@restorecommerce/facade 1.1.6 → 1.3.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 (254) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.cjs +13 -0
  3. package/CHANGELOG.md +22 -0
  4. package/codegen/index.d.ts +1 -1
  5. package/codegen/index.js +19 -44
  6. package/debug-run.ts +7 -6
  7. package/dist/gql/index.d.ts +1 -1
  8. package/dist/gql/index.js +1 -17
  9. package/dist/gql/protos/federation.d.ts +3 -3
  10. package/dist/gql/protos/federation.js +16 -24
  11. package/dist/gql/protos/graphql.d.ts +4 -4
  12. package/dist/gql/protos/graphql.js +64 -42
  13. package/dist/gql/protos/index.d.ts +6 -6
  14. package/dist/gql/protos/index.js +6 -22
  15. package/dist/gql/protos/registry.d.ts +6 -6
  16. package/dist/gql/protos/registry.js +157 -176
  17. package/dist/gql/protos/resolvers.d.ts +3 -3
  18. package/dist/gql/protos/resolvers.js +78 -104
  19. package/dist/gql/protos/schema.d.ts +4 -4
  20. package/dist/gql/protos/schema.js +40 -53
  21. package/dist/gql/protos/types.d.ts +3 -3
  22. package/dist/gql/protos/types.js +1 -4
  23. package/dist/gql/protos/utils.d.ts +3 -3
  24. package/dist/gql/protos/utils.js +23 -62
  25. package/dist/gql/types/AccessControlTypes.js +13 -16
  26. package/dist/gql/types/DateType.js +4 -7
  27. package/dist/gql/types/FilterType.js +7 -10
  28. package/dist/gql/types/MetaType.js +8 -11
  29. package/dist/gql/types/ScopeType.js +4 -7
  30. package/dist/gql/types/SortType.js +5 -8
  31. package/dist/gql/types/StatusType.js +4 -7
  32. package/dist/gql/types/index.d.ts +7 -7
  33. package/dist/gql/types/index.js +7 -23
  34. package/dist/index.d.ts +14 -14
  35. package/dist/index.js +195 -207
  36. package/dist/interfaces.d.ts +8 -8
  37. package/dist/interfaces.js +1 -2
  38. package/dist/middlewares/index.d.ts +1 -1
  39. package/dist/middlewares/index.js +1 -17
  40. package/dist/middlewares/req-res-logger/index.d.ts +2 -2
  41. package/dist/middlewares/req-res-logger/index.js +33 -31
  42. package/dist/modules/access-control/gql/federation.d.ts +1 -1
  43. package/dist/modules/access-control/gql/federation.js +10 -17
  44. package/dist/modules/access-control/gql/schema.d.ts +1 -1
  45. package/dist/modules/access-control/gql/schema.generated.d.ts +136 -110
  46. package/dist/modules/access-control/gql/schema.generated.js +22 -25
  47. package/dist/modules/access-control/gql/schema.js +5 -9
  48. package/dist/modules/access-control/gql/types.d.ts +2 -2
  49. package/dist/modules/access-control/gql/types.js +13 -17
  50. package/dist/modules/access-control/grpc/index.d.ts +5 -5
  51. package/dist/modules/access-control/grpc/index.js +10 -14
  52. package/dist/modules/access-control/index.d.ts +2 -2
  53. package/dist/modules/access-control/index.js +20 -17
  54. package/dist/modules/access-control/interfaces.d.ts +3 -3
  55. package/dist/modules/access-control/interfaces.js +1 -4
  56. package/dist/modules/catalog/gql/federation.d.ts +1 -1
  57. package/dist/modules/catalog/gql/federation.js +10 -17
  58. package/dist/modules/catalog/gql/schema.d.ts +1 -1
  59. package/dist/modules/catalog/gql/schema.generated.d.ts +252 -226
  60. package/dist/modules/catalog/gql/schema.generated.js +20 -23
  61. package/dist/modules/catalog/gql/schema.js +5 -9
  62. package/dist/modules/catalog/gql/types.d.ts +2 -2
  63. package/dist/modules/catalog/gql/types.js +15 -19
  64. package/dist/modules/catalog/grpc/index.d.ts +6 -6
  65. package/dist/modules/catalog/grpc/index.js +12 -16
  66. package/dist/modules/catalog/index.d.ts +2 -2
  67. package/dist/modules/catalog/index.js +20 -17
  68. package/dist/modules/catalog/interfaces.d.ts +3 -3
  69. package/dist/modules/catalog/interfaces.js +1 -4
  70. package/dist/modules/facade-status/gql/index.js +8 -14
  71. package/dist/modules/facade-status/gql/resolvers.d.ts +1 -1
  72. package/dist/modules/facade-status/gql/resolvers.js +14 -8
  73. package/dist/modules/facade-status/gql/schema.d.ts +1 -1
  74. package/dist/modules/facade-status/gql/schema.generated.d.ts +34 -11
  75. package/dist/modules/facade-status/gql/schema.generated.js +1 -2
  76. package/dist/modules/facade-status/gql/schema.js +6 -9
  77. package/dist/modules/facade-status/gql/types.js +3 -6
  78. package/dist/modules/facade-status/index.d.ts +1 -1
  79. package/dist/modules/facade-status/index.js +4 -7
  80. package/dist/modules/facade-status/interfaces.d.ts +1 -1
  81. package/dist/modules/facade-status/interfaces.js +1 -2
  82. package/dist/modules/fulfillment/gql/federation.d.ts +1 -1
  83. package/dist/modules/fulfillment/gql/federation.js +10 -17
  84. package/dist/modules/fulfillment/gql/schema.d.ts +1 -1
  85. package/dist/modules/fulfillment/gql/schema.generated.d.ts +249 -223
  86. package/dist/modules/fulfillment/gql/schema.generated.js +20 -23
  87. package/dist/modules/fulfillment/gql/schema.js +5 -9
  88. package/dist/modules/fulfillment/gql/types.d.ts +2 -2
  89. package/dist/modules/fulfillment/gql/types.js +11 -15
  90. package/dist/modules/fulfillment/grpc/index.d.ts +3 -3
  91. package/dist/modules/fulfillment/grpc/index.js +6 -10
  92. package/dist/modules/fulfillment/index.d.ts +2 -2
  93. package/dist/modules/fulfillment/index.js +20 -17
  94. package/dist/modules/fulfillment/interfaces.d.ts +3 -3
  95. package/dist/modules/fulfillment/interfaces.js +1 -4
  96. package/dist/modules/identity/api-key/api-key.d.ts +2 -2
  97. package/dist/modules/identity/api-key/api-key.js +45 -65
  98. package/dist/modules/identity/gql/federation.d.ts +2 -2
  99. package/dist/modules/identity/gql/federation.js +5 -9
  100. package/dist/modules/identity/gql/schema.d.ts +1 -1
  101. package/dist/modules/identity/gql/schema.generated.d.ts +284 -255
  102. package/dist/modules/identity/gql/schema.generated.js +20 -23
  103. package/dist/modules/identity/gql/schema.js +5 -9
  104. package/dist/modules/identity/gql/types.d.ts +2 -2
  105. package/dist/modules/identity/gql/types.js +17 -21
  106. package/dist/modules/identity/grpc/index.d.ts +6 -6
  107. package/dist/modules/identity/grpc/index.js +12 -16
  108. package/dist/modules/identity/index.d.ts +4 -4
  109. package/dist/modules/identity/index.js +24 -21
  110. package/dist/modules/identity/interfaces.d.ts +5 -5
  111. package/dist/modules/identity/interfaces.js +1 -4
  112. package/dist/modules/identity/oauth/oauth.d.ts +4 -4
  113. package/dist/modules/identity/oauth/oauth.js +109 -132
  114. package/dist/modules/identity/oidc/adapter.d.ts +3 -3
  115. package/dist/modules/identity/oidc/adapter.js +111 -92
  116. package/dist/modules/identity/oidc/in-memory-adapter.d.ts +1 -1
  117. package/dist/modules/identity/oidc/in-memory-adapter.js +64 -50
  118. package/dist/modules/identity/oidc/index.d.ts +6 -6
  119. package/dist/modules/identity/oidc/index.js +29 -30
  120. package/dist/modules/identity/oidc/interfaces.d.ts +6 -6
  121. package/dist/modules/identity/oidc/interfaces.js +2 -6
  122. package/dist/modules/identity/oidc/password-grant.d.ts +1 -1
  123. package/dist/modules/identity/oidc/password-grant.js +43 -66
  124. package/dist/modules/identity/oidc/router.d.ts +6 -6
  125. package/dist/modules/identity/oidc/router.js +31 -26
  126. package/dist/modules/identity/oidc/templates.d.ts +1 -1
  127. package/dist/modules/identity/oidc/templates.js +45 -41
  128. package/dist/modules/identity/oidc/user.d.ts +4 -4
  129. package/dist/modules/identity/oidc/user.js +31 -29
  130. package/dist/modules/identity/oidc/utils.d.ts +2 -2
  131. package/dist/modules/identity/oidc/utils.js +6 -13
  132. package/dist/modules/index.d.ts +13 -13
  133. package/dist/modules/index.js +13 -29
  134. package/dist/modules/indexing/gql/federation.d.ts +1 -1
  135. package/dist/modules/indexing/gql/federation.js +10 -17
  136. package/dist/modules/indexing/gql/schema.d.ts +1 -1
  137. package/dist/modules/indexing/gql/schema.generated.d.ts +45 -19
  138. package/dist/modules/indexing/gql/schema.generated.js +2 -5
  139. package/dist/modules/indexing/gql/schema.js +5 -9
  140. package/dist/modules/indexing/gql/types.d.ts +2 -2
  141. package/dist/modules/indexing/gql/types.js +7 -11
  142. package/dist/modules/indexing/grpc/index.d.ts +2 -2
  143. package/dist/modules/indexing/grpc/index.js +4 -8
  144. package/dist/modules/indexing/index.d.ts +2 -2
  145. package/dist/modules/indexing/index.js +20 -17
  146. package/dist/modules/indexing/interfaces.d.ts +3 -3
  147. package/dist/modules/indexing/interfaces.js +1 -4
  148. package/dist/modules/invoicing/gql/federation.d.ts +1 -1
  149. package/dist/modules/invoicing/gql/federation.js +10 -17
  150. package/dist/modules/invoicing/gql/schema.d.ts +1 -1
  151. package/dist/modules/invoicing/gql/schema.generated.d.ts +209 -183
  152. package/dist/modules/invoicing/gql/schema.generated.js +20 -23
  153. package/dist/modules/invoicing/gql/schema.js +5 -9
  154. package/dist/modules/invoicing/gql/types.d.ts +2 -2
  155. package/dist/modules/invoicing/gql/types.js +7 -11
  156. package/dist/modules/invoicing/grpc/index.d.ts +2 -2
  157. package/dist/modules/invoicing/grpc/index.js +4 -8
  158. package/dist/modules/invoicing/index.d.ts +2 -2
  159. package/dist/modules/invoicing/index.js +20 -17
  160. package/dist/modules/invoicing/interfaces.d.ts +3 -3
  161. package/dist/modules/invoicing/interfaces.js +1 -4
  162. package/dist/modules/notification/gql/federation.d.ts +1 -1
  163. package/dist/modules/notification/gql/federation.js +10 -17
  164. package/dist/modules/notification/gql/schema.d.ts +1 -1
  165. package/dist/modules/notification/gql/schema.generated.d.ts +100 -74
  166. package/dist/modules/notification/gql/schema.generated.js +18 -21
  167. package/dist/modules/notification/gql/schema.js +5 -9
  168. package/dist/modules/notification/gql/types.d.ts +2 -2
  169. package/dist/modules/notification/gql/types.js +7 -11
  170. package/dist/modules/notification/grpc/index.d.ts +2 -2
  171. package/dist/modules/notification/grpc/index.js +4 -8
  172. package/dist/modules/notification/index.d.ts +2 -2
  173. package/dist/modules/notification/index.js +20 -17
  174. package/dist/modules/notification/interfaces.d.ts +3 -3
  175. package/dist/modules/notification/interfaces.js +1 -4
  176. package/dist/modules/ordering/gql/federation.d.ts +1 -1
  177. package/dist/modules/ordering/gql/federation.js +10 -17
  178. package/dist/modules/ordering/gql/schema.d.ts +1 -1
  179. package/dist/modules/ordering/gql/schema.generated.d.ts +221 -195
  180. package/dist/modules/ordering/gql/schema.generated.js +22 -25
  181. package/dist/modules/ordering/gql/schema.js +5 -9
  182. package/dist/modules/ordering/gql/types.d.ts +2 -2
  183. package/dist/modules/ordering/gql/types.js +7 -11
  184. package/dist/modules/ordering/grpc/index.d.ts +2 -2
  185. package/dist/modules/ordering/grpc/index.js +4 -8
  186. package/dist/modules/ordering/index.d.ts +2 -2
  187. package/dist/modules/ordering/index.js +20 -17
  188. package/dist/modules/ordering/interfaces.d.ts +3 -3
  189. package/dist/modules/ordering/interfaces.js +1 -4
  190. package/dist/modules/ostorage/gql/federation.d.ts +1 -1
  191. package/dist/modules/ostorage/gql/federation.js +10 -17
  192. package/dist/modules/ostorage/gql/schema.d.ts +1 -1
  193. package/dist/modules/ostorage/gql/schema.generated.d.ts +126 -94
  194. package/dist/modules/ostorage/gql/schema.generated.js +8 -11
  195. package/dist/modules/ostorage/gql/schema.js +5 -9
  196. package/dist/modules/ostorage/gql/types.d.ts +2 -2
  197. package/dist/modules/ostorage/gql/types.js +7 -11
  198. package/dist/modules/ostorage/grpc/index.d.ts +2 -2
  199. package/dist/modules/ostorage/grpc/index.js +4 -8
  200. package/dist/modules/ostorage/index.d.ts +2 -2
  201. package/dist/modules/ostorage/index.js +20 -17
  202. package/dist/modules/ostorage/interfaces.d.ts +3 -3
  203. package/dist/modules/ostorage/interfaces.js +1 -4
  204. package/dist/modules/payment/gql/federation.d.ts +1 -1
  205. package/dist/modules/payment/gql/federation.js +10 -17
  206. package/dist/modules/payment/gql/schema.d.ts +1 -1
  207. package/dist/modules/payment/gql/schema.generated.d.ts +67 -44
  208. package/dist/modules/payment/gql/schema.generated.js +4 -7
  209. package/dist/modules/payment/gql/schema.js +5 -9
  210. package/dist/modules/payment/gql/types.d.ts +2 -2
  211. package/dist/modules/payment/gql/types.js +7 -11
  212. package/dist/modules/payment/grpc/index.d.ts +2 -2
  213. package/dist/modules/payment/grpc/index.js +4 -8
  214. package/dist/modules/payment/index.d.ts +2 -2
  215. package/dist/modules/payment/index.js +20 -17
  216. package/dist/modules/payment/interfaces.d.ts +3 -3
  217. package/dist/modules/payment/interfaces.js +1 -4
  218. package/dist/modules/resource/gql/federation.d.ts +1 -1
  219. package/dist/modules/resource/gql/federation.js +10 -17
  220. package/dist/modules/resource/gql/schema.d.ts +1 -1
  221. package/dist/modules/resource/gql/schema.generated.d.ts +514 -299
  222. package/dist/modules/resource/gql/schema.generated.js +50 -27
  223. package/dist/modules/resource/gql/schema.js +5 -9
  224. package/dist/modules/resource/gql/types.d.ts +2 -2
  225. package/dist/modules/resource/gql/types.js +31 -33
  226. package/dist/modules/resource/grpc/index.d.ts +14 -12
  227. package/dist/modules/resource/grpc/index.js +28 -30
  228. package/dist/modules/resource/index.d.ts +2 -2
  229. package/dist/modules/resource/index.js +20 -17
  230. package/dist/modules/resource/interfaces.d.ts +3 -3
  231. package/dist/modules/resource/interfaces.js +1 -4
  232. package/dist/modules/scheduling/gql/federation.d.ts +1 -1
  233. package/dist/modules/scheduling/gql/federation.js +10 -17
  234. package/dist/modules/scheduling/gql/schema.d.ts +1 -1
  235. package/dist/modules/scheduling/gql/schema.generated.d.ts +109 -83
  236. package/dist/modules/scheduling/gql/schema.generated.js +10 -13
  237. package/dist/modules/scheduling/gql/schema.js +5 -9
  238. package/dist/modules/scheduling/gql/types.d.ts +2 -2
  239. package/dist/modules/scheduling/gql/types.js +7 -11
  240. package/dist/modules/scheduling/grpc/index.d.ts +2 -2
  241. package/dist/modules/scheduling/grpc/index.js +4 -8
  242. package/dist/modules/scheduling/index.d.ts +2 -2
  243. package/dist/modules/scheduling/index.js +20 -17
  244. package/dist/modules/scheduling/interfaces.d.ts +3 -3
  245. package/dist/modules/scheduling/interfaces.js +1 -4
  246. package/dist/utils.d.ts +3 -3
  247. package/dist/utils.js +4 -9
  248. package/generate.ts +42 -42
  249. package/jest.config.cjs +23 -0
  250. package/package.json +19 -14
  251. package/tsconfig-base.json +8 -0
  252. package/tsconfig.debug.json +5 -1
  253. package/tsconfig.test.json +17 -2
  254. package/jest.config.js +0 -14
