@reactionary/core 0.10.54 → 0.10.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/core",
3
- "version": "0.10.54",
3
+ "version": "0.10.55",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
@@ -8,6 +8,13 @@ const ShippingProtocolDataSchema = z.looseObject({
8
8
  key: z.string().meta({ description: 'The protocol-specific key, e.g. "timeSlotId".' }),
9
9
  value: z.union([z.string(), z.record(z.string(), z.json())]).meta({ description: "The protocol-specific value: either a plain string, or a JSON-serializable object for richer structures." })
10
10
  });
11
+ const SHIPPING_PROTOCOL_DATA_KEYS = {
12
+ /**
13
+ * The identifier (Store.identifier.key) of the brand's own store an
14
+ * in-store pickup (BOPIS) shipping method is fulfilled from.
15
+ */
16
+ pickupStore: "pickup_store"
17
+ };
11
18
  const PickupPointSchema = z.looseObject({
12
19
  identifier: z.object({
13
20
  key: z.string()
@@ -29,7 +36,7 @@ const ShippingMethodSchema = z.looseObject({
29
36
  deliveryTime: z.string(),
30
37
  carrier: z.string().optional(),
31
38
  fulfillmentType: ShippingFulfillmentTypeSchema.optional().meta({ description: `How this shipping method fulfills the order: "delivery" for shipment to an address (including third-party carrier service points selected via the shipping instruction's pickupPoint), "pickup" for collection at one of the brand's own stores (BOPIS). When absent, "delivery" can be assumed.` }),
32
- protocolData: z.array(ShippingProtocolDataSchema).optional().meta({ description: "Additional provider-populated, protocol-specific data for this shipping method, e.g. available pickup time slots." })
39
+ protocolData: z.array(ShippingProtocolDataSchema).optional().meta({ description: `Additional provider-populated, protocol-specific data for this shipping method, e.g. available pickup time slots. Conventional keys (see SHIPPING_PROTOCOL_DATA_KEYS) include "pickup_store": the identifier of the brand's own store a pickup method is fulfilled from.` })
33
40
  });
34
41
  const ShippingInstructionSchema = BaseModelSchema.extend({
35
42
  shippingMethod: ShippingMethodIdentifierSchema,
@@ -41,6 +48,7 @@ const ShippingInstructionSchema = BaseModelSchema.extend({
41
48
  });
42
49
  export {
43
50
  PickupPointSchema,
51
+ SHIPPING_PROTOCOL_DATA_KEYS,
44
52
  ShippingFulfillmentTypeSchema,
45
53
  ShippingInstructionSchema,
46
54
  ShippingMethodSchema,
@@ -19,6 +19,18 @@ export declare const ShippingProtocolDataSchema: z.ZodObject<{
19
19
  key: z.ZodString;
20
20
  value: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
21
21
  }, z.core.$loose>;
22
+ /**
23
+ * Conventional, cross-provider keys for shipping protocol data entries.
24
+ * Providers emit these keys when the concept applies, so clients can consume
25
+ * them without provider-specific knowledge.
26
+ */
27
+ export declare const SHIPPING_PROTOCOL_DATA_KEYS: {
28
+ /**
29
+ * The identifier (Store.identifier.key) of the brand's own store an
30
+ * in-store pickup (BOPIS) shipping method is fulfilled from.
31
+ */
32
+ readonly pickupStore: "pickup_store";
33
+ };
22
34
  export declare const PickupPointSchema: z.ZodObject<{
23
35
  identifier: z.ZodObject<{
24
36
  key: z.ZodString;