@nx-ddd/any-func 19.0.0-preview-remove-post-build-scripts.2 → 19.0.0-preview-test-remove-tsconfig-lib-prod.1
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/adapters/local-storage/index.d.ts +5 -0
- package/adapters/local-storage-browser/index.d.ts +8 -0
- package/adapters/local-storage-node/index.d.ts +5 -0
- package/adapters/validator/index.d.ts +10 -0
- package/adapters/validator-commonjs/index.d.ts +13 -0
- package/adapters/validator-esmodule/index.d.ts +15 -0
- package/browser/index.d.ts +6 -0
- package/fesm2022/nx-ddd-any-func-adapters-local-storage-browser.mjs +12 -0
- package/fesm2022/nx-ddd-any-func-adapters-local-storage-browser.mjs.map +1 -0
- package/fesm2022/nx-ddd-any-func-adapters-local-storage-node.mjs +16 -0
- package/fesm2022/nx-ddd-any-func-adapters-local-storage-node.mjs.map +1 -0
- package/fesm2022/nx-ddd-any-func-adapters-local-storage.mjs +10 -0
- package/fesm2022/nx-ddd-any-func-adapters-local-storage.mjs.map +1 -0
- package/fesm2022/nx-ddd-any-func-adapters-validator-commonjs.mjs +33 -0
- package/fesm2022/nx-ddd-any-func-adapters-validator-commonjs.mjs.map +1 -0
- package/fesm2022/nx-ddd-any-func-adapters-validator-esmodule.mjs +28 -0
- package/fesm2022/nx-ddd-any-func-adapters-validator-esmodule.mjs.map +1 -0
- package/fesm2022/nx-ddd-any-func-adapters-validator.mjs +17 -0
- package/fesm2022/nx-ddd-any-func-adapters-validator.mjs.map +1 -0
- package/fesm2022/nx-ddd-any-func-browser.mjs +19 -0
- package/fesm2022/nx-ddd-any-func-browser.mjs.map +1 -0
- package/fesm2022/nx-ddd-any-func-server.mjs +19 -0
- package/fesm2022/nx-ddd-any-func-server.mjs.map +1 -0
- package/fesm2022/nx-ddd-any-func.mjs +432 -0
- package/fesm2022/nx-ddd-any-func.mjs.map +1 -0
- package/index.d.ts +151 -1
- package/package.json +50 -38
- package/server/index.d.ts +6 -0
- package/README.md +0 -7
- package/index.js +0 -2
- package/index.js.map +0 -1
- package/lib/agent/agent.d.ts +0 -53
- package/lib/agent/agent.js +0 -91
- package/lib/agent/agent.js.map +0 -1
- package/lib/agent/index.d.ts +0 -1
- package/lib/agent/index.js +0 -2
- package/lib/agent/index.js.map +0 -1
- package/lib/any-func/any-func.service.d.ts +0 -4
- package/lib/any-func/any-func.service.impl.d.ts +0 -67
- package/lib/any-func/any-func.service.impl.js +0 -257
- package/lib/any-func/any-func.service.impl.js.map +0 -1
- package/lib/any-func/any-func.service.js +0 -7
- package/lib/any-func/any-func.service.js.map +0 -1
- package/lib/any-func/index.d.ts +0 -1
- package/lib/any-func/index.js +0 -2
- package/lib/any-func/index.js.map +0 -1
- package/lib/browser.d.ts +0 -3
- package/lib/browser.js +0 -12
- package/lib/browser.js.map +0 -1
- package/lib/impl/adapters/cache/cache.adapter.d.ts +0 -9
- package/lib/impl/adapters/cache/cache.adapter.js +0 -47
- package/lib/impl/adapters/cache/cache.adapter.js.map +0 -1
- package/lib/impl/adapters/cache/index.d.ts +0 -1
- package/lib/impl/adapters/cache/index.js +0 -2
- package/lib/impl/adapters/cache/index.js.map +0 -1
- package/lib/impl/adapters/local-storage/browser.d.ts +0 -4
- package/lib/impl/adapters/local-storage/browser.js +0 -5
- package/lib/impl/adapters/local-storage/browser.js.map +0 -1
- package/lib/impl/adapters/local-storage/index.d.ts +0 -1
- package/lib/impl/adapters/local-storage/index.js +0 -2
- package/lib/impl/adapters/local-storage/index.js.map +0 -1
- package/lib/impl/adapters/local-storage/node.d.ts +0 -2
- package/lib/impl/adapters/local-storage/node.js +0 -9
- package/lib/impl/adapters/local-storage/node.js.map +0 -1
- package/lib/impl/adapters/local-storage/token.d.ts +0 -1
- package/lib/impl/adapters/local-storage/token.js +0 -3
- package/lib/impl/adapters/local-storage/token.js.map +0 -1
- package/lib/impl/adapters/validator/commonjs.d.ts +0 -7
- package/lib/impl/adapters/validator/commonjs.js +0 -29
- package/lib/impl/adapters/validator/commonjs.js.map +0 -1
- package/lib/impl/adapters/validator/esmodule.d.ts +0 -9
- package/lib/impl/adapters/validator/esmodule.js +0 -21
- package/lib/impl/adapters/validator/esmodule.js.map +0 -1
- package/lib/impl/adapters/validator/validator.adapter.d.ts +0 -4
- package/lib/impl/adapters/validator/validator.adapter.js +0 -9
- package/lib/impl/adapters/validator/validator.adapter.js.map +0 -1
- package/lib/impl/index.d.ts +0 -2
- package/lib/impl/index.js +0 -3
- package/lib/impl/index.js.map +0 -1
- package/lib/impl/json-schema/default-metadata-storage.d.ts +0 -2
- package/lib/impl/json-schema/default-metadata-storage.js +0 -15
- package/lib/impl/json-schema/default-metadata-storage.js.map +0 -1
- package/lib/impl/json-schema/index.d.ts +0 -1
- package/lib/impl/json-schema/index.js +0 -2
- package/lib/impl/json-schema/index.js.map +0 -1
- package/lib/impl/json-schema/json-schema.d.ts +0 -3
- package/lib/impl/json-schema/json-schema.js +0 -46
- package/lib/impl/json-schema/json-schema.js.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -4
- package/lib/index.js.map +0 -1
- package/lib/server.d.ts +0 -3
- package/lib/server.js +0 -12
- package/lib/server.js.map +0 -1
- package/lib/utils/debug-price.d.ts +0 -1
- package/lib/utils/debug-price.js +0 -39
- package/lib/utils/debug-price.js.map +0 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -2
- package/lib/utils/index.js.map +0 -1
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { inject, Injectable, InjectionToken } from '@angular/core';
|
|
3
|
-
import { injectOpenAiService } from '@nx-ddd/common/infrastructure/externals/openai';
|
|
4
|
-
import { provideOpenaiService } from '@nx-ddd/common/infrastructure/externals/openai/impl';
|
|
5
|
-
import { catchError, lastValueFrom, map, of, retry, switchMap, tap } from 'rxjs';
|
|
6
|
-
import pLimit from 'p-limit';
|
|
7
|
-
import { ZodSchema } from 'zod';
|
|
8
|
-
import zodToJsonSchema from 'zod-to-json-schema';
|
|
9
|
-
import { buildFunctionTool } from '../agent';
|
|
10
|
-
import { targetConstructorToSchema } from '../impl/json-schema';
|
|
11
|
-
import { ANY_FUNC_SERVICE } from './any-func.service';
|
|
12
|
-
import { CacheAdapter } from '../impl/adapters/cache';
|
|
13
|
-
import { ValidatorAdapter } from '../impl/adapters/validator/validator.adapter';
|
|
14
|
-
function isBrowserFile(obj) {
|
|
15
|
-
return typeof File !== 'undefined' && obj instanceof File;
|
|
16
|
-
}
|
|
17
|
-
const ANY_FUNC_CONFIG = new InjectionToken('[@nx-ddd/any-func] AnyFuncConfig');
|
|
18
|
-
export function provideAnyFunc(useFactory) {
|
|
19
|
-
const config = useFactory();
|
|
20
|
-
return [
|
|
21
|
-
{ provide: ANY_FUNC_SERVICE, useClass: AnyFuncService },
|
|
22
|
-
{ provide: ANY_FUNC_CONFIG, useFactory },
|
|
23
|
-
provideOpenaiService(() => ({ apiKey: config.openaiApiKey, dangerouslyAllowBrowser: config.dangerouslyAllowBrowser })),
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
class OpenAiMessageHelper {
|
|
27
|
-
static imageToBase64(imageFile) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
return new Promise((resolve, reject) => {
|
|
30
|
-
const reader = new FileReader();
|
|
31
|
-
reader.onload = () => {
|
|
32
|
-
const base64String = reader.result;
|
|
33
|
-
resolve(base64String.split(',')[1]);
|
|
34
|
-
};
|
|
35
|
-
reader.onerror = reject;
|
|
36
|
-
reader.readAsDataURL(imageFile);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
static buildFilesMessage(files) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
return yield Promise.all(files.map((file) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
return ({
|
|
44
|
-
type: 'image_url',
|
|
45
|
-
image_url: { url: `data:image/jpeg;base64,${yield this.imageToBase64(file)}` },
|
|
46
|
-
});
|
|
47
|
-
})));
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
let AnyFuncService = class AnyFuncService {
|
|
52
|
-
constructor() {
|
|
53
|
-
var _a;
|
|
54
|
-
this.openai = injectOpenAiService();
|
|
55
|
-
this.config = (_a = inject(ANY_FUNC_CONFIG, { optional: true })) !== null && _a !== void 0 ? _a : { debug: false };
|
|
56
|
-
this.cache = inject(CacheAdapter);
|
|
57
|
-
this.validator = inject(ValidatorAdapter);
|
|
58
|
-
}
|
|
59
|
-
/** @deprecated use callByJsonSchema instead */
|
|
60
|
-
jsonSchema(_input_1, jsonSchema_1) {
|
|
61
|
-
return __awaiter(this, arguments, void 0, function* (_input, jsonSchema, options = {}) {
|
|
62
|
-
return this.callByJsonSchema(_input, jsonSchema, options);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
callByJsonSchema(_input_1, jsonSchema_1) {
|
|
66
|
-
return __awaiter(this, arguments, void 0, function* (_input, jsonSchema, { instructions = '', model = 'gpt-4o', specs = [], embeddings = false, sample = 3, temperature = 0, maxRetry = 3, validator = (data) => this.validator.validate(jsonSchema, data), } = {}) {
|
|
67
|
-
for (const spec of specs) {
|
|
68
|
-
const errors = yield validator(spec.output);
|
|
69
|
-
if (errors.length > 0) {
|
|
70
|
-
throw new Error(JSON.stringify(errors, null, 2));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
const content = yield this.parseInput(_input);
|
|
74
|
-
const sortedSpecs = embeddings ? yield this.sort(specs, embeddings, _input) : specs;
|
|
75
|
-
const messages = [
|
|
76
|
-
{ role: 'system', content: instructions },
|
|
77
|
-
...(yield this.buildChatMessages(sortedSpecs.slice(0, sample).reverse())),
|
|
78
|
-
{ role: 'user', content },
|
|
79
|
-
];
|
|
80
|
-
return lastValueFrom(of(null).pipe(map(() => messages), switchMap(() => this.complete(_input, jsonSchema, messages, {
|
|
81
|
-
model,
|
|
82
|
-
sample,
|
|
83
|
-
temperature,
|
|
84
|
-
})), tap(message => messages.push(message)), switchMap((message) => __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
const toolCall = message.tool_calls[0];
|
|
86
|
-
if (toolCall.type !== 'function') {
|
|
87
|
-
throw new Error('Unexpected tool call type');
|
|
88
|
-
}
|
|
89
|
-
const output = JSON.parse(toolCall.function.arguments);
|
|
90
|
-
console.debug('[AnyFuncService#complete] output:', output);
|
|
91
|
-
const errors = yield validator(output);
|
|
92
|
-
console.debug('[AnyFuncService#complete] errors:', errors);
|
|
93
|
-
if (errors.length > 0) {
|
|
94
|
-
messages.push({
|
|
95
|
-
role: 'tool',
|
|
96
|
-
content: JSON.stringify(errors),
|
|
97
|
-
tool_call_id: message.tool_calls[0].id,
|
|
98
|
-
});
|
|
99
|
-
if (this.config.debug) {
|
|
100
|
-
console.debug('messages', JSON.stringify(messages, null, 2));
|
|
101
|
-
}
|
|
102
|
-
throw new Error(JSON.stringify(errors, null, 2));
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
messages.push({
|
|
106
|
-
role: 'tool',
|
|
107
|
-
content: JSON.stringify(output),
|
|
108
|
-
tool_call_id: message.tool_calls[0].id,
|
|
109
|
-
});
|
|
110
|
-
if (this.config.debug) {
|
|
111
|
-
console.debug('messages', JSON.stringify(messages, null, 2));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return output;
|
|
115
|
-
})), catchError((error) => {
|
|
116
|
-
console.error(error);
|
|
117
|
-
throw error;
|
|
118
|
-
}), retry(maxRetry)));
|
|
119
|
-
// debugPrice(model, res.usage);
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
callByZod(_input_1, zod_1) {
|
|
123
|
-
return __awaiter(this, arguments, void 0, function* (_input, zod, { instructions = '', model = 'gpt-4o', specs = [], embeddings = false, sample = 3, temperature = 0, maxRetry = 3, validator = (data) => this.validator.validate(zodToJsonSchema(zod, { $refStrategy: 'none' }), data), } = {}) {
|
|
124
|
-
return this.jsonSchema(_input, zodToJsonSchema(zod, { $refStrategy: 'none' }), {
|
|
125
|
-
instructions,
|
|
126
|
-
model,
|
|
127
|
-
specs,
|
|
128
|
-
embeddings,
|
|
129
|
-
sample,
|
|
130
|
-
temperature,
|
|
131
|
-
maxRetry,
|
|
132
|
-
validator,
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
callByClassValidator(_input_1, args_1) {
|
|
137
|
-
return __awaiter(this, arguments, void 0, function* (_input, args, { instructions = '', model = 'gpt-4o', specs = [], embeddings = false, sample = 3, temperature = 0, maxRetry = 3, validator = (data) => this.validator.validate(targetConstructorToSchema(args), data), } = {}) {
|
|
138
|
-
const parameters = targetConstructorToSchema(args);
|
|
139
|
-
console.debug('[AnyFuncService#call] parameters:', parameters);
|
|
140
|
-
return this.jsonSchema(_input, parameters, {
|
|
141
|
-
instructions,
|
|
142
|
-
model,
|
|
143
|
-
specs,
|
|
144
|
-
embeddings,
|
|
145
|
-
sample,
|
|
146
|
-
temperature,
|
|
147
|
-
maxRetry,
|
|
148
|
-
validator,
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
call(_input_1, args_1) {
|
|
153
|
-
return __awaiter(this, arguments, void 0, function* (_input, args, params = {}) {
|
|
154
|
-
if (args instanceof ZodSchema) {
|
|
155
|
-
return this.callByZod(_input, args, params);
|
|
156
|
-
}
|
|
157
|
-
// class validatorか判定
|
|
158
|
-
if (args instanceof Function) {
|
|
159
|
-
return this.callByClassValidator(_input, args, params);
|
|
160
|
-
}
|
|
161
|
-
if (typeof args === 'object' && args !== null && 'type' in args && args.type === 'object') {
|
|
162
|
-
return this.callByJsonSchema(_input, args, params);
|
|
163
|
-
}
|
|
164
|
-
throw new Error('Invalid args type');
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
complete(_input_1, jsonSchema_1, messages_1) {
|
|
168
|
-
return __awaiter(this, arguments, void 0, function* (_input, jsonSchema, messages, { model = 'gpt-4o', temperature = 0, } = {}) {
|
|
169
|
-
const tool = buildFunctionTool({ name: 'function', description: '', parameters: jsonSchema });
|
|
170
|
-
const props = {
|
|
171
|
-
model,
|
|
172
|
-
messages,
|
|
173
|
-
tools: [tool],
|
|
174
|
-
tool_choice: {
|
|
175
|
-
type: 'function',
|
|
176
|
-
function: { name: 'function' }
|
|
177
|
-
},
|
|
178
|
-
temperature,
|
|
179
|
-
};
|
|
180
|
-
const res = yield this.cache.call(props, props => this.openai.chat.completions.create(props));
|
|
181
|
-
return res.choices[0].message;
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
buildChatMessages(specs) {
|
|
185
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
-
const messages = yield Promise.all(specs.map((_a) => __awaiter(this, [_a], void 0, function* ({ input, output }) {
|
|
187
|
-
const parsedInput = yield this.parseInput(input);
|
|
188
|
-
return [
|
|
189
|
-
{ role: 'user', content: parsedInput },
|
|
190
|
-
{
|
|
191
|
-
role: 'assistant',
|
|
192
|
-
content: null,
|
|
193
|
-
tool_calls: [
|
|
194
|
-
{
|
|
195
|
-
id: 'call-example',
|
|
196
|
-
type: 'function',
|
|
197
|
-
function: {
|
|
198
|
-
name: 'function',
|
|
199
|
-
arguments: JSON.stringify(output),
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
],
|
|
203
|
-
},
|
|
204
|
-
{ role: 'tool', content: 'success', tool_call_id: 'call-example' },
|
|
205
|
-
];
|
|
206
|
-
})));
|
|
207
|
-
return messages.flat();
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
getEmbeddings(item, accessor) {
|
|
211
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
-
const props = { item, model: 'text-embedding-3-small' };
|
|
213
|
-
let embedding = yield this.cache.get(props);
|
|
214
|
-
if (embedding)
|
|
215
|
-
return embedding;
|
|
216
|
-
embedding = yield this.openai.embeddings.create({
|
|
217
|
-
model: props.model,
|
|
218
|
-
input: accessor(item),
|
|
219
|
-
}).then(res => res.data[0].embedding);
|
|
220
|
-
yield this.cache.set(props, embedding);
|
|
221
|
-
return embedding;
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
sort(items, accessor, target) {
|
|
225
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
-
const dist = (a, b) => Math.sqrt(a.reduce((acc, v, i) => acc + Math.pow((v - b[i]), 2), 0));
|
|
227
|
-
const targetEmbeddings = yield this.getEmbeddings(target, s => s);
|
|
228
|
-
const limit = pLimit(10);
|
|
229
|
-
const embeddings = yield Promise.all(items.map(item => limit(() => this.getEmbeddings(item, accessor))));
|
|
230
|
-
const items_ = items.map((item, i) => ({
|
|
231
|
-
item,
|
|
232
|
-
embedding: embeddings[i],
|
|
233
|
-
distance: dist(embeddings[i], targetEmbeddings),
|
|
234
|
-
}));
|
|
235
|
-
const sorted = items_.sort((a, b) => a.distance - b.distance);
|
|
236
|
-
return sorted.map(({ item }) => item);
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
parseInput(input) {
|
|
240
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
241
|
-
if (isBrowserFile(input)) {
|
|
242
|
-
return yield OpenAiMessageHelper.buildFilesMessage([input]);
|
|
243
|
-
}
|
|
244
|
-
else if (input === 'string') {
|
|
245
|
-
return input;
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
return JSON.stringify(input);
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
AnyFuncService = __decorate([
|
|
254
|
-
Injectable({ providedIn: 'root' })
|
|
255
|
-
], AnyFuncService);
|
|
256
|
-
export { AnyFuncService };
|
|
257
|
-
//# sourceMappingURL=any-func.service.impl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"any-func.service.impl.js","sourceRoot":"","sources":["../../../../../../packages/@nx-ddd/any-func/src/lib/any-func/any-func.service.impl.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AI,CAAC,CAAC;QACtC,CAAC;KAAA;IAEa,UAAU,CAAC,KAAU;;YACjC,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,MAAM,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YAC9D,CAAC;iBAAM,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,OAAO,KAAK,CAAC;YACf,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AAvOY,cAAc;IAD1B,UAAU,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;GACpB,cAAc,CAuO1B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { inject, InjectionToken } from '@angular/core';
|
|
2
|
-
export const ANY_FUNC_SERVICE = new InjectionToken('[@nx-ddd/any-func] AnyFuncService');
|
|
3
|
-
export function injectAnyFunc() {
|
|
4
|
-
var _a;
|
|
5
|
-
return (_a = inject(ANY_FUNC_SERVICE, { optional: true })) !== null && _a !== void 0 ? _a : {};
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=any-func.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"any-func.service.js","sourceRoot":"","sources":["../../../../../../packages/@nx-ddd/any-func/src/lib/any-func/any-func.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAiB,mCAAmC,CAAC,CAAC;AAExG,MAAM,UAAU,aAAa;;IAC3B,OAAO,MAAA,MAAM,CAAC,gBAAgB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,mCAAI,EAAoB,CAAC;AAC5E,CAAC"}
|
package/lib/any-func/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './any-func.service';
|
package/lib/any-func/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/@nx-ddd/any-func/src/lib/any-func/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
package/lib/browser.d.ts
DELETED
package/lib/browser.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { makeEnvironmentProviders } from "@angular/core";
|
|
2
|
-
import { provideLocalStorage } from "./impl/adapters/local-storage/browser";
|
|
3
|
-
import { provideValidatorAdapter } from "./impl/adapters/validator/esmodule";
|
|
4
|
-
import { provideAnyFunc } from "./any-func/any-func.service.impl";
|
|
5
|
-
export function provideAnyFuncForBrowser(configFactory) {
|
|
6
|
-
return makeEnvironmentProviders([
|
|
7
|
-
provideAnyFunc(configFactory),
|
|
8
|
-
provideValidatorAdapter(),
|
|
9
|
-
provideLocalStorage(),
|
|
10
|
-
]);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=browser.js.map
|
package/lib/browser.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/any-func/src/lib/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAiB,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEjF,MAAM,UAAU,wBAAwB,CAAC,aAAmC;IAC1E,OAAO,wBAAwB,CAAC;QAC9B,cAAc,CAAC,aAAa,CAAC;QAC7B,uBAAuB,EAAE;QACzB,mBAAmB,EAAE;KACtB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare class CacheAdapter {
|
|
2
|
-
protected localStorage: LocalStorage;
|
|
3
|
-
get<T>(keyOrObj: string | object): Promise<T | null>;
|
|
4
|
-
set(keyOrObj: string | object, value: any): Promise<void>;
|
|
5
|
-
call<P extends (string | object), T>(props: P, callback: (props: P) => Promise<T>): Promise<T>;
|
|
6
|
-
protected makeKey(keyOrObj: string | object): string;
|
|
7
|
-
protected makeJson(valueOrObj: any): string;
|
|
8
|
-
protected parseJson(value: string): any;
|
|
9
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { Injectable } from "@angular/core";
|
|
3
|
-
import { LOCAL_STORAGE } from '../local-storage';
|
|
4
|
-
import CryptoJS from 'crypto-js';
|
|
5
|
-
let CacheAdapter = class CacheAdapter {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.localStorage = LOCAL_STORAGE.inject();
|
|
8
|
-
}
|
|
9
|
-
get(keyOrObj) {
|
|
10
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
11
|
-
const key = this.makeKey(keyOrObj);
|
|
12
|
-
return this.parseJson(this.localStorage.getItem(key));
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
set(keyOrObj, value) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const key = this.makeKey(keyOrObj);
|
|
18
|
-
this.localStorage.setItem(key, this.makeJson(value));
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
call(props, callback) {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const key = this.makeKey(props);
|
|
24
|
-
let value = yield this.get(key);
|
|
25
|
-
if (value)
|
|
26
|
-
return value;
|
|
27
|
-
value = yield callback(props);
|
|
28
|
-
yield this.set(key, value);
|
|
29
|
-
return value;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
makeKey(keyOrObj) {
|
|
33
|
-
const value = typeof keyOrObj === 'string' ? keyOrObj : JSON.stringify(keyOrObj);
|
|
34
|
-
return CryptoJS.SHA256(value).toString();
|
|
35
|
-
}
|
|
36
|
-
makeJson(valueOrObj) {
|
|
37
|
-
return JSON.stringify(valueOrObj);
|
|
38
|
-
}
|
|
39
|
-
parseJson(value) {
|
|
40
|
-
return JSON.parse(value);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
CacheAdapter = __decorate([
|
|
44
|
-
Injectable({ providedIn: 'root' })
|
|
45
|
-
], CacheAdapter);
|
|
46
|
-
export { CacheAdapter };
|
|
47
|
-
//# sourceMappingURL=cache.adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.adapter.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/cache/cache.adapter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,QAAQ,MAAM,WAAW,CAAC;AAG1B,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QACK,iBAAY,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC;IAiClD,CAAC;IA/BO,GAAG,CAAI,QAAyB;;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAa,CAAC;QACpE,CAAC;KAAA;IAEK,GAAG,CAAC,QAAyB,EAAE,KAAU;;YAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACnC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC;KAAA;IAEK,IAAI,CAAiC,KAAQ,EAAE,QAAkC;;YACrF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAChC,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAAI,GAAG,CAAC,CAAC;YACnC,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;YACxB,KAAK,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC9B,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;IAES,OAAO,CAAC,QAAyB;QACzC,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACjF,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC3C,CAAC;IAES,QAAQ,CAAC,UAAe;QAChC,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAES,SAAS,CAAC,KAAa;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;CACF,CAAA;AAlCY,YAAY;IADxB,UAAU,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;GACpB,YAAY,CAkCxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './cache.adapter';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/cache/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/local-storage/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,UAAU,mBAAmB;IACjC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './token';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/local-storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LocalStorage } from "node-localstorage";
|
|
2
|
-
import { LOCAL_STORAGE } from "./token";
|
|
3
|
-
import { makeEnvironmentProviders } from "@angular/core";
|
|
4
|
-
export function provideLocalStorage() {
|
|
5
|
-
return makeEnvironmentProviders([
|
|
6
|
-
LOCAL_STORAGE.provide(() => new LocalStorage('node_modules/.cache/any-func', 5 * 1024 * 1024 * 1024))
|
|
7
|
-
]);
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/local-storage/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAwB,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE/E,MAAM,UAAU,mBAAmB;IACjC,OAAO,wBAAwB,CAAC;QAC9B,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,8BAA8B,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;KACtG,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LOCAL_STORAGE: import("@nx-ddd/core").DiToken<LocalStorage>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/local-storage/token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAe,eAAe,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { JsonError, JsonSchema } from "json-schema-library";
|
|
2
|
-
import { ValidatorAdapter } from "./validator.adapter";
|
|
3
|
-
import { EnvironmentProviders } from "@angular/core";
|
|
4
|
-
export declare class ValidatorAdapterCommonjs extends ValidatorAdapter {
|
|
5
|
-
validate(schema: JsonSchema, data: any): Promise<JsonError[]>;
|
|
6
|
-
}
|
|
7
|
-
export declare function provideValidatorAdapter(): EnvironmentProviders;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { compileSchema, draft07 } from "json-schema-library";
|
|
3
|
-
import { ValidatorAdapter } from "./validator.adapter";
|
|
4
|
-
import { Injectable } from "@angular/core";
|
|
5
|
-
import { makeEnvironmentProviders } from "@angular/core";
|
|
6
|
-
let ValidatorAdapterCommonjs = class ValidatorAdapterCommonjs extends ValidatorAdapter {
|
|
7
|
-
validate(schema, data) {
|
|
8
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
9
|
-
// console.debug('[ValidatorAdapterCommonjs#validate] validate', schema, data);
|
|
10
|
-
const compiledSchema = compileSchema(schema, { drafts: [draft07] });
|
|
11
|
-
const result = compiledSchema.validate(data);
|
|
12
|
-
// Convert ValidateReturnType to JsonError[]
|
|
13
|
-
if (Array.isArray(result)) {
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
return result.errors || [];
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
ValidatorAdapterCommonjs = __decorate([
|
|
21
|
-
Injectable({ providedIn: 'root' })
|
|
22
|
-
], ValidatorAdapterCommonjs);
|
|
23
|
-
export { ValidatorAdapterCommonjs };
|
|
24
|
-
export function provideValidatorAdapter() {
|
|
25
|
-
return makeEnvironmentProviders([
|
|
26
|
-
{ provide: ValidatorAdapter, useClass: ValidatorAdapterCommonjs },
|
|
27
|
-
]);
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=commonjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commonjs.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/validator/commonjs.ts"],"names":[],"mappings":";AAAA,OAAO,EAAyB,aAAa,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAwB,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAIxE,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,gBAAgB;IACtD,QAAQ,CAAC,MAAkB,EAAE,IAAS;;YAC1C,+EAA+E;YAC/E,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACpE,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAE7C,4CAA4C;YAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1B,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,OAAO,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;QAC7B,CAAC;KAAA;CACF,CAAA;AAZY,wBAAwB;IADpC,UAAU,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;GACpB,wBAAwB,CAYpC;;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,wBAAwB,CAAC;QAC9B,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,wBAAwB,EAAE;KAClE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { JsonError, JsonSchema } from "json-schema-library";
|
|
2
|
-
import { ValidatorAdapter } from "./validator.adapter";
|
|
3
|
-
export declare class ValidatorAdapterCommonjs extends ValidatorAdapter {
|
|
4
|
-
validate(schema: JsonSchema, data: any): Promise<JsonError[]>;
|
|
5
|
-
}
|
|
6
|
-
export declare function provideValidatorAdapter(): {
|
|
7
|
-
provide: typeof ValidatorAdapter;
|
|
8
|
-
useClass: typeof ValidatorAdapterCommonjs;
|
|
9
|
-
}[];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { ValidatorAdapter } from "./validator.adapter";
|
|
3
|
-
import { Injectable } from "@angular/core";
|
|
4
|
-
import { compileSchema } from 'json-schema-library';
|
|
5
|
-
let ValidatorAdapterCommonjs = class ValidatorAdapterCommonjs extends ValidatorAdapter {
|
|
6
|
-
validate(schema, data) {
|
|
7
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
8
|
-
return compileSchema(schema).validate(data).errors;
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
ValidatorAdapterCommonjs = __decorate([
|
|
13
|
-
Injectable({ providedIn: 'root' })
|
|
14
|
-
], ValidatorAdapterCommonjs);
|
|
15
|
-
export { ValidatorAdapterCommonjs };
|
|
16
|
-
export function provideValidatorAdapter() {
|
|
17
|
-
return [
|
|
18
|
-
{ provide: ValidatorAdapter, useClass: ValidatorAdapterCommonjs },
|
|
19
|
-
];
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=esmodule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"esmodule.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/validator/esmodule.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI7C,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,gBAAgB;IACtD,QAAQ,CAAC,MAAkB,EAAE,IAAS;;YAC1C,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QACrD,CAAC;KAAA;CACF,CAAA;AAJY,wBAAwB;IADpC,UAAU,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;GACpB,wBAAwB,CAIpC;;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,wBAAwB,EAAE;KAClE,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { Injectable } from "@angular/core";
|
|
3
|
-
let ValidatorAdapter = class ValidatorAdapter {
|
|
4
|
-
};
|
|
5
|
-
ValidatorAdapter = __decorate([
|
|
6
|
-
Injectable()
|
|
7
|
-
], ValidatorAdapter);
|
|
8
|
-
export { ValidatorAdapter };
|
|
9
|
-
//# sourceMappingURL=validator.adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.adapter.js","sourceRoot":"","sources":["../../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/adapters/validator/validator.adapter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIpC,IAAe,gBAAgB,GAA/B,MAAe,gBAAgB;CAErC,CAAA;AAFqB,gBAAgB;IADrC,UAAU,EAAE;GACS,gBAAgB,CAErC"}
|
package/lib/impl/index.d.ts
DELETED
package/lib/impl/index.js
DELETED
package/lib/impl/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/@nx-ddd/any-func/src/lib/impl/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,eAAe,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// 環境差異を吸収するため、try-catchでdynamic importしてdefaultMetadataStorageを取得します。
|
|
2
|
-
let defaultMetadataStorage;
|
|
3
|
-
try {
|
|
4
|
-
({ defaultMetadataStorage } = require('class-transformer/cjs/storage'));
|
|
5
|
-
}
|
|
6
|
-
catch (_a) {
|
|
7
|
-
// Ignore error if class-transformer is not available
|
|
8
|
-
}
|
|
9
|
-
export function getMetadataStorage() {
|
|
10
|
-
return defaultMetadataStorage;
|
|
11
|
-
}
|
|
12
|
-
export function setMetadataStorage(metadataStorage) {
|
|
13
|
-
defaultMetadataStorage = metadataStorage;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=default-metadata-storage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-metadata-storage.js","sourceRoot":"","sources":["../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/json-schema/default-metadata-storage.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,IAAI,sBAAgF,CAAC;AAErF,IAAI,CAAC;IACH,CAAC,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC;AAC1E,CAAC;AAAC,WAAM,CAAC;IACP,qDAAqD;AACvD,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,eAAyE;IAC1G,sBAAsB,GAAG,eAAe,CAAC;AAC3C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './json-schema';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/@nx-ddd/any-func/src/lib/impl/json-schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|