@saihu/common 1.1.34 → 1.1.36

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.
@@ -2,21 +2,29 @@ export type ExchangeType = 'topic' | 'direct' | 'fanout' | 'headers';
2
2
  export declare enum Exchanges {
3
3
  IM_PROCUREMENT_ORDER = "im.procurement.order",
4
4
  IM_SUPPLIER_ITEM = "im.supplier.item",
5
+ IM_GENERIC_ITEM = "im.generic.item",
5
6
  SHOP = "shop",
6
7
  OPER_LOG_EXCHANGE = "oper_log_exchange"
7
8
  }
8
9
  export declare const RoutingKeys: {
9
10
  readonly "im.procurement.order": {
11
+ readonly ORDER_DELIVERED: "procurement.order.delivered";
10
12
  readonly RETURN_APPROVED: "procurement.order.return.approved";
11
13
  readonly ORDER_FINALIZED: "procurement.order.finalized";
14
+ readonly ORDER_CHECK_PASSED: "procurement.order.check.passed";
12
15
  };
13
16
  readonly shop: {
14
- readonly SHOP_CREATED: "shop.created";
17
+ readonly SHOP_UPSERTED: "shop.upserted";
15
18
  };
16
19
  readonly "im.supplier.item": {
17
- readonly SUPPLIER_ITEM_UPDATED: "supplier.item.updated";
20
+ readonly SUPPLIER_ITEMS_UPSERTED: "supplier.items.upserted";
21
+ };
22
+ readonly "im.generic.item": {
23
+ readonly GENERIC_ITEM_UPSERTED: "generic.item.upserted";
24
+ };
25
+ readonly oper_log_exchange: {
26
+ readonly OPER_LOG_CREATED: "oper.log.created";
18
27
  };
19
- readonly oper_log_exchange: {};
20
28
  };
21
29
  export type RoutingKeysForExchange<E extends Exchanges> = (typeof RoutingKeys)[E][keyof (typeof RoutingKeys)[E]];
22
30
  export declare const ExchangeTypes: Record<Exchanges, ExchangeType>;
@@ -24,6 +32,7 @@ export declare const ExchangeOptions: Record<Exchanges, {
24
32
  durable: boolean;
25
33
  internal?: boolean;
26
34
  autoDelete?: boolean;
35
+ messageTtl?: number;
27
36
  }>;
28
37
  export declare const q: (service: string, rk: string) => string;
29
38
  //# sourceMappingURL=topology.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"topology.d.ts","sourceRoot":"","sources":["../../src/messaging/topology.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErE,oBAAY,SAAS;IACnB,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,IAAI,SAAS;IACb,iBAAiB,sBAAsB;CACxC;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;CAcd,CAAC;AAEX,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,SAAS,IACpD,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,CAKzD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,SAAS,EACT;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAM/D,CAAC;AAEF,eAAO,MAAM,CAAC,GAAI,SAAS,MAAM,EAAE,IAAI,MAAM,WAAyB,CAAC"}
1
+ {"version":3,"file":"topology.d.ts","sourceRoot":"","sources":["../../src/messaging/topology.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErE,oBAAY,SAAS;IACnB,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,IAAI,SAAS;IACb,iBAAiB,sBAAsB;CACxC;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;CAoBd,CAAC;AAEX,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,SAAS,IACpD,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,CAMzD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,SAAS,EACT;IACE,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAOF,CAAC;AAEF,eAAO,MAAM,CAAC,GAAI,SAAS,MAAM,EAAE,IAAI,MAAM,WAAyB,CAAC"}
@@ -5,22 +5,29 @@ var Exchanges;
5
5
  (function (Exchanges) {
6
6
  Exchanges["IM_PROCUREMENT_ORDER"] = "im.procurement.order";
7
7
  Exchanges["IM_SUPPLIER_ITEM"] = "im.supplier.item";
8
+ Exchanges["IM_GENERIC_ITEM"] = "im.generic.item";
8
9
  Exchanges["SHOP"] = "shop";
9
10
  Exchanges["OPER_LOG_EXCHANGE"] = "oper_log_exchange";
10
11
  })(Exchanges || (exports.Exchanges = Exchanges = {}));
11
12
  exports.RoutingKeys = {
12
13
  [Exchanges.IM_PROCUREMENT_ORDER]: {
14
+ ORDER_DELIVERED: 'procurement.order.delivered',
13
15
  RETURN_APPROVED: 'procurement.order.return.approved',
14
16
  ORDER_FINALIZED: 'procurement.order.finalized',
17
+ ORDER_CHECK_PASSED: 'procurement.order.check.passed',
15
18
  },
16
19
  [Exchanges.SHOP]: {
17
- SHOP_CREATED: 'shop.created',
20
+ SHOP_UPSERTED: 'shop.upserted',
18
21
  },
19
22
  [Exchanges.IM_SUPPLIER_ITEM]: {
20
- SUPPLIER_ITEM_UPDATED: 'supplier.item.updated',
23
+ SUPPLIER_ITEMS_UPSERTED: 'supplier.items.upserted',
24
+ },
25
+ [Exchanges.IM_GENERIC_ITEM]: {
26
+ GENERIC_ITEM_UPSERTED: 'generic.item.upserted',
21
27
  },
22
28
  [Exchanges.OPER_LOG_EXCHANGE]: {
23
- // Add your oper log routing keys here
29
+ // Add your oper log routing keys here
30
+ OPER_LOG_CREATED: 'oper.log.created',
24
31
  },
25
32
  };
26
33
  exports.ExchangeTypes = {
@@ -28,12 +35,14 @@ exports.ExchangeTypes = {
28
35
  [Exchanges.SHOP]: 'topic',
29
36
  [Exchanges.OPER_LOG_EXCHANGE]: 'direct',
30
37
  [Exchanges.IM_SUPPLIER_ITEM]: 'topic',
38
+ [Exchanges.IM_GENERIC_ITEM]: 'topic',
31
39
  };
32
40
  exports.ExchangeOptions = {
33
41
  [Exchanges.IM_PROCUREMENT_ORDER]: { durable: true },
34
42
  [Exchanges.SHOP]: { durable: true },
35
- [Exchanges.OPER_LOG_EXCHANGE]: { durable: true },
43
+ [Exchanges.OPER_LOG_EXCHANGE]: { durable: true, messageTtl: 86400000 },
36
44
  [Exchanges.IM_SUPPLIER_ITEM]: { durable: true },
45
+ [Exchanges.IM_GENERIC_ITEM]: { durable: true },
37
46
  };
38
47
  const q = (service, rk) => `q.${rk}.${service}`; // e.g. q.procurement.order.delivered.imjobs
39
48
  exports.q = q;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saihu/common",
3
- "version": "1.1.34",
3
+ "version": "1.1.36",
4
4
  "description": "Common utilities for NestJS applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",