package/generate.ts CHANGED
@@ -1,45 +1,45 @@
1
- import { generateSchemaTypings } from "./src_codegen/index";
2
- import { schema as facadeStatusSchema } from "./src/modules/facade-status/gql/schema";
1
+ import { generateSchemaTypings } from './src_codegen/index.js';
2
+ import { schema as facadeStatusSchema } from './src/modules/facade-status/gql/schema.js';
3
3
 
4
- import { schema as orderingSchema } from "./src/modules/ordering/gql/schema";
5
- import { namespace as orderingNamespace } from "./src/modules/ordering/interfaces";
4
+ import { schema as orderingSchema } from './src/modules/ordering/gql/schema.js';
5
+ import { namespace as orderingNamespace } from './src/modules/ordering/interfaces.js';
6
6
 
7
- import { schema as paymentSchema } from "./src/modules/payment/gql/schema";
8
- import { namespace as paymentNamespace } from "./src/modules/payment/interfaces";
7
+ import { schema as paymentSchema } from './src/modules/payment/gql/schema.js';
8
+ import { namespace as paymentNamespace } from './src/modules/payment/interfaces.js';
9
9
 
10
- import { schema as resourceSchema } from "./src/modules/resource/gql/schema";
11
- import { namespace as resourceNamespace } from "./src/modules/resource/interfaces";
10
+ import { schema as resourceSchema } from './src/modules/resource/gql/schema.js';
11
+ import { namespace as resourceNamespace } from './src/modules/resource/interfaces.js';
12
12
 
