@akanjs/signal 0.9.52 → 0.9.54
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.
|
@@ -66,29 +66,29 @@ class InternalApiInfo {
|
|
|
66
66
|
};
|
|
67
67
|
applyApiMeta(sigRef, key) {
|
|
68
68
|
if (this.type === "resolveField") {
|
|
69
|
-
const
|
|
70
|
-
|
|
69
|
+
const metadataMap = (0, import_signalDecorators.getResolveFieldMetaMapOnPrototype)(sigRef.prototype);
|
|
70
|
+
metadataMap.set(key, {
|
|
71
71
|
returns: () => this.returnRef,
|
|
72
72
|
argsOption: this.signalOption,
|
|
73
73
|
key,
|
|
74
74
|
descriptor: { value: this.execFn, writable: true, enumerable: false, configurable: true }
|
|
75
75
|
});
|
|
76
76
|
sigRef.prototype[key] = this.execFn;
|
|
77
|
-
Reflect.defineMetadata("resolveField",
|
|
78
|
-
|
|
77
|
+
Reflect.defineMetadata("resolveField", metadataMap, sigRef.prototype);
|
|
78
|
+
} else {
|
|
79
|
+
const metadataMap = (0, import_signalDecorators.getGqlMetaMapOnPrototype)(sigRef.prototype);
|
|
80
|
+
const internalApiMeta = {
|
|
81
|
+
returns: () => this.returnRef instanceof import_base.Enum ? this.returnRef.type : this.returnRef,
|
|
82
|
+
signalOption: this.signalOption,
|
|
83
|
+
key,
|
|
84
|
+
descriptor: { value: this.execFn, writable: true, enumerable: false, configurable: true },
|
|
85
|
+
guards: ["None"],
|
|
86
|
+
type: InternalApiInfo.#typeTempMap[this.type]
|
|
87
|
+
};
|
|
88
|
+
sigRef.prototype[key] = this.execFn;
|
|
89
|
+
metadataMap.set(key, internalApiMeta);
|
|
90
|
+
(0, import_signalDecorators.setGqlMetaMapOnPrototype)(sigRef.prototype, metadataMap);
|
|
79
91
|
}
|
|
80
|
-
const internalApiMeta = {
|
|
81
|
-
returns: () => this.returnRef instanceof import_base.Enum ? this.returnRef.type : this.returnRef,
|
|
82
|
-
signalOption: this.signalOption,
|
|
83
|
-
key,
|
|
84
|
-
descriptor: { value: this.execFn, writable: true, enumerable: false, configurable: true },
|
|
85
|
-
guards: ["None"],
|
|
86
|
-
type: InternalApiInfo.#typeTempMap[this.type]
|
|
87
|
-
};
|
|
88
|
-
sigRef.prototype[key] = this.execFn;
|
|
89
|
-
const metadataMap = (0, import_signalDecorators.getGqlMetaMapOnPrototype)(sigRef.prototype);
|
|
90
|
-
metadataMap.set(key, internalApiMeta);
|
|
91
|
-
(0, import_signalDecorators.setGqlMetaMapOnPrototype)(sigRef.prototype, metadataMap);
|
|
92
92
|
const argMetas = this.args.map((arg, idx) => ({
|
|
93
93
|
name: arg.name,
|
|
94
94
|
returns: () => arg.argRef,
|
|
@@ -432,7 +432,7 @@ function endpoint(srv, builder, ...libSignals) {
|
|
|
432
432
|
return sigRef;
|
|
433
433
|
}
|
|
434
434
|
const mergeSignals = (signalRef, internalRef, sliceRef) => {
|
|
435
|
-
(0, import_common.applyMixins)(signalRef, [internalRef
|
|
435
|
+
(0, import_common.applyMixins)(signalRef, [internalRef]);
|
|
436
436
|
const gqlMetaMap = getGqlMetaMapOnPrototype(signalRef.prototype);
|
|
437
437
|
const resolveFieldMetaMap = getResolveFieldMetaMapOnPrototype(signalRef.prototype);
|
|
438
438
|
setResolveFieldMetaMapOnPrototype(signalRef.prototype, resolveFieldMetaMap);
|
|
@@ -445,9 +445,12 @@ const mergeSignals = (signalRef, internalRef, sliceRef) => {
|
|
|
445
445
|
});
|
|
446
446
|
internalResolveFieldMetaMap.forEach((value, key) => {
|
|
447
447
|
resolveFieldMetaMap.set(key, value);
|
|
448
|
+
const [argMetas, internalArgMetas] = getArgMetas(internalRef, key);
|
|
449
|
+
setArgMetas(signalRef, key, argMetas, internalArgMetas);
|
|
448
450
|
});
|
|
449
451
|
if (sliceRef) {
|
|
450
452
|
const sliceGqlMetaMap = getGqlMetaMapOnPrototype(sliceRef.prototype);
|
|
453
|
+
(0, import_common.applyMixins)(signalRef, [sliceRef], /* @__PURE__ */ new Set([...gqlMetaMap.keys()]));
|
|
451
454
|
sliceGqlMetaMap.forEach((value, key) => {
|
|
452
455
|
if (gqlMetaMap.has(key))
|
|
453
456
|
return;
|
|
@@ -459,13 +462,6 @@ const mergeSignals = (signalRef, internalRef, sliceRef) => {
|
|
|
459
462
|
setGqlMetaMapOnPrototype(signalRef.prototype, gqlMetaMap);
|
|
460
463
|
return signalRef;
|
|
461
464
|
};
|
|
462
|
-
function LogSignal(refName, srv, option) {
|
|
463
|
-
class BaseSignal {
|
|
464
|
-
}
|
|
465
|
-
import_signalInfo.signalInfo.setRefNameTemp(BaseSignal, refName);
|
|
466
|
-
import_signalInfo.signalInfo.setPrefixTemp(BaseSignal, option?.prefix ?? "");
|
|
467
|
-
return BaseSignal;
|
|
468
|
-
}
|
|
469
465
|
const getSigMeta = (sigRef) => {
|
|
470
466
|
const sigMeta = Reflect.getMetadata("signal", sigRef.prototype);
|
|
471
467
|
if (!sigMeta)
|
package/cjs/src/signalInfo.js
CHANGED
|
@@ -23,7 +23,6 @@ module.exports = __toCommonJS(signalInfo_exports);
|
|
|
23
23
|
var import_base = require("@akanjs/base");
|
|
24
24
|
var import_common = require("@akanjs/common");
|
|
25
25
|
var import_constant = require("@akanjs/constant");
|
|
26
|
-
var import_document = require("@akanjs/document");
|
|
27
26
|
var import_client = require("./client");
|
|
28
27
|
var import_fetchInfo = require("./fetchInfo");
|
|
29
28
|
var import_signalDecorators = require("./signalDecorators");
|
|
@@ -129,8 +128,8 @@ const signalInfo = {
|
|
|
129
128
|
refName,
|
|
130
129
|
slices,
|
|
131
130
|
prefix,
|
|
132
|
-
endpoint: {}
|
|
133
|
-
filter:
|
|
131
|
+
endpoint: {}
|
|
132
|
+
// filter: documentInfo.getSerializedFilter(refName),
|
|
134
133
|
};
|
|
135
134
|
gqlMetaMap.forEach((gqlMeta, key) => {
|
|
136
135
|
if (!["Query", "Mutation", "Pubsub", "Message"].includes(gqlMeta.type))
|
|
@@ -48,29 +48,29 @@ class InternalApiInfo {
|
|
|
48
48
|
};
|
|
49
49
|
applyApiMeta(sigRef, key) {
|
|
50
50
|
if (this.type === "resolveField") {
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const metadataMap = getResolveFieldMetaMapOnPrototype(sigRef.prototype);
|
|
52
|
+
metadataMap.set(key, {
|
|
53
53
|
returns: () => this.returnRef,
|
|
54
54
|
argsOption: this.signalOption,
|
|
55
55
|
key,
|
|
56
56
|
descriptor: { value: this.execFn, writable: true, enumerable: false, configurable: true }
|
|
57
57
|
});
|
|
58
58
|
sigRef.prototype[key] = this.execFn;
|
|
59
|
-
Reflect.defineMetadata("resolveField",
|
|
60
|
-
|
|
59
|
+
Reflect.defineMetadata("resolveField", metadataMap, sigRef.prototype);
|
|
60
|
+
} else {
|
|
61
|
+
const metadataMap = getGqlMetaMapOnPrototype(sigRef.prototype);
|
|
62
|
+
const internalApiMeta = {
|
|
63
|
+
returns: () => this.returnRef instanceof Enum ? this.returnRef.type : this.returnRef,
|
|
64
|
+
signalOption: this.signalOption,
|
|
65
|
+
key,
|
|
66
|
+
descriptor: { value: this.execFn, writable: true, enumerable: false, configurable: true },
|
|
67
|
+
guards: ["None"],
|
|
68
|
+
type: InternalApiInfo.#typeTempMap[this.type]
|
|
69
|
+
};
|
|
70
|
+
sigRef.prototype[key] = this.execFn;
|
|
71
|
+
metadataMap.set(key, internalApiMeta);
|
|
72
|
+
setGqlMetaMapOnPrototype(sigRef.prototype, metadataMap);
|
|
61
73
|
}
|
|
62
|
-
const internalApiMeta = {
|
|
63
|
-
returns: () => this.returnRef instanceof Enum ? this.returnRef.type : this.returnRef,
|
|
64
|
-
signalOption: this.signalOption,
|
|
65
|
-
key,
|
|
66
|
-
descriptor: { value: this.execFn, writable: true, enumerable: false, configurable: true },
|
|
67
|
-
guards: ["None"],
|
|
68
|
-
type: InternalApiInfo.#typeTempMap[this.type]
|
|
69
|
-
};
|
|
70
|
-
sigRef.prototype[key] = this.execFn;
|
|
71
|
-
const metadataMap = getGqlMetaMapOnPrototype(sigRef.prototype);
|
|
72
|
-
metadataMap.set(key, internalApiMeta);
|
|
73
|
-
setGqlMetaMapOnPrototype(sigRef.prototype, metadataMap);
|
|
74
74
|
const argMetas = this.args.map((arg, idx) => ({
|
|
75
75
|
name: arg.name,
|
|
76
76
|
returns: () => arg.argRef,
|
|
@@ -364,7 +364,7 @@ function endpoint(srv, builder, ...libSignals) {
|
|
|
364
364
|
return sigRef;
|
|
365
365
|
}
|
|
366
366
|
const mergeSignals = (signalRef, internalRef, sliceRef) => {
|
|
367
|
-
applyMixins(signalRef, [internalRef
|
|
367
|
+
applyMixins(signalRef, [internalRef]);
|
|
368
368
|
const gqlMetaMap = getGqlMetaMapOnPrototype(signalRef.prototype);
|
|
369
369
|
const resolveFieldMetaMap = getResolveFieldMetaMapOnPrototype(signalRef.prototype);
|
|
370
370
|
setResolveFieldMetaMapOnPrototype(signalRef.prototype, resolveFieldMetaMap);
|
|
@@ -377,9 +377,12 @@ const mergeSignals = (signalRef, internalRef, sliceRef) => {
|
|
|
377
377
|
});
|
|
378
378
|
internalResolveFieldMetaMap.forEach((value, key) => {
|
|
379
379
|
resolveFieldMetaMap.set(key, value);
|
|
380
|
+
const [argMetas, internalArgMetas] = getArgMetas(internalRef, key);
|
|
381
|
+
setArgMetas(signalRef, key, argMetas, internalArgMetas);
|
|
380
382
|
});
|
|
381
383
|
if (sliceRef) {
|
|
382
384
|
const sliceGqlMetaMap = getGqlMetaMapOnPrototype(sliceRef.prototype);
|
|
385
|
+
applyMixins(signalRef, [sliceRef], /* @__PURE__ */ new Set([...gqlMetaMap.keys()]));
|
|
383
386
|
sliceGqlMetaMap.forEach((value, key) => {
|
|
384
387
|
if (gqlMetaMap.has(key))
|
|
385
388
|
return;
|
|
@@ -391,13 +394,6 @@ const mergeSignals = (signalRef, internalRef, sliceRef) => {
|
|
|
391
394
|
setGqlMetaMapOnPrototype(signalRef.prototype, gqlMetaMap);
|
|
392
395
|
return signalRef;
|
|
393
396
|
};
|
|
394
|
-
function LogSignal(refName, srv, option) {
|
|
395
|
-
class BaseSignal {
|
|
396
|
-
}
|
|
397
|
-
signalInfo.setRefNameTemp(BaseSignal, refName);
|
|
398
|
-
signalInfo.setPrefixTemp(BaseSignal, option?.prefix ?? "");
|
|
399
|
-
return BaseSignal;
|
|
400
|
-
}
|
|
401
397
|
const getSigMeta = (sigRef) => {
|
|
402
398
|
const sigMeta = Reflect.getMetadata("signal", sigRef.prototype);
|
|
403
399
|
if (!sigMeta)
|
package/esm/src/signalInfo.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { baseClientEnv, getNonArrayModel, scalarNameMap } from "@akanjs/base";
|
|
2
2
|
import { lowerlize } from "@akanjs/common";
|
|
3
3
|
import { constantInfo } from "@akanjs/constant";
|
|
4
|
-
import { documentInfo } from "@akanjs/document";
|
|
5
4
|
import { client } from "./client";
|
|
6
5
|
import { databaseFetchOf, serviceFetchOf } from "./fetchInfo";
|
|
7
6
|
import {
|
|
@@ -115,8 +114,8 @@ const signalInfo = {
|
|
|
115
114
|
refName,
|
|
116
115
|
slices,
|
|
117
116
|
prefix,
|
|
118
|
-
endpoint: {}
|
|
119
|
-
filter: documentInfo.getSerializedFilter(refName)
|
|
117
|
+
endpoint: {}
|
|
118
|
+
// filter: documentInfo.getSerializedFilter(refName),
|
|
120
119
|
};
|
|
121
120
|
gqlMetaMap.forEach((gqlMeta, key) => {
|
|
122
121
|
if (!["Query", "Mutation", "Pubsub", "Message"].includes(gqlMeta.type))
|