@things-factory/operato-hub 4.3.823 → 4.3.824

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.
@@ -4,15 +4,9 @@ module.exports = {
4
4
  useVirtualHostBasedDomain: false,
5
5
  fallbackRoute: '/',
6
6
  subdomainOffset: 2,
7
- port: 4445,
7
+ port: 3000,
8
8
  inspect: '9260',
9
- storage: {
10
- type: 's3',
11
- accessKeyId: 'AKIAUQEOPWEJHCE4MTH4',
12
- secretAccessKey: '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',
13
- bucketName: 'opa-one',
14
- region: 'ap-southeast-1'
15
- },
9
+ //postgres
16
10
  // ormconfig: {
17
11
  // name: 'default',
18
12
  // type: 'postgres',
@@ -24,7 +18,30 @@ module.exports = {
24
18
  // synchronize: false,
25
19
  // logging: true
26
20
  // },
27
-
21
+ //operato
22
+ // ormconfig: {
23
+ // name: 'default',
24
+ // type: 'postgres',
25
+ // database: 'operato',
26
+ // username: 'postgres',
27
+ // password: 'hatio',
28
+ // host: '192.168.0.151',
29
+ // port: 15432,
30
+ // synchronize: false,
31
+ // logging: true
32
+ // },
33
+ //eric2
34
+ // ormconfig: {
35
+ // name: 'default',
36
+ // type: 'postgres',
37
+ // database: 'eric2',
38
+ // username: 'postgres',
39
+ // password: 'hatio',
40
+ // host: '192.168.0.153',
41
+ // port: 15432,
42
+ // synchronize: false,
43
+ // logging: true
44
+ // },
28
45
  // STAGING DATABASE
29
46
  ormconfig: {
30
47
  name: 'default',
@@ -37,34 +54,30 @@ module.exports = {
37
54
  synchronize: false,
38
55
  logging: true
39
56
  },
40
-
57
+ //EMS
41
58
  // ormconfig: {
42
59
  // name: 'default',
43
60
  // type: 'postgres',
44
- // database: 'operato',
61
+ // database: 'EMS',
45
62
  // username: 'postgres',
46
63
  // password: 'hatio',
47
- // host: '192.168.0.153',
64
+ // host: '192.168.0.161',
48
65
  // port: 15432,
49
66
  // synchronize: false,
50
67
  // logging: true
51
68
  // },
52
-
53
- //db izzah
69
+ //db nora
54
70
  // ormconfig: {
55
71
  // name: 'default',
56
72
  // type: 'postgres',
57
- // database: '06072023',
73
+ // database: 'postgres',
58
74
  // username: 'postgres',
59
75
  // password: 'hatio',
60
- // host: '192.168.0.153',
76
+ // host: '192.168.0.36',
61
77
  // port: 15432,
62
78
  // synchronize: true,
63
79
  // logging: true
64
80
  // },
65
- //postgres
66
-
67
- // //ERIC
68
81
  // ormconfig: {
69
82
  // name: 'default',
70
83
  // type: 'postgres',
@@ -76,33 +89,32 @@ module.exports = {
76
89
  // synchronize: true,
77
90
  // logging: true
78
91
  // },
79
-
80
- //eric2
92
+ //db izzah
81
93
  // ormconfig: {
82
94
  // name: 'default',
83
95
  // type: 'postgres',
84
- // database: 'eric2',
96
+ // database: '06072023',
85
97
  // username: 'postgres',
86
98
  // password: 'hatio',
87
99
  // host: '192.168.0.153',
88
100
  // port: 15432,
89
- // synchronize: false,
101
+ // synchronize: true,
90
102
  // logging: true
91
103
  // },
92
-
93
104
  // ormconfig: {
94
105
  // name: 'default',
95
106
  // type: 'postgres',
96
- // database: 'dev2', // dev2
97
- // username: 'postgres',
98
- // password: 'abcd1234',
99
- // host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
100
- // port: 55432,
101
- // synchronize:false,
102
- // logging: false,
107
+ // host: 'a6cf0bb5671f54555985dede599d5a87-649005352.ap-southeast-1.elb.amazonaws.com',
108
+ // port: 15432,
109
+ // database: 'postgres',
110
+ // username: 'operato-hub-app',
111
+ // password: 'a5Z(7|6n$Zti',
112
+ // synchronize: false,
113
+ // logging: true,
103
114
  // connectTimeoutMS: 30000,
104
115
  // extra: { poolSize: 30 }
105
116
  // },
117
+
106
118
  // ormconfig: {
107
119
  // name: 'default',
108
120
  // type: 'postgres',
@@ -116,6 +128,7 @@ module.exports = {
116
128
  // connectTimeoutMS: 30000,
117
129
  // extra: { poolSize: 30 }
118
130
  // },
131
+
119
132
  password: {
120
133
  lowerCase: true,
121
134
  upperCase: false,
@@ -167,11 +180,6 @@ module.exports = {
167
180
  ciphers: 'SSLv3'
168
181
  }
169
182
  },
170
- jobQueue: {
171
- // For JobQueueService/JobWorker (FIFO queue is supported)
172
- queueUrl: 'https://sqs.ap-southeast-5.amazonaws.com/309536469266/operato-job-queue.fifo',
173
- sqsRegion: 'ap-southeast-5'
174
- },
175
183
  sender: 'noreply@hatiolab.com',
176
184
  notification: {
177
185
  // fcm: {
@@ -210,7 +218,8 @@ module.exports = {
210
218
  isUAT: false,
211
219
  application: 'Operato MMS',
212
220
  partnerId: 846025,
213
- partnerKey: 'd34cfd85a603f196a0d74ebe08043280c1a27788bb36bdffd61e7e0bb1c90b64'
221
+ partnerKey: 'd34cfd85a603f196a0d74ebe08043280c1a27788bb36bdffd61e7e0bb1c90b64',
222
+ v2: true
214
223
  },
215
224
  marketplaceIntegrationLazada: {
216
225
  platform: 'lazada',
@@ -219,6 +228,16 @@ module.exports = {
219
228
  appSecret: 'HB3RTNEXHlVSlBr9SmWF8AjbSUT7a825',
220
229
  callback: 'https://maybank.operato-m.com/lazada-callback'
221
230
  },
231
+
232
+ //testinglazada
233
+ // marketplaceIntegrationLazada: {
234
+ // platform: 'lazada',
235
+ // application: 'powrup_bi',
236
+ // appKey: '117890',
237
+ // appSecret: 'tQVllnUa7irAHoNxAwXEVxoP1we1bUjE',
238
+ // callback: 'https://73c5-175-141-30-142.ngrok-free.app/lazada-callback'
239
+ // },
240
+
222
241
  accountingIntegrationXero: {
223
242
  platform: 'xero',
224
243
  application: 'Operato WMS',
@@ -227,23 +246,48 @@ module.exports = {
227
246
  callback: 'http://operato-h.com:3000/callback-xero',
228
247
  hostname: 'http://operato-h.com:3000/'
229
248
  },
230
- lambda: {
231
- region: 'ap-southeast-1',
232
- accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
233
- secretAccessKey: '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'
249
+ lmdIntegrationNinjavan: {
250
+ clientId: 'P8WCEwMo0FHNlPECwTLetwN3diAmt5KF',
251
+ secretKey: '1D0yNZGseOjhxnwri29xmuZiiuRp131L',
252
+ refreshThreshold: 43200
234
253
  },
254
+
255
+ lmdIntegrationEms: { refreshThreshold: 43200 },
256
+
257
+ lmdIntegrationCitylink: { refreshThreshold: 172800000 },
235
258
  awbFileStorage: {
236
259
  type: 's3',
237
- accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
238
- secretAccessKey: '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',
260
+ accessKeyId: 'AKIAUQEOPWEJPXIVER74',
261
+ secretAccessKey: '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',
239
262
  bucketName: 'operato-awb',
240
263
  region: 'ap-southeast-1'
241
264
  },
265
+ lambda: {
266
+ region: 'ap-southeast-1',
267
+ accessKeyId: 'AKIAUQEOPWEJPXIVER74',
268
+ secretAccessKey: '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'
269
+ },
270
+ lambdaMy: {
271
+ region: 'ap-southeast-5',
272
+ accessKeyId: 'AKIAUQEOPWEJHCE4MTH4',
273
+ secretAccessKey: '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'
274
+ },
275
+ lmdIntegrationConfig: {
276
+ version: {
277
+ v1: 'lmdMiddleware',
278
+ v2: 'lmdMiddlewareV2'
279
+ }
280
+ },
242
281
  awsSesEmail: {
243
- accessKeyId: 'AKIAUQEOPWEJKQDJSEOG',
244
- secretAccessKey: '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',
282
+ accessKeyId: 'AKIAUQEOPWEJPXIVER74',
283
+ secretAccessKey: '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',
245
284
  email: 'support@hatio.asia'
246
285
  },
286
+ jobQueue: {
287
+ // For JobQueueService/JobWorker (FIFO queue is supported)
288
+ queueUrl: 'https://sqs.ap-southeast-5.amazonaws.com/309536469266/operato-job-queue.fifo',
289
+ sqsRegion: 'ap-southeast-5'
290
+ },
247
291
  reportApiUrl:
248
292
  'http://k8s-default-operator-2fd6178d98-66c66a0f76c09575.elb.ap-southeast-1.amazonaws.com/rest/report/show_html'
249
293
  }
@@ -6,83 +6,113 @@ const auth_base_1 = require("@things-factory/auth-base");
6
6
  const env_1 = require("@things-factory/env");
7
7
  const integration_powrup_1 = require("@things-factory/integration-powrup");
8
8
  const sales_base_1 = require("@things-factory/sales-base");
9
+ const ADVISORY_LOCK_KEY = 'powrup-initiate-shipment';
9
10
  exports.powrupInitiateShipmentResolver = {
10
11
  async powrupInitiateShipment(_, {}, context) {
12
+ var _a, _b, _c, _d, _e;
11
13
  const maxRTSRetry = 10;
14
+ // Same fix as powrupGetAirwayBill / powrupGetTrackingNo: avoid wrapping the
15
+ // resolver in a long transaction across external PowrupAPI HTTP calls. Use a
16
+ // single QueryRunner with a session-level advisory lock for concurrency safety,
17
+ // and let each UPDATE auto-commit so row locks are held only for the duration
18
+ // of the UPDATE statement, not across the API call.
19
+ const queryRunner = (0, typeorm_1.getConnection)().createQueryRunner();
20
+ let connected = false;
12
21
  try {
13
- await (0, typeorm_1.getConnection)().transaction(async (tx) => {
14
- var _a, _b, _c, _d;
15
- try {
16
- const powrup = await tx
17
- .getRepository(integration_powrup_1.Powrup)
18
- .findOne({ where: { platform: integration_powrup_1.Platform.POWRUP, active: true } });
19
- let orderPackageQb = tx
20
- .getRepository(sales_base_1.OrderPackage)
21
- .createQueryBuilder('opk')
22
- .innerJoinAndSelect('opk.releaseGood', 'rg')
23
- .innerJoinAndSelect('opk.domain', 'domain')
24
- .innerJoinAndSelect('opk.bizplace', 'bizplace')
25
- .leftJoinAndSelect('opk.creator', 'creator')
26
- .leftJoinAndSelect('rg.lastMileDelivery', 'lmd')
27
- .where(`rg.source = :source`, { source: auth_base_1.ApplicationType.POWRUP })
28
- .andWhere(`rg.type = :rgType`, { rgType: 'b2c' })
29
- .andWhere(`rg.ref_order_id NOTNULL`)
30
- .andWhere(`rg.status = :status`, {
31
- status: sales_base_1.ORDER_STATUS.DONE
32
- })
33
- .andWhere(`opk.market_rts_call_success ISNULL`)
34
- .andWhere(`COALESCE(opk.market_rts_call_retry, 0) <= :maxRTSRetry`, { maxRTSRetry: maxRTSRetry })
35
- .orderBy(`opk.created_at`);
36
- let orderPackagesWithoutRTS = await orderPackageQb.getMany();
37
- if ((orderPackagesWithoutRTS === null || orderPackagesWithoutRTS === void 0 ? void 0 : orderPackagesWithoutRTS.length) > 0) {
38
- for (let i = 0; i < orderPackagesWithoutRTS.length; i++) {
39
- const orderPackage = orderPackagesWithoutRTS[i];
40
- const releaseGood = orderPackage.releaseGood;
41
- if (releaseGood.lmdOption == true && (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.trackingNo) == null) {
42
- continue;
43
- }
44
- let orderInformation = {
45
- refOrderId: orderPackage.releaseGood.refOrderId,
46
- packageId: orderPackage.packageId,
47
- platform: orderPackage.releaseGood.platformCode
48
- };
49
- if ((_a = orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.releaseGood) === null || _a === void 0 ? void 0 : _a.lmdOption) {
50
- orderInformation = Object.assign(Object.assign({}, orderInformation), { awb: orderPackage.airwayBill, trackingNo: orderPackage.trackingNo, lmdOption: (_b = orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.releaseGood) === null || _b === void 0 ? void 0 : _b.lmdOption, shipperName: (_d = (_c = orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.releaseGood) === null || _c === void 0 ? void 0 : _c.lastMileDelivery) === null || _d === void 0 ? void 0 : _d.platform });
51
- }
52
- performance.mark(`start:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`);
53
- try {
54
- await integration_powrup_1.PowrupAPI.initiateShipment(powrup, Object.assign(Object.assign({}, orderInformation), { context: { state: { domain: null, user: null } } }));
55
- await tx
56
- .getRepository(sales_base_1.OrderPackage)
57
- .update({ id: orderPackage.id }, { marketRtsCallSuccess: new Date() });
58
- performance.mark(`end:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`);
59
- }
60
- catch (error) {
61
- performance.mark(`end:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`);
62
- env_1.logger.error(`powrupInitiateShipment[InitiateShipment][Order Package ID: ${orderPackage.id}]: ${error}`);
63
- await (0, typeorm_1.getRepository)(sales_base_1.OrderPackage)
64
- .createQueryBuilder()
65
- .update(sales_base_1.OrderPackage)
66
- .set({ marketRtsCallRetry: () => `coalesce("market_rts_call_retry", 0) + 1` })
67
- .where('id = :id', { id: orderPackage.id })
68
- .execute();
69
- continue;
70
- }
71
- finally {
72
- let perf = performance.measure(`powrupInitiateShipment: ${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`, `start:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`, `end:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`);
73
- console.info(perf.toJSON());
74
- }
22
+ await queryRunner.connect();
23
+ connected = true;
24
+ const lockResult = await queryRunner.query(`SELECT pg_try_advisory_lock(hashtextextended($1, 0)) AS acquired`, [ADVISORY_LOCK_KEY]);
25
+ if (!((_a = lockResult === null || lockResult === void 0 ? void 0 : lockResult[0]) === null || _a === void 0 ? void 0 : _a.acquired)) {
26
+ env_1.logger.info(`powrupInitiateShipment: another instance is running, skipping`);
27
+ return;
28
+ }
29
+ try {
30
+ const manager = queryRunner.manager;
31
+ const powrup = await manager.findOne(integration_powrup_1.Powrup, {
32
+ where: { platform: integration_powrup_1.Platform.POWRUP, active: true }
33
+ });
34
+ const orderPackagesWithoutRTS = await manager
35
+ .createQueryBuilder(sales_base_1.OrderPackage, 'opk')
36
+ .innerJoinAndSelect('opk.releaseGood', 'rg')
37
+ .innerJoinAndSelect('opk.domain', 'domain')
38
+ .innerJoinAndSelect('opk.bizplace', 'bizplace')
39
+ .leftJoinAndSelect('opk.creator', 'creator')
40
+ .leftJoinAndSelect('rg.lastMileDelivery', 'lmd')
41
+ .where(`rg.source = :source`, { source: auth_base_1.ApplicationType.POWRUP })
42
+ .andWhere(`rg.type = :rgType`, { rgType: 'b2c' })
43
+ .andWhere(`rg.ref_order_id NOTNULL`)
44
+ .andWhere(`rg.status = :status`, { status: sales_base_1.ORDER_STATUS.DONE })
45
+ .andWhere(`opk.market_rts_call_success ISNULL`)
46
+ .andWhere(`COALESCE(opk.market_rts_call_retry, 0) <= :maxRTSRetry`, { maxRTSRetry })
47
+ .orderBy(`opk.created_at`)
48
+ .getMany();
49
+ if ((orderPackagesWithoutRTS === null || orderPackagesWithoutRTS === void 0 ? void 0 : orderPackagesWithoutRTS.length) > 0) {
50
+ for (let i = 0; i < orderPackagesWithoutRTS.length; i++) {
51
+ const orderPackage = orderPackagesWithoutRTS[i];
52
+ const releaseGood = orderPackage.releaseGood;
53
+ if (releaseGood.lmdOption == true && (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.trackingNo) == null) {
54
+ continue;
55
+ }
56
+ let orderInformation = {
57
+ refOrderId: orderPackage.releaseGood.refOrderId,
58
+ packageId: orderPackage.packageId,
59
+ platform: orderPackage.releaseGood.platformCode
60
+ };
61
+ if ((_b = orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.releaseGood) === null || _b === void 0 ? void 0 : _b.lmdOption) {
62
+ orderInformation = Object.assign(Object.assign({}, orderInformation), { awb: orderPackage.airwayBill, trackingNo: orderPackage.trackingNo, lmdOption: (_c = orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.releaseGood) === null || _c === void 0 ? void 0 : _c.lmdOption, shipperName: (_e = (_d = orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.releaseGood) === null || _d === void 0 ? void 0 : _d.lastMileDelivery) === null || _e === void 0 ? void 0 : _e.platform });
63
+ }
64
+ performance.mark(`start:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`);
65
+ try {
66
+ await integration_powrup_1.PowrupAPI.initiateShipment(powrup, Object.assign(Object.assign({}, orderInformation), { context: { state: { domain: null, user: null } } }));
67
+ // Auto-commit single-statement UPDATE — row lock held only for this UPDATE,
68
+ // not across the API call above.
69
+ await manager.update(sales_base_1.OrderPackage, { id: orderPackage.id }, { marketRtsCallSuccess: new Date() });
70
+ performance.mark(`end:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`);
71
+ }
72
+ catch (error) {
73
+ performance.mark(`end:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`);
74
+ env_1.logger.error(`powrupInitiateShipment[InitiateShipment][Order Package ID: ${orderPackage.id}]: ${error}`);
75
+ await manager
76
+ .createQueryBuilder()
77
+ .update(sales_base_1.OrderPackage)
78
+ .set({ marketRtsCallRetry: () => `coalesce("market_rts_call_retry", 0) + 1` })
79
+ .where('id = :id', { id: orderPackage.id })
80
+ .execute();
81
+ continue;
82
+ }
83
+ finally {
84
+ let perf = performance.measure(`powrupInitiateShipment: ${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`, `start:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`, `end:${orderPackage.releaseGood.refOrderId} - ${orderPackage.packageId}`);
85
+ console.info(perf.toJSON());
75
86
  }
76
87
  }
77
88
  }
78
- catch (e) {
79
- env_1.logger.error(`powrupInitiateShipment[InitiateShipment]: ${e}`);
89
+ }
90
+ catch (e) {
91
+ env_1.logger.error(`powrupInitiateShipment[InitiateShipment]: ${e}`);
92
+ }
93
+ finally {
94
+ try {
95
+ await queryRunner.query(`SELECT pg_advisory_unlock(hashtextextended($1, 0))`, [ADVISORY_LOCK_KEY]);
80
96
  }
81
- });
97
+ catch (releaseErr) {
98
+ env_1.logger.error(`powrupInitiateShipment[AdvisoryUnlock]: ${releaseErr}`);
99
+ }
100
+ }
82
101
  }
83
102
  catch (e) {
84
103
  env_1.logger.error(`powrupInitiateShipment[MainError]: ${e}`);
85
104
  }
105
+ finally {
106
+ if (connected) {
107
+ try {
108
+ await queryRunner.query(`SELECT pg_advisory_unlock_all()`);
109
+ }
110
+ catch (unlockAllErr) {
111
+ env_1.logger.error(`powrupInitiateShipment[AdvisoryUnlockAll]: ${unlockAllErr}`);
112
+ }
113
+ }
114
+ await queryRunner.release();
115
+ }
86
116
  }
87
117
  };
88
118
  //# sourceMappingURL=powrup-initiate-shipment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"powrup-initiate-shipment.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/synchronization/powrup-initiate-shipment.ts"],"names":[],"mappings":";;;AAAA,qCAAsD;AAEtD,yDAA2D;AAC3D,6CAA4C;AAC5C,2EAAgF;AAChF,2DAAuE;AAE1D,QAAA,8BAA8B,GAAG;IAC5C,KAAK,CAAC,sBAAsB,CAAC,CAAO,EAAE,EAAE,EAAE,OAAY;QACpD,MAAM,WAAW,GAAW,EAAE,CAAA;QAC9B,IAAI;YACF,MAAM,IAAA,uBAAa,GAAE,CAAC,WAAW,CAAC,KAAK,EAAC,EAAE,EAAC,EAAE;;gBAC3C,IAAI;oBACF,MAAM,MAAM,GAAW,MAAM,EAAE;yBAC5B,aAAa,CAAC,2BAAM,CAAC;yBACrB,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,6BAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;oBAElE,IAAI,cAAc,GAAG,EAAE;yBACpB,aAAa,CAAC,yBAAY,CAAC;yBAC3B,kBAAkB,CAAC,KAAK,CAAC;yBACzB,kBAAkB,CAAC,iBAAiB,EAAE,IAAI,CAAC;yBAC3C,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC;yBAC1C,kBAAkB,CAAC,cAAc,EAAE,UAAU,CAAC;yBAC9C,iBAAiB,CAAC,aAAa,EAAE,SAAS,CAAC;yBAC3C,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,CAAC;yBAC/C,KAAK,CAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,2BA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EAAE,EAAE,EAAE,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC;qCAC1C,OAAO,EAAE,CAAA;gCACZ,SAAQ;6BACT;oCAAS;gCACR,IAAI,IAAI,GAAG,WAAW,CAAC,OAAO,CAC5B,2BAA2B,YAAY,CAAC,WAAW,CAAC,UAAU,MAAM,YAAY,CAAC,SAAS,EAAE,EAC5F,SAAS,YAAY,CAAC,WAAW,CAAC,UAAU,MAAM,YAAY,CAAC,SAAS,EAAE,EAC1E,OAAO,YAAY,CAAC,WAAW,CAAC,UAAU,MAAM,YAAY,CAAC,SAAS,EAAE,CACzE,CAAA;gCACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;6BAC5B;yBACF;qBACF;iBACF;gBAAC,OAAO,CAAC,EAAE;oBACV,YAAM,CAAC,KAAK,CAAC,6CAA6C,CAAC,EAAE,CAAC,CAAA;iBAC/D;YACH,CAAC,CAAC,CAAA;SACH;QAAC,OAAO,CAAC,EAAE;YACV,YAAM,CAAC,KAAK,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAA;SACxD;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"powrup-initiate-shipment.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/synchronization/powrup-initiate-shipment.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,yDAA2D;AAC3D,6CAA4C;AAC5C,2EAAgF;AAChF,2DAAuE;AAEvE,MAAM,iBAAiB,GAAG,0BAA0B,CAAA;AAEvC,QAAA,8BAA8B,GAAG;IAC5C,KAAK,CAAC,sBAAsB,CAAC,CAAO,EAAE,EAAE,EAAE,OAAY;;QACpD,MAAM,WAAW,GAAW,EAAE,CAAA;QAE9B,4EAA4E;QAC5E,6EAA6E;QAC7E,gFAAgF;QAChF,8EAA8E;QAC9E,oDAAoD;QACpD,MAAM,WAAW,GAAG,IAAA,uBAAa,GAAE,CAAC,iBAAiB,EAAE,CAAA;QACvD,IAAI,S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