@shushed/helpers 0.0.226-fix-erp-631-20260105165305 → 0.0.226

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 (42) hide show
  1. package/dist/cjs/contracts/index.js +5 -1
  2. package/dist/cjs/contracts/product-draft.schema.json +159 -5
  3. package/dist/cjs/contracts/purchase-orderline.schema.json +135 -0
  4. package/dist/cjs/contracts/stock-movement.schema.json +144 -0
  5. package/dist/cjs/dist-dereferenced/index.js +5 -1
  6. package/dist/cjs/dist-dereferenced/messages/product-draft.js +1 -1
  7. package/dist/cjs/dist-dereferenced/product-draft.js +1 -1
  8. package/dist/cjs/dist-dereferenced/purchase-orderline.js +4 -0
  9. package/dist/cjs/dist-dereferenced/stock-movement.js +4 -0
  10. package/dist/cjs/dist-types/purchase-orderline.js +2 -0
  11. package/dist/cjs/dist-types/stock-movement.js +2 -0
  12. package/dist/cjs/src-public/airtable.js +96 -59
  13. package/dist/cjs/src-public/bcOrder.js +60 -77
  14. package/dist/cjs/src-public/centra.js +56 -5
  15. package/dist/cjs/src-public/env.js +1 -1
  16. package/dist/cjs/src-public/index.js +3 -1
  17. package/dist/cjs/src-public/pubsub.js +35 -10
  18. package/dist/cjs/src-public/runtime.js +48 -9
  19. package/dist/cjs/src-public/sitoo.js +349 -0
  20. package/dist/cjs/src-public/utils.js +3 -0
  21. package/dist/package.json +3 -2
  22. package/dist/types/contracts/index.d.ts +2 -0
  23. package/dist/types/dist-dereferenced/index.d.ts +2 -0
  24. package/dist/types/dist-dereferenced/messages/product-draft.d.ts +148 -1
  25. package/dist/types/dist-dereferenced/product-draft.d.ts +148 -1
  26. package/dist/types/dist-dereferenced/purchase-orderline.d.ts +114 -0
  27. package/dist/types/dist-dereferenced/stock-movement.d.ts +110 -0
  28. package/dist/types/dist-types/index.d.ts +2 -0
  29. package/dist/types/dist-types/messages/product-draft.d.ts +23 -4
  30. package/dist/types/dist-types/product-draft.d.ts +23 -4
  31. package/dist/types/dist-types/purchase-orderline.d.ts +31 -0
  32. package/dist/types/dist-types/stock-movement.d.ts +30 -0
  33. package/dist/types/src-public/airtable.d.ts +0 -9
  34. package/dist/types/src-public/centra.d.ts +3 -0
  35. package/dist/types/src-public/env.d.ts +1 -1
  36. package/dist/types/src-public/index.d.ts +1 -0
  37. package/dist/types/src-public/pubsub.d.ts +4 -1
  38. package/dist/types/src-public/runtime.d.ts +17 -4
  39. package/dist/types/src-public/sitoo.d.ts +254 -0
  40. package/dist/types/src-public/types.d.ts +6 -0
  41. package/dist/types/src-public/utils.d.ts +1 -1
  42. package/package.json +4 -3