13
- import { schema as catalogSchema } from "./src/modules/catalog/gql/schema";
14
- import { namespace as catalogNamespace } from "./src/modules/catalog/interfaces";
13
+ import { schema as catalogSchema } from './src/modules/catalog/gql/schema.js';
14
+ import { namespace as catalogNamespace } from './src/modules/catalog/interfaces.js';
15
15
 
16
- import { schema as invoicingSchema } from "./src/modules/invoicing/gql/schema";
17
- import { namespace as invoicingNamespace } from "./src/modules/invoicing/interfaces";
16
+ import { schema as invoicingSchema } from './src/modules/invoicing/gql/schema.js';
17
+ import { namespace as invoicingNamespace } from './src/modules/invoicing/interfaces.js';
18
18
 
19
- import { schema as fulfillmentSchema } from "./src/modules/fulfillment/gql/schema";
20
- import { namespace as fulfillmentNamespace } from "./src/modules/fulfillment/interfaces";
19
+ import { schema as fulfillmentSchema } from './src/modules/fulfillment/gql/schema.js';
20
+ import { namespace as fulfillmentNamespace } from './src/modules/fulfillment/interfaces.js';
21
21
 
22
- import { schema as indexingSchema } from "./src/modules/indexing/gql/schema";
23
- import { namespace as indexingNamespace } from "./src/modules/indexing/interfaces";
22
+ import { schema as indexingSchema } from './src/modules/indexing/gql/schema.js';
23
+ import { namespace as indexingNamespace } from './src/modules/indexing/interfaces.js';
24
24
 
