chore(docs): Generated API Reference (#2991)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f20cdeb680
commit
3b632c5130
@@ -1,9 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKey.update(publishable_key_id, {
|
||||
medusa.admin.publishableApiKeys.update(publishableApiKeyId, {
|
||||
title: "new title"
|
||||
})
|
||||
.then(({ publishable_api_key }) => {
|
||||
console.log(publishable_api_key.id)
|
||||
})
|
||||
.then(({ publishable_api_key }) => {
|
||||
console.log(publishable_api_key.id)
|
||||
})
|
||||
|
||||
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKeys.list()
|
||||
.then(({ publishable_api_keys }) => {
|
||||
.then(({ publishable_api_keys, count, limit, offset }) => {
|
||||
console.log(publishable_api_keys)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKey.create()
|
||||
.then(({ publishable_api_key }) => {
|
||||
console.log(publishable_api_key.id)
|
||||
})
|
||||
medusa.admin.publishableApiKeys.create({
|
||||
title
|
||||
})
|
||||
.then(({ publishable_api_key }) => {
|
||||
console.log(publishable_api_key.id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKey.delete(key_id)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
medusa.admin.publishableApiKeys.delete(publishableApiKeyId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKey.retrieve(pubKeyId)
|
||||
.then(({ publishable_api_key }) => {
|
||||
console.log(publishable_api_key.id)
|
||||
})
|
||||
medusa.admin.publishableApiKeys.retrieve(publishableApiKeyId)
|
||||
.then(({ publishable_api_key }) => {
|
||||
console.log(publishable_api_key.id)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKey.revoke()
|
||||
medusa.admin.publishableApiKeys.revoke(publishableApiKeyId)
|
||||
.then(({ publishable_api_key }) => {
|
||||
console.log(publishable_api_key.id)
|
||||
})
|
||||
|
||||
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKeys.listSalesChannels()
|
||||
.then(({ sales_channels, limit, offset, count }) => {
|
||||
console.log(sales_channels)
|
||||
.then(({ sales_channels }) => {
|
||||
console.log(sales_channels.length)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKeys.removeSalesChannels(publishableApiKeyId, {
|
||||
medusa.admin.publishableApiKeys.deleteSalesChannelsBatch(publishableApiKeyId, {
|
||||
sales_channel_ids: [
|
||||
{
|
||||
id: channel_id
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.publishableApiKeys.addSalesChannels(publishableApiKeyId, {
|
||||
medusa.admin.publishableApiKeys.addSalesChannelsBatch(publishableApiKeyId, {
|
||||
sales_channel_ids: [
|
||||
{
|
||||
id: channel_id
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{id}' \
|
||||
curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"title": "updated title"
|
||||
"title": "new title"
|
||||
}'
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
-d '{ "created_by": "user_123" }'
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"title": "Web API Key"
|
||||
}'
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{id}' \
|
||||
curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \
|
||||
curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
-d '{ "created_by": "user_123" }'
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' \
|
||||
curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/revoke' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
-d '{ "created_by": "user_123", "revoked_by": "user_123" }'
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' \
|
||||
curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/sales-channels' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \
|
||||
curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/batch' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \
|
||||
curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
|
||||
Reference in New Issue
Block a user