@rytass/wms-module-graphql 0.3.0 → 0.5.0

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 (61) hide show
  1. package/README.md +55 -0
  2. package/adapters/event-emitter.d.ts +29 -0
  3. package/adapters/event-emitter.js +41 -0
  4. package/adapters/member-base.d.ts +35 -0
  5. package/adapters/member-base.js +47 -0
  6. package/docs/README.md +6 -0
  7. package/docs/api-reference.md +100 -1
  8. package/docs/authorization.md +349 -0
  9. package/docs/events.md +304 -0
  10. package/docs/integration-guide.md +121 -4
  11. package/index.cjs.js +299 -3
  12. package/index.d.ts +4 -0
  13. package/index.js +7 -0
  14. package/lib/auth/host-skip.constant.d.ts +27 -0
  15. package/lib/auth/host-skip.constant.js +29 -0
  16. package/lib/auth/index.d.ts +4 -0
  17. package/lib/auth/wms-auth.guard.d.ts +19 -0
  18. package/lib/auth/wms-auth.guard.js +41 -0
  19. package/lib/auth/wms-auth.types.d.ts +36 -0
  20. package/lib/auth/wms-auth.types.js +6 -0
  21. package/lib/auth/wms-operation.decorator.d.ts +23 -0
  22. package/lib/auth/wms-operation.decorator.js +29 -0
  23. package/lib/events/index.d.ts +3 -0
  24. package/lib/events/wms-mutation-event.constants.d.ts +12 -0
  25. package/lib/events/wms-mutation-event.constants.js +4 -0
  26. package/lib/events/wms-mutation-event.decorator.d.ts +15 -0
  27. package/lib/events/wms-mutation-event.decorator.js +20 -0
  28. package/lib/events/wms-mutation.interceptor.d.ts +19 -0
  29. package/lib/events/wms-mutation.interceptor.js +72 -0
  30. package/lib/graphql.module.d.ts +20 -3
  31. package/lib/graphql.module.js +19 -4
  32. package/lib/mutations/allocate-inventory-order.mutation.js +10 -0
  33. package/lib/mutations/hold-inventory-order.mutation.js +10 -0
  34. package/lib/mutations/loader.mutation.js +14 -0
  35. package/lib/mutations/location.mutation.js +8 -0
  36. package/lib/mutations/material.mutation.js +8 -0
  37. package/lib/mutations/merge-batch.mutation.js +6 -0
  38. package/lib/mutations/quality-inspection-order.mutation.js +6 -0
  39. package/lib/mutations/receive-inventory-order.mutation.js +10 -0
  40. package/lib/mutations/reclassify-inventory-order.mutation.js +6 -0
  41. package/lib/mutations/scrape-order.mutation.js +6 -0
  42. package/lib/mutations/ship-inventory-order.mutation.js +12 -0
  43. package/lib/mutations/split-batch.mutation.js +6 -0
  44. package/lib/mutations/transfer-customer-order.mutation.js +10 -0
  45. package/lib/mutations/transfer-order.mutation.js +12 -0
  46. package/lib/mutations/transfer-vendor-order.mutation.js +10 -0
  47. package/lib/mutations/warehouse-map.mutation.js +6 -0
  48. package/lib/queries/allocate-inventory-order.query.js +3 -0
  49. package/lib/queries/batch.query.js +3 -0
  50. package/lib/queries/hold-inventory-order.query.js +3 -0
  51. package/lib/queries/loader.query.js +8 -0
  52. package/lib/queries/location.query.js +4 -0
  53. package/lib/queries/material.query.js +4 -0
  54. package/lib/queries/recieve-inventory-order.query.js +4 -0
  55. package/lib/queries/sale-order.query.js +4 -0
  56. package/lib/queries/ship-inventory-order.query.js +4 -0
  57. package/lib/queries/stock.query.js +7 -0
  58. package/lib/queries/transfer-order.query.js +4 -0
  59. package/lib/queries/unit.query.js +3 -0
  60. package/lib/queries/warehouse-map.query.js +3 -0
  61. package/package.json +17 -3
package/index.cjs.js CHANGED
@@ -9,6 +9,8 @@ var lruCache = require('lru-cache');
9
9
  var typeorm = require('typeorm');
10
10
  var DataLoader = require('dataloader');
11
11
  var graphql = require('@nestjs/graphql');
12
+ var core = require('@nestjs/core');
13
+ var rxjs = require('rxjs');
12
14
  var wmsBaseNestjsModule = require('@rytass/wms-base-nestjs-module');
13
15
  var warehouseMap_entity = require('@rytass/wms-base-nestjs-module/models/warehouse-map.entity');
14
16
 
@@ -212,6 +214,178 @@ function createWmsLoaders(loaderService) {
212
214
  };
213
215
  }
214
216
 
