@shushed/helpers 0.0.295 → 0.0.297-main-20260320145035

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.
Files changed (113) hide show
  1. package/dist/cjs/contracts/asset.schema.json +2 -11
  2. package/dist/cjs/contracts/gift-voucher.schema.json +4 -12
  3. package/dist/cjs/contracts/messages/product.schema.json +5 -1
  4. package/dist/cjs/contracts/order/address.schema.json +18 -14
  5. package/dist/cjs/contracts/order/item.schema.json +22 -85
  6. package/dist/cjs/contracts/order/payment.schema.json +4 -4
  7. package/dist/cjs/contracts/order/shipment/item.schema.json +1 -6
  8. package/dist/cjs/contracts/order/shipment.schema.json +8 -64
  9. package/dist/cjs/contracts/order.schema.json +53 -53
  10. package/dist/cjs/contracts/product.schema.json +6 -95
  11. package/dist/cjs/dist-dereferenced/asset.js +1 -1
  12. package/dist/cjs/dist-dereferenced/category-tree.js +1 -1
  13. package/dist/cjs/dist-dereferenced/development-colour.js +1 -1
  14. package/dist/cjs/dist-dereferenced/gift-voucher.js +1 -1
  15. package/dist/cjs/dist-dereferenced/messages/order/delivered.js +1 -1
  16. package/dist/cjs/dist-dereferenced/messages/order/new.js +1 -1
  17. package/dist/cjs/dist-dereferenced/messages/order/processed.js +1 -1
  18. package/dist/cjs/dist-dereferenced/messages/order/return-initiated.js +1 -1
  19. package/dist/cjs/dist-dereferenced/messages/order/returned.js +1 -1
  20. package/dist/cjs/dist-dereferenced/messages/order/shipped.js +1 -1
  21. package/dist/cjs/dist-dereferenced/messages/product.js +1 -1
  22. package/dist/cjs/dist-dereferenced/order/address.js +1 -1
  23. package/dist/cjs/dist-dereferenced/order/customer.js +1 -1
  24. package/dist/cjs/dist-dereferenced/order/item.js +1 -1
  25. package/dist/cjs/dist-dereferenced/order/orderMain.js +1 -1
  26. package/dist/cjs/dist-dereferenced/order/payment.js +1 -1
  27. package/dist/cjs/dist-dereferenced/order/shipment/item/itemMain.js +1 -1
  28. package/dist/cjs/dist-dereferenced/order/shipment/item/returned.js +1 -1
  29. package/dist/cjs/dist-dereferenced/order/shipment/pos/outbound.js +1 -1
  30. package/dist/cjs/dist-dereferenced/order/shipment/pos/posMain.js +1 -1
  31. package/dist/cjs/dist-dereferenced/order/shipment/pos/return.js +1 -1
  32. package/dist/cjs/dist-dereferenced/order/shipment/shipmentMain.js +1 -1
  33. package/dist/cjs/dist-dereferenced/order/shipment/shipped/outbound.js +1 -1
  34. package/dist/cjs/dist-dereferenced/order/shipment/shipped/return.js +1 -1
  35. package/dist/cjs/dist-dereferenced/order/shipment/shipped/shippedMain.js +1 -1
  36. package/dist/cjs/dist-dereferenced/product.js +1 -1
  37. package/dist/cjs/dist-dereferenced/stock.js +1 -1
  38. package/dist/cjs/src-public/airtable.js +9 -196
  39. package/dist/cjs/src-public/bcOrder.js +398 -300
  40. package/dist/cjs/src-public/centra.js +4 -264
  41. package/dist/cjs/src-public/env.js +1 -7
  42. package/dist/cjs/src-public/fredhopper/fredhopper.base.js +21 -37
  43. package/dist/cjs/src-public/pubsub.js +26 -83
  44. package/dist/cjs/src-public/runtime.js +0 -5
  45. package/dist/cjs/src-public/utils.js +1 -0
  46. package/dist/package.json +0 -1
  47. package/dist/types/dist-dereferenced/asset.d.ts +1 -8
  48. package/dist/types/dist-dereferenced/category-tree.d.ts +0 -3
  49. package/dist/types/dist-dereferenced/development-colour.d.ts +1 -8
  50. package/dist/types/dist-dereferenced/gift-voucher.d.ts +1 -7
  51. package/dist/types/dist-dereferenced/messages/order/delivered.d.ts +105 -126
  52. package/dist/types/dist-dereferenced/messages/order/new.d.ts +105 -126
  53. package/dist/types/dist-dereferenced/messages/order/processed.d.ts +105 -126
  54. package/dist/types/dist-dereferenced/messages/order/return-initiated.d.ts +105 -126
  55. package/dist/types/dist-dereferenced/messages/order/returned.d.ts +105 -126
  56. package/dist/types/dist-dereferenced/messages/order/shipped.d.ts +105 -126
  57. package/dist/types/dist-dereferenced/messages/product.d.ts +4 -99
  58. package/dist/types/dist-dereferenced/order/address.d.ts +14 -10
  59. package/dist/types/dist-dereferenced/order/customer.d.ts +14 -10
  60. package/dist/types/dist-dereferenced/order/index.d.ts +105 -126
  61. package/dist/types/dist-dereferenced/order/item.d.ts +0 -6
  62. package/dist/types/dist-dereferenced/order/orderMain.d.ts +105 -126
  63. package/dist/types/dist-dereferenced/order/payment.d.ts +2 -2
  64. package/dist/types/dist-dereferenced/order/shipment/index.d.ts +1 -21
  65. package/dist/types/dist-dereferenced/order/shipment/item/index.d.ts +1 -4
  66. package/dist/types/dist-dereferenced/order/shipment/item/itemMain.d.ts +1 -4
  67. package/dist/types/dist-dereferenced/order/shipment/item/returned.d.ts +1 -4
  68. package/dist/types/dist-dereferenced/order/shipment/pos/index.d.ts +1 -21
  69. package/dist/types/dist-dereferenced/order/shipment/pos/outbound.d.ts +1 -21
  70. package/dist/types/dist-dereferenced/order/shipment/pos/posMain.d.ts +1 -21
  71. package/dist/types/dist-dereferenced/order/shipment/pos/return.d.ts +1 -21
  72. package/dist/types/dist-dereferenced/order/shipment/shipmentMain.d.ts +1 -21
  73. package/dist/types/dist-dereferenced/order/shipment/shipped/index.d.ts +1 -21
  74. package/dist/types/dist-dereferenced/order/shipment/shipped/outbound.d.ts +1 -21
  75. package/dist/types/dist-dereferenced/order/shipment/shipped/return.d.ts +1 -21
  76. package/dist/types/dist-dereferenced/order/shipment/shipped/shippedMain.d.ts +1 -21
  77. package/dist/types/dist-dereferenced/product.d.ts +3 -98
  78. package/dist/types/dist-dereferenced/stock.d.ts +0 -4
  79. package/dist/types/dist-types/asset.d.ts +0 -2
  80. package/dist/types/dist-types/category-tree.d.ts +0 -1
  81. package/dist/types/dist-types/development-colour.d.ts +0 -2
  82. package/dist/types/dist-types/gift-voucher.d.ts +3 -13
  83. package/dist/types/dist-types/messages/order/delivered.d.ts +9 -17
  84. package/dist/types/dist-types/messages/order/new.d.ts +9 -17
  85. package/dist/types/dist-types/messages/order/processed.d.ts +9 -17
  86. package/dist/types/dist-types/messages/order/return-initiated.d.ts +9 -17
  87. package/dist/types/dist-types/messages/order/returned.d.ts +9 -17
  88. package/dist/types/dist-types/messages/order/shipped.d.ts +9 -17
  89. package/dist/types/dist-types/messages/product.d.ts +2 -31
  90. package/dist/types/dist-types/order/address.d.ts +3 -3
  91. package/dist/types/dist-types/order/customer.d.ts +6 -6
  92. package/dist/types/dist-types/order/item.d.ts +0 -2
  93. package/dist/types/dist-types/order/orderMain.d.ts +9 -17
  94. package/dist/types/dist-types/order/payment.d.ts +2 -2
  95. package/dist/types/dist-types/order/shipment/item/itemMain.d.ts +0 -1
  96. package/dist/types/dist-types/order/shipment/item/returned.d.ts +0 -1
  97. package/dist/types/dist-types/order/shipment/pos/outbound.d.ts +0 -6
  98. package/dist/types/dist-types/order/shipment/pos/posMain.d.ts +0 -6
  99. package/dist/types/dist-types/order/shipment/pos/return.d.ts +0 -6
  100. package/dist/types/dist-types/order/shipment/shipmentMain.d.ts +0 -6
  101. package/dist/types/dist-types/order/shipment/shipped/outbound.d.ts +0 -6
  102. package/dist/types/dist-types/order/shipment/shipped/return.d.ts +0 -6
  103. package/dist/types/dist-types/order/shipment/shipped/shippedMain.d.ts +0 -6
  104. package/dist/types/dist-types/product.d.ts +2 -31
  105. package/dist/types/dist-types/stock.d.ts +0 -1
  106. package/dist/types/src-public/airtable.d.ts +4 -30
  107. package/dist/types/src-public/centra.d.ts +0 -54
  108. package/dist/types/src-public/fredhopper/fredhopper.base.d.ts +0 -1
  109. package/dist/types/src-public/fredhopper/fredhopper.types.d.ts +1 -1
  110. package/dist/types/src-public/pubsub.d.ts +1 -6
  111. package/dist/types/src-public/runtime.d.ts +0 -1
  112. package/dist/types/src-public/types.d.ts +0 -2
  113. package/package.json +1 -2
