docs: update recipes following 2.2 release (#10868)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-01-07 17:07:51 +02:00
1 parent 60fd1cbc6c
commit 8e7d895aa2
4 files changed
+29 -9

No files matched your search

@@ -453,9 +453,15 @@ This method accepts the shipping option's `data` field, which will hold the data
Add the method to `ShipStationProviderService` in `src/modules/shipstation/service.ts`: Add the method to `ShipStationProviderService` in `src/modules/shipstation/service.ts`:
```ts title="src/modules/shipstation/service.ts" ```ts title="src/modules/shipstation/service.ts"
// other imports...
import {
// ...
CreateShippingOptionDTO,
} from "@medusajs/framework/types"
class ShipStationProviderService extends AbstractFulfillmentProviderService { class ShipStationProviderService extends AbstractFulfillmentProviderService {
// ... // ...
async canCalculate(data: Record<string, unknown>): Promise<boolean> { async canCalculate(data: CreateShippingOptionDTO): Promise<boolean> {
return true return true
} }
} }
@@ -820,7 +826,7 @@ class ShipStationProviderService extends AbstractFulfillmentProviderService {
}, },
to_address: context.shipping_address, to_address: context.shipping_address,
items: context.items || [], items: context.items || [],
currency_code: context.currency_code, currency_code: context.currency_code as string,
}) })
rate = shipment.rate_response.rates[0] rate = shipment.rate_response.rates[0]
} else { } else {
@@ -1706,7 +1706,13 @@ Then, create the file `src/modules/digital-product-fulfillment/service.ts` with
```ts title="src/modules/digital-product-fulfillment/service.ts" ```ts title="src/modules/digital-product-fulfillment/service.ts"
import { AbstractFulfillmentProviderService } from "@medusajs/framework/utils" import { AbstractFulfillmentProviderService } from "@medusajs/framework/utils"
import { FulfillmentOption } from "@medusajs/framework/types" import {
CreateFulfillmentResult,
FulfillmentDTO,
FulfillmentItemDTO,
FulfillmentOption,
FulfillmentOrderDTO
} from "@medusajs/framework/types"
class DigitalProductFulfillmentService extends AbstractFulfillmentProviderService { class DigitalProductFulfillmentService extends AbstractFulfillmentProviderService {
static identifier = "digital" static identifier = "digital"
@@ -1735,9 +1741,17 @@ class DigitalProductFulfillmentService extends AbstractFulfillmentProviderServic
return true return true
} }
async createFulfillment(): Promise<Record<string, any>> { async createFulfillment(
data: Record<string, unknown>,
items: Partial<Omit<FulfillmentItemDTO, "fulfillment">>[],
order: Partial<FulfillmentOrderDTO> | undefined,
fulfillment: Partial<Omit<FulfillmentDTO, "provider_id" | "data" | "items">>
): Promise<CreateFulfillmentResult> {
// No data is being sent anywhere // No data is being sent anywhere
return {} return {
data,
labels: []
}
} }
async cancelFulfillment(): Promise<any> { async cancelFulfillment(): Promise<any> {
+2 -2
View File
@@ -112,7 +112,7 @@ export const generatedEditDates = {
"app/nextjs-starter/page.mdx": "2025-01-06T12:19:31.143Z", "app/nextjs-starter/page.mdx": "2025-01-06T12:19:31.143Z",
"app/recipes/b2b/page.mdx": "2024-10-03T13:07:44.153Z", "app/recipes/b2b/page.mdx": "2024-10-03T13:07:44.153Z",
"app/recipes/commerce-automation/page.mdx": "2024-10-16T08:52:01.585Z", "app/recipes/commerce-automation/page.mdx": "2024-10-16T08:52:01.585Z",
"app/recipes/digital-products/examples/standard/page.mdx": "2025-01-06T11:19:35.640Z", "app/recipes/digital-products/examples/standard/page.mdx": "2025-01-07T14:39:31.335Z",
"app/recipes/digital-products/page.mdx": "2025-01-06T11:19:35.623Z", "app/recipes/digital-products/page.mdx": "2025-01-06T11:19:35.623Z",
"app/recipes/ecommerce/page.mdx": "2024-10-22T11:01:01.218Z", "app/recipes/ecommerce/page.mdx": "2024-10-22T11:01:01.218Z",
"app/recipes/integrate-ecommerce-stack/page.mdx": "2024-12-09T13:03:35.846Z", "app/recipes/integrate-ecommerce-stack/page.mdx": "2024-12-09T13:03:35.846Z",
@@ -5615,7 +5615,7 @@ export const generatedEditDates = {
"references/types/DmlTypes/types/types.DmlTypes.RelationshipTypes/page.mdx": "2024-12-10T14:54:55.435Z", "references/types/DmlTypes/types/types.DmlTypes.RelationshipTypes/page.mdx": "2024-12-10T14:54:55.435Z",
"app/recipes/commerce-automation/restock-notification/page.mdx": "2024-12-11T08:47:27.471Z", "app/recipes/commerce-automation/restock-notification/page.mdx": "2024-12-11T08:47:27.471Z",
"app/troubleshooting/workflow-errors/page.mdx": "2024-12-11T08:44:36.598Z", "app/troubleshooting/workflow-errors/page.mdx": "2024-12-11T08:44:36.598Z",
"app/integrations/guides/shipstation/page.mdx": "2024-12-23T07:48:47.719Z", "app/integrations/guides/shipstation/page.mdx": "2025-01-07T14:40:42.561Z",
"app/nextjs-starter/guides/customize-stripe/page.mdx": "2024-12-25T14:48:55.877Z", "app/nextjs-starter/guides/customize-stripe/page.mdx": "2024-12-25T14:48:55.877Z",
"references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx": "2024-12-25T08:43:13.451Z", "references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx": "2024-12-25T08:43:13.451Z",
"references/core_flows/Cart/Workflows_Cart/variables/core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflowId/page.mdx": "2024-12-17T16:57:22.044Z", "references/core_flows/Cart/Workflows_Cart/variables/core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflowId/page.mdx": "2024-12-17T16:57:22.044Z",
+2 -2
View File
@@ -644,7 +644,7 @@ export const generatedSidebar = [
"loaded": true, "loaded": true,
"isPathHref": true, "isPathHref": true,
"type": "ref", "type": "ref",
"title": "Retrieve Logged-In Customer in Storefront", "title": "Retrieve Customer in Storefront",
"path": "/storefront-development/customers/retrieve", "path": "/storefront-development/customers/retrieve",
"children": [] "children": []
}, },
@@ -2258,7 +2258,7 @@ export const generatedSidebar = [
"loaded": true, "loaded": true,
"isPathHref": true, "isPathHref": true,
"type": "ref", "type": "ref",
"title": "Retrieve Logged-In Customer in Storefront", "title": "Retrieve Customer in Storefront",
"path": "/storefront-development/customers/retrieve", "path": "/storefront-development/customers/retrieve",
"children": [] "children": []
}, },