25
- import { schema as schedulingSchema } from "./src/modules/scheduling/gql/schema";
26
- import { namespace as schedulingNamespace } from "./src/modules/scheduling/interfaces";
25
+ import { schema as schedulingSchema } from './src/modules/scheduling/gql/schema.js';
26
+ import { namespace as schedulingNamespace } from './src/modules/scheduling/interfaces.js';
27
27
 
28
- import { schema as notificationSchema } from "./src/modules/notification/gql/schema";
29
- import { namespace as notificationNamespace } from "./src/modules/notification/interfaces";
28
+ import { schema as notificationSchema } from './src/modules/notification/gql/schema.js';
29
+ import { namespace as notificationNamespace } from './src/modules/notification/interfaces.js';
30
30
 
31
- import { schema as accessControlSchema } from "./src/modules/access-control/gql/schema";
32
- import { namespace as accessControlNamespace } from "./src/modules/access-control/interfaces";
31
+ import { schema as accessControlSchema } from './src/modules/access-control/gql/schema.js';
32
+ import { namespace as accessControlNamespace } from './src/modules/access-control/interfaces.js';
33
33
 
34
- import { schema as ostorageSchema } from "./src/modules/ostorage/gql/schema";
35
- import { namespace as ostorageNamespace } from "./src/modules/ostorage/interfaces";
34
+ import { schema as ostorageSchema } from './src/modules/ostorage/gql/schema.js';
35
+ import { namespace as ostorageNamespace } from './src/modules/ostorage/interfaces.js';
36
36
 