@@ -14,11 +14,6 @@
14
14
  "type": "string",
15
15
  "description": "Dash ID"
16
16
  },
17
- "md5": {
18
- "type": "string",
19
- "pattern": "^[a-f0-9]{32}$",
20
- "description": "MD5 hash of the asset"
21
- },
22
17
  "dash_folder_path": {
23
18
  "type": "string",
24
19
  "description": "Dash folder path"
@@ -71,12 +66,8 @@
71
66
  },
72
67
  "file_name": {
73
68
  "type": "string",
74
- "pattern": "^[A-Za-z0-9-_.]+$",
75
- "description": "The filename of the asset. Upper/Lowercase, underscores, dashes, no spaces"
76
- },
77
- "is_product": {
78
- "type": "boolean",
79
- "description": "Whether the asset is a product image or not"
69
+ "pattern": "^[a-z0-9-.]+$",
70
+ "description": "The content type of the asset. Lowercase, dashes, no spaces"
80
71
  }
81
72
  },
82
73
  "required": [
@@ -39,14 +39,8 @@
39
39
  ]
40
40
  }
41
41
  },
42
- "is_expired": {
43
- "type": "boolean"
44
- },
45
42
  "customer_email": {
46
- "type": [
47
- "string",
48
- "null"
49
- ],
43
+ "type": ["string", "null"],
50
44
  "format": "email",
51
45
  "description": "Normalized and lowercased email. Null if invalid.",
52
46
  "example": "alice.johnson@example.com"
@@ -61,10 +55,6 @@
61
55
  ]
