@secrecy/lib 1.6.0 → 1.6.1
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-ca94a07f.d.ts +405 -0
- package/dist/BaseClient.cjs +2 -0
- package/dist/BaseClient.cjs.map +1 -0
- package/dist/BaseClient.d.ts +16 -111
- package/dist/BaseClient.js +2 -506
- 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 -195
- 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 -65
- 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/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 -226
- 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 -1405
- 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 -48
- package/dist/client/SecrecyDbClient.js +2 -419
- 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 -1022
- 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 -28
- package/dist/client/SecrecyPayClient.js +2 -68
- 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 -73
- 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 -33
- 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 -42
- 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 -87
- 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 -119
- 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 -46
- 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 -135
- 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 -195
- 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 -45
- 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 +13 -11
- 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 -14
- package/dist/index.js +2 -10
- 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 -23
- 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 +2 -538
- 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/encoders.cjs +2 -0
- package/dist/utils/encoders.cjs.map +1 -0
- package/dist/utils/encoders.d.ts +6 -4
- package/dist/utils/encoders.js +2 -18
- package/dist/utils/encoders.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 -58
- 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 -12
- 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 -47
- 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 -24
- 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 -118
- 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 -1846
- 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 +91 -89
- package/dist/zeus/index.js +5 -642
- package/dist/zeus/index.js.map +1 -0
- package/package.json +2 -2
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
|
+
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
|
+
type ReturnTypesType = {
|
|
69
70
|
[x: string]: {
|
|
70
71
|
[x: string]: string | undefined;
|
|
71
72
|
} | `scalar.${string}` | undefined;
|
|
72
73
|
};
|
|
73
|
-
|
|
74
|
+
type InputValueType = {
|
|
74
75
|
[x: string]: undefined | boolean | string | number | [any, undefined | boolean | InputValueType] | InputValueType;
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
type VType = undefined | boolean | string | number | [any, undefined | boolean | InputValueType] | InputValueType;
|
|
78
|
+
type PlainType = boolean | number | string | null | undefined;
|
|
79
|
+
type ZeusArgsType = PlainType | {
|
|
79
80
|
[x: string]: ZeusArgsType;
|
|
80
81
|
} | Array<ZeusArgsType>;
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
type Operations = Record<string, string>;
|
|
83
|
+
type VariableDefinition = {
|
|
83
84
|
[x: string]: unknown;
|
|
84
85
|
};
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
declare const SEPARATOR = "|";
|
|
87
|
+
type fetchOptions = Parameters<typeof fetch>;
|
|
87
88
|
type websocketOptions = typeof WebSocket extends new (...args: infer R) => WebSocket ? R : never;
|
|
88
|
-
|
|
89
|
+
type chainOptions = [fetchOptions[0], fetchOptions[1] & {
|
|
89
90
|
websocket?: websocketOptions;
|
|
90
91
|
}] | [fetchOptions[0]];
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
type FetchFunction = (query: string, variables?: Record<string, unknown>) => Promise<any>;
|
|
93
|
+
type SubscriptionFunction = (query: string) => any;
|
|
93
94
|
type NotUndefined<T> = T extends undefined ? never : T;
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
type ResolverType<F> = NotUndefined<F extends [infer ARGS, any] ? ARGS : undefined>;
|
|
96
|
+
type OperationOptions = {
|
|
96
97
|
operationName?: string;
|
|
97
98
|
};
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
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
|
+
type GenericOperation<O> = O extends keyof typeof Ops ? typeof Ops[O] : never;
|
|
112
|
+
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
|
+
type UnwrapPromise<T> = T extends Promise<infer R> ? R : T;
|
|
135
|
+
type ZeusState<T extends (...args: any[]) => Promise<any>> = NonNullable<UnwrapPromise<ReturnType<T>>>;
|
|
136
|
+
type ZeusHook<T extends (...args: any[]) => Record<string, (...args: any[]) => Promise<any>>, N extends keyof ReturnType<T>> = ZeusState<ReturnType<T>[N]>;
|
|
137
|
+
type WithTypeNameValue<T> = T & {
|
|
137
138
|
__typename?: boolean;
|
|
138
139
|
__directives?: string;
|
|
139
140
|
};
|
|
140
|
-
|
|
141
|
+
type AliasType<T> = WithTypeNameValue<T> & {
|
|
141
142
|
__alias?: Record<string, WithTypeNameValue<T>>;
|
|
142
143
|
};
|
|
143
144
|
type DeepAnify<T> = {
|
|
144
145
|
[P in keyof T]?: any;
|
|
145
146
|
};
|
|
146
147
|
type IsPayLoad<T> = T extends [any, infer PayLoad] ? PayLoad : T;
|
|
147
|
-
|
|
148
|
+
type ScalarDefinition = Record<string, ScalarResolver>;
|
|
148
149
|
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;
|
|
@@ -164,13 +165,13 @@ type IsInterfaced<SRC extends DeepAnify<DST>, DST, SCLR extends ScalarDefinition
|
|
|
164
165
|
} : {
|
|
165
166
|
[P in keyof Pick<SRC, keyof DST>]: IsPayLoad<DST[P]> extends BaseZeusResolver ? IsScalar<SRC[P], SCLR> : IsArray<SRC[P], DST[P], SCLR>;
|
|
166
167
|
};
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
type MapType<SRC, DST, SCLR extends ScalarDefinition> = SRC extends DeepAnify<DST> ? IsInterfaced<SRC, DST, SCLR> : never;
|
|
169
|
+
type InputType<SRC, DST, SCLR extends ScalarDefinition = {}> = IsPayLoad<DST> extends {
|
|
169
170
|
__alias: infer R;
|
|
170
171
|
} ? {
|
|
171
172
|
[P in keyof R]: MapType<SRC, R[P], SCLR>[keyof MapType<SRC, R[P], SCLR>];
|
|
172
173
|
} & MapType<SRC, Omit<IsPayLoad<DST>, "__alias">, SCLR> : MapType<SRC, IsPayLoad<DST>, SCLR>;
|
|
173
|
-
|
|
174
|
+
type SubscriptionToGraphQL<Z, T, SCLR extends ScalarDefinition> = {
|
|
174
175
|
ws: WebSocket;
|
|
175
176
|
on: (fn: (args: InputType<T, Z, SCLR>) => void) => void;
|
|
176
177
|
off: (fn: (e: {
|
|
@@ -185,12 +186,12 @@ export type SubscriptionToGraphQL<Z, T, SCLR extends ScalarDefinition> = {
|
|
|
185
186
|
}) => void) => void;
|
|
186
187
|
open: () => void;
|
|
187
188
|
};
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
type FromSelector<SELECTOR, NAME extends keyof GraphQLTypes, SCLR extends ScalarDefinition = {}> = InputType<GraphQLTypes[NAME], SELECTOR, SCLR>;
|
|
190
|
+
type ScalarResolver = {
|
|
190
191
|
encode?: (s: unknown) => string;
|
|
191
192
|
decode?: (s: unknown) => unknown;
|
|
192
193
|
};
|
|
193
|
-
|
|
194
|
+
type SelectionFunction<V> = <T>(t: T | V) => T;
|
|
194
195
|
type BuiltInVariableTypes = {
|
|
195
196
|
["String"]: string;
|
|
196
197
|
["Int"]: number;
|
|
@@ -201,11 +202,11 @@ type BuiltInVariableTypes = {
|
|
|
201
202
|
type AllVariableTypes = keyof BuiltInVariableTypes | keyof ZEUS_VARIABLES;
|
|
202
203
|
type VariableRequired<T extends string> = `${T}!` | T | `[${T}]` | `[${T}]!` | `[${T}!]` | `[${T}!]!`;
|
|
203
204
|
type VR<T extends string> = VariableRequired<VariableRequired<T>>;
|
|
204
|
-
|
|
205
|
+
type GraphQLVariableType = VR<AllVariableTypes>;
|
|
205
206
|
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;
|
|
206
207
|
type DecomposeType<T, Type> = T extends `[${infer R}]` ? Array<DecomposeType<R, Type>> | undefined : T extends `${infer R}!` ? NonNullable<DecomposeType<R, Type>> : Type | undefined;
|
|
207
208
|
type ExtractTypeFromGraphQLType<T extends string> = T extends keyof ZEUS_VARIABLES ? ZEUS_VARIABLES[T] : T extends keyof BuiltInVariableTypes ? BuiltInVariableTypes[T] : any;
|
|
208
|
-
|
|
209
|
+
type GetVariableType<T extends string> = DecomposeType<T, ExtractTypeFromGraphQLType<ExtractVariableTypeString<T>>>;
|
|
209
210
|
type UndefinedKeys<T> = {
|
|
210
211
|
[K in keyof T]-?: T[K] extends NonNullable<T[K]> ? never : K;
|
|
211
212
|
}[keyof T];
|
|
@@ -214,29 +215,29 @@ type WithNonNullableKeys<T> = Omit<T, UndefinedKeys<T>>;
|
|
|
214
215
|
type OptionalKeys<T> = {
|
|
215
216
|
[P in keyof T]?: T[P];
|
|
216
217
|
};
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
type WithOptionalNullables<T> = OptionalKeys<WithNullableKeys<T>> & WithNonNullableKeys<T>;
|
|
219
|
+
type Variable<T extends GraphQLVariableType, Name extends string> = {
|
|
219
220
|
" __zeus_name": Name;
|
|
220
221
|
" __zeus_type": T;
|
|
221
222
|
};
|
|
222
|
-
|
|
223
|
+
type ExtractVariables<Query> = Query extends Variable<infer VType, infer VName> ? {
|
|
223
224
|
[key in VName]: GetVariableType<VType>;
|
|
224
225
|
} : Query extends [infer Inputs, infer Outputs] ? ExtractVariables<Inputs> & ExtractVariables<Outputs> : Query extends string | number | boolean ? {} : UnionToIntersection<{
|
|
225
226
|
[K in keyof Query]: WithOptionalNullables<ExtractVariables<Query[K]>>;
|
|
226
227
|
}[keyof Query]>;
|
|
227
228
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
declare const START_VAR_NAME = "$ZEUS_VAR";
|
|
230
|
+
declare const GRAPHQL_TYPE_SEPARATOR = "__$GRAPHQL__";
|
|
231
|
+
declare const $: <Type extends GraphQLVariableType, Name extends string>(name: Name, graphqlType: Type) => Variable<Type, Name>;
|
|
231
232
|
type ZEUS_INTERFACES = GraphQLTypes["ErrorBase"] | GraphQLTypes["FileContentBase"];
|
|
232
|
-
|
|
233
|
+
type ScalarCoders = {
|
|
233
234
|
BigInt?: ScalarResolver;
|
|
234
235
|
DateTime?: ScalarResolver;
|
|
235
236
|
Json?: ScalarResolver;
|
|
236
237
|
Bytes?: ScalarResolver;
|
|
237
238
|
};
|
|
238
239
|
type ZEUS_UNIONS = GraphQLTypes["AppNotificationsResult"] | GraphQLTypes["ApplicationsResult"] | GraphQLTypes["BlogResult"] | GraphQLTypes["DbConfigResult"] | GraphQLTypes["DbGetResult"] | GraphQLTypes["DbGetDiffResult"] | 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["GetCardIdentificationResult"] | GraphQLTypes["GetStripeBalanceResult"] | GraphQLTypes["GetStripeBalanceTransactionResult"] | GraphQLTypes["GetStripeTransactionResult"] | GraphQLTypes["HasStripeAccountResult"] | GraphQLTypes["KycStripeCompletedResult"] | GraphQLTypes["GetAllStripeTransferResult"] | GraphQLTypes["GetStripeTransferResult"] | GraphQLTypes["GetAllStripePayoutResult"] | GraphQLTypes["GetStripePayoutResult"] | GraphQLTypes["GetAllPaymentRequestToCollectResult"] | GraphQLTypes["GetAllPaymentRequestToPayResult"] | GraphQLTypes["GetPaymentRequestToCollectResult"] | GraphQLTypes["GetPaymentRequestToPayResult"] | GraphQLTypes["IsValidPaymentIntentResult"] | GraphQLTypes["AddFileToHistoryResult"] | GraphQLTypes["CancelPaymentResult"] | GraphQLTypes["CreateCryptoWalletResult"] | GraphQLTypes["CreateDraftMailResult"] | GraphQLTypes["CreateFolderResult"] | GraphQLTypes["DbConfigMutationResult"] | GraphQLTypes["DbConfigToProdMutationResult"] | 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["CreateCardTokenResult"] | GraphQLTypes["CreateStripeTransferResult"] | GraphQLTypes["DeleteCardTokenResult"] | GraphQLTypes["StripeOnBoardingResult"] | GraphQLTypes["CancelStripePayoutResult"] | GraphQLTypes["CreateStripePayoutResult"] | GraphQLTypes["AddCartToPaymentIntentResult"] | GraphQLTypes["CancelPaymentIntentResult"] | GraphQLTypes["ConfirmPaymentIntentResult"] | GraphQLTypes["CreatePaymentIntentResult"] | GraphQLTypes["RenewAppCodeResult"] | GraphQLTypes["UpdateOriginUrlResult"] | GraphQLTypes["CreateApplicationResult"] | GraphQLTypes["DeleteApplicationResult"] | GraphQLTypes["EditColorsResult"] | GraphQLTypes["EditLogoResult"] | GraphQLTypes["EditNameResult"] | GraphQLTypes["AddDeveloperResult"] | GraphQLTypes["DeleteDeveloperResult"] | GraphQLTypes["EditDeveloperResult"] | GraphQLTypes["Error"] | GraphQLTypes["FileContent"];
|
|
239
|
-
|
|
240
|
+
type ValueTypes = {
|
|
240
241
|
["BigInt"]: unknown;
|
|
241
242
|
["DateTime"]: unknown;
|
|
242
243
|
["Json"]: unknown;
|
|
@@ -2798,7 +2799,7 @@ export type ValueTypes = {
|
|
|
2798
2799
|
__typename?: boolean | `@${string}`;
|
|
2799
2800
|
}>;
|
|
2800
2801
|
};
|
|
2801
|
-
|
|
2802
|
+
type ResolverInputTypes = {
|
|
2802
2803
|
["BigInt"]: unknown;
|
|
2803
2804
|
["DateTime"]: unknown;
|
|
2804
2805
|
["Json"]: unknown;
|
|
@@ -5339,7 +5340,7 @@ export type ResolverInputTypes = {
|
|
|
5339
5340
|
__typename?: boolean | `@${string}`;
|
|
5340
5341
|
}>;
|
|
5341
5342
|
};
|
|
5342
|
-
|
|
5343
|
+
type ModelTypes = {
|
|
5343
5344
|
["BigInt"]: any;
|
|
5344
5345
|
["DateTime"]: any;
|
|
5345
5346
|
["Json"]: any;
|
|
@@ -6583,7 +6584,7 @@ export type ModelTypes = {
|
|
|
6583
6584
|
test: boolean;
|
|
6584
6585
|
};
|
|
6585
6586
|
};
|
|
6586
|
-
|
|
6587
|
+
type GraphQLTypes = {
|
|
6587
6588
|
["BigInt"]: "scalar" & {
|
|
6588
6589
|
name: "BigInt";
|
|
6589
6590
|
};
|
|
@@ -8577,57 +8578,57 @@ export type GraphQLTypes = {
|
|
|
8577
8578
|
test: boolean;
|
|
8578
8579
|
};
|
|
8579
8580
|
};
|
|
8580
|
-
|
|
8581
|
+
declare enum Lang {
|
|
8581
8582
|
fr = "fr",
|
|
8582
8583
|
en = "en"
|
|
8583
8584
|
}
|
|
8584
|
-
|
|
8585
|
+
declare enum PlanKind {
|
|
8585
8586
|
free = "free",
|
|
8586
8587
|
basic = "basic",
|
|
8587
8588
|
advanced = "advanced",
|
|
8588
8589
|
pro = "pro"
|
|
8589
8590
|
}
|
|
8590
|
-
|
|
8591
|
+
declare enum UserRole {
|
|
8591
8592
|
user = "user",
|
|
8592
8593
|
admin = "admin"
|
|
8593
8594
|
}
|
|
8594
|
-
|
|
8595
|
+
declare enum MailType {
|
|
8595
8596
|
sent = "sent",
|
|
8596
8597
|
received = "received"
|
|
8597
8598
|
}
|
|
8598
|
-
|
|
8599
|
+
declare enum Rights {
|
|
8599
8600
|
admin = "admin",
|
|
8600
8601
|
write = "write",
|
|
8601
8602
|
read = "read"
|
|
8602
8603
|
}
|
|
8603
|
-
|
|
8604
|
+
declare enum NodeType {
|
|
8604
8605
|
FILE = "FILE",
|
|
8605
8606
|
FOLDER = "FOLDER"
|
|
8606
8607
|
}
|
|
8607
|
-
|
|
8608
|
+
declare enum PaymentMethod {
|
|
8608
8609
|
card = "card",
|
|
8609
8610
|
wire_transfer = "wire_transfer"
|
|
8610
8611
|
}
|
|
8611
|
-
|
|
8612
|
+
declare enum MongoDbConfigType {
|
|
8612
8613
|
current = "current",
|
|
8613
8614
|
next = "next"
|
|
8614
8615
|
}
|
|
8615
|
-
|
|
8616
|
+
declare enum MongoDbEnv {
|
|
8616
8617
|
dev = "dev",
|
|
8617
8618
|
prod = "prod"
|
|
8618
8619
|
}
|
|
8619
|
-
|
|
8620
|
+
declare enum MongoDbFieldDiffAction {
|
|
8620
8621
|
add = "add",
|
|
8621
8622
|
update = "update",
|
|
8622
8623
|
delete = "delete"
|
|
8623
8624
|
}
|
|
8624
|
-
|
|
8625
|
+
declare enum MongoDbFieldType {
|
|
8625
8626
|
string = "string",
|
|
8626
8627
|
number = "number",
|
|
8627
8628
|
boolean = "boolean",
|
|
8628
8629
|
object = "object"
|
|
8629
8630
|
}
|
|
8630
|
-
|
|
8631
|
+
declare enum SortByDate {
|
|
8631
8632
|
createdAt = "createdAt",
|
|
8632
8633
|
createdAt_asc = "createdAt_asc",
|
|
8633
8634
|
createdAt_desc = "createdAt_desc",
|
|
@@ -8635,13 +8636,13 @@ export declare enum SortByDate {
|
|
|
8635
8636
|
updatedAt_asc = "updatedAt_asc",
|
|
8636
8637
|
updatedAt_desc = "updatedAt_desc"
|
|
8637
8638
|
}
|
|
8638
|
-
|
|
8639
|
+
declare enum FileContentType {
|
|
8639
8640
|
cloud = "cloud",
|
|
8640
8641
|
lite = "lite",
|
|
8641
8642
|
sent_mail = "sent_mail",
|
|
8642
8643
|
received_mail = "received_mail"
|
|
8643
8644
|
}
|
|
8644
|
-
|
|
8645
|
+
declare enum InfuraNetwork {
|
|
8645
8646
|
mainnet = "mainnet",
|
|
8646
8647
|
ropsten = "ropsten",
|
|
8647
8648
|
rinkeby = "rinkeby",
|
|
@@ -8650,11 +8651,11 @@ export declare enum InfuraNetwork {
|
|
|
8650
8651
|
polygon_mainnet = "polygon_mainnet",
|
|
8651
8652
|
polygon_mumbai = "polygon_mumbai"
|
|
8652
8653
|
}
|
|
8653
|
-
|
|
8654
|
+
declare enum PayInputType {
|
|
8654
8655
|
secure = "secure",
|
|
8655
8656
|
classic = "classic"
|
|
8656
8657
|
}
|
|
8657
|
-
|
|
8658
|
+
declare enum CancellationReason {
|
|
8658
8659
|
abandoned = "abandoned",
|
|
8659
8660
|
automatic = "automatic",
|
|
8660
8661
|
duplicate = "duplicate",
|
|
@@ -8663,15 +8664,15 @@ export declare enum CancellationReason {
|
|
|
8663
8664
|
requested_by_customer = "requested_by_customer",
|
|
8664
8665
|
void_invoice = "void_invoice"
|
|
8665
8666
|
}
|
|
8666
|
-
|
|
8667
|
+
declare enum CaptureMethod {
|
|
8667
8668
|
manual = "manual",
|
|
8668
8669
|
automatic = "automatic"
|
|
8669
8670
|
}
|
|
8670
|
-
|
|
8671
|
+
declare enum ConfirmationMethod {
|
|
8671
8672
|
manual = "manual",
|
|
8672
8673
|
automatic = "automatic"
|
|
8673
8674
|
}
|
|
8674
|
-
|
|
8675
|
+
declare enum Status {
|
|
8675
8676
|
canceled = "canceled",
|
|
8676
8677
|
processing = "processing",
|
|
8677
8678
|
requires_action = "requires_action",
|
|
@@ -8680,7 +8681,7 @@ export declare enum Status {
|
|
|
8680
8681
|
requires_payment_method = "requires_payment_method",
|
|
8681
8682
|
succeeded = "succeeded"
|
|
8682
8683
|
}
|
|
8683
|
-
|
|
8684
|
+
declare enum PayoutType {
|
|
8684
8685
|
bank_account = "bank_account",
|
|
8685
8686
|
card = "card"
|
|
8686
8687
|
}
|
|
@@ -8718,4 +8719,5 @@ type ZEUS_VARIABLES = {
|
|
|
8718
8719
|
["PayoutType"]: ValueTypes["PayoutType"];
|
|
8719
8720
|
["ApplicationsCollaborators"]: ValueTypes["ApplicationsCollaborators"];
|
|
8720
8721
|
};
|
|
8721
|
-
|
|
8722
|
+
|
|
8723
|
+
export { $, AliasType, AllTypesPropsType, CancellationReason, CaptureMethod, Chain, ConfirmationMethod, 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, MongoDbConfigType, MongoDbEnv, MongoDbFieldDiffAction, MongoDbFieldType, NodeType, OperationOptions, Operations, PayInputType, PaymentMethod, PayoutType, PlainType, PlanKind, PrepareScalarPaths, ResolveFromPath, ResolverInputTypes, ResolverType, ReturnTypesType, Rights, SEPARATOR, START_VAR_NAME, ScalarCoder, ScalarCoders, ScalarDefinition, ScalarResolver, SelectionFunction, Selector, SortByDate, Status, 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 };
|