@@ -0,0 +1,110 @@
1
+ declare const schema: {
2
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
3
+ readonly title: "Stock Movement Schema";
4
+ readonly type: "object";
5
+ readonly additionalProperties: false;
6
+ readonly properties: {
7
+ readonly style_id: {
8
+ readonly type: "string";
9
+ readonly minLength: 1;
10
+ };
11
+ readonly colour_id: {
12
+ readonly type: "string";
13
+ readonly minLength: 1;
14
+ };
15
+ readonly size_code: {
16
+ readonly type: "string";
17
+ readonly minLength: 1;
18
+ };
19
+ readonly location_code: {
20
+ readonly type: "string";
21
+ readonly pattern: "^\\d{3}-[A-Z]+$|^[A-Z]{2,}-?[A-Z]*$|^[A-Z]{2,}\\d{3}$";
22
+ };
23
+ readonly source_system: {
24
+ readonly type: "string";
25
+ readonly enum: readonly ["bc", "centra", "sitoo"];
26
+ };
27
+ readonly quantity: {
28
+ readonly type: "integer";
29
+ readonly minimum: 0;
30
+ };
31
+ readonly entry_no: {
32
+ readonly type: "string";
33
+ };
34
+ readonly external_entry_no: {
35
+ readonly type: "string";
36
+ };
37
+ readonly document_no: {
38
+ readonly type: "string";
39
+ };
40
+ readonly external_document_no: {
41
+ readonly type: "string";
42
+ };
43
+ readonly type: {
44
+ readonly type: "string";
45
+ readonly enum: readonly ["transfer", "negative adjustment", "positive adjustment", "purchase", "sale"];
46
+ };
47
+ readonly unit_cost: {
48
+ readonly oneOf: readonly [{
49
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
50
+ readonly title: "Money";
51
+ readonly type: "object";
52
+ readonly additionalProperties: false;
53
+ readonly properties: {
54
+ readonly value: {
55
+ readonly type: "integer";
56
+ readonly minimum: 0;
57
+ };
58
+ readonly decimal_places: {
59
+ readonly type: "integer";
60
+ readonly minimum: 0;
61
+ readonly maximum: 4;
62
+ };
63
+ readonly currency: {
64
+ readonly title: "Currency";
65
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
66
+ readonly type: "string";
67
+ readonly enum: readonly ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"];
68
+ };
69
+ readonly lcy_value: {
70
+ readonly type: "integer";
71
+ readonly minimum: 0;
72
+ };
73
+ readonly lcy_currency: {
74
+ readonly title: "LCY Currency";
75
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
76
+ readonly type: "string";
77
+ readonly enum: readonly ["AFN", "ALL", "DZD", "USD", "EUR", "AOA", "XCD", "ARS", "AMD", "AWG", "AUD", "AZN", "BSD", "BHD", "BDT", "BBD", "BYN", "BZD", "XOF", "BMD", "BTN", "INR", "BOB", "BOV", "BAM", "BWP", "NOK", "BRL", "BND", "BGN", "BIF", "CVE", "KHR", "XAF", "CAD", "KYD", "CLF", "CLP", "CNY", "COP", "COU", "KMF", "CDF", "NZD", "CRC", "CUC", "CUP", "ANG", "CZK", "DKK", "DJF", "DOP", "EGP", "SVC", "ERN", "ETB", "FKP", "FJD", "XPF", "GMD", "GEL", "GHS", "GIP", "GTQ", "GBP", "GNF", "GYD", "HTG", "HNL", "HKD", "HUF", "ISK", "IDR", "XDR", "IRR", "IQD", "ILS", "JMD", "JPY", "JOD", "KZT", "KES", "KPW", "KRW", "KWD", "KGS", "LAK", "LBP", "LSL", "ZAR", "LRD", "LYD", "CHF", "MOP", "MGA", "MWK", "MYR", "MVR", "MRU", "MUR", "XUA", "MXN", "MXV", "MDL", "MNT", "MAD", "MZN", "MMK", "NAD", "NPR", "NIO", "NGN", "OMR", "PKR", "PAB", "PGK", "PYG", "PEN", "PHP", "PLN", "QAR", "MKD", "RON", "RUB", "RWF", "SHP", "WST", "STN", "SAR", "RSD", "SCR", "SLE", "SGD", "XSU", "SBD", "SOS", "SSP", "LKR", "SDG", "SRD", "SZL", "SEK", "CHE", "CHW", "SYP", "TWD", "TJS", "TZS", "THB", "TOP", "TTD", "TND", "TRY", "TMT", "UGX", "UAH", "AED", "USN", "UYI", "UYU", "UZS", "VUV", "VEF", "VED", "VND", "YER", "ZMW", "ZWL"];
78
+ };
79
+ readonly lcy_decimal_places: {
80
+ readonly type: "integer";
81
+ readonly minimum: 0;
82
+ readonly maximum: 4;
83
+ };
84
+ };
85
+ readonly required: readonly ["value", "currency", "lcy_value", "lcy_currency", "decimal_places", "lcy_decimal_places"];
86
+ }, {
87
+ readonly type: "null";
88
+ }];
89
+ };
90
+ readonly document_date: {
91
+ readonly type: "string";
92
+ readonly format: "date";
93
+ };
94
+ readonly posting_date: {
95
+ readonly type: "string";
96
+ readonly format: "date";
97
+ };
98
+ readonly created_at: {
99
+ readonly type: "string";
100
+ readonly format: "date-time";
101
+ };
102
+ readonly last_modified_at: {
103
+ readonly type: "string";
104
+ readonly format: "date-time";
105
+ };
106
+ };
107
+ readonly required: readonly ["style_id", "source_system", "location_code", "colour_id", "size_code", "last_modified_at", "quantity", "created_at", "document_date", "type"];
108
+ readonly $id: "https://shushed.example.com/stock-move.schema.json";
109
+ };
110
+ export default schema;
@@ -10,6 +10,8 @@ export { default as Price } from './price';
10
10
  export { default as ProductCategory } from './product-category';