62
56
  }
63
57
  },
64
- "original_amount": {
65
- "$ref": "https://shushed.example.com/money.schema.json",
66
- "description": "Original Gift Voucher Amount"
67
- },
68
58
  "balance": {
69
59
  "$ref": "https://shushed.example.com/money.schema.json",
70
60
  "description": "Balance currently on the voucher - Example: 25.50"
@@ -85,6 +75,8 @@
85
75
  "valid_until",
86
76
  "customer_email",
87
77
  "purchased_at",
88
- "balance"
78
+ "balance",
79
+ "is_physical",
80
+ "has_been_emailed"
89
81
  ]
90
82
  }
@@ -13,12 +13,16 @@
13
13
  "required": [
14
14
  "product_id",
15
15
  "style_id",
16
+ "product_name",
16
17
  "variants",
17
18
  "images",
18
19
  "attributes",
20
+ "is_available_to_order",
19
21
  "created_at",
20
22
  "last_modified_at",
21
- "colour_family_name"
23
+ "colour_family_name",
24
+ "colour_label",
25
+ "vat_amount"
22
26
  ]
23
27
  }
24
28
  ]
@@ -45,50 +45,54 @@
45
45
  },
46
46
  "company_name": {
47
47
  "type": "string",
48
- "maxLength": 100
48
+ "maxLength": 30
49
49
  },
