@restorecommerce/facade 1.3.4 → 1.3.6
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/CHANGELOG.md +16 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +10 -5
- package/dist/interfaces.d.ts +7 -0
- package/dist/interfaces.js +2 -0
- package/dist/modules/index.d.ts +1 -1
- package/dist/modules/index.js +1 -1
- package/dist/modules/{resource → master_data}/gql/schema.generated.d.ts +4 -4
- package/dist/modules/{resource → master_data}/interfaces.d.ts +1 -1
- package/dist/modules/master_data/interfaces.js +1 -0
- package/generate.ts +3 -3
- package/package.json +4 -4
- package/dist/modules/resource/interfaces.js +0 -1
- /package/dist/modules/{resource → master_data}/gql/federation.d.ts +0 -0
- /package/dist/modules/{resource → master_data}/gql/federation.js +0 -0
- /package/dist/modules/{resource → master_data}/gql/schema.d.ts +0 -0
- /package/dist/modules/{resource → master_data}/gql/schema.generated.js +0 -0
- /package/dist/modules/{resource → master_data}/gql/schema.js +0 -0
- /package/dist/modules/{resource → master_data}/gql/types.d.ts +0 -0
- /package/dist/modules/{resource → master_data}/gql/types.js +0 -0
- /package/dist/modules/{resource → master_data}/grpc/index.d.ts +0 -0
- /package/dist/modules/{resource → master_data}/grpc/index.js +0 -0
- /package/dist/modules/{resource → master_data}/index.d.ts +0 -0
- /package/dist/modules/{resource → master_data}/index.js +0 -0
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,22 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.3.6](https://github.com/restorecommerce/libs/compare/@restorecommerce/facade@1.3.5...@restorecommerce/facade@1.3.6) (2023-06-16)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @restorecommerce/facade
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## [1.3.5](https://github.com/restorecommerce/libs/compare/@restorecommerce/facade@1.3.4...@restorecommerce/facade@1.3.5) (2023-06-16)
|
15
|
+
|
16
|
+
**Note:** Version bump only for package @restorecommerce/facade
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
6
22
|
## [1.3.4](https://github.com/restorecommerce/libs/compare/@restorecommerce/facade@1.3.3...@restorecommerce/facade@1.3.4) (2023-06-16)
|
7
23
|
|
8
24
|
|
package/dist/index.d.ts
CHANGED
@@ -4,7 +4,7 @@ import { type Logger } from 'winston';
|
|
4
4
|
import { type Server, ServerResponse } from 'node:http';
|
5
5
|
import Koa from 'koa';
|
6
6
|
import { type AddressInfo } from 'node:net';
|
7
|
-
import { type Facade, type FacadeBaseContext, type FacadeModule, type FacadeModuleBase, type FacadeModulesContext } from './interfaces.js';
|
7
|
+
import { type Facade, type FacadeBaseContext, type FacadeModule, type FacadeModuleBase, type FacadeModulesContext, FileUploadOptionsConfig } from './interfaces.js';
|
8
8
|
import { type KafkaProviderConfig } from '@restorecommerce/kafka-client';
|
9
9
|
export * from './modules/index.js';
|
10
10
|
export * from './middlewares/index.js';
|
@@ -18,6 +18,7 @@ interface RestoreCommerceFacadeImplConfig {
|
|
18
18
|
hostname?: string;
|
19
19
|
env?: string;
|
20
20
|
kafka?: KafkaProviderConfig['kafka'];
|
21
|
+
fileUploadOptions?: FileUploadOptionsConfig['fileUploadOptions'];
|
21
22
|
}
|
22
23
|
export declare class RestoreCommerceFacade<TModules extends FacadeModuleBase[] = []> implements Facade<TModules> {
|
23
24
|
private apolloServices;
|
@@ -31,9 +32,10 @@ export declare class RestoreCommerceFacade<TModules extends FacadeModuleBase[] =
|
|
31
32
|
readonly env: string;
|
32
33
|
readonly modules: FacadeModule[];
|
33
34
|
readonly kafkaConfig?: KafkaProviderConfig['kafka'];
|
35
|
+
readonly fileUploadOptionsConfig?: FileUploadOptionsConfig['fileUploadOptions'];
|
34
36
|
private startFns;
|
35
37
|
private stopFns;
|
36
|
-
constructor({ koa, logger, port, hostname, env, kafka }: RestoreCommerceFacadeImplConfig);
|
38
|
+
constructor({ koa, logger, port, hostname, env, kafka, fileUploadOptions }: RestoreCommerceFacadeImplConfig);
|
37
39
|
get server(): Server<typeof import("http").IncomingMessage, typeof ServerResponse> | undefined;
|
38
40
|
get address(): AddressInfo | undefined;
|
39
41
|
get listening(): boolean;
|
@@ -59,5 +61,6 @@ export interface FacadeConfig {
|
|
59
61
|
env?: string;
|
60
62
|
keys?: string[];
|
61
63
|
kafka?: KafkaProviderConfig['kafka'];
|
64
|
+
fileUploadOptions?: FileUploadOptionsConfig['fileUploadOptions'];
|
62
65
|
}
|
63
66
|
export declare const createFacade: (config: FacadeConfig) => Facade;
|
package/dist/index.js
CHANGED
@@ -38,7 +38,7 @@ export * from './interfaces.js';
|
|
38
38
|
export * from './utils.js';
|
39
39
|
export * from './gql/index.js';
|
40
40
|
export class RestoreCommerceFacade {
|
41
|
-
constructor({ koa, logger, port, hostname, env, kafka }) {
|
41
|
+
constructor({ koa, logger, port, hostname, env, kafka, fileUploadOptions }) {
|
42
42
|
this.apolloServices = {};
|
43
43
|
this.allResolvers = {};
|
44
44
|
this._initialized = false;
|
@@ -51,6 +51,7 @@ export class RestoreCommerceFacade {
|
|
51
51
|
this.koa = koa;
|
52
52
|
this.env = env !== null && env !== void 0 ? env : 'development';
|
53
53
|
this.kafkaConfig = kafka;
|
54
|
+
this.fileUploadOptionsConfig = fileUploadOptions;
|
54
55
|
setUseSubscriptions(!!kafka);
|
55
56
|
}
|
56
57
|
get server() {
|
@@ -163,6 +164,7 @@ export class RestoreCommerceFacade {
|
|
163
164
|
});
|
164
165
|
}
|
165
166
|
mountApolloServer() {
|
167
|
+
var _a, _b;
|
166
168
|
return __awaiter(this, void 0, void 0, function* () {
|
167
169
|
const serviceList = Object.keys(this.apolloServices).map(key => {
|
168
170
|
var _a;
|
@@ -265,10 +267,12 @@ export class RestoreCommerceFacade {
|
|
265
267
|
},
|
266
268
|
});
|
267
269
|
yield gqlServer.start();
|
268
|
-
//
|
270
|
+
// set maxFile size and maximum files via Facade config of `createFacade`
|
271
|
+
const maxFileSize = ((_a = this.fileUploadOptionsConfig) === null || _a === void 0 ? void 0 : _a.maxFileSize) ? this.fileUploadOptionsConfig.maxFileSize : 10000000;
|
272
|
+
const maxFiles = ((_b = this.fileUploadOptionsConfig) === null || _b === void 0 ? void 0 : _b.maxFiles) ? this.fileUploadOptionsConfig.maxFiles : 20;
|
269
273
|
this.koa.use(graphqlUploadKoa({
|
270
|
-
maxFileSize
|
271
|
-
maxFiles
|
274
|
+
maxFileSize,
|
275
|
+
maxFiles
|
272
276
|
}));
|
273
277
|
this.koa.use(cors());
|
274
278
|
this.koa.use(bodyParser());
|
@@ -302,6 +306,7 @@ export const createFacade = (config) => {
|
|
302
306
|
port: config.port,
|
303
307
|
hostname: config.hostname,
|
304
308
|
env: config.env,
|
305
|
-
kafka: config.kafka
|
309
|
+
kafka: config.kafka,
|
310
|
+
fileUploadOptions: config.fileUploadOptions,
|
306
311
|
}).useModule(facadeStatusModule);
|
307
312
|
};
|
package/dist/interfaces.d.ts
CHANGED
@@ -44,4 +44,11 @@ export interface Facade<TModules extends FacadeModuleBase[] = []> {
|
|
44
44
|
useModule<TNewModule extends FacadeModule>(mod: TNewModule): Facade<[...TModules, TNewModule]>;
|
45
45
|
supportsModule<TSupportedModule extends FacadeModuleBase>(mod: TSupportedModule): this is Facade<[TSupportedModule, ...TModules]> & Facade<[...TModules]>;
|
46
46
|
}
|
47
|
+
export interface FileUploadOptionsConfig {
|
48
|
+
fileUploadOptions: FileUploadOptions;
|
49
|
+
}
|
50
|
+
interface FileUploadOptions {
|
51
|
+
maxFileSize: number;
|
52
|
+
maxFiles: number;
|
53
|
+
}
|
47
54
|
export {};
|
package/dist/modules/index.d.ts
CHANGED
@@ -2,7 +2,7 @@ export * from './facade-status/index.js';
|
|
2
2
|
export * from './identity/index.js';
|
3
3
|
export * from './ordering/index.js';
|
4
4
|
export * from './payment/index.js';
|
5
|
-
export * from './
|
5
|
+
export * from './master_data/index.js';
|
6
6
|
export * from './catalog/index.js';
|
7
7
|
export * from './invoicing/index.js';
|
8
8
|
export * from './fulfillment/index.js';
|
package/dist/modules/index.js
CHANGED
@@ -2,7 +2,7 @@ export * from './facade-status/index.js';
|
|
2
2
|
export * from './identity/index.js';
|
3
3
|
export * from './ordering/index.js';
|
4
4
|
export * from './payment/index.js';
|
5
|
-
export * from './
|
5
|
+
export * from './master_data/index.js';
|
6
6
|
export * from './catalog/index.js';
|
7
7
|
export * from './invoicing/index.js';
|
8
8
|
export * from './fulfillment/index.js';
|
@@ -53,7 +53,7 @@ export type Scalars = {
|
|
53
53
|
};
|
54
54
|
export type Query = {
|
55
55
|
__typename?: 'Query';
|
56
|
-
|
56
|
+
master_data: ResourceQuery;
|
57
57
|
};
|
58
58
|
export type ResourceQuery = {
|
59
59
|
__typename?: 'ResourceQuery';
|
@@ -803,7 +803,7 @@ export declare enum IoRestorecommerceCodeSector {
|
|
803
803
|
}
|
804
804
|
export type Mutation = {
|
805
805
|
__typename?: 'Mutation';
|
806
|
-
|
806
|
+
master_data: ResourceMutation;
|
807
807
|
};
|
808
808
|
export type ResourceMutation = {
|
809
809
|
__typename?: 'ResourceMutation';
|
@@ -1638,7 +1638,7 @@ export type ResolversParentTypes = ResolversObject<{
|
|
1638
1638
|
SubscriptionOutput: SubscriptionOutput;
|
1639
1639
|
}>;
|
1640
1640
|
export type QueryResolvers<ContextType = ResourceContext, ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']> = ResolversObject<{
|
1641
|
-
|
1641
|
+
master_data?: Resolver<ResolversTypes['ResourceQuery'], ParentType, ContextType>;
|
1642
1642
|
}>;
|
1643
1643
|
export type ResourceQueryResolvers<ContextType = ResourceContext, ParentType extends ResolversParentTypes['ResourceQuery'] = ResolversParentTypes['ResourceQuery']> = ResolversObject<{
|
1644
1644
|
address?: Resolver<ResolversTypes['ResourceAddressQuery'], ParentType, ContextType>;
|
@@ -2299,7 +2299,7 @@ export type IoRestorecommerceCodeSectorResolvers = {
|
|
2299
2299
|
SPACE_AND_TIME: 13;
|
2300
2300
|
};
|
2301
2301
|
export type MutationResolvers<ContextType = ResourceContext, ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']> = ResolversObject<{
|
2302
|
-
|
2302
|
+
master_data?: Resolver<ResolversTypes['ResourceMutation'], ParentType, ContextType>;
|
2303
2303
|
}>;
|
2304
2304
|
export type ResourceMutationResolvers<ContextType = ResourceContext, ParentType extends ResolversParentTypes['ResourceMutation'] = ResolversParentTypes['ResourceMutation']> = ResolversObject<{
|
2305
2305
|
address?: Resolver<ResolversTypes['ResourceAddressMutation'], ParentType, ContextType>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export const namespace = 'master_data';
|
package/generate.ts
CHANGED
@@ -7,8 +7,8 @@ import { namespace as orderingNamespace } from './src/modules/ordering/interface
|
|
7
7
|
import { schema as paymentSchema } from './src/modules/payment/gql/schema.js';
|
8
8
|
import { namespace as paymentNamespace } from './src/modules/payment/interfaces.js';
|
9
9
|
|
10
|
-
import { schema as resourceSchema } from './src/modules/
|
11
|
-
import { namespace as resourceNamespace } from './src/modules/
|
10
|
+
import { schema as resourceSchema } from './src/modules/master_data/gql/schema.js';
|
11
|
+
import { namespace as resourceNamespace } from './src/modules/master_data/interfaces.js';
|
12
12
|
|
13
13
|
import { schema as catalogSchema } from './src/modules/catalog/gql/schema.js';
|
14
14
|
import { namespace as catalogNamespace } from './src/modules/catalog/interfaces.js';
|
@@ -72,7 +72,7 @@ generateSchemaTypings({
|
|
72
72
|
|
73
73
|
generateSchemaTypings({
|
74
74
|
schema: resourceSchema(cfg.get(resourceNamespace)),
|
75
|
-
outputFile: './src/modules/
|
75
|
+
outputFile: './src/modules/master_data/gql/schema.generated.ts',
|
76
76
|
typescriptResolvers: {
|
77
77
|
contextType: '../interfaces.js#ResourceContext'
|
78
78
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@restorecommerce/facade",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.6",
|
4
4
|
"description": "Facade for Restorecommerce microservices",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"typings": "dist/index.d.ts",
|
@@ -26,9 +26,9 @@
|
|
26
26
|
"@grpc/proto-loader": "^0.7.7",
|
27
27
|
"@koa/cors": "^4.0.0",
|
28
28
|
"@restorecommerce/grpc-client": "^2.0.1",
|
29
|
-
"@restorecommerce/kafka-client": "^1.0.
|
29
|
+
"@restorecommerce/kafka-client": "^1.0.10",
|
30
30
|
"@restorecommerce/logger": "^1.2.3",
|
31
|
-
"@restorecommerce/rc-grpc-clients": "^3.1.
|
31
|
+
"@restorecommerce/rc-grpc-clients": "^3.1.2",
|
32
32
|
"@restorecommerce/service-config": "^1.0.5",
|
33
33
|
"array.prototype.flat": "^1.3.1",
|
34
34
|
"co": "^4.6.0",
|
@@ -136,5 +136,5 @@
|
|
136
136
|
}
|
137
137
|
}
|
138
138
|
},
|
139
|
-
"gitHead": "
|
139
|
+
"gitHead": "9ba83dbe3c8e4b790b0a98cce14f1daa004a13a9"
|
140
140
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export const namespace = 'resource';
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|