@shushed/helpers 0.0.229 → 0.0.230-fix-erp-780-20260109153401
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/dist/cjs/contracts/index.js +1 -5
- package/dist/cjs/contracts/product-draft.schema.json +5 -159
- package/dist/cjs/dist-dereferenced/index.js +1 -5
- package/dist/cjs/dist-dereferenced/messages/product-draft.js +1 -1
- package/dist/cjs/dist-dereferenced/product-draft.js +1 -1
- package/dist/cjs/src-public/airtable.js +59 -96
- package/dist/cjs/src-public/bcOrder.js +6 -2
- package/dist/cjs/src-public/centra.js +5 -56
- package/dist/cjs/src-public/env.js +1 -1
- package/dist/cjs/src-public/index.js +1 -3
- package/dist/cjs/src-public/pubsub.js +10 -36
- package/dist/cjs/src-public/runtime.js +9 -48
- package/dist/cjs/src-public/utils.js +0 -3
- package/dist/package.json +2 -3
- package/dist/types/contracts/index.d.ts +0 -2
- package/dist/types/dist-dereferenced/index.d.ts +0 -2
- package/dist/types/dist-dereferenced/messages/product-draft.d.ts +1 -148
- package/dist/types/dist-dereferenced/product-draft.d.ts +1 -148
- package/dist/types/dist-types/index.d.ts +0 -2
- package/dist/types/dist-types/messages/product-draft.d.ts +4 -23
- package/dist/types/dist-types/product-draft.d.ts +4 -23
- package/dist/types/src-public/airtable.d.ts +9 -0
- package/dist/types/src-public/centra.d.ts +0 -3
- package/dist/types/src-public/env.d.ts +1 -1
- package/dist/types/src-public/index.d.ts +0 -1
- package/dist/types/src-public/pubsub.d.ts +1 -4
- package/dist/types/src-public/runtime.d.ts +4 -17
- package/dist/types/src-public/types.d.ts +0 -6
- package/dist/types/src-public/utils.d.ts +1 -1
- package/package.json +3 -4
- package/dist/cjs/contracts/purchase-orderline.schema.json +0 -135
- package/dist/cjs/contracts/stock-movement.schema.json +0 -144
- package/dist/cjs/dist-dereferenced/purchase-orderline.js +0 -4
- package/dist/cjs/dist-dereferenced/stock-movement.js +0 -4
- package/dist/cjs/dist-types/purchase-orderline.js +0 -2
- package/dist/cjs/dist-types/stock-movement.js +0 -2
- package/dist/cjs/src-public/sitoo.js +0 -349
- package/dist/types/dist-dereferenced/purchase-orderline.d.ts +0 -114
- package/dist/types/dist-dereferenced/stock-movement.d.ts +0 -110
- package/dist/types/dist-types/purchase-orderline.d.ts +0 -31
- package/dist/types/dist-types/stock-movement.d.ts +0 -30
- package/dist/types/src-public/sitoo.d.ts +0 -254
|
@@ -1,30 +0,0 @@
|
|
|
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;
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import EnvEngine from './env';
|
|
2
|
-
import Runtime from './runtime';
|
|
3
|
-
export declare enum SitooOrderState {
|
|
4
|
-
Abandoned = -1,
|
|
5
|
-
Open = 0,
|
|
6
|
-
Closed = 10,
|
|
7
|
-
Cancelled = 20
|
|
8
|
-
}
|
|
9
|
-
export declare enum SitooOrderType {
|
|
10
|
-
Order = 10,
|
|
11
|
-
Booking = 100,
|
|
12
|
-
POSParked = 110
|
|
13
|
-
}
|
|
14
|
-
export declare enum SitooPaymentState {
|
|
15
|
-
None = 0,
|
|
16
|
-
Pending = 10,
|
|
17
|
-
Reserved = 15,
|
|
18
|
-
Successful = 20,
|
|
19
|
-
Cancelled = 30,
|
|
20
|
-
Failed = 40
|
|
21
|
-
}
|
|
22
|
-
export declare enum SitooOrderItemType {
|
|
23
|
-
Product = 10,
|
|
24
|
-
Discount = 20
|
|
25
|
-
}
|
|
26
|
-
export interface SitooMoney {
|
|
27
|
-
value: string;
|
|
28
|
-
decimalplaces: number;
|
|
29
|
-
currency: string;
|
|
30
|
-
}
|
|
31
|
-
export interface SitooOrderItemSalesTax {
|
|
32
|
-
name: string;
|
|
33
|
-
code?: string;
|
|
34
|
-
externalid?: string | null;
|
|
35
|
-
groupregion?: string | null;
|
|
36
|
-
moneytotal: SitooMoney;
|
|
37
|
-
moneytax: SitooMoney;
|
|
38
|
-
decimaltaxvalue: string;
|
|
39
|
-
}
|
|
40
|
-
export interface SitooOrderItem {
|
|
41
|
-
orderitemid: number;
|
|
42
|
-
orderitemtype: SitooOrderItemType;
|
|
43
|
-
productid?: number;
|
|
44
|
-
productname: string;
|
|
45
|
-
sku?: string;
|
|
46
|
-
productattributes?: string;
|
|
47
|
-
externalid?: string | null;
|
|
48
|
-
externalidaliased?: string | null;
|
|
49
|
-
unitlabel?: string;
|
|
50
|
-
decimalunitquantity?: string;
|
|
51
|
-
quantity: number;
|
|
52
|
-
decimalquantity?: string;
|
|
53
|
-
moneyrowprice: SitooMoney;
|
|
54
|
-
moneyrowdiscount?: SitooMoney;
|
|
55
|
-
moneyrow: SitooMoney;
|
|
56
|
-
vatvalue?: number;
|
|
57
|
-
deliveryinfo?: string | null;
|
|
58
|
-
salestaxes?: SitooOrderItemSalesTax[];
|
|
59
|
-
additionaldata?: Record<string, string>;
|
|
60
|
-
}
|
|
61
|
-
export interface SitooOrderPayment {
|
|
62
|
-
name: string;
|
|
63
|
-
moneyamount: SitooMoney;
|
|
64
|
-
externalid?: string | null;
|
|
65
|
-
reftype?: string | null;
|
|
66
|
-
refid?: string | null;
|
|
67
|
-
cardissuer?: string | null;
|
|
68
|
-
additionaldata?: Record<string, string>;
|
|
69
|
-
reservedpaymentid?: string | null;
|
|
70
|
-
}
|
|
71
|
-
export interface SitooOrderReservedPayment {
|
|
72
|
-
id: string;
|
|
73
|
-
name: string;
|
|
74
|
-
moneyreserved: SitooMoney;
|
|
75
|
-
externalid?: string | null;
|
|
76
|
-
reftype?: string | null;
|
|
77
|
-
refid?: string | null;
|
|
78
|
-
cardissuer?: string | null;
|
|
79
|
-
additionaldata?: Record<string, string>;
|
|
80
|
-
}
|
|
81
|
-
export interface SitooOrder {
|
|
82
|
-
orderid: number;
|
|
83
|
-
orderstate: SitooOrderState;
|
|
84
|
-
ordertype: SitooOrderType;
|
|
85
|
-
paymentstate: SitooPaymentState;
|
|
86
|
-
datecreated: number;
|
|
87
|
-
datemodified?: number;
|
|
88
|
-
orderdate?: number;
|
|
89
|
-
ordertypename?: string;
|
|
90
|
-
registerid?: string;
|
|
91
|
-
warehouseid?: number;
|
|
92
|
-
storeid?: number;
|
|
93
|
-
email?: string | null;
|
|
94
|
-
namefirst?: string;
|
|
95
|
-
namelast?: string;
|
|
96
|
-
company?: string;
|
|
97
|
-
phone?: string | null;
|
|
98
|
-
personalid?: string;
|
|
99
|
-
externalid?: string | null;
|
|
100
|
-
comment?: string | null;
|
|
101
|
-
commentinternal?: string | null;
|
|
102
|
-
currencycode?: string;
|
|
103
|
-
moneytotal: SitooMoney;
|
|
104
|
-
moneytotaldiscount?: SitooMoney;
|
|
105
|
-
moneyrounding?: SitooMoney;
|
|
106
|
-
moneytotalpayments?: SitooMoney;
|
|
107
|
-
moneytotalreservedpayments?: SitooMoney;
|
|
108
|
-
orderitems?: SitooOrderItem[];
|
|
109
|
-
payments?: SitooOrderPayment[];
|
|
110
|
-
reservedpayments?: SitooOrderReservedPayment[];
|
|
111
|
-
additionaldata?: Record<string, string>;
|
|
112
|
-
address?: string;
|
|
113
|
-
address2?: string;
|
|
114
|
-
zip?: string;
|
|
115
|
-
city?: string;
|
|
116
|
-
state?: string;
|
|
117
|
-
countryid?: string;
|
|
118
|
-
invoicenamefirst?: string;
|
|
119
|
-
invoicenamelast?: string;
|
|
120
|
-
invoicecompany?: string;
|
|
121
|
-
invoiceaddress?: string;
|
|
122
|
-
invoiceaddress2?: string;
|
|
123
|
-
invoicezip?: string;
|
|
124
|
-
invoicecity?: string;
|
|
125
|
-
invoicestate?: string;
|
|
126
|
-
invoicecountryid?: string;
|
|
127
|
-
}
|
|
128
|
-
export interface GetAllOrdersOptions {
|
|
129
|
-
fromTimestamp?: number;
|
|
130
|
-
untilTimestamp?: number;
|
|
131
|
-
filterByState?: SitooOrderState;
|
|
132
|
-
}
|
|
133
|
-
export interface SitooOrdersEnvelope {
|
|
134
|
-
totalcount: number;
|
|
135
|
-
items: SitooOrder[];
|
|
136
|
-
}
|
|
137
|
-
export interface UnitCost {
|
|
138
|
-
value: number;
|
|
139
|
-
decimal_places: number;
|
|
140
|
-
currency: string;
|
|
141
|
-
lcy_value: number;
|
|
142
|
-
lcy_currency: string;
|
|
143
|
-
lcy_decimal_places: number;
|
|
144
|
-
}
|
|
145
|
-
export interface StockMovementInput {
|
|
146
|
-
style_id: string;
|
|
147
|
-
colour_id: string;
|
|
148
|
-
size_code: string;
|
|
149
|
-
location_code: string;
|
|
150
|
-
last_updated_at?: string;
|
|
151
|
-
entry_no: string;
|
|
152
|
-
quantity: number;
|
|
153
|
-
document_no: string;
|
|
154
|
-
external_document_no?: string;
|
|
155
|
-
type: 'transfer' | 'negative adjustment' | 'positive adjustment' | 'purchase' | 'sale';
|
|
156
|
-
unit_cost?: UnitCost;
|
|
157
|
-
document_date?: string;
|
|
158
|
-
posting_date?: string;
|
|
159
|
-
created_at: string;
|
|
160
|
-
}
|
|
161
|
-
export type BasicSitooWarehouse = {
|
|
162
|
-
warehouseid: number;
|
|
163
|
-
warehousetype: string;
|
|
164
|
-
usetype: string;
|
|
165
|
-
storeid: number;
|
|
166
|
-
sellable: boolean;
|
|
167
|
-
name: string;
|
|
168
|
-
externalId: number;
|
|
169
|
-
};
|
|
170
|
-
export type BasicSitooStore = {
|
|
171
|
-
storeid: number;
|
|
172
|
-
name: string;
|
|
173
|
-
externalId: number;
|
|
174
|
-
};
|
|
175
|
-
export type BasicWarehouseTransaction = {
|
|
176
|
-
warehousetransactionid: number;
|
|
177
|
-
warehouseid: number;
|
|
178
|
-
datecreated: number;
|
|
179
|
-
transactiontype: number;
|
|
180
|
-
description: string;
|
|
181
|
-
orderdeliveryid: number | null;
|
|
182
|
-
shipmentid: number | null;
|
|
183
|
-
externalid: string | null;
|
|
184
|
-
reasoncode: string | null;
|
|
185
|
-
items: Array<{
|
|
186
|
-
decimalquantity: string;
|
|
187
|
-
decimaltotal: string;
|
|
188
|
-
moneypricein: string;
|
|
189
|
-
moneytotal: string;
|
|
190
|
-
moneyvalue: string;
|
|
191
|
-
sku: string;
|
|
192
|
-
}>;
|
|
193
|
-
};
|
|
194
|
-
export type WarehouseTransactionEnvelope = {
|
|
195
|
-
totalcount: number;
|
|
196
|
-
items: BasicWarehouseTransaction[];
|
|
197
|
-
};
|
|
198
|
-
export interface WarehouseTransactionSyncOptions {
|
|
199
|
-
preview?: boolean;
|
|
200
|
-
skuGenerator?: (styleId: string, colourId: string, sizeCode: string) => string;
|
|
201
|
-
}
|
|
202
|
-
export interface WarehouseTransactionSyncResult {
|
|
203
|
-
found: Array<{
|
|
204
|
-
entryNo: string;
|
|
205
|
-
transactionId: number;
|
|
206
|
-
}>;
|
|
207
|
-
missing: string[];
|
|
208
|
-
created: Array<{
|
|
209
|
-
entryNo: string;
|
|
210
|
-
transactionId: number;
|
|
211
|
-
}>;
|
|
212
|
-
errors: Array<{
|
|
213
|
-
entryNo: string;
|
|
214
|
-
error: string;
|
|
215
|
-
}>;
|
|
216
|
-
firestoreUpdated: boolean;
|
|
217
|
-
skipped: Array<{
|
|
218
|
-
entryNo: string;
|
|
219
|
-
reason: string;
|
|
220
|
-
}>;
|
|
221
|
-
}
|
|
222
|
-
export interface FirestoreCacheDocument {
|
|
223
|
-
[entryNo: string]: number;
|
|
224
|
-
}
|
|
225
|
-
export default class SitooHelper extends EnvEngine {
|
|
226
|
-
protected opts: {
|
|
227
|
-
accessToken: string;
|
|
228
|
-
sitooBaseUrl: string;
|
|
229
|
-
sitooSiteId: number;
|
|
230
|
-
};
|
|
231
|
-
shaToken: string;
|
|
232
|
-
baseUrl: string;
|
|
233
|
-
siteId: number;
|
|
234
|
-
constructor(options: ConstructorParameters<typeof Runtime>[0], opts: {
|
|
235
|
-
accessToken: string;
|
|
236
|
-
sitooBaseUrl: string;
|
|
237
|
-
sitooSiteId: number;
|
|
238
|
-
});
|
|
239
|
-
getAllOrders(options?: GetAllOrdersOptions): Promise<SitooOrder[]>;
|
|
240
|
-
getSitooWarehouses(): Promise<{
|
|
241
|
-
nameToId: Record<string, number>;
|
|
242
|
-
warehouses: Record<number, BasicSitooWarehouse>;
|
|
243
|
-
}>;
|
|
244
|
-
private fetchWarehouseTransactionsWithFilter;
|
|
245
|
-
private searchTransactionsInApi;
|
|
246
|
-
private batchAddWarehouseTransactions;
|
|
247
|
-
syncWarehouseTransactions(items: StockMovementInput[], options?: WarehouseTransactionSyncOptions): Promise<Array<{
|
|
248
|
-
entryNo: string;
|
|
249
|
-
transactionId: number;
|
|
250
|
-
} | Error | {
|
|
251
|
-
error: boolean;
|
|
252
|
-
message: string;
|
|
253
|
-
}>>;
|
|
254
|
-
}
|