50
50
  "first_name": {
51
- "type": ["string", "null"],
52
- "maxLength": 50,
51
+ "type": "string",
52
+ "maxLength": 30,
53
+ "minLength": 1,
53
54
  "faker": { "name.firstName": [] },
54
- "description": "Recipient's first name. Null for company/press orders without individual names."
55
+ "description": "Recipient's first name."
55
56
  },
56
57
  "last_name": {
57
- "type": ["string", "null"],
58
- "maxLength": 50,
58
+ "type": "string",
59
+ "maxLength": 30,
60
+ "minLength": 1,
59
61
  "faker": { "name.lastName": [] },
60
- "description": "Recipient's last name. Null for company/press orders without individual names."
62
+ "description": "Recipient's last name."
61
63
  },
62
64
  "address1": {
63
65
  "type": ["string"],
64
66
  "minLength": 1,
65
- "maxLength": 100,
67
+ "maxLength": 30,
66
68
  "faker": { "address.streetAddress": [] },
67
69
  "description": "Primary street address."
68
70
  },
69
71
  "address2": {
70
72
  "type": ["string", "null"],
71
- "maxLength": 100,
73
+ "maxLength": 30,
72
74
  "faker": { "address.secondaryAddress": [] },
73
75
  "description": "Additional address line (e.g., apartment or suite number)."
74
76
  },
75
77
  "city": {
76
- "type": ["string", "null"],
77
- "maxLength": 50,
78
+ "type": ["string"],
79
+ "maxLength": 30,
80
+ "minLength": 1,
78
81
  "faker": { "address.city": [] },
79
- "description": "City or locality of the address. Null when not provided in BC source data."
82
+ "description": "City or locality of the address."
80
83
  },
81
84
  "region": {
82
85
  "type": ["string", "null"],
83
- "maxLength": 50,
86
+ "maxLength": 30,
84
87
  "faker": { "address.state": [] },
85
88
  "description": "State, province, or region of the address."
86
89
  },
87
90
  "post_code": {
88
91
  "type": ["string", "null"],
89
92
  "maxLength": 20,
93
+ "pattern": "^[A-Z0-9 ]*$",
90
94
  "faker": { "address.zipCode": [] },
91
- "description": "Postal code (optional for countries without postal codes).",
95
+ "description": "Postal code (uppercase letters and numbers with spaces; optional for countries without postal codes).",
92
96
  "examples": ["SW1A 1AA", "90210", null]
93
97
  },
