repzo-sap-absjo 1.0.52 → 1.0.54

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 (41) hide show
  1. package/lib/actions/create_client.d.ts +8 -0
  2. package/lib/actions/create_client.js +206 -0
  3. package/lib/actions/create_invoice.d.ts +1 -1
  4. package/lib/actions/create_payment.d.ts +1 -1
  5. package/lib/actions/create_proforma.d.ts +1 -1
  6. package/lib/actions/create_return_invoice.d.ts +1 -1
  7. package/lib/actions/create_transfer.d.ts +1 -1
  8. package/lib/actions/index.d.ts +1 -1
  9. package/lib/actions/index.js +3 -0
  10. package/lib/commands/join.js +34 -4
  11. package/lib/index.d.ts +1 -1
  12. package/lib/test/actions/create_client.d.ts +1 -0
  13. package/lib/test/actions/create_client.js +141 -0
  14. package/lib/test/commands/join.js +165 -84
  15. package/lib/types.d.ts +3 -0
  16. package/lib/util.d.ts +4 -4
  17. package/package.json +5 -3
  18. package/src/actions/create_client.ts +185 -0
  19. package/src/actions/create_invoice.ts +2 -2
  20. package/src/actions/index.ts +3 -0
  21. package/src/commands/adjust_inventory.ts +2 -2
  22. package/src/commands/bank.ts +5 -1
  23. package/src/commands/brand.ts +2 -2
  24. package/src/commands/category.ts +2 -2
  25. package/src/commands/channel.ts +2 -2
  26. package/src/commands/client.ts +2 -2
  27. package/src/commands/client_disabled.ts +2 -2
  28. package/src/commands/join.ts +8 -0
  29. package/src/commands/measureunit.ts +2 -2
  30. package/src/commands/payment_term.ts +2 -2
  31. package/src/commands/price_list.ts +2 -2
  32. package/src/commands/price_list_disabled.ts +2 -2
  33. package/src/commands/product.ts +8 -4
  34. package/src/commands/product_disabled.ts +8 -4
  35. package/src/commands/rep.ts +1 -1
  36. package/src/commands/tag.ts +2 -2
  37. package/src/commands/tax.ts +2 -2
  38. package/src/commands/warehouse.ts +2 -2
  39. package/src/test/actions/create_client.ts +141 -0
  40. package/src/test/commands/join.ts +165 -84
  41. package/src/types.ts +1 -0
@@ -1,29 +1,24 @@
1
1
  import { Commands } from "../../index.js";
