@restorecommerce/facade 0.3.0 → 0.3.3
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 +27 -0
- package/codegen/index.js +1 -1
- package/dist/gql/helpers/schema.d.ts +2 -6
- package/dist/gql/index.js +5 -1
- package/dist/gql/protos/graphql.d.ts +5 -7
- package/dist/gql/protos/graphql.js +43 -44
- package/dist/gql/protos/index.js +5 -1
- package/dist/gql/protos/protos.d.ts +1 -1
- package/dist/gql/protos/protos.js +4 -4
- package/dist/gql/protos/registry.d.ts +1 -1
- package/dist/gql/protos/registry.js +31 -31
- package/dist/gql/protos/types.d.ts +1 -1
- package/dist/gql/protos/utils.js +5 -5
- package/dist/gql/types/AccessControlTypes.js +2 -2
- package/dist/gql/types/DateType.d.ts +1 -1
- package/dist/gql/types/index.js +5 -1
- package/dist/index.js +13 -6
- package/dist/middlewares/index.js +5 -1
- package/dist/middlewares/req-res-logger/index.js +2 -2
- package/dist/modules/access-control/gql/federation.js +4 -3
- package/dist/modules/access-control/gql/schema.generated.d.ts +91 -94
- package/dist/modules/access-control/gql/schema.js +2 -2
- package/dist/modules/access-control/gql/types.js +1 -1
- package/dist/modules/access-control/grpc/index.js +4 -4
- package/dist/modules/access-control/index.js +2 -2
- package/dist/modules/catalog/gql/federation.js +4 -3
- package/dist/modules/catalog/gql/schema.generated.d.ts +127 -130
- package/dist/modules/catalog/gql/schema.js +2 -2
- package/dist/modules/catalog/gql/types.js +1 -1
- package/dist/modules/catalog/grpc/index.js +5 -5
- package/dist/modules/catalog/index.js +2 -2
- package/dist/modules/facade-status/gql/index.js +2 -2
- package/dist/modules/facade-status/gql/schema.generated.d.ts +6 -7
- package/dist/modules/facade-status/gql/types.js +1 -1
- package/dist/modules/facade-status/index.js +1 -1
- package/dist/modules/fulfillment/gql/federation.js +4 -3
- package/dist/modules/fulfillment/gql/schema.generated.d.ts +120 -123
- package/dist/modules/fulfillment/gql/schema.js +2 -2
- package/dist/modules/fulfillment/gql/types.js +1 -1
- package/dist/modules/fulfillment/grpc/index.js +2 -2
- package/dist/modules/fulfillment/index.js +2 -2
- package/dist/modules/identity/api-key/api-key.js +1 -1
- package/dist/modules/identity/gql/federation.js +4 -3
- package/dist/modules/identity/gql/schema.generated.d.ts +169 -172
- package/dist/modules/identity/gql/schema.js +2 -2
- package/dist/modules/identity/gql/types.js +1 -1
- package/dist/modules/identity/grpc/index.js +5 -5
- package/dist/modules/identity/index.js +5 -5
- package/dist/modules/identity/oauth/oauth.js +13 -14
- package/dist/modules/identity/oidc/adapter.js +2 -2
- package/dist/modules/identity/oidc/in-memory-adapter.js +10 -6
- package/dist/modules/identity/oidc/index.js +6 -6
- package/dist/modules/identity/oidc/password-grant.js +4 -4
- package/dist/modules/identity/oidc/user.js +2 -2
- package/dist/modules/identity/oidc/utils.js +1 -1
- package/dist/modules/index.js +5 -1
- package/dist/modules/indexing/gql/federation.js +4 -3
- package/dist/modules/indexing/gql/schema.generated.d.ts +10 -13
- package/dist/modules/indexing/gql/schema.js +2 -2
- package/dist/modules/indexing/gql/types.js +1 -1
- package/dist/modules/indexing/grpc/index.js +1 -1
- package/dist/modules/indexing/index.js +2 -2
- package/dist/modules/invoicing/gql/federation.js +4 -3
- package/dist/modules/invoicing/gql/schema.generated.d.ts +61 -64
- package/dist/modules/invoicing/gql/schema.js +2 -2
- package/dist/modules/invoicing/gql/types.js +1 -1
- package/dist/modules/invoicing/grpc/index.js +1 -1
- package/dist/modules/invoicing/index.js +2 -2
- package/dist/modules/notification/gql/federation.js +4 -3
- package/dist/modules/notification/gql/schema.generated.d.ts +59 -62
- package/dist/modules/notification/gql/schema.js +2 -2
- package/dist/modules/notification/gql/types.js +1 -1
- package/dist/modules/notification/grpc/index.js +1 -1
- package/dist/modules/notification/index.js +2 -2
- package/dist/modules/ordering/gql/federation.js +4 -3
- package/dist/modules/ordering/gql/schema.generated.d.ts +92 -95
- package/dist/modules/ordering/gql/schema.js +2 -2
- package/dist/modules/ordering/gql/types.js +1 -1
- package/dist/modules/ordering/grpc/index.js +1 -1
- package/dist/modules/ordering/index.js +2 -2
- package/dist/modules/ostorage/gql/federation.js +4 -3
- package/dist/modules/ostorage/gql/schema.generated.d.ts +61 -64
- package/dist/modules/ostorage/gql/schema.js +2 -2
- package/dist/modules/ostorage/gql/types.js +1 -1
- package/dist/modules/ostorage/grpc/index.js +1 -1
- package/dist/modules/ostorage/index.js +2 -2
- package/dist/modules/payment/gql/federation.js +4 -3
- package/dist/modules/payment/gql/schema.generated.d.ts +32 -35
- package/dist/modules/payment/gql/schema.js +2 -2
- package/dist/modules/payment/gql/types.js +1 -1
- package/dist/modules/payment/grpc/index.js +1 -1
- package/dist/modules/payment/index.js +2 -2
- package/dist/modules/resource/gql/federation.js +4 -3
- package/dist/modules/resource/gql/schema.generated.d.ts +179 -182
- package/dist/modules/resource/gql/schema.js +2 -2
- package/dist/modules/resource/gql/types.js +1 -1
- package/dist/modules/resource/grpc/index.js +12 -12
- package/dist/modules/resource/index.js +2 -2
- package/dist/modules/scheduling/gql/federation.js +4 -3
- package/dist/modules/scheduling/gql/schema.generated.d.ts +55 -58
- package/dist/modules/scheduling/gql/schema.js +2 -2
- package/dist/modules/scheduling/gql/types.js +1 -1
- package/dist/modules/scheduling/grpc/index.js +1 -1
- package/dist/modules/scheduling/index.js +2 -2
- package/package.json +43 -42
@@ -5,13 +5,13 @@ const federation_1 = require("./gql/federation");
|
|
5
5
|
const interfaces_1 = require("./interfaces");
|
6
6
|
const grpc_1 = require("./grpc");
|
7
7
|
const utils_1 = require("../../utils");
|
8
|
-
exports.invoicingModule = utils_1.createFacadeModuleFactory(interfaces_1.namespace, (facade, config) => {
|
8
|
+
exports.invoicingModule = (0, utils_1.createFacadeModuleFactory)(interfaces_1.namespace, (facade, config) => {
|
9
9
|
const invoicing = {
|
10
10
|
client: new grpc_1.InvoicingSrvGrpcClient(config.config.client, facade.logger)
|
11
11
|
};
|
12
12
|
facade.addApolloService({
|
13
13
|
name: interfaces_1.namespace,
|
14
|
-
schema: federation_1.FederatedInvoicingSchema(config.config)
|
14
|
+
schema: (0, federation_1.FederatedInvoicingSchema)(config.config)
|
15
15
|
});
|
16
16
|
facade.koa.use(async (ctx, next) => {
|
17
17
|
ctx.invoicing = invoicing;
|
@@ -7,10 +7,11 @@ const schema_1 = require("./schema");
|
|
7
7
|
const interfaces_1 = require("../interfaces");
|
8
8
|
const protos_1 = require("../../../gql/protos");
|
9
9
|
const types_1 = require("./types");
|
10
|
+
const graphql_1 = require("graphql");
|
10
11
|
// TODO There is currently no way of building a federated schema from GraphQLSchema Object
|
11
12
|
// See https://github.com/apollographql/apollo-server/pull/4310
|
12
|
-
const FederatedNotificationSchema = (cfg) => federation_1.buildFederatedSchema({
|
13
|
-
typeDefs: apollo_server_koa_1.gql(
|
14
|
-
resolvers: protos_1.generateSubServiceResolvers(types_1.subServices, cfg, interfaces_1.namespace)
|
13
|
+
const FederatedNotificationSchema = (cfg) => (0, federation_1.buildFederatedSchema)({
|
14
|
+
typeDefs: (0, apollo_server_koa_1.gql)((0, graphql_1.printSchema)((0, schema_1.schema)(cfg))),
|
15
|
+
resolvers: (0, protos_1.generateSubServiceResolvers)(types_1.subServices, cfg, interfaces_1.namespace)
|
15
16
|
});
|
16
17
|
exports.FederatedNotificationSchema = FederatedNotificationSchema;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql';
|
2
2
|
import { NotificationContext } from '../interfaces';
|
3
3
|
export declare type Maybe<T> = T | undefined;
|
4
|
+
export declare type InputMaybe<T> = T | undefined;
|
4
5
|
export declare type Exact<T extends {
|
5
6
|
[key: string]: unknown;
|
6
7
|
}> = {
|
@@ -12,9 +13,7 @@ export declare type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
12
13
|
export declare type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
13
14
|
[SubKey in K]: Maybe<T[SubKey]>;
|
14
15
|
};
|
15
|
-
export declare type RequireFields<T, K extends keyof T> = {
|
16
|
-
[X in Exclude<keyof T, K>]?: T[X];
|
17
|
-
} & {
|
16
|
+
export declare type RequireFields<T, K extends keyof T> = Omit<T, K> & {
|
18
17
|
[P in K]-?: NonNullable<T[P]>;
|
19
18
|
};
|
20
19
|
/** All built-in and custom scalars, mapped to their actual values */
|
@@ -106,19 +105,19 @@ export declare type IoRestorecommerceStatusOperationStatus = {
|
|
106
105
|
message?: Maybe<Scalars['String']>;
|
107
106
|
};
|
108
107
|
export declare type IIoRestorecommerceResourcebaseReadRequest = {
|
109
|
-
offset?:
|
110
|
-
limit?:
|
111
|
-
sort?:
|
112
|
-
filters?:
|
113
|
-
field?:
|
114
|
-
search?:
|
115
|
-
localesLimiter?:
|
116
|
-
customQueries?:
|
117
|
-
customArguments?:
|
108
|
+
offset?: InputMaybe<Scalars['Int']>;
|
109
|
+
limit?: InputMaybe<Scalars['Int']>;
|
110
|
+
sort?: InputMaybe<Array<IIoRestorecommerceResourcebaseSort>>;
|
111
|
+
filters?: InputMaybe<Array<IIoRestorecommerceResourcebaseFilterOp>>;
|
112
|
+
field?: InputMaybe<Array<IIoRestorecommerceResourcebaseFieldFilter>>;
|
113
|
+
search?: InputMaybe<Array<Scalars['String']>>;
|
114
|
+
localesLimiter?: InputMaybe<Array<Scalars['String']>>;
|
115
|
+
customQueries?: InputMaybe<Array<Scalars['String']>>;
|
116
|
+
customArguments?: InputMaybe<IGoogleProtobufAny>;
|
118
117
|
};
|
119
118
|
export declare type IIoRestorecommerceResourcebaseSort = {
|
120
|
-
field?:
|
121
|
-
order?:
|
119
|
+
field?: InputMaybe<Scalars['String']>;
|
120
|
+
order?: InputMaybe<IoRestorecommerceResourcebaseSortSortOrder>;
|
122
121
|
};
|
123
122
|
export declare enum IoRestorecommerceResourcebaseSortSortOrder {
|
124
123
|
Unsorted = 0,
|
@@ -126,15 +125,15 @@ export declare enum IoRestorecommerceResourcebaseSortSortOrder {
|
|
126
125
|
Descending = 2
|
127
126
|
}
|
128
127
|
export declare type IIoRestorecommerceResourcebaseFilterOp = {
|
129
|
-
filter?:
|
130
|
-
operator?:
|
128
|
+
filter?: InputMaybe<Array<IIoRestorecommerceResourcebaseFilter>>;
|
129
|
+
operator?: InputMaybe<IoRestorecommerceResourcebaseFilterOpOperator>;
|
131
130
|
};
|
132
131
|
export declare type IIoRestorecommerceResourcebaseFilter = {
|
133
|
-
field?:
|
134
|
-
operation?:
|
135
|
-
value?:
|
136
|
-
type?:
|
137
|
-
filters?:
|
132
|
+
field?: InputMaybe<Scalars['String']>;
|
133
|
+
operation?: InputMaybe<IoRestorecommerceResourcebaseFilterOperation>;
|
134
|
+
value?: InputMaybe<Scalars['String']>;
|
135
|
+
type?: InputMaybe<IoRestorecommerceResourcebaseFilterValueType>;
|
136
|
+
filters?: InputMaybe<Array<IIoRestorecommerceFilterFilterOp>>;
|
138
137
|
};
|
139
138
|
export declare enum IoRestorecommerceResourcebaseFilterOperation {
|
140
139
|
Eq = 0,
|
@@ -155,15 +154,15 @@ export declare enum IoRestorecommerceResourcebaseFilterValueType {
|
|
155
154
|
Array = 4
|
156
155
|
}
|
157
156
|
export declare type IIoRestorecommerceFilterFilterOp = {
|
158
|
-
filter?:
|
159
|
-
operator?:
|
157
|
+
filter?: InputMaybe<Array<IIoRestorecommerceFilterFilter>>;
|
158
|
+
operator?: InputMaybe<IoRestorecommerceFilterFilterOpOperator>;
|
160
159
|
};
|
161
160
|
export declare type IIoRestorecommerceFilterFilter = {
|
162
|
-
field?:
|
163
|
-
operation?:
|
164
|
-
value?:
|
165
|
-
type?:
|
166
|
-
filters?:
|
161
|
+
field?: InputMaybe<Scalars['String']>;
|
162
|
+
operation?: InputMaybe<IoRestorecommerceFilterFilterOperation>;
|
163
|
+
value?: InputMaybe<Scalars['String']>;
|
164
|
+
type?: InputMaybe<IoRestorecommerceFilterFilterValueType>;
|
165
|
+
filters?: InputMaybe<Array<IIoRestorecommerceFilterFilterOp>>;
|
167
166
|
};
|
168
167
|
export declare enum IoRestorecommerceFilterFilterOperation {
|
169
168
|
Eq = 0,
|
@@ -192,43 +191,43 @@ export declare enum IoRestorecommerceResourcebaseFilterOpOperator {
|
|
192
191
|
Or = 1
|
193
192
|
}
|
194
193
|
export declare type IIoRestorecommerceResourcebaseFieldFilter = {
|
195
|
-
name?:
|
196
|
-
include?:
|
194
|
+
name?: InputMaybe<Scalars['String']>;
|
195
|
+
include?: InputMaybe<Scalars['Boolean']>;
|
197
196
|
};
|
198
197
|
export declare type IGoogleProtobufAny = {
|
199
|
-
typeUrl?:
|
200
|
-
value?:
|
198
|
+
typeUrl?: InputMaybe<Scalars['String']>;
|
199
|
+
value?: InputMaybe<Scalars['Upload']>;
|
201
200
|
};
|
202
201
|
export declare type IIoRestorecommerceNotificationNotificationList = {
|
203
|
-
items?:
|
204
|
-
totalCount?:
|
205
|
-
mode?:
|
202
|
+
items?: InputMaybe<Array<IIoRestorecommerceNotificationNotification>>;
|
203
|
+
totalCount?: InputMaybe<Scalars['Int']>;
|
204
|
+
mode?: InputMaybe<ModeType>;
|
206
205
|
};
|
207
206
|
export declare type IIoRestorecommerceNotificationNotification = {
|
208
|
-
id?:
|
209
|
-
meta?:
|
210
|
-
name?:
|
211
|
-
description?:
|
212
|
-
notificationChannelIds?:
|
213
|
-
email?:
|
214
|
-
telephoneNumber?:
|
215
|
-
subjectTemplate?:
|
216
|
-
bodyTemplate?:
|
207
|
+
id?: InputMaybe<Scalars['String']>;
|
208
|
+
meta?: InputMaybe<IIoRestorecommerceMetaMeta>;
|
209
|
+
name?: InputMaybe<Scalars['String']>;
|
210
|
+
description?: InputMaybe<Scalars['String']>;
|
211
|
+
notificationChannelIds?: InputMaybe<Array<Scalars['String']>>;
|
212
|
+
email?: InputMaybe<Scalars['String']>;
|
213
|
+
telephoneNumber?: InputMaybe<Scalars['String']>;
|
214
|
+
subjectTemplate?: InputMaybe<Scalars['String']>;
|
215
|
+
bodyTemplate?: InputMaybe<Scalars['String']>;
|
217
216
|
};
|
218
217
|
export declare type IIoRestorecommerceMetaMeta = {
|
219
|
-
created?:
|
220
|
-
modified?:
|
221
|
-
modifiedBy?:
|
222
|
-
owner?:
|
223
|
-
acl?:
|
218
|
+
created?: InputMaybe<Scalars['Float']>;
|
219
|
+
modified?: InputMaybe<Scalars['Float']>;
|
220
|
+
modifiedBy?: InputMaybe<Scalars['String']>;
|
221
|
+
owner?: InputMaybe<Array<IIoRestorecommerceAttributeAttribute>>;
|
222
|
+
acl?: InputMaybe<Array<IIoRestorecommerceAttributeAttributeObj>>;
|
224
223
|
};
|
225
224
|
export declare type IIoRestorecommerceAttributeAttribute = {
|
226
|
-
id?:
|
227
|
-
value?:
|
228
|
-
attribute?:
|
225
|
+
id?: InputMaybe<Scalars['String']>;
|
226
|
+
value?: InputMaybe<Scalars['String']>;
|
227
|
+
attribute?: InputMaybe<Array<IIoRestorecommerceAttributeAttribute>>;
|
229
228
|
};
|
230
229
|
export declare type IIoRestorecommerceAttributeAttributeObj = {
|
231
|
-
attribute?:
|
230
|
+
attribute?: InputMaybe<IIoRestorecommerceAttributeAttribute>;
|
232
231
|
};
|
233
232
|
export declare enum ModeType {
|
234
233
|
Create = "CREATE",
|
@@ -245,15 +244,18 @@ export declare type IoRestorecommerceResourcebaseDeleteResponse = {
|
|
245
244
|
operationStatus?: Maybe<IoRestorecommerceStatusOperationStatus>;
|
246
245
|
};
|
247
246
|
export declare type IIoRestorecommerceResourcebaseDeleteRequest = {
|
248
|
-
collection?:
|
249
|
-
ids?:
|
247
|
+
collection?: InputMaybe<Scalars['Boolean']>;
|
248
|
+
ids?: InputMaybe<Array<Scalars['String']>>;
|
250
249
|
};
|
251
250
|
export declare type WithIndex<TObject> = TObject & Record<string, any>;
|
252
251
|
export declare type ResolversObject<TObject> = WithIndex<TObject>;
|
253
252
|
export declare type ResolverTypeWrapper<T> = Promise<T> | T;
|
254
|
-
export declare type
|
253
|
+
export declare type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
|
254
|
+
resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
|
255
|
+
};
|
256
|
+
export declare type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> = ResolverFn<TResult, TParent, TContext, TArgs> | ResolverWithResolve<TResult, TParent, TContext, TArgs>;
|
255
257
|
export declare type ResolverFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => Promise<TResult> | TResult;
|
256
|
-
export declare type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) =>
|
258
|
+
export declare type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => AsyncIterable<TResult> | Promise<AsyncIterable<TResult>>;
|
257
259
|
export declare type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise<TResult>;
|
258
260
|
export interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> {
|
259
261
|
subscribe: SubscriptionSubscribeFn<{
|
@@ -507,8 +509,3 @@ export declare type Resolvers<ContextType = NotificationContext> = ResolversObje
|
|
507
509
|
ProtoIoRestorecommerceResourcebaseDeleteResponse?: ProtoIoRestorecommerceResourcebaseDeleteResponseResolvers<ContextType>;
|
508
510
|
IoRestorecommerceResourcebaseDeleteResponse?: IoRestorecommerceResourcebaseDeleteResponseResolvers<ContextType>;
|
509
511
|
}>;
|
510
|
-
/**
|
511
|
-
* @deprecated
|
512
|
-
* Use "Resolvers" root object instead. If you wish to get "IResolvers", add "typesPrefix: I" to your config.
|
513
|
-
*/
|
514
|
-
export declare type IResolvers<ContextType = NotificationContext> = Resolvers<ContextType>;
|
@@ -4,6 +4,6 @@ exports.schema = void 0;
|
|
4
4
|
const types_1 = require("./types");
|
5
5
|
const protos_1 = require("../../../gql/protos");
|
6
6
|
const interfaces_1 = require("../interfaces");
|
7
|
-
types_1.registerTypings();
|
8
|
-
const schema = (cfg) => protos_1.generateSubServiceSchemas(types_1.subServices, cfg, interfaces_1.namespace, 'Notification');
|
7
|
+
(0, types_1.registerTypings)();
|
8
|
+
const schema = (cfg) => (0, protos_1.generateSubServiceSchemas)(types_1.subServices, cfg, interfaces_1.namespace, 'Notification');
|
9
9
|
exports.schema = schema;
|
@@ -4,7 +4,7 @@ exports.subServices = exports.registerTypings = void 0;
|
|
4
4
|
const notification_1 = require("@restorecommerce/rc-grpc-clients/dist/generated/io/restorecommerce/notification");
|
5
5
|
const protos_1 = require("../../../gql/protos");
|
6
6
|
function registerTypings() {
|
7
|
-
protos_1.registerPackagesRecursive(notification_1.protoMetadata);
|
7
|
+
(0, protos_1.registerPackagesRecursive)(notification_1.protoMetadata);
|
8
8
|
}
|
9
9
|
exports.registerTypings = registerTypings;
|
10
10
|
exports.subServices = [
|
@@ -7,7 +7,7 @@ const protos_1 = require("../../../gql/protos");
|
|
7
7
|
class NotificationSrvGrpcClient extends rc_grpc_clients_1.RestoreCommerceGrpcClient {
|
8
8
|
constructor(cfg, logger) {
|
9
9
|
super(cfg, logger);
|
10
|
-
this.service = protos_1.getGRPCService(this, notification_1.protobufPackage, notification_1.protoMetadata.fileDescriptor.service[0]);
|
10
|
+
this.service = (0, protos_1.getGRPCService)(this, notification_1.protobufPackage, notification_1.protoMetadata.fileDescriptor.service[0]);
|
11
11
|
}
|
12
12
|
}
|
13
13
|
exports.NotificationSrvGrpcClient = NotificationSrvGrpcClient;
|
@@ -5,13 +5,13 @@ const federation_1 = require("./gql/federation");
|
|
5
5
|
const interfaces_1 = require("./interfaces");
|
6
6
|
const grpc_1 = require("./grpc");
|
7
7
|
const utils_1 = require("../../utils");
|
8
|
-
exports.notificationModule = utils_1.createFacadeModuleFactory(interfaces_1.namespace, (facade, config) => {
|
8
|
+
exports.notificationModule = (0, utils_1.createFacadeModuleFactory)(interfaces_1.namespace, (facade, config) => {
|
9
9
|
const notification = {
|
10
10
|
client: new grpc_1.NotificationSrvGrpcClient(config.config.client, facade.logger)
|
11
11
|
};
|
12
12
|
facade.addApolloService({
|
13
13
|
name: interfaces_1.namespace,
|
14
|
-
schema: federation_1.FederatedNotificationSchema(config.config)
|
14
|
+
schema: (0, federation_1.FederatedNotificationSchema)(config.config)
|
15
15
|
});
|
16
16
|
facade.koa.use(async (ctx, next) => {
|
17
17
|
ctx.notification = notification;
|
@@ -7,10 +7,11 @@ const schema_1 = require("./schema");
|
|
7
7
|
const interfaces_1 = require("../interfaces");
|
8
8
|
const graphql_1 = require("../../../gql/protos/graphql");
|
9
9
|
const types_1 = require("./types");
|
10
|
+
const graphql_2 = require("graphql");
|
10
11
|
// TODO There is currently no way of building a federated schema from GraphQLSchema Object
|
11
12
|
// See https://github.com/apollographql/apollo-server/pull/4310
|
12
|
-
const FederatedOrderingSchema = (cfg) => federation_1.buildFederatedSchema({
|
13
|
-
typeDefs: apollo_server_koa_1.gql(
|
14
|
-
resolvers: graphql_1.generateSubServiceResolvers(types_1.subServices, cfg, interfaces_1.namespace)
|
13
|
+
const FederatedOrderingSchema = (cfg) => (0, federation_1.buildFederatedSchema)({
|
14
|
+
typeDefs: (0, apollo_server_koa_1.gql)((0, graphql_2.printSchema)((0, schema_1.schema)(cfg))),
|
15
|
+
resolvers: (0, graphql_1.generateSubServiceResolvers)(types_1.subServices, cfg, interfaces_1.namespace)
|
15
16
|
});
|
16
17
|
exports.FederatedOrderingSchema = FederatedOrderingSchema;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql';
|
2
2
|
import { OrderingContext } from '../interfaces';
|
3
3
|
export declare type Maybe<T> = T | undefined;
|
4
|
+
export declare type InputMaybe<T> = T | undefined;
|
4
5
|
export declare type Exact<T extends {
|
5
6
|
[key: string]: unknown;
|
6
7
|
}> = {
|
@@ -12,9 +13,7 @@ export declare type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
12
13
|
export declare type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
13
14
|
[SubKey in K]: Maybe<T[SubKey]>;
|
14
15
|
};
|
15
|
-
export declare type RequireFields<T, K extends keyof T> = {
|
16
|
-
[X in Exclude<keyof T, K>]?: T[X];
|
17
|
-
} & {
|
16
|
+
export declare type RequireFields<T, K extends keyof T> = Omit<T, K> & {
|
18
17
|
[P in K]-?: NonNullable<T[P]>;
|
19
18
|
};
|
20
19
|
/** All built-in and custom scalars, mapped to their actual values */
|
@@ -125,19 +124,19 @@ export declare type IoRestorecommerceStatusOperationStatus = {
|
|
125
124
|
message?: Maybe<Scalars['String']>;
|
126
125
|
};
|
127
126
|
export declare type IIoRestorecommerceResourcebaseReadRequest = {
|
128
|
-
offset?:
|
129
|
-
limit?:
|
130
|
-
sort?:
|
131
|
-
filters?:
|
132
|
-
field?:
|
133
|
-
search?:
|
134
|
-
localesLimiter?:
|
135
|
-
customQueries?:
|
136
|
-
customArguments?:
|
127
|
+
offset?: InputMaybe<Scalars['Int']>;
|
128
|
+
limit?: InputMaybe<Scalars['Int']>;
|
129
|
+
sort?: InputMaybe<Array<IIoRestorecommerceResourcebaseSort>>;
|
130
|
+
filters?: InputMaybe<Array<IIoRestorecommerceResourcebaseFilterOp>>;
|
131
|
+
field?: InputMaybe<Array<IIoRestorecommerceResourcebaseFieldFilter>>;
|
132
|
+
search?: InputMaybe<Array<Scalars['String']>>;
|
133
|
+
localesLimiter?: InputMaybe<Array<Scalars['String']>>;
|
134
|
+
customQueries?: InputMaybe<Array<Scalars['String']>>;
|
135
|
+
customArguments?: InputMaybe<IGoogleProtobufAny>;
|
137
136
|
};
|
138
137
|
export declare type IIoRestorecommerceResourcebaseSort = {
|
139
|
-
field?:
|
140
|
-
order?:
|
138
|
+
field?: InputMaybe<Scalars['String']>;
|
139
|
+
order?: InputMaybe<IoRestorecommerceResourcebaseSortSortOrder>;
|
141
140
|
};
|
142
141
|
export declare enum IoRestorecommerceResourcebaseSortSortOrder {
|
143
142
|
Unsorted = 0,
|
@@ -145,15 +144,15 @@ export declare enum IoRestorecommerceResourcebaseSortSortOrder {
|
|
145
144
|
Descending = 2
|
146
145
|
}
|
147
146
|
export declare type IIoRestorecommerceResourcebaseFilterOp = {
|
148
|
-
filter?:
|
149
|
-
operator?:
|
147
|
+
filter?: InputMaybe<Array<IIoRestorecommerceResourcebaseFilter>>;
|
148
|
+
operator?: InputMaybe<IoRestorecommerceResourcebaseFilterOpOperator>;
|
150
149
|
};
|
151
150
|
export declare type IIoRestorecommerceResourcebaseFilter = {
|
152
|
-
field?:
|
153
|
-
operation?:
|
154
|
-
value?:
|
155
|
-
type?:
|
156
|
-
filters?:
|
151
|
+
field?: InputMaybe<Scalars['String']>;
|
152
|
+
operation?: InputMaybe<IoRestorecommerceResourcebaseFilterOperation>;
|
153
|
+
value?: InputMaybe<Scalars['String']>;
|
154
|
+
type?: InputMaybe<IoRestorecommerceResourcebaseFilterValueType>;
|
155
|
+
filters?: InputMaybe<Array<IIoRestorecommerceFilterFilterOp>>;
|
157
156
|
};
|
158
157
|
export declare enum IoRestorecommerceResourcebaseFilterOperation {
|
159
158
|
Eq = 0,
|
@@ -174,15 +173,15 @@ export declare enum IoRestorecommerceResourcebaseFilterValueType {
|
|
174
173
|
Array = 4
|
175
174
|
}
|
176
175
|
export declare type IIoRestorecommerceFilterFilterOp = {
|
177
|
-
filter?:
|
178
|
-
operator?:
|
176
|
+
filter?: InputMaybe<Array<IIoRestorecommerceFilterFilter>>;
|
177
|
+
operator?: InputMaybe<IoRestorecommerceFilterFilterOpOperator>;
|
179
178
|
};
|
180
179
|
export declare type IIoRestorecommerceFilterFilter = {
|
181
|
-
field?:
|
182
|
-
operation?:
|
183
|
-
value?:
|
184
|
-
type?:
|
185
|
-
filters?:
|
180
|
+
field?: InputMaybe<Scalars['String']>;
|
181
|
+
operation?: InputMaybe<IoRestorecommerceFilterFilterOperation>;
|
182
|
+
value?: InputMaybe<Scalars['String']>;
|
183
|
+
type?: InputMaybe<IoRestorecommerceFilterFilterValueType>;
|
184
|
+
filters?: InputMaybe<Array<IIoRestorecommerceFilterFilterOp>>;
|
186
185
|
};
|
187
186
|
export declare enum IoRestorecommerceFilterFilterOperation {
|
188
187
|
Eq = 0,
|
@@ -211,12 +210,12 @@ export declare enum IoRestorecommerceResourcebaseFilterOpOperator {
|
|
211
210
|
Or = 1
|
212
211
|
}
|
213
212
|
export declare type IIoRestorecommerceResourcebaseFieldFilter = {
|
214
|
-
name?:
|
215
|
-
include?:
|
213
|
+
name?: InputMaybe<Scalars['String']>;
|
214
|
+
include?: InputMaybe<Scalars['Boolean']>;
|
216
215
|
};
|
217
216
|
export declare type IGoogleProtobufAny = {
|
218
|
-
typeUrl?:
|
219
|
-
value?:
|
217
|
+
typeUrl?: InputMaybe<Scalars['String']>;
|
218
|
+
value?: InputMaybe<Scalars['Upload']>;
|
220
219
|
};
|
221
220
|
export declare type Mutation = {
|
222
221
|
__typename?: 'Mutation';
|
@@ -242,60 +241,60 @@ export declare type OrderingOrderMutationTriggerFulfillmentArgs = {
|
|
242
241
|
input: IIoRestorecommerceOrderOrderDataList;
|
243
242
|
};
|
244
243
|
export declare type IIoRestorecommerceOrderOrderList = {
|
245
|
-
items?:
|
246
|
-
totalCount?:
|
247
|
-
mode?:
|
244
|
+
items?: InputMaybe<Array<IIoRestorecommerceOrderOrder>>;
|
245
|
+
totalCount?: InputMaybe<Scalars['Int']>;
|
246
|
+
mode?: InputMaybe<ModeType>;
|
248
247
|
};
|
249
248
|
export declare type IIoRestorecommerceOrderOrder = {
|
250
|
-
id?:
|
251
|
-
meta?:
|
252
|
-
name?:
|
253
|
-
description?:
|
254
|
-
status?:
|
255
|
-
customerReference?:
|
256
|
-
items?:
|
257
|
-
totalPrice?:
|
258
|
-
shippingContactPointId?:
|
259
|
-
billingContactPointId?:
|
260
|
-
totalWeightInKg?:
|
249
|
+
id?: InputMaybe<Scalars['String']>;
|
250
|
+
meta?: InputMaybe<IIoRestorecommerceMetaMeta>;
|
251
|
+
name?: InputMaybe<Scalars['String']>;
|
252
|
+
description?: InputMaybe<Scalars['String']>;
|
253
|
+
status?: InputMaybe<Scalars['String']>;
|
254
|
+
customerReference?: InputMaybe<Scalars['String']>;
|
255
|
+
items?: InputMaybe<Array<IIoRestorecommerceOrderItems>>;
|
256
|
+
totalPrice?: InputMaybe<Scalars['Float']>;
|
257
|
+
shippingContactPointId?: InputMaybe<Scalars['String']>;
|
258
|
+
billingContactPointId?: InputMaybe<Scalars['String']>;
|
259
|
+
totalWeightInKg?: InputMaybe<Scalars['Float']>;
|
261
260
|
};
|
262
261
|
export declare type IIoRestorecommerceMetaMeta = {
|
263
|
-
created?:
|
264
|
-
modified?:
|
265
|
-
modifiedBy?:
|
266
|
-
owner?:
|
267
|
-
acl?:
|
262
|
+
created?: InputMaybe<Scalars['Float']>;
|
263
|
+
modified?: InputMaybe<Scalars['Float']>;
|
264
|
+
modifiedBy?: InputMaybe<Scalars['String']>;
|
265
|
+
owner?: InputMaybe<Array<IIoRestorecommerceAttributeAttribute>>;
|
266
|
+
acl?: InputMaybe<Array<IIoRestorecommerceAttributeAttributeObj>>;
|
268
267
|
};
|
269
268
|
export declare type IIoRestorecommerceAttributeAttribute = {
|
270
|
-
id?:
|
271
|
-
value?:
|
272
|
-
attribute?:
|
269
|
+
id?: InputMaybe<Scalars['String']>;
|
270
|
+
value?: InputMaybe<Scalars['String']>;
|
271
|
+
attribute?: InputMaybe<Array<IIoRestorecommerceAttributeAttribute>>;
|
273
272
|
};
|
274
273
|
export declare type IIoRestorecommerceAttributeAttributeObj = {
|
275
|
-
attribute?:
|
274
|
+
attribute?: InputMaybe<IIoRestorecommerceAttributeAttribute>;
|
276
275
|
};
|
277
276
|
export declare type IIoRestorecommerceOrderItems = {
|
278
|
-
quantityPrice?:
|
279
|
-
item?:
|
277
|
+
quantityPrice?: InputMaybe<Scalars['Float']>;
|
278
|
+
item?: InputMaybe<IIoRestorecommerceOrderItem>;
|
280
279
|
};
|
281
280
|
export declare type IIoRestorecommerceOrderItem = {
|
282
|
-
productVariantBundleId?:
|
283
|
-
productName?:
|
284
|
-
productDescription?:
|
285
|
-
manufacturerName?:
|
286
|
-
manufacturerDescription?:
|
287
|
-
prototypeName?:
|
288
|
-
prototypeDescription?:
|
289
|
-
quantity?:
|
290
|
-
vat?:
|
291
|
-
price?:
|
292
|
-
itemType?:
|
293
|
-
taricCode?:
|
294
|
-
stockKeepingUnit?:
|
295
|
-
weightInKg?:
|
296
|
-
lengthInCm?:
|
297
|
-
widthInCm?:
|
298
|
-
heightInCm?:
|
281
|
+
productVariantBundleId?: InputMaybe<Scalars['String']>;
|
282
|
+
productName?: InputMaybe<Scalars['String']>;
|
283
|
+
productDescription?: InputMaybe<Scalars['String']>;
|
284
|
+
manufacturerName?: InputMaybe<Scalars['String']>;
|
285
|
+
manufacturerDescription?: InputMaybe<Scalars['String']>;
|
286
|
+
prototypeName?: InputMaybe<Scalars['String']>;
|
287
|
+
prototypeDescription?: InputMaybe<Scalars['String']>;
|
288
|
+
quantity?: InputMaybe<Scalars['Int']>;
|
289
|
+
vat?: InputMaybe<Scalars['Int']>;
|
290
|
+
price?: InputMaybe<Scalars['Float']>;
|
291
|
+
itemType?: InputMaybe<Scalars['String']>;
|
292
|
+
taricCode?: InputMaybe<Scalars['Float']>;
|
293
|
+
stockKeepingUnit?: InputMaybe<Scalars['String']>;
|
294
|
+
weightInKg?: InputMaybe<Scalars['Float']>;
|
295
|
+
lengthInCm?: InputMaybe<Scalars['Int']>;
|
296
|
+
widthInCm?: InputMaybe<Scalars['Int']>;
|
297
|
+
heightInCm?: InputMaybe<Scalars['Int']>;
|
299
298
|
};
|
300
299
|
export declare enum ModeType {
|
301
300
|
Create = "CREATE",
|
@@ -312,8 +311,8 @@ export declare type IoRestorecommerceResourcebaseDeleteResponse = {
|
|
312
311
|
operationStatus?: Maybe<IoRestorecommerceStatusOperationStatus>;
|
313
312
|
};
|
314
313
|
export declare type IIoRestorecommerceResourcebaseDeleteRequest = {
|
315
|
-
collection?:
|
316
|
-
ids?:
|
314
|
+
collection?: InputMaybe<Scalars['Boolean']>;
|
315
|
+
ids?: InputMaybe<Array<Scalars['String']>>;
|
317
316
|
};
|
318
317
|
export declare type ProtoIoRestorecommerceOrderFulfillmentResults = {
|
319
318
|
__typename?: 'ProtoIoRestorecommerceOrderFulfillmentResults';
|
@@ -339,29 +338,32 @@ export declare type IoRestorecommerceOrderErrorList = {
|
|
339
338
|
message?: Maybe<Array<Scalars['String']>>;
|
340
339
|
};
|
341
340
|
export declare type IIoRestorecommerceOrderOrderDataList = {
|
342
|
-
orderData?:
|
343
|
-
meta?:
|
341
|
+
orderData?: InputMaybe<Array<IIoRestorecommerceOrderOrderData>>;
|
342
|
+
meta?: InputMaybe<IIoRestorecommerceMetaMeta>;
|
344
343
|
};
|
345
344
|
export declare type IIoRestorecommerceOrderOrderData = {
|
346
|
-
orderId?:
|
347
|
-
shipments?:
|
345
|
+
orderId?: InputMaybe<Scalars['String']>;
|
346
|
+
shipments?: InputMaybe<Array<IIoRestorecommerceOrderShipments>>;
|
348
347
|
};
|
349
348
|
export declare type IIoRestorecommerceOrderShipments = {
|
350
|
-
totalWeightInKg?:
|
351
|
-
individualWeightInKg?:
|
352
|
-
amount?:
|
353
|
-
exportType?:
|
354
|
-
exportDescription?:
|
355
|
-
customsTariffNumber?:
|
356
|
-
invoiceNumber?:
|
357
|
-
customsValue?:
|
349
|
+
totalWeightInKg?: InputMaybe<Scalars['Float']>;
|
350
|
+
individualWeightInKg?: InputMaybe<Scalars['Float']>;
|
351
|
+
amount?: InputMaybe<Scalars['Int']>;
|
352
|
+
exportType?: InputMaybe<Scalars['String']>;
|
353
|
+
exportDescription?: InputMaybe<Scalars['String']>;
|
354
|
+
customsTariffNumber?: InputMaybe<Scalars['String']>;
|
355
|
+
invoiceNumber?: InputMaybe<Scalars['String']>;
|
356
|
+
customsValue?: InputMaybe<Scalars['Float']>;
|
358
357
|
};
|
359
358
|
export declare type WithIndex<TObject> = TObject & Record<string, any>;
|
360
359
|
export declare type ResolversObject<TObject> = WithIndex<TObject>;
|
361
360
|
export declare type ResolverTypeWrapper<T> = Promise<T> | T;
|
362
|
-
export declare type
|
361
|
+
export declare type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
|
362
|
+
resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
|
363
|
+
};
|
364
|
+
export declare type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> = ResolverFn<TResult, TParent, TContext, TArgs> | ResolverWithResolve<TResult, TParent, TContext, TArgs>;
|
363
365
|
export declare type ResolverFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => Promise<TResult> | TResult;
|
364
|
-
export declare type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) =>
|
366
|
+
export declare type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => AsyncIterable<TResult> | Promise<AsyncIterable<TResult>>;
|
365
367
|
export declare type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise<TResult>;
|
366
368
|
export interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> {
|
367
369
|
subscribe: SubscriptionSubscribeFn<{
|
@@ -716,8 +718,3 @@ export declare type Resolvers<ContextType = OrderingContext> = ResolversObject<{
|
|
716
718
|
IoRestorecommerceOrderOrderStatus?: IoRestorecommerceOrderOrderStatusResolvers<ContextType>;
|
717
719
|
IoRestorecommerceOrderErrorList?: IoRestorecommerceOrderErrorListResolvers<ContextType>;
|
718
720
|
}>;
|
719
|
-
/**
|
720
|
-
* @deprecated
|
721
|
-
* Use "Resolvers" root object instead. If you wish to get "IResolvers", add "typesPrefix: I" to your config.
|
722
|
-
*/
|
723
|
-
export declare type IResolvers<ContextType = OrderingContext> = Resolvers<ContextType>;
|
@@ -4,6 +4,6 @@ exports.schema = void 0;
|
|
4
4
|
const types_1 = require("./types");
|
5
5
|
const protos_1 = require("../../../gql/protos");
|
6
6
|
const interfaces_1 = require("../interfaces");
|
7
|
-
types_1.registerTypings();
|
8
|
-
const schema = (cfg) => protos_1.generateSubServiceSchemas(types_1.subServices, cfg, interfaces_1.namespace, 'Ordering');
|
7
|
+
(0, types_1.registerTypings)();
|
8
|
+
const schema = (cfg) => (0, protos_1.generateSubServiceSchemas)(types_1.subServices, cfg, interfaces_1.namespace, 'Ordering');
|
9
9
|
exports.schema = schema;
|
@@ -4,7 +4,7 @@ exports.subServices = exports.registerTypings = void 0;
|
|
4
4
|
const order_1 = require("@restorecommerce/rc-grpc-clients/dist/generated/io/restorecommerce/order");
|
5
5
|
const protos_1 = require("../../../gql/protos");
|
6
6
|
function registerTypings() {
|
7
|
-
protos_1.registerPackagesRecursive(order_1.protoMetadata);
|
7
|
+
(0, protos_1.registerPackagesRecursive)(order_1.protoMetadata);
|
8
8
|
}
|
9
9
|
exports.registerTypings = registerTypings;
|
10
10
|
exports.subServices = [
|
@@ -7,7 +7,7 @@ const protos_1 = require("../../../gql/protos");
|
|
7
7
|
class OrderingSrvGrpcClient extends rc_grpc_clients_1.RestoreCommerceGrpcClient {
|
8
8
|
constructor(cfg, logger) {
|
9
9
|
super(cfg, logger);
|
10
|
-
this.order = protos_1.getGRPCService(this, order_1.protobufPackage, order_1.protoMetadata.fileDescriptor.service[0]);
|
10
|
+
this.order = (0, protos_1.getGRPCService)(this, order_1.protobufPackage, order_1.protoMetadata.fileDescriptor.service[0]);
|
11
11
|
}
|
12
12
|
}
|
13
13
|
exports.OrderingSrvGrpcClient = OrderingSrvGrpcClient;
|
@@ -5,13 +5,13 @@ const federation_1 = require("./gql/federation");
|
|
5
5
|
const interfaces_1 = require("./interfaces");
|
6
6
|
const grpc_1 = require("./grpc");
|
7
7
|
const utils_1 = require("../../utils");
|
8
|
-
exports.orderingModule = utils_1.createFacadeModuleFactory(interfaces_1.namespace, (facade, config) => {
|
8
|
+
exports.orderingModule = (0, utils_1.createFacadeModuleFactory)(interfaces_1.namespace, (facade, config) => {
|
9
9
|
const ordering = {
|
10
10
|
client: new grpc_1.OrderingSrvGrpcClient(config.config.client, facade.logger)
|
11
11
|
};
|
12
12
|
facade.addApolloService({
|
13
13
|
name: interfaces_1.namespace,
|
14
|
-
schema: federation_1.FederatedOrderingSchema(config.config)
|
14
|
+
schema: (0, federation_1.FederatedOrderingSchema)(config.config)
|
15
15
|
});
|
16
16
|
facade.koa.use(async (ctx, next) => {
|
17
17
|
ctx.ordering = ordering;
|