@deenruv/replicate-plugin 1.0.17-dev.20 → 1.0.17-dev.24
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/plugin-server/graphql/generated-admin-types.d.ts +411 -61
- package/dist/plugin-server/graphql/generated-admin-types.js +29 -11
- package/dist/plugin-server/zeus/const.js +802 -634
- package/dist/plugin-server/zeus/index.d.ts +5727 -3479
- package/dist/plugin-server/zeus/index.js +123 -82
- package/dist/plugin-server/zeus/typedDocumentNode.d.ts +2 -2
- package/dist/plugin-ui/graphql/queries.d.ts +2 -2
- package/dist/plugin-ui/graphql/selectors.d.ts +3 -2
- package/dist/plugin-ui/zeus/const.js +802 -634
- package/dist/plugin-ui/zeus/index.d.ts +5727 -3479
- package/dist/plugin-ui/zeus/index.js +123 -82
- package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +2 -2
- package/dist/plugin-ui/zeus/typedDocumentNode.js +2 -2
- package/package.json +6 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import { AllTypesProps, ReturnTypes, Ops } from
|
|
3
|
-
export const HOST = "
|
|
2
|
+
import { AllTypesProps, ReturnTypes, Ops } from "./const.js";
|
|
3
|
+
export const HOST = "Specify host";
|
|
4
4
|
export const HEADERS = {};
|
|
5
5
|
export const apiSubscription = (options) => (query) => {
|
|
6
6
|
try {
|
|
7
|
-
const queryString = options[0] +
|
|
8
|
-
const wsString = queryString.replace(
|
|
7
|
+
const queryString = options[0] + "?query=" + encodeURIComponent(query);
|
|
8
|
+
const wsString = queryString.replace("http", "ws");
|
|
9
9
|
const host = (options.length > 1 && options[1]?.websocket?.[0]) || wsString;
|
|
10
10
|
const webSocketOptions = options[1]?.websocket || [host];
|
|
11
11
|
const ws = new WebSocket(...webSocketOptions);
|
|
@@ -32,7 +32,7 @@ export const apiSubscription = (options) => (query) => {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
catch {
|
|
35
|
-
throw new Error(
|
|
35
|
+
throw new Error("No websockets implemented");
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
const handleFetchResponse = (response) => {
|
|
@@ -55,7 +55,7 @@ const handleFetchResponse = (response) => {
|
|
|
55
55
|
};
|
|
56
56
|
export const apiFetch = (options) => (query, variables = {}) => {
|
|
57
57
|
const fetchOptions = options[1] || {};
|
|
58
|
-
if (fetchOptions.method && fetchOptions.method ===
|
|
58
|
+
if (fetchOptions.method && fetchOptions.method === "GET") {
|
|
59
59
|
return fetch(`${options[0]}?query=${encodeURIComponent(query)}`, fetchOptions)
|
|
60
60
|
.then(handleFetchResponse)
|
|
61
61
|
.then((response) => {
|
|
@@ -67,9 +67,9 @@ export const apiFetch = (options) => (query, variables = {}) => {
|
|
|
67
67
|
}
|
|
68
68
|
return fetch(`${options[0]}`, {
|
|
69
69
|
body: JSON.stringify({ query, variables }),
|
|
70
|
-
method:
|
|
70
|
+
method: "POST",
|
|
71
71
|
headers: {
|
|
72
|
-
|
|
72
|
+
"Content-Type": "application/json",
|
|
73
73
|
},
|
|
74
74
|
...fetchOptions,
|
|
75
75
|
})
|
|
@@ -82,16 +82,16 @@ export const apiFetch = (options) => (query, variables = {}) => {
|
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
export const InternalsBuildQuery = ({ ops, props, returns, options, scalars, }) => {
|
|
85
|
-
const ibb = (k, o, p =
|
|
85
|
+
const ibb = (k, o, p = "", root = true, vars = []) => {
|
|
86
86
|
const keyForPath = purifyGraphQLKey(k);
|
|
87
87
|
const newPath = [p, keyForPath].join(SEPARATOR);
|
|
88
88
|
if (!o) {
|
|
89
|
-
return
|
|
89
|
+
return "";
|
|
90
90
|
}
|
|
91
|
-
if (typeof o ===
|
|
91
|
+
if (typeof o === "boolean" || typeof o === "number") {
|
|
92
92
|
return k;
|
|
93
93
|
}
|
|
94
|
-
if (typeof o ===
|
|
94
|
+
if (typeof o === "string") {
|
|
95
95
|
return `${k} ${o}`;
|
|
96
96
|
}
|
|
97
97
|
if (Array.isArray(o)) {
|
|
@@ -104,29 +104,32 @@ export const InternalsBuildQuery = ({ ops, props, returns, options, scalars, })
|
|
|
104
104
|
})(o[0], newPath);
|
|
105
105
|
return `${ibb(args ? `${k}(${args})` : k, o[1], p, false, vars)}`;
|
|
106
106
|
}
|
|
107
|
-
if (k ===
|
|
107
|
+
if (k === "__alias") {
|
|
108
108
|
return Object.entries(o)
|
|
109
109
|
.map(([alias, objectUnderAlias]) => {
|
|
110
|
-
if (typeof objectUnderAlias !==
|
|
111
|
-
|
|
110
|
+
if (typeof objectUnderAlias !== "object" ||
|
|
111
|
+
Array.isArray(objectUnderAlias)) {
|
|
112
|
+
throw new Error("Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}");
|
|
112
113
|
}
|
|
113
114
|
const operationName = Object.keys(objectUnderAlias)[0];
|
|
114
115
|
const operation = objectUnderAlias[operationName];
|
|
115
116
|
return ibb(`${alias}:${operationName}`, operation, p, false, vars);
|
|
116
117
|
})
|
|
117
|
-
.join(
|
|
118
|
+
.join("\n");
|
|
118
119
|
}
|
|
119
|
-
const hasOperationName = root && options?.operationName ?
|
|
120
|
-
const keyForDirectives = o.__directives ??
|
|
120
|
+
const hasOperationName = root && options?.operationName ? " " + options.operationName : "";
|
|
121
|
+
const keyForDirectives = o.__directives ?? "";
|
|
121
122
|
const query = `{${Object.entries(o)
|
|
122
|
-
.filter(([k]) => k !==
|
|
123
|
+
.filter(([k]) => k !== "__directives")
|
|
123
124
|
.map((e) => ibb(...e, [p, `field<>${keyForPath}`].join(SEPARATOR), false, vars))
|
|
124
|
-
.join(
|
|
125
|
+
.join("\n")}}`;
|
|
125
126
|
if (!root) {
|
|
126
127
|
return `${k} ${keyForDirectives}${hasOperationName} ${query}`;
|
|
127
128
|
}
|
|
128
|
-
const varsString = vars
|
|
129
|
-
|
|
129
|
+
const varsString = vars
|
|
130
|
+
.map((v) => `${v.name}: ${v.graphQLType}`)
|
|
131
|
+
.join(", ");
|
|
132
|
+
return `${k} ${keyForDirectives}${hasOperationName}${varsString ? `(${varsString})` : ""} ${query}`;
|
|
130
133
|
};
|
|
131
134
|
return ibb;
|
|
132
135
|
};
|
|
@@ -193,26 +196,30 @@ export const Selector = (key) => key && ZeusSelect();
|
|
|
193
196
|
export const TypeFromSelector = (key) => key && ZeusSelect();
|
|
194
197
|
export const Gql = Chain(HOST, {
|
|
195
198
|
headers: {
|
|
196
|
-
|
|
199
|
+
"Content-Type": "application/json",
|
|
197
200
|
...HEADERS,
|
|
198
201
|
},
|
|
199
202
|
});
|
|
200
203
|
export const ZeusScalars = ZeusSelect();
|
|
201
204
|
export const fields = (k) => {
|
|
202
205
|
const t = ReturnTypes[k];
|
|
203
|
-
const fnType = k in AllTypesProps
|
|
204
|
-
|
|
206
|
+
const fnType = k in AllTypesProps
|
|
207
|
+
? AllTypesProps[k]
|
|
208
|
+
: undefined;
|
|
209
|
+
const hasFnTypes = typeof fnType === "object" ? fnType : undefined;
|
|
205
210
|
const o = Object.fromEntries(Object.entries(t)
|
|
206
211
|
.filter(([k, value]) => {
|
|
207
|
-
const isFunctionType = hasFnTypes &&
|
|
212
|
+
const isFunctionType = hasFnTypes &&
|
|
213
|
+
k in hasFnTypes &&
|
|
214
|
+
!!hasFnTypes[k];
|
|
208
215
|
if (isFunctionType)
|
|
209
216
|
return false;
|
|
210
217
|
const isReturnType = ReturnTypes[value];
|
|
211
218
|
if (!isReturnType)
|
|
212
219
|
return true;
|
|
213
|
-
if (typeof isReturnType !==
|
|
220
|
+
if (typeof isReturnType !== "string")
|
|
214
221
|
return false;
|
|
215
|
-
if (isReturnType.startsWith(
|
|
222
|
+
if (isReturnType.startsWith("scalar.")) {
|
|
216
223
|
return true;
|
|
217
224
|
}
|
|
218
225
|
return false;
|
|
@@ -246,12 +253,15 @@ export const traverseResponse = ({ resolvers, scalarPaths, }) => {
|
|
|
246
253
|
const scalarPathString = p.join(SEPARATOR);
|
|
247
254
|
const currentScalarString = scalarPaths[scalarPathString];
|
|
248
255
|
if (currentScalarString) {
|
|
249
|
-
const currentDecoder = resolvers[currentScalarString.split(
|
|
256
|
+
const currentDecoder = resolvers[currentScalarString.split(".")[1]]?.decode;
|
|
250
257
|
if (currentDecoder) {
|
|
251
258
|
return currentDecoder(o);
|
|
252
259
|
}
|
|
253
260
|
}
|
|
254
|
-
if (typeof o ===
|
|
261
|
+
if (typeof o === "boolean" ||
|
|
262
|
+
typeof o === "number" ||
|
|
263
|
+
typeof o === "string" ||
|
|
264
|
+
!o) {
|
|
255
265
|
return o;
|
|
256
266
|
}
|
|
257
267
|
const entries = Object.entries(o).map(([k, v]) => [k, ibb(k, v, [...p, purifyGraphQLKey(k)])]);
|
|
@@ -263,15 +273,15 @@ export const traverseResponse = ({ resolvers, scalarPaths, }) => {
|
|
|
263
273
|
};
|
|
264
274
|
return ibb;
|
|
265
275
|
};
|
|
266
|
-
export const SEPARATOR =
|
|
276
|
+
export const SEPARATOR = "|";
|
|
267
277
|
export class GraphQLError extends Error {
|
|
268
278
|
constructor(response) {
|
|
269
|
-
super(
|
|
279
|
+
super("");
|
|
270
280
|
this.response = response;
|
|
271
281
|
console.error(response);
|
|
272
282
|
}
|
|
273
283
|
toString() {
|
|
274
|
-
return
|
|
284
|
+
return "GraphQL Response Error";
|
|
275
285
|
}
|
|
276
286
|
}
|
|
277
287
|
const ExtractScalar = (mappedParts, returns) => {
|
|
@@ -280,7 +290,7 @@ const ExtractScalar = (mappedParts, returns) => {
|
|
|
280
290
|
}
|
|
281
291
|
const oKey = mappedParts[0];
|
|
282
292
|
const returnP1 = returns[oKey];
|
|
283
|
-
if (typeof returnP1 ===
|
|
293
|
+
if (typeof returnP1 === "object") {
|
|
284
294
|
const returnP2 = returnP1[mappedParts[1]];
|
|
285
295
|
if (returnP2) {
|
|
286
296
|
return ExtractScalar([returnP2, ...mappedParts.slice(2)], returns);
|
|
@@ -289,15 +299,17 @@ const ExtractScalar = (mappedParts, returns) => {
|
|
|
289
299
|
}
|
|
290
300
|
return returnP1;
|
|
291
301
|
};
|
|
292
|
-
export const PrepareScalarPaths = ({ ops, returns }) => {
|
|
302
|
+
export const PrepareScalarPaths = ({ ops, returns, }) => {
|
|
293
303
|
const ibb = (k, originalKey, o, p = [], pOriginals = [], root = true) => {
|
|
294
304
|
if (!o) {
|
|
295
305
|
return;
|
|
296
306
|
}
|
|
297
|
-
if (typeof o ===
|
|
307
|
+
if (typeof o === "boolean" ||
|
|
308
|
+
typeof o === "number" ||
|
|
309
|
+
typeof o === "string") {
|
|
298
310
|
const extractionArray = [...pOriginals, originalKey];
|
|
299
311
|
const isScalar = ExtractScalar(extractionArray, returns);
|
|
300
|
-
if (isScalar?.startsWith(
|
|
312
|
+
if (isScalar?.startsWith("scalar")) {
|
|
301
313
|
const partOfTree = {
|
|
302
314
|
[[...p, k].join(SEPARATOR)]: isScalar,
|
|
303
315
|
};
|
|
@@ -308,11 +320,12 @@ export const PrepareScalarPaths = ({ ops, returns }) => {
|
|
|
308
320
|
if (Array.isArray(o)) {
|
|
309
321
|
return ibb(k, k, o[1], p, pOriginals, false);
|
|
310
322
|
}
|
|
311
|
-
if (k ===
|
|
323
|
+
if (k === "__alias") {
|
|
312
324
|
return Object.entries(o)
|
|
313
325
|
.map(([alias, objectUnderAlias]) => {
|
|
314
|
-
if (typeof objectUnderAlias !==
|
|
315
|
-
|
|
326
|
+
if (typeof objectUnderAlias !== "object" ||
|
|
327
|
+
Array.isArray(objectUnderAlias)) {
|
|
328
|
+
throw new Error("Invalid alias it should be __alias:{ YOUR_ALIAS_NAME: { OPERATION_NAME: { ...selectors }}}");
|
|
316
329
|
}
|
|
317
330
|
const operationName = Object.keys(objectUnderAlias)[0];
|
|
318
331
|
const operation = objectUnderAlias[operationName];
|
|
@@ -325,11 +338,13 @@ export const PrepareScalarPaths = ({ ops, returns }) => {
|
|
|
325
338
|
}
|
|
326
339
|
const keyName = root ? ops[k] : k;
|
|
327
340
|
return Object.entries(o)
|
|
328
|
-
.filter(([k]) => k !==
|
|
341
|
+
.filter(([k]) => k !== "__directives")
|
|
329
342
|
.map(([k, v]) => {
|
|
330
343
|
// Inline fragments shouldn't be added to the path as they aren't a field
|
|
331
344
|
const isInlineFragment = originalKey.match(/^...\s*on/) != null;
|
|
332
|
-
return ibb(k, k, v, isInlineFragment ? p : [...p, purifyGraphQLKey(keyName || k)], isInlineFragment
|
|
345
|
+
return ibb(k, k, v, isInlineFragment ? p : [...p, purifyGraphQLKey(keyName || k)], isInlineFragment
|
|
346
|
+
? pOriginals
|
|
347
|
+
: [...pOriginals, purifyGraphQLKey(originalKey)], false);
|
|
333
348
|
})
|
|
334
349
|
.reduce((a, b) => ({
|
|
335
350
|
...a,
|
|
@@ -338,47 +353,49 @@ export const PrepareScalarPaths = ({ ops, returns }) => {
|
|
|
338
353
|
};
|
|
339
354
|
return ibb;
|
|
340
355
|
};
|
|
341
|
-
export const purifyGraphQLKey = (k) => k.replace(/\([^)]*\)/g,
|
|
356
|
+
export const purifyGraphQLKey = (k) => k.replace(/\([^)]*\)/g, "").replace(/^[^:]*\:/g, "");
|
|
342
357
|
const mapPart = (p) => {
|
|
343
|
-
const [isArg, isField] = p.split(
|
|
358
|
+
const [isArg, isField] = p.split("<>");
|
|
344
359
|
if (isField) {
|
|
345
360
|
return {
|
|
346
361
|
v: isField,
|
|
347
|
-
__type:
|
|
362
|
+
__type: "field",
|
|
348
363
|
};
|
|
349
364
|
}
|
|
350
365
|
return {
|
|
351
366
|
v: isArg,
|
|
352
|
-
__type:
|
|
367
|
+
__type: "arg",
|
|
353
368
|
};
|
|
354
369
|
};
|
|
355
370
|
export const ResolveFromPath = (props, returns, ops) => {
|
|
356
371
|
const ResolvePropsType = (mappedParts) => {
|
|
357
372
|
const oKey = ops[mappedParts[0].v];
|
|
358
373
|
const propsP1 = oKey ? props[oKey] : props[mappedParts[0].v];
|
|
359
|
-
if (propsP1 ===
|
|
360
|
-
return
|
|
374
|
+
if (propsP1 === "enum" && mappedParts.length === 1) {
|
|
375
|
+
return "enum";
|
|
361
376
|
}
|
|
362
|
-
if (typeof propsP1 ===
|
|
377
|
+
if (typeof propsP1 === "string" &&
|
|
378
|
+
propsP1.startsWith("scalar.") &&
|
|
379
|
+
mappedParts.length === 1) {
|
|
363
380
|
return propsP1;
|
|
364
381
|
}
|
|
365
|
-
if (typeof propsP1 ===
|
|
382
|
+
if (typeof propsP1 === "object") {
|
|
366
383
|
if (mappedParts.length < 2) {
|
|
367
|
-
return
|
|
384
|
+
return "not";
|
|
368
385
|
}
|
|
369
386
|
const propsP2 = propsP1[mappedParts[1].v];
|
|
370
|
-
if (typeof propsP2 ===
|
|
387
|
+
if (typeof propsP2 === "string") {
|
|
371
388
|
return rpp(`${propsP2}${SEPARATOR}${mappedParts
|
|
372
389
|
.slice(2)
|
|
373
390
|
.map((mp) => mp.v)
|
|
374
391
|
.join(SEPARATOR)}`);
|
|
375
392
|
}
|
|
376
|
-
if (typeof propsP2 ===
|
|
393
|
+
if (typeof propsP2 === "object") {
|
|
377
394
|
if (mappedParts.length < 3) {
|
|
378
|
-
return
|
|
395
|
+
return "not";
|
|
379
396
|
}
|
|
380
397
|
const propsP3 = propsP2[mappedParts[2].v];
|
|
381
|
-
if (propsP3 && mappedParts[2].__type ===
|
|
398
|
+
if (propsP3 && mappedParts[2].__type === "arg") {
|
|
382
399
|
return rpp(`${propsP3}${SEPARATOR}${mappedParts
|
|
383
400
|
.slice(3)
|
|
384
401
|
.map((mp) => mp.v)
|
|
@@ -389,13 +406,13 @@ export const ResolveFromPath = (props, returns, ops) => {
|
|
|
389
406
|
};
|
|
390
407
|
const ResolveReturnType = (mappedParts) => {
|
|
391
408
|
if (mappedParts.length === 0) {
|
|
392
|
-
return
|
|
409
|
+
return "not";
|
|
393
410
|
}
|
|
394
411
|
const oKey = ops[mappedParts[0].v];
|
|
395
412
|
const returnP1 = oKey ? returns[oKey] : returns[mappedParts[0].v];
|
|
396
|
-
if (typeof returnP1 ===
|
|
413
|
+
if (typeof returnP1 === "object") {
|
|
397
414
|
if (mappedParts.length < 2)
|
|
398
|
-
return
|
|
415
|
+
return "not";
|
|
399
416
|
const returnP2 = returnP1[mappedParts[1].v];
|
|
400
417
|
if (returnP2) {
|
|
401
418
|
return rpp(`${returnP2}${SEPARATOR}${mappedParts
|
|
@@ -416,15 +433,17 @@ export const ResolveFromPath = (props, returns, ops) => {
|
|
|
416
433
|
if (returnP1) {
|
|
417
434
|
return returnP1;
|
|
418
435
|
}
|
|
419
|
-
return
|
|
436
|
+
return "not";
|
|
420
437
|
};
|
|
421
438
|
return rpp;
|
|
422
439
|
};
|
|
423
440
|
export const InternalArgsBuilt = ({ props, ops, returns, scalars, vars, }) => {
|
|
424
|
-
const arb = (a, p =
|
|
425
|
-
if (typeof a ===
|
|
441
|
+
const arb = (a, p = "", root = true) => {
|
|
442
|
+
if (typeof a === "string") {
|
|
426
443
|
if (a.startsWith(START_VAR_NAME)) {
|
|
427
|
-
const [varName, graphQLType] = a
|
|
444
|
+
const [varName, graphQLType] = a
|
|
445
|
+
.replace(START_VAR_NAME, "$")
|
|
446
|
+
.split(GRAPHQL_TYPE_SEPARATOR);
|
|
428
447
|
const v = vars.find((v) => v.name === varName);
|
|
429
448
|
if (!v) {
|
|
430
449
|
vars.push({
|
|
@@ -441,28 +460,29 @@ export const InternalArgsBuilt = ({ props, ops, returns, scalars, vars, }) => {
|
|
|
441
460
|
}
|
|
442
461
|
}
|
|
443
462
|
const checkType = ResolveFromPath(props, returns, ops)(p);
|
|
444
|
-
if (checkType.startsWith(
|
|
445
|
-
|
|
446
|
-
const
|
|
463
|
+
if (checkType.startsWith("scalar.")) {
|
|
464
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
465
|
+
const [_, ...splittedScalar] = checkType.split(".");
|
|
466
|
+
const scalarKey = splittedScalar.join(".");
|
|
447
467
|
return scalars?.[scalarKey]?.encode?.(a) || JSON.stringify(a);
|
|
448
468
|
}
|
|
449
469
|
if (Array.isArray(a)) {
|
|
450
|
-
return `[${a.map((arr) => arb(arr, p, false)).join(
|
|
470
|
+
return `[${a.map((arr) => arb(arr, p, false)).join(", ")}]`;
|
|
451
471
|
}
|
|
452
|
-
if (typeof a ===
|
|
453
|
-
if (checkType ===
|
|
472
|
+
if (typeof a === "string") {
|
|
473
|
+
if (checkType === "enum") {
|
|
454
474
|
return a;
|
|
455
475
|
}
|
|
456
476
|
return `${JSON.stringify(a)}`;
|
|
457
477
|
}
|
|
458
|
-
if (typeof a ===
|
|
478
|
+
if (typeof a === "object") {
|
|
459
479
|
if (a === null) {
|
|
460
480
|
return `null`;
|
|
461
481
|
}
|
|
462
482
|
const returnedObjectString = Object.entries(a)
|
|
463
|
-
.filter(([, v]) => typeof v !==
|
|
483
|
+
.filter(([, v]) => typeof v !== "undefined")
|
|
464
484
|
.map(([k, v]) => `${k}: ${arb(v, [p, k].join(SEPARATOR), false)}`)
|
|
465
|
-
.join(
|
|
485
|
+
.join(",\n");
|
|
466
486
|
if (!root) {
|
|
467
487
|
return `{${returnedObjectString}}`;
|
|
468
488
|
}
|
|
@@ -476,7 +496,10 @@ export const resolverFor = (type, field, fn) => fn;
|
|
|
476
496
|
export const START_VAR_NAME = `$ZEUS_VAR`;
|
|
477
497
|
export const GRAPHQL_TYPE_SEPARATOR = `__$GRAPHQL__`;
|
|
478
498
|
export const $ = (name, graphqlType) => {
|
|
479
|
-
return (START_VAR_NAME +
|
|
499
|
+
return (START_VAR_NAME +
|
|
500
|
+
name +
|
|
501
|
+
GRAPHQL_TYPE_SEPARATOR +
|
|
502
|
+
graphqlType);
|
|
480
503
|
};
|
|
481
504
|
/** @description
|
|
482
505
|
The state of a Job in the JobQueue
|
|
@@ -1073,16 +1096,34 @@ export var OrderType;
|
|
|
1073
1096
|
OrderType["Seller"] = "Seller";
|
|
1074
1097
|
OrderType["Aggregate"] = "Aggregate";
|
|
1075
1098
|
})(OrderType || (OrderType = {}));
|
|
1076
|
-
export var
|
|
1077
|
-
(function (
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1099
|
+
export var MetricRangeType;
|
|
1100
|
+
(function (MetricRangeType) {
|
|
1101
|
+
MetricRangeType["Today"] = "Today";
|
|
1102
|
+
MetricRangeType["Yesterday"] = "Yesterday";
|
|
1103
|
+
MetricRangeType["ThisWeek"] = "ThisWeek";
|
|
1104
|
+
MetricRangeType["LastWeek"] = "LastWeek";
|
|
1105
|
+
MetricRangeType["ThisMonth"] = "ThisMonth";
|
|
1106
|
+
MetricRangeType["LastMonth"] = "LastMonth";
|
|
1107
|
+
MetricRangeType["ThisYear"] = "ThisYear";
|
|
1108
|
+
MetricRangeType["LastYear"] = "LastYear";
|
|
1109
|
+
MetricRangeType["FirstQuarter"] = "FirstQuarter";
|
|
1110
|
+
MetricRangeType["SecondQuarter"] = "SecondQuarter";
|
|
1111
|
+
MetricRangeType["ThirdQuarter"] = "ThirdQuarter";
|
|
1112
|
+
MetricRangeType["FourthQuarter"] = "FourthQuarter";
|
|
1113
|
+
MetricRangeType["Custom"] = "Custom";
|
|
1114
|
+
})(MetricRangeType || (MetricRangeType = {}));
|
|
1115
|
+
export var MetricIntervalType;
|
|
1116
|
+
(function (MetricIntervalType) {
|
|
1117
|
+
MetricIntervalType["Day"] = "Day";
|
|
1118
|
+
MetricIntervalType["Hour"] = "Hour";
|
|
1119
|
+
})(MetricIntervalType || (MetricIntervalType = {}));
|
|
1120
|
+
export var ChartMetricType;
|
|
1121
|
+
(function (ChartMetricType) {
|
|
1122
|
+
ChartMetricType["OrderCount"] = "OrderCount";
|
|
1123
|
+
ChartMetricType["OrderTotal"] = "OrderTotal";
|
|
1124
|
+
ChartMetricType["AverageOrderValue"] = "AverageOrderValue";
|
|
1125
|
+
ChartMetricType["OrderTotalProductsCount"] = "OrderTotalProductsCount";
|
|
1126
|
+
})(ChartMetricType || (ChartMetricType = {}));
|
|
1086
1127
|
export var PredictionType;
|
|
1087
1128
|
(function (PredictionType) {
|
|
1088
1129
|
PredictionType["RFM_SCORE"] = "RFM_SCORE";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TypedDocumentNode } from
|
|
2
|
-
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from
|
|
1
|
+
import { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
2
|
+
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from "./index.js";
|
|
3
3
|
export declare const typedGql: <O extends "query" | "mutation", SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions) => TypedDocumentNode<InputType<GraphQLTypes[R], Z, SCLR>, ExtractVariables<Z>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { gql } from
|
|
2
|
-
import { Zeus, } from
|
|
1
|
+
import { gql } from "graphql-tag";
|
|
2
|
+
import { Zeus, } from "./index.js";
|
|
3
3
|
export const typedGql = (operation, graphqlOptions) => (o, ops) => {
|
|
4
4
|
const str = Zeus(operation, o, {
|
|
5
5
|
operationOptions: ops,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deenruv/replicate-plugin",
|
|
3
|
-
"version": "1.0.17-dev.
|
|
3
|
+
"version": "1.0.17-dev.24",
|
|
4
4
|
"homepage": "https://deenruv.com/",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"react-router": "^7.13.0",
|
|
28
28
|
"replicate": "1.0.1",
|
|
29
29
|
"sonner": "^1.4.41",
|
|
30
|
-
"@deenruv/admin-types": "^1.0.17-dev.
|
|
31
|
-
"@deenruv/react-ui-devkit": "^1.0.17-dev.
|
|
32
|
-
"@deenruv/common": "^1.0.17-dev.
|
|
33
|
-
"@deenruv/testing": "^1.0.17-dev.
|
|
30
|
+
"@deenruv/admin-types": "^1.0.17-dev.24",
|
|
31
|
+
"@deenruv/react-ui-devkit": "^1.0.17-dev.24",
|
|
32
|
+
"@deenruv/common": "^1.0.17-dev.24",
|
|
33
|
+
"@deenruv/testing": "^1.0.17-dev.24"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/react-dom": "^19.0.0",
|
|
39
39
|
"rimraf": "^5.0.10",
|
|
40
40
|
"typescript": "5.3.3",
|
|
41
|
-
"@deenruv/core": "^1.0.17-dev.
|
|
41
|
+
"@deenruv/core": "^1.0.17-dev.24"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@deenruv/core": "^1.0.0 || ^1.0.17-dev.0",
|