chore(docs): Generated API Reference (#5601)

Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
This commit is contained in:
github-actions[bot]andolivermrbl authored and GitHub committed 2023-11-10 14:27:17 +02:00
1 parent 02e2ee4e8a
commit 01d4047976
496 files changed
+1456 -867

No files matched your search

@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.auth.getSession() medusa.admin.auth.getSession()
.then(({ user }) => { .then(({ user }) => {
console.log(user.id); console.log(user.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.auth.createSession({
}) })
.then(({ user }) => { .then(({ user }) => {
console.log(user.id); console.log(user.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.auth.getToken({
}) })
.then(({ access_token }) => { .then(({ access_token }) => {
console.log(access_token); console.log(access_token);
}); })
@@ -7,4 +7,4 @@ medusa.admin.batchJobs.create({
dry_run: false dry_run: false
}).then((({ batch_job }) => { }).then((({ batch_job }) => {
console.log(batch_job.id); console.log(batch_job.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.batchJobs.retrieve(batchJobId) medusa.admin.batchJobs.retrieve(batchJobId)
.then(({ batch_job }) => { .then(({ batch_job }) => {
console.log(batch_job.id); console.log(batch_job.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.batchJobs.cancel(batchJobId) medusa.admin.batchJobs.cancel(batchJobId)
.then(({ batch_job }) => { .then(({ batch_job }) => {
console.log(batch_job.id); console.log(batch_job.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.batchJobs.confirm(batchJobId) medusa.admin.batchJobs.confirm(batchJobId)
.then(({ batch_job }) => { .then(({ batch_job }) => {
console.log(batch_job.id); console.log(batch_job.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.collections.list() medusa.admin.collections.list()
.then(({ collections, limit, offset, count }) => { .then(({ collections, limit, offset, count }) => {
console.log(collections.length); console.log(collections.length);
}); })
@@ -6,4 +6,4 @@ medusa.admin.collections.create({
}) })
.then(({ collection }) => { .then(({ collection }) => {
console.log(collection.id); console.log(collection.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.collections.delete(collectionId) medusa.admin.collections.delete(collectionId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id); console.log(id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.collections.retrieve(collectionId) medusa.admin.collections.retrieve(collectionId)
.then(({ collection }) => { .then(({ collection }) => {
console.log(collection.id); console.log(collection.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.collections.update(collectionId, {
}) })
.then(({ collection }) => { .then(({ collection }) => {
console.log(collection.id); console.log(collection.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.currencies.list() medusa.admin.currencies.list()
.then(({ currencies, count, offset, limit }) => { .then(({ currencies, count, offset, limit }) => {
console.log(currencies.length); console.log(currencies.length);
}); })
@@ -6,4 +6,4 @@ medusa.admin.currencies.update(code, {
}) })
.then(({ currency }) => { .then(({ currency }) => {
console.log(currency.code); console.log(currency.code);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.customerGroups.list() medusa.admin.customerGroups.list()
.then(({ customer_groups, limit, offset, count }) => { .then(({ customer_groups, limit, offset, count }) => {
console.log(customer_groups.length); console.log(customer_groups.length);
}); })
@@ -6,4 +6,4 @@ medusa.admin.customerGroups.create({
}) })
.then(({ customer_group }) => { .then(({ customer_group }) => {
console.log(customer_group.id); console.log(customer_group.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.customerGroups.delete(customerGroupId) medusa.admin.customerGroups.delete(customerGroupId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id); console.log(id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.customerGroups.retrieve(customerGroupId) medusa.admin.customerGroups.retrieve(customerGroupId)
.then(({ customer_group }) => { .then(({ customer_group }) => {
console.log(customer_group.id); console.log(customer_group.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.customerGroups.update(customerGroupId, {
}) })
.then(({ customer_group }) => { .then(({ customer_group }) => {
console.log(customer_group.id); console.log(customer_group.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.customerGroups.listCustomers(customerGroupId) medusa.admin.customerGroups.listCustomers(customerGroupId)
.then(({ customers }) => { .then(({ customers }) => {
console.log(customers.length); console.log(customers.length);
}); })
@@ -10,4 +10,4 @@ medusa.admin.customerGroups.removeCustomers(customerGroupId, {
}) })
.then(({ customer_group }) => { .then(({ customer_group }) => {
console.log(customer_group.id); console.log(customer_group.id);
}); })
@@ -10,4 +10,4 @@ medusa.admin.customerGroups.addCustomers(customerGroupId, {
}) })
.then(({ customer_group }) => { .then(({ customer_group }) => {
console.log(customer_group.id); console.log(customer_group.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.customers.list() medusa.admin.customers.list()
.then(({ customers, limit, offset, count }) => { .then(({ customers, limit, offset, count }) => {
console.log(customers.length); console.log(customers.length);
}); })
@@ -9,4 +9,4 @@ medusa.admin.customers.create({
}) })
.then(({ customer }) => { .then(({ customer }) => {
console.log(customer.id); console.log(customer.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.customers.retrieve(customerId) medusa.admin.customers.retrieve(customerId)
.then(({ customer }) => { .then(({ customer }) => {
console.log(customer.id); console.log(customer.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.customers.update(customerId, {
}) })
.then(({ customer }) => { .then(({ customer }) => {
console.log(customer.id); console.log(customer.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.list() medusa.admin.discounts.list()
.then(({ discounts, limit, offset, count }) => { .then(({ discounts, limit, offset, count }) => {
console.log(discounts.id); console.log(discounts.id);
}); })
@@ -15,4 +15,4 @@ medusa.admin.discounts.create({
}) })
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.retrieveByCode(code) medusa.admin.discounts.retrieveByCode(code)
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -3,8 +3,9 @@ import { DiscountConditionOperator } from "@medusajs/medusa"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.discounts.createCondition(discountId, { medusa.admin.discounts.createCondition(discountId, {
operator: DiscountConditionOperator.IN operator: DiscountConditionOperator.IN,
products: [productId]
}) })
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.deleteCondition(discountId, conditionId) medusa.admin.discounts.deleteCondition(discountId, conditionId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id); console.log(id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.getCondition(discountId, conditionId) medusa.admin.discounts.getCondition(discountId, conditionId)
.then(({ discount_condition }) => { .then(({ discount_condition }) => {
console.log(discount_condition.id); console.log(discount_condition.id);
}); })
@@ -8,4 +8,4 @@ medusa.admin.discounts.updateCondition(discountId, conditionId, {
}) })
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.discounts.deleteConditionResourceBatch(discountId, conditionId, {
}) })
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.discounts.addConditionResourceBatch(discountId, conditionId, {
}) })
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.delete(discountId) medusa.admin.discounts.delete(discountId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id); console.log(id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.retrieve(discountId) medusa.admin.discounts.retrieve(discountId)
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.discounts.update(discountId, {
}) })
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -7,4 +7,4 @@ medusa.admin.discounts.createDynamicCode(discountId, {
}) })
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.deleteDynamicCode(discountId, code) medusa.admin.discounts.deleteDynamicCode(discountId, code)
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.removeRegion(discountId, regionId) medusa.admin.discounts.removeRegion(discountId, regionId)
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.discounts.addRegion(discountId, regionId) medusa.admin.discounts.addRegion(discountId, regionId)
.then(({ discount }) => { .then(({ discount }) => {
console.log(discount.id); console.log(discount.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.draftOrders.list() medusa.admin.draftOrders.list()
.then(({ draft_orders, limit, offset, count }) => { .then(({ draft_orders, limit, offset, count }) => {
console.log(draft_orders.length); console.log(draft_orders.length);
}); })
@@ -17,4 +17,4 @@ medusa.admin.draftOrders.create({
}) })
.then(({ draft_order }) => { .then(({ draft_order }) => {
console.log(draft_order.id); console.log(draft_order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.draftOrders.delete(draftOrderId) medusa.admin.draftOrders.delete(draftOrderId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id); console.log(id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.draftOrders.retrieve(draftOrderId) medusa.admin.draftOrders.retrieve(draftOrderId)
.then(({ draft_order }) => { .then(({ draft_order }) => {
console.log(draft_order.id); console.log(draft_order.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.draftOrders.update(draftOrderId, {
}) })
.then(({ draft_order }) => { .then(({ draft_order }) => {
console.log(draft_order.id); console.log(draft_order.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.draftOrders.addLineItem(draftOrderId, {
}) })
.then(({ draft_order }) => { .then(({ draft_order }) => {
console.log(draft_order.id); console.log(draft_order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.draftOrders.removeLineItem(draftOrderId, itemId) medusa.admin.draftOrders.removeLineItem(draftOrderId, itemId)
.then(({ draft_order }) => { .then(({ draft_order }) => {
console.log(draft_order.id); console.log(draft_order.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.draftOrders.updateLineItem(draftOrderId, lineId, {
}) })
.then(({ draft_order }) => { .then(({ draft_order }) => {
console.log(draft_order.id); console.log(draft_order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.draftOrders.markPaid(draftOrderId) medusa.admin.draftOrders.markPaid(draftOrderId)
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.giftCards.list() medusa.admin.giftCards.list()
.then(({ gift_cards, limit, offset, count }) => { .then(({ gift_cards, limit, offset, count }) => {
console.log(gift_cards.length); console.log(gift_cards.length);
}); })
@@ -6,4 +6,4 @@ medusa.admin.giftCards.create({
}) })
.then(({ gift_card }) => { .then(({ gift_card }) => {
console.log(gift_card.id); console.log(gift_card.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.giftCards.delete(giftCardId) medusa.admin.giftCards.delete(giftCardId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id); console.log(id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.giftCards.retrieve(giftCardId) medusa.admin.giftCards.retrieve(giftCardId)
.then(({ gift_card }) => { .then(({ gift_card }) => {
console.log(gift_card.id); console.log(gift_card.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.giftCards.update(giftCardId, {
}) })
.then(({ gift_card }) => { .then(({ gift_card }) => {
console.log(gift_card.id); console.log(gift_card.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.inventoryItems.list() medusa.admin.inventoryItems.list()
.then(({ inventory_items, count, offset, limit }) => { .then(({ inventory_items, count, offset, limit }) => {
console.log(inventory_items.length); console.log(inventory_items.length);
}); })
@@ -6,4 +6,4 @@ medusa.admin.inventoryItems.create({
}) })
.then(({ inventory_item }) => { .then(({ inventory_item }) => {
console.log(inventory_item.id); console.log(inventory_item.id);
}); })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.inventoryItems.delete(inventoryItemId) medusa.admin.inventoryItems.delete(inventoryItemId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id) console.log(id)
}) })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.inventoryItems.retrieve(inventoryItemId) medusa.admin.inventoryItems.retrieve(inventoryItemId)
.then(({ inventory_item }) => { .then(({ inventory_item }) => {
console.log(inventory_item.id); console.log(inventory_item.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.inventoryItems.update(inventoryItemId, {
}) })
.then(({ inventory_item }) => { .then(({ inventory_item }) => {
console.log(inventory_item.id); console.log(inventory_item.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.inventoryItems.listLocationLevels(inventoryItemId) medusa.admin.inventoryItems.listLocationLevels(inventoryItemId)
.then(({ inventory_item }) => { .then(({ inventory_item }) => {
console.log(inventory_item.location_levels); console.log(inventory_item.location_levels);
}); })
@@ -7,4 +7,4 @@ medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, {
}) })
.then(({ inventory_item }) => { .then(({ inventory_item }) => {
console.log(inventory_item.id); console.log(inventory_item.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, locationId) medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, locationId)
.then(({ inventory_item }) => { .then(({ inventory_item }) => {
console.log(inventory_item.id); console.log(inventory_item.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, locationId, {
}) })
.then(({ inventory_item }) => { .then(({ inventory_item }) => {
console.log(inventory_item.id); console.log(inventory_item.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.invites.list() medusa.admin.invites.list()
.then(({ invites }) => { .then(({ invites }) => {
console.log(invites.length); console.log(invites.length);
}); })
@@ -10,4 +10,4 @@ medusa.admin.invites.create({
}) })
.catch(() => { .catch(() => {
// an error occurred // an error occurred
}); })
@@ -14,4 +14,4 @@ medusa.admin.invites.accept({
}) })
.catch(() => { .catch(() => {
// an error occurred // an error occurred
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.invites.delete(inviteId) medusa.admin.invites.delete(inviteId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id); console.log(id);
}); })
@@ -7,4 +7,4 @@ medusa.admin.invites.resend(inviteId)
}) })
.catch(() => { .catch(() => {
// an error occurred // an error occurred
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.notes.list() medusa.admin.notes.list()
.then(({ notes, limit, offset, count }) => { .then(({ notes, limit, offset, count }) => {
console.log(notes.length); console.log(notes.length);
}); })
@@ -8,4 +8,4 @@ medusa.admin.notes.create({
}) })
.then(({ note }) => { .then(({ note }) => {
console.log(note.id); console.log(note.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.notes.delete(noteId) medusa.admin.notes.delete(noteId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id); console.log(id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.notes.retrieve(noteId) medusa.admin.notes.retrieve(noteId)
.then(({ note }) => { .then(({ note }) => {
console.log(note.id); console.log(note.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.notes.update(noteId, {
}) })
.then(({ note }) => { .then(({ note }) => {
console.log(note.id); console.log(note.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.notifications.list() medusa.admin.notifications.list()
.then(({ notifications }) => { .then(({ notifications }) => {
console.log(notifications.length); console.log(notifications.length);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.notifications.resend(notificationId) medusa.admin.notifications.resend(notificationId)
.then(({ notification }) => { .then(({ notification }) => {
console.log(notification.id); console.log(notification.id);
}); })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.list() medusa.admin.orderEdits.list()
.then(({ order_edits, count, limit, offset }) => { .then(({ order_edits, count, limit, offset }) => {
console.log(order_edits.length) console.log(order_edits.length)
}) })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.create({ orderId }) medusa.admin.orderEdits.create({ orderId })
.then(({ order_edit }) => { .then(({ order_edit }) => {
console.log(order_edit.id) console.log(order_edit.id)
}) })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.delete(orderEditId) medusa.admin.orderEdits.delete(orderEditId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id) console.log(id)
}) })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.retrieve(orderEditId) medusa.admin.orderEdits.retrieve(orderEditId)
.then(({ order_edit }) => { .then(({ order_edit }) => {
console.log(order_edit.id) console.log(order_edit.id)
}) })
@@ -4,6 +4,6 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.orderEdits.update(orderEditId, { medusa.admin.orderEdits.update(orderEditId, {
internal_note: "internal reason XY" internal_note: "internal reason XY"
}) })
.then(({ order_edit }) => { .then(({ order_edit }) => {
console.log(order_edit.id) console.log(order_edit.id)
}) })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.cancel(orderEditId) medusa.admin.orderEdits.cancel(orderEditId)
.then(({ order_edit }) => { .then(({ order_edit }) => {
console.log(order_edit.id) console.log(order_edit.id)
}) })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.deleteItemChange(orderEdit_id, itemChangeId) medusa.admin.orderEdits.deleteItemChange(orderEdit_id, itemChangeId)
.then(({ id, object, deleted }) => { .then(({ id, object, deleted }) => {
console.log(id) console.log(id)
}) })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.confirm(orderEditId) medusa.admin.orderEdits.confirm(orderEditId)
.then(({ order_edit }) => { .then(({ order_edit }) => {
console.log(order_edit.id) console.log(order_edit.id)
}) })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.removeLineItem(orderEditId, lineItemId) medusa.admin.orderEdits.removeLineItem(orderEditId, lineItemId)
.then(({ order_edit }) => { .then(({ order_edit }) => {
console.log(order_edit.id) console.log(order_edit.id)
}) })
@@ -2,8 +2,8 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.updateLineItem(orderEditId, lineItemId, { medusa.admin.orderEdits.updateLineItem(orderEditId, lineItemId, {
quantity: 5 quantity: 5
}) })
.then(({ order_edit }) => { .then(({ order_edit }) => {
console.log(order_edit.id) console.log(order_edit.id)
}) })
@@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
// must be previously logged in or use api token // must be previously logged in or use api token
medusa.admin.orderEdits.requestConfirmation(orderEditId) medusa.admin.orderEdits.requestConfirmation(orderEditId)
.then({ order_edit }) => { .then({ order_edit }) => {
console.log(order_edit.id) console.log(order_edit.id)
}) })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.orders.list() medusa.admin.orders.list()
.then(({ orders, limit, offset, count }) => { .then(({ orders, limit, offset, count }) => {
console.log(orders.length); console.log(orders.length);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.orders.retrieve(orderId) medusa.admin.orders.retrieve(orderId)
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.orders.update(orderId, {
}) })
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.orders.archive(orderId) medusa.admin.orders.archive(orderId)
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.orders.cancel(orderId) medusa.admin.orders.cancel(orderId)
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.orders.capturePayment(orderId) medusa.admin.orders.capturePayment(orderId)
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -12,4 +12,4 @@ medusa.admin.orders.createClaim(orderId, {
}) })
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.orders.updateClaim(orderId, claimId, {
}) })
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.orders.cancelClaim(orderId, claimId) medusa.admin.orders.cancelClaim(orderId, claimId)
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -5,4 +5,4 @@ medusa.admin.orders.fulfillClaim(orderId, claimId, {
}) })
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.admin.orders.cancelClaimFulfillment(orderId, claimId, fulfillmentId) medusa.admin.orders.cancelClaimFulfillment(orderId, claimId, fulfillmentId)
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
@@ -6,4 +6,4 @@ medusa.admin.orders.createClaimShipment(orderId, claimId, {
}) })
.then(({ order }) => { .then(({ order }) => {
console.log(order.id); console.log(order.id);
}); })
Loaded 100 of 496 files, more files were not shown because too many files have changed in this diff. Show more