37
- import { schema as identitySchema } from "./src/modules/identity/gql/schema";
38
- import { namespace as identityNamespace } from "./src/modules/identity/interfaces";
37
+ import { schema as identitySchema } from './src/modules/identity/gql/schema.js';
38
+ import { namespace as identityNamespace } from './src/modules/identity/interfaces.js';
39
39
 
40
- import { createServiceConfig } from "@restorecommerce/service-config";
41
- import { join } from "path";
42
- import { setUseSubscriptions } from './src/gql/protos/utils';
40
+ import { createServiceConfig } from '@restorecommerce/service-config';
41
+ import { join } from 'node:path';
42
+ import { setUseSubscriptions } from './src/gql/protos/utils.js';
43
43
 
44
44
  // TODO Configurable
45
45
  const cfg = createServiceConfig(join(process.cwd(), 'tests'));
@@ -50,7 +50,7 @@ generateSchemaTypings({
50
50
  schema: facadeStatusSchema,
51
51
  outputFile: './src/modules/facade-status/gql/schema.generated.ts',
52
52
  typescriptResolvers: {
53
- contextType: '../interfaces#FacadeStatusContext'
53
+ contextType: '../interfaces.js#FacadeStatusContext'
54
54
  }
55
55
  });
56
56
 
@@ -58,7 +58,7 @@ generateSchemaTypings({
58
58
  schema: orderingSchema(cfg.get(orderingNamespace)),
59
59
  outputFile: './src/modules/ordering/gql/schema.generated.ts',
60
60
  typescriptResolvers: {
61
- contextType: '../interfaces#OrderingContext'
61
+ contextType: '../interfaces.js#OrderingContext'
62
62
  }
63
63
  });
