@deliverart/sdk-js-integration 2.40.0-dev.2 → 2.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -488,3 +488,7 @@ omit the new keys; public info resolves defaults to preserve existing branding.
488
488
  These settings also travel through lead/activation data. Font URLs and arbitrary
489
489
  font names are not supported. The existing 2.37 theme passthrough preserves the
490
490
  additive keys for consumers during a coordinated rollout.
491
+
492
+ ## Ecommerce payment configuration references
493
+
494
+ `paymentConfigs` uses method-specific references such as `/payment_configs/credit_card/<uuid>`. The method is a literal route segment; only the configuration identifier is a UUID. The SDK accepts Cash, Credit Card, Bank Transfer, Stripe and Ticket references, including SDK objects serialized by settings forms, and rejects unsupported methods or malformed identifiers. POS integration collections and ecommerce settings use the same validated contract.
package/dist/index.cjs CHANGED
@@ -1077,6 +1077,7 @@ __export(index_exports, {
1077
1077
  integrationEcommerceMenuPriceOverrideSchema: () => integrationEcommerceMenuPriceOverrideSchema,
1078
1078
  integrationEcommerceMenuPriceSchema: () => integrationEcommerceMenuPriceSchema,
1079
1079
  integrationEcommerceMenuSchema: () => integrationEcommerceMenuSchema,
1080
+ integrationEcommercePaymentConfigIriSchema: () => integrationEcommercePaymentConfigIriSchema,
1080
1081
  integrationEcommercePaymentMethodInfoSchema: () => integrationEcommercePaymentMethodInfoSchema,
1081
1082
  integrationEcommercePointOfSaleInfoSchema: () => integrationEcommercePointOfSaleInfoSchema,
1082
1083
  integrationEcommerceRegistrationLinkInputSchema: () => integrationEcommerceRegistrationLinkInputSchema,
@@ -2528,8 +2529,24 @@ var import_sdk_js_menu2 = require("@deliverart/sdk-js-menu");
2528
2529
  var import_sdk_js_point_of_sale3 = require("@deliverart/sdk-js-point-of-sale");
2529
2530
  var import_sdk_js_sales_mode3 = require("@deliverart/sdk-js-sales-mode");
2530
2531
  var import_zod7 = require("zod");
2532
+ var paymentConfigPatterns = [
2533
+ "/payment_configs/cash/:id",
2534
+ "/payment_configs/credit_card/:id",
2535
+ "/payment_configs/bank_transfer/:id",
2536
+ "/payment_configs/stripe/:id",
2537
+ "/payment_configs/ticket/:id"
2538
+ ];
2539
+ var integrationEcommercePaymentConfigIriSchema = import_zod7.z.unknown().transform((value, context) => {
2540
+ const iri = typeof value === "string" ? value : value !== null && typeof value === "object" && "iri" in value ? value.iri : null;
2541
+ const pattern = typeof iri === "string" ? paymentConfigPatterns.find((candidate) => (0, import_sdk_js_global_types7.matchesIriPattern)(iri, candidate)) : void 0;
2542
+ if (!pattern || typeof iri !== "string") {
2543
+ context.addIssue({ code: "custom", message: "Invalid payment configuration reference" });
2544
+ return import_zod7.z.NEVER;
2545
+ }
2546
+ return new import_sdk_js_global_types7.IriObject(iri, pattern);
2547
+ });
2531
2548
  var integrationEcommerceSchema = integrationBaseSchema.omit({ service: true }).extend({
2532
- paymentConfigs: import_zod7.z.array((0, import_sdk_js_global_types7.iriSchema)("/payment_configs/:method/:id")),
2549
+ paymentConfigs: import_zod7.z.array(integrationEcommercePaymentConfigIriSchema),
2533
2550
  path: import_zod7.z.string(),
2534
2551
  orderingModes: import_zod7.z.array(types_exports.integrationEcommerceOrderingModeSchema).min(1),
2535
2552
  minOrderValue: import_zod7.z.coerce.number().nonnegative(),
@@ -12868,6 +12885,7 @@ __reExport(index_exports, types_exports, module.exports);
12868
12885
  integrationEcommerceMenuPriceOverrideSchema,
12869
12886
  integrationEcommerceMenuPriceSchema,
12870
12887
  integrationEcommerceMenuSchema,
12888
+ integrationEcommercePaymentConfigIriSchema,
12871
12889
  integrationEcommercePaymentMethodInfoSchema,
12872
12890
  integrationEcommercePointOfSaleInfoSchema,
12873
12891
  integrationEcommerceRegistrationLinkInputSchema,