diff --git a/www/apps/resources/.content.eslintrc.mjs b/www/apps/resources/.content.eslintrc.mjs index beafbafb09..89e64e6728 100644 --- a/www/apps/resources/.content.eslintrc.mjs +++ b/www/apps/resources/.content.eslintrc.mjs @@ -22,7 +22,8 @@ export default [ ignores: [ "**/references/**/*", "**/events-reference/**/*", - "**/_events-table/**/*", + "**/events/_content/**/*", + "**/events/_content.mdx", ], }, { diff --git a/www/apps/resources/app/admin-components/components/table/page.mdx b/www/apps/resources/app/admin-components/components/table/page.mdx index 65337762ea..411fe15512 100644 --- a/www/apps/resources/app/admin-components/components/table/page.mdx +++ b/www/apps/resources/app/admin-components/components/table/page.mdx @@ -281,7 +281,7 @@ const CustomPage = () => { const { data } = useQuery({ queryFn: () => sdk.admin.product.list({ limit, - offset + offset, }), queryKey: [["products", limit, offset]], }) @@ -325,12 +325,12 @@ return ( columns={[ { key: "id", - label: "ID" + label: "ID", }, { key: "title", - label: "Title" - } + label: "Title", + }, ]} data={data.products as any} pageSize={data.limit} diff --git a/www/apps/resources/app/commerce-modules/auth/events/_content.mdx b/www/apps/resources/app/commerce-modules/auth/events/_content.mdx new file mode 100644 index 0000000000..9b645dc463 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/auth/events/_content.mdx @@ -0,0 +1,36 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `auth.password_reset` + + + + + Emitted when a password of a user, customer, or other actor types is reset. + + + + +```ts blockStyle="inline" +{ + entity_id, // The user's identifier, such as their email + token, // The reset token + actor_type // `user`, `customer`, or custom type +} +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/auth/events/page.mdx b/www/apps/resources/app/commerce-modules/auth/events/page.mdx new file mode 100644 index 0000000000..3a571caaba --- /dev/null +++ b/www/apps/resources/app/commerce-modules/auth/events/page.mdx @@ -0,0 +1,11 @@ +import Content from "./_content.mdx" + +export const metadata = { + title: `Auth Module Events Reference`, +} + +# {metadata.title} + +This reference shows all the events emitted by the Medusa application related to the Auth Module. If you use the module outside the Medusa application, these events aren't emitted. + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/cart/events/_content.mdx b/www/apps/resources/app/commerce-modules/cart/events/_content.mdx new file mode 100644 index 0000000000..234872f864 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/cart/events/_content.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `cart.created` + + + + + Emitted when a cart is created. + + + + +```ts blockStyle="inline" +{ + id, // The ID of the cart +} +``` + + + + + + + `cart.updated` + + + + + Emitted when a cart is updated. This includes updates to its items, shipping methods, or information. + + + + +```ts blockStyle="inline" +{ + id, // The ID of the customer +} +``` + + + + + + + `cart.region_updated` + + + + + Emitted when the region of a cart is updated. + + + + +```ts blockStyle="inline" +{ + id, // The ID of the customer +} +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/cart/events/page.mdx b/www/apps/resources/app/commerce-modules/cart/events/page.mdx new file mode 100644 index 0000000000..5ddc561cf0 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/cart/events/page.mdx @@ -0,0 +1,11 @@ +import Content from "./_content.mdx" + +export const metadata = { + title: `Cart Module Events Reference`, +} + +# {metadata.title} + +This reference shows all the events emitted by the Medusa application related to the Cart Module. If you use the module outside the Medusa application, these events aren't emitted. + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/customer/events/_content.mdx b/www/apps/resources/app/commerce-modules/customer/events/_content.mdx new file mode 100644 index 0000000000..69e43fe809 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/customer/events/_content.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `customer.created` + + + + + Emitted when customers are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the customer +}] +``` + + + + + + + `customer.updated` + + + + + Emitted when customers are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the customer +}] +``` + + + + + + + `customer.deleted` + + + + + Emitted when customers are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the customer +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/customer/events/page.mdx b/www/apps/resources/app/commerce-modules/customer/events/page.mdx new file mode 100644 index 0000000000..35ff76a89e --- /dev/null +++ b/www/apps/resources/app/commerce-modules/customer/events/page.mdx @@ -0,0 +1,11 @@ +import Content from "./_content.mdx" + +export const metadata = { + title: `Customer Module Events Reference`, +} + +# {metadata.title} + +This reference shows all the events emitted by the Medusa application related to the Customer Module. If you use the module outside the Medusa application, these events aren't emitted. + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/order/events/_content.mdx b/www/apps/resources/app/commerce-modules/order/events/_content.mdx new file mode 100644 index 0000000000..f51d4aae58 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/order/events/_content.mdx @@ -0,0 +1,251 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `order.placed` + + + + + Emitted when the customer completes a cart and an order is placed. + + + + +```ts blockStyle="inline" +{ + id, // The ID of the order +} +``` + + + + + + + `order.canceled` + + + + + Emitted when an order is canceled. + + + + +```ts blockStyle="inline" +{ + id, // The ID of the order +} +``` + + + + + + + `order.completed` + + + + + Emitted when orders are completed. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the order +}] +``` + + + + + + + `order.archived` + + + + + Emitted when orders are archived. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the order +}] +``` + + + + + + + `order.fulfillment_created` + + + + + Emitted when a fulfillment is created for an order. + + + + +```ts blockStyle="inline" +{ + order_id, // The ID of the order + fulfillment_id, // The ID of the fulfillment +} +``` + + + + + + + `order.fulfillment_canceled` + + + + + Emitted when a fulfillment is canceled for an order. + + + + +```ts blockStyle="inline" +{ + order_id, // The ID of the order + fulfillment_id, // The ID of the fulfillment +} +``` + + + + + + + `order.return_requested` + + + + + Emitted when a return is requested. + + + + +```ts blockStyle="inline" +{ + order_id, // The ID of the order + return_id, // The ID of the return +} +``` + + + + + + + `order.return_received` + + + + + Emitted when a return is received. + + + + +```ts blockStyle="inline" +{ + order_id, // The ID of the order + return_id, // The ID of the return +} +``` + + + + + + + `order.claim_created` + + + + + Emitted when a claim is created. + + + + +```ts blockStyle="inline" +{ + order_id, // The ID of the order + claim_id, // The ID of the claim +} +``` + + + + + + + `order.exchange_created` + + + + + Emitted when an exchange is created. + + + + +```ts blockStyle="inline" +{ + order_id, // The ID of the order + exchange_id, // The ID of the exchange +} +``` + + + + + + + `order.transfer_requested` + + + + + Emitted when an order transfer is requested. This is available from [Medusa v2.0.5+](https://github.com/medusajs/medusa/releases/tag/v2.0.5). + + + + +```ts blockStyle="inline" +{ + order_id, // The ID of the order + exchange_id, // The ID of the exchange +} +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/order/events/page.mdx b/www/apps/resources/app/commerce-modules/order/events/page.mdx new file mode 100644 index 0000000000..0078b870d0 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/order/events/page.mdx @@ -0,0 +1,11 @@ +import Content from "./_content.mdx" + +export const metadata = { + title: `Order Module Events Reference`, +} + +# {metadata.title} + +This reference shows all the events emitted by the Medusa application related to the Order Module. If you use the module outside the Medusa application, these events aren't emitted. + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/events/_content/product-category.mdx b/www/apps/resources/app/commerce-modules/product/events/_content/product-category.mdx new file mode 100644 index 0000000000..875f862e8c --- /dev/null +++ b/www/apps/resources/app/commerce-modules/product/events/_content/product-category.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `product-category.created` + + + + + Emitted when product categories are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the category +}] +``` + + + + + + + `product-category.updated` + + + + + Emitted when product categories are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the category +}] +``` + + + + + + + `product-category.deleted` + + + + + Emitted when product categories are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the category +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/events/_content/product-collection.mdx b/www/apps/resources/app/commerce-modules/product/events/_content/product-collection.mdx new file mode 100644 index 0000000000..fe9d7b8070 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/product/events/_content/product-collection.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `product-collection.created` + + + + + Emitted when product collections are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the collection +}] +``` + + + + + + + `product-collection.updated` + + + + + Emitted when product collections are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the collection +}] +``` + + + + + + + `product-collection.deleted` + + + + + Emitted when product collections are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the collection +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/events/_content/product-option.mdx b/www/apps/resources/app/commerce-modules/product/events/_content/product-option.mdx new file mode 100644 index 0000000000..9d612ec87c --- /dev/null +++ b/www/apps/resources/app/commerce-modules/product/events/_content/product-option.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `product-option.created` + + + + + Emitted when product options are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the option +}] +``` + + + + + + + `product-option.updated` + + + + + Emitted when product options are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the option +}] +``` + + + + + + + `product-option.deleted` + + + + + Emitted when product options are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the option +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/events/_content/product-tag.mdx b/www/apps/resources/app/commerce-modules/product/events/_content/product-tag.mdx new file mode 100644 index 0000000000..8bb8f3dc94 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/product/events/_content/product-tag.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `product-tag.created` + + + + + Emitted when product tags are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the tag +}] +``` + + + + + + + `product-tag.updated` + + + + + Emitted when product tags are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the tag +}] +``` + + + + + + + `product-tag.deleted` + + + + + Emitted when product tags are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the tag +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/events/_content/product-type.mdx b/www/apps/resources/app/commerce-modules/product/events/_content/product-type.mdx new file mode 100644 index 0000000000..70f3538eba --- /dev/null +++ b/www/apps/resources/app/commerce-modules/product/events/_content/product-type.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `product-type.created` + + + + + Emitted when product types are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the type +}] +``` + + + + + + + `product-type.updated` + + + + + Emitted when product types are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the type +}] +``` + + + + + + + `product-type.deleted` + + + + + Emitted when product types are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the type +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/events/_content/product-variant.mdx b/www/apps/resources/app/commerce-modules/product/events/_content/product-variant.mdx new file mode 100644 index 0000000000..a1e439a633 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/product/events/_content/product-variant.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `product-variant.created` + + + + + Emitted when product variants are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the variant +}] +``` + + + + + + + `product-variant.updated` + + + + + Emitted when product variants are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the variant +}] +``` + + + + + + + `product-variant.deleted` + + + + + Emitted when product variants are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the variant +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/events/_content/product.mdx b/www/apps/resources/app/commerce-modules/product/events/_content/product.mdx new file mode 100644 index 0000000000..2bb2832732 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/product/events/_content/product.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `product.created` + + + + + Emitted when products are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the product +}] +``` + + + + + + + `product.updated` + + + + + Emitted when products are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the product +}] +``` + + + + + + + `product.deleted` + + + + + Emitted when products are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the product +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/events/page.mdx b/www/apps/resources/app/commerce-modules/product/events/page.mdx new file mode 100644 index 0000000000..ed952532c2 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/product/events/page.mdx @@ -0,0 +1,55 @@ +import ProductEvents from "./_content/product.mdx" +import ProductCategoryEvents from "./_content/product-category.mdx" +import ProductCollectionEvents from "./_content/product-collection.mdx" +import ProductOptionEvents from "./_content/product-option.mdx" +import ProductTagEvents from "./_content/product-tag.mdx" +import ProductTypeEvents from "./_content/product-type.mdx" +import ProductVariantEvents from "./_content/product-variant.mdx" + +export const metadata = { + title: `Product Module Events Reference`, +} + +# {metadata.title} + +This reference shows all the events emitted by the Medusa application related to the Product Module. If you use the module outside the Medusa application, these events aren't emitted. + +## Product Events + + + +--- + +## Product Category Events + + + +--- + +## Product Collection Events + + + +--- + +## Product Option Events + + + +--- + +## Product Tag Events + + + +--- + +## Product Type Events + + + +--- + +## Product Variant Events + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/region/events/_content.mdx b/www/apps/resources/app/commerce-modules/region/events/_content.mdx new file mode 100644 index 0000000000..5a40a112fc --- /dev/null +++ b/www/apps/resources/app/commerce-modules/region/events/_content.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `region.created` + + + + + Emitted when regions are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the region +}] +``` + + + + + + + `region.updated` + + + + + Emitted when regions are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the region +}] +``` + + + + + + + `region.deleted` + + + + + Emitted when regions are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the region +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/region/events/page.mdx b/www/apps/resources/app/commerce-modules/region/events/page.mdx new file mode 100644 index 0000000000..2cf19939d6 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/region/events/page.mdx @@ -0,0 +1,11 @@ +import Content from "./_content.mdx" + +export const metadata = { + title: `Region Module Events Reference`, +} + +# {metadata.title} + +This reference shows all the events emitted by the Medusa application related to the Region Module. If you use the module outside the Medusa application, these events aren't emitted. + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/sales-channel/events/_content.mdx b/www/apps/resources/app/commerce-modules/sales-channel/events/_content.mdx new file mode 100644 index 0000000000..fbd45b84a6 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/sales-channel/events/_content.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `sales-channel.created` + + + + + Emitted when sales channels are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the sales channel +}] +``` + + + + + + + `sales-channel.updated` + + + + + Emitted when sales channels are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the sales channel +}] +``` + + + + + + + `sales-channel.deleted` + + + + + Emitted when sales channels are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the sales channel +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/sales-channel/events/page.mdx b/www/apps/resources/app/commerce-modules/sales-channel/events/page.mdx new file mode 100644 index 0000000000..0de96f43c3 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/sales-channel/events/page.mdx @@ -0,0 +1,11 @@ +import Content from "./_content.mdx" + +export const metadata = { + title: `Sales Channel Module Events Reference`, +} + +# {metadata.title} + +This reference shows all the events emitted by the Medusa application related to the Sales Channel Module. If you use the module outside the Medusa application, these events aren't emitted. + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/user/events/_content/invite.mdx b/www/apps/resources/app/commerce-modules/user/events/_content/invite.mdx new file mode 100644 index 0000000000..0552b8e732 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/user/events/_content/invite.mdx @@ -0,0 +1,97 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `invite.accepted` + + + + + Emitted when an invite is accepted. + + + + +```ts blockStyle="inline" +{ + id, // The ID of the invite +} +``` + + + + + + + `invite.created` + + + + + Emitted when invites are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the invite +}] +``` + + + + + + + `invite.deleted` + + + + + Emitted when invites are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the invite +}] +``` + + + + + + + `invite.resent` + + + + + Emitted when invites are resent. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the invite +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/user/events/_content/user.mdx b/www/apps/resources/app/commerce-modules/user/events/_content/user.mdx new file mode 100644 index 0000000000..0459869798 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/user/events/_content/user.mdx @@ -0,0 +1,76 @@ +import { Table } from "docs-ui" + + + + + Event Name + Description + Payload + + + + + + + `user.created` + + + + + Emitted when users are created. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the user +}] +``` + + + + + + + `user.updated` + + + + + Emitted when users are updated. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the user +}] +``` + + + + + + + `user.deleted` + + + + + Emitted when users are deleted. + + + + +```ts blockStyle="inline" +[{ + id, // The ID of the user +}] +``` + + + + +
\ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/user/events/page.mdx b/www/apps/resources/app/commerce-modules/user/events/page.mdx new file mode 100644 index 0000000000..e754a49d49 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/user/events/page.mdx @@ -0,0 +1,20 @@ +import InviteEvents from "./_content/invite.mdx" +import UserEvents from "./_content/user.mdx" + +export const metadata = { + title: `User Module Events Reference`, +} + +# {metadata.title} + +This reference shows all the events emitted by the Medusa application related to the User Module. If you use the module outside the Medusa application, these events aren't emitted. + +## Invite Events + + + +--- + +## User Events + + \ No newline at end of file diff --git a/www/apps/resources/app/events-reference/page.mdx b/www/apps/resources/app/events-reference/page.mdx index 9ac0affa32..7d0a0b54e8 100644 --- a/www/apps/resources/app/events-reference/page.mdx +++ b/www/apps/resources/app/events-reference/page.mdx @@ -1,4 +1,19 @@ import { Table } from "docs-ui" +import AuthEvents from "../commerce-modules/auth/events/_content.mdx" +import CartEvents from "../commerce-modules/cart/events/_content.mdx" +import CustomerEvents from "../commerce-modules/customer/events/_content.mdx" +import InviteEvents from "../commerce-modules/user/events/_content/invite.mdx" +import OrderEvents from "../commerce-modules/order/events/_content.mdx" +import ProductEvents from "../commerce-modules/product/events/_content/product.mdx" +import ProductCategoryEvents from "../commerce-modules/product/events/_content/product-category.mdx" +import ProductCollectionEvents from "../commerce-modules/product/events/_content/product-collection.mdx" +import ProductOptionEvents from "../commerce-modules/product/events/_content/product-option.mdx" +import ProductTagEvents from "../commerce-modules/product/events/_content/product-tag.mdx" +import ProductTypeEvents from "../commerce-modules/product/events/_content/product-type.mdx" +import ProductVariantEvents from "../commerce-modules/product/events/_content/product-variant.mdx" +import RegionEvents from "../commerce-modules/region/events/_content.mdx" +import SalesChannelEvents from "../commerce-modules/sales-channel/events/_content.mdx" +import UserEvents from "../commerce-modules/user/events/_content/user.mdx" export const metadata = { title: `Events Reference`, @@ -10,1339 +25,88 @@ This documentation page includes the list of all events emitted by [Medusa's wor ## Auth Events - - - - Event Name - Description - Payload - - - - - - - `auth.password_reset` - - - - - Emitted when a password of a user, customer, or other actor types is reset. - - - - -```ts blockStyle="inline" -{ - entity_id, // The user's identifier, such as their email - token, // The reset token - actor_type // `user`, `customer`, or custom type -} -``` - - - - -
+ --- ## Cart Events - - - - Event Name - Description - Payload - - - - - - - `cart.created` - - - - - Emitted when a cart is created. - - - - -```ts blockStyle="inline" -{ - id, // The ID of the cart -} -``` - - - - - - - `cart.updated` - - - - - Emitted when a cart is updated. This includes updates to its items, shipping methods, or information. - - - - -```ts blockStyle="inline" -{ - id, // The ID of the customer -} -``` - - - - - - - `cart.region_updated` - - - - - Emitted when the region of a cart is updated. - - - - -```ts blockStyle="inline" -{ - id, // The ID of the customer -} -``` - - - - -
+ --- ## Customer Events - - - - Event Name - Description - Payload - - - - - - - `customer.created` - - - - - Emitted when customers are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the customer -}] -``` - - - - - - - `customer.updated` - - - - - Emitted when customers are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the customer -}] -``` - - - - - - - `customer.deleted` - - - - - Emitted when customers are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the customer -}] -``` - - - - -
+ --- ## Invite Events - - - - Event Name - Description - Payload - - - - - - - `invite.accepted` - - - - - Emitted when an invite is accepted. - - - - -```ts blockStyle="inline" -{ - id, // The ID of the invite -} -``` - - - - - - - `invite.created` - - - - - Emitted when invites are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the invite -}] -``` - - - - - - - `invite.deleted` - - - - - Emitted when invites are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the invite -}] -``` - - - - - - - `invite.resent` - - - - - Emitted when invites are resent. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the invite -}] -``` - - - - -
+ --- ## Order Events - - - - Event Name - Description - Payload - - - - - - - `order.placed` - - - - - Emitted when the customer completes a cart and an order is placed. - - - - -```ts blockStyle="inline" -{ - id, // The ID of the order -} -``` - - - - - - - `order.canceled` - - - - - Emitted when an order is canceled. - - - - -```ts blockStyle="inline" -{ - id, // The ID of the order -} -``` - - - - - - - `order.completed` - - - - - Emitted when orders are completed. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the order -}] -``` - - - - - - - `order.archived` - - - - - Emitted when orders are archived. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the order -}] -``` - - - - - - - `order.fulfillment_created` - - - - - Emitted when a fulfillment is created for an order. - - - - -```ts blockStyle="inline" -{ - order_id, // The ID of the order - fulfillment_id, // The ID of the fulfillment -} -``` - - - - - - - `order.fulfillment_canceled` - - - - - Emitted when a fulfillment is canceled for an order. - - - - -```ts blockStyle="inline" -{ - order_id, // The ID of the order - fulfillment_id, // The ID of the fulfillment -} -``` - - - - - - - `order.return_requested` - - - - - Emitted when a return is requested. - - - - -```ts blockStyle="inline" -{ - order_id, // The ID of the order - return_id, // The ID of the return -} -``` - - - - - - - `order.return_received` - - - - - Emitted when a return is received. - - - - -```ts blockStyle="inline" -{ - order_id, // The ID of the order - return_id, // The ID of the return -} -``` - - - - - - - `order.claim_created` - - - - - Emitted when a claim is created. - - - - -```ts blockStyle="inline" -{ - order_id, // The ID of the order - claim_id, // The ID of the claim -} -``` - - - - - - - `order.exchange_created` - - - - - Emitted when an exchange is created. - - - - -```ts blockStyle="inline" -{ - order_id, // The ID of the order - exchange_id, // The ID of the exchange -} -``` - - - - - - - `order.transfer_requested` - - - - - Emitted when an order transfer is requested. This is available from [Medusa v2.0.5+](https://github.com/medusajs/medusa/releases/tag/v2.0.5). - - - - -```ts blockStyle="inline" -{ - order_id, // The ID of the order - exchange_id, // The ID of the exchange -} -``` - - - - -
+ --- ## Product Events - - - - Event Name - Description - Payload - - - - - - - `product.created` - - - - - Emitted when products are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the product -}] -``` - - - - - - - `product.updated` - - - - - Emitted when products are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the product -}] -``` - - - - - - - `product.deleted` - - - - - Emitted when products are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the product -}] -``` - - - - -
+ --- ## Product Category Events - - - - Event Name - Description - Payload - - - - - - - `product-category.created` - - - - - Emitted when product categories are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the category -}] -``` - - - - - - - `product-category.updated` - - - - - Emitted when product categories are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the category -}] -``` - - - - - - - `product-category.deleted` - - - - - Emitted when product categories are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the category -}] -``` - - - - -
+ --- ## Product Collection Events - - - - Event Name - Description - Payload - - - - - - - `product-collection.created` - - - - - Emitted when product collections are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the collection -}] -``` - - - - - - - `product-collection.updated` - - - - - Emitted when product collections are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the collection -}] -``` - - - - - - - `product-collection.deleted` - - - - - Emitted when product collections are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the collection -}] -``` - - - - -
+ --- ## Product Option Events - - - - Event Name - Description - Payload - - - - - - - `product-option.created` - - - - - Emitted when product options are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the option -}] -``` - - - - - - - `product-option.updated` - - - - - Emitted when product options are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the option -}] -``` - - - - - - - `product-option.deleted` - - - - - Emitted when product options are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the option -}] -``` - - - - -
+ --- ## Product Tag Events - - - - Event Name - Description - Payload - - - - - - - `product-tag.created` - - - - - Emitted when product tags are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the tag -}] -``` - - - - - - - `product-tag.updated` - - - - - Emitted when product tags are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the tag -}] -``` - - - - - - - `product-tag.deleted` - - - - - Emitted when product tags are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the tag -}] -``` - - - - -
+ --- ## Product Type Events - - - - Event Name - Description - Payload - - - - - - - `product-type.created` - - - - - Emitted when product types are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the type -}] -``` - - - - - - - `product-type.updated` - - - - - Emitted when product types are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the type -}] -``` - - - - - - - `product-type.deleted` - - - - - Emitted when product types are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the type -}] -``` - - - - -
+ --- ## Product Variant Events - - - - Event Name - Description - Payload - - - - - - - `product-variant.created` - - - - - Emitted when product variants are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the variant -}] -``` - - - - - - - `product-variant.updated` - - - - - Emitted when product variants are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the variant -}] -``` - - - - - - - `product-variant.deleted` - - - - - Emitted when product variants are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the variant -}] -``` - - - - -
+ --- ## Region Events - - - - Event Name - Description - Payload - - - - - - - `region.created` - - - - - Emitted when regions are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the region -}] -``` - - - - - - - `region.updated` - - - - - Emitted when regions are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the region -}] -``` - - - - - - - `region.deleted` - - - - - Emitted when regions are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the region -}] -``` - - - - -
+ --- ## Sales Channel Events - - - - Event Name - Description - Payload - - - - - - - `sales-channel.created` - - - - - Emitted when sales channels are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the sales channel -}] -``` - - - - - - - `sales-channel.updated` - - - - - Emitted when sales channels are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the sales channel -}] -``` - - - - - - - `sales-channel.deleted` - - - - - Emitted when sales channels are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the sales channel -}] -``` - - - - -
+ --- ## User Events - - - - Event Name - Description - Payload - - - - - - - `user.created` - - - - - Emitted when users are created. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the user -}] -``` - - - - - - - `user.updated` - - - - - Emitted when users are updated. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the user -}] -``` - - - - - - - `user.deleted` - - - - - Emitted when users are deleted. - - - - -```ts blockStyle="inline" -[{ - id, // The ID of the user -}] -``` - - - - -
+ diff --git a/www/apps/resources/app/integrations/guides/shipstation/page.mdx b/www/apps/resources/app/integrations/guides/shipstation/page.mdx index 1d53f56e7f..59e8054643 100644 --- a/www/apps/resources/app/integrations/guides/shipstation/page.mdx +++ b/www/apps/resources/app/integrations/guides/shipstation/page.mdx @@ -247,9 +247,9 @@ export class ShipStationClient { ...data, headers: { ...data?.headers, - 'api-key': this.options.api_key, - "Content-Type": "application/json" - } + "api-key": this.options.api_key, + "Content-Type": "application/json", + }, }).then((resp) => { const contentType = resp.headers.get("content-type") if (!contentType?.includes("application/json")) { @@ -416,7 +416,7 @@ class ShipStationProviderService extends AbstractFulfillmentProviderService { id: `${carrier.carrier_id}__${service.service_code}`, name: service.name, carrier_id: carrier.carrier_id, - carrier_service_code: service.service_code + carrier_service_code: service.service_code, }) }) }) @@ -606,7 +606,7 @@ export class ShipStationClient { ): Promise { return await this.sendRequest("/rates", { method: "POST", - body: JSON.stringify(data) + body: JSON.stringify(data), }).then((resp) => { if (resp.rate_response.errors?.length) { throw new MedusaError( @@ -643,7 +643,7 @@ export const serviceHighlights8 = [ // other imports... import { // ... - MedusaError + MedusaError, } from "@medusajs/framework/utils" import { // ... @@ -651,7 +651,7 @@ import { } from "@medusajs/framework/types" import { GetShippingRatesResponse, - ShipStationAddress + ShipStationAddress, } from "./types" class ShipStationProviderService extends AbstractFulfillmentProviderService { @@ -662,7 +662,7 @@ class ShipStationProviderService extends AbstractFulfillmentProviderService { from_address, to_address, items, - currency_code + currency_code, }: { carrier_id: string carrier_service_code: string @@ -692,7 +692,7 @@ class ShipStationProviderService extends AbstractFulfillmentProviderService { state_province: from_address?.address?.province || "", postal_code: from_address?.address?.postal_code || "", country_code: from_address?.address?.country_code || "", - address_residential_indicator: "unknown" + address_residential_indicator: "unknown", } if (!to_address) { throw new MedusaError( @@ -709,7 +709,7 @@ class ShipStationProviderService extends AbstractFulfillmentProviderService { state_province: to_address.province || "", postal_code: to_address.postal_code || "", country_code: to_address.country_code || "", - address_residential_indicator: "unknown" + address_residential_indicator: "unknown", } // TODO create shipment @@ -748,24 +748,24 @@ return await this.client.getShippingRates({ items: items?.map((item) => ({ name: item.title, quantity: item.quantity, - sku: item.variant_sku || "" + sku: item.variant_sku || "", })), packages: [{ weight: { value: packageWeight, - unit: "kilogram" - } + unit: "kilogram", + }, }], customs: { contents: "merchandise", - non_delivery: "return_to_sender" - } + non_delivery: "return_to_sender", + }, }, rate_options: { carrier_ids: [carrier_id], service_codes: [carrier_service_code], preferred_currency: currency_code as string, - } + }, }) ``` @@ -816,11 +816,11 @@ class ShipStationProviderService extends AbstractFulfillmentProviderService { carrier_service_code, from_address: { name: context.from_location?.name, - address: context.from_location?.address + address: context.from_location?.address, }, to_address: context.shipping_address, items: context.items || [], - currency_code: context.currency_code + currency_code: context.currency_code, }) rate = shipment.rate_response.rates[0] } else { @@ -834,7 +834,7 @@ class ShipStationProviderService extends AbstractFulfillmentProviderService { return { calculated_amount: calculatedPrice, - is_calculated_price_tax_inclusive: !!rate?.tax_amount + is_calculated_price_tax_inclusive: !!rate?.tax_amount, } } } @@ -901,21 +901,21 @@ class ShipStationProviderService extends AbstractFulfillmentProviderService { // @ts-ignore name: context.from_location?.name, // @ts-ignore - address: context.from_location?.address + address: context.from_location?.address, }, // @ts-ignore to_address: context.shipping_address, // @ts-ignore items: context.items || [], // @ts-ignore - currency_code: context.currency_code + currency_code: context.currency_code, }) shipment_id = shipment.shipment_id } return { ...data, - shipment_id + shipment_id, } } } @@ -994,7 +994,7 @@ export class ShipStationClient { async purchaseLabelForShipment(id: string): Promise