217
+ /**
218
+ * Metadata key stamped on every `@WmsOperation` handler so that a host
219
+ * application's *globally registered* auth guard (`APP_GUARD`) treats WMS
220
+ * resolvers as "skip / public" and defers the real authorization decision to
221
+ * {@link WmsAuthGuard}.
222
+ *
223
+ * Why this exists
224
+ * ---------------
225
+ * A deny-by-default global guard — e.g. the `CasbinGuard` from
226
+ * `@rytass/member-base-nestjs-module` — blankets every resolver in the compiled
227
+ * schema, including the ones this library owns. WMS resolvers carry no
228
+ * host-specific permission metadata, so such a guard rejects them all. By
229
+ * stamping this key WMS tells the host guard "let me through", and then runs
230
+ * its own {@link WmsAuthGuard} (wired to the consumer's `authChecker`) to do the
231
+ * actual enforcement.
232
+ *
233
+ * The single coupling point
234
+ * -------------------------
235
+ * The default value matches `@rytass/member-base-nestjs-module`'s
236
+ * `IS_ROUTE_PUBLIC` metadata key. This is the *one and only* place WMS assumes
237
+ * anything about a specific host guard. If your host guard uses a different
238
+ * "public / skip" metadata key, fork this constant — nothing else changes.
239
+ *
240
+ * If you do not register a global guard at all (or set
241
+ * `enableGlobalGuard: false`), this marker is simply inert.
242
+ */
243
+ const HOST_SKIP_METADATA_KEY = 'IS_ROUTE_PUBLIC';
244
+
245
+ /** DI token holding the resolved {@link WmsAuthModuleOptions}. */
246
+ const WMS_AUTH_OPTIONS = Symbol('WMS_AUTH_OPTIONS');
247
+ /** Reflector metadata key carrying the {@link WmsOperationRequirement}. */
248
+ const WMS_OPERATION_METADATA = 'wms:operation';
249
+
250
+ /**
251
+ * Route-level guard applied automatically by `@WmsOperation`. It reads the
252
+ * requirement declared on the handler and delegates the allow/deny decision to
253
+ * the consumer-supplied {@link WmsAuthModuleOptions.authChecker}.
254
+ *
255
+ * It is deliberately permissive in two cases:
256
+ * - the handler carries no requirement (field resolvers reached only through an
257
+ * already-authorized root operation), and
258
+ * - no `authChecker` was configured (local dev / auth handled elsewhere).
259
+ */
260
+ exports.WmsAuthGuard = class WmsAuthGuard {
261
+ reflector;
262
+ options;
263
+ constructor(reflector, options) {
264
+ this.reflector = reflector;
265
+ this.options = options;
266
+ }
267
+ canActivate(context) {
268
+ const requirement = this.reflector.get(WMS_OPERATION_METADATA, context.getHandler());
269
+ if (!requirement) {
270
+ return true;
271
+ }
272
+ const { authChecker } = this.options;
273
+ if (!authChecker) {
274
+ return true;
275
+ }
276
+ return authChecker(context, requirement);
277
+ }
278
+ };
279
+ exports.WmsAuthGuard = tslib.__decorate([
280
+ common.Injectable(),
281
+ tslib.__param(1, common.Inject(WMS_AUTH_OPTIONS)),
282
+ tslib.__metadata("design:paramtypes", [core.Reflector, Object])
283
+ ], exports.WmsAuthGuard);
284
+
285
+ /**
286
+ * Declares the permission requirement for a WMS root operation and wires up its
287
+ * enforcement. Apply it to every `@Query` / `@Mutation` the library exposes.
288
+ *
289
+ * It bundles three concerns so a single annotation keeps a resolver
290
+ * self-protecting and host-friendly:
291
+ *
292
+ * 1. {@link WMS_OPERATION_METADATA} — the host-neutral `{ resource, action }`
293
+ * that {@link WmsAuthGuard} hands to the consumer's `authChecker`.
294
+ * 2. {@link HOST_SKIP_METADATA_KEY} — tells a host's global guard to defer (see
295
+ * that constant for the single coupling point with member-base).
296
+ * 3. `@UseGuards(WmsAuthGuard)` — the route-level guard that performs the real
297
+ * authorization through the configured `authChecker`.
298
+ *
299
+ * @example
300
+ * ```ts
301
+ * @Query(() => MaterialDto)
302
+ * @WmsOperation({ resource: 'material', action: 'read' })
303
+ * material(@Args('id') id: string): Promise<MaterialDto> { ... }
304
+ * ```
305
+ */
306
+ const WmsOperation = (requirement) => common.applyDecorators(common.SetMetadata(WMS_OPERATION_METADATA, requirement), common.SetMetadata(HOST_SKIP_METADATA_KEY, true), common.UseGuards(exports.WmsAuthGuard));
307
+
308
+ /** Reflector metadata key carrying the {@link WmsMutationEventConfig}. */
309
+ const WMS_MUTATION_EVENT_METADATA = 'wms:mutation-event';
310
+
311
+ const defaultResolveId = (result, args) => {
312
+ if (result &&
313
+ typeof result === 'object' &&
314
+ 'id' in result &&
315
+ typeof result.id === 'string') {
316
+ return result.id;
317
+ }
318
+ const argId = args['id'];
319
+ return typeof argId === 'string' ? argId : null;
320
+ };
321
+ /**
322
+ * Wraps each `@WmsMutationEvent` mutation in a dispatch scope:
323
+ * 1. runs the before-hook (throw -> veto, before any transaction);
324
+ * 2. executes the resolver (services collect stock events into the scope);
325
+ * 3. emits the operation event after the handler resolves (post-commit);
326
+ * 4. flushes the whole buffer to after-listeners + emitter bridge.
327
+ *
328
+ * When no hook/listener/bridge is configured it passes through untouched.
329
+ */
330
+ exports.WmsMutationInterceptor = class WmsMutationInterceptor {
331
+ reflector;
332
+ dispatcher;
333
+ constructor(reflector, dispatcher) {
334
+ this.reflector = reflector;
335
+ this.dispatcher = dispatcher;
336
+ }
337
+ async intercept(context, next) {
338
+ const config = this.reflector.get(WMS_MUTATION_EVENT_METADATA, context.getHandler());
339
+ if (!config || !this.dispatcher.isActive()) {
340
+ return next.handle();
341
+ }
342
+ const args = graphql.GqlExecutionContext.create(context).getArgs() ??
343
+ {};
344
+ // Before-hook runs before any DB work; a throw vetoes with zero side effects.
345
+ await this.dispatcher.runBeforeHook({
346
+ event: config.event,
347
+ args,
348
+ executionContext: context,
349
+ });
350
+ const { result, events } = await wmsModuleCore.runInDispatchScope(async () => {
351
+ const handlerResult = await rxjs.firstValueFrom(next.handle());
352
+ const id = config.resolveId
353
+ ? config.resolveId(handlerResult, args)
354
+ : defaultResolveId(handlerResult, args);
355
+ const operationEvent = {
356
+ name: config.event,
357
+ payload: { id, result: handlerResult },
358
+ };
359
+ wmsModuleCore.collectToScope(operationEvent);
360
+ return handlerResult;
361
+ });
362
+ if (events) {
363
+ await this.dispatcher.flush(events);
364
+ }
365
+ return rxjs.of(result);
366
+ }
367
+ };
368
+ exports.WmsMutationInterceptor = tslib.__decorate([
369
+ common.Injectable(),
370
+ tslib.__metadata("design:paramtypes", [core.Reflector,
371
+ wmsModuleCore.WmsEventDispatcher])
372
+ ], exports.WmsMutationInterceptor);
373
+
374
+ /**
375
+ * Declares the operation event for a WMS root mutation and wires the
376
+ * {@link WmsMutationInterceptor} that runs before-hooks (veto) and flushes
377
+ * collected events post-commit. Apply alongside `@WmsOperation` on each mutation.
378
+ *
379
+ * @example
380
+ * ```ts
381
+ * @Mutation(() => ShipInventoryOrderDto)
382
+ * @WmsOperation({ resource: 'ship-inventory-order', action: 'ship' })
383
+ * @WmsMutationEvent({ event: 'ship-inventory-order.shipped' })
384
+ * ship(@Args() args: ShipArgs): Promise<boolean> { ... }
385
+ * ```
386
+ */
387
+ const WmsMutationEvent = (config) => common.applyDecorators(common.SetMetadata(WMS_MUTATION_EVENT_METADATA, config), common.UseInterceptors(exports.WmsMutationInterceptor));
388
+
215
389
  const IdGenFunction = (input) => {
216
390
  const hash = crypto.createHash('sha256');
217
391
  hash.update(input);
@@ -1540,6 +1714,8 @@ let LoaderMutation = class LoaderMutation {
1540
1714
  };
1541
1715
  tslib.__decorate([
1542
1716
  graphql.Mutation(() => [LoaderDto]),
1717
+ WmsOperation({ resource: 'loader', action: 'create' }),
1718
+ WmsMutationEvent({ event: 'loader.created' }),
1543
1719
  tslib.__param(0, graphql.Args()),
1544
1720
  tslib.__metadata("design:type", Function),
1545
1721
  tslib.__metadata("design:paramtypes", [CreateLoaderArgs]),
@@ -1547,6 +1723,8 @@ tslib.__decorate([
1547
1723
  ], LoaderMutation.prototype, "createLoader", null);
1548
1724
  tslib.__decorate([
1549
1725
  graphql.Mutation(() => [LoaderDto]),
1726
+ WmsOperation({ resource: 'loader', action: 'create' }),
1727
+ WmsMutationEvent({ event: 'loader.batch-created' }),
1550
1728
  tslib.__param(0, graphql.Args('items', { type: () => [CreateLoadersArgs] })),
1551
1729
  tslib.__metadata("design:type", Function),
1552
1730
  tslib.__metadata("design:paramtypes", [Array]),
@@ -1554,6 +1732,8 @@ tslib.__decorate([
1554
1732
  ], LoaderMutation.prototype, "createBatchLoader", null);
1555
1733
  tslib.__decorate([
1556
1734
  graphql.Mutation(() => LoaderDto),
1735
+ WmsOperation({ resource: 'loader', action: 'update' }),
1736
+ WmsMutationEvent({ event: 'loader.updated' }),
1557
1737
  tslib.__param(0, graphql.Args()),
1558
1738
  tslib.__metadata("design:type", Function),
1559
1739
  tslib.__metadata("design:paramtypes", [UpdateLoaderArgs]),
@@ -1561,6 +1741,8 @@ tslib.__decorate([
1561
1741
  ], LoaderMutation.prototype, "updateLoader", null);
1562
1742
  tslib.__decorate([
1563
1743
  graphql.Mutation(() => LoaderTypeDto),
1744
+ WmsOperation({ resource: 'loader', action: 'create' }),
1745
+ WmsMutationEvent({ event: 'loader.type-created' }),
1564
1746
  tslib.__param(0, graphql.Args()),
1565
1747
  tslib.__metadata("design:type", Function),
1566
1748
  tslib.__metadata("design:paramtypes", [CreateLoaderTypeArgs]),
@@ -1568,6 +1750,8 @@ tslib.__decorate([
1568
1750
  ], LoaderMutation.prototype, "createLoaderType", null);
1569
1751
  tslib.__decorate([
1570
1752
  graphql.Mutation(() => LoaderTypeDto),
1753
+ WmsOperation({ resource: 'loader', action: 'update' }),
1754
+ WmsMutationEvent({ event: 'loader.type-updated' }),
1571
1755
  tslib.__param(0, graphql.Args()),
1572
1756
  tslib.__metadata("design:type", Function),
1573
1757
  tslib.__metadata("design:paramtypes", [UpdateLoaderTypeArgs]),
@@ -1796,6 +1980,7 @@ let LoaderQuery = class LoaderQuery {
1796
1980
  };
1797
1981
  tslib.__decorate([
1798
1982
  graphql.Query(() => LoaderDto),
1983
+ WmsOperation({ resource: 'loader', action: 'read' }),
1799
1984
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID })),
1800
1985
  tslib.__metadata("design:type", Function),
1801
1986
  tslib.__metadata("design:paramtypes", [String]),
@@ -1803,6 +1988,7 @@ tslib.__decorate([
1803
1988
  ], LoaderQuery.prototype, "loader", null);
1804
1989
  tslib.__decorate([
1805
1990
  graphql.Query(() => Loaders),
1991
+ WmsOperation({ resource: 'loader', action: 'read' }),
1806
1992
  tslib.__param(0, graphql.Args()),
1807
1993
  tslib.__metadata("design:type", Function),
1808
1994
  tslib.__metadata("design:paramtypes", [FindLoaderArgs]),
@@ -1810,6 +1996,7 @@ tslib.__decorate([
1810
1996
  ], LoaderQuery.prototype, "loaders", null);
1811
1997
  tslib.__decorate([
1812
1998
  graphql.Query(() => LoaderTypeDto),
1999
+ WmsOperation({ resource: 'loader', action: 'read' }),
1813
2000
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID })),
1814
2001
  tslib.__metadata("design:type", Function),
1815
2002
  tslib.__metadata("design:paramtypes", [String]),
@@ -1817,6 +2004,7 @@ tslib.__decorate([
1817
2004
  ], LoaderQuery.prototype, "loaderType", null);
1818
2005
  tslib.__decorate([
1819
2006
  graphql.Query(() => LoaderTypes),
2007
+ WmsOperation({ resource: 'loader', action: 'read' }),
1820
2008
  tslib.__param(0, graphql.Args()),
1821
2009
  tslib.__metadata("design:type", Function),
1822
2010
  tslib.__metadata("design:paramtypes", [FindLoaderTypeArgs]),
@@ -1824,6 +2012,7 @@ tslib.__decorate([
1824
2012
  ], LoaderQuery.prototype, "loaderTypes", null);
1825
2013
  tslib.__decorate([
1826
2014
  graphql.Query(() => [LoaderUnitDto]),
2015
+ WmsOperation({ resource: 'loader', action: 'read' }),
1827
2016
  tslib.__param(0, graphql.Args('type', { type: () => LoaderUnit })),
1828
2017
  tslib.__metadata("design:type", Function),
1829
2018
  tslib.__metadata("design:paramtypes", [String]),
@@ -1831,6 +2020,7 @@ tslib.__decorate([
1831
2020
  ], LoaderQuery.prototype, "loaderUnits", null);
1832
2021
  tslib.__decorate([
1833
2022
  graphql.Query(() => [LoaderDto]),
2023
+ WmsOperation({ resource: 'loader', action: 'read' }),
1834
2024
  tslib.__param(0, graphql.Args('locationId', { type: () => graphql.ID, nullable: true })),
1835
2025
  tslib.__metadata("design:type", Function),
1836
2026
  tslib.__metadata("design:paramtypes", [String]),
@@ -1924,6 +2114,8 @@ let MaterialMutation = class MaterialMutation {
1924
2114
  };
1925
2115
  tslib.__decorate([
1926
2116
  graphql.Mutation(() => MaterialDto),
2117
+ WmsOperation({ resource: 'material', action: 'create' }),
2118
+ WmsMutationEvent({ event: 'material.created' }),
1927
2119
  tslib.__param(0, graphql.Args()),
1928
2120
  tslib.__metadata("design:type", Function),
1929
2121
  tslib.__metadata("design:paramtypes", [CreateMaterialArgs]),
@@ -1931,6 +2123,8 @@ tslib.__decorate([
1931
2123
  ], MaterialMutation.prototype, "createMaterial", null);
1932
2124
  tslib.__decorate([
1933
2125
  graphql.Mutation(() => MaterialDto),
2126
+ WmsOperation({ resource: 'material', action: 'update' }),
2127
+ WmsMutationEvent({ event: 'material.updated' }),
1934
2128
  tslib.__param(0, graphql.Args()),
1935
2129
  tslib.__metadata("design:type", Function),
1936
2130
  tslib.__metadata("design:paramtypes", [UpdateMaterialArgs]),
@@ -1979,6 +2173,7 @@ let MaterialQuery = class MaterialQuery {
1979
2173
  };
1980
2174
  tslib.__decorate([
1981
2175
  graphql.Query(() => MaterialDto),
2176
+ WmsOperation({ resource: 'material', action: 'read' }),
1982
2177
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID, nullable: true })),
1983
2178
  tslib.__param(1, graphql.Args('key', { type: () => String, nullable: true })),
1984
2179
  tslib.__metadata("design:type", Function),
@@ -1987,6 +2182,7 @@ tslib.__decorate([
1987
2182
  ], MaterialQuery.prototype, "material", null);
1988
2183
  tslib.__decorate([
1989
2184
  graphql.Query(() => Materials),
2185
+ WmsOperation({ resource: 'material', action: 'read' }),
1990
2186
  tslib.__param(0, graphql.Args()),
1991
2187
  tslib.__metadata("design:type", Function),
1992
2188
  tslib.__metadata("design:paramtypes", [FindMaterialArgs]),
@@ -2098,6 +2294,7 @@ let StockQuery = class StockQuery {
2098
2294
  };
2099
2295
  tslib.__decorate([
2100
2296
  graphql.Query(() => StockDto),
2297
+ WmsOperation({ resource: 'stock', action: 'read' }),
2101
2298
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID })),
2102
2299
  tslib.__metadata("design:type", Function),
2103
2300
  tslib.__metadata("design:paramtypes", [String]),
@@ -2105,6 +2302,7 @@ tslib.__decorate([
2105
2302
  ], StockQuery.prototype, "stock", null);
2106
2303
  tslib.__decorate([
2107
2304
  graphql.Query(() => Stocks),
2305
+ WmsOperation({ resource: 'stock', action: 'read' }),
2108
2306
  tslib.__param(0, graphql.Args()),
2109
2307
  tslib.__metadata("design:type", Function),
2110
2308
  tslib.__metadata("design:paramtypes", [FindStockArgs]),
@@ -2112,6 +2310,7 @@ tslib.__decorate([
2112
2310
  ], StockQuery.prototype, "stocks", null);
2113
2311
  tslib.__decorate([
2114
2312
  graphql.Query(() => Materials),
2313
+ WmsOperation({ resource: 'stock', action: 'read' }),
2115
2314
  tslib.__param(0, graphql.Args()),
2116
2315
  tslib.__metadata("design:type", Function),
2117
2316
  tslib.__metadata("design:paramtypes", [FindStockArgs]),
@@ -2119,6 +2318,7 @@ tslib.__decorate([
2119
2318
  ], StockQuery.prototype, "stocksGroupedByMaterial", null);
2120
2319
  tslib.__decorate([
2121
2320
  graphql.Query(() => AggregatedStocks),
2321
+ WmsOperation({ resource: 'stock', action: 'read' }),
2122
2322
  tslib.__param(0, graphql.Args()),
2123
2323
  tslib.__metadata("design:type", Function),
2124
2324
  tslib.__metadata("design:paramtypes", [FindStockArgs]),
@@ -2126,6 +2326,7 @@ tslib.__decorate([
2126
2326
  ], StockQuery.prototype, "aggregatedStocks", null);
2127
2327
  tslib.__decorate([
2128
2328
  graphql.Query(() => ChangeLogs),
2329
+ WmsOperation({ resource: 'stock', action: 'read' }),
2129
2330
  tslib.__param(0, graphql.Args()),
2130
2331
  tslib.__metadata("design:type", Function),
2131
2332
  tslib.__metadata("design:paramtypes", [FindStockArgs]),
@@ -2318,6 +2519,8 @@ let ReceiveInventoryOrderMutation = class ReceiveInventoryOrderMutation {
2318
2519
  };
2319
2520
  tslib.__decorate([
2320
2521
  graphql.Mutation(() => ReceiveInventoryOrderDto),
2522
+ WmsOperation({ resource: 'receive-inventory-order', action: 'create' }),
2523
+ WmsMutationEvent({ event: 'receive-inventory-order.created' }),
2321
2524
  tslib.__param(0, graphql.Args()),
2322
2525
  tslib.__metadata("design:type", Function),
2323
2526
  tslib.__metadata("design:paramtypes", [CreateReceiveInventoryOrderArgs]),
@@ -2325,6 +2528,8 @@ tslib.__decorate([
2325
2528
  ], ReceiveInventoryOrderMutation.prototype, "createReceiveInventoryOrder", null);
2326
2529
  tslib.__decorate([
2327
2530
  graphql.Mutation(() => ReceiveInventoryOrderDto),
2531
+ WmsOperation({ resource: 'receive-inventory-order', action: 'update' }),
2532
+ WmsMutationEvent({ event: 'receive-inventory-order.updated' }),
2328
2533
  tslib.__param(0, graphql.Args()),
2329
2534
  tslib.__metadata("design:type", Function),
2330
2535
  tslib.__metadata("design:paramtypes", [UpdateReceiveInventoryOrderArgs]),
@@ -2332,6 +2537,8 @@ tslib.__decorate([
2332
2537
  ], ReceiveInventoryOrderMutation.prototype, "updateReceiveInventoryOrder", null);
2333
2538
  tslib.__decorate([
2334
2539
  graphql.Mutation(() => Boolean),
2540
+ WmsOperation({ resource: 'receive-inventory-order', action: 'receive' }),
2541
+ WmsMutationEvent({ event: 'receive-inventory-order.received' }),
2335
2542
  tslib.__param(0, graphql.Args('items', { type: () => [ReceiveOrderArgs] })),
2336
2543
  tslib.__metadata("design:type", Function),
2337
2544
  tslib.__metadata("design:paramtypes", [Array]),
@@ -2428,6 +2635,7 @@ let ReceiveInventoryOrderQuery = class ReceiveInventoryOrderQuery {
2428
2635
  };
2429
2636
  tslib.__decorate([
2430
2637
  graphql.Query(() => ReceiveInventoryOrderDto),
2638
+ WmsOperation({ resource: 'receive-inventory-order', action: 'read' }),
2431
2639
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID })),
2432
2640
  tslib.__metadata("design:type", Function),
2433
2641
  tslib.__metadata("design:paramtypes", [String]),
@@ -2435,6 +2643,7 @@ tslib.__decorate([
2435
2643
  ], ReceiveInventoryOrderQuery.prototype, "receiveInventoryOrder", null);
2436
2644
  tslib.__decorate([
2437
2645
  graphql.Query(() => ReceiveInventoryOrders),
2646
+ WmsOperation({ resource: 'receive-inventory-order', action: 'read' }),
2438
2647
  tslib.__param(0, graphql.Args()),
2439
2648
  tslib.__metadata("design:type", Function),
2440
2649
  tslib.__metadata("design:paramtypes", [FindReceiveInventoryOrderArgs]),
@@ -2672,6 +2881,8 @@ let ShipInventoryOrderMutation = class ShipInventoryOrderMutation {
2672
2881
  };
2673
2882
  tslib.__decorate([
2674
2883
  graphql.Mutation(() => ShipInventoryOrderDto),
2884
+ WmsOperation({ resource: 'ship-inventory-order', action: 'create' }),
2885
+ WmsMutationEvent({ event: 'ship-inventory-order.created' }),
2675
2886
  tslib.__param(0, graphql.Args()),
2676
2887
  tslib.__metadata("design:type", Function),
2677
2888
  tslib.__metadata("design:paramtypes", [CreateShipInventoryOrderArgs]),
@@ -2679,6 +2890,8 @@ tslib.__decorate([
2679
2890
  ], ShipInventoryOrderMutation.prototype, "createShipInventoryOrder", null);
2680
2891
  tslib.__decorate([
2681
2892
  graphql.Mutation(() => ShipInventoryOrderDto),
2893
+ WmsOperation({ resource: 'ship-inventory-order', action: 'update' }),
2894
+ WmsMutationEvent({ event: 'ship-inventory-order.updated' }),
2682
2895
  tslib.__param(0, graphql.Args()),
2683
2896
  tslib.__metadata("design:type", Function),
2684
2897
  tslib.__metadata("design:paramtypes", [UpdateShipInventoryOrderArgs]),
@@ -2686,6 +2899,8 @@ tslib.__decorate([
2686
2899
  ], ShipInventoryOrderMutation.prototype, "updateShipInventoryOrder", null);
2687
2900
  tslib.__decorate([
2688
2901
  graphql.Mutation(() => Boolean),
2902
+ WmsOperation({ resource: 'ship-inventory-order', action: 'ship' }),
2903
+ WmsMutationEvent({ event: 'ship-inventory-order.shipped' }),
2689
2904
  tslib.__param(0, graphql.Args('items', { type: () => [ShipOrderArgs] })),
2690
2905
  tslib.__metadata("design:type", Function),
2691
2906
  tslib.__metadata("design:paramtypes", [Array]),
@@ -2693,6 +2908,8 @@ tslib.__decorate([
2693
2908
  ], ShipInventoryOrderMutation.prototype, "ship", null);
2694
2909
  tslib.__decorate([
2695
2910
  graphql.Mutation(() => Boolean),
2911
+ WmsOperation({ resource: 'ship-inventory-order', action: 'cancel' }),
2912
+ WmsMutationEvent({ event: 'ship-inventory-order.ship-cancelled' }),
2696
2913
  tslib.__param(0, graphql.Args('items', { type: () => [CancelShipOrderArgs] })),
2697
2914
  tslib.__metadata("design:type", Function),
2698
2915
  tslib.__metadata("design:paramtypes", [Array]),
@@ -2789,6 +3006,7 @@ let ShipInventoryOrderQuery = class ShipInventoryOrderQuery {
2789
3006
  };
2790
3007
  tslib.__decorate([
2791
3008
  graphql.Query(() => ShipInventoryOrderDto),
3009
+ WmsOperation({ resource: 'ship-inventory-order', action: 'read' }),
2792
3010
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID })),
2793
3011
  tslib.__metadata("design:type", Function),
2794
3012
  tslib.__metadata("design:paramtypes", [String]),
@@ -2796,6 +3014,7 @@ tslib.__decorate([
2796
3014
  ], ShipInventoryOrderQuery.prototype, "shipInventoryOrder", null);
2797
3015
  tslib.__decorate([
2798
3016
  graphql.Query(() => ShipInventoryOrders),
3017
+ WmsOperation({ resource: 'ship-inventory-order', action: 'read' }),
2799
3018
  tslib.__param(0, graphql.Args()),
2800
3019
  tslib.__metadata("design:type", Function),
2801
3020
  tslib.__metadata("design:paramtypes", [FindShipInventoryOrderArgs]),
@@ -3345,6 +3564,8 @@ let WarehouseMapMutation = class WarehouseMapMutation {
3345
3564
  };
3346
3565
  tslib.__decorate([
3347
3566
  graphql.Mutation(() => MapDataDto),
3567
+ WmsOperation({ resource: 'warehouse-map', action: 'update' }),
3568
+ WmsMutationEvent({ event: 'warehouse-map.updated' }),
3348
3569
  tslib.__param(0, graphql.Args()),
3349
3570
  tslib.__metadata("design:type", Function),
3350
3571
  tslib.__metadata("design:paramtypes", [UpdateWarehouseMapArgs]),
@@ -3446,6 +3667,7 @@ let LocationQuery = class LocationQuery {
3446
3667
  };
3447
3668
  tslib.__decorate([
3448
3669
  graphql.Query(() => LocationDto),
3670
+ WmsOperation({ resource: 'location', action: 'read' }),
3449
3671
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID })),
3450
3672
  tslib.__metadata("design:type", Function),
3451
3673
  tslib.__metadata("design:paramtypes", [String]),
@@ -3453,6 +3675,7 @@ tslib.__decorate([
3453
3675
  ], LocationQuery.prototype, "location", null);
3454
3676
  tslib.__decorate([
3455
3677
  graphql.Query(() => Locations),
3678
+ WmsOperation({ resource: 'location', action: 'read' }),
3456
3679
  tslib.__param(0, graphql.Args()),
3457
3680
  tslib.__metadata("design:type", Function),
3458
3681
  tslib.__metadata("design:paramtypes", [FindLocationArgs]),
@@ -3523,6 +3746,8 @@ let LocationMutation = class LocationMutation {
3523
3746
  };
3524
3747
  tslib.__decorate([
3525
3748
  graphql.Mutation(() => LocationDto),
3749
+ WmsOperation({ resource: 'location', action: 'create' }),
3750
+ WmsMutationEvent({ event: 'location.created' }),
3526
3751
  tslib.__param(0, graphql.Args()),
3527
3752
  tslib.__metadata("design:type", Function),
3528
3753
  tslib.__metadata("design:paramtypes", [CreateLocationArgs]),
@@ -3530,6 +3755,8 @@ tslib.__decorate([
3530
3755
  ], LocationMutation.prototype, "createLocation", null);
3531
3756
  tslib.__decorate([
3532
3757
  graphql.Mutation(() => LocationDto),
3758
+ WmsOperation({ resource: 'location', action: 'update' }),
3759
+ WmsMutationEvent({ event: 'location.updated' }),
3533
3760
  tslib.__param(0, graphql.Args()),
3534
3761
  tslib.__metadata("design:type", Function),
3535
3762
  tslib.__metadata("design:paramtypes", [UpdateLocationArgs]),
@@ -3572,6 +3799,7 @@ let UnitQuery = class UnitQuery {
3572
3799
  };
3573
3800
  tslib.__decorate([
3574
3801
  graphql.Query(() => [UnitDto]),
3802
+ WmsOperation({ resource: 'unit', action: 'read' }),
3575
3803
  tslib.__metadata("design:type", Function),
3576
3804
  tslib.__metadata("design:paramtypes", []),
3577
3805
  tslib.__metadata("design:returntype", Promise)
@@ -3831,6 +4059,8 @@ let TransferOrderMutation = class TransferOrderMutation {
3831
4059
  };
3832
4060
  tslib.__decorate([
3833
4061
  graphql.Mutation(() => TransferOrderDto),
4062
+ WmsOperation({ resource: 'transfer-order', action: 'create' }),
4063
+ WmsMutationEvent({ event: 'transfer-order.created' }),
3834
4064
  tslib.__param(0, graphql.Args()),
3835
4065
  tslib.__metadata("design:type", Function),
3836
4066
  tslib.__metadata("design:paramtypes", [CreateTransferOrderArgs]),
@@ -3838,6 +4068,8 @@ tslib.__decorate([
3838
4068
  ], TransferOrderMutation.prototype, "createTransferOrder", null);
3839
4069
  tslib.__decorate([
3840
4070
  graphql.Mutation(() => TransferOrderDto),
4071
+ WmsOperation({ resource: 'transfer-order', action: 'update' }),
4072
+ WmsMutationEvent({ event: 'transfer-order.updated' }),
3841
4073
  tslib.__param(0, graphql.Args()),
3842
4074
  tslib.__metadata("design:type", Function),
3843
4075
  tslib.__metadata("design:paramtypes", [UpdateTransferOrderArgs]),
@@ -3845,6 +4077,8 @@ tslib.__decorate([
3845
4077
  ], TransferOrderMutation.prototype, "updateTransferOrder", null);
3846
4078
  tslib.__decorate([
3847
4079
  graphql.Mutation(() => Boolean),
4080
+ WmsOperation({ resource: 'transfer-order', action: 'transfer' }),
4081
+ WmsMutationEvent({ event: 'transfer-order.transferred' }),
3848
4082
  tslib.__param(0, graphql.Args('items', { type: () => [TransferOrderArgs] })),
3849
4083
  tslib.__metadata("design:type", Function),
3850
4084
  tslib.__metadata("design:paramtypes", [Array]),
@@ -3852,6 +4086,8 @@ tslib.__decorate([
3852
4086
  ], TransferOrderMutation.prototype, "transfer", null);
3853
4087
  tslib.__decorate([
3854
4088
  graphql.Mutation(() => Boolean),
4089
+ WmsOperation({ resource: 'transfer-order', action: 'cancel' }),
4090
+ WmsMutationEvent({ event: 'transfer-order.transfer-cancelled' }),
3855
4091
  tslib.__param(0, graphql.Args('items', { type: () => [CancelTransferOrderArgs] })),
3856
4092
  tslib.__metadata("design:type", Function),
3857
4093
  tslib.__metadata("design:paramtypes", [Array]),
@@ -3956,6 +4192,7 @@ let TransferOrderQuery = class TransferOrderQuery {
3956
4192
  };
3957
4193
  tslib.__decorate([
3958
4194
  graphql.Query(() => TransferOrders),
4195
+ WmsOperation({ resource: 'transfer-order', action: 'read' }),
3959
4196
  tslib.__param(0, graphql.Args()),
3960
4197
  tslib.__metadata("design:type", Function),
3961
4198
  tslib.__metadata("design:paramtypes", [FindTransferOrderArgs]),
@@ -3963,6 +4200,7 @@ tslib.__decorate([
3963
4200
  ], TransferOrderQuery.prototype, "transferOrders", null);
3964
4201
  tslib.__decorate([
3965
4202
  graphql.Query(() => TransferOrderDto),
4203
+ WmsOperation({ resource: 'transfer-order', action: 'read' }),
3966
4204
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID })),
3967
4205
  tslib.__metadata("design:type", Function),
3968
4206
  tslib.__metadata("design:paramtypes", [String]),
@@ -4300,6 +4538,8 @@ let HoldInventoryOrderMutation = class HoldInventoryOrderMutation {
4300
4538
  };
4301
4539
  tslib.__decorate([
4302
4540
  graphql.Mutation(() => HoldInventoryOrderDto),
4541
+ WmsOperation({ resource: 'hold-inventory-order', action: 'create' }),
4542
+ WmsMutationEvent({ event: 'hold-inventory-order.created' }),
4303
4543
  tslib.__param(0, graphql.Args()),
4304
4544
  tslib.__metadata("design:type", Function),
4305
4545
  tslib.__metadata("design:paramtypes", [CreateHoldInventoryOrderArgs]),
@@ -4307,6 +4547,8 @@ tslib.__decorate([
4307
4547
  ], HoldInventoryOrderMutation.prototype, "createHoldInventoryOrder", null);
4308
4548
  tslib.__decorate([
4309
4549
  graphql.Mutation(() => HoldInventoryOrderDto),
4550
+ WmsOperation({ resource: 'hold-inventory-order', action: 'update' }),
4551
+ WmsMutationEvent({ event: 'hold-inventory-order.updated' }),
4310
4552
  tslib.__param(0, graphql.Args()),
4311
4553
  tslib.__metadata("design:type", Function),
4312
4554
  tslib.__metadata("design:paramtypes", [UpdateHoldInventoryOrderArgs]),
@@ -4314,6 +4556,8 @@ tslib.__decorate([
4314
4556
  ], HoldInventoryOrderMutation.prototype, "updateHoldInventoryOrder", null);
4315
4557
  tslib.__decorate([
4316
4558
  graphql.Mutation(() => Boolean),
4559
+ WmsOperation({ resource: 'hold-inventory-order', action: 'release' }),
4560
+ WmsMutationEvent({ event: 'hold-inventory-order.released' }),
4317
4561
  tslib.__param(0, graphql.Args('items', { type: () => [ReleaseOrderArgs] })),
4318
4562
  tslib.__metadata("design:type", Function),
4319
4563
  tslib.__metadata("design:paramtypes", [Array]),
@@ -4373,6 +4617,7 @@ let HoldInventoryOrderQuery = class HoldInventoryOrderQuery {
4373
4617
  };
4374
4618
  tslib.__decorate([
4375
4619
  graphql.Query(() => HoldInventoryOrders),
4620
+ WmsOperation({ resource: 'hold-inventory-order', action: 'read' }),
4376
4621
  tslib.__param(0, graphql.Args()),
4377
4622
  tslib.__metadata("design:type", Function),
4378
4623
  tslib.__metadata("design:paramtypes", [FindHoldInventoryOrderArgs]),
@@ -4434,6 +4679,7 @@ let BatchQuery = class BatchQuery {
4434
4679
  };
4435
4680
  tslib.__decorate([
4436
4681
  graphql.Query(() => Batches),
4682
+ WmsOperation({ resource: 'batch', action: 'read' }),
4437
4683
  tslib.__param(0, graphql.Args()),
4438
4684
  tslib.__metadata("design:type", Function),
4439
4685
  tslib.__metadata("design:paramtypes", [FindBatchArgs]),
@@ -4653,6 +4899,7 @@ let AllocateInventoryOrderQuery = class AllocateInventoryOrderQuery {
4653
4899
  };
4654
4900
  tslib.__decorate([
4655
4901
  graphql.Query(() => AllocateInventoryOrders),
4902
+ WmsOperation({ resource: 'allocate-inventory-order', action: 'read' }),
4656
4903
  tslib.__param(0, graphql.Args()),
4657
4904
  tslib.__metadata("design:type", Function),
4658
4905
  tslib.__metadata("design:paramtypes", [FindAllocateInventoryOrderArgs]),
@@ -4828,6 +5075,8 @@ let AllocateInventoryOrderMutation = class AllocateInventoryOrderMutation {
4828
5075
  };
4829
5076
  tslib.__decorate([
4830
5077
  graphql.Mutation(() => AllocateInventoryOrderDto),
5078
+ WmsOperation({ resource: 'allocate-inventory-order', action: 'create' }),
5079
+ WmsMutationEvent({ event: 'allocate-inventory-order.created' }),
4831
5080
  tslib.__param(0, graphql.Args()),
4832
5081
  tslib.__metadata("design:type", Function),
4833
5082
  tslib.__metadata("design:paramtypes", [CreateAllocateInventoryOrderArgs]),
@@ -4835,6 +5084,8 @@ tslib.__decorate([
4835
5084
  ], AllocateInventoryOrderMutation.prototype, "createAllocateInventoryOrder", null);
4836
5085
  tslib.__decorate([
4837
5086
  graphql.Mutation(() => AllocateInventoryOrderDto),
5087
+ WmsOperation({ resource: 'allocate-inventory-order', action: 'update' }),
5088
+ WmsMutationEvent({ event: 'allocate-inventory-order.updated' }),
4838
5089
  tslib.__param(0, graphql.Args()),
4839
5090
  tslib.__metadata("design:type", Function),
4840
5091
  tslib.__metadata("design:paramtypes", [UpdateAllocateInventoryOrderArgs]),
@@ -4842,6 +5093,8 @@ tslib.__decorate([
4842
5093
  ], AllocateInventoryOrderMutation.prototype, "updateAllocateInventoryOrder", null);
4843
5094
  tslib.__decorate([
4844
5095
  graphql.Mutation(() => Boolean),
5096
+ WmsOperation({ resource: 'allocate-inventory-order', action: 'deallocate' }),
5097
+ WmsMutationEvent({ event: 'allocate-inventory-order.deallocated' }),
4845
5098
  tslib.__param(0, graphql.Args('items', { type: () => [DeallocateOrderArgs] })),
4846
5099
  tslib.__metadata("design:type", Function),
4847
5100
  tslib.__metadata("design:paramtypes", [Array]),
@@ -5178,6 +5431,7 @@ let SaleOrderQuery = class SaleOrderQuery {
5178
5431
  };
5179
5432
  tslib.__decorate([
5180
5433
  graphql.Query(() => [String]),
5434
+ WmsOperation({ resource: 'sale-order', action: 'read' }),
5181
5435
  tslib.__param(0, graphql.Args()),
5182
5436
  tslib.__metadata("design:type", Function),
5183
5437
  tslib.__metadata("design:paramtypes", [FindSaleOrderArgs]),
@@ -5185,6 +5439,7 @@ tslib.__decorate([
5185
5439
  ], SaleOrderQuery.prototype, "saleOrderDistinctIds", null);
5186
5440
  tslib.__decorate([
5187
5441
  graphql.Query(() => [String]),
5442
+ WmsOperation({ resource: 'sale-order', action: 'read' }),
5188
5443
  tslib.__param(0, graphql.Args('id', { type: () => graphql.ID })),
5189
5444
  tslib.__metadata("design:type", Function),
5190
5445
  tslib.__metadata("design:paramtypes", [String]),
@@ -5295,6 +5550,8 @@ let SplitBatchMutation = class SplitBatchMutation {
5295
5550
  };
5296
5551
  tslib.__decorate([
5297
5552
  graphql.Mutation(() => SplitBatchOrderDto),
5553
+ WmsOperation({ resource: 'batch', action: 'split' }),
5554
+ WmsMutationEvent({ event: 'batch.splitted' }),
5298
5555
  tslib.__param(0, graphql.Args()),
5299
5556
  tslib.__metadata("design:type", Function),
5300
5557
  tslib.__metadata("design:paramtypes", [SplitBatchArgs]),
@@ -5413,6 +5670,8 @@ let MergeBatchMutation = class MergeBatchMutation {
5413
5670
  };
5414
5671
  tslib.__decorate([
5415
5672
  graphql.Mutation(() => MergeBatchOrderDto),
5673
+ WmsOperation({ resource: 'batch', action: 'merge' }),
5674
+ WmsMutationEvent({ event: 'batch.merged' }),
5416
5675
  tslib.__param(0, graphql.Args()),
5417
5676
  tslib.__metadata("design:type", Function),
5418
5677
  tslib.__metadata("design:paramtypes", [MergeBatchArgs]),
@@ -5537,6 +5796,8 @@ let ReclassifyInventoryOrderMutation = class ReclassifyInventoryOrderMutation {
5537
5796
  };
5538
5797
  tslib.__decorate([
5539
5798
  graphql.Mutation(() => ReclassifyInventoryOrderDto),
5799
+ WmsOperation({ resource: 'reclassify-inventory-order', action: 'reclassify' }),
5800
+ WmsMutationEvent({ event: 'reclassify-inventory-order.reclassified' }),
5540
5801
  tslib.__param(0, graphql.Args()),
5541
5802
  tslib.__metadata("design:type", Function),
5542
5803
  tslib.__metadata("design:paramtypes", [ReclassifyInventoryOrderArgs]),
@@ -5709,6 +5970,8 @@ let TransferCustomerOrderMutation = class TransferCustomerOrderMutation {
5709
5970
  };
5710
5971
  tslib.__decorate([
5711
5972
  graphql.Mutation(() => TransferCustomerOrderDto),
5973
+ WmsOperation({ resource: 'transfer-customer-order', action: 'create' }),
5974
+ WmsMutationEvent({ event: 'transfer-customer-order.created' }),
5712
5975
  tslib.__param(0, graphql.Args()),
5713
5976
  tslib.__metadata("design:type", Function),
5714
5977
  tslib.__metadata("design:paramtypes", [CreateTransferCustomerOrderArgs]),
@@ -5716,6 +5979,8 @@ tslib.__decorate([
5716
5979
  ], TransferCustomerOrderMutation.prototype, "createTransferCustomerOrder", null);
5717
5980
  tslib.__decorate([
5718
5981
  graphql.Mutation(() => TransferCustomerOrderDto),
5982
+ WmsOperation({ resource: 'transfer-customer-order', action: 'update' }),
5983
+ WmsMutationEvent({ event: 'transfer-customer-order.updated' }),
5719
5984
  tslib.__param(0, graphql.Args()),
5720
5985
  tslib.__metadata("design:type", Function),
5721
5986
  tslib.__metadata("design:paramtypes", [UpdateTransferCustomerOrderArgs]),
@@ -5723,6 +5988,8 @@ tslib.__decorate([
5723
5988
  ], TransferCustomerOrderMutation.prototype, "updateTransferCustomerOrder", null);
5724
5989
  tslib.__decorate([
5725
5990
  graphql.Mutation(() => Boolean),
5991
+ WmsOperation({ resource: 'transfer-customer-order', action: 'return' }),
5992
+ WmsMutationEvent({ event: 'transfer-customer-order.returned' }),
5726
5993
  tslib.__param(0, graphql.Args('items', { type: () => [ReturnTransferCustomerOrderArgs] })),
5727
5994
  tslib.__metadata("design:type", Function),
5728
5995
  tslib.__metadata("design:paramtypes", [Array]),
@@ -5914,6 +6181,8 @@ let TransferVendorOrderMutation = class TransferVendorOrderMutation {
5914
6181
  };
5915
6182
  tslib.__decorate([
5916
6183
  graphql.Mutation(() => TransferVendorOrderDto),
6184
+ WmsOperation({ resource: 'transfer-vendor-order', action: 'create' }),
6185
+ WmsMutationEvent({ event: 'transfer-vendor-order.created' }),
5917
6186
  tslib.__param(0, graphql.Args()),
5918
6187
  tslib.__metadata("design:type", Function),
5919
6188
  tslib.__metadata("design:paramtypes", [CreateTransferVendorOrderArgs]),
@@ -5921,6 +6190,8 @@ tslib.__decorate([
5921
6190
  ], TransferVendorOrderMutation.prototype, "createTransferVendorOrder", null);
5922
6191
  tslib.__decorate([
5923
6192
  graphql.Mutation(() => TransferVendorOrderDto),
6193
+ WmsOperation({ resource: 'transfer-vendor-order', action: 'update' }),
6194
+ WmsMutationEvent({ event: 'transfer-vendor-order.updated' }),
5924
6195
  tslib.__param(0, graphql.Args()),
5925
6196
  tslib.__metadata("design:type", Function),
5926
6197
  tslib.__metadata("design:paramtypes", [UpdateTransferVendorOrderArgs]),
@@ -5928,6 +6199,8 @@ tslib.__decorate([
5928
6199
  ], TransferVendorOrderMutation.prototype, "updateTransferVendorOrder", null);
5929
6200
  tslib.__decorate([
5930
6201
  graphql.Mutation(() => Boolean),
6202
+ WmsOperation({ resource: 'transfer-vendor-order', action: 'return' }),
6203
+ WmsMutationEvent({ event: 'transfer-vendor-order.returned' }),
5931
6204
  tslib.__param(0, graphql.Args('items', { type: () => [ReturnTransferVendorOrderArgs] })),
5932
6205
  tslib.__metadata("design:type", Function),
5933
6206
  tslib.__metadata("design:paramtypes", [Array]),
@@ -6049,6 +6322,8 @@ let ScrapeMutation = class ScrapeMutation {
6049
6322
  };
6050
6323
  tslib.__decorate([
6051
6324
  graphql.Mutation(() => ScrapeOrderDto),
6325
+ WmsOperation({ resource: 'scrape-order', action: 'scrape' }),
6326
+ WmsMutationEvent({ event: 'scrape-order.scraped' }),
6052
6327
  tslib.__param(0, graphql.Args()),
6053
6328
  tslib.__metadata("design:type", Function),
6054
6329
  tslib.__metadata("design:paramtypes", [ScrapeOrderArgs]),
@@ -6131,6 +6406,8 @@ let QualityInspectionOrderMutation = class QualityInspectionOrderMutation {
6131
6406
  };
6132
6407
  tslib.__decorate([
6133
6408
  graphql.Mutation(() => QualityInspectionOrderDto),
6409
+ WmsOperation({ resource: 'quality-inspection-order', action: 'inspect' }),
6410
+ WmsMutationEvent({ event: 'quality-inspection-order.inspected' }),
6134
6411
  tslib.__param(0, graphql.Args()),
6135
6412
  tslib.__metadata("design:type", Function),
6136
6413
  tslib.__metadata("design:paramtypes", [CreateQualityInspectionOrderArgs]),
@@ -6154,6 +6431,7 @@ let WarehouseMapDataQuery = class WarehouseMapDataQuery {
6154
6431
  };
6155
6432
  tslib.__decorate([
6156
6433
  graphql.Query(() => MapDataDto),
6434
+ WmsOperation({ resource: 'warehouse-map', action: 'read' }),
6157
6435
  tslib.__param(0, graphql.Args('key')),
6158
6436
  tslib.__metadata("design:type", Function),
6159
6437
  tslib.__metadata("design:paramtypes", [String]),
@@ -6243,12 +6521,24 @@ const exportDependencies = [
6243
6521
  ];
6244
6522
  exports.WmsModuleGraphqlModule = WmsModuleGraphqlModule_1 = class WmsModuleGraphqlModule {
6245
6523
  static forRootAsync(options) {
6246
- const coreModule = wmsModuleCore.WmsModuleCoreModule.forRootAsync(options);
6524
+ const { authChecker, beforeHooks, afterListeners, eventEmitterBridge, ...coreOptions } = options;
6525
+ const coreModule = wmsModuleCore.WmsModuleCoreModule.forRootAsync(coreOptions);
6526
+ const authOptions = { authChecker };
6527
+ const eventOptions = { beforeHooks, afterListeners };
6528
+ const providers = [
6529
+ ...exportDependencies,
6530
+ exports.WmsAuthGuard,
6531
+ { provide: WMS_AUTH_OPTIONS, useValue: authOptions },
6532
+ { provide: wmsModuleCore.WMS_EVENT_OPTIONS, useValue: eventOptions },
6533
+ wmsModuleCore.WmsEventDispatcher,
6534
+ exports.WmsMutationInterceptor,
6535
+ ...(eventEmitterBridge ? [eventEmitterBridge] : []),
6536
+ ];
6247
6537
  return {
6248
6538
  module: WmsModuleGraphqlModule_1,
6249
6539
  imports: [coreModule, HelperModule],
6250
- providers: exportDependencies,
6251
- exports: [...exportDependencies, HelperModule, coreModule],
6540
+ providers,
6541
+ exports: [...exportDependencies, exports.WmsAuthGuard, HelperModule, coreModule],
6252
6542
  };
6253
6543
  }
6254
6544
  };
@@ -6258,4 +6548,10 @@ exports.WmsModuleGraphqlModule = WmsModuleGraphqlModule_1 = tslib.__decorate([
6258
6548
  })
6259
6549
  ], exports.WmsModuleGraphqlModule);
6260
6550
 
6551
+ exports.HOST_SKIP_METADATA_KEY = HOST_SKIP_METADATA_KEY;
6552
+ exports.WMS_AUTH_OPTIONS = WMS_AUTH_OPTIONS;
6553
+ exports.WMS_MUTATION_EVENT_METADATA = WMS_MUTATION_EVENT_METADATA;
6554
+ exports.WMS_OPERATION_METADATA = WMS_OPERATION_METADATA;
6555
+ exports.WmsMutationEvent = WmsMutationEvent;
6556
+ exports.WmsOperation = WmsOperation;
6261
6557
  exports.createWmsLoaders = createWmsLoaders;