@restorecommerce/facade 1.2.0 → 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.
- package/.eslintignore +3 -0
- package/.eslintrc.cjs +13 -0
- package/CHANGELOG.md +11 -0
- package/codegen/index.d.ts +1 -1
- package/codegen/index.js +18 -44
- package/debug-run.ts +7 -6
- package/dist/gql/index.d.ts +1 -1
- package/dist/gql/index.js +1 -17
- package/dist/gql/protos/federation.d.ts +3 -3
- package/dist/gql/protos/federation.js +16 -24
- package/dist/gql/protos/graphql.d.ts +4 -4
- package/dist/gql/protos/graphql.js +64 -42
- package/dist/gql/protos/index.d.ts +6 -6
- package/dist/gql/protos/index.js +6 -22
- package/dist/gql/protos/registry.d.ts +6 -6
- package/dist/gql/protos/registry.js +157 -176
- package/dist/gql/protos/resolvers.d.ts +3 -3
- package/dist/gql/protos/resolvers.js +78 -104
- package/dist/gql/protos/schema.d.ts +4 -4
- package/dist/gql/protos/schema.js +40 -53
- package/dist/gql/protos/types.d.ts +3 -3
- package/dist/gql/protos/types.js +1 -4
- package/dist/gql/protos/utils.d.ts +3 -3
- package/dist/gql/protos/utils.js +23 -62
- package/dist/gql/types/AccessControlTypes.js +13 -16
- package/dist/gql/types/DateType.js +4 -7
- package/dist/gql/types/FilterType.js +7 -10
- package/dist/gql/types/MetaType.js +8 -11
- package/dist/gql/types/ScopeType.js +4 -7
- package/dist/gql/types/SortType.js +5 -8
- package/dist/gql/types/StatusType.js +4 -7
- package/dist/gql/types/index.d.ts +7 -7
- package/dist/gql/types/index.js +7 -23
- package/dist/index.d.ts +14 -14
- package/dist/index.js +195 -207
- package/dist/interfaces.d.ts +8 -8
- package/dist/interfaces.js +1 -2
- package/dist/middlewares/index.d.ts +1 -1
- package/dist/middlewares/index.js +1 -17
- package/dist/middlewares/req-res-logger/index.d.ts +2 -2
- package/dist/middlewares/req-res-logger/index.js +33 -31
- package/dist/modules/access-control/gql/federation.d.ts +1 -1
- package/dist/modules/access-control/gql/federation.js +10 -17
- package/dist/modules/access-control/gql/schema.d.ts +1 -1
- package/dist/modules/access-control/gql/schema.generated.d.ts +136 -110
- package/dist/modules/access-control/gql/schema.generated.js +22 -25
- package/dist/modules/access-control/gql/schema.js +5 -9
- package/dist/modules/access-control/gql/types.d.ts +2 -2
- package/dist/modules/access-control/gql/types.js +13 -17
- package/dist/modules/access-control/grpc/index.d.ts +5 -5
- package/dist/modules/access-control/grpc/index.js +10 -14
- package/dist/modules/access-control/index.d.ts +2 -2
- package/dist/modules/access-control/index.js +20 -17
- package/dist/modules/access-control/interfaces.d.ts +3 -3
- package/dist/modules/access-control/interfaces.js +1 -4
- package/dist/modules/catalog/gql/federation.d.ts +1 -1
- package/dist/modules/catalog/gql/federation.js +10 -17
- package/dist/modules/catalog/gql/schema.d.ts +1 -1
- package/dist/modules/catalog/gql/schema.generated.d.ts +252 -226
- package/dist/modules/catalog/gql/schema.generated.js +20 -23
- package/dist/modules/catalog/gql/schema.js +5 -9
- package/dist/modules/catalog/gql/types.d.ts +2 -2
- package/dist/modules/catalog/gql/types.js +15 -19
- package/dist/modules/catalog/grpc/index.d.ts +6 -6
- package/dist/modules/catalog/grpc/index.js +12 -16
- package/dist/modules/catalog/index.d.ts +2 -2
- package/dist/modules/catalog/index.js +20 -17
- package/dist/modules/catalog/interfaces.d.ts +3 -3
- package/dist/modules/catalog/interfaces.js +1 -4
- package/dist/modules/facade-status/gql/index.js +8 -14
- package/dist/modules/facade-status/gql/resolvers.d.ts +1 -1
- package/dist/modules/facade-status/gql/resolvers.js +14 -8
- package/dist/modules/facade-status/gql/schema.d.ts +1 -1
- package/dist/modules/facade-status/gql/schema.generated.d.ts +34 -11
- package/dist/modules/facade-status/gql/schema.generated.js +1 -2
- package/dist/modules/facade-status/gql/schema.js +6 -9
- package/dist/modules/facade-status/gql/types.js +3 -6
- package/dist/modules/facade-status/index.d.ts +1 -1
- package/dist/modules/facade-status/index.js +4 -7
- package/dist/modules/facade-status/interfaces.d.ts +1 -1
- package/dist/modules/facade-status/interfaces.js +1 -2
- package/dist/modules/fulfillment/gql/federation.d.ts +1 -1
- package/dist/modules/fulfillment/gql/federation.js +10 -17
- package/dist/modules/fulfillment/gql/schema.d.ts +1 -1
- package/dist/modules/fulfillment/gql/schema.generated.d.ts +249 -223
- package/dist/modules/fulfillment/gql/schema.generated.js +20 -23
- package/dist/modules/fulfillment/gql/schema.js +5 -9
- package/dist/modules/fulfillment/gql/types.d.ts +2 -2
- package/dist/modules/fulfillment/gql/types.js +11 -15
- package/dist/modules/fulfillment/grpc/index.d.ts +3 -3
- package/dist/modules/fulfillment/grpc/index.js +6 -10
- package/dist/modules/fulfillment/index.d.ts +2 -2
- package/dist/modules/fulfillment/index.js +20 -17
- package/dist/modules/fulfillment/interfaces.d.ts +3 -3
- package/dist/modules/fulfillment/interfaces.js +1 -4
- package/dist/modules/identity/api-key/api-key.d.ts +2 -2
- package/dist/modules/identity/api-key/api-key.js +45 -65
- package/dist/modules/identity/gql/federation.d.ts +2 -2
- package/dist/modules/identity/gql/federation.js +5 -9
- package/dist/modules/identity/gql/schema.d.ts +1 -1
- package/dist/modules/identity/gql/schema.generated.d.ts +284 -255
- package/dist/modules/identity/gql/schema.generated.js +20 -23
- package/dist/modules/identity/gql/schema.js +5 -9
- package/dist/modules/identity/gql/types.d.ts +2 -2
- package/dist/modules/identity/gql/types.js +17 -21
- package/dist/modules/identity/grpc/index.d.ts +6 -6
- package/dist/modules/identity/grpc/index.js +12 -16
- package/dist/modules/identity/index.d.ts +4 -4
- package/dist/modules/identity/index.js +24 -21
- package/dist/modules/identity/interfaces.d.ts +5 -5
- package/dist/modules/identity/interfaces.js +1 -4
- package/dist/modules/identity/oauth/oauth.d.ts +4 -4
- package/dist/modules/identity/oauth/oauth.js +109 -135
- package/dist/modules/identity/oidc/adapter.d.ts +3 -3
- package/dist/modules/identity/oidc/adapter.js +111 -92
- package/dist/modules/identity/oidc/in-memory-adapter.d.ts +1 -1
- package/dist/modules/identity/oidc/in-memory-adapter.js +64 -50
- package/dist/modules/identity/oidc/index.d.ts +6 -6
- package/dist/modules/identity/oidc/index.js +29 -30
- package/dist/modules/identity/oidc/interfaces.d.ts +6 -6
- package/dist/modules/identity/oidc/interfaces.js +2 -6
- package/dist/modules/identity/oidc/password-grant.d.ts +1 -1
- package/dist/modules/identity/oidc/password-grant.js +43 -66
- package/dist/modules/identity/oidc/router.d.ts +6 -6
- package/dist/modules/identity/oidc/router.js +31 -26
- package/dist/modules/identity/oidc/templates.d.ts +1 -1
- package/dist/modules/identity/oidc/templates.js +45 -41
- package/dist/modules/identity/oidc/user.d.ts +4 -4
- package/dist/modules/identity/oidc/user.js +31 -29
- package/dist/modules/identity/oidc/utils.d.ts +2 -2
- package/dist/modules/identity/oidc/utils.js +6 -13
- package/dist/modules/index.d.ts +13 -13
- package/dist/modules/index.js +13 -29
- package/dist/modules/indexing/gql/federation.d.ts +1 -1
- package/dist/modules/indexing/gql/federation.js +10 -17
- package/dist/modules/indexing/gql/schema.d.ts +1 -1
- package/dist/modules/indexing/gql/schema.generated.d.ts +45 -19
- package/dist/modules/indexing/gql/schema.generated.js +2 -5
- package/dist/modules/indexing/gql/schema.js +5 -9
- package/dist/modules/indexing/gql/types.d.ts +2 -2
- package/dist/modules/indexing/gql/types.js +7 -11
- package/dist/modules/indexing/grpc/index.d.ts +2 -2
- package/dist/modules/indexing/grpc/index.js +4 -8
- package/dist/modules/indexing/index.d.ts +2 -2
- package/dist/modules/indexing/index.js +20 -17
- package/dist/modules/indexing/interfaces.d.ts +3 -3
- package/dist/modules/indexing/interfaces.js +1 -4
- package/dist/modules/invoicing/gql/federation.d.ts +1 -1
- package/dist/modules/invoicing/gql/federation.js +10 -17
- package/dist/modules/invoicing/gql/schema.d.ts +1 -1
- package/dist/modules/invoicing/gql/schema.generated.d.ts +209 -183
- package/dist/modules/invoicing/gql/schema.generated.js +20 -23
- package/dist/modules/invoicing/gql/schema.js +5 -9
- package/dist/modules/invoicing/gql/types.d.ts +2 -2
- package/dist/modules/invoicing/gql/types.js +7 -11
- package/dist/modules/invoicing/grpc/index.d.ts +2 -2
- package/dist/modules/invoicing/grpc/index.js +4 -8
- package/dist/modules/invoicing/index.d.ts +2 -2
- package/dist/modules/invoicing/index.js +20 -17
- package/dist/modules/invoicing/interfaces.d.ts +3 -3
- package/dist/modules/invoicing/interfaces.js +1 -4
- package/dist/modules/notification/gql/federation.d.ts +1 -1
- package/dist/modules/notification/gql/federation.js +10 -17
- package/dist/modules/notification/gql/schema.d.ts +1 -1
- package/dist/modules/notification/gql/schema.generated.d.ts +100 -74
- package/dist/modules/notification/gql/schema.generated.js +18 -21
- package/dist/modules/notification/gql/schema.js +5 -9
- package/dist/modules/notification/gql/types.d.ts +2 -2
- package/dist/modules/notification/gql/types.js +7 -11
- package/dist/modules/notification/grpc/index.d.ts +2 -2
- package/dist/modules/notification/grpc/index.js +4 -8
- package/dist/modules/notification/index.d.ts +2 -2
- package/dist/modules/notification/index.js +20 -17
- package/dist/modules/notification/interfaces.d.ts +3 -3
- package/dist/modules/notification/interfaces.js +1 -4
- package/dist/modules/ordering/gql/federation.d.ts +1 -1
- package/dist/modules/ordering/gql/federation.js +10 -17
- package/dist/modules/ordering/gql/schema.d.ts +1 -1
- package/dist/modules/ordering/gql/schema.generated.d.ts +221 -195
- package/dist/modules/ordering/gql/schema.generated.js +22 -25
- package/dist/modules/ordering/gql/schema.js +5 -9
- package/dist/modules/ordering/gql/types.d.ts +2 -2
- package/dist/modules/ordering/gql/types.js +7 -11
- package/dist/modules/ordering/grpc/index.d.ts +2 -2
- package/dist/modules/ordering/grpc/index.js +4 -8
- package/dist/modules/ordering/index.d.ts +2 -2
- package/dist/modules/ordering/index.js +20 -17
- package/dist/modules/ordering/interfaces.d.ts +3 -3
- package/dist/modules/ordering/interfaces.js +1 -4
- package/dist/modules/ostorage/gql/federation.d.ts +1 -1
- package/dist/modules/ostorage/gql/federation.js +10 -17
- package/dist/modules/ostorage/gql/schema.d.ts +1 -1
- package/dist/modules/ostorage/gql/schema.generated.d.ts +126 -94
- package/dist/modules/ostorage/gql/schema.generated.js +8 -11
- package/dist/modules/ostorage/gql/schema.js +5 -9
- package/dist/modules/ostorage/gql/types.d.ts +2 -2
- package/dist/modules/ostorage/gql/types.js +7 -11
- package/dist/modules/ostorage/grpc/index.d.ts +2 -2
- package/dist/modules/ostorage/grpc/index.js +4 -8
- package/dist/modules/ostorage/index.d.ts +2 -2
- package/dist/modules/ostorage/index.js +20 -17
- package/dist/modules/ostorage/interfaces.d.ts +3 -3
- package/dist/modules/ostorage/interfaces.js +1 -4
- package/dist/modules/payment/gql/federation.d.ts +1 -1
- package/dist/modules/payment/gql/federation.js +10 -17
- package/dist/modules/payment/gql/schema.d.ts +1 -1
- package/dist/modules/payment/gql/schema.generated.d.ts +67 -44
- package/dist/modules/payment/gql/schema.generated.js +4 -7
- package/dist/modules/payment/gql/schema.js +5 -9
- package/dist/modules/payment/gql/types.d.ts +2 -2
- package/dist/modules/payment/gql/types.js +7 -11
- package/dist/modules/payment/grpc/index.d.ts +2 -2
- package/dist/modules/payment/grpc/index.js +4 -8
- package/dist/modules/payment/index.d.ts +2 -2
- package/dist/modules/payment/index.js +20 -17
- package/dist/modules/payment/interfaces.d.ts +3 -3
- package/dist/modules/payment/interfaces.js +1 -4
- package/dist/modules/resource/gql/federation.d.ts +1 -1
- package/dist/modules/resource/gql/federation.js +10 -17
- package/dist/modules/resource/gql/schema.d.ts +1 -1
- package/dist/modules/resource/gql/schema.generated.d.ts +348 -322
- package/dist/modules/resource/gql/schema.generated.js +28 -31
- package/dist/modules/resource/gql/schema.js +5 -9
- package/dist/modules/resource/gql/types.d.ts +2 -2
- package/dist/modules/resource/gql/types.js +31 -35
- package/dist/modules/resource/grpc/index.d.ts +13 -13
- package/dist/modules/resource/grpc/index.js +28 -32
- package/dist/modules/resource/index.d.ts +2 -2
- package/dist/modules/resource/index.js +20 -17
- package/dist/modules/resource/interfaces.d.ts +3 -3
- package/dist/modules/resource/interfaces.js +1 -4
- package/dist/modules/scheduling/gql/federation.d.ts +1 -1
- package/dist/modules/scheduling/gql/federation.js +10 -17
- package/dist/modules/scheduling/gql/schema.d.ts +1 -1
- package/dist/modules/scheduling/gql/schema.generated.d.ts +109 -83
- package/dist/modules/scheduling/gql/schema.generated.js +10 -13
- package/dist/modules/scheduling/gql/schema.js +5 -9
- package/dist/modules/scheduling/gql/types.d.ts +2 -2
- package/dist/modules/scheduling/gql/types.js +7 -11
- package/dist/modules/scheduling/grpc/index.d.ts +2 -2
- package/dist/modules/scheduling/grpc/index.js +4 -8
- package/dist/modules/scheduling/index.d.ts +2 -2
- package/dist/modules/scheduling/index.js +20 -17
- package/dist/modules/scheduling/interfaces.d.ts +3 -3
- package/dist/modules/scheduling/interfaces.js +1 -4
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +4 -9
- package/generate.ts +42 -42
- package/jest.config.cjs +23 -0
- package/package.json +17 -12
- package/tsconfig-base.json +8 -0
- package/tsconfig.debug.json +5 -1
- package/tsconfig.test.json +17 -2
- package/jest.config.js +0 -14
package/generate.ts
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
import { generateSchemaTypings } from
|
2
|
-
import { schema as facadeStatusSchema } from
|
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
|
5
|
-
import { namespace as orderingNamespace } from
|
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
|
8
|
-
import { namespace as paymentNamespace } from
|
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
|
11
|
-
import { namespace as resourceNamespace } from
|
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
|
14
|
-
import { namespace as catalogNamespace } from
|
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
|
17
|
-
import { namespace as invoicingNamespace } from
|
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
|
20
|
-
import { namespace as fulfillmentNamespace } from
|
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
|
23
|
-
import { namespace as indexingNamespace } from
|
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
|
26
|
-
import { namespace as schedulingNamespace } from
|
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
|
29
|
-
import { namespace as notificationNamespace } from
|
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
|
32
|
-
import { namespace as accessControlNamespace } from
|
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
|
35
|
-
import { namespace as ostorageNamespace } from
|
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
|
38
|
-
import { namespace as identityNamespace } from
|
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
|
41
|
-
import { join } from
|
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
|
});
|
package/jest.config.cjs
ADDED
@@ -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.
|
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",
|
@@ -62,9 +63,9 @@
|
|
62
63
|
"ws": "^8.12.1"
|
63
64
|
},
|
64
65
|
"devDependencies": {
|
65
|
-
"@graphql-codegen/core": "^
|
66
|
-
"@graphql-codegen/typescript": "^
|
67
|
-
"@graphql-codegen/typescript-resolvers": "^
|
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
|
-
"
|
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": "
|
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
|
-
"
|
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": ">=
|
125
|
+
"node": ">=16"
|
121
126
|
},
|
122
127
|
"publishConfig": {
|
123
128
|
"access": "public"
|
@@ -131,5 +136,5 @@
|
|
131
136
|
}
|
132
137
|
}
|
133
138
|
},
|
134
|
-
"gitHead": "
|
139
|
+
"gitHead": "18bb61bb70fbf8a8e5908edb3332ae015c7f5e54"
|
135
140
|
}
|
package/tsconfig-base.json
CHANGED
@@ -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
|
}
|
package/tsconfig.debug.json
CHANGED
package/tsconfig.test.json
CHANGED
@@ -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",
|
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
|
-
};
|