94
98
  "country_code": {
@@ -12,105 +12,59 @@
12
12
  "type": "object",
13
13
  "properties": {
14
14
  "sku": {
15
- "type": [
16
- "string"
17
- ],
18
- "faker": {
19
- "custom.sku": []
20
- },
15
+ "type": ["string"],
16
+ "faker": { "custom.sku": [] },
21
17
  "description": "Stock Keeping Unit identifier for the item.Combination of style code and colour code and "
22
18
  },
23
19
  "linked_style_id": {
24
- "type": [
25
- "string",
26
- "null"
27
- ],
28
- "faker": {
29
- "custom.style": []
30
- },
20
+ "type": ["string", "null"],
21
+ "faker": { "custom.style": [] },
31
22
  "description": "Style ID of the parent item if this is a variation."
32
23
  },
33
24
  "colour_id": {
34
- "type": [
35
- "string",
36
- "null"
37
- ],
38
- "faker": {
39
- "custom.color": []
40
- },
25
+ "type": ["string", "null"],
26
+ "faker": { "custom.color": [] },
41
27
  "description": "Code from Object Colorway - Example: 3203, null if not applicable (e.g., non-product items like NEWSLETTER)"
42
28
  },
43
29
  "style_id": {
44
- "type": [
45
- "string",
46
- "null"
47
- ],
48
- "faker": {
49
- "custom.style": []
50
- },
30
+ "type": ["string", "null"],
31
+ "faker": { "custom.style": [] },
51
32
  "description": "Code from Object style - Example: 000697, null if not applicable (e.g., non-product items like NEWSLETTER)"
52
33
  },
53
34
  "product_id": {
54
- "type": [
55
- "string",
56
- "null"
57
- ],
35
+ "type": ["string", "null"],
58
36
  "description": "Code from Object style and colour - Example: 000697-3203"
59
37
  },
60
38
  "colour_name": {
61
- "type": [
62
- "string"
63
- ],
64
- "faker": {
65
- "color.human": []
66
- },
39
+ "type": ["string"],
40
+ "faker": { "color.human": [] },
67
41
  "description": "Node Name from Object Colorway - Example: Toffee Brown"
68
42
  },
69
43
  "size_name": {
70
- "type": [
71
- "string"
72
- ],
73
- "faker": {
74
- "custom.size": []
75
- },
44
+ "type": ["string"],
45
+ "faker": { "custom.size": [] },
76
46
  "description": "HS_ColorwayAttr_SizeRangeNodeName from Object ColorwayAttributes - Example: 10-16"
77
47
  },
78
48
  "preorder_date": {
79
- "type": [
80
- "string",
81
- "null"
82
- ],
49
+ "type": ["string", "null"],
83
50
  "format": "date",
84
51
  "description": "Expected availability date if the item is on preorder."
85
52
  },
86
53
  "quantity": {
87
- "type": [
88
- "integer"
89
- ],
54
+ "type": ["integer"],
90
55
  "minimum": 0,
91
- "faker": {
92
- "minimum": 0,
93
- "maximum": 10
94
- },
56
+ "faker": { "minimum": 0, "maximum": 10 },
95
57
  "description": "Number of units ordered. Represented as integer."
96
58
  },
97
59
  "unit_price_status": {
98
60
  "type": "string",
99
- "enum": [
100
- "rrp",
101
- "perm",
102
- "pos"
103
- ],
61
+ "enum": ["rrp", "perm", "pos"],
104
62
  "description": "Pricing status: rrp (Full Price), perm (Markdown), pos (Promotional)."
105
63
  },
106
64
  "returned_quantity": {
107
- "type": [
108
- "integer"
109
- ],
65
+ "type": ["integer"],
110
66
  "minimum": 0,
111
- "faker": {
112
- "maximum": 1
113
- },
67
+ "faker": { "maximum": 1 },
114
68
  "description": "Number of units returned. Represented as integer."
115
69
  },
116
70
  "unit_price_net": {
@@ -122,29 +76,12 @@
122
76
  "description": "Gross unit price in smallest currency unit. Represented as integer."
123
77
  },
124
78
  "discount_code": {
125
- "type": [
126
- "string",
127
- "null"
128
- ],
129
- "faker": {
130
- "format": "uuid"
131
- },
79
+ "type": ["string", "null"],
80
+ "faker": { "format": "uuid" },
132
81
  "description": "Code applied to trigger a discount, if any."
133
82
  },
134
- "discount_campaign": {
135
- "type": [
136
- "string",
137
- "null"
138
- ],
139
- "description": "Voucher code or campaign name for the purchase"
140
- },
141
83
  "cost_net": {
142
- "$ref": "https://shushed.example.com/money.schema.json",
143
- "description": "Net cost per unit in smallest currency unit (from unit_cost_lcy)."
144
- },
145
- "order_line_no": {
146
- "type": ["integer", "null"],
147
- "description": "Original order line number from BC sales/invoice line. Used for cross-document tracing."
84
+ "$ref": "https://shushed.example.com/money.schema.json"
148
85
  }
149
86
  },
150
87
  "required": [
@@ -35,9 +35,9 @@
35
35
  "description": "The method used for the transaction."
36
36
  },
37
37
  "transaction_id": {
38
- "type": ["string", "null"],
38
+ "type": ["string"],
39
39
  "faker": { "custom.documentid": ["TR", 10] },
40
- "description": "Internal transaction reference ID. Derived from card_payment.transaction_id, payment.payment_gateway_token, or null if unavailable."
40
+ "description": "Internal transaction reference ID."
41
41
  },
42
42
  "card_number": {
43
43
  "type": ["string", "null"],
@@ -70,9 +70,9 @@
70
70
  "description": "Channel through which the payment was initiated."
71
71
  },
72
72
  "psp_reference": {
73
- "type": ["string", "null"],
73
+ "type": "string",
74
74
  "faker": { "custom.documentid": ["PSP", 10] },
75
- "description": "Reference provided by the Payment Service Provider (PSP). Same as transaction_id."
75
+ "description": "Reference provided by the Payment Service Provider (PSP)."
76
76
  },
77
77
  "card_brand": {
78
78
  "type": ["string", "null"],
@@ -11,11 +11,6 @@
11
11
  "faker": { "datatype.number": [1, 1] },
12
12
  "description": "Line number of the item in the order. Used for item referencing and tracking."
13
13
  },
14
- "sku": {
15
- "type": ["string"],
16
- "faker": { "custom.sku": [] },
17
- "description": "Stock Keeping Unit identifier matching the order item SKU (item_no-variant_code)."
18
- },
19
14
  "quantity": {
20
15
  "type": ["integer"],
21
16
  "minimum": 1,
@@ -23,5 +18,5 @@
23
18
  "description": "The number of units of the item shipped."
24
19
  }
25
20
  },
