@akanjs/signal 0.9.47 → 0.9.49
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/cjs/src/apiInfo.js +167 -0
- package/cjs/src/base.signal.js +55 -93
- package/cjs/src/baseFetch.js +1 -2
- package/cjs/src/fetch.js +2 -0
- package/cjs/src/fetchInfo.js +364 -0
- package/cjs/src/gql.js +7 -762
- package/cjs/src/graphql.js +125 -0
- package/cjs/src/index.js +5 -0
- package/cjs/src/internalApiInfo.js +151 -0
- package/cjs/src/signalDecorators.js +114 -148
- package/cjs/src/signalInfo.js +185 -0
- package/cjs/src/sliceInfo.js +193 -0
- package/esm/src/apiInfo.js +152 -0
- package/esm/src/base.signal.js +56 -108
- package/esm/src/baseFetch.js +1 -2
- package/esm/src/fetch.js +2 -0
- package/esm/src/fetchInfo.js +345 -0
- package/esm/src/gql.js +7 -784
- package/esm/src/graphql.js +106 -0
- package/esm/src/index.js +5 -0
- package/esm/src/internalApiInfo.js +137 -0
- package/esm/src/signalDecorators.js +115 -152
- package/esm/src/signalInfo.js +174 -0
- package/esm/src/sliceInfo.js +178 -0
- package/package.json +1 -1
- package/src/apiInfo.d.ts +73 -0
- package/src/base.signal.d.ts +131 -19
- package/src/fetch.d.ts +10 -8
- package/src/fetchInfo.d.ts +19 -0
- package/src/gql.d.ts +12 -48
- package/src/graphql.d.ts +9 -0
- package/src/index.d.ts +5 -0
- package/src/internalApiInfo.d.ts +74 -0
- package/src/signalDecorators.d.ts +71 -42
- package/src/signalInfo.d.ts +78 -0
- package/src/sliceInfo.d.ts +68 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var fetchInfo_exports = {};
|
|
19
|
+
__export(fetchInfo_exports, {
|
|
20
|
+
databaseFetchOf: () => databaseFetchOf,
|
|
21
|
+
serviceFetchOf: () => serviceFetchOf
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(fetchInfo_exports);
|
|
24
|
+
var import_base = require("@akanjs/base");
|
|
25
|
+
var import_common = require("@akanjs/common");
|
|
26
|
+
var import_constant = require("@akanjs/constant");
|
|
27
|
+
var import_gql = require("./gql");
|
|
28
|
+
var import_graphql = require("./graphql");
|
|
29
|
+
const serviceFetchOf = (signal) => {
|
|
30
|
+
const fetch = {};
|
|
31
|
+
Object.entries(signal.endpoint).forEach(([key, endpoint]) => {
|
|
32
|
+
const returnRef = import_constant.constantInfo.getModelRef(endpoint.returns.refName, endpoint.returns.modelType);
|
|
33
|
+
const isScalar = (0, import_base.isGqlScalar)(returnRef);
|
|
34
|
+
if (endpoint.type === "message") {
|
|
35
|
+
const emitEvent = function(...args) {
|
|
36
|
+
const fetchPolicy = args[endpoint.args.length] ?? { crystalize: true };
|
|
37
|
+
if (!this.client.io && !fetchPolicy.url) {
|
|
38
|
+
import_common.Logger.warn(`${key} emit suppressed - socket is not connected`);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const message = Object.fromEntries(
|
|
42
|
+
endpoint.args.map((arg, idx) => {
|
|
43
|
+
const argRef = import_constant.constantInfo.getModelRef(arg.refName, arg.modelType);
|
|
44
|
+
return [arg.name, (0, import_constant.serializeArg)(argRef, arg.arrDepth, args[idx], arg.argsOption) ?? null];
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
if (fetchPolicy.transport === "udp") {
|
|
48
|
+
if (!this.client.udp)
|
|
49
|
+
throw new Error("UDP is not set");
|
|
50
|
+
const uri = fetchPolicy.url ?? "udpout:localhost:4000";
|
|
51
|
+
const [host, port] = uri.split(":").slice(1);
|
|
52
|
+
this.client.udp.send(JSON.stringify(message), parseInt(port), host);
|
|
53
|
+
import_common.Logger.debug(`udp emit: ${key}: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
|
54
|
+
return;
|
|
55
|
+
} else {
|
|
56
|
+
const io = this.client.getIo(fetchPolicy.url);
|
|
57
|
+
void this.client.waitUntilWebSocketConnected(fetchPolicy.url).then(() => {
|
|
58
|
+
io.emit(key, message);
|
|
59
|
+
import_common.Logger.debug(`socket emit: ${key}: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const listenEvent = function(handleEvent, fetchPolicy = {}) {
|
|
64
|
+
const crystalize = (data) => {
|
|
65
|
+
if (isScalar) {
|
|
66
|
+
if (returnRef.prototype === Date.prototype)
|
|
67
|
+
return (0, import_base.dayjs)(data);
|
|
68
|
+
else
|
|
69
|
+
return data;
|
|
70
|
+
} else if (Array.isArray(data))
|
|
71
|
+
return data.map((d) => crystalize(d));
|
|
72
|
+
else
|
|
73
|
+
return (0, import_constant.makeCrystalize)(returnRef)(data);
|
|
74
|
+
};
|
|
75
|
+
const handle = (data) => {
|
|
76
|
+
import_common.Logger.debug(`socket listened: ${key}: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
|
77
|
+
handleEvent(crystalize(data));
|
|
78
|
+
};
|
|
79
|
+
const io = this.client.getIo(fetchPolicy.url);
|
|
80
|
+
this.client.waitUntilWebSocketConnected(fetchPolicy.url).then(() => {
|
|
81
|
+
io.removeListener(key, handle);
|
|
82
|
+
io.on(key, handle);
|
|
83
|
+
import_common.Logger.debug(`socket listen start: ${key}: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
|
84
|
+
});
|
|
85
|
+
return async () => {
|
|
86
|
+
await this.client.waitUntilWebSocketConnected(fetchPolicy.url);
|
|
87
|
+
import_common.Logger.debug(`socket listen end: ${key}: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
|
88
|
+
io.removeListener(key, handle);
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
fetch[key] = emitEvent;
|
|
92
|
+
fetch[`listen${(0, import_common.capitalize)(key)}`] = listenEvent;
|
|
93
|
+
} else if (endpoint.type === "pubsub") {
|
|
94
|
+
const makeRoomId = (gqlKey, argValues) => `${gqlKey}-${argValues.join("-")}`;
|
|
95
|
+
const crystalize = (data) => {
|
|
96
|
+
if (isScalar) {
|
|
97
|
+
if (returnRef.prototype === Date.prototype)
|
|
98
|
+
return (0, import_base.dayjs)(data);
|
|
99
|
+
else
|
|
100
|
+
return data;
|
|
101
|
+
} else if (Array.isArray(data))
|
|
102
|
+
return data.map((d) => crystalize(d));
|
|
103
|
+
else
|
|
104
|
+
return (0, import_constant.makeCrystalize)(returnRef)(data);
|
|
105
|
+
};
|
|
106
|
+
const subscribeEvent = function(...args) {
|
|
107
|
+
const onData = args[endpoint.args.length];
|
|
108
|
+
const fetchPolicy = args[endpoint.args.length + 1] ?? { crystalize: true };
|
|
109
|
+
const message = Object.fromEntries(
|
|
110
|
+
endpoint.args.map((arg, idx) => {
|
|
111
|
+
const argRef = import_constant.constantInfo.getModelRef(arg.refName, arg.modelType);
|
|
112
|
+
return [arg.name, (0, import_constant.serializeArg)(argRef, arg.arrDepth, args[idx], arg.argsOption) ?? null];
|
|
113
|
+
})
|
|
114
|
+
);
|
|
115
|
+
const handleEvent = (data) => {
|
|
116
|
+
if (data.__subscribe__)
|
|
117
|
+
return;
|
|
118
|
+
onData(crystalize(data));
|
|
119
|
+
};
|
|
120
|
+
const roomId = makeRoomId(
|
|
121
|
+
key,
|
|
122
|
+
endpoint.args.map((arg) => message[arg.name])
|
|
123
|
+
);
|
|
124
|
+
const io = this.client.getIo(fetchPolicy.url);
|
|
125
|
+
void this.client.waitUntilWebSocketConnected(fetchPolicy.url).then(() => {
|
|
126
|
+
import_common.Logger.debug(`socket subscribe start: ${key}: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
|
127
|
+
io.subscribe({ key, roomId, message, handleEvent });
|
|
128
|
+
});
|
|
129
|
+
return async () => {
|
|
130
|
+
//! 앱에서 다른 앱 넘어갈 때 언마운트 되버리면서 subscribe가 끊기는 일이 있음.
|
|
131
|
+
await this.client.waitUntilWebSocketConnected(fetchPolicy.url);
|
|
132
|
+
import_common.Logger.debug(`socket unsubscribe: ${key}: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
|
133
|
+
io.unsubscribe(roomId, handleEvent);
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
fetch[`subscribe${(0, import_common.capitalize)(key)}`] = subscribeEvent;
|
|
137
|
+
} else if (["query", "mutation"].includes(endpoint.type)) {
|
|
138
|
+
const name = endpoint.signalOption?.name ?? key;
|
|
139
|
+
const makeReq = ({ resolve }) => async function(...args) {
|
|
140
|
+
import_common.Logger.debug(`fetch: ${key} start: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")}`);
|
|
141
|
+
const now = Date.now();
|
|
142
|
+
const lightenedReturnRef = isScalar || endpoint.returns.arrDepth === 0 ? returnRef : endpoint.returns.modelType === "full" ? import_constant.constantInfo.getDatabase(endpoint.returns.refName).light : returnRef;
|
|
143
|
+
const fetchPolicy = args[endpoint.args.length] ?? { crystalize: true };
|
|
144
|
+
const partial = fetchPolicy.partial ?? endpoint.signalOption?.partial;
|
|
145
|
+
const crystalize = (data) => {
|
|
146
|
+
if (fetchPolicy.crystalize === false)
|
|
147
|
+
return data;
|
|
148
|
+
if (isScalar) {
|
|
149
|
+
if (lightenedReturnRef.prototype === Date.prototype)
|
|
150
|
+
return (0, import_base.dayjs)(data);
|
|
151
|
+
else
|
|
152
|
+
return data;
|
|
153
|
+
} else if (Array.isArray(data))
|
|
154
|
+
return data.map((d) => crystalize(d));
|
|
155
|
+
else
|
|
156
|
+
return (0, import_constant.makeCrystalize)(lightenedReturnRef, { partial })(data);
|
|
157
|
+
};
|
|
158
|
+
try {
|
|
159
|
+
const res = (await (endpoint.type === "query" ? import_gql.query : import_gql.mutate)(
|
|
160
|
+
this.client,
|
|
161
|
+
(0, import_graphql.graphql)((0, import_graphql.getGqlStr)(returnRef, key, endpoint, lightenedReturnRef, partial)),
|
|
162
|
+
Object.fromEntries(
|
|
163
|
+
endpoint.args.map((arg, idx) => {
|
|
164
|
+
const argRef = import_constant.constantInfo.getModelRef(arg.refName, arg.modelType);
|
|
165
|
+
return [arg.name, (0, import_constant.serializeArg)(argRef, arg.arrDepth, args[idx], arg.argsOption) ?? null];
|
|
166
|
+
})
|
|
167
|
+
),
|
|
168
|
+
fetchPolicy
|
|
169
|
+
))[name];
|
|
170
|
+
const data = resolve ? crystalize(res) : res;
|
|
171
|
+
import_common.Logger.debug(`fetch: ${key} end: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")} ${Date.now() - now}ms`);
|
|
172
|
+
return data;
|
|
173
|
+
} catch (e) {
|
|
174
|
+
import_common.Logger.error(`fetch: ${key} error: ${e}`);
|
|
175
|
+
throw e;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
const reqFn = makeReq({ resolve: true });
|
|
179
|
+
const reqFnWithoutResolve = makeReq({ resolve: false });
|
|
180
|
+
fetch[name] = async function(...args) {
|
|
181
|
+
return await reqFn.apply(this, args);
|
|
182
|
+
};
|
|
183
|
+
fetch[`_${name}`] = async function(...args) {
|
|
184
|
+
return await reqFnWithoutResolve.apply(this, args);
|
|
185
|
+
};
|
|
186
|
+
} else
|
|
187
|
+
throw new Error(`Invalid endpoint type: ${endpoint.type}`);
|
|
188
|
+
});
|
|
189
|
+
return fetch;
|
|
190
|
+
};
|
|
191
|
+
const databaseFetchOf = (signal, option = {}) => {
|
|
192
|
+
const cnst = import_constant.constantInfo.getDatabase(signal.refName);
|
|
193
|
+
const [fieldName, className] = [(0, import_common.lowerlize)(signal.refName), (0, import_common.capitalize)(signal.refName)];
|
|
194
|
+
const names = {
|
|
195
|
+
refName: signal.refName,
|
|
196
|
+
model: fieldName,
|
|
197
|
+
Model: className,
|
|
198
|
+
_model: `_${fieldName}`,
|
|
199
|
+
lightModel: `light${className}`,
|
|
200
|
+
_lightModel: `_light${className}`,
|
|
201
|
+
defaultModel: `default${className}`,
|
|
202
|
+
defaultModelInsight: `default${className}Insight`,
|
|
203
|
+
mergeModel: `merge${className}`,
|
|
204
|
+
viewModel: `view${className}`,
|
|
205
|
+
getModelView: `get${className}View`,
|
|
206
|
+
modelView: `${fieldName}View`,
|
|
207
|
+
modelViewAt: `${fieldName}ViewAt`,
|
|
208
|
+
editModel: `edit${className}`,
|
|
209
|
+
getModelEdit: `get${className}Edit`,
|
|
210
|
+
modelEdit: `${fieldName}Edit`,
|
|
211
|
+
listModel: `list${className}`,
|
|
212
|
+
modelList: `${fieldName}List`,
|
|
213
|
+
modelObjList: `${fieldName}ObjList`,
|
|
214
|
+
modelInsight: `${fieldName}Insight`,
|
|
215
|
+
modelObjInsight: `${fieldName}ObjInsight`,
|
|
216
|
+
updateModel: `update${className}`,
|
|
217
|
+
modelObj: `${fieldName}Obj`,
|
|
218
|
+
_modelList: `_${fieldName}List`,
|
|
219
|
+
modelInit: `${fieldName}Init`,
|
|
220
|
+
pageOfModel: `pageOf${className}`,
|
|
221
|
+
lastPageOfModel: `lastPageOf${className}`,
|
|
222
|
+
limitOfModel: `limitOf${className}`,
|
|
223
|
+
queryArgsOfModel: `queryArgsOf${className}`,
|
|
224
|
+
sortOfModel: `sortOf${className}`,
|
|
225
|
+
modelInitAt: `${fieldName}InitAt`,
|
|
226
|
+
initModel: `init${className}`,
|
|
227
|
+
getModelInit: `get${className}Init`,
|
|
228
|
+
addModelFiles: `add${className}Files`,
|
|
229
|
+
addFiles: `addFiles`
|
|
230
|
+
};
|
|
231
|
+
const fetch = serviceFetchOf(signal);
|
|
232
|
+
const util = {
|
|
233
|
+
[names.addModelFiles]: async (files, id, option2) => {
|
|
234
|
+
const metas = Array.from(files).map((file) => ({ lastModifiedAt: new Date(file.lastModified), size: file.size }));
|
|
235
|
+
//! will not work properly
|
|
236
|
+
return await global.builtFetch[names.addFiles](
|
|
237
|
+
files,
|
|
238
|
+
metas,
|
|
239
|
+
names.model,
|
|
240
|
+
id,
|
|
241
|
+
option2
|
|
242
|
+
);
|
|
243
|
+
},
|
|
244
|
+
[names.mergeModel]: async (modelOrId, data, option2) => {
|
|
245
|
+
const model = typeof modelOrId === "string" ? await global.builtFetch[names._model](modelOrId) : modelOrId;
|
|
246
|
+
const input = cnst.purify({ ...model, ...data });
|
|
247
|
+
if (!input)
|
|
248
|
+
throw new Error("Error");
|
|
249
|
+
return await global.builtFetch[names.updateModel](model.id, input, option2);
|
|
250
|
+
},
|
|
251
|
+
[names.viewModel]: async (id, option2) => {
|
|
252
|
+
const modelObj = await global.builtFetch[names._model](id, option2);
|
|
253
|
+
return {
|
|
254
|
+
[names.model]: cnst.crystalize(modelObj),
|
|
255
|
+
[names.modelView]: {
|
|
256
|
+
refName: names.model,
|
|
257
|
+
[names.modelObj]: modelObj,
|
|
258
|
+
[names.modelViewAt]: /* @__PURE__ */ new Date()
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
[names.getModelView]: async (id, option2) => {
|
|
263
|
+
const modelView = await global.builtFetch[names._model](id, option2);
|
|
264
|
+
return {
|
|
265
|
+
refName: names.model,
|
|
266
|
+
[names.modelObj]: modelView,
|
|
267
|
+
[names.modelViewAt]: /* @__PURE__ */ new Date()
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
[names.editModel]: async (id, option2) => {
|
|
271
|
+
const modelObj = await global.builtFetch[names._model](id, option2);
|
|
272
|
+
return {
|
|
273
|
+
[names.model]: cnst.crystalize(modelObj),
|
|
274
|
+
[names.modelEdit]: {
|
|
275
|
+
refName: names.model,
|
|
276
|
+
[names.modelObj]: modelObj,
|
|
277
|
+
[names.modelViewAt]: /* @__PURE__ */ new Date()
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
},
|
|
281
|
+
[names.getModelEdit]: async (id, option2) => {
|
|
282
|
+
const modelEdit = await global.builtFetch[names.editModel](id, option2);
|
|
283
|
+
return modelEdit[names.modelEdit];
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
const sliceUtil = Object.fromEntries(
|
|
287
|
+
signal.slices.reduce((acc, { sliceName, argLength, defaultArgs }) => {
|
|
288
|
+
const namesOfSlice = {
|
|
289
|
+
modelList: sliceName.replace(names.model, names.modelList),
|
|
290
|
+
// modelListInSelf
|
|
291
|
+
modelInsight: sliceName.replace(names.model, names.modelInsight),
|
|
292
|
+
// modelInsightInSelf
|
|
293
|
+
modelInit: sliceName.replace(names.model, names.modelInit),
|
|
294
|
+
// modelInitInSelf
|
|
295
|
+
initModel: sliceName.replace(names.model, names.initModel),
|
|
296
|
+
// initModelInSelf
|
|
297
|
+
getModelInit: sliceName.replace(names.model, names.getModelInit)
|
|
298
|
+
// getModelInitInSelf
|
|
299
|
+
};
|
|
300
|
+
const getInitFn = async (...args) => {
|
|
301
|
+
const queryArgLength = Math.min(args.length, argLength);
|
|
302
|
+
const queryArgs = [
|
|
303
|
+
...new Array(queryArgLength).fill(null).map((_, i) => args[i]),
|
|
304
|
+
...queryArgLength < argLength ? new Array(argLength - queryArgLength).fill(null).map((_, i) => defaultArgs[i + queryArgLength] ?? null) : []
|
|
305
|
+
];
|
|
306
|
+
const fetchInitOption = args[argLength] ?? {};
|
|
307
|
+
const { page = 1, limit = 20, sort = "latest", insight } = fetchInitOption;
|
|
308
|
+
const skip = (page - 1) * limit;
|
|
309
|
+
const [modelObjList, modelObjInsight] = await Promise.all([
|
|
310
|
+
global.builtFetch[`_${namesOfSlice.modelList}`](
|
|
311
|
+
...queryArgs,
|
|
312
|
+
skip,
|
|
313
|
+
limit,
|
|
314
|
+
sort,
|
|
315
|
+
fetchInitOption
|
|
316
|
+
),
|
|
317
|
+
global.builtFetch[`_${namesOfSlice.modelInsight}`](
|
|
318
|
+
...queryArgs,
|
|
319
|
+
fetchInitOption
|
|
320
|
+
)
|
|
321
|
+
]);
|
|
322
|
+
const count = modelObjInsight.count;
|
|
323
|
+
return {
|
|
324
|
+
// Client Component용
|
|
325
|
+
refName: names.model,
|
|
326
|
+
sliceName,
|
|
327
|
+
argLength,
|
|
328
|
+
[names.modelObjList]: modelObjList,
|
|
329
|
+
[names.modelObjInsight]: modelObjInsight,
|
|
330
|
+
[names.pageOfModel]: page,
|
|
331
|
+
[names.lastPageOfModel]: Math.max(Math.floor((count - 1) / limit) + 1, 1),
|
|
332
|
+
[names.limitOfModel]: limit,
|
|
333
|
+
[names.queryArgsOfModel]: JSON.parse(JSON.stringify(queryArgs)),
|
|
334
|
+
[names.sortOfModel]: sort,
|
|
335
|
+
[names.modelInitAt]: /* @__PURE__ */ new Date()
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
const initFn = async function(...args) {
|
|
339
|
+
const modelInit = await getInitFn(...args);
|
|
340
|
+
const modelObjList = modelInit[names.modelObjList];
|
|
341
|
+
const modelObjInsight = modelInit[names.modelObjInsight];
|
|
342
|
+
const modelList = new import_base.DataList(
|
|
343
|
+
modelObjList.map((modelObj) => cnst.lightCrystalize(modelObj))
|
|
344
|
+
);
|
|
345
|
+
const modelInsight = cnst.crystalizeInsight(modelObjInsight);
|
|
346
|
+
return {
|
|
347
|
+
[namesOfSlice.modelList]: modelList,
|
|
348
|
+
// Server Component용
|
|
349
|
+
[namesOfSlice.modelInsight]: modelInsight,
|
|
350
|
+
// Server Component용
|
|
351
|
+
[namesOfSlice.modelInit]: modelInit
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
return [...acc, [namesOfSlice.getModelInit, getInitFn], [namesOfSlice.initModel, initFn]];
|
|
355
|
+
}, [])
|
|
356
|
+
);
|
|
357
|
+
const modelGql = Object.assign(fetch, {
|
|
358
|
+
...util,
|
|
359
|
+
...sliceUtil
|
|
360
|
+
// slices: [...overwriteSlices, ...sigMeta.slices],
|
|
361
|
+
});
|
|
362
|
+
(0, import_gql.setGqlOnStorage)(signal.refName, modelGql);
|
|
363
|
+
return modelGql;
|
|
364
|
+
};
|