64
64
 
@@ -66,7 +66,7 @@ generateSchemaTypings({
66
66
  schema: paymentSchema(cfg.get(paymentNamespace)),
67
67
  outputFile: './src/modules/payment/gql/schema.generated.ts',
68
68
  typescriptResolvers: {
69
- contextType: '../interfaces#PaymentContext'
69
+ contextType: '../interfaces.js#PaymentContext'
70
70
  }
71
71
  });
72
72
 
@@ -74,7 +74,7 @@ generateSchemaTypings({
74
74
  schema: resourceSchema(cfg.get(resourceNamespace)),
75
75
  outputFile: './src/modules/resource/gql/schema.generated.ts',
76
76
  typescriptResolvers: {
77
- contextType: '../interfaces#ResourceContext'
77
+ contextType: '../interfaces.js#ResourceContext'
78
78
  }
79
79
  });
80
80
 
@@ -82,7 +82,7 @@ generateSchemaTypings({
82
82
  schema: catalogSchema(cfg.get(catalogNamespace)),
83
83
  outputFile: './src/modules/catalog/gql/schema.generated.ts',
84
84
  typescriptResolvers: {
85
- contextType: '../interfaces#CatalogContext'
85
+ contextType: '../interfaces.js#CatalogContext'
86
86
  }
87
87
  });
88
88
 
@@ -90,7 +90,7 @@ generateSchemaTypings({
90
90
  schema: invoicingSchema(cfg.get(invoicingNamespace)),
91
91
  outputFile: './src/modules/invoicing/gql/schema.generated.ts',
92
92
  typescriptResolvers: {
93
- contextType: '../interfaces#InvoicingContext'
93
+ contextType: '../interfaces.js#InvoicingContext'
94
94
  }
95
95
  });
96
96
 
@@ -98,7 +98,7 @@ generateSchemaTypings({
98
98
  schema: fulfillmentSchema(cfg.get(fulfillmentNamespace)),
99
99
  outputFile: './src/modules/fulfillment/gql/schema.generated.ts',
100
100
  typescriptResolvers: {
101
- contextType: '../interfaces#FulfillmentContext'
101
+ contextType: '../interfaces.js#FulfillmentContext'
102
102
  }
103
103
  });
104
104
 
@@ -106,7 +106,7 @@ generateSchemaTypings({
106
106
  schema: indexingSchema(cfg.get(indexingNamespace)),
107
107
  outputFile: './src/modules/indexing/gql/schema.generated.ts',
108
108
  typescriptResolvers: {
109
- contextType: '../interfaces#IndexingContext'
109
+ contextType: '../interfaces.js#IndexingContext'
110
110
  }
111
111
  });
112
112
 
@@ -114,7 +114,7 @@ generateSchemaTypings({
114
114
  schema: schedulingSchema(cfg.get(schedulingNamespace)),
115
115
  outputFile: './src/modules/scheduling/gql/schema.generated.ts',
116
116
  typescriptResolvers: {
117
- contextType: '../interfaces#SchedulingContext'
117
+ contextType: '../interfaces.js#SchedulingContext'
118
118
  }
119
119
  });
120
120
 
@@ -122,7 +122,7 @@ generateSchemaTypings({
122
122
  schema: notificationSchema(cfg.get(notificationNamespace)),
123
123
  outputFile: './src/modules/notification/gql/schema.generated.ts',
124
124
  typescriptResolvers: {
125
- contextType: '../interfaces#NotificationContext'
125
+ contextType: '../interfaces.js#NotificationContext'
126
126
  }
127
127
  });