2
2
  let commandEvent = {
3
3
  app: {
4
- _id: "6391a53edb71ef6435719794",
5
- name: "SAP",
4
+ _id: "68d11f0322e5865ce90326fe",
5
+ name: "SAP Integration ",
6
6
  disabled: false,
7
7
  available_app: {
8
- _id: "6391a268db71ef64357195da",
8
+ _id: "639ee4cf462a9df7c25cef4c",
9
9
  name: "repzo-sap-absjo",
10
10
  title: "SAP ABS JO",
11
- logo: "https://www.e2abs.com/wp-content/uploads/2021/03/Website-Main-Logo-1.svg",
12
- description: "",
11
+ logo: "https://prod-repzo-media-service.s3.us-east-1.amazonaws.com/repzo/image/2022/12/18/3f73de7d-1920-4786-90db-57c76d18acci-SAP_EBS_JO.png",
12
+ description:
13
+ "SAP Jordan. We provide real value to SMEs by understanding their business and driving their vision forward with SAP Business One",
13
14
  disabled: false,
14
15
  JSONSchema: {
15
16
  title: "SAP Integration Settings",
16
17
  type: "object",
17
18
  required: ["repzoApiKey", "sapHostUrl"],
18
19
  properties: {
19
- repzoApiKey: {
20
- type: "string",
21
- title: "Repzo API KEY",
22
- },
23
- sapHostUrl: {
24
- type: "string",
25
- title: "SAP Host Url",
26
- },
20
+ repzoApiKey: { type: "string", title: "Repzo API KEY" },
21
+ sapHostUrl: { type: "string", title: "SAP Host Url" },
27
22
  errorEmail: {
28
23
  type: "string",
29
24
  format: "email",
@@ -44,11 +39,22 @@ let commandEvent = {
44
39
  format: "string",
45
40
  title: "Invoice/Return Department Code",
46
41
  },
47
- return_reason: {
42
+ return_reasons: {
48
43
  type: "string",
49
44
  format: "string",
50
45
  title: "Return Reason Array",
51
46
  },
47
+ measureUnitInjections: {
48
+ type: "string",
49
+ format: "string",
50
+ title:
51
+ 'Uom Injection Array, example: [{ "itemCode": "010-KEA-JU0003", "uom": "PC" }]',
52
+ },
53
+ defaultWarehouseForSalesOrder: {
54
+ type: "string",
55
+ format: "string",
56
+ title: "Default Warehouse Code For Sales Orders",
57
+ },
52
58
  SalPersCode: {
53
59
  type: "string",
54
60
  format: "string",
@@ -110,6 +116,24 @@ let commandEvent = {
110
116
  title: "Live Sync Approved Transfers from Repzo to SAP",
111
117
  default: false,
112
118
  },
119
+ adjustInventoryInFailedTransfer: {
120
+ type: "boolean",
121
+ title:
122
+ "Adjust Inventories in Repzo if creation Transfer Failed in SAP",
123
+ default: false,
124
+ },
125
+ },
126
+ },
127
+ client: {
128
+ type: "object",
129
+ title: "Client",
130
+ required: ["createClientHook"],
131
+ properties: {
132
+ createClientHook: {
133
+ type: "boolean",
134
+ title: "Live Sync Clients from Repzo to SAP",
135
+ default: false,
136
+ },
113
137
  },
114
138
  },
115
139
  },
@@ -124,122 +148,189 @@ let commandEvent = {
124
148
  type: "string",
125
149
  format: "date",
126
150
  },
151
+ bench_time_channel: {
152
+ title: "Bench Time: Channels",
153
+ type: "string",
154
+ format: "date-time",
155
+ },
156
+ bench_time_payment_term: {
157
+ title: "Bench Time: Payment Terms",
158
+ type: "string",
159
+ format: "date-time",
160
+ },
161
+ bench_time_product: {
162
+ title: "Bench Time: Products",
163
+ type: "string",
164
+ format: "date-time",
165
+ },
166
+ bench_time_product_disabled: {
167
+ title: "Bench Time: Inactive Products",
168
+ type: "string",
169
+ format: "date-time",
170
+ },
171
+ bench_time_price_list: {
172
+ title: "Bench Time: Price List",
173
+ type: "string",
174
+ format: "date-time",
175
+ },
176
+ bench_time_client: {
177
+ title: "Bench Time: Clients",
178
+ type: "string",
179
+ format: "date-time",
180
+ },
181
+ bench_time_disabled_client: {
182
+ title: "Bench Time: Inactive Clients",
183
+ type: "string",
184
+ format: "date-time",
185
+ },
127
186
  },
128
187
  },
129
188
  app_settings: {
130
189
  repo: "",
131
190
  serviceEndPoint: "",
132
- _id: "6391a268db71ef64357195db",
191
+ _id: "639ee4cf462a9df7c25cef4d",
133
192
  },
134
- app_category: "6249fa8466312f76e595634a",
193
+ app_category: "629c62fcff7a8a2dc7a21ba1",
135
194
  commands: [
136
195
  {
137
196
  command: "basic",
138
197
  name: "Full Sync",
139
- description: "",
140
- _id: "6391a268db71ef64357195dc",
198
+ description: "Exclude Join & Adjust Inventories",
199
+ group_sync: false,
200
+ _id: "639ee4cf462a9df7c25cef4e",
141
201
  },
142
202
  {
143
203
  command: "join",
144
204
  name: "Join",
145
205
  description: "",
146
- _id: "6391a268db71ef64357195dd",
206
+ group_sync: false,
207
+ _id: "639ee4cf462a9df7c25cef4f",
147
208
  },
148
209
  {
149
210
  command: "warehouse",
150
211
  name: "Sync Warehouse",
151
212
  description: "Sync Warehouses From SAP to Repzo",
152
- _id: "6391c42a1b0f4f7a30e40f40",
213
+ group_sync: false,
214
+ _id: "639ee4cf462a9df7c25cef50",
153
215
  },
154
216
  {
155
217
  command: "rep",
156
218
  name: "Sync Representatives",
157
219
  description: "Sync Representatives From SAP to Repzo",
158
- _id: "639715c2bee5dd4b6b11e129",
220
+ group_sync: false,
221
+ _id: "639ee4cf462a9df7c25cef51",
159
222
  },
160
223
  {
161
224
  command: "tax",
162
225
  name: "Sync Taxes",
163
226
  description: "Sync Taxes From SAP to Repzo",
164
- _id: "639715c2bee5dd4b6b11e12a",
227
+ group_sync: false,
228
+ _id: "639ee4cf462a9df7c25cef52",
165
229
  },
166
230
  {
167
231
  command: "tag",
168
232
  name: "Sync Area Tags",
169
233
  description: "Sync Area Tags From SAP to Repzo",
170
- _id: "639715c2bee5dd4b6b11e12b",
234
+ group_sync: false,
235
+ _id: "639ee4cf462a9df7c25cef53",
171
236
  },
172
237
  {
173
238
  command: "measureunit",
174
239
  name: "Sync Measure Units",
175
240
  description: "Sync Measure Units From SAP to Repzo",
176
- _id: "639817eaedafde008af0ad0e",
241
+ group_sync: false,
242
+ _id: "639ee4cf462a9df7c25cef54",
177
243
  },
178
244
  {
179
245
  command: "measureunit_family",
180
246
  name: "Sync Measure Units Family",
181
247
  description: "Sync Measure Units Family From SAP to Repzo",
182
- _id: "63982d09edafde008af0f698",
248
+ group_sync: false,
249
+ _id: "639ee4cf462a9df7c25cef55",
183
250
  },
184
251
  {
185
252
  command: "category",
186
253
  name: "Sync Product Category",
187
254
  description: "Sync Product Categories From SAP to Repzo",
255
+ group_sync: false,
256
+ _id: "639ee4cf462a9df7c25cef56",
257
+ },
258
+ {
259
+ command: "brand",
260
+ name: "Sync Product Brand",
261
+ description: "Sync Product Brands From SAP to Repzo",
262
+ group_sync: false,
188
263
  _id: "63984085edafde008af2f689",
189
264
  },
190
265
  {
191
266
  command: "channel",
192
267
  name: "Sync Client's Channels",
193
268
  description: "Sync Client's Channels From SAP to Repzo",
194
- _id: "63984085edafde008af2f689",
269
+ group_sync: false,
270
+ _id: "639ee4cf462a9df7c25cef57",
195
271
  },
196
272
  {
197
273
  command: "payment_term",
198
274
  name: "Sync Payments Term",
199
275
  description: "Sync Payments Term From SAP to Repzo",
200
- _id: "63984085edafde008af2f68a",
276
+ group_sync: false,
277
+ _id: "639ee4cf462a9df7c25cef58",
201
278
  },
202
279
  {
203
280
  command: "bank",
204
281
  name: "Sync Banks",
205
282
  description: "Sync Banks From SAP to Repzo",
206
- _id: "63986018333b84929c538570",
283
+ group_sync: false,
284
+ _id: "639ee4cf462a9df7c25cef59",
207
285
  },
208
286
  {
209
287
  command: "product",
210
288
  name: "Sync Products",
211
289
  description: "Sync Active Products From SAP to Repzo",
212
- _id: "63987139333b84929c53a293",
290
+ group_sync: false,
291
+ _id: "639ee4cf462a9df7c25cef5a",
213
292
  },
214
293
  {
215
294
  command: "disabled_product",
216
295
  name: "Sync Inactive Products",
217
296
  description: "Sync Inactive Products From SAP to Repzo",
218
- _id: "6399714d0242db686d496466",
297
+ group_sync: false,
298
+ _id: "639ee4cf462a9df7c25cef5b",
219
299
  },
220
300
  {
221
301
  command: "price_list",
222
302
  name: "Sync Price Lists",
223
303
  description: "Sync Price Lists From SAP to Repzo",
224
- _id: "639972d6e8a1cfdd26deaa7e",
304
+ group_sync: false,
305
+ _id: "639ee4cf462a9df7c25cef5c",
306
+ },
307
+ {
308
+ command: "price_list_disabled",
309
+ name: "Sync Disbaled Price List Items",
310
+ description: "Sync Disbaled Price List Items From SAP to Repzo",
311
+ group_sync: false,
312
+ _id: "656ed4098961a3f97182773f",
225
313
  },
226
314
  {
227
315
  command: "client",
228
316
  name: "Sync Clients",
229
317
  description: "Sync Clients From SAP to Repzo",
230
- _id: "63997615e8a1cfdd26ded7d1",
318
+ group_sync: false,
319
+ _id: "639ee4cf462a9df7c25cef5d",
231
320
  },
232
321
  {
233
322
  command: "disabled_client",
234
323
  name: "Sync Inactive Clients",
235
324
  description: "Sync Inactive Clients From SAP to Repzo",
236
- _id: "639ac554e157f1c63770c1bc",
325
+ group_sync: false,
326
+ _id: "639ee4cf462a9df7c25cef5e",
237
327
  },
238
328
  {
239
329
  command: "adjust_inventory",
240
330
  name: "Adjust Inventories",
241
331
  description: "Adjust Inventories From SAP to Repzo",
242
- _id: "639ac56fe157f1c63770c2eb",
332
+ group_sync: false,
333
+ _id: "639ee4cf462a9df7c25cef5f",
243
334
  },
244
335
  ],
245
336
  actions: [
@@ -247,93 +338,83 @@ let commandEvent = {
247
338
  action: "create_invoice",
248
339
  name: "Sync Invoices",
249
340
  description: "Sync Invoices From Repzo to SAP",
250
- _id: "639ebeacdbba64d7af94520c",
341
+ _id: "639ee4cf462a9df7c25cef60",
251
342
  },
252
343
  {
253
344
  action: "create_return_invoice",
254
345
  name: "Sync Return Invoices",
255
346
  description: "Sync Return Invoices From Repzo to SAP",
256
- _id: "639ebeacdbba64d7af94520d",
347
+ _id: "639ee4cf462a9df7c25cef61",
257
348
  },
258
349
  {
259
350
  action: "create_proforma",
260
351
  name: "Sync Approved Sales Orders",
261
352
  description: "Sync Approved Sales Orders From Repzo to SAP",
262
- _id: "639ebeacdbba64d7af94520e",
353
+ _id: "639ee4cf462a9df7c25cef62",
263
354
  },
264
355
  {
265
356
  action: "create_payment",
266
357
  name: "Sync Paymants",
267
358
  description: "Sync Paymants From Repzo to SAP",
268
- _id: "639ebeacdbba64d7af94520f",
359
+ _id: "639ee4cf462a9df7c25cef63",
269
360
  },
270
361
  {
271
362
  action: "create_transfer",
272
363
  name: "Sync Approved Transfers",
273
364
  description: "Sync Approved Transfers From Repzo to SAP",
274
- _id: "639ebeacdbba64d7af945210",
365
+ _id: "639ee4cf462a9df7c25cef64",
366
+ },
367
+ {
368
+ action: "create_client",
369
+ name: "Sync Approved Clients",
370
+ description: "Sync Approved Clients From Repzo to SAP",
371
+ _id: "68edeaa0bfbb2c273b91736f",
275
372
  },
276
373
  ],
277
- createdAt: "2022-12-08T08:38:00.915Z",
278
- updatedAt: "2022-12-18T09:01:24.539Z",
374
+ createdAt: "2022-12-18T10:00:47.414Z",
375
+ updatedAt: "2025-10-14T06:16:00.977Z",
279
376
  __v: 0,
377
+ subscription_billing_mode: "free",
280
378
  },
281
- company_namespace: ["unisap"],
379
+ company_namespace: ["hassanein1"],
282
380
  formData: {
283
- invoices: {
284
- createInvoiceHook: false,
285
- createReturnInvoiceHook: false,
286
- },
287
- payments: {
288
- createPaymentHook: false,
289
- },
290
- proformas: {
291
- createApprovedProformaHook: false,
292
- },
381
+ repzoApiKey: "SZx76pM2TiuFt9kK7fsBCLkW7oY8qA8pIjUHdmgzdZg",
382
+ sapHostUrl: "https://abs-dmz.b1pro.com:9001/api",
383
+ invoices: { createInvoiceHook: true, createReturnInvoiceHook: true },
384
+ payments: { createPaymentHook: true },
385
+ proformas: { createApprovedProformaHook: true },
293
386
  transfers: {
294
- createApprovedTransferHook: false,
295
- },
296
- transfer: {
297
387
  createApprovedTransferHook: true,
388
+ adjustInventoryInFailedTransfer: true,
298
389
  },
299
- repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
300
- sapHostUrl: "http://unipal.b1pro.com:8083/api",
301
- errorEmail: "maram.alshen@repzoapp.com",
302
- serviceApiKey: "awdas",
303
- warehouseDefaultUpdateDate: "2015-01-01",
304
- DepartmentCode: "D2",
305
- return_reason:
306
- '[{sap_id:1,sap_name:"BarcodeIssue",repzo_name:"Barcodeissue",repzo_id:"62b074972b332895edf114fc"},{sap_id:2,sap_name:"Damaged",repzo_name:"Damaged",repzo_id:"62b074ace96258fb745982e4"},{sap_id:3,sap_name:"Nearexpiry",repzo_name:"Nearexpiry",repzo_id:"62b074c0a066173bd1c1ea0d"},{sap_id:4,sap_name:"Wrongprinting",repzo_name:"Wrongprinting",repzo_id:"62b074d79e7f41f306a4cb42"},{sap_id:5,sap_name:"experied",repzo_name:"Experied",repzo_id:"62b074faa066173bd1c1eec0"}]',
307
- SalPersCode: "111",
308
- SalesPersonCode: "111",
390
+ client: { createClientHook: true },
309
391
  },
310
392
  options_formData: {
311
- bench_time_warehouse: "2022-12-08",
312
- bench_time_rep: "2022-12-12T11:43:07.899Z",
313
- bench_time_tax: "2022-12-13T05:52:47.025Z",
314
- bench_time_tag: "2022-12-13T06:00:22.724Z",
315
- bench_time_measureunit: "2022-12-13T06:48:44.370Z",
316
- bench_time_measureunit_family: "2022-12-13T08:27:26.562Z",
317
- bench_time_category: "2022-12-13T09:14:26.572Z",
318
- bench_time_channel: "2022-12-13T09:18:07.697Z",
319
- bench_time_payment_term: "2022-12-13T09:19:50.316Z",
320
- bench_time_bank: "2022-12-13T11:50:08.710Z",
321
- bench_time_product: "2022-12-18T05:48:21.443Z",
322
- bench_time_product_disabled: "2022-12-14T06:53:26.903Z",
323
- bench_time_price_list: "2022-12-14T11:41:36.811Z",
324
- bench_time_client: "2022-12-18T05:28:57.853Z",
325
- bench_time_disabled_client: "2022-12-18T05:40:29.169Z",
393
+ bench_time_warehouse: "2025-01-01",
394
+ bench_time_channel: "2025-09-22T11:59:38.667Z",
395
+ bench_time_payment_term: "2025-09-24T09:04:47.049Z",
396
+ bench_time_product: "2025-10-06T10:10:13.619Z",
397
+ bench_time_price_list: "2025-10-14T11:00:40.686Z",
398
+ bench_time_client: "2025-10-14T11:20:40.049Z",
399
+ bench_time_rep: "2025-10-12T10:40:25.535Z",
400
+ bench_time_tax: "2025-09-22T12:05:46.901Z",
401
+ bench_time_tag: "2025-09-22T12:06:01.041Z",
402
+ bench_time_measureunit: "2025-10-06T10:16:06.878Z",
403
+ bench_time_measureunit_family: "2025-09-29T13:21:39.534Z",
404
+ bench_time_category: "2025-09-24T09:04:43.969Z",
405
+ bench_time_brand: "2025-09-22T11:59:36.800Z",
406
+ bench_time_price_list_disabled: "2025-09-22T12:23:39.010Z",
326
407
  },
327
- createdAt: "2022-12-08T08:50:06.903Z",
328
- updatedAt: "2022-12-18T09:02:48.580Z",
408
+ createdAt: "2025-09-22T10:03:47.010Z",
409
+ updatedAt: "2025-10-14T11:20:48.859Z",
329
410
  __v: 0,
330
411
  },
331
412
  end_of_day: "04:00",
332
- nameSpace: ["unisap"],
413
+ nameSpace: ["hassanein1"],
333
414
  timezone: "Asia/Amman",
334
415
  meta: "",
335
416
  env: "staging",
336
- sync_id: "47c9c804-e136-4d54-928a-000017",
417
+ sync_id: "bacad499-81e4-4925-bba4-b1f0befb7b21",
337
418
  command: "join",
338
419
  };
