@akanjs/dictionary 0.0.45 → 0.0.46
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/index.js +47 -983
- package/package.json +2 -10
package/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// pkgs/@akanjs/dictionary/index.ts
|
|
@@ -39,935 +29,10 @@ __export(dictionary_exports, {
|
|
|
39
29
|
});
|
|
40
30
|
module.exports = __toCommonJS(dictionary_exports);
|
|
41
31
|
|
|
42
|
-
// pkgs/@akanjs/common/src/isDayjs.ts
|
|
43
|
-
var import_dayjs = require("dayjs");
|
|
44
|
-
|
|
45
|
-
// pkgs/@akanjs/common/src/isQueryEqual.ts
|
|
46
|
-
var import_dayjs2 = __toESM(require("dayjs"));
|
|
47
|
-
|
|
48
|
-
// pkgs/@akanjs/common/src/isValidDate.ts
|
|
49
|
-
var import_dayjs3 = __toESM(require("dayjs"));
|
|
50
|
-
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
|
|
51
|
-
import_dayjs3.default.extend(import_customParseFormat.default);
|
|
52
|
-
|
|
53
|
-
// pkgs/@akanjs/common/src/pluralize.ts
|
|
54
|
-
var import_pluralize = __toESM(require("pluralize"));
|
|
55
|
-
|
|
56
|
-
// pkgs/@akanjs/common/src/capitalize.ts
|
|
57
|
-
var capitalize = (str) => {
|
|
58
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// pkgs/@akanjs/common/src/Logger.ts
|
|
62
|
-
var import_dayjs4 = __toESM(require("dayjs"));
|
|
63
|
-
var logLevels = ["trace", "verbose", "debug", "log", "info", "warn", "error"];
|
|
64
|
-
var clc = {
|
|
65
|
-
bold: (text) => `\x1B[1m${text}\x1B[0m`,
|
|
66
|
-
green: (text) => `\x1B[32m${text}\x1B[39m`,
|
|
67
|
-
yellow: (text) => `\x1B[33m${text}\x1B[39m`,
|
|
68
|
-
red: (text) => `\x1B[31m${text}\x1B[39m`,
|
|
69
|
-
magentaBright: (text) => `\x1B[95m${text}\x1B[39m`,
|
|
70
|
-
cyanBright: (text) => `\x1B[96m${text}\x1B[39m`
|
|
71
|
-
};
|
|
72
|
-
var colorizeMap = {
|
|
73
|
-
trace: clc.bold,
|
|
74
|
-
verbose: clc.cyanBright,
|
|
75
|
-
debug: clc.magentaBright,
|
|
76
|
-
log: clc.green,
|
|
77
|
-
info: clc.green,
|
|
78
|
-
warn: clc.yellow,
|
|
79
|
-
error: clc.red
|
|
80
|
-
};
|
|
81
|
-
var Logger = class _Logger {
|
|
82
|
-
static #ignoreCtxSet = /* @__PURE__ */ new Set([
|
|
83
|
-
"InstanceLoader",
|
|
84
|
-
"RoutesResolver",
|
|
85
|
-
"RouterExplorer",
|
|
86
|
-
"NestFactory",
|
|
87
|
-
"WebSocketsController",
|
|
88
|
-
"GraphQLModule",
|
|
89
|
-
"NestApplication"
|
|
90
|
-
]);
|
|
91
|
-
static level = process.env.NEXT_PUBLIC_LOG_LEVEL ?? "log";
|
|
92
|
-
static #levelIdx = logLevels.findIndex((l) => l === process.env.NEXT_PUBLIC_LOG_LEVEL);
|
|
93
|
-
static #startAt = (0, import_dayjs4.default)();
|
|
94
|
-
static setLevel(level) {
|
|
95
|
-
this.level = level;
|
|
96
|
-
this.#levelIdx = logLevels.findIndex((l) => l === level);
|
|
97
|
-
}
|
|
98
|
-
name;
|
|
99
|
-
constructor(name) {
|
|
100
|
-
this.name = name;
|
|
101
|
-
}
|
|
102
|
-
trace(msg2, context = "") {
|
|
103
|
-
if (_Logger.#levelIdx <= 0)
|
|
104
|
-
_Logger.#printMessages(this.name ?? "App", msg2, context, "trace");
|
|
105
|
-
}
|
|
106
|
-
verbose(msg2, context = "") {
|
|
107
|
-
if (_Logger.#levelIdx <= 1)
|
|
108
|
-
_Logger.#printMessages(this.name ?? "App", msg2, context, "verbose");
|
|
109
|
-
}
|
|
110
|
-
debug(msg2, context = "") {
|
|
111
|
-
if (_Logger.#levelIdx <= 2)
|
|
112
|
-
_Logger.#printMessages(this.name ?? "App", msg2, context, "debug");
|
|
113
|
-
}
|
|
114
|
-
log(msg2, context = "") {
|
|
115
|
-
if (_Logger.#levelIdx <= 3)
|
|
116
|
-
_Logger.#printMessages(this.name ?? "App", msg2, context, "log");
|
|
117
|
-
}
|
|
118
|
-
info(msg2, context = "") {
|
|
119
|
-
if (_Logger.#levelIdx <= 4)
|
|
120
|
-
_Logger.#printMessages(this.name ?? "App", msg2, context, "info");
|
|
121
|
-
}
|
|
122
|
-
warn(msg2, context = "") {
|
|
123
|
-
if (_Logger.#levelIdx <= 5)
|
|
124
|
-
_Logger.#printMessages(this.name ?? "App", msg2, context, "warn");
|
|
125
|
-
}
|
|
126
|
-
error(msg2, context = "") {
|
|
127
|
-
if (_Logger.#levelIdx <= 6)
|
|
128
|
-
_Logger.#printMessages(this.name ?? "App", msg2, context, "error");
|
|
129
|
-
}
|
|
130
|
-
raw(msg2, method) {
|
|
131
|
-
_Logger.rawLog(msg2, method);
|
|
132
|
-
}
|
|
133
|
-
rawLog(msg2, method) {
|
|
134
|
-
_Logger.rawLog(msg2, method);
|
|
135
|
-
}
|
|
136
|
-
static trace(msg2, context = "") {
|
|
137
|
-
if (_Logger.#levelIdx <= 0)
|
|
138
|
-
_Logger.#printMessages("App", msg2, context, "trace");
|
|
139
|
-
}
|
|
140
|
-
static verbose(msg2, context = "") {
|
|
141
|
-
if (_Logger.#levelIdx <= 1)
|
|
142
|
-
_Logger.#printMessages("App", msg2, context, "verbose");
|
|
143
|
-
}
|
|
144
|
-
static debug(msg2, context = "") {
|
|
145
|
-
if (_Logger.#levelIdx <= 2)
|
|
146
|
-
_Logger.#printMessages("App", msg2, context, "debug");
|
|
147
|
-
}
|
|
148
|
-
static log(msg2, context = "") {
|
|
149
|
-
if (_Logger.#levelIdx <= 3)
|
|
150
|
-
_Logger.#printMessages("App", msg2, context, "log");
|
|
151
|
-
}
|
|
152
|
-
static info(msg2, context = "") {
|
|
153
|
-
if (_Logger.#levelIdx <= 4)
|
|
154
|
-
_Logger.#printMessages("App", msg2, context, "info");
|
|
155
|
-
}
|
|
156
|
-
static warn(msg2, context = "") {
|
|
157
|
-
if (_Logger.#levelIdx <= 5)
|
|
158
|
-
_Logger.#printMessages("App", msg2, context, "warn");
|
|
159
|
-
}
|
|
160
|
-
static error(msg2, context = "") {
|
|
161
|
-
if (_Logger.#levelIdx <= 6)
|
|
162
|
-
_Logger.#printMessages("App", msg2, context, "error");
|
|
163
|
-
}
|
|
164
|
-
static #colorize(msg2, logLevel) {
|
|
165
|
-
return colorizeMap[logLevel](msg2);
|
|
166
|
-
}
|
|
167
|
-
static #printMessages(name, content, context, logLevel, writeStreamType = logLevel === "error" ? "stderr" : "stdout") {
|
|
168
|
-
if (this.#ignoreCtxSet.has(context))
|
|
169
|
-
return;
|
|
170
|
-
const now = (0, import_dayjs4.default)();
|
|
171
|
-
const processMsg = this.#colorize(
|
|
172
|
-
`[${name ?? "App"}] ${global.process?.pid ?? "window"} -`,
|
|
173
|
-
logLevel
|
|
174
|
-
);
|
|
175
|
-
const timestampMsg = now.format("MM/DD/YYYY, HH:mm:ss A");
|
|
176
|
-
const logLevelMsg = this.#colorize(logLevel.toUpperCase().padStart(7, " "), logLevel);
|
|
177
|
-
const contextMsg = context ? clc.yellow(`[${context}] `) : "";
|
|
178
|
-
const contentMsg = this.#colorize(content, logLevel);
|
|
179
|
-
const timeDiffMsg = clc.yellow(`+${now.diff(_Logger.#startAt, "ms")}ms`);
|
|
180
|
-
if (typeof window === "undefined")
|
|
181
|
-
process[writeStreamType].write(
|
|
182
|
-
`${processMsg} ${timestampMsg} ${logLevelMsg} ${contextMsg} ${contentMsg} ${timeDiffMsg}
|
|
183
|
-
`
|
|
184
|
-
);
|
|
185
|
-
else
|
|
186
|
-
console.log(`${processMsg} ${timestampMsg} ${logLevelMsg} ${contextMsg} ${contentMsg} ${timeDiffMsg}
|
|
187
|
-
`);
|
|
188
|
-
}
|
|
189
|
-
static rawLog(msg2, method) {
|
|
190
|
-
this.raw(`${msg2}
|
|
191
|
-
`, method);
|
|
192
|
-
}
|
|
193
|
-
static raw(msg2, method) {
|
|
194
|
-
if (typeof window === "undefined" && method !== "console" && global.process)
|
|
195
|
-
global.process.stdout.write(msg2);
|
|
196
|
-
else
|
|
197
|
-
console.log(msg2);
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
// pkgs/@akanjs/common/src/lowerlize.ts
|
|
202
|
-
var lowerlize = (str) => {
|
|
203
|
-
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
// pkgs/@akanjs/common/src/sleep.ts
|
|
207
|
-
var sleep = async (ms) => {
|
|
208
|
-
return new Promise((resolve) => {
|
|
209
|
-
setTimeout(() => {
|
|
210
|
-
resolve(true);
|
|
211
|
-
}, ms);
|
|
212
|
-
});
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
// pkgs/@akanjs/base/src/base.ts
|
|
216
|
-
var version = "0.9.0";
|
|
217
|
-
var logo = `
|
|
218
|
-
_ _ _
|
|
219
|
-
/ \\ | | ____ _ _ __ (_)___
|
|
220
|
-
/ _ \\ | |/ / _' | '_ \\ | / __|
|
|
221
|
-
/ ___ \\| < (_| | | | |_ | \\__ \\
|
|
222
|
-
/_/ \\_\\_|\\_\\__,_|_| |_(_)/ |___/
|
|
223
|
-
|__/ ver ${version}
|
|
224
|
-
? See more details on docs https://www.akanjs.com/docs
|
|
225
|
-
\u2605 Star Akanjs on GitHub https://github.com/aka-bassman/akanjs
|
|
226
|
-
|
|
227
|
-
`;
|
|
228
|
-
|
|
229
|
-
// pkgs/@akanjs/base/src/baseEnv.ts
|
|
230
|
-
var appName = process.env.NEXT_PUBLIC_APP_NAME ?? "unknown";
|
|
231
|
-
var repoName = process.env.NEXT_PUBLIC_REPO_NAME ?? "unknown";
|
|
232
|
-
var serveDomain = process.env.NEXT_PUBLIC_SERVE_DOMAIN ?? "unknown";
|
|
233
|
-
if (appName === "unknown")
|
|
234
|
-
throw new Error("environment variable NEXT_PUBLIC_APP_NAME is required");
|
|
235
|
-
if (repoName === "unknown")
|
|
236
|
-
throw new Error("environment variable NEXT_PUBLIC_REPO_NAME is required");
|
|
237
|
-
if (serveDomain === "unknown")
|
|
238
|
-
throw new Error("environment variable NEXT_PUBLIC_SERVE_DOMAIN is required");
|
|
239
|
-
var environment = process.env.NEXT_PUBLIC_ENV ?? "debug";
|
|
240
|
-
var operationType = typeof window !== "undefined" ? "client" : process.env.NEXT_RUNTIME ? "client" : "server";
|
|
241
|
-
var operationMode = process.env.NEXT_PUBLIC_OPERATION_MODE ?? "cloud";
|
|
242
|
-
var networkType = process.env.NEXT_PUBLIC_NETWORK_TYPE ?? (environment === "main" ? "mainnet" : environment === "develop" ? "testnet" : "debugnet");
|
|
243
|
-
var tunnelUsername = process.env.SSU_TUNNEL_USERNAME ?? "root";
|
|
244
|
-
var tunnelPassword = process.env.SSU_TUNNEL_PASSWORD ?? repoName;
|
|
245
|
-
var baseEnv = {
|
|
246
|
-
repoName,
|
|
247
|
-
serveDomain,
|
|
248
|
-
appName,
|
|
249
|
-
environment,
|
|
250
|
-
operationType,
|
|
251
|
-
operationMode,
|
|
252
|
-
networkType,
|
|
253
|
-
tunnelUsername,
|
|
254
|
-
tunnelPassword
|
|
255
|
-
};
|
|
256
|
-
var side = typeof window === "undefined" ? "server" : "client";
|
|
257
|
-
var renderMode = process.env.RENDER_ENV ?? "ssr";
|
|
258
|
-
var clientHost = process.env.NEXT_PUBLIC_CLIENT_HOST ?? (operationMode === "local" || side === "server" ? "localhost" : window.location.hostname);
|
|
259
|
-
var clientPort = parseInt(
|
|
260
|
-
process.env.NEXT_PUBLIC_CLIENT_PORT ?? (operationMode === "local" ? renderMode === "ssr" ? "4200" : "4201" : "443")
|
|
261
|
-
);
|
|
262
|
-
var clientHttpProtocol = side === "client" ? window.location.protocol : clientHost === "localhost" ? "http:" : "https:";
|
|
263
|
-
var clientHttpUri = `${clientHttpProtocol}//${clientHost}${clientPort === 443 ? "" : `:${clientPort}`}`;
|
|
264
|
-
var serverHost = process.env.SERVER_HOST ?? (operationMode === "local" ? typeof window === "undefined" ? "localhost" : window.location.host.split(":")[0] : renderMode === "csr" ? `${appName}-${environment}.${serveDomain}` : side === "client" ? window.location.host.split(":")[0] : operationMode === "cloud" ? `backend-svc.${appName}-${environment}.svc.cluster.local` : "localhost");
|
|
265
|
-
var serverPort = parseInt(
|
|
266
|
-
process.env.SERVER_PORT ?? (operationMode === "local" || side === "server" ? "8080" : "443")
|
|
267
|
-
);
|
|
268
|
-
var serverHttpProtocol = side === "client" ? window.location.protocol : "http:";
|
|
269
|
-
var serverHttpUri = `${serverHttpProtocol}//${serverHost}${serverPort === 443 ? "" : `:${serverPort}`}/backend`;
|
|
270
|
-
var serverGraphqlUri = `${serverHttpUri}/graphql`;
|
|
271
|
-
var serverWsProtocol = serverHttpProtocol === "http:" ? "ws:" : "wss:";
|
|
272
|
-
var serverWsUri = `${serverWsProtocol}//${serverHost}${serverPort === 443 ? "" : `:${serverPort}`}`;
|
|
273
|
-
var baseClientEnv = {
|
|
274
|
-
...baseEnv,
|
|
275
|
-
side,
|
|
276
|
-
renderMode,
|
|
277
|
-
websocket: true,
|
|
278
|
-
clientHost,
|
|
279
|
-
clientPort,
|
|
280
|
-
clientHttpProtocol,
|
|
281
|
-
clientHttpUri,
|
|
282
|
-
serverHost,
|
|
283
|
-
serverPort,
|
|
284
|
-
serverHttpProtocol,
|
|
285
|
-
serverHttpUri,
|
|
286
|
-
serverGraphqlUri,
|
|
287
|
-
serverWsProtocol,
|
|
288
|
-
serverWsUri
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// pkgs/@akanjs/base/src/scalar.ts
|
|
292
|
-
var import_dayjs5 = __toESM(require("dayjs"));
|
|
293
|
-
var dayjs4 = import_dayjs5.default;
|
|
294
|
-
var Int = class {
|
|
295
|
-
__Scalar__;
|
|
296
|
-
};
|
|
297
|
-
var Upload = class {
|
|
298
|
-
__Scalar__;
|
|
299
|
-
filename;
|
|
300
|
-
mimetype;
|
|
301
|
-
encoding;
|
|
302
|
-
createReadStream;
|
|
303
|
-
};
|
|
304
|
-
var Float = class {
|
|
305
|
-
__Scalar__;
|
|
306
|
-
};
|
|
307
|
-
var ID = class {
|
|
308
|
-
__Scalar__;
|
|
309
|
-
};
|
|
310
|
-
var JSON2 = class {
|
|
311
|
-
__Scalar__;
|
|
312
|
-
};
|
|
313
|
-
var getNonArrayModel = (arraiedModel2) => {
|
|
314
|
-
let arrDepth = 0;
|
|
315
|
-
let target = arraiedModel2;
|
|
316
|
-
while (Array.isArray(target)) {
|
|
317
|
-
target = target[0];
|
|
318
|
-
arrDepth++;
|
|
319
|
-
}
|
|
320
|
-
return [target, arrDepth];
|
|
321
|
-
};
|
|
322
|
-
var scalarSet = /* @__PURE__ */ new Set([String, Boolean, Date, ID, Int, Float, Upload, JSON2, Map]);
|
|
323
|
-
var scalarNameMap = /* @__PURE__ */ new Map([
|
|
324
|
-
[ID, "ID"],
|
|
325
|
-
[Int, "Int"],
|
|
326
|
-
[Float, "Float"],
|
|
327
|
-
[String, "String"],
|
|
328
|
-
[Boolean, "Boolean"],
|
|
329
|
-
[Date, "Date"],
|
|
330
|
-
[Upload, "Upload"],
|
|
331
|
-
[JSON2, "JSON"],
|
|
332
|
-
[Map, "Map"]
|
|
333
|
-
]);
|
|
334
|
-
var scalarArgMap = /* @__PURE__ */ new Map([
|
|
335
|
-
[ID, null],
|
|
336
|
-
[String, ""],
|
|
337
|
-
[Boolean, false],
|
|
338
|
-
[Date, dayjs4(/* @__PURE__ */ new Date(-1))],
|
|
339
|
-
[Int, 0],
|
|
340
|
-
[Float, 0],
|
|
341
|
-
[JSON2, {}],
|
|
342
|
-
[Map, {}]
|
|
343
|
-
]);
|
|
344
|
-
var scalarDefaultMap = /* @__PURE__ */ new Map([
|
|
345
|
-
[ID, null],
|
|
346
|
-
[String, ""],
|
|
347
|
-
[Boolean, false],
|
|
348
|
-
[Date, dayjs4(/* @__PURE__ */ new Date(-1))],
|
|
349
|
-
[Int, 0],
|
|
350
|
-
[Float, 0],
|
|
351
|
-
[JSON2, {}]
|
|
352
|
-
]);
|
|
353
|
-
var isGqlScalar = (modelRef) => scalarSet.has(modelRef);
|
|
354
|
-
var isGqlMap = (modelRef) => modelRef === Map;
|
|
355
|
-
|
|
356
|
-
// pkgs/@akanjs/constant/src/scalar.ts
|
|
357
|
-
var import_reflect_metadata = require("reflect-metadata");
|
|
358
|
-
var scalarExampleMap = /* @__PURE__ */ new Map([
|
|
359
|
-
[ID, "1234567890abcdef12345678"],
|
|
360
|
-
[Int, 0],
|
|
361
|
-
[Float, 0],
|
|
362
|
-
[String, "String"],
|
|
363
|
-
[Boolean, true],
|
|
364
|
-
[Date, (/* @__PURE__ */ new Date()).toISOString()],
|
|
365
|
-
[Upload, "FileUpload"],
|
|
366
|
-
[JSON2, {}],
|
|
367
|
-
[Map, {}]
|
|
368
|
-
]);
|
|
369
|
-
var getClassMeta = (modelRef) => {
|
|
370
|
-
const [target] = getNonArrayModel(modelRef);
|
|
371
|
-
const classMeta = Reflect.getMetadata("class", target.prototype);
|
|
372
|
-
if (!classMeta)
|
|
373
|
-
throw new Error(`No ClassMeta for this target ${target.name}`);
|
|
374
|
-
return classMeta;
|
|
375
|
-
};
|
|
376
|
-
var getFieldMetas = (modelRef) => {
|
|
377
|
-
const [target] = getNonArrayModel(modelRef);
|
|
378
|
-
const metadataMap = Reflect.getMetadata("fields", target.prototype) ?? /* @__PURE__ */ new Map();
|
|
379
|
-
const keySortMap = { id: -1, createdAt: 1, updatedAt: 2, removedAt: 3 };
|
|
380
|
-
return [...metadataMap.values()].sort((a, b) => (keySortMap[a.key] ?? 0) - (keySortMap[b.key] ?? 0));
|
|
381
|
-
};
|
|
382
|
-
var getFieldMetaMap = (modelRef) => {
|
|
383
|
-
const [target] = getNonArrayModel(modelRef);
|
|
384
|
-
const metadataMap = Reflect.getMetadata("fields", target.prototype) ?? /* @__PURE__ */ new Map();
|
|
385
|
-
return new Map(metadataMap);
|
|
386
|
-
};
|
|
387
|
-
var getFieldMetaMapOnPrototype = (prototype) => {
|
|
388
|
-
const metadataMap = Reflect.getMetadata("fields", prototype) ?? /* @__PURE__ */ new Map();
|
|
389
|
-
return new Map(metadataMap);
|
|
390
|
-
};
|
|
391
|
-
var setFieldMetaMapOnPrototype = (prototype, metadataMap) => {
|
|
392
|
-
Reflect.defineMetadata("fields", new Map(metadataMap), prototype);
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
// pkgs/@akanjs/constant/src/fieldMeta.ts
|
|
396
|
-
var applyFieldMeta = (modelRef, arrDepth, option, optionArrDepth) => {
|
|
397
|
-
const isArray = arrDepth > 0;
|
|
398
|
-
const isClass = !isGqlScalar(modelRef);
|
|
399
|
-
const isMap = isGqlMap(modelRef);
|
|
400
|
-
const { refName, type } = isClass ? getClassMeta(modelRef) : { refName: "", type: "scalar" };
|
|
401
|
-
const name = isClass ? refName : scalarNameMap.get(modelRef) ?? "Unknown";
|
|
402
|
-
if (isMap && !option.of)
|
|
403
|
-
throw new Error("Map type must have 'of' option");
|
|
404
|
-
return (prototype, key) => {
|
|
405
|
-
const metadata = {
|
|
406
|
-
nullable: option.nullable ?? false,
|
|
407
|
-
ref: option.ref,
|
|
408
|
-
refPath: option.refPath,
|
|
409
|
-
refType: option.refType,
|
|
410
|
-
default: option.default ?? (isArray ? [] : null),
|
|
411
|
-
type: option.type,
|
|
412
|
-
fieldType: option.fieldType ?? "property",
|
|
413
|
-
immutable: option.immutable ?? false,
|
|
414
|
-
min: option.min,
|
|
415
|
-
max: option.max,
|
|
416
|
-
enum: option.enum,
|
|
417
|
-
select: option.select ?? true,
|
|
418
|
-
minlength: option.minlength,
|
|
419
|
-
maxlength: option.maxlength,
|
|
420
|
-
query: option.query,
|
|
421
|
-
accumulate: option.accumulate,
|
|
422
|
-
example: option.example,
|
|
423
|
-
validate: option.validate,
|
|
424
|
-
key,
|
|
425
|
-
name,
|
|
426
|
-
isClass,
|
|
427
|
-
isScalar: type === "scalar",
|
|
428
|
-
modelRef,
|
|
429
|
-
arrDepth,
|
|
430
|
-
isArray,
|
|
431
|
-
optArrDepth: optionArrDepth,
|
|
432
|
-
isMap,
|
|
433
|
-
of: option.of,
|
|
434
|
-
text: option.text
|
|
435
|
-
};
|
|
436
|
-
const metadataMap = getFieldMetaMapOnPrototype(prototype);
|
|
437
|
-
metadataMap.set(key, metadata);
|
|
438
|
-
setFieldMetaMapOnPrototype(prototype, metadataMap);
|
|
439
|
-
};
|
|
440
|
-
};
|
|
441
|
-
var makeField = (customOption) => (returns, fieldOption) => {
|
|
442
|
-
const [modelRef, arrDepth] = getNonArrayModel(returns());
|
|
443
|
-
if (!fieldOption)
|
|
444
|
-
return applyFieldMeta(modelRef, arrDepth, { ...customOption }, arrDepth);
|
|
445
|
-
const [opt, optArrDepth] = getNonArrayModel(fieldOption);
|
|
446
|
-
return applyFieldMeta(modelRef, arrDepth, { ...opt, ...customOption }, optArrDepth);
|
|
447
|
-
};
|
|
448
|
-
var Field = {
|
|
449
|
-
Prop: makeField({ fieldType: "property" }),
|
|
450
|
-
Hidden: makeField({ fieldType: "hidden", nullable: true }),
|
|
451
|
-
Secret: makeField({ fieldType: "hidden", select: false, nullable: true }),
|
|
452
|
-
Resolve: makeField({ fieldType: "resolve" })
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
// pkgs/@akanjs/constant/src/constantDecorator.ts
|
|
456
|
-
var import_reflect_metadata2 = require("reflect-metadata");
|
|
457
|
-
|
|
458
|
-
// pkgs/@akanjs/constant/src/filterMeta.ts
|
|
459
|
-
var getFilterMeta = (filterRef) => {
|
|
460
|
-
const filterMeta = Reflect.getMetadata("filter", filterRef.prototype);
|
|
461
|
-
if (!filterMeta)
|
|
462
|
-
throw new Error("filterMeta is not defined");
|
|
463
|
-
return filterMeta;
|
|
464
|
-
};
|
|
465
|
-
var setFilterMeta = (filterRef, filterMeta) => {
|
|
466
|
-
const existingFilterMeta = Reflect.getMetadata("filter", filterRef.prototype);
|
|
467
|
-
if (existingFilterMeta)
|
|
468
|
-
Object.assign(filterMeta.sort, existingFilterMeta.sort);
|
|
469
|
-
Reflect.defineMetadata("filter", filterMeta, filterRef.prototype);
|
|
470
|
-
};
|
|
471
|
-
var getFilterKeyMetaMapOnPrototype = (prototype) => {
|
|
472
|
-
const metadataMap = Reflect.getMetadata("filterKey", prototype) ?? /* @__PURE__ */ new Map();
|
|
473
|
-
return new Map(metadataMap);
|
|
474
|
-
};
|
|
475
|
-
var setFilterKeyMetaMapOnPrototype = (prototype, metadataMap) => {
|
|
476
|
-
Reflect.defineMetadata("filterKey", new Map(metadataMap), prototype);
|
|
477
|
-
};
|
|
478
|
-
var applyFilterKeyMeta = (option) => {
|
|
479
|
-
return (prototype, key, descriptor) => {
|
|
480
|
-
const metadata = { key, ...option, descriptor };
|
|
481
|
-
const metadataMap = getFilterKeyMetaMapOnPrototype(prototype);
|
|
482
|
-
metadataMap.set(key, metadata);
|
|
483
|
-
setFilterKeyMetaMapOnPrototype(prototype, metadataMap);
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
|
-
var makeFilter = (customOption) => (fieldOption) => {
|
|
487
|
-
return applyFilterKeyMeta({ ...customOption, ...fieldOption });
|
|
488
|
-
};
|
|
489
|
-
var getFilterArgMetasOnPrototype = (prototype, key) => {
|
|
490
|
-
const filterArgMetas = Reflect.getMetadata("filterArg", prototype, key) ?? [];
|
|
491
|
-
return filterArgMetas;
|
|
492
|
-
};
|
|
493
|
-
var setFilterArgMetasOnPrototype = (prototype, key, filterArgMetas) => {
|
|
494
|
-
Reflect.defineMetadata("filterArg", filterArgMetas, prototype, key);
|
|
495
|
-
};
|
|
496
|
-
var getFilterArgMetas = (filterRef, key) => {
|
|
497
|
-
const filterArgMetas = getFilterArgMetasOnPrototype(filterRef.prototype, key);
|
|
498
|
-
return filterArgMetas;
|
|
499
|
-
};
|
|
500
|
-
var applyFilterArgMeta = (name, returns, argOption) => {
|
|
501
|
-
return (prototype, key, idx) => {
|
|
502
|
-
const [modelRef, arrDepth] = getNonArrayModel(returns());
|
|
503
|
-
const [opt, optArrDepth] = getNonArrayModel(argOption ?? {});
|
|
504
|
-
const filterArgMeta = { name, ...opt, modelRef, arrDepth, isArray: arrDepth > 0, optArrDepth };
|
|
505
|
-
const filterArgMetas = getFilterArgMetasOnPrototype(prototype, key);
|
|
506
|
-
filterArgMetas[idx] = filterArgMeta;
|
|
507
|
-
setFilterArgMetasOnPrototype(prototype, key, filterArgMetas);
|
|
508
|
-
};
|
|
509
|
-
};
|
|
510
|
-
var getFilterQueryMap = (filterRef) => {
|
|
511
|
-
const filterKeyMetaMap = getFilterKeyMetaMapOnPrototype(filterRef.prototype);
|
|
512
|
-
return filterKeyMetaMap;
|
|
513
|
-
};
|
|
514
|
-
var getFilterSortMap = (filterRef) => {
|
|
515
|
-
const filterMeta = getFilterMeta(filterRef);
|
|
516
|
-
return filterMeta.sort;
|
|
517
|
-
};
|
|
518
|
-
var Filter = {
|
|
519
|
-
Mongo: makeFilter({ type: "mongo" }),
|
|
520
|
-
// Meili: makeFilter({ fieldType: "hidden", nullable: true }),
|
|
521
|
-
Arg: applyFilterArgMeta
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
// pkgs/@akanjs/constant/src/baseGql.ts
|
|
525
|
-
var import_reflect_metadata3 = require("reflect-metadata");
|
|
526
|
-
var defaultFieldMeta = {
|
|
527
|
-
fieldType: "property",
|
|
528
|
-
immutable: false,
|
|
529
|
-
select: true,
|
|
530
|
-
isClass: false,
|
|
531
|
-
isScalar: true,
|
|
532
|
-
nullable: false,
|
|
533
|
-
isArray: false,
|
|
534
|
-
arrDepth: 0,
|
|
535
|
-
optArrDepth: 0,
|
|
536
|
-
default: null,
|
|
537
|
-
isMap: false
|
|
538
|
-
};
|
|
539
|
-
var idFieldMeta = { ...defaultFieldMeta, key: "id", name: "ID", modelRef: ID };
|
|
540
|
-
var createdAtFieldMeta = { ...defaultFieldMeta, key: "createdAt", name: "Date", modelRef: Date };
|
|
541
|
-
var updatedAtFieldMeta = { ...defaultFieldMeta, key: "updatedAt", name: "Date", modelRef: Date };
|
|
542
|
-
var removedAtFieldMeta = {
|
|
543
|
-
...defaultFieldMeta,
|
|
544
|
-
key: "removedAt",
|
|
545
|
-
name: "Date",
|
|
546
|
-
modelRef: Date,
|
|
547
|
-
nullable: true,
|
|
548
|
-
default: null
|
|
549
|
-
};
|
|
550
|
-
|
|
551
|
-
// pkgs/@akanjs/constant/src/classMeta.ts
|
|
552
|
-
var import_reflect_metadata4 = require("reflect-metadata");
|
|
553
|
-
var InputModelStorage = class {
|
|
554
|
-
};
|
|
555
|
-
var LightModelStorage = class {
|
|
556
|
-
};
|
|
557
|
-
var FullModelStorage = class {
|
|
558
|
-
};
|
|
559
|
-
var ScalarModelStorage = class {
|
|
560
|
-
};
|
|
561
|
-
var FilterModelStorage = class {
|
|
562
|
-
};
|
|
563
|
-
var hasTextField = (modelRef) => {
|
|
564
|
-
const fieldMetas = getFieldMetas(modelRef);
|
|
565
|
-
return fieldMetas.some(
|
|
566
|
-
(fieldMeta) => !!fieldMeta.text || fieldMeta.isScalar && fieldMeta.isClass && fieldMeta.select && hasTextField(fieldMeta.modelRef)
|
|
567
|
-
);
|
|
568
|
-
};
|
|
569
|
-
var applyClassMeta = (type, modelType, storage) => {
|
|
570
|
-
return function(refName) {
|
|
571
|
-
return function(target) {
|
|
572
|
-
const modelRef = target;
|
|
573
|
-
const classMeta = { refName, type, modelType, modelRef, hasTextField: hasTextField(modelRef) };
|
|
574
|
-
Reflect.defineMetadata("class", classMeta, modelRef.prototype);
|
|
575
|
-
Reflect.defineMetadata(refName, modelRef, storage.prototype);
|
|
576
|
-
};
|
|
577
|
-
};
|
|
578
|
-
};
|
|
579
|
-
var applyFilterMeta = (storage) => {
|
|
580
|
-
return function(refName) {
|
|
581
|
-
return function(target) {
|
|
582
|
-
const modelRef = target;
|
|
583
|
-
setFilterMeta(modelRef, { refName, sort: {} });
|
|
584
|
-
Reflect.defineMetadata(refName, modelRef, storage.prototype);
|
|
585
|
-
};
|
|
586
|
-
};
|
|
587
|
-
};
|
|
588
|
-
var Model = {
|
|
589
|
-
Light: applyClassMeta("light", "data", LightModelStorage),
|
|
590
|
-
Object: applyClassMeta("full", "ephemeral", FullModelStorage),
|
|
591
|
-
Full: applyClassMeta("full", "data", FullModelStorage),
|
|
592
|
-
Input: applyClassMeta("input", "data", InputModelStorage),
|
|
593
|
-
Scalar: applyClassMeta("scalar", "data", ScalarModelStorage),
|
|
594
|
-
Summary: applyClassMeta("scalar", "summary", ScalarModelStorage),
|
|
595
|
-
Insight: applyClassMeta("scalar", "insight", ScalarModelStorage),
|
|
596
|
-
Filter: applyFilterMeta(FilterModelStorage)
|
|
597
|
-
};
|
|
598
|
-
var getAllFullModelRefs = () => {
|
|
599
|
-
const modelNames = Reflect.getMetadataKeys(FullModelStorage.prototype);
|
|
600
|
-
const modelRefs = modelNames.map(
|
|
601
|
-
(modelName) => Reflect.getMetadata(modelName, FullModelStorage.prototype)
|
|
602
|
-
);
|
|
603
|
-
return modelRefs;
|
|
604
|
-
};
|
|
605
|
-
var getAllScalarModelRefs = () => {
|
|
606
|
-
const modelNames = Reflect.getMetadataKeys(ScalarModelStorage.prototype);
|
|
607
|
-
const modelRefs = modelNames.map(
|
|
608
|
-
(modelName) => Reflect.getMetadata(modelName, ScalarModelStorage.prototype)
|
|
609
|
-
);
|
|
610
|
-
return modelRefs;
|
|
611
|
-
};
|
|
612
|
-
var getAllFilterModelRefs = () => {
|
|
613
|
-
const modelNames = Reflect.getMetadataKeys(FilterModelStorage.prototype);
|
|
614
|
-
const modelRefs = modelNames.map(
|
|
615
|
-
(modelName) => Reflect.getMetadata(modelName, FilterModelStorage.prototype)
|
|
616
|
-
);
|
|
617
|
-
return modelRefs;
|
|
618
|
-
};
|
|
619
|
-
|
|
620
|
-
// pkgs/@akanjs/signal/src/client.ts
|
|
621
|
-
var import_core = require("@urql/core");
|
|
622
|
-
var import_socket = require("socket.io-client");
|
|
623
|
-
var SocketIo = class {
|
|
624
|
-
socket;
|
|
625
|
-
roomSubscribeMap = /* @__PURE__ */ new Map();
|
|
626
|
-
constructor(uri) {
|
|
627
|
-
this.socket = (0, import_socket.io)(uri, { transports: ["websocket"] });
|
|
628
|
-
this.socket.on("connect", () => {
|
|
629
|
-
this.roomSubscribeMap.forEach((option) => {
|
|
630
|
-
this.socket.emit(option.key, { ...option.message, __subscribe__: true });
|
|
631
|
-
});
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
on(event, callback) {
|
|
635
|
-
this.socket.on(event, callback);
|
|
636
|
-
}
|
|
637
|
-
removeListener(event, callback) {
|
|
638
|
-
this.socket.removeListener(event, callback);
|
|
639
|
-
}
|
|
640
|
-
removeAllListeners() {
|
|
641
|
-
this.socket.removeAllListeners();
|
|
642
|
-
}
|
|
643
|
-
hasListeners(event) {
|
|
644
|
-
return this.socket.hasListeners(event);
|
|
645
|
-
}
|
|
646
|
-
emit(key, data) {
|
|
647
|
-
this.socket.emit(key, data);
|
|
648
|
-
}
|
|
649
|
-
subscribe(option) {
|
|
650
|
-
if (!this.roomSubscribeMap.has(option.roomId)) {
|
|
651
|
-
this.roomSubscribeMap.set(option.roomId, option);
|
|
652
|
-
this.socket.emit(option.key, { ...option.message, __subscribe__: true });
|
|
653
|
-
}
|
|
654
|
-
this.socket.on(option.roomId, option.handleEvent);
|
|
655
|
-
}
|
|
656
|
-
unsubscribe(roomId, handleEvent) {
|
|
657
|
-
this.socket.removeListener(roomId, handleEvent);
|
|
658
|
-
const option = this.roomSubscribeMap.get(roomId);
|
|
659
|
-
if (this.hasListeners(roomId) || !option)
|
|
660
|
-
return;
|
|
661
|
-
this.roomSubscribeMap.delete(roomId);
|
|
662
|
-
this.socket.emit(option.key, { ...option.message, __subscribe__: false });
|
|
663
|
-
}
|
|
664
|
-
disconnect() {
|
|
665
|
-
this.socket.disconnect();
|
|
666
|
-
return this;
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
var Client = class _Client {
|
|
670
|
-
static globalIoMap = /* @__PURE__ */ new Map();
|
|
671
|
-
static tokenStore = /* @__PURE__ */ new Map();
|
|
672
|
-
async waitUntilWebSocketConnected(ws = baseClientEnv.serverWsUri) {
|
|
673
|
-
if (baseClientEnv.side === "server")
|
|
674
|
-
return true;
|
|
675
|
-
while (!this.getIo(ws).socket.connected) {
|
|
676
|
-
Logger.verbose("waiting for websocket to initialize...");
|
|
677
|
-
await sleep(300);
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
isInitialized = false;
|
|
681
|
-
uri = baseClientEnv.serverGraphqlUri;
|
|
682
|
-
ws = baseClientEnv.serverWsUri;
|
|
683
|
-
udp = null;
|
|
684
|
-
gql = (0, import_core.createClient)({ url: this.uri, fetch, exchanges: [import_core.cacheExchange, import_core.fetchExchange] });
|
|
685
|
-
jwt = null;
|
|
686
|
-
async getJwt() {
|
|
687
|
-
const isNextServer = baseClientEnv.side === "server" && baseEnv.operationType === "client";
|
|
688
|
-
if (isNextServer) {
|
|
689
|
-
const nextHeaders = require("next/headers");
|
|
690
|
-
return (await nextHeaders.cookies?.())?.get("jwt")?.value ?? (await nextHeaders.headers?.())?.get("jwt") ?? this.jwt ?? null;
|
|
691
|
-
} else
|
|
692
|
-
return _Client.tokenStore.get(this) ?? null;
|
|
693
|
-
}
|
|
694
|
-
io = null;
|
|
695
|
-
init(data = {}) {
|
|
696
|
-
Object.assign(this, data);
|
|
697
|
-
this.setLink(data.uri);
|
|
698
|
-
this.setIo(data.ws);
|
|
699
|
-
this.isInitialized = true;
|
|
700
|
-
}
|
|
701
|
-
setIo(ws = baseClientEnv.serverWsUri) {
|
|
702
|
-
this.ws = ws;
|
|
703
|
-
const existingIo = _Client.globalIoMap.get(ws);
|
|
704
|
-
if (existingIo) {
|
|
705
|
-
this.io = existingIo;
|
|
706
|
-
return;
|
|
707
|
-
}
|
|
708
|
-
this.io = new SocketIo(ws);
|
|
709
|
-
_Client.globalIoMap.set(ws, this.io);
|
|
710
|
-
}
|
|
711
|
-
getIo(ws = baseClientEnv.serverWsUri) {
|
|
712
|
-
const existingIo = _Client.globalIoMap.get(ws);
|
|
713
|
-
if (existingIo)
|
|
714
|
-
return existingIo;
|
|
715
|
-
const io2 = new SocketIo(ws);
|
|
716
|
-
_Client.globalIoMap.set(ws, io2);
|
|
717
|
-
return io2;
|
|
718
|
-
}
|
|
719
|
-
setLink(uri = baseClientEnv.serverGraphqlUri) {
|
|
720
|
-
this.uri = uri;
|
|
721
|
-
this.gql = (0, import_core.createClient)({
|
|
722
|
-
url: this.uri,
|
|
723
|
-
fetch,
|
|
724
|
-
exchanges: [import_core.cacheExchange, import_core.fetchExchange],
|
|
725
|
-
// requestPolicy: "network-only",
|
|
726
|
-
fetchOptions: () => {
|
|
727
|
-
return {
|
|
728
|
-
headers: {
|
|
729
|
-
"apollo-require-preflight": "true",
|
|
730
|
-
...this.jwt ? { authorization: `Bearer ${this.jwt}` } : {}
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
setJwt(jwt) {
|
|
737
|
-
_Client.tokenStore.set(this, jwt);
|
|
738
|
-
}
|
|
739
|
-
reset() {
|
|
740
|
-
this.io?.disconnect();
|
|
741
|
-
this.io = null;
|
|
742
|
-
this.jwt = null;
|
|
743
|
-
}
|
|
744
|
-
clone(data = {}) {
|
|
745
|
-
const newClient = new _Client();
|
|
746
|
-
newClient.init({ ...this, ...data });
|
|
747
|
-
if (data.jwt)
|
|
748
|
-
_Client.tokenStore.set(newClient, data.jwt);
|
|
749
|
-
return newClient;
|
|
750
|
-
}
|
|
751
|
-
terminate() {
|
|
752
|
-
this.reset();
|
|
753
|
-
_Client.globalIoMap.forEach((io2) => io2.disconnect());
|
|
754
|
-
this.isInitialized = false;
|
|
755
|
-
}
|
|
756
|
-
setUdp(udp) {
|
|
757
|
-
this.udp = udp;
|
|
758
|
-
}
|
|
759
|
-
};
|
|
760
|
-
var client = new Client();
|
|
761
|
-
|
|
762
|
-
// pkgs/@akanjs/signal/src/immerify.ts
|
|
763
|
-
var import_immer = require("immer");
|
|
764
|
-
|
|
765
|
-
// pkgs/@akanjs/signal/src/signalDecorators.ts
|
|
766
|
-
var import_reflect_metadata5 = require("reflect-metadata");
|
|
767
|
-
var SignalStorage = class {
|
|
768
|
-
};
|
|
769
|
-
var getAllSignalRefs = () => {
|
|
770
|
-
const signalNames = Reflect.getOwnMetadataKeys(SignalStorage.prototype);
|
|
771
|
-
const sigRefs = signalNames?.reduce((acc, signalName) => [...acc, ...getSignalRefsOnStorage(signalName)], []) ?? [];
|
|
772
|
-
return sigRefs;
|
|
773
|
-
};
|
|
774
|
-
var getSignalRefsOnStorage = (refName) => {
|
|
775
|
-
const sigRefs = Reflect.getMetadata(refName, SignalStorage.prototype);
|
|
776
|
-
return sigRefs ?? [];
|
|
777
|
-
};
|
|
778
|
-
var createArgMetaDecorator = (type) => {
|
|
779
|
-
return function(option = {}) {
|
|
780
|
-
return function(prototype, key, idx) {
|
|
781
|
-
const argMetas = getArgMetasOnPrototype(prototype, key);
|
|
782
|
-
argMetas[idx] = { key, idx, type, option };
|
|
783
|
-
setArgMetasOnPrototype(prototype, key, argMetas);
|
|
784
|
-
};
|
|
785
|
-
};
|
|
786
|
-
};
|
|
787
|
-
var Account = createArgMetaDecorator("Account");
|
|
788
|
-
var defaultAccount = {
|
|
789
|
-
__InternalArg__: "Account",
|
|
790
|
-
appName: baseEnv.appName,
|
|
791
|
-
environment: baseEnv.environment
|
|
792
|
-
};
|
|
793
|
-
var Self = createArgMetaDecorator("Self");
|
|
794
|
-
var Me = createArgMetaDecorator("Me");
|
|
795
|
-
var UserIp = createArgMetaDecorator("UserIp");
|
|
796
|
-
var Access = createArgMetaDecorator("Access");
|
|
797
|
-
var Req = createArgMetaDecorator("Req");
|
|
798
|
-
var Res = createArgMetaDecorator("Res");
|
|
799
|
-
var Ws = createArgMetaDecorator("Ws");
|
|
800
|
-
var Job = createArgMetaDecorator("Job");
|
|
801
|
-
var getQuery = (allow) => function(returns, signalOption = {}, guards = []) {
|
|
802
|
-
return (prototype, key, descriptor) => {
|
|
803
|
-
const metadataMap = getGqlMetaMapOnPrototype(prototype);
|
|
804
|
-
metadataMap.set(key, {
|
|
805
|
-
returns,
|
|
806
|
-
signalOption,
|
|
807
|
-
key,
|
|
808
|
-
descriptor,
|
|
809
|
-
guards: [allow, ...guards],
|
|
810
|
-
type: "Query"
|
|
811
|
-
});
|
|
812
|
-
setGqlMetaMapOnPrototype(prototype, metadataMap);
|
|
813
|
-
};
|
|
814
|
-
};
|
|
815
|
-
var getMutation = (allow) => function(returns, signalOption = {}, guards = []) {
|
|
816
|
-
return (prototype, key, descriptor) => {
|
|
817
|
-
const metadataMap = getGqlMetaMapOnPrototype(prototype);
|
|
818
|
-
metadataMap.set(key, {
|
|
819
|
-
returns,
|
|
820
|
-
signalOption,
|
|
821
|
-
key,
|
|
822
|
-
descriptor,
|
|
823
|
-
guards: [allow, ...guards],
|
|
824
|
-
type: "Mutation"
|
|
825
|
-
});
|
|
826
|
-
setGqlMetaMapOnPrototype(prototype, metadataMap);
|
|
827
|
-
};
|
|
828
|
-
};
|
|
829
|
-
var getMessage = (allow) => function(returns, signalOption = {}, guards = []) {
|
|
830
|
-
return (prototype, key, descriptor) => {
|
|
831
|
-
const metadataMap = getGqlMetaMapOnPrototype(prototype);
|
|
832
|
-
metadataMap.set(key, {
|
|
833
|
-
returns,
|
|
834
|
-
signalOption,
|
|
835
|
-
key,
|
|
836
|
-
descriptor,
|
|
837
|
-
guards: [allow, ...guards],
|
|
838
|
-
type: "Message"
|
|
839
|
-
});
|
|
840
|
-
setGqlMetaMapOnPrototype(prototype, metadataMap);
|
|
841
|
-
};
|
|
842
|
-
};
|
|
843
|
-
var getPubsub = (allow) => function(returns, signalOption = {}, guards = []) {
|
|
844
|
-
return (prototype, key, descriptor) => {
|
|
845
|
-
const metadataMap = getGqlMetaMapOnPrototype(prototype);
|
|
846
|
-
metadataMap.set(key, {
|
|
847
|
-
returns,
|
|
848
|
-
signalOption,
|
|
849
|
-
key,
|
|
850
|
-
descriptor,
|
|
851
|
-
guards: [allow, ...guards],
|
|
852
|
-
type: "Pubsub"
|
|
853
|
-
});
|
|
854
|
-
setGqlMetaMapOnPrototype(prototype, metadataMap);
|
|
855
|
-
};
|
|
856
|
-
};
|
|
857
|
-
var getProcess = (serverType) => function(returns, signalOption = {}) {
|
|
858
|
-
return (prototype, key, descriptor) => {
|
|
859
|
-
const metadataMap = getGqlMetaMapOnPrototype(prototype);
|
|
860
|
-
metadataMap.set(key, {
|
|
861
|
-
returns,
|
|
862
|
-
signalOption: { ...signalOption, serverType: lowerlize(serverType) },
|
|
863
|
-
key,
|
|
864
|
-
descriptor,
|
|
865
|
-
guards: ["None"],
|
|
866
|
-
type: "Process"
|
|
867
|
-
});
|
|
868
|
-
setGqlMetaMapOnPrototype(prototype, metadataMap);
|
|
869
|
-
};
|
|
870
|
-
};
|
|
871
|
-
var Query = {
|
|
872
|
-
Public: getQuery("Public"),
|
|
873
|
-
Every: getQuery("Every"),
|
|
874
|
-
Admin: getQuery("Admin"),
|
|
875
|
-
User: getQuery("User"),
|
|
876
|
-
SuperAdmin: getQuery("SuperAdmin"),
|
|
877
|
-
None: getQuery("None"),
|
|
878
|
-
Owner: getQuery("Owner")
|
|
879
|
-
};
|
|
880
|
-
var Mutation = {
|
|
881
|
-
Public: getMutation("Public"),
|
|
882
|
-
Every: getMutation("Every"),
|
|
883
|
-
Admin: getMutation("Admin"),
|
|
884
|
-
User: getMutation("User"),
|
|
885
|
-
SuperAdmin: getMutation("SuperAdmin"),
|
|
886
|
-
None: getMutation("None"),
|
|
887
|
-
Owner: getMutation("Owner")
|
|
888
|
-
};
|
|
889
|
-
var Message = {
|
|
890
|
-
Public: getMessage("Public"),
|
|
891
|
-
Every: getMessage("Every"),
|
|
892
|
-
Admin: getMessage("Admin"),
|
|
893
|
-
User: getMessage("User"),
|
|
894
|
-
SuperAdmin: getMessage("SuperAdmin"),
|
|
895
|
-
None: getMessage("None"),
|
|
896
|
-
Owner: getMessage("Owner")
|
|
897
|
-
};
|
|
898
|
-
var Pubsub = {
|
|
899
|
-
Public: getPubsub("Public"),
|
|
900
|
-
Every: getPubsub("Every"),
|
|
901
|
-
Admin: getPubsub("Admin"),
|
|
902
|
-
User: getPubsub("User"),
|
|
903
|
-
SuperAdmin: getPubsub("SuperAdmin"),
|
|
904
|
-
None: getPubsub("None"),
|
|
905
|
-
Owner: getPubsub("Owner")
|
|
906
|
-
};
|
|
907
|
-
var Process = {
|
|
908
|
-
Federation: getProcess("Federation"),
|
|
909
|
-
Batch: getProcess("Batch"),
|
|
910
|
-
All: getProcess("All")
|
|
911
|
-
};
|
|
912
|
-
var getArg = (type) => function(name, returns, argsOption = {}) {
|
|
913
|
-
return function(prototype, key, idx) {
|
|
914
|
-
const argMetas = getArgMetasOnPrototype(prototype, key);
|
|
915
|
-
argMetas[idx] = { name, returns, argsOption, key, idx, type };
|
|
916
|
-
setArgMetasOnPrototype(prototype, key, argMetas);
|
|
917
|
-
};
|
|
918
|
-
};
|
|
919
|
-
var Arg = {
|
|
920
|
-
Body: getArg("Body"),
|
|
921
|
-
Param: getArg("Param"),
|
|
922
|
-
Query: getArg("Query"),
|
|
923
|
-
Upload: getArg("Upload"),
|
|
924
|
-
Msg: getArg("Msg"),
|
|
925
|
-
Room: getArg("Room")
|
|
926
|
-
};
|
|
927
|
-
var getSigMeta = (sigRef) => {
|
|
928
|
-
const sigMeta = Reflect.getMetadata("signal", sigRef.prototype);
|
|
929
|
-
if (!sigMeta)
|
|
930
|
-
throw new Error(`No SignalMeta found for ${sigRef.name}`);
|
|
931
|
-
return sigMeta;
|
|
932
|
-
};
|
|
933
|
-
var getGqlMetaMapOnPrototype = (prototype) => {
|
|
934
|
-
const gqlMetaMap = Reflect.getMetadata("gql", prototype);
|
|
935
|
-
return gqlMetaMap ?? /* @__PURE__ */ new Map();
|
|
936
|
-
};
|
|
937
|
-
var getGqlMetas = (sigRef) => {
|
|
938
|
-
const gqlMetaMap = Reflect.getMetadata("gql", sigRef.prototype);
|
|
939
|
-
return gqlMetaMap ? [...gqlMetaMap.values()] : [];
|
|
940
|
-
};
|
|
941
|
-
var setGqlMetaMapOnPrototype = (prototype, gqlMetaMap) => {
|
|
942
|
-
Reflect.defineMetadata("gql", gqlMetaMap, prototype);
|
|
943
|
-
};
|
|
944
|
-
var getArgMetas = (sigRef, key) => {
|
|
945
|
-
const metas = Reflect.getMetadata("args", sigRef.prototype, key) ?? [];
|
|
946
|
-
const argMetas = metas.filter((meta) => !!meta.returns);
|
|
947
|
-
const internalArgMetas = metas.filter((meta) => !meta.returns);
|
|
948
|
-
return [argMetas, internalArgMetas];
|
|
949
|
-
};
|
|
950
|
-
var getArgMetasOnPrototype = (prototype, key) => {
|
|
951
|
-
return Reflect.getMetadata("args", prototype, key) ?? [];
|
|
952
|
-
};
|
|
953
|
-
var setArgMetasOnPrototype = (prototype, key, argMetas) => {
|
|
954
|
-
Reflect.defineMetadata("args", argMetas, prototype, key);
|
|
955
|
-
};
|
|
956
|
-
|
|
957
|
-
// pkgs/@akanjs/signal/src/baseFetch.ts
|
|
958
|
-
var nativeFetch = fetch;
|
|
959
|
-
var baseFetch = Object.assign(nativeFetch, {
|
|
960
|
-
client,
|
|
961
|
-
clone: function(option = {}) {
|
|
962
|
-
return {
|
|
963
|
-
...this,
|
|
964
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
965
|
-
client: this.client.clone(option)
|
|
966
|
-
};
|
|
967
|
-
}
|
|
968
|
-
});
|
|
969
|
-
|
|
970
32
|
// pkgs/@akanjs/dictionary/src/trans.ts
|
|
33
|
+
var import_common = require("@akanjs/common");
|
|
34
|
+
var import_constant = require("@akanjs/constant");
|
|
35
|
+
var import_signal = require("@akanjs/signal");
|
|
971
36
|
var baseTrans = {
|
|
972
37
|
id: ["Id", "\uC544\uC774\uB514"],
|
|
973
38
|
"desc-id": ["Unique ID value", "\uC720\uB2C8\uD06C\uD55C \uC544\uC774\uB514\uAC12"],
|
|
@@ -993,7 +58,7 @@ var baseTrans = {
|
|
|
993
58
|
"qargdesc-byStatuses-statuses": ["Statuses", "\uC0C1\uD0DC"]
|
|
994
59
|
};
|
|
995
60
|
var getBaseSignalTrans = (modelName) => {
|
|
996
|
-
const className = capitalize(modelName);
|
|
61
|
+
const className = (0, import_common.capitalize)(modelName);
|
|
997
62
|
return {
|
|
998
63
|
// * ==================== Endpoint ==================== * //
|
|
999
64
|
[`api-light${className}`]: [`Get light version of ${modelName}`, `${modelName} \uACBD\uB7C9\uD654 \uBC84\uC804 \uC870\uD68C`],
|
|
@@ -1042,7 +107,7 @@ var getBaseSignalTrans = (modelName) => {
|
|
|
1042
107
|
var checkModelDictCoverages = (modelName, dictionary, modelRefs, filterRefs) => {
|
|
1043
108
|
const enumKeyMap = /* @__PURE__ */ new Map();
|
|
1044
109
|
modelRefs.forEach((modelRef) => {
|
|
1045
|
-
const fieldMetaMap = getFieldMetaMap(modelRef);
|
|
110
|
+
const fieldMetaMap = (0, import_constant.getFieldMetaMap)(modelRef);
|
|
1046
111
|
[...fieldMetaMap.values()].forEach((fieldMeta) => {
|
|
1047
112
|
if (!fieldMeta.enum)
|
|
1048
113
|
return;
|
|
@@ -1052,12 +117,12 @@ var checkModelDictCoverages = (modelName, dictionary, modelRefs, filterRefs) =>
|
|
|
1052
117
|
const modelDict = rootDictionary[modelName];
|
|
1053
118
|
const rootEnumDict = modelDict?.[`enum-${fieldMeta.key}-${value}`];
|
|
1054
119
|
if (!enumDict && !rootEnumDict) {
|
|
1055
|
-
Logger.warn(`\u2620\uFE0F Missing enum translation: ${modelName}.enum-${fieldMeta.key}-${value}`);
|
|
120
|
+
import_common.Logger.warn(`\u2620\uFE0F Missing enum translation: ${modelName}.enum-${fieldMeta.key}-${value}`);
|
|
1056
121
|
}
|
|
1057
122
|
const enumDescDict = dictionary[`enumdesc-${fieldMeta.key}-${value}`];
|
|
1058
123
|
const rootEnumDescDict = modelDict?.[`enumdesc-${fieldMeta.key}-${value}`];
|
|
1059
124
|
if (!enumDescDict && !rootEnumDescDict) {
|
|
1060
|
-
Logger.warn(`\u2620\uFE0F Missing enum description: ${modelName}.enumdesc-${fieldMeta.key}-${value}`);
|
|
125
|
+
import_common.Logger.warn(`\u2620\uFE0F Missing enum description: ${modelName}.enumdesc-${fieldMeta.key}-${value}`);
|
|
1061
126
|
}
|
|
1062
127
|
});
|
|
1063
128
|
});
|
|
@@ -1066,19 +131,19 @@ var checkModelDictCoverages = (modelName, dictionary, modelRefs, filterRefs) =>
|
|
|
1066
131
|
const [, fieldKey, ...values] = key.split("-");
|
|
1067
132
|
const value = values.join("-");
|
|
1068
133
|
if (!enumKeyMap.get(fieldKey)?.has(value)) {
|
|
1069
|
-
Logger.error(
|
|
134
|
+
import_common.Logger.error(
|
|
1070
135
|
`\u{1F47B} Unused enum translation, need to delete: ${modelName}.enum-${fieldKey}-${value} & ${modelName}.enumdesc-${fieldKey}-${value}`
|
|
1071
136
|
);
|
|
1072
137
|
}
|
|
1073
138
|
});
|
|
1074
139
|
const fieldKeySet = /* @__PURE__ */ new Set([
|
|
1075
|
-
...modelRefs.map((modelRef) => [...getFieldMetaMap(modelRef).keys()]).flat(),
|
|
1076
|
-
...filterRefs.map((filterRef) => Object.keys(getFilterSortMap(filterRef))).flat()
|
|
140
|
+
...modelRefs.map((modelRef) => [...(0, import_constant.getFieldMetaMap)(modelRef).keys()]).flat(),
|
|
141
|
+
...filterRefs.map((filterRef) => Object.keys((0, import_constant.getFilterSortMap)(filterRef))).flat()
|
|
1077
142
|
]);
|
|
1078
143
|
Object.keys(dictionary).filter((key) => key.startsWith("desc-")).forEach((key) => {
|
|
1079
144
|
const [, fieldKey] = key.split("-");
|
|
1080
145
|
if (!fieldKeySet.has(fieldKey))
|
|
1081
|
-
Logger.error(
|
|
146
|
+
import_common.Logger.error(
|
|
1082
147
|
`\u{1F47B} Unused description translation, need to delete: ${modelName}.${fieldKey} & ${modelName}.desc-${fieldKey}`
|
|
1083
148
|
);
|
|
1084
149
|
});
|
|
@@ -1086,18 +151,18 @@ var checkModelDictCoverages = (modelName, dictionary, modelRefs, filterRefs) =>
|
|
|
1086
151
|
var checkSignalDictCoverages = (modelName, sigRefs, dictionary) => {
|
|
1087
152
|
const argKeyMap = /* @__PURE__ */ new Map();
|
|
1088
153
|
sigRefs.forEach((sigRef) => {
|
|
1089
|
-
const gqlMetas = getGqlMetas(sigRef);
|
|
154
|
+
const gqlMetas = (0, import_signal.getGqlMetas)(sigRef);
|
|
1090
155
|
gqlMetas.filter((gqlMeta) => gqlMeta.type !== "Process").forEach((gqlMeta) => {
|
|
1091
|
-
const [argMetas] = getArgMetas(sigRef, gqlMeta.key);
|
|
156
|
+
const [argMetas] = (0, import_signal.getArgMetas)(sigRef, gqlMeta.key);
|
|
1092
157
|
argKeyMap.set(gqlMeta.key, new Set(argMetas.map((argMeta) => argMeta.name)));
|
|
1093
158
|
argMetas.forEach((argMeta) => {
|
|
1094
159
|
const argDict = dictionary[`arg-${gqlMeta.key}-${argMeta.name}`];
|
|
1095
160
|
if (!argDict) {
|
|
1096
|
-
Logger.warn(`\u2620\uFE0F Missing arg translation: ${modelName}.arg-${gqlMeta.key}-${argMeta.name}`);
|
|
161
|
+
import_common.Logger.warn(`\u2620\uFE0F Missing arg translation: ${modelName}.arg-${gqlMeta.key}-${argMeta.name}`);
|
|
1097
162
|
}
|
|
1098
163
|
const argDescDict = dictionary[`argdesc-${gqlMeta.key}-${argMeta.name}`];
|
|
1099
164
|
if (!argDescDict) {
|
|
1100
|
-
Logger.warn(`\u2620\uFE0F Missing arg description: ${modelName}.argdesc-${gqlMeta.key}-${argMeta.name}`);
|
|
165
|
+
import_common.Logger.warn(`\u2620\uFE0F Missing arg description: ${modelName}.argdesc-${gqlMeta.key}-${argMeta.name}`);
|
|
1101
166
|
}
|
|
1102
167
|
});
|
|
1103
168
|
});
|
|
@@ -1105,7 +170,7 @@ var checkSignalDictCoverages = (modelName, sigRefs, dictionary) => {
|
|
|
1105
170
|
Object.keys(dictionary).filter((key) => key.startsWith("arg-")).forEach((key) => {
|
|
1106
171
|
const [, gqlKey, argKey] = key.split("-");
|
|
1107
172
|
if (!argKeyMap.get(gqlKey)?.has(argKey))
|
|
1108
|
-
Logger.error(
|
|
173
|
+
import_common.Logger.error(
|
|
1109
174
|
`\u{1F47B} Unused arg translation, need to delete: ${modelName}.arg-${gqlKey}-${argKey} & ${modelName}.argdesc-${gqlKey}-${argKey}`
|
|
1110
175
|
);
|
|
1111
176
|
});
|
|
@@ -1113,85 +178,85 @@ var checkSignalDictCoverages = (modelName, sigRefs, dictionary) => {
|
|
|
1113
178
|
var checkFilterDictCoverages = (modelName, filterRefs, dictionary) => {
|
|
1114
179
|
const qargKeyMap = /* @__PURE__ */ new Map();
|
|
1115
180
|
filterRefs.forEach((filterRef) => {
|
|
1116
|
-
const filterMetaMap = getFilterQueryMap(filterRef);
|
|
181
|
+
const filterMetaMap = (0, import_constant.getFilterQueryMap)(filterRef);
|
|
1117
182
|
filterMetaMap.forEach((filterMeta) => {
|
|
1118
|
-
const filterArgMetas = getFilterArgMetas(filterRef, filterMeta.key);
|
|
183
|
+
const filterArgMetas = (0, import_constant.getFilterArgMetas)(filterRef, filterMeta.key);
|
|
1119
184
|
qargKeyMap.set(filterMeta.key, new Set(filterArgMetas.map((filterArgMeta) => filterArgMeta.name)));
|
|
1120
185
|
filterArgMetas.forEach((filterArgMeta) => {
|
|
1121
186
|
const qargDict = dictionary[`qarg-${filterMeta.key}-${filterArgMeta.name}`];
|
|
1122
187
|
if (!qargDict)
|
|
1123
|
-
Logger.warn(`\u2620\uFE0F Missing qarg translation: ${modelName}.qarg-${filterMeta.key}-${filterArgMeta.name}`);
|
|
188
|
+
import_common.Logger.warn(`\u2620\uFE0F Missing qarg translation: ${modelName}.qarg-${filterMeta.key}-${filterArgMeta.name}`);
|
|
1124
189
|
const qargDescDict = dictionary[`qargdesc-${filterMeta.key}-${filterArgMeta.name}`];
|
|
1125
190
|
if (!qargDescDict)
|
|
1126
|
-
Logger.warn(`\u2620\uFE0F Missing qarg description: ${modelName}.qargdesc-${filterMeta.key}-${filterArgMeta.name}`);
|
|
191
|
+
import_common.Logger.warn(`\u2620\uFE0F Missing qarg description: ${modelName}.qargdesc-${filterMeta.key}-${filterArgMeta.name}`);
|
|
1127
192
|
});
|
|
1128
193
|
});
|
|
1129
194
|
});
|
|
1130
195
|
Object.keys(dictionary).filter((key) => key.startsWith("qarg-")).forEach((key) => {
|
|
1131
196
|
const [, filterKey, filterArgKey] = key.split("-");
|
|
1132
197
|
if (!qargKeyMap.get(filterKey)?.has(filterArgKey))
|
|
1133
|
-
Logger.error(
|
|
198
|
+
import_common.Logger.error(
|
|
1134
199
|
`\u{1F47B} Unused qarg translation, need to delete: ${modelName}.qarg-${filterKey}-${filterArgKey} & ${modelName}.qargdesc-${filterKey}-${filterArgKey}`
|
|
1135
200
|
);
|
|
1136
201
|
});
|
|
1137
202
|
};
|
|
1138
203
|
var checkDictCoverage = () => {
|
|
1139
|
-
const fullModelRefEntries = getAllFullModelRefs().filter((modelRef) => {
|
|
1140
|
-
const classMeta = getClassMeta(modelRef);
|
|
204
|
+
const fullModelRefEntries = (0, import_constant.getAllFullModelRefs)().filter((modelRef) => {
|
|
205
|
+
const classMeta = (0, import_constant.getClassMeta)(modelRef);
|
|
1141
206
|
return classMeta.type === "full" && classMeta.modelType === "data";
|
|
1142
207
|
}).map((modelRef) => {
|
|
1143
|
-
const classMeta = getClassMeta(modelRef);
|
|
1144
|
-
const modelName = lowerlize(classMeta.refName);
|
|
208
|
+
const classMeta = (0, import_constant.getClassMeta)(modelRef);
|
|
209
|
+
const modelName = (0, import_common.lowerlize)(classMeta.refName);
|
|
1145
210
|
return { modelName, modelRef };
|
|
1146
211
|
});
|
|
1147
|
-
const scalarModelRefs = getAllScalarModelRefs();
|
|
1148
|
-
const insightModelRefEntries = scalarModelRefs.filter((ref) => getClassMeta(ref).modelType === "insight").map((modelRef) => {
|
|
1149
|
-
const classMeta = getClassMeta(modelRef);
|
|
212
|
+
const scalarModelRefs = (0, import_constant.getAllScalarModelRefs)();
|
|
213
|
+
const insightModelRefEntries = scalarModelRefs.filter((ref) => (0, import_constant.getClassMeta)(ref).modelType === "insight").map((modelRef) => {
|
|
214
|
+
const classMeta = (0, import_constant.getClassMeta)(modelRef);
|
|
1150
215
|
if (!classMeta.refName.endsWith("Insight"))
|
|
1151
216
|
throw new Error(`Invalid insight model name: ${classMeta.refName}`);
|
|
1152
|
-
const modelName = lowerlize(classMeta.refName.slice(0, -7));
|
|
217
|
+
const modelName = (0, import_common.lowerlize)(classMeta.refName.slice(0, -7));
|
|
1153
218
|
return { modelName, modelRef };
|
|
1154
219
|
});
|
|
1155
|
-
const pureScalarModelRefEntries = scalarModelRefs.filter((ref) => getClassMeta(ref).modelType === "data").map((modelRef) => {
|
|
1156
|
-
const classMeta = getClassMeta(modelRef);
|
|
1157
|
-
const modelName = lowerlize(classMeta.refName);
|
|
220
|
+
const pureScalarModelRefEntries = scalarModelRefs.filter((ref) => (0, import_constant.getClassMeta)(ref).modelType === "data").map((modelRef) => {
|
|
221
|
+
const classMeta = (0, import_constant.getClassMeta)(modelRef);
|
|
222
|
+
const modelName = (0, import_common.lowerlize)(classMeta.refName);
|
|
1158
223
|
return { modelName, modelRef };
|
|
1159
224
|
});
|
|
1160
|
-
const filterModelRefEntries = getAllFilterModelRefs().map((filterModelRef) => {
|
|
1161
|
-
const filterMeta = getFilterMeta(filterModelRef);
|
|
225
|
+
const filterModelRefEntries = (0, import_constant.getAllFilterModelRefs)().map((filterModelRef) => {
|
|
226
|
+
const filterMeta = (0, import_constant.getFilterMeta)(filterModelRef);
|
|
1162
227
|
if (!filterMeta.refName.endsWith("Filter"))
|
|
1163
228
|
throw new Error(`Invalid filter model name: ${filterMeta.refName}`);
|
|
1164
|
-
const modelName = lowerlize(filterMeta.refName.slice(0, -6));
|
|
229
|
+
const modelName = (0, import_common.lowerlize)(filterMeta.refName.slice(0, -6));
|
|
1165
230
|
return { modelName, filterModelRef };
|
|
1166
231
|
});
|
|
1167
|
-
const signalRefs = getAllSignalRefs();
|
|
232
|
+
const signalRefs = (0, import_signal.getAllSignalRefs)();
|
|
1168
233
|
const fullModelSignalRefEntries = signalRefs.filter((ref) => {
|
|
1169
|
-
const sigMeta = getSigMeta(ref);
|
|
234
|
+
const sigMeta = (0, import_signal.getSigMeta)(ref);
|
|
1170
235
|
if (!sigMeta.returns)
|
|
1171
236
|
return false;
|
|
1172
237
|
const modelRef = sigMeta.returns();
|
|
1173
|
-
const classMeta = getClassMeta(modelRef);
|
|
238
|
+
const classMeta = (0, import_constant.getClassMeta)(modelRef);
|
|
1174
239
|
return classMeta.type === "full";
|
|
1175
240
|
}).map((sigRef) => {
|
|
1176
|
-
const sigMeta = getSigMeta(sigRef);
|
|
1177
|
-
const modelName = lowerlize(sigMeta.refName);
|
|
241
|
+
const sigMeta = (0, import_signal.getSigMeta)(sigRef);
|
|
242
|
+
const modelName = (0, import_common.lowerlize)(sigMeta.refName);
|
|
1178
243
|
return { modelName, sigRef };
|
|
1179
244
|
});
|
|
1180
245
|
const scalarModelSignalRefEntries = signalRefs.filter((ref) => {
|
|
1181
|
-
const sigMeta = getSigMeta(ref);
|
|
246
|
+
const sigMeta = (0, import_signal.getSigMeta)(ref);
|
|
1182
247
|
if (!sigMeta.returns)
|
|
1183
248
|
return false;
|
|
1184
249
|
const modelRef = sigMeta.returns();
|
|
1185
|
-
const classMeta = getClassMeta(modelRef);
|
|
250
|
+
const classMeta = (0, import_constant.getClassMeta)(modelRef);
|
|
1186
251
|
return classMeta.type === "scalar";
|
|
1187
252
|
}).map((sigRef) => {
|
|
1188
|
-
const sigMeta = getSigMeta(sigRef);
|
|
1189
|
-
const modelName = lowerlize(sigMeta.refName);
|
|
253
|
+
const sigMeta = (0, import_signal.getSigMeta)(sigRef);
|
|
254
|
+
const modelName = (0, import_common.lowerlize)(sigMeta.refName);
|
|
1190
255
|
return { modelName, sigRef };
|
|
1191
256
|
});
|
|
1192
|
-
const pureSignalRefEntries = signalRefs.filter((ref) => !getSigMeta(ref).returns).map((sigRef) => {
|
|
1193
|
-
const sigMeta = getSigMeta(sigRef);
|
|
1194
|
-
const modelName = lowerlize(sigMeta.refName);
|
|
257
|
+
const pureSignalRefEntries = signalRefs.filter((ref) => !(0, import_signal.getSigMeta)(ref).returns).map((sigRef) => {
|
|
258
|
+
const sigMeta = (0, import_signal.getSigMeta)(sigRef);
|
|
259
|
+
const modelName = (0, import_common.lowerlize)(sigMeta.refName);
|
|
1195
260
|
return { modelName, sigRef };
|
|
1196
261
|
});
|
|
1197
262
|
const modelDictExamMap = /* @__PURE__ */ new Map();
|
|
@@ -1304,4 +369,3 @@ var makeTrans = (locale) => {
|
|
|
1304
369
|
msg
|
|
1305
370
|
};
|
|
1306
371
|
};
|
|
1307
|
-
//! Nextjs는 환경변수를 build time에 그냥 하드코딩으로 값을 넣어버림. operationMode같은것들 잘 동작안할 수 있음. 추후 수정 필요.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/dictionary",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.46",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,13 +14,5 @@
|
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=22"
|
|
16
16
|
},
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@urql/core": "^5.1.0",
|
|
19
|
-
"dayjs": "^1.11.13",
|
|
20
|
-
"immer": "^10.1.1",
|
|
21
|
-
"next": "^15.3.2",
|
|
22
|
-
"pluralize": "^8.0.0",
|
|
23
|
-
"reflect-metadata": "^0.2.2",
|
|
24
|
-
"socket.io-client": "^4.8.1"
|
|
25
|
-
}
|
|
17
|
+
"dependencies": {}
|
|
26
18
|
}
|