128
128
 
@@ -130,7 +130,7 @@ generateSchemaTypings({
130
130
  schema: accessControlSchema(cfg.get(accessControlNamespace)),
131
131
  outputFile: './src/modules/access-control/gql/schema.generated.ts',
132
132
  typescriptResolvers: {
133
- contextType: '../interfaces#AccessControlContext'
133
+ contextType: '../interfaces.js#AccessControlContext'
134
134
  }
135
135
  });
136
136
 
@@ -138,7 +138,7 @@ generateSchemaTypings({
138
138
  schema: ostorageSchema(cfg.get(ostorageNamespace)),
139
139
  outputFile: './src/modules/ostorage/gql/schema.generated.ts',
140
140
  typescriptResolvers: {
141
- contextType: '../interfaces#OstorageContext'
141
+ contextType: '../interfaces.js#OstorageContext'
142
142
  }
143
143
  });
144
144
 
@@ -146,6 +146,6 @@ generateSchemaTypings({
146
146
  schema: identitySchema(cfg.get(identityNamespace)),
147
147
  outputFile: './src/modules/identity/gql/schema.generated.ts',
148
148
  typescriptResolvers: {
149
- contextType: '../interfaces#IdentityContext'
149
+ contextType: '../interfaces.js#IdentityContext'
150
150
  }
151
151
  });
@@ -0,0 +1,23 @@
1
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
2
+ module.exports = {
3
+ preset: 'ts-jest/presets/default-esm',
4
+ resolver: 'ts-jest-resolver',
5
+ verbose: true,
6
+ testEnvironment: 'node',
7
+ collectCoverage: true,
8
+ coverageReporters: ["json", "html"],
9
+ moduleNameMapper: {
10
+ "^jose/(.*)$": "<rootDir>/node_modules/jose/dist/node/cjs/$1"
11
+ },
12
+ extensionsToTreatAsEsm: ['.ts'],
13
+ transform: {
14
+ '^.+\\.[tj]sx?$': [
15
+ 'ts-jest',
16
+ {
17
+ useESM: true,
18
+ tsconfig: 'tsconfig.test.json',
19
+ isolatedModules: true
20
+ },
21
+ ],
22
+ },
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restorecommerce/facade",
3
- "version": "1.1.6",
3
+ "version": "1.3.0",
4
4
  "description": "Facade for Restorecommerce microservices",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -15,6 +15,7 @@
15
15
  "commerce",
16
16
  "facade"
17
17
  ],
18
+ "type": "module",
18
19
  "dependencies": {
19
20
  "@apollo/federation": "^0.38.1",
20
21
  "@apollo/gateway": "^2.3.2",
@@ -25,9 +26,9 @@
25
26
  "@grpc/proto-loader": "^0.7.5",
26
27
  "@koa/cors": "^4.0.0",
27
28
  "@restorecommerce/grpc-client": "^2.0.1",
28
- "@restorecommerce/kafka-client": "^1.0.7",
29
+ "@restorecommerce/kafka-client": "^1.0.8",
29
30
  "@restorecommerce/logger": "^1.2.3",
30
- "@restorecommerce/rc-grpc-clients": "^3.0.1",
31
+ "@restorecommerce/rc-grpc-clients": "^3.1.0",
31
32
  "@restorecommerce/service-config": "^1.0.5",
32
33
  "array.prototype.flat": "^1.3.1",
33
34
  "co": "^4.6.0",
@@ -62,9 +63,9 @@
62
63
  "ws": "^8.12.1"
63
64
  },