11
11
  export { default as ProductDraft } from './product-draft';
12
12
  export { default as Product } from './product';
13
+ export { default as PurchaseOrderline } from './purchase-orderline';
14
+ export { default as StockMovement } from './stock-movement';
13
15
  export { default as Stock } from './stock';
14
16
  export { default as Total } from './total';
15
17
  export * as Messages from './messages';
@@ -3,26 +3,39 @@ export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" |
3
3
  export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
4
4
  export type Country = ("AF" | "AX" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AI" | "AQ" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BM" | "BT" | "BO" | "BQ" | "BA" | "BW" | "BV" | "BR" | "IO" | "BN" | "BG" | "BF" | "BI" | "CV" | "KH" | "CM" | "CA" | "KY" | "CF" | "TD" | "CL" | "CN" | "CX" | "CC" | "CO" | "KM" | "CD" | "CG" | "CK" | "CR" | "CI" | "HR" | "CU" | "CW" | "CY" | "CZ" | "DK" | "DJ" | "DM" | "DO" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "SZ" | "ET" | "FK" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "TF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GI" | "GR" | "GL" | "GD" | "GP" | "GU" | "GT" | "GG" | "GN" | "GW" | "GY" | "HT" | "HM" | "VA" | "HN" | "HK" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "KP" | "KR" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LY" | "LI" | "LT" | "LU" | "MO" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MH" | "MQ" | "MR" | "MU" | "YT" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "MM" | "NA" | "NR" | "NP" | "NL" | "NC" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "MK" | "MP" | "NO" | "OM" | "PK" | "PW" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PN" | "PL" | "PT" | "PR" | "QA" | "RE" | "RO" | "RU" | "RW" | "BL" | "SH" | "KN" | "LC" | "MF" | "PM" | "VC" | "WS" | "SM" | "ST" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SB" | "SO" | "ZA" | "GS" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SE" | "CH" | "SY" | "TW" | "TJ" | "TZ" | "TH" | "TL" | "TG" | "TK" | "TO" | "TT" | "TN" | "TR" | "TM" | "TC" | "TV" | "UG" | "UA" | "AE" | "GB" | "UM" | "US" | "UY" | "UZ" | "VU" | "VE" | "VN" | "VG" | "VI" | "WF" | "EH" | "YE" | "ZM" | "ZW");
5
5
  export interface ProductDraft {
6
- development_colourway_id: string;
7
- development_style_id: string;
6
+ development_colourway_id?: string;
7
+ development_style_id?: string;
8
+ centric_id?: string;
9
+ style_centric_id?: string;
8
10
  product_id: string;
9
- created_at: string;
11
+ created_at?: string;
12
+ erp_settings?: (string | null);
13
+ erp_created_at?: (string | null);
14
+ erp_export_settings?: ("Exportable to Website" | "Exportable to Next" | "Available to sell")[];
10
15
  is_colourway_approved?: boolean;
11
16
  product_name?: (string | null);
17
+ erp_name?: (string | null);
12
18
  colour_id: string;
13
19
  colour_label?: (string | null);
14
20
  style_id: string;
15
- season_id: string;
21
+ season_id?: string;
16
22
  size_curves?: {
17
23
  channel?: string;
18
24
  name?: string;
19
25
  [k: string]: unknown;
20
26
  }[];
21
27
  plm_buying_quantities?: BuyingQuantitiesChannel[];
28
+ store_grade?: (string | null);
22
29
  drops?: DropChannel[];
30
+ direct_stock_buffer?: (number | null);
31
+ qa_completed?: (boolean | null);
32
+ warehouse_instructions?: (string | null);
33
+ available_to_sell_from?: (string | null);
34
+ processing_time_warehouse?: (number | null);
23
35
  stock_type?: (string | null);
24
36
  block?: (string | null);
25
37
  packing_method?: (string | null);
38
+ packaging_code?: (string | null);
26
39
  is_bought_in_product?: (boolean | null);
27
40
  reprocess_method?: (string | null);
28
41
  is_carry_over?: (boolean | null);
@@ -90,6 +103,9 @@ export interface ProductDraft {
90
103
  length_measurement?: (string | null);
91
104
  fabric_composition?: (string | null);
92
105
  };
106
+ preorder_options?: ("Never" | "Default" | "Weeks" | null);
107
+ preorder_num_period?: (string | null);
108
+ vat_posting_group_code?: (string | null);
93
109
  retail_price?: (Money | null);
94
110
  cost?: {
95
111
  current_cost?: (Money | null);
@@ -98,6 +114,8 @@ export interface ProductDraft {
98
114
  commission_rate?: (number | null);
99
115
  freight_rate?: (number | null);
100
116
  duty_rate?: (number | null);
117
+ unit_cost?: (Money | null);
118
+ last_direct_cost?: (Money | null);
101
119
  };
102
120
  duty?: {
103
121
  [k: string]: unknown;
@@ -111,6 +129,7 @@ export interface ProductDraft {
111
129
  port_of_origin?: (string | null);
112
130
  moq?: (number | null);
113
131
  supplier_id?: (string | null);
132
+ erp_supplier_id?: (string | null);
114
133
  supplier_name?: (string | null);
115
134
  factory_id?: (string | null);
116
135
  };
@@ -2,26 +2,39 @@ export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" |
2
2
  export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
3
3
  export type Country = ("AF" | "AX" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AI" | "AQ" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BM" | "BT" | "BO" | "BQ" | "BA" | "BW" | "BV" | "BR" | "IO" | "BN" | "BG" | "BF" | "BI" | "CV" | "KH" | "CM" | "CA" | "KY" | "CF" | "TD" | "CL" | "CN" | "CX" | "CC" | "CO" | "KM" | "CD" | "CG" | "CK" | "CR" | "CI" | "HR" | "CU" | "CW" | "CY" | "CZ" | "DK" | "DJ" | "DM" | "DO" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "SZ" | "ET" | "FK" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "TF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GI" | "GR" | "GL" | "GD" | "GP" | "GU" | "GT" | "GG" | "GN" | "GW" | "GY" | "HT" | "HM" | "VA" | "HN" | "HK" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "KP" | "KR" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LY" | "LI" | "LT" | "LU" | "MO" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MH" | "MQ" | "MR" | "MU" | "YT" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "MM" | "NA" | "NR" | "NP" | "NL" | "NC" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "MK" | "MP" | "NO" | "OM" | "PK" | "PW" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PN" | "PL" | "PT" | "PR" | "QA" | "RE" | "RO" | "RU" | "RW" | "BL" | "SH" | "KN" | "LC" | "MF" | "PM" | "VC" | "WS" | "SM" | "ST" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SB" | "SO" | "ZA" | "GS" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SE" | "CH" | "SY" | "TW" | "TJ" | "TZ" | "TH" | "TL" | "TG" | "TK" | "TO" | "TT" | "TN" | "TR" | "TM" | "TC" | "TV" | "UG" | "UA" | "AE" | "GB" | "UM" | "US" | "UY" | "UZ" | "VU" | "VE" | "VN" | "VG" | "VI" | "WF" | "EH" | "YE" | "ZM" | "ZW");
4
4
  export interface __MainSchema {
5
- development_colourway_id: string;
6
- development_style_id: string;
5
+ development_colourway_id?: string;
6
+ development_style_id?: string;
7
+ centric_id?: string;
8
+ style_centric_id?: string;
7
9
  product_id: string;
8
- created_at: string;
10
+ created_at?: string;
11
+ erp_settings?: (string | null);
12
+ erp_created_at?: (string | null);
13
+ erp_export_settings?: ("Exportable to Website" | "Exportable to Next" | "Available to sell")[];
9
14
  is_colourway_approved?: boolean;
10
15
  product_name?: (string | null);
16
+ erp_name?: (string | null);
11
17
  colour_id: string;
12
18
  colour_label?: (string | null);
13
19
  style_id: string;
14
- season_id: string;
20
+ season_id?: string;
15
21
  size_curves?: {
16
22
  channel?: string;
17
23
  name?: string;
18
24
  [k: string]: unknown;
19
25
  }[];
20
26
  plm_buying_quantities?: BuyingQuantitiesChannel[];
27
+ store_grade?: (string | null);
21
28
  drops?: DropChannel[];
29
+ direct_stock_buffer?: (number | null);
30
+ qa_completed?: (boolean | null);
31
+ warehouse_instructions?: (string | null);
32
+ available_to_sell_from?: (string | null);
33
+ processing_time_warehouse?: (number | null);
22
34
  stock_type?: (string | null);
23
35
  block?: (string | null);
24
36
  packing_method?: (string | null);
37
+ packaging_code?: (string | null);
25
38
  is_bought_in_product?: (boolean | null);
26
39
  reprocess_method?: (string | null);
27
40
  is_carry_over?: (boolean | null);
@@ -89,6 +102,9 @@ export interface __MainSchema {
89
102
  length_measurement?: (string | null);
90
103
  fabric_composition?: (string | null);
91
104
  };
105
+ preorder_options?: ("Never" | "Default" | "Weeks" | null);
106
+ preorder_num_period?: (string | null);
107
+ vat_posting_group_code?: (string | null);
92
108
  retail_price?: (Money | null);
93
109
  cost?: {
94
110
  current_cost?: (Money | null);
@@ -97,6 +113,8 @@ export interface __MainSchema {
97
113
  commission_rate?: (number | null);
98
114
  freight_rate?: (number | null);
99
115
  duty_rate?: (number | null);
116
+ unit_cost?: (Money | null);
117
+ last_direct_cost?: (Money | null);
100
118
  };
101
119
  duty?: {
102
120
  [k: string]: unknown;
@@ -110,6 +128,7 @@ export interface __MainSchema {
110
128
  port_of_origin?: (string | null);
111
129
  moq?: (number | null);
112
130
  supplier_id?: (string | null);
131
+ erp_supplier_id?: (string | null);
113
132
  supplier_name?: (string | null);
114
133
  factory_id?: (string | null);
115
134
  };
@@ -0,0 +1,31 @@
1
+ export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
2
+ export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
3
+ export interface __MainSchema {
4
+ style_id: string;
5
+ colour_id: string;
6
+ product_id: string;
7
+ size_code: string;
8
+ sku: string;
9
+ season_id: string;
10
+ drop: string;
11
+ document_line_no: string;
12
+ document_no: string;
13
+ created_at?: string;
14
+ location_code?: string;
15
+ quantity?: number;
16
+ quantity_received?: number;
17
+ quantity_to_receive?: number;
18
+ last_modified_at?: string;
19
+ expected_date?: string;
20
+ qa_completed_date?: string;
21
+ unit_price?: (Money | null);
22
+ }
23
+ export interface Money {
24
+ value: number;
25
+ decimal_places: number;
26
+ currency: Currency;
27
+ lcy_value: number;
28
+ lcy_currency: LCYCurrency;
29
+ lcy_decimal_places: number;
30
+ }
31
+ export default __MainSchema;
@@ -0,0 +1,30 @@
1
+ export type Currency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
2
+ export type LCYCurrency = ("AFN" | "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BSD" | "BHD" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | "BAM" | "BWP" | "NOK" | "BRL" | "BND" | "BGN" | "BIF" | "CVE" | "KHR" | "XAF" | "CAD" | "KYD" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "KMF" | "CDF" | "NZD" | "CRC" | "CUC" | "CUP" | "ANG" | "CZK" | "DKK" | "DJF" | "DOP" | "EGP" | "SVC" | "ERN" | "ETB" | "FKP" | "FJD" | "XPF" | "GMD" | "GEL" | "GHS" | "GIP" | "GTQ" | "GBP" | "GNF" | "GYD" | "HTG" | "HNL" | "HKD" | "HUF" | "ISK" | "IDR" | "XDR" | "IRR" | "IQD" | "ILS" | "JMD" | "JPY" | "JOD" | "KZT" | "KES" | "KPW" | "KRW" | "KWD" | "KGS" | "LAK" | "LBP" | "LSL" | "ZAR" | "LRD" | "LYD" | "CHF" | "MOP" | "MGA" | "MWK" | "MYR" | "MVR" | "MRU" | "MUR" | "XUA" | "MXN" | "MXV" | "MDL" | "MNT" | "MAD" | "MZN" | "MMK" | "NAD" | "NPR" | "NIO" | "NGN" | "OMR" | "PKR" | "PAB" | "PGK" | "PYG" | "PEN" | "PHP" | "PLN" | "QAR" | "MKD" | "RON" | "RUB" | "RWF" | "SHP" | "WST" | "STN" | "SAR" | "RSD" | "SCR" | "SLE" | "SGD" | "XSU" | "SBD" | "SOS" | "SSP" | "LKR" | "SDG" | "SRD" | "SZL" | "SEK" | "CHE" | "CHW" | "SYP" | "TWD" | "TJS" | "TZS" | "THB" | "TOP" | "TTD" | "TND" | "TRY" | "TMT" | "UGX" | "UAH" | "AED" | "USN" | "UYI" | "UYU" | "UZS" | "VUV" | "VEF" | "VED" | "VND" | "YER" | "ZMW" | "ZWL");
3
+ export interface __MainSchema {
4
+ style_id: string;
5
+ colour_id: string;
6
+ size_code: string;
7
+ location_code: string;
8
+ source_system: ("bc" | "centra" | "sitoo");
9
+ quantity: number;
10
+ description?: string;
11
+ entry_no?: string;
12
+ external_entry_no?: string;
13
+ document_no?: string;
14
+ external_document_no?: string;
15
+ type: ("transfer" | "negative adjustment" | "positive adjustment" | "purchase" | "sale");
16
+ unit_cost?: (Money | null);
17
+ document_date: string;
18
+ posting_date?: string;
19
+ created_at: string;
20
+ last_modified_at: string;
21
+ }
22
+ export interface Money {
23
+ value: number;
24
+ decimal_places: number;
25
+ currency: Currency;
26
+ lcy_value: number;
27
+ lcy_currency: LCYCurrency;
28
+ lcy_decimal_places: number;
29
+ }
30
+ export default __MainSchema;
@@ -45,15 +45,6 @@ declare class AirtableHelper<T extends Record<string, string>, K extends keyof T
45
45
  fieldsToMergeOn?: Array<keyof T>;
46
46
  primaryKeyWritable?: boolean;
47
47
  typecast?: boolean;
48
- }, callIdx?: number, collectedResult?: {
49
- updatedRecords: Array<string>;
50
- createdRecords: Array<string>;
51
- records: Array<{
52
- id: string;
53
- fields: {
54
- [key in T[keyof T]]: any;
55
- };
56
- } | Error>;
57
48
  }): Promise<{
58
49
  updatedRecords: Array<string>;
59
50
  createdRecords: Array<string>;
@@ -140,6 +140,8 @@ export default class CentraHelper extends EnvEngine {
140
140
  getCacheKeyForCountryCode(countryCode: string): string;
141
141
  getCacheKeyForMarkets(): string;
142
142
  getCacheKeyForMarket(marketExternalId: string): string;
143
+ getCacheKeyForCampaigns(): string;
144
+ getCacheKeyForCampaign(campaignName: string): string;
143
145
  getCacheKeyForSizeCharts(): string;
144
146
  getCacheKeyForCountries(): string;
145
147
  getCacheKeyForCountry(countryIso2Code: string): string;
@@ -163,6 +165,7 @@ export default class CentraHelper extends EnvEngine {
163
165
  private fetchCentraVariants;
164
166
  getCentraWarehouses(externalIds?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraWarehouse>>;
165
167
  getCentraPricelists(names?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicPricelist>>;
168
+ getCentraCampaigns(alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraMarket>>;
166
169
  getCentraMarkets(alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraMarket>>;
167
170
  getCentraCountries(iso2Codes?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraCountry>>;
168
171
  getCentraSizeCharts(externalIds?: string[] | null | undefined, alwaysFetch?: boolean): Promise<Error | Record<string, Error | BasicCentraSizeChart>>;
@@ -1,5 +1,5 @@
1
1
  import { IncomingMessage } from "http";
2
- import { type PubSub } from "@google-cloud/pubsub";
2
+ import type { PubSub } from "@google-cloud/pubsub";
3
3
  import { RateLimiterRedis } from "rate-limiter-flexible";
4
4
  import PubSubHelper from "./pubsub";
5
5
  import Runtime, { Opts as RuntimeOpts } from './runtime';
@@ -17,3 +17,4 @@ export { default as setHeaders } from './setHeaders';
17
17
  export { type CentraError, type CentraErrors, type BasicCentraCountry, type BasicCentraMarket, type BasicCentraSizeChart, type BasicPricelist, type BasicCentraWarehouse, type BasicCentraCampaign, type BasicCentraProduct, type BasicCentraVariant, type BasicCentraDisplay } from './centra';
18
18
  export { default as RateLimit, RedisConnectionError } from './rateLimit';
19
19
  export { type TriggerOnCreateOptions, type TriggerOnExecuteOptions, type NodeOptions, type RNConfiguration, type TriggerExtraOptions } from './types';
20
+ export { default as SitooHelper, type UnitCost, type StockMovementInput, type BasicSitooWarehouse, type BasicSitooStore, type BasicWarehouseTransaction, type WarehouseTransactionEnvelope, type WarehouseTransactionSyncOptions } from './sitoo';
@@ -5,6 +5,8 @@ declare global {
5
5
  var HUSH_PUBSUB_PUBLISH_TOPICS: Record<string, Topic>;
6
6
  }
7
7
  export declare function isSubscriptionBigQuery(opts: SubscriptionOptionsBigQuery | SubscriptionOptionsPull): opts is SubscriptionOptionsBigQuery;
8
+ type PublishAttributesGenerator<T> = (payload: any) => T;
9
+ type PublishAttributes = PublishAttributesGenerator<Record<string, string>> | Record<string, string> | Record<string, PublishAttributesGenerator<string | boolean | number> | boolean | number>;
8
10
  export type Message = {
9
11
  buildshipId: string;
10
12
  subscriptionName?: string;
@@ -57,7 +59,8 @@ declare class PubSubHelper extends Runtime {
57
59
  publish(options: Partial<Message> & {
58
60
  topicName: string;
59
61
  sourceSystem: string;
60
- attributesGenerator?: (payload: any) => Record<string, string>;
62
+ extraAttributes?: PublishAttributes;
63
+ attributesGenerator?: PublishAttributesGenerator<Record<string, string>>;
61
64
  }, payloads: Array<MessageBody>): Promise<Array<string | Error>>;
62
65
  createOrUpdate(opts: {
63
66
  topicName: string;
@@ -6,11 +6,9 @@ export type Opts = {
6
6
  workflowId?: string;
7
7
  workflow?: {
8
8
  id: string;
9
+ nodeValues?: Record<string, any>;
9
10
  };
10
11
  triggerId?: string;
11
- trigger?: {
12
- id: string;
13
- };
14
12
  url?: string;
15
13
  runtimeUrl?: string;
16
14
  request?: {
@@ -21,6 +19,12 @@ export type Opts = {
21
19
  triggerEnv?: any;
22
20
  runtimeEnv?: string;
23
21
  };
22
+ trigger?: {
23
+ id?: string;
24
+ meta?: {
25
+ name?: string;
26
+ };
27
+ };
24
28
  session?: {
25
29
  executedNodes: {
26
30
  [key: string]: {
@@ -45,13 +49,22 @@ export declare class Logging implements ILogging {
45
49
  export default class Runtime {
46
50
  readonly workflowId: string;
47
51
  readonly triggerId: string;
52
+ readonly triggerName: string;
53
+ readonly triggerVersion: string;
48
54
  readonly envName: string;
49
55
  readonly pubSubPrefix: string;
50
56
  readonly systemEnvName: string;
51
57
  readonly runtimeUrl: string;
52
58
  readonly logging: ILogging;
53
- readonly workflowRoot: any | null;
59
+ readonly triggerDataProperties: Record<string, any> | undefined;
60
+ readonly triggerConfigProperties: Record<string, any> | undefined;
61
+ readonly triggerConfig: Record<string, any> | undefined;
62
+ readonly workflowRoot: {
63
+ state?: Record<string, any>;
64
+ [key: string]: any;
65
+ };
54
66
  constructor(opts: Opts | Runtime);
67
+ enhanceWorkflowReturn(triggerReturn: any, triggerConfig: any): any;
55
68
  private getRuntimeUrl;
56
69
  private getSystemEnvName;
57
70
  private get isDeployment();