@secrecy/lib 1.0.0-dev.63 → 1.0.0-dev.65
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/BaseClient-15fdf493.d.ts +351 -0
- package/dist/BaseClient.cjs +2 -0
- package/dist/BaseClient.cjs.map +1 -0
- package/dist/BaseClient.d.ts +16 -104
- package/dist/BaseClient.js +2 -482
- package/dist/BaseClient.js.map +1 -0
- package/dist/PopupTools.cjs +2 -0
- package/dist/PopupTools.cjs.map +1 -0
- package/dist/PopupTools.d.ts +5 -4
- package/dist/PopupTools.js +2 -216
- package/dist/PopupTools.js.map +1 -0
- package/dist/ZeusThunder.cjs +2 -0
- package/dist/ZeusThunder.cjs.map +1 -0
- package/dist/ZeusThunder.d.ts +6 -2
- package/dist/ZeusThunder.js +2 -79
- package/dist/ZeusThunder.js.map +1 -0
- package/dist/cache.cjs +2 -0
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.ts +22 -4
- package/dist/cache.js +2 -4
- package/dist/cache.js.map +1 -0
- package/dist/chunk-5WPCTUWH.cjs +2 -0
- package/dist/chunk-5WPCTUWH.cjs.map +1 -0
- package/dist/chunk-KMTF2BZE.js +2 -0
- package/dist/chunk-KMTF2BZE.js.map +1 -0
- package/dist/client/SecrecyAppClient.cjs +2 -0
- package/dist/client/SecrecyAppClient.cjs.map +1 -0
- package/dist/client/SecrecyAppClient.d.ts +16 -17
- package/dist/client/SecrecyAppClient.js +2 -256
- package/dist/client/SecrecyAppClient.js.map +1 -0
- package/dist/client/SecrecyCloudClient.cjs +2 -0
- package/dist/client/SecrecyCloudClient.cjs.map +1 -0
- package/dist/client/SecrecyCloudClient.d.ts +16 -89
- package/dist/client/SecrecyCloudClient.js +2 -1627
- package/dist/client/SecrecyCloudClient.js.map +1 -0
- package/dist/client/SecrecyDbClient.cjs +2 -0
- package/dist/client/SecrecyDbClient.cjs.map +1 -0
- package/dist/client/SecrecyDbClient.d.ts +16 -21
- package/dist/client/SecrecyDbClient.js +2 -198
- package/dist/client/SecrecyDbClient.js.map +1 -0
- package/dist/client/SecrecyMailClient.cjs +2 -0
- package/dist/client/SecrecyMailClient.cjs.map +1 -0
- package/dist/client/SecrecyMailClient.d.ts +16 -42
- package/dist/client/SecrecyMailClient.js +2 -1187
- package/dist/client/SecrecyMailClient.js.map +1 -0
- package/dist/client/SecrecyPayClient.cjs +2 -0
- package/dist/client/SecrecyPayClient.cjs.map +1 -0
- package/dist/client/SecrecyPayClient.d.ts +16 -7
- package/dist/client/SecrecyPayClient.js +2 -37
- package/dist/client/SecrecyPayClient.js.map +1 -0
- package/dist/client/SecrecyWalletClient.cjs +2 -0
- package/dist/client/SecrecyWalletClient.cjs.map +1 -0
- package/dist/client/SecrecyWalletClient.d.ts +16 -30
- package/dist/client/SecrecyWalletClient.js +2 -76
- package/dist/client/SecrecyWalletClient.js.map +1 -0
- package/dist/client/convert/file.cjs +2 -0
- package/dist/client/convert/file.cjs.map +1 -0
- package/dist/client/convert/file.d.ts +11 -5
- package/dist/client/convert/file.js +2 -34
- package/dist/client/convert/file.js.map +1 -0
- package/dist/client/convert/mail.cjs +2 -0
- package/dist/client/convert/mail.cjs.map +1 -0
- package/dist/client/convert/mail.d.ts +13 -3
- package/dist/client/convert/mail.js +2 -48
- package/dist/client/convert/mail.js.map +1 -0
- package/dist/client/convert/node.cjs +2 -0
- package/dist/client/convert/node.cjs.map +1 -0
- package/dist/client/convert/node.d.ts +18 -9
- package/dist/client/convert/node.js +2 -100
- package/dist/client/convert/node.js.map +1 -0
- package/dist/client/helpers.cjs +2 -0
- package/dist/client/helpers.cjs.map +1 -0
- package/dist/client/helpers.d.ts +16 -28
- package/dist/client/helpers.js +2 -126
- package/dist/client/helpers.js.map +1 -0
- package/dist/client/index.cjs +2 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.ts +16 -34
- package/dist/client/index.js +2 -52
- package/dist/client/index.js.map +1 -0
- package/dist/client/storage.cjs +2 -0
- package/dist/client/storage.cjs.map +1 -0
- package/dist/client/storage.d.ts +6 -3
- package/dist/client/storage.js +2 -12
- package/dist/client/storage.js.map +1 -0
- package/dist/client/types/File.cjs +1 -0
- package/dist/client/types/File.cjs.map +1 -0
- package/dist/client/types/File.d.ts +9 -5
- package/dist/client/types/File.js +1 -3
- package/dist/client/types/File.js.map +1 -0
- package/dist/client/types/Inputs.cjs +1 -0
- package/dist/client/types/Inputs.cjs.map +1 -0
- package/dist/client/types/Inputs.d.ts +6 -4
- package/dist/client/types/Inputs.js +1 -3
- package/dist/client/types/Inputs.js.map +1 -0
- package/dist/client/types/Node.cjs +1 -0
- package/dist/client/types/Node.cjs.map +1 -0
- package/dist/client/types/Node.d.ts +9 -56
- package/dist/client/types/Node.js +1 -3
- package/dist/client/types/Node.js.map +1 -0
- package/dist/client/types/UserAppNotifications.cjs +1 -0
- package/dist/client/types/UserAppNotifications.cjs.map +1 -0
- package/dist/client/types/UserAppNotifications.d.ts +3 -1
- package/dist/client/types/UserAppNotifications.js +1 -3
- package/dist/client/types/UserAppNotifications.js.map +1 -0
- package/dist/client/types/UserAppSettings.cjs +1 -0
- package/dist/client/types/UserAppSettings.cjs.map +1 -0
- package/dist/client/types/UserAppSettings.d.ts +3 -1
- package/dist/client/types/UserAppSettings.js +1 -3
- package/dist/client/types/UserAppSettings.js.map +1 -0
- package/dist/client/types/index.cjs +2 -0
- package/dist/client/types/index.cjs.map +1 -0
- package/dist/client/types/index.d.ts +86 -30
- package/dist/client/types/index.js +2 -8
- package/dist/client/types/index.js.map +1 -0
- package/dist/client/types/selectors.cjs +2 -0
- package/dist/client/types/selectors.cjs.map +1 -0
- package/dist/client/types/selectors.d.ts +7 -5
- package/dist/client/types/selectors.js +2 -138
- package/dist/client/types/selectors.js.map +1 -0
- package/dist/crypto/file.cjs +2 -0
- package/dist/crypto/file.cjs.map +1 -0
- package/dist/crypto/file.d.ts +8 -6
- package/dist/crypto/file.js +2 -210
- package/dist/crypto/file.js.map +1 -0
- package/dist/crypto/index.cjs +2 -0
- package/dist/crypto/index.cjs.map +1 -0
- package/dist/crypto/index.d.ts +11 -9
- package/dist/crypto/index.js +2 -47
- package/dist/crypto/index.js.map +1 -0
- package/dist/error.cjs +1 -0
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.ts +12 -10
- package/dist/error.js +1 -3
- package/dist/error.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +19 -11
- package/dist/index.js +2 -9
- package/dist/index.js.map +1 -0
- package/dist/minify/index.cjs +2 -0
- package/dist/minify/index.cjs.map +1 -0
- package/dist/minify/index.d.ts +4 -2
- package/dist/minify/index.js +2 -28
- package/dist/minify/index.js.map +1 -0
- package/dist/minify/lz4.cjs +3 -0
- package/dist/minify/lz4.cjs.map +1 -0
- package/dist/minify/lz4.d.ts +7 -5
- package/dist/minify/lz4.js +3 -627
- package/dist/minify/lz4.js.map +1 -0
- package/dist/sodium.cjs +2 -0
- package/dist/sodium.cjs.map +1 -0
- package/dist/sodium.d.ts +5 -3
- package/dist/sodium.js +2 -6
- package/dist/sodium.js.map +1 -0
- package/dist/utils/store-buddy.cjs +2 -0
- package/dist/utils/store-buddy.cjs.map +1 -0
- package/dist/utils/store-buddy.d.ts +4 -3
- package/dist/utils/store-buddy.js +2 -65
- package/dist/utils/store-buddy.js.map +1 -0
- package/dist/utils/time.cjs +2 -0
- package/dist/utils/time.cjs.map +1 -0
- package/dist/utils/time.d.ts +4 -2
- package/dist/utils/time.js +2 -14
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/utils.cjs +2 -0
- package/dist/utils/utils.cjs.map +1 -0
- package/dist/utils/utils.d.ts +6 -4
- package/dist/utils/utils.js +2 -57
- package/dist/utils/utils.js.map +1 -0
- package/dist/worker/md5.cjs +2 -0
- package/dist/worker/md5.cjs.map +1 -0
- package/dist/worker/md5.d.ts +3 -1
- package/dist/worker/md5.js +2 -25
- package/dist/worker/md5.js.map +1 -0
- package/dist/worker/sodium.cjs +2 -0
- package/dist/worker/sodium.cjs.map +1 -0
- package/dist/worker/sodium.d.ts +6 -3
- package/dist/worker/sodium.js +2 -120
- package/dist/worker/sodium.js.map +1 -0
- package/dist/worker/workerCodes.cjs +254 -0
- package/dist/worker/workerCodes.cjs.map +1 -0
- package/dist/worker/workerCodes.d.ts +4 -2
- package/dist/worker/workerCodes.js +4 -5
- package/dist/worker/workerCodes.js.map +1 -0
- package/dist/zeus/const.cjs +2 -0
- package/dist/zeus/const.cjs.map +1 -0
- package/dist/zeus/const.d.ts +5 -3
- package/dist/zeus/const.js +2 -1286
- package/dist/zeus/const.js.map +1 -0
- package/dist/zeus/index.cjs +5 -0
- package/dist/zeus/index.cjs.map +1 -0
- package/dist/zeus/index.d.ts +80 -78
- package/dist/zeus/index.js +5 -687
- package/dist/zeus/index.js.map +1 -0
- package/package.json +27 -30
package/dist/zeus/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Ops } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Ops } from './const.js';
|
|
2
|
+
|
|
3
|
+
declare const HOST = "http://localhost:4000/graphql";
|
|
4
|
+
declare const HEADERS: {};
|
|
5
|
+
declare const apiSubscription: (options: chainOptions) => (query: string) => {
|
|
5
6
|
ws: WebSocket;
|
|
6
7
|
on: (e: (args: any) => void) => void;
|
|
7
8
|
off: (e: (args: any) => void) => void;
|
|
8
9
|
error: (e: (args: any) => void) => void;
|
|
9
10
|
open: (e: () => void) => void;
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
declare const apiFetch: (options: [input: URL | RequestInfo, init?: RequestInit | undefined]) => (query: string, variables?: Record<string, unknown>) => Promise<Record<string, any> | undefined>;
|
|
13
|
+
declare const InternalsBuildQuery: ({ ops, props, returns, options, scalars }: {
|
|
13
14
|
props: AllTypesPropsType;
|
|
14
15
|
returns: ReturnTypesType;
|
|
15
16
|
ops: Operations;
|
|
@@ -19,30 +20,30 @@ export declare const InternalsBuildQuery: ({ ops, props, returns, options, scala
|
|
|
19
20
|
name: string;
|
|
20
21
|
graphQLType: string;
|
|
21
22
|
}>) => string;
|
|
22
|
-
|
|
23
|
+
declare const Thunder: (fn: FetchFunction) => <O extends "query" | "mutation" | "subscription", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z | ValueTypes[R], ops?: OperationOptions & {
|
|
23
24
|
variables?: Record<string, unknown>;
|
|
24
25
|
}) => Promise<InputType<GraphQLTypes[R], Z, SCLR>>;
|
|
25
|
-
|
|
26
|
+
declare const Chain: (...options: chainOptions) => <O extends "query" | "mutation" | "subscription", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z | ValueTypes[R], ops?: OperationOptions & {
|
|
26
27
|
variables?: Record<string, unknown>;
|
|
27
28
|
}) => Promise<InputType<GraphQLTypes[R], Z, SCLR>>;
|
|
28
|
-
|
|
29
|
+
declare const SubscriptionThunder: (fn: SubscriptionFunction) => <O extends "query" | "mutation" | "subscription", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z | ValueTypes[R], ops?: (OperationOptions & {
|
|
29
30
|
variables?: ExtractVariables<Z> | undefined;
|
|
30
31
|
}) | undefined) => SubscriptionToGraphQL<Z, GraphQLTypes[R], SCLR>;
|
|
31
|
-
|
|
32
|
+
declare const Subscription: (...options: chainOptions) => <O extends "query" | "mutation" | "subscription", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z | ValueTypes[R], ops?: (OperationOptions & {
|
|
32
33
|
variables?: ExtractVariables<Z> | undefined;
|
|
33
34
|
}) | undefined) => SubscriptionToGraphQL<Z, GraphQLTypes[R], SCLR>;
|
|
34
|
-
|
|
35
|
+
declare const Zeus: <Z extends ValueTypes[R], O extends "query" | "mutation" | "subscription", R extends keyof ValueTypes = GenericOperation<O>>(operation: O, o: Z | ValueTypes[R], ops?: {
|
|
35
36
|
operationOptions?: OperationOptions;
|
|
36
37
|
scalars?: ScalarDefinition;
|
|
37
38
|
}) => string;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
declare const ZeusSelect: <T>() => SelectionFunction<T>;
|
|
40
|
+
declare const Selector: <T extends keyof ValueTypes>(key: T) => SelectionFunction<ValueTypes[T]>;
|
|
41
|
+
declare const TypeFromSelector: <T extends keyof ValueTypes>(key: T) => SelectionFunction<ValueTypes[T]>;
|
|
42
|
+
declare const Gql: <O extends "query" | "mutation" | "subscription", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z | ValueTypes[R], ops?: OperationOptions & {
|
|
42
43
|
variables?: Record<string, unknown>;
|
|
43
44
|
}) => Promise<InputType<GraphQLTypes[R], Z, SCLR>>;
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
declare const ZeusScalars: SelectionFunction<ScalarCoders>;
|
|
46
|
+
declare const decodeScalarsInResponse: <O extends Operations>({ response, scalars, returns, ops, initialZeusQuery, initialOp }: {
|
|
46
47
|
ops: O;
|
|
47
48
|
response: any;
|
|
48
49
|
returns: ReturnTypesType;
|
|
@@ -50,7 +51,7 @@ export declare const decodeScalarsInResponse: <O extends Operations>({ response,
|
|
|
50
51
|
initialOp: keyof O;
|
|
51
52
|
initialZeusQuery: InputValueType | VType;
|
|
52
53
|
}) => any;
|
|
53
|
-
|
|
54
|
+
declare const traverseResponse: ({ resolvers, scalarPaths }: {
|
|
54
55
|
scalarPaths: {
|
|
55
56
|
[x: string]: `scalar.${string}`;
|
|
56
57
|
};
|
|
@@ -58,68 +59,68 @@ export declare const traverseResponse: ({ resolvers, scalarPaths }: {
|
|
|
58
59
|
[x: string]: ScalarResolver | undefined;
|
|
59
60
|
};
|
|
60
61
|
}) => (k: string, o: InputValueType | VType, p?: string[]) => unknown;
|
|
61
|
-
|
|
62
|
+
declare type AllTypesPropsType = {
|
|
62
63
|
[x: string]: undefined | `scalar.${string}` | "enum" | {
|
|
63
64
|
[x: string]: undefined | string | {
|
|
64
65
|
[x: string]: string | undefined;
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
+
declare type ReturnTypesType = {
|
|
69
70
|
[x: string]: {
|
|
70
71
|
[x: string]: string | undefined;
|
|
71
72
|
} | `scalar.${string}` | undefined;
|
|
72
73
|
};
|
|
73
|
-
|
|
74
|
+
declare type InputValueType = {
|
|
74
75
|
[x: string]: undefined | boolean | string | number | [any, undefined | boolean | InputValueType] | InputValueType;
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
declare type VType = undefined | boolean | string | number | [any, undefined | boolean | InputValueType] | InputValueType;
|
|
78
|
+
declare type PlainType = boolean | number | string | null | undefined;
|
|
79
|
+
declare type ZeusArgsType = PlainType | {
|
|
79
80
|
[x: string]: ZeusArgsType;
|
|
80
81
|
} | Array<ZeusArgsType>;
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
declare type Operations = Record<string, string>;
|
|
83
|
+
declare type VariableDefinition = {
|
|
83
84
|
[x: string]: unknown;
|
|
84
85
|
};
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
declare const SEPARATOR = "|";
|
|
87
|
+
declare type fetchOptions = Parameters<typeof fetch>;
|
|
87
88
|
declare type websocketOptions = typeof WebSocket extends new (...args: infer R) => WebSocket ? R : never;
|
|
88
|
-
|
|
89
|
+
declare type chainOptions = [fetchOptions[0], fetchOptions[1] & {
|
|
89
90
|
websocket?: websocketOptions;
|
|
90
91
|
}] | [fetchOptions[0]];
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
declare type FetchFunction = (query: string, variables?: Record<string, unknown>) => Promise<any>;
|
|
93
|
+
declare type SubscriptionFunction = (query: string) => any;
|
|
93
94
|
declare type NotUndefined<T> = T extends undefined ? never : T;
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
declare type ResolverType<F> = NotUndefined<F extends [infer ARGS, any] ? ARGS : undefined>;
|
|
96
|
+
declare type OperationOptions = {
|
|
96
97
|
operationName?: string;
|
|
97
98
|
};
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
declare type ScalarCoder = Record<string, (s: unknown) => string>;
|
|
100
|
+
interface GraphQLResponse {
|
|
100
101
|
data?: Record<string, any>;
|
|
101
102
|
errors?: Array<{
|
|
102
103
|
message: string;
|
|
103
104
|
}>;
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
+
declare class GraphQLError extends Error {
|
|
106
107
|
response: GraphQLResponse;
|
|
107
108
|
constructor(response: GraphQLResponse);
|
|
108
109
|
toString(): string;
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
declare type GenericOperation<O> = O extends keyof typeof Ops ? typeof Ops[O] : never;
|
|
112
|
+
declare type ThunderGraphQLOptions<SCLR extends ScalarDefinition> = {
|
|
112
113
|
scalars?: SCLR | ScalarCoders;
|
|
113
114
|
};
|
|
114
|
-
|
|
115
|
+
declare const PrepareScalarPaths: ({ ops, returns }: {
|
|
115
116
|
returns: ReturnTypesType;
|
|
116
117
|
ops: Operations;
|
|
117
118
|
}) => (k: string, originalKey: string, o: InputValueType | VType, p?: string[], pOriginals?: string[], root?: boolean) => {
|
|
118
119
|
[x: string]: `scalar.${string}`;
|
|
119
120
|
} | undefined;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
declare const purifyGraphQLKey: (k: string) => string;
|
|
122
|
+
declare const ResolveFromPath: (props: AllTypesPropsType, returns: ReturnTypesType, ops: Operations) => (path: string) => "enum" | "not" | `scalar.${string}`;
|
|
123
|
+
declare const InternalArgsBuilt: ({ props, ops, returns, scalars, vars }: {
|
|
123
124
|
props: AllTypesPropsType;
|
|
124
125
|
returns: ReturnTypesType;
|
|
125
126
|
ops: Operations;
|
|
@@ -129,22 +130,22 @@ export declare const InternalArgsBuilt: ({ props, ops, returns, scalars, vars }:
|
|
|
129
130
|
graphQLType: string;
|
|
130
131
|
}>;
|
|
131
132
|
}) => (a: ZeusArgsType, p?: string, root?: boolean) => string;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
declare const resolverFor: <X, T extends keyof ResolverInputTypes, Z extends keyof ResolverInputTypes[T]>(_type: T, _field: Z, fn: (args: Required<ResolverInputTypes[T]>[Z] extends [infer Input, any] ? Input : any, source: any) => Z extends keyof ModelTypes[T] ? X | ModelTypes[T][Z] | Promise<ModelTypes[T][Z]> : any) => (args?: any, source?: any) => any;
|
|
134
|
+
declare type UnwrapPromise<T> = T extends Promise<infer R> ? R : T;
|
|
135
|
+
declare type ZeusState<T extends (...args: any[]) => Promise<any>> = NonNullable<UnwrapPromise<ReturnType<T>>>;
|
|
136
|
+
declare type ZeusHook<T extends (...args: any[]) => Record<string, (...args: any[]) => Promise<any>>, N extends keyof ReturnType<T>> = ZeusState<ReturnType<T>[N]>;
|
|
137
|
+
declare type WithTypeNameValue<T> = T & {
|
|
137
138
|
__typename?: boolean;
|
|
138
139
|
__directives?: string;
|
|
139
140
|
};
|
|
140
|
-
|
|
141
|
+
declare type AliasType<T> = WithTypeNameValue<T> & {
|
|
141
142
|
__alias?: Record<string, WithTypeNameValue<T>>;
|
|
142
143
|
};
|
|
143
144
|
declare type DeepAnify<T> = {
|
|
144
145
|
[P in keyof T]?: any;
|
|
145
146
|
};
|
|
146
147
|
declare type IsPayLoad<T> = T extends [any, infer PayLoad] ? PayLoad : T;
|
|
147
|
-
|
|
148
|
+
declare type ScalarDefinition = Record<string, ScalarResolver>;
|
|
148
149
|
declare type IsScalar<S, SCLR extends ScalarDefinition> = S extends "scalar" & {
|
|
149
150
|
name: infer T;
|
|
150
151
|
} ? T extends keyof SCLR ? SCLR[T]["decode"] extends (s: unknown) => unknown ? ReturnType<SCLR[T]["decode"]> : unknown : unknown : S;
|
|
@@ -162,13 +163,13 @@ declare type IsInterfaced<SRC extends DeepAnify<DST>, DST, SCLR extends ScalarDe
|
|
|
162
163
|
} : {
|
|
163
164
|
[P in keyof Pick<SRC, keyof DST>]: IsPayLoad<DST[P]> extends BaseZeusResolver ? IsScalar<SRC[P], SCLR> : IsArray<SRC[P], DST[P], SCLR>;
|
|
164
165
|
};
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
declare type MapType<SRC, DST, SCLR extends ScalarDefinition> = SRC extends DeepAnify<DST> ? IsInterfaced<SRC, DST, SCLR> : never;
|
|
167
|
+
declare type InputType<SRC, DST, SCLR extends ScalarDefinition = {}> = IsPayLoad<DST> extends {
|
|
167
168
|
__alias: infer R;
|
|
168
169
|
} ? {
|
|
169
170
|
[P in keyof R]: MapType<SRC, R[P], SCLR>[keyof MapType<SRC, R[P], SCLR>];
|
|
170
171
|
} & MapType<SRC, Omit<IsPayLoad<DST>, "__alias">, SCLR> : MapType<SRC, IsPayLoad<DST>, SCLR>;
|
|
171
|
-
|
|
172
|
+
declare type SubscriptionToGraphQL<Z, T, SCLR extends ScalarDefinition> = {
|
|
172
173
|
ws: WebSocket;
|
|
173
174
|
on: (fn: (args: InputType<T, Z, SCLR>) => void) => void;
|
|
174
175
|
off: (fn: (e: {
|
|
@@ -183,12 +184,12 @@ export declare type SubscriptionToGraphQL<Z, T, SCLR extends ScalarDefinition> =
|
|
|
183
184
|
}) => void) => void;
|
|
184
185
|
open: () => void;
|
|
185
186
|
};
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
declare type FromSelector<SELECTOR, NAME extends keyof GraphQLTypes, SCLR extends ScalarDefinition = {}> = InputType<GraphQLTypes[NAME], SELECTOR, SCLR>;
|
|
188
|
+
declare type ScalarResolver = {
|
|
188
189
|
encode?: (s: unknown) => string;
|
|
189
190
|
decode?: (s: unknown) => unknown;
|
|
190
191
|
};
|
|
191
|
-
|
|
192
|
+
declare type SelectionFunction<V> = <T>(t: T | V) => T;
|
|
192
193
|
declare type BuiltInVariableTypes = {
|
|
193
194
|
["String"]: string;
|
|
194
195
|
["Int"]: number;
|
|
@@ -199,11 +200,11 @@ declare type BuiltInVariableTypes = {
|
|
|
199
200
|
declare type AllVariableTypes = keyof BuiltInVariableTypes | keyof ZEUS_VARIABLES;
|
|
200
201
|
declare type VariableRequired<T extends string> = `${T}!` | T | `[${T}]` | `[${T}]!` | `[${T}!]` | `[${T}!]!`;
|
|
201
202
|
declare type VR<T extends string> = VariableRequired<VariableRequired<T>>;
|
|
202
|
-
|
|
203
|
+
declare type GraphQLVariableType = VR<AllVariableTypes>;
|
|
203
204
|
declare type ExtractVariableTypeString<T extends string> = T extends VR<infer R1> ? R1 extends VR<infer R2> ? R2 extends VR<infer R3> ? R3 extends VR<infer R4> ? R4 extends VR<infer R5> ? R5 : R4 : R3 : R2 : R1 : T;
|
|
204
205
|
declare type DecomposeType<T, Type> = T extends `[${infer R}]` ? Array<DecomposeType<R, Type>> | undefined : T extends `${infer R}!` ? NonNullable<DecomposeType<R, Type>> : Type | undefined;
|
|
205
206
|
declare type ExtractTypeFromGraphQLType<T extends string> = T extends keyof ZEUS_VARIABLES ? ZEUS_VARIABLES[T] : T extends keyof BuiltInVariableTypes ? BuiltInVariableTypes[T] : any;
|
|
206
|
-
|
|
207
|
+
declare type GetVariableType<T extends string> = DecomposeType<T, ExtractTypeFromGraphQLType<ExtractVariableTypeString<T>>>;
|
|
207
208
|
declare type UndefinedKeys<T> = {
|
|
208
209
|
[K in keyof T]-?: T[K] extends NonNullable<T[K]> ? never : K;
|
|
209
210
|
}[keyof T];
|
|
@@ -212,29 +213,29 @@ declare type WithNonNullableKeys<T> = Omit<T, UndefinedKeys<T>>;
|
|
|
212
213
|
declare type OptionalKeys<T> = {
|
|
213
214
|
[P in keyof T]?: T[P];
|
|
214
215
|
};
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
declare type WithOptionalNullables<T> = OptionalKeys<WithNullableKeys<T>> & WithNonNullableKeys<T>;
|
|
217
|
+
declare type Variable<T extends GraphQLVariableType, Name extends string> = {
|
|
217
218
|
" __zeus_name": Name;
|
|
218
219
|
" __zeus_type": T;
|
|
219
220
|
};
|
|
220
|
-
|
|
221
|
+
declare type ExtractVariables<Query> = Query extends Variable<infer VType, infer VName> ? {
|
|
221
222
|
[key in VName]: GetVariableType<VType>;
|
|
222
223
|
} : Query extends [infer Inputs, infer Outputs] ? ExtractVariables<Inputs> & ExtractVariables<Outputs> : Query extends string | number | boolean ? {} : UnionToIntersection<{
|
|
223
224
|
[K in keyof Query]: WithOptionalNullables<ExtractVariables<Query[K]>>;
|
|
224
225
|
}[keyof Query]>;
|
|
225
226
|
declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
declare const START_VAR_NAME = "$ZEUS_VAR";
|
|
228
|
+
declare const GRAPHQL_TYPE_SEPARATOR = "__$GRAPHQL__";
|
|
229
|
+
declare const $: <Type extends GraphQLVariableType, Name extends string>(name: Name, graphqlType: Type) => Variable<Type, Name>;
|
|
229
230
|
declare type ZEUS_INTERFACES = GraphQLTypes["ErrorBase"] | GraphQLTypes["FileContentBase"];
|
|
230
|
-
|
|
231
|
+
declare type ScalarCoders = {
|
|
231
232
|
BigInt?: ScalarResolver;
|
|
232
233
|
DateTime?: ScalarResolver;
|
|
233
234
|
Json?: ScalarResolver;
|
|
234
235
|
Bytes?: ScalarResolver;
|
|
235
236
|
};
|
|
236
237
|
declare type ZEUS_UNIONS = GraphQLTypes["AppNotificationsResult"] | GraphQLTypes["BlogResult"] | GraphQLTypes["DbConfigResult"] | GraphQLTypes["DbGetResult"] | GraphQLTypes["DbSearchResult"] | GraphQLTypes["DeletedMailsResult"] | GraphQLTypes["DeletedNodesResult"] | GraphQLTypes["FaqResult"] | GraphQLTypes["FileResult"] | GraphQLTypes["FileContentResult"] | GraphQLTypes["FilesContentResult"] | GraphQLTypes["GetJwtResult"] | GraphQLTypes["IsCryptoTransactionDoneResult"] | GraphQLTypes["LimitsResult"] | GraphQLTypes["MailResult"] | GraphQLTypes["MyCryptoBalanceResult"] | GraphQLTypes["NodeResult"] | GraphQLTypes["NodesSharedWithMeResult"] | GraphQLTypes["PaymentInfosResult"] | GraphQLTypes["PlansResult"] | GraphQLTypes["SharedNodesResult"] | GraphQLTypes["UnreadReceivedMailsCountResult"] | GraphQLTypes["UserResult"] | GraphQLTypes["UserListResult"] | GraphQLTypes["AddFileToHistoryResult"] | GraphQLTypes["CancelPaymentResult"] | GraphQLTypes["CreateApplicationResult"] | GraphQLTypes["CreateCryptoWalletResult"] | GraphQLTypes["CreateDraftMailResult"] | GraphQLTypes["CreateFolderResult"] | GraphQLTypes["DbConfigMutationResult"] | GraphQLTypes["DbSetResult"] | GraphQLTypes["DeleteDraftMailResult"] | GraphQLTypes["DeleteFileResult"] | GraphQLTypes["DeleteMailResult"] | GraphQLTypes["DeleteMailTrashResult"] | GraphQLTypes["DeleteNodeResult"] | GraphQLTypes["DeleteNodeCloudTrashResult"] | GraphQLTypes["DeleteNodeSharingResult"] | GraphQLTypes["DeleteUserResult"] | GraphQLTypes["DuplicateNodeResult"] | GraphQLTypes["EmptyCloudTrashResult"] | GraphQLTypes["EmptyMailTrashResult"] | GraphQLTypes["LogoutResult"] | GraphQLTypes["MoveNodesResult"] | GraphQLTypes["PayResult"] | GraphQLTypes["ReadMailResult"] | GraphQLTypes["RecoverMailResult"] | GraphQLTypes["RecoverNodeResult"] | GraphQLTypes["SaveInCloudResult"] | GraphQLTypes["SendAppMailResult"] | GraphQLTypes["SendCryptoTransactionResult"] | GraphQLTypes["SendDraftMailResult"] | GraphQLTypes["SendOneMailResult"] | GraphQLTypes["SendReportResult"] | GraphQLTypes["ShareFileInHistoryResult"] | GraphQLTypes["ShareNodeResult"] | GraphQLTypes["ShareNodeFinishResult"] | GraphQLTypes["UnreadMailResult"] | GraphQLTypes["UpdateAppNotificationsResult"] | GraphQLTypes["UpdateAppSettingsResult"] | GraphQLTypes["UpdateAutoDisconnectDelayResult"] | GraphQLTypes["UpdateDraftMailResult"] | GraphQLTypes["UpdateNodeResult"] | GraphQLTypes["UpdateProfileResult"] | GraphQLTypes["UploadFileResult"] | GraphQLTypes["UploadFileEndResult"] | GraphQLTypes["UploadFilePartEndResult"] | GraphQLTypes["UploadLiteFileResult"] | GraphQLTypes["ChangeUserPlanResult"] | GraphQLTypes["Error"] | GraphQLTypes["FileContent"];
|
|
237
|
-
|
|
238
|
+
declare type ValueTypes = {
|
|
238
239
|
["BigInt"]: unknown;
|
|
239
240
|
["DateTime"]: unknown;
|
|
240
241
|
["Json"]: unknown;
|
|
@@ -2007,7 +2008,7 @@ export declare type ValueTypes = {
|
|
|
2007
2008
|
__typename?: boolean | `@${string}`;
|
|
2008
2009
|
}>;
|
|
2009
2010
|
};
|
|
2010
|
-
|
|
2011
|
+
declare type ResolverInputTypes = {
|
|
2011
2012
|
["BigInt"]: unknown;
|
|
2012
2013
|
["DateTime"]: unknown;
|
|
2013
2014
|
["Json"]: unknown;
|
|
@@ -3756,7 +3757,7 @@ export declare type ResolverInputTypes = {
|
|
|
3756
3757
|
__typename?: boolean | `@${string}`;
|
|
3757
3758
|
}>;
|
|
3758
3759
|
};
|
|
3759
|
-
|
|
3760
|
+
declare type ModelTypes = {
|
|
3760
3761
|
["BigInt"]: any;
|
|
3761
3762
|
["DateTime"]: any;
|
|
3762
3763
|
["Json"]: any;
|
|
@@ -4649,7 +4650,7 @@ export declare type ModelTypes = {
|
|
|
4649
4650
|
test: boolean;
|
|
4650
4651
|
};
|
|
4651
4652
|
};
|
|
4652
|
-
|
|
4653
|
+
declare type GraphQLTypes = {
|
|
4653
4654
|
["BigInt"]: "scalar" & {
|
|
4654
4655
|
name: "BigInt";
|
|
4655
4656
|
};
|
|
@@ -6048,40 +6049,40 @@ export declare type GraphQLTypes = {
|
|
|
6048
6049
|
test: boolean;
|
|
6049
6050
|
};
|
|
6050
6051
|
};
|
|
6051
|
-
|
|
6052
|
+
declare enum Lang {
|
|
6052
6053
|
fr = "fr",
|
|
6053
6054
|
en = "en"
|
|
6054
6055
|
}
|
|
6055
|
-
|
|
6056
|
+
declare enum PlanKind {
|
|
6056
6057
|
free = "free",
|
|
6057
6058
|
basic = "basic",
|
|
6058
6059
|
advanced = "advanced",
|
|
6059
6060
|
pro = "pro"
|
|
6060
6061
|
}
|
|
6061
|
-
|
|
6062
|
+
declare enum UserRole {
|
|
6062
6063
|
user = "user",
|
|
6063
6064
|
admin = "admin"
|
|
6064
6065
|
}
|
|
6065
|
-
|
|
6066
|
+
declare enum MailType {
|
|
6066
6067
|
sent = "sent",
|
|
6067
6068
|
received = "received"
|
|
6068
6069
|
}
|
|
6069
|
-
|
|
6070
|
+
declare enum Rights {
|
|
6070
6071
|
admin = "admin",
|
|
6071
6072
|
write = "write",
|
|
6072
6073
|
read = "read"
|
|
6073
6074
|
}
|
|
6074
|
-
|
|
6075
|
+
declare enum NodeType {
|
|
6075
6076
|
FILE = "FILE",
|
|
6076
6077
|
FOLDER = "FOLDER"
|
|
6077
6078
|
}
|
|
6078
|
-
|
|
6079
|
+
declare enum FileContentType {
|
|
6079
6080
|
cloud = "cloud",
|
|
6080
6081
|
lite = "lite",
|
|
6081
6082
|
sent_mail = "sent_mail",
|
|
6082
6083
|
received_mail = "received_mail"
|
|
6083
6084
|
}
|
|
6084
|
-
|
|
6085
|
+
declare enum InfuraNetwork {
|
|
6085
6086
|
mainnet = "mainnet",
|
|
6086
6087
|
ropsten = "ropsten",
|
|
6087
6088
|
rinkeby = "rinkeby",
|
|
@@ -6090,7 +6091,7 @@ export declare enum InfuraNetwork {
|
|
|
6090
6091
|
polygon_mainnet = "polygon_mainnet",
|
|
6091
6092
|
polygon_mumbai = "polygon_mumbai"
|
|
6092
6093
|
}
|
|
6093
|
-
|
|
6094
|
+
declare enum PayInputType {
|
|
6094
6095
|
secure = "secure",
|
|
6095
6096
|
classic = "classic"
|
|
6096
6097
|
}
|
|
@@ -6116,4 +6117,5 @@ declare type ZEUS_VARIABLES = {
|
|
|
6116
6117
|
["ShareFileKeyInput"]: ValueTypes["ShareFileKeyInput"];
|
|
6117
6118
|
["ShareNodesInput"]: ValueTypes["ShareNodesInput"];
|
|
6118
6119
|
};
|
|
6119
|
-
|
|
6120
|
+
|
|
6121
|
+
export { $, AliasType, AllTypesPropsType, Chain, ExtractVariables, FetchFunction, FileContentType, FromSelector, GRAPHQL_TYPE_SEPARATOR, GenericOperation, GetVariableType, Gql, GraphQLError, GraphQLResponse, GraphQLTypes, GraphQLVariableType, HEADERS, HOST, InfuraNetwork, InputType, InputValueType, InternalArgsBuilt, InternalsBuildQuery, Lang, MailType, MapType, ModelTypes, NodeType, OperationOptions, Operations, PayInputType, PlainType, PlanKind, PrepareScalarPaths, ResolveFromPath, ResolverInputTypes, ResolverType, ReturnTypesType, Rights, SEPARATOR, START_VAR_NAME, ScalarCoder, ScalarCoders, ScalarDefinition, ScalarResolver, SelectionFunction, Selector, Subscription, SubscriptionFunction, SubscriptionThunder, SubscriptionToGraphQL, Thunder, ThunderGraphQLOptions, TypeFromSelector, UnwrapPromise, UserRole, VType, ValueTypes, Variable, VariableDefinition, WithOptionalNullables, WithTypeNameValue, Zeus, ZeusArgsType, ZeusHook, ZeusScalars, ZeusSelect, ZeusState, apiFetch, apiSubscription, chainOptions, decodeScalarsInResponse, fetchOptions, purifyGraphQLKey, resolverFor, traverseResponse };
|