64
65
  "devDependencies": {
65
- "@graphql-codegen/core": "^2.6.2",
66
- "@graphql-codegen/typescript": "^2.7.4",
67
- "@graphql-codegen/typescript-resolvers": "^2.7.4",
66
+ "@graphql-codegen/core": "^4.0.0",
67
+ "@graphql-codegen/typescript": "^4.0.0",
68
+ "@graphql-codegen/typescript-resolvers": "^4.0.0",
68
69
  "@types/array.prototype.flat": "^1.2.1",
69
70
  "@types/co": "^4.6.3",
70
71
  "@types/debug": "^4.1.7",
@@ -90,12 +91,14 @@
90
91
  "@types/useragent": "^2.3.1",
91
92
  "@types/uuid": "^9.0.1",
92
93
  "@types/ws": "^8.5.4",
93
- "jest": "^29.4.3",
94
+ "eslint": "^8.42.0",
95
+ "jest": "^29.5.0",
94
96
  "nodemon": "^2.0.20",
95
97
  "npm-run-all": "^4.1.5",
96
98
  "rimraf": "^4.1.2",
97
99
  "supertest": "^6.3.3",
98
- "ts-jest": "^29.0.5",
100
+ "ts-jest": "~29.1.0",
101
+ "ts-jest-resolver": "^2.0.1",
99
102
  "ts-node": "^10.9.1",
100
103
  "tsconfig-paths": "^4.1.2",
101
104
  "typescript": "^4.9.5"
@@ -108,16 +111,18 @@
108
111
  "build:codegen:compile": "tsc -p tsconfig.codegen.json",
109
112
  "dev": "npm-run-all build:clean dev:compile",
110
113
  "dev:compile": "tsc -w -p tsconfig.json",
111
- "test": "jest --runInBand --testTimeout=30000",
114
+ "pretest": "rm -rf ./node_modules/@josephg/resolvable/index.ts",
115
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand --testTimeout=30000",
112
116
  "test:watch": "jest --watch",
113
117
  "dev:serve": "TS_NODE_PROJECT=tsconfig.test.json nodemon -e ts,hbs -w ./tests -w ./src -x node --inspect=7000 -r ts-node/register tests/server.ts",
114
- "generate": "ts-node --project tsconfig.generate.json -r tsconfig-paths/register generate.ts",
118
+ "generate": "ts-node-esm --project tsconfig.generate.json -r tsconfig-paths/register generate.ts",
115
119
  "prepublishOnly": "npm run build",
116
- "debug-run": "ts-node --project tsconfig.debug.json debug-run.ts",
117
- "copyhbs": "sh copy-hbs.sh"
120
+ "debug-run": "ts-node-esm --project tsconfig.debug.json debug-run.ts",
121
+ "copyhbs": "sh copy-hbs.sh",
122
+ "lint": "eslint './**/*.ts'"
118
123
  },
119
124
  "engines": {
120
- "node": ">= 12.18.0"
125
+ "node": ">=16"
121
126
  },
122
127
  "publishConfig": {
123
128
  "access": "public"
@@ -131,5 +136,5 @@
131
136
  }
132
137
  }
133
138
  },
134
- "gitHead": "1c4ac0aaccaa55439930b96256d6db3884690cb0"
139
+ "gitHead": "18bb61bb70fbf8a8e5908edb3332ae015c7f5e54"
135
140
  }
@@ -8,6 +8,14 @@
8
8
  "allowSyntheticDefaultImports": true,
9
9
  "declaration": true,
10
10
  "strict": true,
11
+ "target": "ES6",
12
+ "module": "ESNext",
13
+ "moduleResolution": "Node16",
11
14
  "skipLibCheck": true // temp work around for kafka-client typings
15
+ },
16
+ "ts-node": {
17
+ "transpileOnly": true,
18
+ "files": true,
19
+ "experimentalResolver": true
12
20
  }
13
21
  }
@@ -7,5 +7,9 @@
7
7
  "strict": true,
8
8
  "esModuleInterop": true
9
9
  },
10
- "include": ["./src/**/*.ts", "./src/**/*.d.ts"]
10
+ "include": [
11
+ "./src/**/*.ts",
12
+ "./src/**/*.d.ts",
13
+ "./debug-run.ts"
14
+ ]
11
15
  }
@@ -8,9 +8,24 @@
8
8
  "@gql": ["src/gql/index"],
9
9
  "@gql/*": ["src/gql/*"]
10
10
  },
11
- "esModuleInterop": true
11
+ "esModuleInterop": true,
12
+ "allowJs": true,
13
+
14
+ "rootDirs": ["src"],
15
+ "outDir": "dist",
16
+ "lib": ["ES2022"],
17
+ "target": "ES2022",
18
+ "module": "ES2022",
19
+ "composite": true,
20
+ "moduleResolution": "node",
21
+ "declaration": true,
22
+ "declarationMap": true,
23
+ "incremental": true,
24
+ "types": ["jest", "node", "@types/jest"],
25
+ "sourceMap": true
12
26
  },
13
27
  "include": [
14
- "./tests/**/*.ts", "tests/generate-keysjts"
28
+ "./tests/**/*.ts",
29
+ "tests/generate-keys.js"
15
30
  ]
16
31
  }
package/jest.config.js DELETED
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- preset: 'ts-jest',
3
- testEnvironment: 'node',
4
- collectCoverage: true,
5
- coverageReporters: ["json", "html"],
6
- globals: {
7
- 'ts-jest': {
8
- tsconfig: 'tsconfig.test.json'
9
- }
10
- },
11
- moduleNameMapper: {
12
- "^jose/(.*)$": "<rootDir>/node_modules/jose/dist/node/cjs/$1"
13
- }
14
- };