@envelop/core 2.4.0-alpha-aca44e1.0 → 2.4.0-alpha-e9434aa.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/cjs/create.js +28 -0
- package/cjs/enable-if.js +24 -0
- package/cjs/index.js +16 -0
- package/cjs/orchestrator.js +451 -0
- package/cjs/package.json +1 -0
- package/cjs/plugins/use-envelop.js +13 -0
- package/cjs/plugins/use-error-handler.js +21 -0
- package/cjs/plugins/use-extend-context.js +9 -0
- package/cjs/plugins/use-immediate-introspection.js +50 -0
- package/cjs/plugins/use-logger.js +45 -0
- package/cjs/plugins/use-masked-errors.js +90 -0
- package/cjs/plugins/use-payload-formatter.js +21 -0
- package/cjs/plugins/use-schema.js +29 -0
- package/cjs/plugins/use-timing.js +138 -0
- package/cjs/traced-orchestrator.js +134 -0
- package/cjs/traced-schema.js +68 -0
- package/cjs/utils.js +221 -0
- package/esm/create.js +28 -0
- package/esm/enable-if.js +24 -0
- package/esm/index.js +29 -0
- package/esm/orchestrator.js +451 -0
- package/esm/plugins/use-envelop.js +13 -0
- package/esm/plugins/use-error-handler.js +21 -0
- package/esm/plugins/use-extend-context.js +9 -0
- package/esm/plugins/use-immediate-introspection.js +50 -0
- package/esm/plugins/use-logger.js +45 -0
- package/esm/plugins/use-masked-errors.js +90 -0
- package/esm/plugins/use-payload-formatter.js +21 -0
- package/esm/plugins/use-schema.js +29 -0
- package/esm/plugins/use-timing.js +138 -0
- package/esm/traced-orchestrator.js +134 -0
- package/esm/traced-schema.js +68 -0
- package/esm/utils.js +221 -0
- package/package.json +33 -12
- package/{create.d.ts → typings/create.d.ts} +1 -1
- package/{enable-if.d.ts → typings/enable-if.d.ts} +0 -0
- package/typings/index.d.ts +13 -0
- package/{orchestrator.d.ts → typings/orchestrator.d.ts} +0 -0
- package/{plugins → typings/plugins}/use-envelop.d.ts +0 -0
- package/{plugins → typings/plugins}/use-error-handler.d.ts +0 -0
- package/{plugins → typings/plugins}/use-extend-context.d.ts +0 -0
- package/{plugins → typings/plugins}/use-immediate-introspection.d.ts +0 -0
- package/{plugins → typings/plugins}/use-logger.d.ts +1 -1
- package/{plugins → typings/plugins}/use-masked-errors.d.ts +3 -3
- package/{plugins → typings/plugins}/use-payload-formatter.d.ts +0 -0
- package/{plugins → typings/plugins}/use-schema.d.ts +0 -0
- package/{plugins → typings/plugins}/use-timing.d.ts +2 -2
- package/{traced-orchestrator.d.ts → typings/traced-orchestrator.d.ts} +1 -1
- package/{traced-schema.d.ts → typings/traced-schema.d.ts} +0 -0
- package/{utils.d.ts → typings/utils.d.ts} +0 -13
- package/README.md +0 -15
- package/index.d.ts +0 -13
- package/index.js +0 -1359
- package/index.mjs +0 -1317
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetEnvelopedFn, ComposeContext, Plugin } from '@envelop/types';
|
|
2
|
-
import { PluginOrDisabledPlugin } from './enable-if';
|
|
2
|
+
import { PluginOrDisabledPlugin } from './enable-if.js';
|
|
3
3
|
export declare function envelop<PluginsType extends Plugin<any>[]>(options: {
|
|
4
4
|
plugins: Array<PluginOrDisabledPlugin>;
|
|
5
5
|
enableInternalTracing?: boolean;
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from '@envelop/types';
|
|
2
|
+
export * from './create.js';
|
|
3
|
+
export * from './utils.js';
|
|
4
|
+
export * from './plugins/use-envelop.js';
|
|
5
|
+
export * from './plugins/use-logger.js';
|
|
6
|
+
export * from './plugins/use-timing.js';
|
|
7
|
+
export * from './plugins/use-schema.js';
|
|
8
|
+
export * from './plugins/use-error-handler.js';
|
|
9
|
+
export * from './plugins/use-extend-context.js';
|
|
10
|
+
export * from './plugins/use-payload-formatter.js';
|
|
11
|
+
export * from './plugins/use-masked-errors.js';
|
|
12
|
+
export * from './plugins/use-immediate-introspection.js';
|
|
13
|
+
export * from './enable-if.js';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Plugin } from '@envelop/types';
|
|
2
|
-
import { GraphQLError } from 'graphql';
|
|
2
|
+
import { GraphQLError, GraphQLErrorExtensions } from 'graphql';
|
|
3
3
|
export declare const DEFAULT_ERROR_MESSAGE = "Unexpected error.";
|
|
4
4
|
export declare class EnvelopError extends GraphQLError {
|
|
5
|
-
constructor(message: string, extensions?:
|
|
5
|
+
constructor(message: string, extensions?: GraphQLErrorExtensions);
|
|
6
6
|
}
|
|
7
7
|
export declare type FormatErrorHandler = (error: GraphQLError | unknown, message: string, isDev: boolean) => GraphQLError;
|
|
8
8
|
export declare const formatError: FormatErrorHandler;
|
|
@@ -36,4 +36,4 @@ export declare type UseMaskedErrorsOpts = {
|
|
|
36
36
|
*/
|
|
37
37
|
handleValidationErrors?: boolean;
|
|
38
38
|
};
|
|
39
|
-
export declare const useMaskedErrors: (opts?: UseMaskedErrorsOpts
|
|
39
|
+
export declare const useMaskedErrors: (opts?: UseMaskedErrorsOpts) => Plugin;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from '@envelop/types';
|
|
2
2
|
import { DocumentNode, ExecutionArgs, GraphQLResolveInfo, Source, SubscriptionArgs } from 'graphql';
|
|
3
|
-
import { envelopIsIntrospectionSymbol } from '../utils';
|
|
3
|
+
import { envelopIsIntrospectionSymbol } from '../utils.js';
|
|
4
4
|
export declare type ResultTiming = {
|
|
5
5
|
ms: number;
|
|
6
6
|
ns: number;
|
|
@@ -17,5 +17,5 @@ export declare type TimingPluginOptions = {
|
|
|
17
17
|
declare type InternalPluginContext = {
|
|
18
18
|
[envelopIsIntrospectionSymbol]?: true;
|
|
19
19
|
};
|
|
20
|
-
export declare const useTiming: (rawOptions?: TimingPluginOptions
|
|
20
|
+
export declare const useTiming: (rawOptions?: TimingPluginOptions) => Plugin<InternalPluginContext>;
|
|
21
21
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ArbitraryObject } from '@envelop/types';
|
|
2
|
-
import { EnvelopOrchestrator } from './orchestrator';
|
|
2
|
+
import { EnvelopOrchestrator } from './orchestrator.js';
|
|
3
3
|
declare const tracingSymbol: unique symbol;
|
|
4
4
|
export declare function traceOrchestrator<TInitialContext extends ArbitraryObject, TPluginsContext extends ArbitraryObject>(orchestrator: EnvelopOrchestrator<TInitialContext, TPluginsContext>): EnvelopOrchestrator<TInitialContext & {
|
|
5
5
|
[tracingSymbol]?: {};
|
|
File without changes
|
|
@@ -31,16 +31,3 @@ export declare function isAsyncIterable<TType>(maybeAsyncIterable: unknown): may
|
|
|
31
31
|
export declare function handleStreamOrSingleExecutionResult<ContextType = DefaultContext>(payload: OnExecuteDoneEventPayload<ContextType>, fn: OnExecuteDoneHookResultOnNextHook<ContextType>): void | OnExecuteDoneHookResult<ContextType>;
|
|
32
32
|
export declare function finalAsyncIterator<TInput>(source: AsyncIterable<TInput>, onFinal: () => void): AsyncGenerator<TInput>;
|
|
33
33
|
export declare function errorAsyncIterator<TInput>(source: AsyncIterable<TInput>, onError: (err: unknown) => void): AsyncGenerator<TInput>;
|
|
34
|
-
export interface BasicCache<V> {
|
|
35
|
-
get(key: string): V | undefined;
|
|
36
|
-
set(key: string, value: V): void;
|
|
37
|
-
delete(key: string): void;
|
|
38
|
-
clear?: () => void;
|
|
39
|
-
}
|
|
40
|
-
export declare function getInMemoryLRUCache<V>({ max, onDelete, }?: {
|
|
41
|
-
max?: number;
|
|
42
|
-
onDelete?: (key: string, value: V) => void;
|
|
43
|
-
}): BasicCache<V> & {
|
|
44
|
-
clear(): void;
|
|
45
|
-
};
|
|
46
|
-
export declare function isSourceObject(maybeSource: any): maybeSource is Source;
|
package/README.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
## `@envelop/core`
|
|
2
|
-
|
|
3
|
-
This is the core package for Envelop. You can find a complete documentation here: https://github.com/dotansimha/envelop
|
|
4
|
-
|
|
5
|
-
### Built-in plugins
|
|
6
|
-
|
|
7
|
-
- [`useSchema`](./docs/use-schema.md)
|
|
8
|
-
- [`useAsyncSchema`](./docs/use-async-schema.md)
|
|
9
|
-
- [`useLazyLoadedSchema`](./docs/use-lazy-loaded-schema.md)
|
|
10
|
-
- [`useErrorHandler`](./docs/use-error-handler.md)
|
|
11
|
-
- [`useExtendContext`](./docs/use-extend-context.md)
|
|
12
|
-
- [`useLogger`](./docs/use-logger.md)
|
|
13
|
-
- [`useMaskedErrors`](./docs/use-masked-errors.md)
|
|
14
|
-
- [`usePayloadFormatter`](./docs/use-payload-formatter.md)
|
|
15
|
-
- [`useTiming`](./docs/use-timing.md)
|
package/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from '@envelop/types';
|
|
2
|
-
export * from './create';
|
|
3
|
-
export * from './utils';
|
|
4
|
-
export * from './plugins/use-envelop';
|
|
5
|
-
export * from './plugins/use-logger';
|
|
6
|
-
export * from './plugins/use-timing';
|
|
7
|
-
export * from './plugins/use-schema';
|
|
8
|
-
export * from './plugins/use-error-handler';
|
|
9
|
-
export * from './plugins/use-extend-context';
|
|
10
|
-
export * from './plugins/use-payload-formatter';
|
|
11
|
-
export * from './plugins/use-masked-errors';
|
|
12
|
-
export * from './plugins/use-immediate-introspection';
|
|
13
|
-
export * from './enable-if';
|