26
- "required": ["lineNumber", "sku", "quantity"]
21
+ "required": ["lineNumber", "quantity"]
27
22
  }
@@ -12,21 +12,12 @@
12
12
  "type": "object",
13
13
  "properties": {
14
14
  "erp_id": {
15
- "type": [
16
- "string"
17
- ],
18
- "faker": {
19
- "custom.documentid": [
20
- "SP",
21
- 9
22
- ]
23
- },
15
+ "type": ["string"],
16
+ "faker": { "custom.documentid": ["SP", 9] },
24
17
  "description": "Unique identifier for the shipment from the ERP system."
25
18
  },
26
19
  "type": {
27
- "type": [
28
- "string"
29
- ],
20
+ "type": ["string"],
30
21
  "enum": [
31
22
  "SHIPPED-OUTBOUND",
32
23
  "SHIPPED-RETURN",
@@ -36,59 +27,17 @@
36
27
  "description": "Type of shipment. Can be shipped or returned from warehouse or POS."
37
28
  },
38
29
  "shipped_at": {
39
- "type": [
40
- "string"
41
- ],
30
+ "type": ["string"],
42
31
  "format": "date-time",
43
32
  "description": "Date and time the shipment was shipped."
44
33
  },
45
34
  "status": {
46
- "type": [
47
- "string"
48
- ],
49
- "enum": [
50
- "PENDING",
51
- "SHIPPED",
52
- "RECEIVED",
53
- "CANCELLED"
54
- ],
55
- "description": "Current status of the shipment."
56
- },
57
- "discount_code": {
58
- "type": [
59
- "string",
60
- "null"
61
- ],
62
- "faker": {
63
- "format": "uuid"
64
- },
65
- "description": "Code applied to trigger a discount, if any."
66
- },
67
- "discount_campaign": {
68
- "type": [
69
- "string",
70
- "null"
71
- ],
72
- "description": "Voucher code or campaign name for the purchase"
73
- },
74
- "courier_name": {
75
- "type": ["string", "null"],
76
- "enum": ["GLOBALE", "ROYALMAIL", "EVRI", "WAITROSE", null],
77
- "description": "Name of the courier/shipping carrier handling the shipment."
78
- },
79
- "tracking_code": {
80
- "type": ["string", "null"],
81
- "description": "Tracking code or reference number provided by the courier."
82
- },
83
- "class_name": {
84
35
  "type": ["string"],
85
- "enum": ["STANDARD", "PRIORITY"],
86
- "description": "Shipping service class. PRIORITY for express/24-hour, STANDARD for economy/48-hour."
36
+ "enum": ["PENDING", "SHIPPED", "RECEIVED", "CANCELLED"],
37
+ "description": "Current status of the shipment."
87
38
  },
88
39
  "items": {
89
- "type": [
90
- "array"
91
- ],
40
+ "type": ["array"],
92
41
  "items": {
93
42
  "type": "object",
94
43
  "anyOf": [
@@ -105,10 +54,5 @@
105
54
  }
106
55
  }
107
56
  ],
108
- "required": [
109
- "erp_id",
110
- "shipped_at",
111
- "status",
112
- "items"
113
- ]
57
+ "required": ["erp_id", "shipped_at", "status", "items"]
114
58
  }