@orion-js/graphql 4.0.0-alpha.3 → 4.0.0-next.2

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/dist/index.d.ts CHANGED
@@ -1,570 +1,119 @@
1
- // Generated by dts-bundle-generator v9.5.1
2
-
3
- import { ApolloServerOptions } from '@apollo/server';
4
- import express from 'express';
5
- import * as GraphQL from 'graphql';
1
+ import * as _orion_js_resolvers from '@orion-js/resolvers';
2
+ import { ResolverOptions, GlobalResolverResolve, Resolver, ModelResolverResolve, ModelResolver as ModelResolver$1, ResolverMiddleware } from '@orion-js/resolvers';
3
+ import { GlobalResolversMap, ModelResolversMap, Model } from '@orion-js/models';
4
+ import { express } from '@orion-js/http';
6
5
  import { PubSubEngine } from 'graphql-subscriptions';
6
+ import { ApolloServerOptions } from '@apollo/server';
7
+ import { Schema } from '@orion-js/schema';
8
+ import * as graphql from 'graphql';
9
+ export { graphql as GraphQL };
7
10
 
8
- // Generated by dts-bundle-generator v9.5.1
9
- // Generated by dts-bundle-generator v9.5.1
10
- export interface StoredCacheData {
11
- value: any;
12
- expires?: Date;
13
- }
14
- export interface SetCacheOptions {
15
- ttl?: number;
16
- }
17
- export interface GetCacheOptions {
18
- ttl?: number;
19
- fallback?(): Promise<any>;
20
- }
21
- export interface OrionCache {
22
- /**
23
- * Save data in the cache
24
- */
25
- set(key: string, value: any, options?: SetCacheOptions): Promise<void> | void;
26
- /**
27
- * Get data from the cache
28
- */
29
- get(key: string, options?: GetCacheOptions): Promise<StoredCacheData>;
30
- /**
31
- * Removes data from the cache
32
- */
33
- invalidate(key: string): Promise<void> | void;
34
- }
35
- export type Blackbox = {
36
- [name: string]: any;
37
- };
38
- export type GlobalResolverResolve = (params: any, viewer: any, info?: any) => Promise<any>;
39
- export type ModelResolverResolve = (item: any, params: any, viewer: any, info?: any) => Promise<any>;
40
- export type GlobalCheckPermissions = (params: any, viewer: any, info?: any) => Promise<string | void>;
41
- export type ModelCheckPermissions = (parent: any, params: any, viewer: any, info?: any) => Promise<string | void>;
42
- export type GlobalGetCacheKey = (params: any, viewer: any, info: any) => Promise<any>;
43
- export type ModelGetCacheKey = (parent: any, params: any, viewer: any, info: any) => Promise<any>;
44
- export interface ExecuteOptions {
45
- params: Blackbox;
46
- viewer: any;
47
- parent?: any;
48
- info?: any;
49
- options: ResolverOptions;
50
- }
51
- export type Parameters$1<T> = T extends (...args: infer P) => any ? P : never;
52
- export type ReturnType$1<T> = T extends (...args: any) => infer R ? R : any;
53
- export type ResolverParams<Resolve, IsModel> = IsModel extends undefined ? Parameters$1<Resolve>[0] : Parameters$1<Resolve>[1];
54
- export interface ExecuteParams<Resolve = Function, IsModel = undefined> {
55
- params?: ResolverParams<Resolve, IsModel>;
56
- viewer?: any;
57
- parent?: IsModel extends undefined ? undefined : Parameters$1<Resolve>[0];
58
- info?: any;
59
- }
60
- export type Execute<Resolve = Function, IsModel = undefined> = (executeOptions: ExecuteParams<Resolve, IsModel>) => ReturnType$1<Resolve>;
61
- export interface SharedResolverOptions {
62
- resolverId?: string;
63
- params?: any;
64
- returns?: any;
65
- mutation?: boolean;
66
- private?: boolean;
67
- checkPermission?: GlobalCheckPermissions | ModelCheckPermissions;
68
- getCacheKey?: GlobalGetCacheKey | ModelGetCacheKey;
69
- cache?: number;
70
- cacheProvider?: OrionCache;
71
- permissionsOptions?: any;
72
- middlewares?: ResolverMiddleware[];
73
- }
74
- export interface ResolverOptions<Resolve = Function> extends SharedResolverOptions {
75
- resolve: Resolve;
11
+ declare class OrionSubscription<TParams = any, ReturnType = any> {
12
+ name: string;
13
+ params: object;
14
+ subscribe: (callParams: object, viewer: object) => {};
15
+ returns: ReturnType;
16
+ publish: (params: TParams, data: ReturnType) => Promise<void>;
76
17
  }
77
- export type OmitFirstArg<F> = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never;
78
- export interface Resolver<Resolve = Function, IsModel = undefined> extends SharedResolverOptions {
79
- execute: Execute<Resolve, IsModel>;
80
- resolve: Resolve;
81
- modelResolve: IsModel extends undefined ? undefined : OmitFirstArg<Resolve>;
18
+ type CreateOrionSubscriptionFunction = <T = any, ReturnType = any>(options: OrionSubscriptionOptions) => OrionSubscription<T, ReturnType>;
19
+ interface OrionSubscriptionsMap {
20
+ [key: string]: OrionSubscription;
82
21
  }
83
- export type ModelResolver<Resolve = Function> = Resolver<Resolve, true>;
84
- export type ResolverMiddleware = (executeOptions: ExecuteOptions, next: () => Promise<any>) => Promise<any>;
85
- export declare class OrionSubscription<TParams = any, ReturnType = any> {
86
- name: string;
87
- params: object;
88
- subscribe: (callParams: object, viewer: object) => {};
89
- returns: ReturnType;
90
- publish: (params: TParams, data: ReturnType) => Promise<void>;
91
- }
92
- export type CreateOrionSubscriptionFunction = <T = any, ReturnType = any>(options: OrionSubscriptionOptions) => OrionSubscription<T, ReturnType>;
93
- export interface OrionSubscriptionsMap {
94
- [key: string]: OrionSubscription;
95
- }
96
- export interface OrionSubscriptionOptions extends Omit<ResolverOptions, "resolve"> {
97
- name?: string;
22
+ interface OrionSubscriptionOptions extends Omit<ResolverOptions, 'resolve'> {
23
+ name?: string;
98
24
  }
25
+
99
26
  declare const createSubscription: CreateOrionSubscriptionFunction;
100
- interface StoredCacheData$1 {
101
- value: any;
102
- expires?: Date;
103
- }
104
- interface SetCacheOptions$1 {
105
- ttl?: number;
106
- }
107
- interface GetCacheOptions$1 {
108
- ttl?: number;
109
- fallback?(): Promise<any>;
110
- }
111
- interface OrionCache$1 {
112
- /**
113
- * Save data in the cache
114
- */
115
- set(key: string, value: any, options?: SetCacheOptions$1): Promise<void> | void;
116
- /**
117
- * Get data from the cache
118
- */
119
- get(key: string, options?: GetCacheOptions$1): Promise<StoredCacheData$1>;
120
- /**
121
- * Removes data from the cache
122
- */
123
- invalidate(key: string): Promise<void> | void;
124
- }
125
- type Blackbox$1 = {
126
- [name: string]: any;
127
- };
128
- type GlobalResolverResolve$1 = (params: any, viewer: any, info?: any) => Promise<any>;
129
- type ModelResolverResolve$1 = (item: any, params: any, viewer: any, info?: any) => Promise<any>;
130
- type GlobalCheckPermissions$1 = (params: any, viewer: any, info?: any) => Promise<string | void>;
131
- type ModelCheckPermissions$1 = (parent: any, params: any, viewer: any, info?: any) => Promise<string | void>;
132
- type GlobalGetCacheKey$1 = (params: any, viewer: any, info: any) => Promise<any>;
133
- type ModelGetCacheKey$1 = (parent: any, params: any, viewer: any, info: any) => Promise<any>;
134
- interface ExecuteOptions$1 {
135
- params: Blackbox$1;
136
- viewer: any;
137
- parent?: any;
138
- info?: any;
139
- options: ResolverOptions$1;
140
- }
141
- type Parameters$1$1<T> = T extends (...args: infer P) => any ? P : never;
142
- type ReturnType$1$1<T> = T extends (...args: any) => infer R ? R : any;
143
- type ResolverParams$1<Resolve, IsModel> = IsModel extends undefined ? Parameters$1$1<Resolve>[0] : Parameters$1$1<Resolve>[1];
144
- interface ExecuteParams$1<Resolve = Function, IsModel = undefined> {
145
- params?: ResolverParams$1<Resolve, IsModel>;
146
- viewer?: any;
147
- parent?: IsModel extends undefined ? undefined : Parameters$1$1<Resolve>[0];
148
- info?: any;
149
- }
150
- type Execute$1<Resolve = Function, IsModel = undefined> = (executeOptions: ExecuteParams$1<Resolve, IsModel>) => ReturnType$1$1<Resolve>;
151
- interface SharedResolverOptions$1 {
152
- resolverId?: string;
153
- params?: any;
154
- returns?: any;
155
- mutation?: boolean;
156
- private?: boolean;
157
- checkPermission?: GlobalCheckPermissions$1 | ModelCheckPermissions$1;
158
- getCacheKey?: GlobalGetCacheKey$1 | ModelGetCacheKey$1;
159
- cache?: number;
160
- cacheProvider?: OrionCache$1;
161
- permissionsOptions?: any;
162
- middlewares?: ResolverMiddleware$1[];
163
- }
164
- interface ResolverOptions$1<Resolve = Function> extends SharedResolverOptions$1 {
165
- resolve: Resolve;
166
- }
167
- type OmitFirstArg$1<F> = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never;
168
- interface Resolver$1<Resolve = Function, IsModel = undefined> extends SharedResolverOptions$1 {
169
- execute: Execute$1<Resolve, IsModel>;
170
- resolve: Resolve;
171
- modelResolve: IsModel extends undefined ? undefined : OmitFirstArg$1<Resolve>;
172
- }
173
- type ModelResolver$1<Resolve = Function> = Resolver$1<Resolve, true>;
174
- type ResolverMiddleware$1 = (executeOptions: ExecuteOptions$1, next: () => Promise<any>) => Promise<any>;
175
- export interface FieldType {
176
- name: string;
177
- validate: ValidateFunction;
178
- clean: CleanFunction;
179
- meta?: any;
180
- toGraphQLType?: (GraphQL: any) => any;
181
- _isFieldType: boolean;
182
- }
183
- export type Constructor<T> = new (...args: any[]) => T;
184
- export type FieldTypesList = "string" | "date" | "integer" | "number" | "ID" | "boolean" | "email" | "blackbox" | "any";
185
- export type TypedModelOnSchema = Function;
186
- export type ConstructorsTypesList = Constructor<String> | Constructor<Number> | Constructor<Boolean> | Constructor<Date>;
187
- export type SchemaRecursiveNodeTypeExtras = {
188
- _isFieldType?: boolean;
189
- __clean?: CleanFunction;
190
- __validate?: ValidateFunction;
191
- __skipChildValidation?: (value: any, info: CurrentNodeInfo) => Promise<boolean>;
192
- };
193
- export interface Schema {
194
- [key: string]: SchemaNode | Function;
195
- }
196
- export type SchemaRecursiveNodeType = Schema & SchemaRecursiveNodeTypeExtras;
197
- export type SchemaMetaFieldTypeSingle = FieldTypesList | ConstructorsTypesList | SchemaRecursiveNodeType | FieldType | TypedModelOnSchema;
198
- export type SchemaMetaFieldType = SchemaMetaFieldTypeSingle | SchemaMetaFieldTypeSingle[];
199
- export type ValidateFunction = (value: any, info?: Partial<CurrentNodeInfo>, ...args: any[]) => object | string | void | Promise<object | string | void>;
200
- export type CleanFunction = (value: any, info?: Partial<CurrentNodeInfo>, ...args: any[]) => any | Promise<any>;
201
- export interface SchemaNode {
202
- /**
203
- * The type of the field. Used for type validations. Can also contain a subschema.
204
- */
205
- type: SchemaMetaFieldType;
206
- /**
207
- * Defaults to false
208
- */
209
- optional?: boolean;
210
- allowedValues?: Array<any>;
211
- defaultValue?: ((info: CurrentNodeInfo, ...args: any[]) => any | Promise<any>) | any;
212
- /**
213
- * Function that takes a value and returns an error message if there are any errors. Must return null or undefined otherwise.
214
- */
215
- validate?: ValidateFunction;
216
- /**
217
- * Function that preprocesses a value before it is set.
218
- */
219
- clean?: CleanFunction;
220
- autoValue?: (value: any, info: CurrentNodeInfo, ...args: any[]) => any | Promise<any>;
221
- /**
222
- * The minimum value if it's a number, the minimum length if it's a string or array.
223
- */
224
- min?: number;
225
- /**
226
- * The maximum value if it's a number, the maximum length if it's a string or array.
227
- */
228
- max?: number;
229
- /**
230
- * Internal use only.
231
- */
232
- isBlackboxChild?: boolean;
233
- /**
234
- * @deprecated
235
- */
236
- custom?: ValidateFunction;
237
- /**
238
- * Used in GraphQL. If true, the field will be omitted from the schema.
239
- */
240
- private?: boolean;
241
- /**
242
- * Used in GraphQL. When in GraphQL, this resolver will replace the static field.
243
- */
244
- graphQLResolver?: (...args: any) => any;
245
- /**
246
- * Used in GraphQL. Sets the key of the field in the GraphQL schema. You must set this value when building your schema.
247
- */
248
- key?: string;
249
- /**
250
- * The name that would be displayed in a front-end form
251
- */
252
- label?: string;
253
- /**
254
- * The description that would be displayed in a front-end form
255
- */
256
- description?: string;
257
- /**
258
- * The placeholder that would be displayed in a front-end form
259
- */
260
- placeholder?: string;
261
- /**
262
- * The field type that would be used in a front-end form
263
- */
264
- fieldType?: string;
265
- /**
266
- * The field options that will be passed as props to the front-end field
267
- */
268
- fieldOptions?: any;
269
- }
270
- export interface CurrentNodeInfoOptions {
271
- autoConvert?: boolean;
272
- filter?: boolean;
273
- trimStrings?: boolean;
274
- removeEmptyStrings?: boolean;
275
- forceDoc?: any;
276
- omitRequired?: boolean;
277
- }
278
- export interface CurrentNodeInfo {
279
- /**
280
- * The global schema, prefaced by {type: {...}} to be compatible with subschemas
281
- * Sometimes it's given without {type: {...}}. TODO: Normalize this.
282
- */
283
- schema?: SchemaNode | Schema;
284
- /**
285
- * The current node subschema
286
- */
287
- currentSchema?: Partial<SchemaNode>;
288
- value: any;
289
- doc?: any;
290
- currentDoc?: any;
291
- options?: CurrentNodeInfoOptions;
292
- args?: any[];
293
- type?: SchemaMetaFieldType;
294
- keys?: string[];
295
- addError?: (keys: string[], code: string | object) => void;
296
- }
297
- export interface ModelResolversMap {
298
- [key: string]: ModelResolver$1<ModelResolverResolve$1>;
299
- }
300
- export interface GlobalResolversMap {
301
- [key: string]: Resolver$1<GlobalResolverResolve$1>;
302
- }
303
- export interface CloneOptions {
304
- name: string;
305
- omitFields?: string[];
306
- pickFields?: string[];
307
- mapFields?: (field: any, key: string) => any;
308
- extendSchema?: Schema;
309
- extendResolvers?: ModelResolversMap;
310
- }
311
- export interface Model<TSchema = any> {
312
- __isModel: boolean;
313
- /**
314
- * The name of the model, used for example for GraphQL
315
- */
316
- name: string;
317
- /**
318
- * Returns the schema of the model
319
- */
320
- getSchema: () => Schema & {
321
- __model: Model;
322
- };
323
- /**
324
- * Returns the schema without adding __model to the schema
325
- */
326
- getCleanSchema: () => Schema;
327
- /**
328
- * Returns the model resolvers
329
- */
330
- getResolvers: () => ModelResolversMap;
331
- /**
332
- * Adds the model resolvers to a item
333
- */
334
- initItem: (item: any) => any;
335
- /**
336
- * Validates an item using @orion-js/schema
337
- */
338
- validate: (item: any) => Promise<any>;
339
- /**
340
- * Cleans an item using @orion-js/schema
341
- */
342
- clean: (item: any) => Promise<TSchema>;
343
- /**
344
- * Cleans and validates an item using @orion-js/schema
345
- */
346
- cleanAndValidate: (item: any) => Promise<TSchema>;
347
- /**
348
- * Creates a new model using this one as a base
349
- */
350
- clone: (cloneOptions: CloneOptions) => Model;
351
- /**
352
- * The type of the model. Only use this in typescript
353
- */
354
- type: TSchema;
355
- }
356
- export type ExecuteGraphQLCache = (req: express.Request, res: express.Response, viewer: object, executeQuery: () => Promise<string>) => Promise<string>;
357
- export interface ModelsResolversMap {
358
- [key: string]: ModelResolversMap;
359
- }
360
- export type SchemaOmits = "schema" | "schemaHash" | "context" | "useGraphiql";
361
- export interface StartGraphQLOptions extends Omit<ApolloServerOptions<any>, SchemaOmits> {
362
- /**
363
- * A map with all the global resolvers
364
- */
365
- resolvers: GlobalResolversMap;
366
- /**
367
- * A map with all the model resolvers. You must only add the models that you want to extend with resolvers.
368
- */
369
- modelResolvers?: ModelsResolversMap;
370
- /**
371
- * A Map with all global subscriptions
372
- */
373
- subscriptions?: OrionSubscriptionsMap;
374
- /**
375
- * A function that executes the http level cache of graphql queries
376
- */
377
- /**
378
- * Should use GraphiQL. Default to true
379
- */
380
- useGraphiql?: boolean;
381
- /**
382
- * Pass another express app
383
- */
384
- app?: express.Application;
385
- /**
386
- * The pubsub provider to use. Default to the single server pubsub.
387
- * If you are using multiple servers you must pass a pubsub provider like RedisPubSub
388
- */
389
- pubsub?: PubSubEngine;
390
- }
391
- declare function _default(options: StartGraphQLOptions): Promise<void>;
392
- declare function _default$1(apolloOptions: ApolloServerOptions<any>, options: StartGraphQLOptions): void;
393
- declare const _default$2: {
394
- params: Resolver<({ mutation, name }: any, viewer: any) => Promise<{
395
- resolver: Resolver$1<GlobalResolverResolve$1, undefined>;
396
- name: any;
397
- }>, undefined>;
398
- };
399
- declare const _default$3: Model<any>;
400
- interface FieldType$1 {
401
- name: string;
402
- validate: ValidateFunction$1;
403
- clean: CleanFunction$1;
404
- meta?: any;
405
- toGraphQLType?: (GraphQL: any) => any;
406
- _isFieldType: boolean;
27
+
28
+ type ExecuteGraphQLCache = (req: express.Request, res: express.Response, viewer: object, executeQuery: () => Promise<string>) => Promise<string>;
29
+ interface ModelsResolversMap {
30
+ [key: string]: ModelResolversMap;
31
+ }
32
+ type SchemaOmits = 'schema' | 'schemaHash' | 'context' | 'useGraphiql';
33
+ interface StartGraphQLOptions extends Omit<ApolloServerOptions<any>, SchemaOmits> {
34
+ /**
35
+ * A map with all the global resolvers
36
+ */
37
+ resolvers: GlobalResolversMap;
38
+ /**
39
+ * A map with all the model resolvers. You must only add the models that you want to extend with resolvers.
40
+ */
41
+ modelResolvers?: ModelsResolversMap;
42
+ /**
43
+ * A Map with all global subscriptions
44
+ */
45
+ subscriptions?: OrionSubscriptionsMap;
46
+ /**
47
+ * A function that executes the http level cache of graphql queries
48
+ */
49
+ /**
50
+ * Should use GraphiQL. Default to true
51
+ */
52
+ useGraphiql?: boolean;
53
+ /**
54
+ * Pass another express app
55
+ */
56
+ app?: express.Application;
57
+ /**
58
+ * The pubsub provider to use. Default to the single server pubsub.
59
+ * If you are using multiple servers you must pass a pubsub provider like RedisPubSub
60
+ */
61
+ pubsub?: PubSubEngine;
407
62
  }
408
- type Constructor$1<T> = new (...args: any[]) => T;
409
- type FieldTypesList$1 = "string" | "date" | "integer" | "number" | "ID" | "boolean" | "email" | "blackbox" | "any";
410
- type TypedModelOnSchema$1 = Function;
411
- type ConstructorsTypesList$1 = Constructor$1<String> | Constructor$1<Number> | Constructor$1<Boolean> | Constructor$1<Date>;
412
- type SchemaRecursiveNodeTypeExtras$1 = {
413
- _isFieldType?: boolean;
414
- __clean?: CleanFunction$1;
415
- __validate?: ValidateFunction$1;
416
- __skipChildValidation?: (value: any, info: CurrentNodeInfo$1) => Promise<boolean>;
63
+
64
+ declare function export_default$1(options: StartGraphQLOptions): Promise<void>;
65
+
66
+ declare function export_default(apolloOptions: ApolloServerOptions<any>, options: StartGraphQLOptions): void;
67
+
68
+ declare const _default$1: {
69
+ params: _orion_js_resolvers.Resolver<({ mutation, name }: any, viewer: any) => Promise<{
70
+ resolver: _orion_js_resolvers.Resolver<_orion_js_resolvers.GlobalResolverResolve, undefined>;
71
+ name: any;
72
+ }>, undefined>;
417
73
  };
418
- interface Schema$1 {
419
- [key: string]: SchemaNode$1 | Function;
420
- }
421
- type SchemaRecursiveNodeType$1 = Schema$1 & SchemaRecursiveNodeTypeExtras$1;
422
- type SchemaMetaFieldTypeSingle$1 = FieldTypesList$1 | ConstructorsTypesList$1 | SchemaRecursiveNodeType$1 | FieldType$1 | TypedModelOnSchema$1;
423
- type SchemaMetaFieldType$1 = SchemaMetaFieldTypeSingle$1 | SchemaMetaFieldTypeSingle$1[];
424
- type ValidateFunction$1 = (value: any, info?: Partial<CurrentNodeInfo$1>, ...args: any[]) => object | string | void | Promise<object | string | void>;
425
- type CleanFunction$1 = (value: any, info?: Partial<CurrentNodeInfo$1>, ...args: any[]) => any | Promise<any>;
426
- interface SchemaNode$1 {
427
- /**
428
- * The type of the field. Used for type validations. Can also contain a subschema.
429
- */
430
- type: SchemaMetaFieldType$1;
431
- /**
432
- * Defaults to false
433
- */
434
- optional?: boolean;
435
- allowedValues?: Array<any>;
436
- defaultValue?: ((info: CurrentNodeInfo$1, ...args: any[]) => any | Promise<any>) | any;
437
- /**
438
- * Function that takes a value and returns an error message if there are any errors. Must return null or undefined otherwise.
439
- */
440
- validate?: ValidateFunction$1;
441
- /**
442
- * Function that preprocesses a value before it is set.
443
- */
444
- clean?: CleanFunction$1;
445
- autoValue?: (value: any, info: CurrentNodeInfo$1, ...args: any[]) => any | Promise<any>;
446
- /**
447
- * The minimum value if it's a number, the minimum length if it's a string or array.
448
- */
449
- min?: number;
450
- /**
451
- * The maximum value if it's a number, the maximum length if it's a string or array.
452
- */
453
- max?: number;
454
- /**
455
- * Internal use only.
456
- */
457
- isBlackboxChild?: boolean;
458
- /**
459
- * @deprecated
460
- */
461
- custom?: ValidateFunction$1;
462
- /**
463
- * Used in GraphQL. If true, the field will be omitted from the schema.
464
- */
465
- private?: boolean;
466
- /**
467
- * Used in GraphQL. When in GraphQL, this resolver will replace the static field.
468
- */
469
- graphQLResolver?: (...args: any) => any;
470
- /**
471
- * Used in GraphQL. Sets the key of the field in the GraphQL schema. You must set this value when building your schema.
472
- */
473
- key?: string;
474
- /**
475
- * The name that would be displayed in a front-end form
476
- */
477
- label?: string;
478
- /**
479
- * The description that would be displayed in a front-end form
480
- */
481
- description?: string;
482
- /**
483
- * The placeholder that would be displayed in a front-end form
484
- */
485
- placeholder?: string;
486
- /**
487
- * The field type that would be used in a front-end form
488
- */
489
- fieldType?: string;
490
- /**
491
- * The field options that will be passed as props to the front-end field
492
- */
493
- fieldOptions?: any;
494
- }
495
- interface CurrentNodeInfoOptions$1 {
496
- autoConvert?: boolean;
497
- filter?: boolean;
498
- trimStrings?: boolean;
499
- removeEmptyStrings?: boolean;
500
- forceDoc?: any;
501
- omitRequired?: boolean;
502
- }
503
- interface CurrentNodeInfo$1 {
504
- /**
505
- * The global schema, prefaced by {type: {...}} to be compatible with subschemas
506
- * Sometimes it's given without {type: {...}}. TODO: Normalize this.
507
- */
508
- schema?: SchemaNode$1 | Schema$1;
509
- /**
510
- * The current node subschema
511
- */
512
- currentSchema?: Partial<SchemaNode$1>;
513
- value: any;
514
- doc?: any;
515
- currentDoc?: any;
516
- options?: CurrentNodeInfoOptions$1;
517
- args?: any[];
518
- type?: SchemaMetaFieldType$1;
519
- keys?: string[];
520
- addError?: (keys: string[], code: string | object) => void;
521
- }
522
- export function serializeSchema(params: any): Promise<Schema$1>;
74
+
75
+ declare const _default: Model<any>;
76
+
77
+ declare function serializeSchema(params: any): Promise<Schema>;
78
+
523
79
  declare function getBasicQuery(field: any): Promise<any>;
524
- export declare function Resolvers(): ClassDecorator;
525
- export interface GlobalResolverPropertyDescriptor extends Omit<PropertyDecorator, "value"> {
526
- value?: GlobalResolverResolve;
527
- }
528
- export declare function Query(options?: Omit<ResolverOptions<any>, "resolve" | "mutation">): (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor) => void;
529
- export declare function Mutation(options?: Omit<ResolverOptions<any>, "resolve" | "mutation">): (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor) => void;
530
- export declare function getServiceResolvers(target: any): {
531
- [key: string]: Resolver<GlobalResolverResolve>;
532
- };
533
- export interface ModelResolverPropertyDescriptor extends Omit<PropertyDecorator, "value"> {
534
- value?: ModelResolverResolve;
535
- }
536
- declare function ModelResolver$2(options?: Omit<ResolverOptions<any>, "resolve" | "middlewares">): (target: any, propertyKey: string, descriptor: ModelResolverPropertyDescriptor) => void;
537
- export interface ModelResolversOptions {
538
- modelName?: string;
539
- }
540
- export declare function ModelResolvers(typedSchema: any, options?: ModelResolversOptions): ClassDecorator;
541
- export declare function getServiceModelResolvers(target: any): {
542
- [key: string]: {
543
- [key: string]: ModelResolver<GlobalResolverResolve>;
544
- };
80
+
81
+ declare function Resolvers(): ClassDecorator;
82
+ interface GlobalResolverPropertyDescriptor extends Omit<PropertyDecorator, 'value'> {
83
+ value?: GlobalResolverResolve;
84
+ }
85
+ declare function Query(options?: Omit<ResolverOptions<any>, 'resolve' | 'mutation'>): (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor) => void;
86
+ declare function Mutation(options?: Omit<ResolverOptions<any>, 'resolve' | 'mutation'>): (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor) => void;
87
+ declare function getServiceResolvers(target: any): {
88
+ [key: string]: Resolver<GlobalResolverResolve>;
545
89
  };
546
- export declare function Subscriptions(): ClassDecorator;
547
- export declare function Subscription<T = any, ReturnType = any>(options: OrionSubscriptionOptions): (object: any, propertyName: string, index?: number) => void;
548
- export declare function getServiceSubscriptions(target: any): {
549
- [key: string]: OrionSubscription;
90
+
91
+ interface ModelResolverPropertyDescriptor extends Omit<PropertyDecorator, 'value'> {
92
+ value?: ModelResolverResolve;
93
+ }
94
+ declare function ModelResolver(options?: Omit<ResolverOptions<any>, 'resolve' | 'middlewares'>): (target: any, propertyKey: string, descriptor: ModelResolverPropertyDescriptor) => void;
95
+ interface ModelResolversOptions {
96
+ modelName?: string;
97
+ }
98
+ declare function ModelResolvers(typedSchema: any, options?: ModelResolversOptions): ClassDecorator;
99
+ declare function getServiceModelResolvers(target: any): {
100
+ [key: string]: {
101
+ [key: string]: ModelResolver$1<GlobalResolverResolve>;
102
+ };
550
103
  };
551
- export declare function getTargetMetadata(target: any, propertyKey: string, metadataKey: string): any;
552
- export declare const UseMiddleware: (metadata: ResolverMiddleware) => (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor | ModelResolverPropertyDescriptor) => void;
553
- declare const ResolverParams$2: (metadata: any) => (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor | ModelResolverPropertyDescriptor) => void;
554
- export declare const ResolverReturns: (metadata: any) => (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor | ModelResolverPropertyDescriptor) => void;
555
- export declare const getWebsockerViewer: (connectionParams: any) => Promise<any>;
556
- export declare const setGetWebsockerViewer: (getViewerFunc: (connectionParams: any) => any) => void;
557
104
 
558
- export {
559
- GraphQL,
560
- ModelResolver$2 as ModelResolver,
561
- ResolverParams$2 as ResolverParams,
562
- _default as startGraphQL,
563
- _default$1 as startGraphiQL,
564
- _default$2 as resolversSchemas,
565
- _default$3 as ResolverParamsInfo,
566
- createSubscription as subscription,
567
- getBasicQuery as getBasicResultQuery,
105
+ declare function Subscriptions(): ClassDecorator;
106
+ declare function Subscription<T = any, ReturnType = any>(options: OrionSubscriptionOptions): (object: any, propertyName: string, index?: number) => void;
107
+ declare function getServiceSubscriptions(target: any): {
108
+ [key: string]: OrionSubscription;
568
109
  };
569
110
 
570
- export {};
111
+ declare function getTargetMetadata(target: any, propertyKey: string, metadataKey: string): any;
112
+ declare const UseMiddleware: (metadata: ResolverMiddleware) => (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor | ModelResolverPropertyDescriptor) => void;
113
+ declare const ResolverParams: (metadata: any) => (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor | ModelResolverPropertyDescriptor) => void;
114
+ declare const ResolverReturns: (metadata: any) => (target: any, propertyKey: string, descriptor: GlobalResolverPropertyDescriptor | ModelResolverPropertyDescriptor) => void;
115
+
116
+ declare const getWebsockerViewer: (connectionParams: any) => Promise<any>;
117
+ declare const setGetWebsockerViewer: (getViewerFunc: (connectionParams: any) => any) => void;
118
+
119
+ export { type CreateOrionSubscriptionFunction, type ExecuteGraphQLCache, type GlobalResolverPropertyDescriptor, ModelResolver, type ModelResolverPropertyDescriptor, ModelResolvers, type ModelResolversOptions, type ModelsResolversMap, Mutation, OrionSubscription, type OrionSubscriptionOptions, type OrionSubscriptionsMap, Query, ResolverParams, _default as ResolverParamsInfo, ResolverReturns, Resolvers, type StartGraphQLOptions, Subscription, Subscriptions, UseMiddleware, getBasicQuery as getBasicResultQuery, getServiceModelResolvers, getServiceResolvers, getServiceSubscriptions, getTargetMetadata, getWebsockerViewer, _default$1 as resolversSchemas, serializeSchema, setGetWebsockerViewer, export_default$1 as startGraphQL, export_default as startGraphiQL, createSubscription as subscription };