339
420
  Commands(commandEvent);
package/lib/types.d.ts CHANGED
@@ -113,6 +113,9 @@ export interface FormData {
113
113
  createApprovedTransferHook?: boolean;
114
114
  adjustInventoryInFailedTransfer?: boolean;
115
115
  };
116
+ client?: {
117
+ createClientHook?: boolean;
118
+ };
116
119
  }
117
120
  interface OptionsFormData {
118
121
  bench_time_warehouse?: string;
package/lib/util.d.ts CHANGED
@@ -16,27 +16,27 @@ export declare const _fetch: (
16
16
  path: string,
17
17
  headers?: Headers,
18
18
  params?: Params
19
- ) => Promise<any>;
19
+ ) => Promise<unknown>;
20
20
  export declare const _create: (
21
21
  baseUrl: string,
22
22
  path: string,
23
23
  body: Data,
24
24
  headers?: Headers,
25
25
  params?: Params
26
- ) => Promise<any>;
26
+ ) => Promise<unknown>;
27
27
  export declare const _update: (
28
28
  baseUrl: string,
29
29
  path: string,
30
30
  body: Data,
31
31
  headers?: Headers,
32
32
  params?: Params
33
- ) => Promise<any>;
33
+ ) => Promise<unknown>;
34
34
  export declare const _delete: (
35
35
  baseUrl: string,
36
36
  path: string,
37
37
  headers?: Headers,
38
38
  params?: Params
39
- ) => Promise<any>;
39
+ ) => Promise<unknown>;
40
40
  export declare const update_bench_time: (
41
41
  repzo: Repzo,
42
42
  app_id: string,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "repzo-sap-absjo",
3
3
  "description": "repzo SAP ABS jo integration",
4
- "version": "1.0.52",
4
+ "version": "1.0.54",
5
5
  "homepage": "",
6
6
  "keywords": [],
7
7
  "author": {
@@ -21,7 +21,9 @@
21
21
  "lint": "npx --yes prettier --write .",
22
22
  "build": "tsc && npm run lint",
23
23
  "test": "mocha",
24
- "mac": "npm run build && node ./lib/test/commands/test.js",
24
+ "mac": "npm run build && node ./lib/test/actions/***.js",
25
+ "command": "npm run build && node ./lib/test/commands/***.js",
26
+ "action": "npm run build && node ./lib/test/actions/***.js",
25
27
  "prepublishOnly": "npm run build"
26
28
  },
27
29
  "repository": {
@@ -45,7 +47,7 @@
45
47
  "jsonwebtoken": "^8.5.1",
46
48
  "lodash": "^4.17.21",
47
49
  "moment-timezone": "^0.5.34",
48
- "repzo": "^1.0.196",
50
+ "repzo": "^1.0.209",
49
51
  "uuid": "^8.3.2"
50
52
  }
51
53
  }