@operato/graphql 0.2.51 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,52 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ### [0.3.4](https://github.com/hatiolab/operato/compare/v0.3.3...v0.3.4) (2022-01-03)
7
+
8
+ **Note:** Version bump only for package @operato/graphql
9
+
10
+
11
+
12
+
13
+
14
+ ### [0.3.3](https://github.com/hatiolab/operato/compare/v0.3.2...v0.3.3) (2022-01-03)
15
+
16
+ **Note:** Version bump only for package @operato/graphql
17
+
18
+
19
+
20
+
21
+
22
+ ### [0.3.2](https://github.com/hatiolab/operato/compare/v0.3.1...v0.3.2) (2022-01-03)
23
+
24
+ **Note:** Version bump only for package @operato/graphql
25
+
26
+
27
+
28
+
29
+
30
+ ### [0.3.1](https://github.com/hatiolab/operato/compare/v0.3.0...v0.3.1) (2021-12-31)
31
+
32
+ **Note:** Version bump only for package @operato/graphql
33
+
34
+
35
+
36
+
37
+
38
+ ## [0.3.0](https://github.com/hatiolab/operato/compare/v0.2.52...v0.3.0) (2021-12-31)
39
+
40
+
41
+ ### :rocket: New Features
42
+
43
+ * add tsconfig option useDefineForClassFields ([6291438](https://github.com/hatiolab/operato/commit/6291438571eee0f095064e7d2ada1c620832e092))
44
+
45
+
46
+
47
+ ### [0.2.52](https://github.com/hatiolab/operato/compare/v0.2.51...v0.2.52) (2021-12-21)
48
+
49
+
50
+ ### :bug: Bug Fix
51
+
52
+ * upgrade dependencies ([3fde5e7](https://github.com/hatiolab/operato/commit/3fde5e7182bb4b502103bcb70de2f1bfab2bc1ff))
@@ -0,0 +1,7 @@
1
+ export declare const CONTEXT_KEY = "__context__";
2
+ export declare function gqlContext(): any;
3
+ export declare function buildGqlContext(context: {
4
+ headers: {
5
+ 'x-things-factory-domain': string;
6
+ };
7
+ } | string): string;
@@ -0,0 +1,14 @@
1
+ export const CONTEXT_KEY = '__context__';
2
+ export function gqlContext() {
3
+ const search = new URLSearchParams(location.search);
4
+ return JSON.parse(search.get(CONTEXT_KEY) || '""') || '';
5
+ }
6
+ export function buildGqlContext(context) {
7
+ if (!context)
8
+ throw new Error('context is not passed');
9
+ if (typeof context !== 'string') {
10
+ context = JSON.stringify(context);
11
+ }
12
+ return new URLSearchParams({ [CONTEXT_KEY]: context }).toString();
13
+ }
14
+ //# sourceMappingURL=gql-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gql-context.js","sourceRoot":"","sources":["../../src/gql-context.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AAExC,MAAM,UAAU,UAAU;IACxB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACnD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAA;AAC1D,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,OAMU;IAEV,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;IACtD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;KAClC;IAED,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,OAAiB,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC7E,CAAC","sourcesContent":["export const CONTEXT_KEY = '__context__'\n\nexport function gqlContext() {\n const search = new URLSearchParams(location.search)\n return JSON.parse(search.get(CONTEXT_KEY) || '\"\"') || ''\n}\n\nexport function buildGqlContext(\n context:\n | {\n headers: {\n 'x-things-factory-domain': string\n }\n }\n | string\n) {\n if (!context) throw new Error('context is not passed')\n if (typeof context !== 'string') {\n context = JSON.stringify(context)\n }\n\n return new URLSearchParams({ [CONTEXT_KEY]: context as string }).toString()\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { ApolloClient } from '@apollo/client/core';
2
+ export declare const GRAPHQL_URI = "/graphql";
3
+ export declare const client: ApolloClient<import("@apollo/client").NormalizedCacheObject>;
4
+ export declare const subscribe: (request: any, subscribe: any) => Promise<{
5
+ unsubscribe(): void;
6
+ }>;
@@ -0,0 +1,142 @@
1
+ import { ApolloClient, ApolloLink, HttpLink, InMemoryCache, from } from '@apollo/client/core';
2
+ import { SubscriptionClient } from 'subscriptions-transport-ws';
3
+ import { createUploadLink } from 'apollo-upload-client';
4
+ import { onError } from '@apollo/client/link/error';
5
+ // import { persistCache } from 'apollo-cache-persist'
6
+ export const GRAPHQL_URI = '/graphql';
7
+ const defaultOptions = {
8
+ watchQuery: {
9
+ fetchPolicy: 'no-cache',
10
+ errorPolicy: 'ignore'
11
+ },
12
+ query: {
13
+ fetchPolicy: 'no-cache',
14
+ errorPolicy: 'all'
15
+ },
16
+ mutate: {
17
+ errorPolicy: 'all'
18
+ }
19
+ };
20
+ const ERROR_HANDLER = ({ operation, graphQLErrors, networkError }) => {
21
+ if (graphQLErrors) {
22
+ document.dispatchEvent(new CustomEvent('notify', {
23
+ detail: {
24
+ level: 'error',
25
+ message: graphQLErrors[0].message,
26
+ ex: graphQLErrors
27
+ }
28
+ }));
29
+ }
30
+ if (networkError) {
31
+ /* networkError가 ServerParseError 이거나 ServerError 인 경우에만 statusCode를 갖는다. */
32
+ switch (networkError.statusCode) {
33
+ case undefined /* in case this error is not a server side error */:
34
+ document.dispatchEvent(new CustomEvent('notify', {
35
+ detail: {
36
+ level: 'error',
37
+ message: networkError.message,
38
+ ex: networkError
39
+ }
40
+ }));
41
+ break;
42
+ case 401:
43
+ /* 401 에러가 리턴되면, 인증이 필요하다는 메시지를 dispatch 한다. 이 auth 모듈 등에서 이 메시지를 받아서 signin 프로세스를 진행할 수 있다. */
44
+ document.dispatchEvent(new CustomEvent('auth-required'));
45
+ break;
46
+ case 403:
47
+ /* 403 에러가 리턴되면, 도메인 정보가 필요하다는 메시지를 dispatch 한다. 이 auth 모듈 등에서 이 메시지를 받아서 domain-register 프로세스 등을 진행할 수 있다. */
48
+ document.dispatchEvent(new CustomEvent('domain-required'));
49
+ break;
50
+ default:
51
+ var { name, response, statusCode, bodyText, message } = networkError;
52
+ if (name == 'ServerParseError') {
53
+ message = `[ ${statusCode || ''} : ${response.statusText} ] ${bodyText}`;
54
+ }
55
+ else {
56
+ /* in case this error is instanceof ServerError */
57
+ message = `[ ${statusCode || ''} : ${response.statusText} ] ${message}`;
58
+ }
59
+ document.dispatchEvent(new CustomEvent('notify', {
60
+ detail: {
61
+ level: 'error',
62
+ message,
63
+ ex: networkError
64
+ }
65
+ }));
66
+ }
67
+ }
68
+ };
69
+ const cache = new InMemoryCache({
70
+ addTypename: false
71
+ // dataIdFromObject: object => object.key
72
+ });
73
+ const httpOptions = {
74
+ GRAPHQL_URI,
75
+ credentials: 'include'
76
+ };
77
+ const httpLink = ApolloLink.split(operation => operation.getContext().hasUpload, createUploadLink(httpOptions), new HttpLink(httpOptions));
78
+ // const initPersistCache = async () => {
79
+ // persistCache({
80
+ // cache,
81
+ // storage: window.localStorage
82
+ // })
83
+ // }
84
+ // initPersistCache()
85
+ export const client = new ApolloClient({
86
+ defaultOptions,
87
+ cache,
88
+ link: from([onError(ERROR_HANDLER), httpLink])
89
+ });
90
+ /* SubscriptionClient */
91
+ var subscriptionClient;
92
+ const getSubscriptionClient = async () => {
93
+ if (!subscriptionClient) {
94
+ subscriptionClient = new Promise((resolve, reject) => {
95
+ var client = new SubscriptionClient(location.origin.replace(/^http/, 'ws') + '/subscriptions', {
96
+ reconnect: true,
97
+ connectionParams: {
98
+ headers: {
99
+ /*
100
+ 특정 도메인의 데이타만 받고자 하는 경우에, referer 정보를 제공해서 서버에서 서브도메인 정보를 취득하도록 한다.
101
+ referer: location.href
102
+ 또는, 이미 서브도메인 정보를 알고 있다면,
103
+ 'x-things-factory-domain': '[subdomain]'
104
+ 을 보낼 수 있다.
105
+ 관련 정보를 보내지 않는다면, 사용자가 권한을 가진 모든 도메인의 데이타를 수신하게 된다.
106
+ */
107
+ referer: location.href
108
+ }
109
+ }
110
+ });
111
+ client.onError(err => {
112
+ //readyState === 3 인 경우 url을 잘 못 입력했거나, 서버에 문제가 있는 경우이므로 강제로 close() 시킨다.
113
+ if (client.status === 3) {
114
+ client.close();
115
+ }
116
+ reject(err);
117
+ });
118
+ client.onConnected(() => {
119
+ resolve(client);
120
+ });
121
+ });
122
+ }
123
+ return await subscriptionClient;
124
+ };
125
+ var subscriptions = [];
126
+ export const subscribe = async (request, subscribe) => {
127
+ var client = await getSubscriptionClient();
128
+ var { unsubscribe } = client.request(request).subscribe(subscribe);
129
+ subscriptions.push(unsubscribe);
130
+ return {
131
+ unsubscribe() {
132
+ subscriptions.splice(subscriptions.indexOf(unsubscribe), 1);
133
+ unsubscribe();
134
+ if (subscriptions.length == 0) {
135
+ client.unsubscribeAll();
136
+ client.close(true);
137
+ subscriptionClient = null;
138
+ }
139
+ }
140
+ };
141
+ };
142
+ //# sourceMappingURL=graphql-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql-client.js","sourceRoot":"","sources":["../../src/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAkB,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAI7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,sDAAsD;AAEtD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAA;AAErC,MAAM,cAAc,GAAmB;IACrC,UAAU,EAA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E,CAAA;gBACvB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBAElB,kBAAkB,GAAG,IAAI,CAAA;aAC1B;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { ApolloClient, ApolloLink, DefaultOptions, HttpLink, InMemoryCache, from } from '@apollo/client/core'\n\nimport { ErrorLink } from '@apollo/client/link/error'\nimport { ServerParseError } from '@apollo/client'\nimport { SubscriptionClient } from 'subscriptions-transport-ws'\nimport { createUploadLink } from 'apollo-upload-client'\nimport { onError } from '@apollo/client/link/error'\n\n// import { persistCache } from 'apollo-cache-persist'\n\nexport const GRAPHQL_URI = '/graphql'\n\nconst defaultOptions: DefaultOptions = {\n watchQuery: {\n fetchPolicy: 'no-cache',\n errorPolicy: 'ignore'\n },\n query: {\n fetchPolicy: 'no-cache', //'network-only'\n errorPolicy: 'all'\n },\n mutate: {\n errorPolicy: 'all'\n }\n}\n\nconst ERROR_HANDLER: ErrorLink.ErrorHandler = ({ operation, graphQLErrors, networkError }) => {\n if (graphQLErrors) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: graphQLErrors[0].message,\n ex: graphQLErrors\n }\n })\n )\n }\n\n if (networkError) {\n /* networkError가 ServerParseError 이거나 ServerError 인 경우에만 statusCode를 갖는다. */\n switch ((networkError as ServerParseError).statusCode) {\n case undefined /* in case this error is not a server side error */:\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: networkError.message,\n ex: networkError\n }\n })\n )\n break\n\n case 401:\n /* 401 에러가 리턴되면, 인증이 필요하다는 메시지를 dispatch 한다. 이 auth 모듈 등에서 이 메시지를 받아서 signin 프로세스를 진행할 수 있다. */\n document.dispatchEvent(new CustomEvent('auth-required'))\n break\n\n case 403:\n /* 403 에러가 리턴되면, 도메인 정보가 필요하다는 메시지를 dispatch 한다. 이 auth 모듈 등에서 이 메시지를 받아서 domain-register 프로세스 등을 진행할 수 있다. */\n document.dispatchEvent(new CustomEvent('domain-required'))\n break\n\n default:\n var { name, response, statusCode, bodyText, message } = networkError as ServerParseError\n if (name == 'ServerParseError') {\n message = `[ ${statusCode || ''} : ${response.statusText} ] ${bodyText}`\n } else {\n /* in case this error is instanceof ServerError */\n message = `[ ${statusCode || ''} : ${response.statusText} ] ${message}`\n }\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message,\n ex: networkError\n }\n })\n )\n }\n }\n}\n\nconst cache = new InMemoryCache({\n addTypename: false\n // dataIdFromObject: object => object.key\n})\n\nconst httpOptions = {\n GRAPHQL_URI,\n credentials: 'include'\n}\n\nconst httpLink = ApolloLink.split(\n operation => operation.getContext().hasUpload,\n createUploadLink(httpOptions),\n new HttpLink(httpOptions)\n)\n\n// const initPersistCache = async () => {\n// persistCache({\n// cache,\n// storage: window.localStorage\n// })\n// }\n\n// initPersistCache()\n\nexport const client = new ApolloClient({\n defaultOptions,\n cache,\n link: from([onError(ERROR_HANDLER), httpLink])\n})\n\n/* SubscriptionClient */\nvar subscriptionClient: Promise<SubscriptionClient> | null\n\nconst getSubscriptionClient = async (): Promise<SubscriptionClient> => {\n if (!subscriptionClient) {\n subscriptionClient = new Promise((resolve, reject) => {\n var client = new SubscriptionClient(location.origin.replace(/^http/, 'ws') + '/subscriptions', {\n reconnect: true,\n connectionParams: {\n headers: {\n /* \n 특정 도메인의 데이타만 받고자 하는 경우에, referer 정보를 제공해서 서버에서 서브도메인 정보를 취득하도록 한다.\n referer: location.href\n 또는, 이미 서브도메인 정보를 알고 있다면,\n 'x-things-factory-domain': '[subdomain]'\n 을 보낼 수 있다.\n 관련 정보를 보내지 않는다면, 사용자가 권한을 가진 모든 도메인의 데이타를 수신하게 된다.\n */\n referer: location.href\n }\n }\n })\n\n client.onError(err => {\n //readyState === 3 인 경우 url을 잘 못 입력했거나, 서버에 문제가 있는 경우이므로 강제로 close() 시킨다.\n if (client.status === 3) {\n client.close()\n }\n reject(err)\n })\n\n client.onConnected(() => {\n resolve(client)\n })\n })\n }\n\n return await subscriptionClient\n}\n\nvar subscriptions: (() => void)[] = []\n\nexport const subscribe = async (request: any, subscribe: any) => {\n var client = await getSubscriptionClient()\n var { unsubscribe } = client.request(request).subscribe(subscribe)\n\n subscriptions.push(unsubscribe)\n\n return {\n unsubscribe() {\n subscriptions.splice(subscriptions.indexOf(unsubscribe), 1)\n unsubscribe()\n\n if (subscriptions.length == 0) {\n client.unsubscribeAll()\n client.close(true)\n\n subscriptionClient = null\n }\n }\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export * from './gql-context';
2
+ export * from './graphql-client';
3
+ export * from './json-to-grqphql-query';
package/dist/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './gql-context';
2
2
  export * from './graphql-client';
3
- export * from 'json-to-graphql-query';
3
+ export * from './json-to-grqphql-query';
4
4
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA","sourcesContent":["export * from './gql-context'\nexport * from './graphql-client'\nexport * from './json-to-grqphql-query'\n"]}
@@ -0,0 +1,9 @@
1
+ export declare const configFields: string[];
2
+ export declare function buildArgs(argsObj: any): string;
3
+ export declare function buildVariables(varsObj: any): string;
4
+ export interface IJsonToGraphQLOptions {
5
+ pretty?: boolean;
6
+ ignoreFields?: string[];
7
+ includeFalsyKeys?: boolean;
8
+ }
9
+ export declare function jsonToGraphQLQuery(query: any, options?: IJsonToGraphQLOptions): string;
@@ -0,0 +1,180 @@
1
+ /* inspired by https://github.com/dupski/json-to-graphql-query */
2
+ import { EnumType } from './types/EnumType';
3
+ import { VariableType } from './types/VariableType';
4
+ export const configFields = [
5
+ '__args',
6
+ '__alias',
7
+ '__aliasFor',
8
+ '__variables',
9
+ '__directives',
10
+ '__on',
11
+ '__all_on',
12
+ '__typeName',
13
+ '__name'
14
+ ];
15
+ function stringify(obj_from_json) {
16
+ if (obj_from_json instanceof EnumType) {
17
+ return obj_from_json.value;
18
+ }
19
+ // variables should be prefixed with dollar sign and not quoted
20
+ else if (obj_from_json instanceof VariableType) {
21
+ return `$${obj_from_json.value}`;
22
+ }
23
+ // Cheers to Derek: https://stackoverflow.com/questions/11233498/json-stringify-without-quotes-on-properties
24
+ else if (typeof obj_from_json !== 'object' || obj_from_json === null) {
25
+ // not an object, stringify using native function
26
+ return JSON.stringify(obj_from_json);
27
+ }
28
+ else if (Array.isArray(obj_from_json)) {
29
+ return `[${obj_from_json.map(item => stringify(item)).join(', ')}]`;
30
+ }
31
+ // Implements recursive object serialization according to JSON spec
32
+ // but without quotes around the keys.
33
+ const props = Object.keys(obj_from_json)
34
+ .map(key => `${key}: ${stringify(obj_from_json[key])}`)
35
+ .join(', ');
36
+ return `{${props}}`;
37
+ }
38
+ export function buildArgs(argsObj) {
39
+ const args = [];
40
+ for (const argName in argsObj) {
41
+ args.push(`${argName}: ${stringify(argsObj[argName])}`);
42
+ }
43
+ return args.join(', ');
44
+ }
45
+ export function buildVariables(varsObj) {
46
+ const args = [];
47
+ for (const varName in varsObj) {
48
+ args.push(`$${varName}: ${varsObj[varName]}`);
49
+ }
50
+ return args.join(', ');
51
+ }
52
+ function buildDirectives(dirsObj) {
53
+ const directiveName = Object.keys(dirsObj)[0];
54
+ const directiveValue = dirsObj[directiveName];
55
+ if (typeof directiveValue === 'boolean') {
56
+ return directiveName;
57
+ }
58
+ else if (typeof directiveValue === 'object') {
59
+ const args = [];
60
+ for (const argName in directiveValue) {
61
+ const argVal = stringify(directiveValue[argName]).replace(/"/g, '');
62
+ args.push(`${argName}: ${argVal}`);
63
+ }
64
+ return `${directiveName}(${args.join(', ')})`;
65
+ }
66
+ else {
67
+ throw new Error(`Unsupported type for directive: ${typeof directiveValue}. Types allowed: object, boolean.\n` +
68
+ `Offending object: ${JSON.stringify(dirsObj)}`);
69
+ }
70
+ }
71
+ function getIndent(level) {
72
+ return Array(level * 4 + 1).join(' ');
73
+ }
74
+ function filterNonConfigFields(fieldName, ignoreFields) {
75
+ // Returns true if fieldName is not a 'configField'.
76
+ return configFields.indexOf(fieldName) == -1 && ignoreFields.indexOf(fieldName) == -1;
77
+ }
78
+ function convertQuery(node, level, output, options) {
79
+ Object.keys(node)
80
+ .filter(key => filterNonConfigFields(key, options.ignoreFields))
81
+ .forEach(key => {
82
+ let value = node[key];
83
+ if (typeof value === 'object') {
84
+ if (Array.isArray(value)) {
85
+ value = value.find(item => item && typeof item === 'object');
86
+ if (!value) {
87
+ output.push([`${key}`, level]);
88
+ return;
89
+ }
90
+ }
91
+ const fieldCount = Object.keys(value).filter(keyCount => filterNonConfigFields(keyCount, options.ignoreFields)).length;
92
+ const subFields = fieldCount > 0;
93
+ const argsExist = typeof value.__args === 'object' && Object.keys(value.__args).length > 0;
94
+ const directivesExist = typeof value.__directives === 'object';
95
+ const fullFragmentsExist = value.__all_on instanceof Array;
96
+ const partialFragmentsExist = typeof value.__on === 'object';
97
+ let token = `${key}`;
98
+ if (typeof value.__name === 'string') {
99
+ token = `${token} ${value.__name}`;
100
+ }
101
+ if (typeof value.__aliasFor === 'string') {
102
+ token = `${token}: ${value.__aliasFor}`;
103
+ }
104
+ if (typeof value.__variables === 'object') {
105
+ token = `${token} (${buildVariables(value.__variables)})`;
106
+ }
107
+ else if (argsExist || directivesExist) {
108
+ let argsStr = '';
109
+ let dirsStr = '';
110
+ if (directivesExist) {
111
+ // TODO: Add support for multiple directives on one node.
112
+ const numDirectives = Object.keys(value.__directives).length;
113
+ if (numDirectives > 1) {
114
+ throw new Error(`Too many directives. The object/key ` +
115
+ `'${Object.keys(value)[0]}' had ${numDirectives} directives, ` +
116
+ `but only 1 directive per object/key is supported at this time.`);
117
+ }
118
+ dirsStr = `@${buildDirectives(value.__directives)}`;
119
+ }
120
+ if (argsExist) {
121
+ argsStr = `(${buildArgs(value.__args)})`;
122
+ }
123
+ const spacer = directivesExist && argsExist ? ' ' : '';
124
+ token = `${token} ${dirsStr}${spacer}${argsStr}`;
125
+ }
126
+ output.push([token + (subFields || partialFragmentsExist || fullFragmentsExist ? ' {' : ''), level]);
127
+ convertQuery(value, level + 1, output, options);
128
+ if (fullFragmentsExist) {
129
+ value.__all_on.forEach((fullFragment) => {
130
+ output.push([`...${fullFragment}`, level + 1]);
131
+ });
132
+ }
133
+ if (partialFragmentsExist) {
134
+ const inlineFragments = value.__on instanceof Array ? value.__on : [value.__on];
135
+ inlineFragments.forEach(inlineFragment => {
136
+ const name = inlineFragment.__typeName;
137
+ output.push([`... on ${name} {`, level + 1]);
138
+ convertQuery(inlineFragment, level + 2, output, options);
139
+ output.push(['}', level + 1]);
140
+ });
141
+ }
142
+ if (subFields || partialFragmentsExist || fullFragmentsExist) {
143
+ output.push(['}', level]);
144
+ }
145
+ }
146
+ else if (options.includeFalsyKeys === true || value) {
147
+ output.push([`${key}`, level]);
148
+ }
149
+ });
150
+ }
151
+ export function jsonToGraphQLQuery(query, options = {}) {
152
+ if (!query || typeof query != 'object') {
153
+ throw new Error('query object not specified');
154
+ }
155
+ if (Object.keys(query).length == 0) {
156
+ throw new Error('query object has no data');
157
+ }
158
+ if (!(options.ignoreFields instanceof Array)) {
159
+ options.ignoreFields = [];
160
+ }
161
+ const queryLines = [];
162
+ convertQuery(query, 0, queryLines, options);
163
+ let output = '';
164
+ queryLines.forEach(([line, level]) => {
165
+ if (options.pretty) {
166
+ if (output) {
167
+ output += '\n';
168
+ }
169
+ output += getIndent(level) + line;
170
+ }
171
+ else {
172
+ if (output) {
173
+ output += ' ';
174
+ }
175
+ output += line;
176
+ }
177
+ });
178
+ return output;
179
+ }
180
+ //# sourceMappingURL=json-to-grqphql-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-to-grqphql-query.js","sourceRoot":"","sources":["../../src/json-to-grqphql-query.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,OAAO,EAAE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IAAI,CAAA;aACf;YACD,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAA;SAClC;aAAM;YACL,IAAI,MAAM,EAAE;gBACV,MAAM,IAAI,GAAG,CAAA;aACd;YACD,MAAM,IAAI,IAAI,CAAA;SACf;IACH,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["/* inspired by https://github.com/dupski/json-to-graphql-query */\n\nimport { EnumType } from './types/EnumType'\nimport { VariableType } from './types/VariableType'\n\nexport const configFields = [\n '__args',\n '__alias',\n '__aliasFor',\n '__variables',\n '__directives',\n '__on',\n '__all_on',\n '__typeName',\n '__name'\n]\n\nfunction stringify(obj_from_json: any): string {\n if (obj_from_json instanceof EnumType) {\n return obj_from_json.value\n }\n // variables should be prefixed with dollar sign and not quoted\n else if (obj_from_json instanceof VariableType) {\n return `$${obj_from_json.value}`\n }\n // Cheers to Derek: https://stackoverflow.com/questions/11233498/json-stringify-without-quotes-on-properties\n else if (typeof obj_from_json !== 'object' || obj_from_json === null) {\n // not an object, stringify using native function\n return JSON.stringify(obj_from_json)\n } else if (Array.isArray(obj_from_json)) {\n return `[${obj_from_json.map(item => stringify(item)).join(', ')}]`\n }\n // Implements recursive object serialization according to JSON spec\n // but without quotes around the keys.\n const props: string = Object.keys(obj_from_json)\n .map(key => `${key}: ${stringify(obj_from_json[key])}`)\n .join(', ')\n\n return `{${props}}`\n}\n\nexport function buildArgs(argsObj: any): string {\n const args = []\n for (const argName in argsObj) {\n args.push(`${argName}: ${stringify(argsObj[argName])}`)\n }\n return args.join(', ')\n}\n\nexport function buildVariables(varsObj: any): string {\n const args = []\n for (const varName in varsObj) {\n args.push(`$${varName}: ${varsObj[varName]}`)\n }\n return args.join(', ')\n}\n\nfunction buildDirectives(dirsObj: any): string {\n const directiveName = Object.keys(dirsObj)[0]\n const directiveValue = dirsObj[directiveName]\n if (typeof directiveValue === 'boolean') {\n return directiveName\n } else if (typeof directiveValue === 'object') {\n const args = []\n for (const argName in directiveValue) {\n const argVal = stringify(directiveValue[argName]).replace(/\"/g, '')\n args.push(`${argName}: ${argVal}`)\n }\n return `${directiveName}(${args.join(', ')})`\n } else {\n throw new Error(\n `Unsupported type for directive: ${typeof directiveValue}. Types allowed: object, boolean.\\n` +\n `Offending object: ${JSON.stringify(dirsObj)}`\n )\n }\n}\n\nfunction getIndent(level: number): string {\n return Array(level * 4 + 1).join(' ')\n}\n\nfunction filterNonConfigFields(fieldName: string, ignoreFields: string[]) {\n // Returns true if fieldName is not a 'configField'.\n return configFields.indexOf(fieldName) == -1 && ignoreFields.indexOf(fieldName) == -1\n}\n\nfunction convertQuery(node: any, level: number, output: [string, number][], options: IJsonToGraphQLOptions) {\n Object.keys(node)\n .filter(key => filterNonConfigFields(key, options.ignoreFields!))\n .forEach(key => {\n let value = node[key]\n if (typeof value === 'object') {\n if (Array.isArray(value)) {\n value = value.find(item => item && typeof item === 'object')\n if (!value) {\n output.push([`${key}`, level])\n return\n }\n }\n\n const fieldCount = Object.keys(value).filter(keyCount =>\n filterNonConfigFields(keyCount, options.ignoreFields!)\n ).length\n const subFields = fieldCount > 0\n const argsExist = typeof value.__args === 'object' && Object.keys(value.__args).length > 0\n const directivesExist = typeof value.__directives === 'object'\n const fullFragmentsExist = value.__all_on instanceof Array\n const partialFragmentsExist = typeof value.__on === 'object'\n\n let token = `${key}`\n\n if (typeof value.__name === 'string') {\n token = `${token} ${value.__name}`\n }\n\n if (typeof value.__aliasFor === 'string') {\n token = `${token}: ${value.__aliasFor}`\n }\n\n if (typeof value.__variables === 'object') {\n token = `${token} (${buildVariables(value.__variables)})`\n } else if (argsExist || directivesExist) {\n let argsStr = ''\n let dirsStr = ''\n if (directivesExist) {\n // TODO: Add support for multiple directives on one node.\n const numDirectives = Object.keys(value.__directives).length\n if (numDirectives > 1) {\n throw new Error(\n `Too many directives. The object/key ` +\n `'${Object.keys(value)[0]}' had ${numDirectives} directives, ` +\n `but only 1 directive per object/key is supported at this time.`\n )\n }\n dirsStr = `@${buildDirectives(value.__directives)}`\n }\n if (argsExist) {\n argsStr = `(${buildArgs(value.__args)})`\n }\n const spacer = directivesExist && argsExist ? ' ' : ''\n token = `${token} ${dirsStr}${spacer}${argsStr}`\n }\n\n output.push([token + (subFields || partialFragmentsExist || fullFragmentsExist ? ' {' : ''), level])\n convertQuery(value, level + 1, output, options)\n\n if (fullFragmentsExist) {\n value.__all_on.forEach((fullFragment: string) => {\n output.push([`...${fullFragment}`, level + 1])\n })\n }\n if (partialFragmentsExist) {\n const inlineFragments: { __typeName: string }[] = value.__on instanceof Array ? value.__on : [value.__on]\n inlineFragments.forEach(inlineFragment => {\n const name = inlineFragment.__typeName\n output.push([`... on ${name} {`, level + 1])\n convertQuery(inlineFragment, level + 2, output, options)\n output.push(['}', level + 1])\n })\n }\n\n if (subFields || partialFragmentsExist || fullFragmentsExist) {\n output.push(['}', level])\n }\n } else if (options.includeFalsyKeys === true || value) {\n output.push([`${key}`, level])\n }\n })\n}\n\nexport interface IJsonToGraphQLOptions {\n pretty?: boolean\n ignoreFields?: string[]\n includeFalsyKeys?: boolean\n}\n\nexport function jsonToGraphQLQuery(query: any, options: IJsonToGraphQLOptions = {}) {\n if (!query || typeof query != 'object') {\n throw new Error('query object not specified')\n }\n if (Object.keys(query).length == 0) {\n throw new Error('query object has no data')\n }\n if (!(options.ignoreFields instanceof Array)) {\n options.ignoreFields = []\n }\n\n const queryLines: [string, number][] = []\n convertQuery(query, 0, queryLines, options)\n\n let output = ''\n queryLines.forEach(([line, level]) => {\n if (options.pretty) {\n if (output) {\n output += '\\n'\n }\n output += getIndent(level) + line\n } else {\n if (output) {\n output += ' '\n }\n output += line\n }\n })\n return output\n}\n"]}
@@ -0,0 +1,5 @@
1
+ declare class EnumType {
2
+ value: string;
3
+ constructor(value: string);
4
+ }
5
+ export { EnumType };
@@ -0,0 +1,7 @@
1
+ class EnumType {
2
+ constructor(value) {
3
+ this.value = value;
4
+ }
5
+ }
6
+ export { EnumType };
7
+ //# sourceMappingURL=EnumType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnumType.js","sourceRoot":"","sources":["../../../src/types/EnumType.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ;IACZ,YAAmB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;CACrC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA","sourcesContent":["class EnumType {\n constructor(public value: string) {}\n}\n\nexport { EnumType }\n"]}
@@ -0,0 +1,6 @@
1
+ declare class VariableType {
2
+ value: string;
3
+ constructor(value: string);
4
+ toJSON(): string;
5
+ }
6
+ export { VariableType };
@@ -0,0 +1,10 @@
1
+ class VariableType {
2
+ constructor(value) {
3
+ this.value = value;
4
+ }
5
+ toJSON() {
6
+ return `$${this.value}`;
7
+ }
8
+ }
9
+ export { VariableType };
10
+ //# sourceMappingURL=VariableType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VariableType.js","sourceRoot":"","sources":["../../../src/types/VariableType.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY;IAChB,YAAmB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAEpC,MAAM;QACJ,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,CAAA;IACzB,CAAC;CACF;AAED,OAAO,EAAE,YAAY,EAAE,CAAA","sourcesContent":["class VariableType {\n constructor(public value: string) {}\n\n toJSON() {\n return `$${this.value}`\n }\n}\n\nexport { VariableType }\n"]}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../src/gql-context.ts","../../../node_modules/graphql/version.d.ts","../../../node_modules/graphql/jsutils/maybe.d.ts","../../../node_modules/graphql/language/source.d.ts","../../../node_modules/graphql/language/tokenkind.d.ts","../../../node_modules/graphql/language/ast.d.ts","../../../node_modules/graphql/language/directivelocation.d.ts","../../../node_modules/graphql/jsutils/promiseorvalue.d.ts","../../../node_modules/graphql/jsutils/path.d.ts","../../../node_modules/graphql/type/definition.d.ts","../../../node_modules/graphql/type/directives.d.ts","../../../node_modules/graphql/type/schema.d.ts","../../../node_modules/graphql/language/location.d.ts","../../../node_modules/graphql/error/graphqlerror.d.ts","../../../node_modules/graphql/error/formaterror.d.ts","../../../node_modules/graphql/execution/execute.d.ts","../../../node_modules/graphql/graphql.d.ts","../../../node_modules/graphql/type/scalars.d.ts","../../../node_modules/graphql/type/introspection.d.ts","../../../node_modules/graphql/type/validate.d.ts","../../../node_modules/graphql/type/index.d.ts","../../../node_modules/graphql/language/printlocation.d.ts","../../../node_modules/graphql/language/kinds.d.ts","../../../node_modules/graphql/language/lexer.d.ts","../../../node_modules/graphql/language/parser.d.ts","../../../node_modules/graphql/language/printer.d.ts","../../../node_modules/graphql/language/visitor.d.ts","../../../node_modules/graphql/language/predicates.d.ts","../../../node_modules/graphql/language/index.d.ts","../../../node_modules/graphql/execution/values.d.ts","../../../node_modules/graphql/execution/index.d.ts","../../../node_modules/graphql/subscription/subscribe.d.ts","../../../node_modules/graphql/subscription/index.d.ts","../../../node_modules/graphql/utilities/typeinfo.d.ts","../../../node_modules/graphql/validation/validationcontext.d.ts","../../../node_modules/graphql/validation/validate.d.ts","../../../node_modules/graphql/validation/specifiedrules.d.ts","../../../node_modules/graphql/validation/rules/executabledefinitionsrule.d.ts","../../../node_modules/graphql/validation/rules/fieldsoncorrecttyperule.d.ts","../../../node_modules/graphql/validation/rules/fragmentsoncompositetypesrule.d.ts","../../../node_modules/graphql/validation/rules/knownargumentnamesrule.d.ts","../../../node_modules/graphql/validation/rules/knowndirectivesrule.d.ts","../../../node_modules/graphql/validation/rules/knownfragmentnamesrule.d.ts","../../../node_modules/graphql/validation/rules/knowntypenamesrule.d.ts","../../../node_modules/graphql/validation/rules/loneanonymousoperationrule.d.ts","../../../node_modules/graphql/validation/rules/nofragmentcyclesrule.d.ts","../../../node_modules/graphql/validation/rules/noundefinedvariablesrule.d.ts","../../../node_modules/graphql/validation/rules/nounusedfragmentsrule.d.ts","../../../node_modules/graphql/validation/rules/nounusedvariablesrule.d.ts","../../../node_modules/graphql/validation/rules/overlappingfieldscanbemergedrule.d.ts","../../../node_modules/graphql/validation/rules/possiblefragmentspreadsrule.d.ts","../../../node_modules/graphql/validation/rules/providedrequiredargumentsrule.d.ts","../../../node_modules/graphql/validation/rules/scalarleafsrule.d.ts","../../../node_modules/graphql/validation/rules/singlefieldsubscriptionsrule.d.ts","../../../node_modules/graphql/validation/rules/uniqueargumentnamesrule.d.ts","../../../node_modules/graphql/validation/rules/uniquedirectivesperlocationrule.d.ts","../../../node_modules/graphql/validation/rules/uniquefragmentnamesrule.d.ts","../../../node_modules/graphql/validation/rules/uniqueinputfieldnamesrule.d.ts","../../../node_modules/graphql/validation/rules/uniqueoperationnamesrule.d.ts","../../../node_modules/graphql/validation/rules/uniquevariablenamesrule.d.ts","../../../node_modules/graphql/validation/rules/valuesofcorrecttyperule.d.ts","../../../node_modules/graphql/validation/rules/variablesareinputtypesrule.d.ts","../../../node_modules/graphql/validation/rules/variablesinallowedpositionrule.d.ts","../../../node_modules/graphql/validation/rules/loneschemadefinitionrule.d.ts","../../../node_modules/graphql/validation/rules/uniqueoperationtypesrule.d.ts","../../../node_modules/graphql/validation/rules/uniquetypenamesrule.d.ts","../../../node_modules/graphql/validation/rules/uniqueenumvaluenamesrule.d.ts","../../../node_modules/graphql/validation/rules/uniquefielddefinitionnamesrule.d.ts","../../../node_modules/graphql/validation/rules/uniquedirectivenamesrule.d.ts","../../../node_modules/graphql/validation/rules/possibletypeextensionsrule.d.ts","../../../node_modules/graphql/validation/rules/custom/nodeprecatedcustomrule.d.ts","../../../node_modules/graphql/validation/rules/custom/noschemaintrospectioncustomrule.d.ts","../../../node_modules/graphql/validation/index.d.ts","../../../node_modules/graphql/error/syntaxerror.d.ts","../../../node_modules/graphql/error/locatederror.d.ts","../../../node_modules/graphql/error/index.d.ts","../../../node_modules/graphql/utilities/getintrospectionquery.d.ts","../../../node_modules/graphql/utilities/getoperationast.d.ts","../../../node_modules/graphql/utilities/getoperationroottype.d.ts","../../../node_modules/graphql/utilities/introspectionfromschema.d.ts","../../../node_modules/graphql/utilities/buildclientschema.d.ts","../../../node_modules/graphql/utilities/buildastschema.d.ts","../../../node_modules/graphql/utilities/extendschema.d.ts","../../../node_modules/graphql/utilities/lexicographicsortschema.d.ts","../../../node_modules/graphql/utilities/printschema.d.ts","../../../node_modules/graphql/utilities/typefromast.d.ts","../../../node_modules/graphql/utilities/valuefromast.d.ts","../../../node_modules/graphql/utilities/valuefromastuntyped.d.ts","../../../node_modules/graphql/utilities/astfromvalue.d.ts","../../../node_modules/graphql/utilities/coerceinputvalue.d.ts","../../../node_modules/graphql/utilities/concatast.d.ts","../../../node_modules/graphql/utilities/separateoperations.d.ts","../../../node_modules/graphql/utilities/stripignoredcharacters.d.ts","../../../node_modules/graphql/utilities/typecomparators.d.ts","../../../node_modules/graphql/utilities/assertvalidname.d.ts","../../../node_modules/graphql/utilities/findbreakingchanges.d.ts","../../../node_modules/graphql/utilities/typedquerydocumentnode.d.ts","../../../node_modules/graphql/utilities/finddeprecatedusages.d.ts","../../../node_modules/graphql/utilities/index.d.ts","../../../node_modules/graphql/index.d.ts","../../../node_modules/@apollo/client/node_modules/ts-invariant/lib/invariant.d.ts","../../../node_modules/@apollo/client/utilities/globals/dev.d.ts","../../../node_modules/@apollo/client/utilities/globals/maybe.d.ts","../../../node_modules/@apollo/client/utilities/globals/global.d.ts","../../../node_modules/@apollo/client/utilities/globals/index.d.ts","../../../node_modules/@apollo/client/utilities/graphql/directives.d.ts","../../../node_modules/@apollo/client/utilities/graphql/fragments.d.ts","../../../node_modules/@apollo/client/utilities/graphql/getfromast.d.ts","../../../node_modules/@apollo/client/utilities/graphql/storeutils.d.ts","../../../node_modules/@apollo/client/utilities/graphql/transform.d.ts","../../../node_modules/@graphql-typed-document-node/core/dist/index.d.ts","../../../node_modules/@wry/trie/lib/trie.d.ts","../../../node_modules/@apollo/client/cache/core/types/cache.d.ts","../../../node_modules/@apollo/client/cache/inmemory/entitystore.d.ts","../../../node_modules/@apollo/client/cache/inmemory/types.d.ts","../../../node_modules/@apollo/client/cache/inmemory/fixpolyfills.d.ts","../../../node_modules/@apollo/client/cache/inmemory/reactivevars.d.ts","../../../node_modules/@apollo/client/cache/inmemory/inmemorycache.d.ts","../../../node_modules/@apollo/client/cache/inmemory/object-canon.d.ts","../../../node_modules/@apollo/client/cache/inmemory/readfromstore.d.ts","../../../node_modules/@apollo/client/cache/inmemory/writetostore.d.ts","../../../node_modules/@apollo/client/cache/inmemory/policies.d.ts","../../../node_modules/@apollo/client/cache/core/types/common.d.ts","../../../node_modules/@apollo/client/cache/core/types/dataproxy.d.ts","../../../node_modules/@apollo/client/cache/core/cache.d.ts","../../../node_modules/@apollo/client/cache/inmemory/helpers.d.ts","../../../node_modules/@apollo/client/cache/index.d.ts","../../../node_modules/@apollo/client/utilities/policies/pagination.d.ts","../../../node_modules/@apollo/client/node_modules/zen-observable-ts/module.d.ts","../../../node_modules/@apollo/client/node_modules/symbol-observable/index.d.ts","../../../node_modules/@apollo/client/utilities/observables/observable.d.ts","../../../node_modules/@apollo/client/utilities/common/objects.d.ts","../../../node_modules/@apollo/client/utilities/common/mergedeep.d.ts","../../../node_modules/@apollo/client/utilities/common/clonedeep.d.ts","../../../node_modules/@apollo/client/utilities/common/maybedeepfreeze.d.ts","../../../node_modules/@apollo/client/utilities/observables/iteration.d.ts","../../../node_modules/@apollo/client/utilities/observables/asyncmap.d.ts","../../../node_modules/@apollo/client/utilities/observables/concast.d.ts","../../../node_modules/@apollo/client/utilities/observables/subclassing.d.ts","../../../node_modules/@apollo/client/utilities/common/arrays.d.ts","../../../node_modules/@apollo/client/utilities/common/errorhandling.d.ts","../../../node_modules/@apollo/client/utilities/common/canuse.d.ts","../../../node_modules/@apollo/client/utilities/common/compact.d.ts","../../../node_modules/@apollo/client/utilities/common/makeuniqueid.d.ts","../../../node_modules/@apollo/client/utilities/common/stringifyfordisplay.d.ts","../../../node_modules/@apollo/client/utilities/types/isstrictlyany.d.ts","../../../node_modules/@apollo/client/utilities/index.d.ts","../../../node_modules/@apollo/client/link/core/types.d.ts","../../../node_modules/@apollo/client/link/core/apollolink.d.ts","../../../node_modules/@apollo/client/link/core/empty.d.ts","../../../node_modules/@apollo/client/link/core/from.d.ts","../../../node_modules/@apollo/client/link/core/split.d.ts","../../../node_modules/@apollo/client/link/core/concat.d.ts","../../../node_modules/@apollo/client/link/core/execute.d.ts","../../../node_modules/@apollo/client/link/core/index.d.ts","../../../node_modules/@apollo/client/link/http/parseandcheckhttpresponse.d.ts","../../../node_modules/@apollo/client/link/http/serializefetchparameter.d.ts","../../../node_modules/@apollo/client/link/http/selecthttpoptionsandbody.d.ts","../../../node_modules/@apollo/client/link/http/checkfetcher.d.ts","../../../node_modules/@apollo/client/link/http/createsignalifsupported.d.ts","../../../node_modules/@apollo/client/link/http/selecturi.d.ts","../../../node_modules/@apollo/client/link/http/createhttplink.d.ts","../../../node_modules/@apollo/client/link/http/httplink.d.ts","../../../node_modules/@apollo/client/link/http/rewriteuriforget.d.ts","../../../node_modules/@apollo/client/link/http/index.d.ts","../../../node_modules/@apollo/client/core/networkstatus.d.ts","../../../node_modules/@apollo/client/link/utils/fromerror.d.ts","../../../node_modules/@apollo/client/link/utils/topromise.d.ts","../../../node_modules/@apollo/client/link/utils/frompromise.d.ts","../../../node_modules/@apollo/client/link/utils/throwservererror.d.ts","../../../node_modules/@apollo/client/link/utils/validateoperation.d.ts","../../../node_modules/@apollo/client/link/utils/createoperation.d.ts","../../../node_modules/@apollo/client/link/utils/transformoperation.d.ts","../../../node_modules/@apollo/client/link/utils/index.d.ts","../../../node_modules/@apollo/client/errors/index.d.ts","../../../node_modules/@apollo/client/core/queryinfo.d.ts","../../../node_modules/@apollo/client/core/localstate.d.ts","../../../node_modules/@apollo/client/core/types.d.ts","../../../node_modules/@apollo/client/core/watchqueryoptions.d.ts","../../../node_modules/@apollo/client/core/querymanager.d.ts","../../../node_modules/@apollo/client/core/observablequery.d.ts","../../../node_modules/@apollo/client/core/apolloclient.d.ts","../../../node_modules/graphql-tag/lib/index.d.ts","../../../node_modules/@apollo/client/core/index.d.ts","../../../node_modules/@apollo/client/link/error/index.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/@apollo/client/react/context/apolloconsumer.d.ts","../../../node_modules/@apollo/client/react/ssr/getdatafromtree.d.ts","../../../node_modules/@apollo/client/react/ssr/rendertostringwithdata.d.ts","../../../node_modules/@apollo/client/react/types/types.d.ts","../../../node_modules/@apollo/client/react/ssr/renderpromises.d.ts","../../../node_modules/@apollo/client/react/ssr/index.d.ts","../../../node_modules/@apollo/client/react/context/apollocontext.d.ts","../../../node_modules/@apollo/client/react/context/apolloprovider.d.ts","../../../node_modules/@apollo/client/react/context/index.d.ts","../../../node_modules/@apollo/client/react/hooks/useapolloclient.d.ts","../../../node_modules/@apollo/client/react/hooks/uselazyquery.d.ts","../../../node_modules/@apollo/client/react/hooks/usemutation.d.ts","../../../node_modules/@apollo/client/react/hooks/usequery.d.ts","../../../node_modules/@apollo/client/react/hooks/usesubscription.d.ts","../../../node_modules/@apollo/client/react/hooks/usereactivevar.d.ts","../../../node_modules/@apollo/client/react/hooks/index.d.ts","../../../node_modules/@apollo/client/react/parser/index.d.ts","../../../node_modules/@apollo/client/react/index.d.ts","../../../node_modules/@apollo/client/index.d.ts","../../../node_modules/eventemitter3/index.d.ts","../../../node_modules/subscriptions-transport-ws/dist/client.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/subscriptions-transport-ws/dist/server.d.ts","../../../node_modules/subscriptions-transport-ws/dist/message-types.d.ts","../../../node_modules/subscriptions-transport-ws/dist/protocol.d.ts","../../../node_modules/subscriptions-transport-ws/dist/index.d.ts","../../../node_modules/@types/extract-files/index.d.ts","../../../node_modules/@types/apollo-upload-client/index.d.ts","../src/graphql-client.ts","../src/types/enumtype.ts","../src/types/variabletype.ts","../src/json-to-grqphql-query.ts","../src/index.ts","../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"12f4cfe2fe60b810c3174537bc2ddb20c1067b7768643d12cb1266fd183afb75","cd379aaae560bbfaac0ef4deaaf52bfe98f84cb32cf0292d9dd935111e35fe20","fd179d7b68260caf075aaabe202dfd39622403405beec3c7a697dec1df338cb2","d086d18c6de38fff9261952724c77cfb8915e09d8e927133565f368ae3f80f6d","115d60d2b07ac7d513543b5e86e13bbf9a9524faf8bdf4985bd7a08815b46406","4a1545bdbccec0209a67da02f760fad629deedbe7d8ac9f55c93c82f95ff5449","7b52c21bd6397ca26df3b7863fa2d5014aa4bbf5621377769726bbd59956e6bc","6b93d6b362ef33a455a7852f7891a6023a8a2bbb03a81cf84bb0f2b627673148","641b9da0622e0225740b5a55f47af9f23f01bf8f4dcbfb81128c16b585900717","5534c99590ae8b633509d9e4d2e1a7bf6511cb7fd1710c36d7723c2f9486aeba","431666f207d18bf924ef0c3b8e1ffabe4e050becb25a82feb9d57355a55ec43d","3ace48f46b43fec335799729ecba491fba8478ef911bbaba4e64ae91ac284082","0da6adbb172817b7101eb1fc5a93310d5b140ac7c3678e3f8891d6177d1f2ce8","95210bf2a09475e9e19fe532fdc2562dced3536fc50f92aad88466950ff11160","912e51e547d6297d2dc7611148c27ed51dbfc544e35298bc30d846e0ae51c376","032aa0bbc88640270f29cfee50f0857ebd903dee14626eb9ec52043d75765173","d24cd8c79f8eb91b85d4a61e75188504f0d2dcd6ab8ebb87ac22a8ba0ec200b2","70055bc7cbe14541919f4b9e4c488b31cc901fa8defa32827ca3ba955a409762","155dc0abafc201d20cb2c4c54d631e13cf286f5a757fff975dc2dd7e196380fe","256eb1263ff0eae669dd39371245c70e082437ebd01dac855dda8ef5bc5a1330","b56adcca0e4ea4e2ff1a527006c90a7eecf5c0637f10b7232d5a6ffb40e1a47e","92910a77d5284b3bb6fb8fa17209d7128619b23a05d8c38b63dbe7b102552145","3084564f4782aacb5f60dee152f260a73b7ec7093432626814d019d2f871b1e9","67aaa92c35872e8ac9ca6092e0010db368656740e28e4486c2cf8064e536d057","04b00c8e04b88f9dd0aefaec6b8c42fa4d1ffdfd9a73131cb6d96b185978d536","17eab666f34227a634a3e24041ea06a7f52cd0216411de7dea6bccaef7ab62ac","1d8dc736a80d377b4ce3b78568038c796485e604cb9c5c664ac5718a5fb63c41","9df9a424cba33791a9f05592ce73c61a6ea6cd0e8d02b5d634601d169e28229c","1a1cfc77cc8eb4bf26f01d2da8059920873646a67cb359e41d5b0842cd423271","4d33127708c239d63baa8c5bdf6f23e50e4a40527bce36e5511bf6d655c873f3","2626836cf152b2231a1d800779a594695b029c19bd49a150e5e994f788a8d9e1","8315d8694e8042084de91475cdb9cc307e50c3b4154776294c899eb7e47bbd09","9fce90d4533619eb5754806401668fa487fbdf0efeeb30c43299aef5a0b5c552","a0aba12f2b210e2151aa6ff772c4c0e1115d437306e1942d7b71f0b45c48ccf3","3b59126bda683d0720973054280a28f57af77498b081985b15779fe85dc96f77","fadd926f5d4644bf9e3161c69104c9f5246e5a5cffbf9076399c3b086ee7f0d3","da2266dd4ecebf71026539d95e36674563a06f869a53ae8e837d512161013dee","e4b3c4ec3ccd3fbe8ed62f6eb3b39c9f0ad574a35eafd1a31077c1e8dd29e93d","4dbbbf7f7b59aa88c2dda60aed5a06c5a57f29b6f931f70ac53bf6cc8aac1cef","8da32928f6184ecfa071cb9aac8e886a640ec68000d72b1fc47a85b5778bdbba","c737d79aaa58f7b5225de26005f12cbfeb60d6e1c0799df85c372a5b3498b313","ccb092565dcf7e8e9eb07dabe8f77a257bb18d10745b78f09501a2826f0b9f7e","50001c90059bbb2d06aabb16ad94b44a9a3dbd0b76a7ad1fbceef53c67ed67ff","103cc813c979b72c032d57fd398bb8a7de019c009a0cd8968f90f149a21c7b09","85aeedbb5aaee4ebb373587871ef070586a3b76eedd345db9dfba6b76bb3d7c0","9fa580d16a5b066442f16778c2846ee169e7ba421f45cd841bcf6d44495b9b13","9cec7eef215c0e9a903104033b96bd6c14fb71dc8b6084c81c869c39acb84101","d204930d40cace62928e7318026791c1e0cef281a06eabde7a98ddddf57154dc","f96b8ea264d72de393165690a473893934773a21cbc29ebadf22a2bbb2e64df2","d2bb51b12f0a2f927774a9a9affed26f0cd925f440f2352c833c55f695b65890","239689e40d3935cd4f340798982febacca88f44ca353b503f654ccb4233370fb","19d4b8c121977c1ea5ad800579d5a4a69007796faa9a547add76a6e94ab91ab4","c70f356c83e8167cd33cc119e908d1d32a9736e8b9f130f8d88fd0d9d498831a","eb9d456c9ba78783d6044925a34d2edcc4ab519bc366e5b42f82fa714eb3d6ae","434ac011dacc3b2659595fbc0555800dd725e626b29cc83292abdb6517262e32","520da364d225aa51b0e7b7adb8fd1a7489a6f680f4bb37ca573024147de84100","aca1a7376ae8f37e0c2b9447633196e3e1671371193451bae8c1ff09e58bad1a","c1c25d86e86ac79472059cf4249b20e04e36f06ead16296a78df76561c9ab59d","c766a7f306fa53af2dacface548cb9590202209e19cd8677febbd66261837a7a","8c403008299cb52d4fb675e9a4cd732a52f1c4c39dba4b2d33a197192c343ea5","c37bf53cf0701fedc43913d79405dcab26450c5aa8afe8bd1b2b4a049da748ae","ebb6dcacb4caa1f40b085fda697f84860fcb74cf3bbb15d5a4f5e0dc27edc6c8","5191da1f2d2e5d8aa799ec10e571e434dc544e9a3e600eeb7dce881f88c3146a","ecf8bb458fd8aa581d044827f214f4c108bd93a32140bd2ed29ca6f2af1bf72f","544e42686ffda36f20b22830f1c1ae966ab1ba4b1f1e6bc68dc6c51d2ace867b","19e18f2211b420eef79412c0bc407119617a7e7699af24d3c70d7d88ee14b2c2","57eb3245f592f2382e2f79b5bdcd3684ba5a21bc0b411de82ef8101284aeb213","74e6286c0c9e2336ac18e6103a82e90a781985604418ff37a695bf9e91148577","53b7b0ad34feb6667b7aa137afb2f87316e8eb2c15d6327355353224fe47b55b","5b581648b2a40a6f970cd938b57270e5e2febf41bfb2813d3176a4ccd9e8fcd5","e74d4b1989725bbdd6ba672055b4e769d3eb90f294d99a683997d1fa6dd3cad5","04017eca924a3c90094ebc57fdc0d60d1c37a8592c988af07926e341fe91fc0b","08b1e0a48d64af7ea99e7911db1a540ebcfef468b4a62c589c40e2de630d786e","f473e9a749dd87ab056d387c4454faba9d21c921b744afbcf9b989043273d44f","cd674d3401bf5b290da4a5e31890305ba67a378b2c01aa8da6ac73feb0685f50","01a1038d946f7820cfb6136f103dc282e3d2cbe8ad2ea244bbe1c15a94727cfb","6123fa53525865f0f96b5e59f98bf56aba6ba4acaa171ec23676d13bc0b77020","19f96045ebaef51fbea86ab5d00f98fd18381eaf54aefe4a6d4d1cd02b866e7d","9ef452a63549b5d29f8c0a8ad8af73e33d23f388b9f34992b8ea9b8c80e2e219","44faba923fbff252b227ab2222946cc55ab7a8d2c941e56afa7d5f4dc38bebbc","005605697e492ea72f9fc309fa31ee8587e0478bbfc9bb72676559dab2f39339","a1c1195f9dd70a8de22947a275074d1c30571c61f762518291e748a7e644ac9e","f2949ec3b920d10267dff3f4803b3db920f81401182af62740a41e76cc26d8f6","23cfdfc12051eef1bddaff6d95cbda090174b36fb105c7d263acdadb76da1577","ffee2f0960a86ceada047cffc3404363bf9e7783e30848199c4d90cb210123dd","e004995dfdf9fd1a97f47cdc6b74ba0f1da186736eac03c6856412661ac6a6d4","36a29c4843b36ccf4b6f0ed12763414a3516f0176563747b99c016ab3a570922","8ce2616be99a635b1346deef302d68969006b044fc82d6992abb432a4956dc6a","ad73903fb76951a5cd4c4e91d9eed60fb9b0114b1477c2da5c55691dd78cdfe6","9db5c31039049a999fe86ec606d07f9fe0074cf9289400c8f7a5f7ffb5719e9f","ccd23805724c86c86eccc2a73e9f1438c7b0a6e08647c0f54f6c2b3f505026a5","101c66c0a04753be2f1604483f98e1f072d1a95418345d3a7593de7ddfd92fc9","ec007e489e7403a1b46f85392a94fef09533a2bb12f9b98e9d433871aac66b5a","8b26b547fc41921b66353c05c2dbdbdb1dc8d0b60a9ea60f912787818bb9c42c","dbce3e1a32c2696ee8f056b92d2442fc0370f7e3d8d95dddc88cdc8d3ca03454","15ac98e72a64754e1a2c673e630f0c3e6dc163ec18ebf326f7f88f45bb80f526","e4188659bc53e80d6c46cf76e5bdc2968a137166f1e5a853088fc6a0aed4f52b","ea3882010173f50840078eb0e7b013a8a1d9d2b23dbe1725fb0e8350c9abd856","85968e53cc97754877d8b409ca3815b1c0f1c4317d41d47b7975a31e8f3a5bf4","b318a3e94029ffc01f1a3eb1797647bf7487a2a179d4da963043c42fdaf0b4f5","05f82884018fbd03c6512b56d11a712c0282dd1df6338473a2ca5bcacffa8fb9","10524f144adcc87a1048a0fff1c02bb022dce22d35caf3d6f68e055c2daf6e37","f254a186c5fc9355b388d5e1643b9f85cb3a84c03d48b0ce7297a352db0b367d","a960dc35ca7a0854d06432d698547debe3a4760438deea197fde8a3ff2101180",{"version":"a26923eb264e2c55ebf3d129659a510551680f5228b2265a21039c7ec55a50c7","affectsGlobalScope":true},"45f238c699f946ac07f7e7eb7f1ae65b7da6323b8146a7cf5b3fd775b8c00b11","fd7059d47830c465f3a32f1928bd61f7ccb62dac8089ecea0c5b2b365afd9b64","f26f3b22a0ce930bf8e6eb27806db849f616784527a93269c2e3861e875815e8","2c309164cb0e2c526d1d275589679024e669a77ada61d5ec7a3ec93b8cbd542c","353ff6badc7a53ba2487f4eb074bd5d0b41db4984134e507b1f6f766780b82fb","2ff93c18956316429e46976ac101b31b030f413ece59231d9a3685bbb239c41f","233fc0209343fa04c2a458537b4aaed00bed49f5db212a1fe5200dcee6e2fa4e","b830de197c8889ab5f03fc2211c2e1cee4478c4a5ceb05af2eaea23d9af3af0a","b62564be4535552ed34c9cececa78a0da7dd5447351e195e8cefaada1ba21129","4c9d4f0962f0caf85200c783d97f7049c5e58a48c6a5825e51fc6f0b974b0e9d","d737fc71b51b3e6c591e3edba25062644bbc95696240460adf5c9109df763fe5","b3dec0879e876086c6bd5d93b671bf3a034da7712ea60b6e815f1de987df060a","50134fabe24e7eb552897d84d2eaefc923d7577a5fef9427e268c469d8cdc7e1","00d3b08e4ea2d4d02e180810c9f6b03be1977d9d2ea5389141d3363efcd58f3c","5c7b4d69e9d49382954fb7c46b9e368b517b11a5f55f34e66b8fd9951fed6d34","47ca4f700d7cbd844259cb0fb35fbe484fdef7b794a6c60c3c8dfe02ad4be3b2","a34a4b7870a629ef38a8912c8ed915d7300fc555ebb75eaae4e1c502222628bb","e41fb0c8db766e1135661341557b83cdfbdd95614f9a4e7c6703e3f41ad1a658","f8555900075ce2073dedb0818960ea42b52d18e5729b44a6dc75c43bbd088ed1","dbd825417d2051294de6b53445bef43b0527e200d78e1a8ae6cfaf818da50278","c2bbb1290dfda842dc0b66a9d50da29972b5bcafd3d4b124a74cef3d3d2af610","59c82aa1d026476297ba6e14c69b055baefd28ad533d02491aa6711eba8b150a","b2c46988d6d7d3d0da5cc2fa0c80e8a4adcb309071d4264ba6d30f2d67cd642c","ab218a7d41436bd2cae6bcbf7371bc9321786471de9997816e549184c3bdc335","9b51dd74a388c13e157c457cc39d59dc2aae2134f6a21cc6b695219932cb8817",{"version":"db06f4cdf70e3689f0cd5a96a6836f34024ad61e8dd01473560ebbcae09c532b","affectsGlobalScope":true},"6c71a186369074378653c84fe944b269db54501e33e790791d59a106482aae86","41db1e358120ce74584d9cf596344db2702f305b649c6c8c55ad4e27c440eaf1","ffb162ad0b1e5c1d9882a81a6af2ee94db93dc4f9fcfeb5e5a7a1025a40c1a24","d18cafabd6456b23ebcf11198c9c056a56361facb07977c653cce50a6ba184f9","29cce97240f57803d3ebbd2dce484634ff8646088287203d461dd97ae29cc692","29bfbafb7d1b80882c83b108f5242bd78aaad7fefc464fda5f571ffe6d8c5a99","a93475d7baca260e4db85215cfa6e59b2357e1f526b056b18ed9c4493e7b80c3","22439dda560fdbd61a07a52b12a58dd167b1116bb3a4f3ca5aeb954de594810c","820a5ca18bb09bc50ebd1856794e9dfbc5a7f855f610e6f9d59cbe3b9e1a7c8f","364524cd4d5db23c9d6aaaa9a8fb2f6d067fb39122728b78efed43055677bdbe","746b1ad552967231e762f8742671ad1f700e3dc3e259aa5def3a1f7f31135aff","1544a3865f518c4e5c6bc623c0f2c54f8aa938cec29742c3087ef981014110ca","3e79b1b6beb23ce850766d185e632d24442afbd54667891c2e052c3ba93062d1","25978fa21b2728d3277888d33df9272738605df94140b4b0c883cf352ec31ca6","c9e5c708eb84894b985071080652da531d4b27ca8cb60963521270239cfe8c20","89561071bc9d84d0d763b929dc34b0920365cd79d5f2a264b4b22a1f211c61d4","c3617c5310a07cac5f9fb1d08a841581010d4884d123c51500e0a08003e308dc","63d3ddfad484b1e3c3e4a3890fa312721064c8570c437081e597b8941a9b0be3","074d0c29700bd9667bc549f460ce2097132e13b2cfafac16be9dbe38756adc17","d20248b40c769f2957741b1fde5580cb2d4cb4c28651f7fd250eb02fa6c98f09","514791e8c0e59bd61576e76f61db12272e949bab76a3af11ccedfb75be3d4794","ad17364042b079f3c14b7d29eac304bcfe25cceb3565b4973f387bf1d5d27782","fccb69b68f78d7fbba625c31a5622a0682dbf8e88b51fd03ea50e721ca596296","2daed8a6f384d9bbfda7a08ad51f194ea391e1a4a581ab8c6af08822d2e1d86e","2f2dca6bd4f2f67a44848a53407e8b19ad36d0fe78b938b612494794d15e4139","b7ebd94ed755d68d46fdb6f1e3c031eb72c8942a08dc9bf4afbc5586d3efbb27","ff5fad599a44994948615b02ab9a4b10215fb631ecbc4d6e0fc8943ba8452d5a","363ae6ba6e8903b1972f9d9b9a57e69df939b2b7294a760ea4bccf2756e48f74","59e117fad3dc25be31325b8595d65e4fad0a323519b244f7095735b29740798e","3245a023245b2174422c427b2826ec5d28e689665b32dfe717b9921f13503c40","ba1380651f4f31c52a3b68dfbd2e820de6bb64de494930b6e990e99f1296edc9","e4dca3b5d2b2f31cfbbeeeefa2a5d2e909c61c00f17aa7be9fc396170981e368","131fdc917c4eec9e3b03d1ccd9a1154ca03cce5c9b3abc5e12677a5234c1ece8","e32e499cdb189c52a79433d0715e822419b6581199df2e93974378269ea7d528","b0b83a5d3e15193408b4145b8e27ffea7666c0a163e9f5f7e95ef960363d9fe1","c754af99b43287268ab8d94c69f0f9005ef3b029a0d35001d2af3297f8cf9f28","dfa584f5099cb5deee0c65137055b520473a23d9e20041bcbc107f2e9592cf14","f5800d0a2b11c8338d1205543f7352850deb101ba2372eb395839a60f9132d94","228700f3848072c320cf259ad6092013128639fd4f28d50a009f7409329865aa","3e7f64156b20e71249be6e8ce2f4ec5eaf265bd82156b75623a9c1044b11ddf5","70d7baad641e61f0e2f32dfb089aae0ffee36080ba0d1405c8be8b740421ea92","0e96ef72a2d31523a5eed98ceccd861e08ec69469fc269e7248e45c4fc66bcf8","6e83430621d62e7a87b205819bcb5ed54bc356e83f20a8654f12e3d43613acce","c18aa3cdf4ca66da764a7bb6a51118674cfcfe18b7dae7024b5080d03fb9e5a5","e20cf252e9c517654604ac4ceea19a0fc1259f24cc89c5e656ea33faa523aedb","95fe56d192ce6f1ca4948005eb47d0cfb68bd6227346a9aa12e7b838c553557e","b1f1ebc4e1589420d6a0586b1d8612802efd03f8a54b375fd1917fdf5a637581","95328498dcf755c3919f360e07c000018c1b54da1bbcc2b36c993364148fc00e","d601b55f6510d6861777197c451c374e14e65afc761f38b416ad814daff3f542","7b492faa09a9fc936c7273e02b9c0b605ad1f7dfcbe03cc31b2f2643ee3ccb20","cd652432d0c0140216907069c48f18667ec3db60d951f37901768dc9b4b63b07","a54f99f4bc9135180f1513ea35248ed4e87d3e3b80c0404648cd2d74bb5916cf","5dcd41aeb5f7119177adab46147589a1618f2b35bd976e6c3a20ec328f58d1bd","6002918a3d55434deb4dd2a8f034411cf185fe77585ccc02b8e141455f060477","3e7b8fe469c41d68fb222fdf7f009887f826b9f19031d95373f03750b55c62cf",{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"1bc82f5b3bb93df76d19730c84467b0b346187198537135d63a672956f323720","affectsGlobalScope":true},"24b77ccef75bd2bd25deb2acfc4723b75d171ed92fe18178b3457073e592a90a","061febff29c5d278119380274e549c882f294b14b2d27e7e8d6b5085797e6a60","5673d28d9adb6209ba1120bfd5bacbfd27e50df4167eb7b7576c6a38f6d82049","a84f2f6153fc2a7ab5206f04ac3083e8fcdbc4bcdc2d38dbc81d9609322290d4","f7972a842e7f36506baab62f5417d3cceda18d2c6af8a2adf41070628e2ad5a2","62c8953f06da3b62d7c6b52bc4d47a04c16484ee8f69aedb85ef35737719d1fe","2771f18413bee37bc63b861f663a843947c86ccfc858e2d0cd83a62c6f1da1af","31ac42673f115c2a476cdb344626de64627dc12fc4212d963b0426bab3ec9610","bf233e782dbbf53cc572be908504bf4c075459cef8af4b81a6b56de19e966946","17708f8c8f046446915bea2dd0ab7daeb27716fed357d7253e049630e1f35216","2787d73275f3815967204846f32abee51471a740dced21aef988be704cc8e50c","217199191521b6913e6778f0fd8c8c5dbeaa2948cbda7f64d12c048be9a69234","3c12c6459a8d6f9541f76948556d2bab432e3f92c2134c0b6b7c4f45f8a049fc","327dce4f7a8a708865565ef6ed316c727072c498a5f6c9fe0097969ff2789980","633c8d4a118ecb39643de5c1220eb9ae464531af9b49bde0457ad4332f26d438","544a639a944b7d6e3fe004cae6f3943f6c471408c10b8697a7ee3d91b9104d52","696cfd8e9589d34ddedc239183efa681cfbf47110722abea5568288f4da55c44","9500809b0594a0597c1699829b1d59717a12c37d8d767759f063d4a3c622d7fa","a47553afcd47d59dc10b5b3b0e6f0c607db4f8b81a3c7acda13326572837a79f","0e58e6f3fa554921c7950ff344d6c299caf9260e4c78bf7c699a6b5a6d02e6bc","3eb80f1addaca2a298abd6186a2cfe98567d88635f334a0f2415438ec5f2d3b7","0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"c2ab70bbc7a24c42a790890739dd8a0ba9d2e15038b40dff8163a97a5d148c00","affectsGlobalScope":true},"422dbb183fdced59425ca072c8bd09efaa77ce4e2ab928ec0d8a1ce062d2a45a",{"version":"2a801b0322994c3dd7f0ef30265d19b3dd3bae6d793596879166ed6219c3da68","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","bcc8caf03ee65fe8610d258752f255fbdddbb2e4de7b6c5628956a5a0d859ec8","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","cc0b61316c4f37393f1f9595e93b673f4184e9d07f4c127165a490ec4a928668","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"c28e5baab1b53377c90d12970e207a2644bc3627840066449e37e2a59125d07e","affectsGlobalScope":true},"7a5459efa09ea82088234e6533a203d528c594b01787fb90fba148885a36e8b6","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","fce6a1a1553ff7d54ffb8bb3ae488c9cb5f2f4f4e52212c1abe40f544819ef35","ad41bb744149e92adb06eb953da195115620a3f2ad48e7d3ae04d10762dae197","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"f548e3501187467575e639cabc2e845f2e217a50d5f6869e32cace49874a4255","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"bd1a08e30569b0fb2f0b21035eb9b039871f68faa9b98accf847e9c878c5e0a9","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"cfe724f7c694aab65a9bdd1acb05997848c504548c9d4c71645c187a091cfa2a","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"3345c276cab0e76dda86c0fb79104ff915a4580ba0f3e440870e183b1baec476","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","e383ff72aabf294913f8c346f5da1445ae6ad525836d28efd52cbadc01a361a6","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7","1835259a20b9fa6b1882931375b69ae5978195f2b139b4e0db51ec8319261649","b52cd693219a63dd21282ac99a7bf55f77cbe8a91f097968856419cc2e05f017","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"267af67ea520cabd16402522756b19ac63d9e2c1c86e7c4d1ddeb991c32e12c9","bc81aff061c53a7140270555f4b22da4ecfe8601e8027cf5aa175fbdc7927c31","8d5af927098c40f41f315552e7ff9ee9376b26fc03e83421a0cf2d93907ea346","c993b44ec48e09bf9e9b512941379656f9090ddf81f7ab61b4d8a6cdbe7ec409","54f323b0c25677fcd7dbb6541667f131e17bf49d48b6efdfed72ae71722fe8f5","7668c31fc1a0d6c5ee0ae1048d41f7232a56fbe18367929f78bd0c77303af11e","c64039a3d43346e9ce9fa12a5ac22b1f4b9f46144b3669260475debb2ae2e0f1",{"version":"880fb35eddd19cf4167bbb7def3531953a335730426c2d7e7c9ddd54d72a0f9c","affectsGlobalScope":true},"e1a6213a4b2a454be3f1d488c1cad81e365505e871b4d2c4f8e52bc982a9c092","62f440af0994f0c61d57db398c736a516113476c1acb2ba381713525eae6b752","fb57116b443ed72833924dcba96c9090c1a4155535b0bd6a6335fed78e180380","9397448f65a53c8c48148918982c18ec3ee554dd671b2b9d16b017cdcce4fad3","529e0cdef5654963edc0fec8f8956e905d675437cf03e346d78d7e0b88e68d4d",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":false,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":true,"target":5,"useDefineForClassFields":false},"fileIdsList":[[140,153,164,187,295],[163,164,165,295],[140,162,187,295],[140,151,163,295],[145,153,154,155,157,158,159,162,163,164,165,166,187,295],[152,153,155,162,163,187,295],[295],[140,155,162,187,295],[140,153,155,157,162,165,187,295],[145,295],[140,155,158,161,163,187,295],[224,295],[140,153,155,158,159,163,187,295],[140,154,162,163,165,187,295],[140,155,158,160,187,224,295],[140,167,187,195,205,217,218,219,221,295],[141,155,167,187,195,205,206,214,215,217,218,219,221,222,223,295],[140,167,187,195,218,222,295],[163,167,187,206,215,216,218,219,220,295],[140,167,187,195,206,215,218,219,220,221,295],[140,167,187,195,206,216,217,218,219,221,295],[140,151,167,187,195,206,215,216,217,219,221,295],[140,151,167,195,218,295],[140,145,205,214,295],[224,248,295],[187,188,295],[189,295],[145,188,189,190,191,192,193,194,295],[140,187,295],[140,187,195,215,295],[145,195,198,295],[195,198,295],[145,196,197,198,199,200,201,202,203,204,295],[195,295],[198,295],[140,195,295],[187,295],[145,207,208,209,210,211,212,213,295],[224,230,295],[224,230,236,295],[145,231,237,238,295],[145,240,241,242,243,244,245,295],[140,151,224,234,295],[224,234,295],[140,145,151,224,234,295],[145,234,239,246,247,295],[140,295],[230,295],[232,233,235,295],[224,230,234,295],[140,151,187,195,215,224,230,295],[173,295],[172,295],[141,142,143,144,295],[140,147,295],[145,146,147,148,149,150,168,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,295],[171,295],[169,170,295],[167,295],[205,224,295,308],[252,295],[255,295],[256,261,295],[257,267,268,275,284,294,295],[257,258,267,275,295],[259,295],[260,261,268,276,295],[261,284,291,295],[262,264,267,275,295],[263,295],[264,265,295],[266,267,295],[267,295],[267,268,269,284,294,295],[267,268,269,284,295],[270,275,284,294,295],[267,268,270,271,275,284,291,294,295],[270,272,284,291,294,295],[252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301],[267,273,295],[274,294,295],[264,267,275,284,295],[276,295],[277,295],[255,278,295],[279,293,295,299],[280,295],[281,295],[267,282,295],[282,283,295,297],[267,284,285,286,295],[284,286,295],[284,285,295],[287,295],[288,295],[267,289,290,295],[289,290,295],[261,275,284,291,295],[292,295],[275,293,295],[256,270,281,294,295],[261,295],[284,295,296],[295,297],[295,298],[256,261,267,269,278,284,294,295,297,299],[284,295,300],[226,227,228,229,295],[267,270,272,275,284,291,294,295,300,302],[46,223,295],[53,54,295],[43,44,46,53,295],[54,55,114,115,295],[43,46,54,295],[44,54,295],[43,46,48,49,50,52,54,55,295],[49,56,70,295],[43,46,50,51,52,54,295],[43,44,50,52,56,295],[42,57,61,69,71,73,113,116,139,295],[44,45,295],[44,45,46,47,53,62,63,64,65,66,67,68,295],[44,45,46,295],[44,295],[43,44,45,46,64,140,295],[46,295],[44,46,53,295],[43,46,295],[72,295],[43,46,50,52,56,295],[43,46,48,49,52,295],[43,46,47,50,295],[49,50,51,52,58,59,60,295],[50,295],[43,46,50,51,295],[52,54,295],[54,295],[43,46,50,295],[44,46,52,65,295],[52,117,295],[50,54,295],[43,46,52,295],[52,295],[46,52,54,295],[43,47,295],[46,50,52,295],[74,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,295],[50,52,295],[43,46,50,51,52,67,295],[75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,295],[67,75,295],[75,295],[43,46,52,54,74,75,295],[43,46,50,51,52,54,67,74,295],[46,56,250,295],[251,295,304,305,306],[140,270,295,302,303],[40,295],[40,224,225,249,295,307,309],[40,41,295,310,313],[40,295,311,312]],"referencedMap":[[165,1],[153,2],[163,3],[164,4],[167,5],[154,6],[156,7],[166,8],[158,9],[159,10],[162,11],[157,12],[160,13],[155,14],[161,15],[222,16],[224,17],[217,18],[206,7],[221,19],[216,20],[220,21],[218,22],[219,23],[215,24],[249,25],[189,26],[193,27],[190,27],[194,27],[191,27],[195,28],[192,27],[188,29],[225,30],[199,7],[202,31],[200,7],[203,32],[205,33],[196,34],[204,35],[198,36],[201,34],[197,10],[212,34],[207,37],[209,37],[214,38],[210,7],[208,37],[213,34],[211,34],[170,7],[141,7],[169,7],[231,39],[237,40],[238,39],[239,41],[246,42],[240,12],[241,43],[242,43],[243,44],[245,12],[244,45],[248,46],[247,47],[232,48],[236,49],[235,50],[233,48],[234,51],[180,7],[182,7],[174,7],[183,52],[181,47],[184,7],[175,10],[173,53],[172,7],[185,7],[142,7],[144,7],[145,54],[143,7],[146,47],[147,47],[148,47],[149,55],[150,47],[187,56],[177,57],[178,57],[176,57],[171,58],[179,57],[168,59],[186,7],[151,47],[309,60],[308,7],[315,7],[252,61],[253,61],[255,62],[256,63],[257,64],[258,65],[259,66],[260,67],[261,68],[262,69],[263,70],[264,71],[265,71],[266,72],[267,73],[268,74],[269,75],[254,7],[301,7],[270,76],[271,77],[272,78],[302,79],[273,80],[274,81],[275,82],[276,83],[277,84],[278,85],[279,86],[280,87],[281,88],[282,89],[283,90],[284,91],[286,92],[285,93],[287,94],[288,95],[289,96],[290,97],[291,98],[292,99],[293,100],[294,101],[295,102],[296,103],[297,104],[298,105],[299,106],[300,107],[228,7],[226,7],[230,108],[227,7],[229,7],[303,109],[152,7],[250,7],[223,110],[55,111],[54,112],[116,113],[115,114],[114,115],[56,116],[71,117],[70,118],[57,119],[140,120],[43,7],[49,7],[48,7],[46,121],[47,7],[69,122],[63,7],[64,123],[53,124],[65,125],[68,126],[66,126],[62,127],[44,7],[45,7],[67,128],[73,129],[72,130],[50,131],[51,132],[61,133],[59,134],[58,134],[52,135],[60,136],[135,137],[129,138],[122,139],[121,140],[130,141],[131,126],[123,142],[136,143],[138,144],[117,145],[118,128],[119,146],[139,147],[120,140],[124,143],[125,148],[132,126],[133,124],[134,148],[137,126],[126,146],[74,149],[127,138],[128,128],[113,150],[111,151],[112,151],[78,151],[79,151],[80,151],[81,151],[82,151],[83,151],[84,151],[85,151],[104,151],[86,151],[87,151],[88,151],[89,151],[90,151],[91,151],[110,151],[92,151],[93,151],[94,151],[95,151],[109,151],[96,151],[107,151],[108,151],[97,151],[98,151],[99,151],[105,151],[106,151],[100,151],[101,151],[102,151],[103,151],[77,152],[76,153],[75,154],[42,7],[251,155],[307,156],[305,7],[306,7],[304,157],[40,7],[8,7],[10,7],[9,7],[2,7],[11,7],[12,7],[13,7],[14,7],[15,7],[16,7],[17,7],[18,7],[3,7],[4,7],[22,7],[19,7],[20,7],[21,7],[23,7],[24,7],[25,7],[5,7],[26,7],[27,7],[28,7],[29,7],[6,7],[30,7],[31,7],[32,7],[33,7],[7,7],[38,7],[34,7],[35,7],[36,7],[37,7],[1,7],[39,7],[41,158],[310,159],[314,160],[313,161],[311,158],[312,158]],"exportedModulesMap":[[165,1],[153,2],[163,3],[164,4],[167,5],[154,6],[156,7],[166,8],[158,9],[159,10],[162,11],[157,12],[160,13],[155,14],[161,15],[222,16],[224,17],[217,18],[206,7],[221,19],[216,20],[220,21],[218,22],[219,23],[215,24],[249,25],[189,26],[193,27],[190,27],[194,27],[191,27],[195,28],[192,27],[188,29],[225,30],[199,7],[202,31],[200,7],[203,32],[205,33],[196,34],[204,35],[198,36],[201,34],[197,10],[212,34],[207,37],[209,37],[214,38],[210,7],[208,37],[213,34],[211,34],[170,7],[141,7],[169,7],[231,39],[237,40],[238,39],[239,41],[246,42],[240,12],[241,43],[242,43],[243,44],[245,12],[244,45],[248,46],[247,47],[232,48],[236,49],[235,50],[233,48],[234,51],[180,7],[182,7],[174,7],[183,52],[181,47],[184,7],[175,10],[173,53],[172,7],[185,7],[142,7],[144,7],[145,54],[143,7],[146,47],[147,47],[148,47],[149,55],[150,47],[187,56],[177,57],[178,57],[176,57],[171,58],[179,57],[168,59],[186,7],[151,47],[309,60],[308,7],[315,7],[252,61],[253,61],[255,62],[256,63],[257,64],[258,65],[259,66],[260,67],[261,68],[262,69],[263,70],[264,71],[265,71],[266,72],[267,73],[268,74],[269,75],[254,7],[301,7],[270,76],[271,77],[272,78],[302,79],[273,80],[274,81],[275,82],[276,83],[277,84],[278,85],[279,86],[280,87],[281,88],[282,89],[283,90],[284,91],[286,92],[285,93],[287,94],[288,95],[289,96],[290,97],[291,98],[292,99],[293,100],[294,101],[295,102],[296,103],[297,104],[298,105],[299,106],[300,107],[228,7],[226,7],[230,108],[227,7],[229,7],[303,109],[152,7],[250,7],[223,110],[55,111],[54,112],[116,113],[115,114],[114,115],[56,116],[71,117],[70,118],[57,119],[140,120],[43,7],[49,7],[48,7],[46,121],[47,7],[69,122],[63,7],[64,123],[53,124],[65,125],[68,126],[66,126],[62,127],[44,7],[45,7],[67,128],[73,129],[72,130],[50,131],[51,132],[61,133],[59,134],[58,134],[52,135],[60,136],[135,137],[129,138],[122,139],[121,140],[130,141],[131,126],[123,142],[136,143],[138,144],[117,145],[118,128],[119,146],[139,147],[120,140],[124,143],[125,148],[132,126],[133,124],[134,148],[137,126],[126,146],[74,149],[127,138],[128,128],[113,150],[111,151],[112,151],[78,151],[79,151],[80,151],[81,151],[82,151],[83,151],[84,151],[85,151],[104,151],[86,151],[87,151],[88,151],[89,151],[90,151],[91,151],[110,151],[92,151],[93,151],[94,151],[95,151],[109,151],[96,151],[107,151],[108,151],[97,151],[98,151],[99,151],[105,151],[106,151],[100,151],[101,151],[102,151],[103,151],[77,152],[76,153],[75,154],[42,7],[251,155],[307,156],[305,7],[306,7],[304,157],[40,7],[8,7],[10,7],[9,7],[2,7],[11,7],[12,7],[13,7],[14,7],[15,7],[16,7],[17,7],[18,7],[3,7],[4,7],[22,7],[19,7],[20,7],[21,7],[23,7],[24,7],[25,7],[5,7],[26,7],[27,7],[28,7],[29,7],[6,7],[30,7],[31,7],[32,7],[33,7],[7,7],[38,7],[34,7],[35,7],[36,7],[37,7],[1,7],[39,7],[41,158],[310,159],[314,160],[313,161],[311,158],[312,158]],"semanticDiagnosticsPerFile":[165,153,163,164,167,154,156,166,158,159,162,157,160,155,161,222,224,217,206,221,216,220,218,219,215,249,189,193,190,194,191,195,192,188,225,199,202,200,203,205,196,204,198,201,197,212,207,209,214,210,208,213,211,170,141,169,231,237,238,239,246,240,241,242,243,245,244,248,247,232,236,235,233,234,180,182,174,183,181,184,175,173,172,185,142,144,145,143,146,147,148,149,150,187,177,178,176,171,179,168,186,151,309,308,315,252,253,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,254,301,270,271,272,302,273,274,275,276,277,278,279,280,281,282,283,284,286,285,287,288,289,290,291,292,293,294,295,296,297,298,299,300,228,226,230,227,229,303,152,250,223,55,54,116,115,114,56,71,70,57,140,43,49,48,46,47,69,63,64,53,65,68,66,62,44,45,67,73,72,50,51,61,59,58,52,60,135,129,122,121,130,131,123,136,138,117,118,119,139,120,124,125,132,133,134,137,126,74,127,128,113,111,112,78,79,80,81,82,83,84,85,104,86,87,88,89,90,91,110,92,93,94,95,109,96,107,108,97,98,99,105,106,100,101,102,103,77,76,75,42,251,307,305,306,304,40,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,38,34,35,36,37,1,39,41,310,314,313,311,312]},"version":"4.5.4"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent graphql-client following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "heartyoh@hatiolab.com",
6
- "version": "0.2.51",
6
+ "version": "0.3.4",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
9
9
  "publishConfig": {
@@ -35,7 +35,6 @@
35
35
  "@apollo/client": "^3.5.6",
36
36
  "apollo-upload-client": "^17.0.0",
37
37
  "graphql-tag": "^2.12.6",
38
- "json-to-graphql-query": "^2.1.0",
39
38
  "lit": "^2.0.2",
40
39
  "subscriptions-transport-ws": "^0.11.0"
41
40
  },
@@ -95,5 +94,6 @@
95
94
  "eslint --fix",
96
95
  "prettier --write"
97
96
  ]
98
- }
97
+ },
98
+ "gitHead": "730f7f88d9feaec4e42fdfa8f4bd9503f04df72e"
99
99
  }
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './gql-context'
2
2
  export * from './graphql-client'
3
- export * from 'json-to-graphql-query'
3
+ export * from './json-to-grqphql-query'
@@ -0,0 +1,206 @@
1
+ /* inspired by https://github.com/dupski/json-to-graphql-query */
2
+
3
+ import { EnumType } from './types/EnumType'
4
+ import { VariableType } from './types/VariableType'
5
+
6
+ export const configFields = [
7
+ '__args',
8
+ '__alias',
9
+ '__aliasFor',
10
+ '__variables',
11
+ '__directives',
12
+ '__on',
13
+ '__all_on',
14
+ '__typeName',
15
+ '__name'
16
+ ]
17
+
18
+ function stringify(obj_from_json: any): string {
19
+ if (obj_from_json instanceof EnumType) {
20
+ return obj_from_json.value
21
+ }
22
+ // variables should be prefixed with dollar sign and not quoted
23
+ else if (obj_from_json instanceof VariableType) {
24
+ return `$${obj_from_json.value}`
25
+ }
26
+ // Cheers to Derek: https://stackoverflow.com/questions/11233498/json-stringify-without-quotes-on-properties
27
+ else if (typeof obj_from_json !== 'object' || obj_from_json === null) {
28
+ // not an object, stringify using native function
29
+ return JSON.stringify(obj_from_json)
30
+ } else if (Array.isArray(obj_from_json)) {
31
+ return `[${obj_from_json.map(item => stringify(item)).join(', ')}]`
32
+ }
33
+ // Implements recursive object serialization according to JSON spec
34
+ // but without quotes around the keys.
35
+ const props: string = Object.keys(obj_from_json)
36
+ .map(key => `${key}: ${stringify(obj_from_json[key])}`)
37
+ .join(', ')
38
+
39
+ return `{${props}}`
40
+ }
41
+
42
+ export function buildArgs(argsObj: any): string {
43
+ const args = []
44
+ for (const argName in argsObj) {
45
+ args.push(`${argName}: ${stringify(argsObj[argName])}`)
46
+ }
47
+ return args.join(', ')
48
+ }
49
+
50
+ export function buildVariables(varsObj: any): string {
51
+ const args = []
52
+ for (const varName in varsObj) {
53
+ args.push(`$${varName}: ${varsObj[varName]}`)
54
+ }
55
+ return args.join(', ')
56
+ }
57
+
58
+ function buildDirectives(dirsObj: any): string {
59
+ const directiveName = Object.keys(dirsObj)[0]
60
+ const directiveValue = dirsObj[directiveName]
61
+ if (typeof directiveValue === 'boolean') {
62
+ return directiveName
63
+ } else if (typeof directiveValue === 'object') {
64
+ const args = []
65
+ for (const argName in directiveValue) {
66
+ const argVal = stringify(directiveValue[argName]).replace(/"/g, '')
67
+ args.push(`${argName}: ${argVal}`)
68
+ }
69
+ return `${directiveName}(${args.join(', ')})`
70
+ } else {
71
+ throw new Error(
72
+ `Unsupported type for directive: ${typeof directiveValue}. Types allowed: object, boolean.\n` +
73
+ `Offending object: ${JSON.stringify(dirsObj)}`
74
+ )
75
+ }
76
+ }
77
+
78
+ function getIndent(level: number): string {
79
+ return Array(level * 4 + 1).join(' ')
80
+ }
81
+
82
+ function filterNonConfigFields(fieldName: string, ignoreFields: string[]) {
83
+ // Returns true if fieldName is not a 'configField'.
84
+ return configFields.indexOf(fieldName) == -1 && ignoreFields.indexOf(fieldName) == -1
85
+ }
86
+
87
+ function convertQuery(node: any, level: number, output: [string, number][], options: IJsonToGraphQLOptions) {
88
+ Object.keys(node)
89
+ .filter(key => filterNonConfigFields(key, options.ignoreFields!))
90
+ .forEach(key => {
91
+ let value = node[key]
92
+ if (typeof value === 'object') {
93
+ if (Array.isArray(value)) {
94
+ value = value.find(item => item && typeof item === 'object')
95
+ if (!value) {
96
+ output.push([`${key}`, level])
97
+ return
98
+ }
99
+ }
100
+
101
+ const fieldCount = Object.keys(value).filter(keyCount =>
102
+ filterNonConfigFields(keyCount, options.ignoreFields!)
103
+ ).length
104
+ const subFields = fieldCount > 0
105
+ const argsExist = typeof value.__args === 'object' && Object.keys(value.__args).length > 0
106
+ const directivesExist = typeof value.__directives === 'object'
107
+ const fullFragmentsExist = value.__all_on instanceof Array
108
+ const partialFragmentsExist = typeof value.__on === 'object'
109
+
110
+ let token = `${key}`
111
+
112
+ if (typeof value.__name === 'string') {
113
+ token = `${token} ${value.__name}`
114
+ }
115
+
116
+ if (typeof value.__aliasFor === 'string') {
117
+ token = `${token}: ${value.__aliasFor}`
118
+ }
119
+
120
+ if (typeof value.__variables === 'object') {
121
+ token = `${token} (${buildVariables(value.__variables)})`
122
+ } else if (argsExist || directivesExist) {
123
+ let argsStr = ''
124
+ let dirsStr = ''
125
+ if (directivesExist) {
126
+ // TODO: Add support for multiple directives on one node.
127
+ const numDirectives = Object.keys(value.__directives).length
128
+ if (numDirectives > 1) {
129
+ throw new Error(
130
+ `Too many directives. The object/key ` +
131
+ `'${Object.keys(value)[0]}' had ${numDirectives} directives, ` +
132
+ `but only 1 directive per object/key is supported at this time.`
133
+ )
134
+ }
135
+ dirsStr = `@${buildDirectives(value.__directives)}`
136
+ }
137
+ if (argsExist) {
138
+ argsStr = `(${buildArgs(value.__args)})`
139
+ }
140
+ const spacer = directivesExist && argsExist ? ' ' : ''
141
+ token = `${token} ${dirsStr}${spacer}${argsStr}`
142
+ }
143
+
144
+ output.push([token + (subFields || partialFragmentsExist || fullFragmentsExist ? ' {' : ''), level])
145
+ convertQuery(value, level + 1, output, options)
146
+
147
+ if (fullFragmentsExist) {
148
+ value.__all_on.forEach((fullFragment: string) => {
149
+ output.push([`...${fullFragment}`, level + 1])
150
+ })
151
+ }
152
+ if (partialFragmentsExist) {
153
+ const inlineFragments: { __typeName: string }[] = value.__on instanceof Array ? value.__on : [value.__on]
154
+ inlineFragments.forEach(inlineFragment => {
155
+ const name = inlineFragment.__typeName
156
+ output.push([`... on ${name} {`, level + 1])
157
+ convertQuery(inlineFragment, level + 2, output, options)
158
+ output.push(['}', level + 1])
159
+ })
160
+ }
161
+
162
+ if (subFields || partialFragmentsExist || fullFragmentsExist) {
163
+ output.push(['}', level])
164
+ }
165
+ } else if (options.includeFalsyKeys === true || value) {
166
+ output.push([`${key}`, level])
167
+ }
168
+ })
169
+ }
170
+
171
+ export interface IJsonToGraphQLOptions {
172
+ pretty?: boolean
173
+ ignoreFields?: string[]
174
+ includeFalsyKeys?: boolean
175
+ }
176
+
177
+ export function jsonToGraphQLQuery(query: any, options: IJsonToGraphQLOptions = {}) {
178
+ if (!query || typeof query != 'object') {
179
+ throw new Error('query object not specified')
180
+ }
181
+ if (Object.keys(query).length == 0) {
182
+ throw new Error('query object has no data')
183
+ }
184
+ if (!(options.ignoreFields instanceof Array)) {
185
+ options.ignoreFields = []
186
+ }
187
+
188
+ const queryLines: [string, number][] = []
189
+ convertQuery(query, 0, queryLines, options)
190
+
191
+ let output = ''
192
+ queryLines.forEach(([line, level]) => {
193
+ if (options.pretty) {
194
+ if (output) {
195
+ output += '\n'
196
+ }
197
+ output += getIndent(level) + line
198
+ } else {
199
+ if (output) {
200
+ output += ' '
201
+ }
202
+ output += line
203
+ }
204
+ })
205
+ return output
206
+ }
@@ -0,0 +1,5 @@
1
+ class EnumType {
2
+ constructor(public value: string) {}
3
+ }
4
+
5
+ export { EnumType }
@@ -0,0 +1,9 @@
1
+ class VariableType {
2
+ constructor(public value: string) {}
3
+
4
+ toJSON() {
5
+ return `$${this.value}`
6
+ }
7
+ }
8
+
9
+ export { VariableType }
package/tsconfig.json CHANGED
@@ -9,6 +9,7 @@
9
9
  "esModuleInterop": false,
10
10
  "allowSyntheticDefaultImports": true,
11
11
  "experimentalDecorators": true,
12
+ "useDefineForClassFields": false,
12
13
  "importHelpers": true,
13
14
  "outDir": "dist",
14
15
  "sourceMap": true,