@nx-ddd/any-func 19.2.0 → 19.3.0
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 -13
- package/server/index.d.ts +6 -0
- package/README.md +0 -7
- package/index.js +0 -5
- package/index.js.map +0 -1
- package/lib/agent/agent.d.ts +0 -53
- package/lib/agent/agent.js +0 -103
- package/lib/agent/agent.js.map +0 -1
- package/lib/agent/index.d.ts +0 -1
- package/lib/agent/index.js +0 -5
- 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 -261
- package/lib/any-func/any-func.service.impl.js.map +0 -1
- package/lib/any-func/any-func.service.js +0 -11
- 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 -5
- package/lib/any-func/index.js.map +0 -1
- package/lib/browser.d.ts +0 -3
- package/lib/browser.js +0 -15
- 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 -50
- 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 -5
- 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 -8
- 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 -5
- 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 -12
- 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 -6
- 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 -33
- 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 -25
- 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 -12
- 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 -6
- 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 -19
- 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 -5
- 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 -49
- package/lib/impl/json-schema/json-schema.js.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -7
- package/lib/index.js.map +0 -1
- package/lib/server.d.ts +0 -3
- package/lib/server.js +0 -15
- package/lib/server.js.map +0 -1
- package/lib/utils/debug-price.d.ts +0 -1
- package/lib/utils/debug-price.js +0 -42
- package/lib/utils/debug-price.js.map +0 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -5
- package/lib/utils/index.js.map +0 -1
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AnyFuncService = void 0;
|
|
4
|
-
exports.provideAnyFunc = provideAnyFunc;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const core_1 = require("@angular/core");
|
|
7
|
-
const openai_1 = require("@nx-ddd/common/infrastructure/externals/openai");
|
|
8
|
-
const impl_1 = require("@nx-ddd/common/infrastructure/externals/openai/impl");
|
|
9
|
-
const rxjs_1 = require("rxjs");
|
|
10
|
-
const p_limit_1 = tslib_1.__importDefault(require("p-limit"));
|
|
11
|
-
const zod_1 = require("zod");
|
|
12
|
-
const zod_to_json_schema_1 = tslib_1.__importDefault(require("zod-to-json-schema"));
|
|
13
|
-
const agent_1 = require("../agent");
|
|
14
|
-
const json_schema_1 = require("../impl/json-schema");
|
|
15
|
-
const any_func_service_1 = require("./any-func.service");
|
|
16
|
-
const cache_1 = require("../impl/adapters/cache");
|
|
17
|
-
const validator_adapter_1 = require("../impl/adapters/validator/validator.adapter");
|
|
18
|
-
function isBrowserFile(obj) {
|
|
19
|
-
return typeof File !== 'undefined' && obj instanceof File;
|
|
20
|
-
}
|
|
21
|
-
const ANY_FUNC_CONFIG = new core_1.InjectionToken('[@nx-ddd/any-func] AnyFuncConfig');
|
|
22
|
-
function provideAnyFunc(useFactory) {
|
|
23
|
-
const config = useFactory();
|
|
24
|
-
return [
|
|
25
|
-
{ provide: any_func_service_1.ANY_FUNC_SERVICE, useClass: AnyFuncService },
|
|
26
|
-
{ provide: ANY_FUNC_CONFIG, useFactory },
|
|
27
|
-
(0, impl_1.provideOpenaiService)(() => ({ apiKey: config.openaiApiKey, dangerouslyAllowBrowser: config.dangerouslyAllowBrowser })),
|
|
28
|
-
];
|
|
29
|
-
}
|
|
30
|
-
class OpenAiMessageHelper {
|
|
31
|
-
static imageToBase64(imageFile) {
|
|
32
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
const reader = new FileReader();
|
|
35
|
-
reader.onload = () => {
|
|
36
|
-
const base64String = reader.result;
|
|
37
|
-
resolve(base64String.split(',')[1]);
|
|
38
|
-
};
|
|
39
|
-
reader.onerror = reject;
|
|
40
|
-
reader.readAsDataURL(imageFile);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
static buildFilesMessage(files) {
|
|
45
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
return yield Promise.all(files.map((file) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
return ({
|
|
48
|
-
type: 'image_url',
|
|
49
|
-
image_url: { url: `data:image/jpeg;base64,${yield this.imageToBase64(file)}` },
|
|
50
|
-
});
|
|
51
|
-
})));
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
let AnyFuncService = class AnyFuncService {
|
|
56
|
-
constructor() {
|
|
57
|
-
var _a;
|
|
58
|
-
this.openai = (0, openai_1.injectOpenAiService)();
|
|
59
|
-
this.config = (_a = (0, core_1.inject)(ANY_FUNC_CONFIG, { optional: true })) !== null && _a !== void 0 ? _a : { debug: false };
|
|
60
|
-
this.cache = (0, core_1.inject)(cache_1.CacheAdapter);
|
|
61
|
-
this.validator = (0, core_1.inject)(validator_adapter_1.ValidatorAdapter);
|
|
62
|
-
}
|
|
63
|
-
/** @deprecated use callByJsonSchema instead */
|
|
64
|
-
jsonSchema(_input_1, jsonSchema_1) {
|
|
65
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* (_input, jsonSchema, options = {}) {
|
|
66
|
-
return this.callByJsonSchema(_input, jsonSchema, options);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
callByJsonSchema(_input_1, jsonSchema_1) {
|
|
70
|
-
return tslib_1.__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), } = {}) {
|
|
71
|
-
for (const spec of specs) {
|
|
72
|
-
const errors = yield validator(spec.output);
|
|
73
|
-
if (errors.length > 0) {
|
|
74
|
-
throw new Error(JSON.stringify(errors, null, 2));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const content = yield this.parseInput(_input);
|
|
78
|
-
const sortedSpecs = embeddings ? yield this.sort(specs, embeddings, _input) : specs;
|
|
79
|
-
const messages = [
|
|
80
|
-
{ role: 'system', content: instructions },
|
|
81
|
-
...(yield this.buildChatMessages(sortedSpecs.slice(0, sample).reverse())),
|
|
82
|
-
{ role: 'user', content },
|
|
83
|
-
];
|
|
84
|
-
return (0, rxjs_1.lastValueFrom)((0, rxjs_1.of)(null).pipe((0, rxjs_1.map)(() => messages), (0, rxjs_1.switchMap)(() => this.complete(_input, jsonSchema, messages, {
|
|
85
|
-
model,
|
|
86
|
-
sample,
|
|
87
|
-
temperature,
|
|
88
|
-
})), (0, rxjs_1.tap)(message => messages.push(message)), (0, rxjs_1.switchMap)((message) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
const toolCall = message.tool_calls[0];
|
|
90
|
-
if (toolCall.type !== 'function') {
|
|
91
|
-
throw new Error('Unexpected tool call type');
|
|
92
|
-
}
|
|
93
|
-
const output = JSON.parse(toolCall.function.arguments);
|
|
94
|
-
console.debug('[AnyFuncService#complete] output:', output);
|
|
95
|
-
const errors = yield validator(output);
|
|
96
|
-
console.debug('[AnyFuncService#complete] errors:', errors);
|
|
97
|
-
if (errors.length > 0) {
|
|
98
|
-
messages.push({
|
|
99
|
-
role: 'tool',
|
|
100
|
-
content: JSON.stringify(errors),
|
|
101
|
-
tool_call_id: message.tool_calls[0].id,
|
|
102
|
-
});
|
|
103
|
-
if (this.config.debug) {
|
|
104
|
-
console.debug('messages', JSON.stringify(messages, null, 2));
|
|
105
|
-
}
|
|
106
|
-
throw new Error(JSON.stringify(errors, null, 2));
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
messages.push({
|
|
110
|
-
role: 'tool',
|
|
111
|
-
content: JSON.stringify(output),
|
|
112
|
-
tool_call_id: message.tool_calls[0].id,
|
|
113
|
-
});
|
|
114
|
-
if (this.config.debug) {
|
|
115
|
-
console.debug('messages', JSON.stringify(messages, null, 2));
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return output;
|
|
119
|
-
})), (0, rxjs_1.catchError)((error) => {
|
|
120
|
-
console.error(error);
|
|
121
|
-
throw error;
|
|
122
|
-
}), (0, rxjs_1.retry)(maxRetry)));
|
|
123
|
-
// debugPrice(model, res.usage);
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
callByZod(_input_1, zod_2) {
|
|
127
|
-
return tslib_1.__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((0, zod_to_json_schema_1.default)(zod, { $refStrategy: 'none' }), data), } = {}) {
|
|
128
|
-
return this.jsonSchema(_input, (0, zod_to_json_schema_1.default)(zod, { $refStrategy: 'none' }), {
|
|
129
|
-
instructions,
|
|
130
|
-
model,
|
|
131
|
-
specs,
|
|
132
|
-
embeddings,
|
|
133
|
-
sample,
|
|
134
|
-
temperature,
|
|
135
|
-
maxRetry,
|
|
136
|
-
validator,
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
callByClassValidator(_input_1, args_1) {
|
|
141
|
-
return tslib_1.__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((0, json_schema_1.targetConstructorToSchema)(args), data), } = {}) {
|
|
142
|
-
const parameters = (0, json_schema_1.targetConstructorToSchema)(args);
|
|
143
|
-
console.debug('[AnyFuncService#call] parameters:', parameters);
|
|
144
|
-
return this.jsonSchema(_input, parameters, {
|
|
145
|
-
instructions,
|
|
146
|
-
model,
|
|
147
|
-
specs,
|
|
148
|
-
embeddings,
|
|
149
|
-
sample,
|
|
150
|
-
temperature,
|
|
151
|
-
maxRetry,
|
|
152
|
-
validator,
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
call(_input_1, args_1) {
|
|
157
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* (_input, args, params = {}) {
|
|
158
|
-
if (args instanceof zod_1.ZodSchema) {
|
|
159
|
-
return this.callByZod(_input, args, params);
|
|
160
|
-
}
|
|
161
|
-
// class validatorか判定
|
|
162
|
-
if (args instanceof Function) {
|
|
163
|
-
return this.callByClassValidator(_input, args, params);
|
|
164
|
-
}
|
|
165
|
-
if (typeof args === 'object' && args !== null && 'type' in args && args.type === 'object') {
|
|
166
|
-
return this.callByJsonSchema(_input, args, params);
|
|
167
|
-
}
|
|
168
|
-
throw new Error('Invalid args type');
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
complete(_input_1, jsonSchema_1, messages_1) {
|
|
172
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* (_input, jsonSchema, messages, { model = 'gpt-4o', temperature = 0, } = {}) {
|
|
173
|
-
const tool = (0, agent_1.buildFunctionTool)({ name: 'function', description: '', parameters: jsonSchema });
|
|
174
|
-
const props = {
|
|
175
|
-
model,
|
|
176
|
-
messages,
|
|
177
|
-
tools: [tool],
|
|
178
|
-
tool_choice: {
|
|
179
|
-
type: 'function',
|
|
180
|
-
function: { name: 'function' }
|
|
181
|
-
},
|
|
182
|
-
temperature,
|
|
183
|
-
};
|
|
184
|
-
const res = yield this.cache.call(props, props => this.openai.chat.completions.create(props));
|
|
185
|
-
return res.choices[0].message;
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
buildChatMessages(specs) {
|
|
189
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
190
|
-
const messages = yield Promise.all(specs.map((_a) => tslib_1.__awaiter(this, [_a], void 0, function* ({ input, output }) {
|
|
191
|
-
const parsedInput = yield this.parseInput(input);
|
|
192
|
-
return [
|
|
193
|
-
{ role: 'user', content: parsedInput },
|
|
194
|
-
{
|
|
195
|
-
role: 'assistant',
|
|
196
|
-
content: null,
|
|
197
|
-
tool_calls: [
|
|
198
|
-
{
|
|
199
|
-
id: 'call-example',
|
|
200
|
-
type: 'function',
|
|
201
|
-
function: {
|
|
202
|
-
name: 'function',
|
|
203
|
-
arguments: JSON.stringify(output),
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
],
|
|
207
|
-
},
|
|
208
|
-
{ role: 'tool', content: 'success', tool_call_id: 'call-example' },
|
|
209
|
-
];
|
|
210
|
-
})));
|
|
211
|
-
return messages.flat();
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
getEmbeddings(item, accessor) {
|
|
215
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
216
|
-
const props = { item, model: 'text-embedding-3-small' };
|
|
217
|
-
let embedding = yield this.cache.get(props);
|
|
218
|
-
if (embedding)
|
|
219
|
-
return embedding;
|
|
220
|
-
embedding = yield this.openai.embeddings.create({
|
|
221
|
-
model: props.model,
|
|
222
|
-
input: accessor(item),
|
|
223
|
-
}).then(res => res.data[0].embedding);
|
|
224
|
-
yield this.cache.set(props, embedding);
|
|
225
|
-
return embedding;
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
sort(items, accessor, target) {
|
|
229
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
230
|
-
const dist = (a, b) => Math.sqrt(a.reduce((acc, v, i) => acc + Math.pow((v - b[i]), 2), 0));
|
|
231
|
-
const targetEmbeddings = yield this.getEmbeddings(target, s => s);
|
|
232
|
-
const limit = (0, p_limit_1.default)(10);
|
|
233
|
-
const embeddings = yield Promise.all(items.map(item => limit(() => this.getEmbeddings(item, accessor))));
|
|
234
|
-
const items_ = items.map((item, i) => ({
|
|
235
|
-
item,
|
|
236
|
-
embedding: embeddings[i],
|
|
237
|
-
distance: dist(embeddings[i], targetEmbeddings),
|
|
238
|
-
}));
|
|
239
|
-
const sorted = items_.sort((a, b) => a.distance - b.distance);
|
|
240
|
-
return sorted.map(({ item }) => item);
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
parseInput(input) {
|
|
244
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
245
|
-
if (isBrowserFile(input)) {
|
|
246
|
-
return yield OpenAiMessageHelper.buildFilesMessage([input]);
|
|
247
|
-
}
|
|
248
|
-
else if (input === 'string') {
|
|
249
|
-
return input;
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
return JSON.stringify(input);
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
exports.AnyFuncService = AnyFuncService;
|
|
258
|
-
exports.AnyFuncService = AnyFuncService = tslib_1.__decorate([
|
|
259
|
-
(0, core_1.Injectable)({ providedIn: 'root' })
|
|
260
|
-
], AnyFuncService);
|
|
261
|
-
//# 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.ts"],"names":[],"mappings":";;;AAuCA,wCAOC;;AA9CD,wCAAmE;AACnE,2EAAqF;AACrF,8EAA2F;AAC3F,+BAAiF;AACjF,8DAA6B;AAG7B,6BAAgC;AAChC,oFAAiD;AACjD,oCAA6C;AAC7C,qDAAgE;AAChE,yDAAsD;AACtD,kDAAsD;AACtD,oFAAgF;AAIhF,SAAS,aAAa,CAAC,GAAY;IACjC,OAAO,OAAO,IAAI,KAAK,WAAW,IAAI,GAAG,YAAY,IAAI,CAAC;AAC5D,CAAC;AAkBD,MAAM,eAAe,GAAG,IAAI,qBAAc,CAAgB,kCAAkC,CAAC,CAAC;AAE9F,SAAgB,cAAc,CAAC,UAAgC;IAC7D,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO;QACL,EAAE,OAAO,EAAE,mCAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE;QACvD,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE;QACxC,IAAA,2BAAoB,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,uBAAuB,EAAE,MAAM,CAAC,uBAAuB,EAAE,CAAC,CAAC;KACvH,CAAA;AACH,CAAC;AAED,MAAM,mBAAmB;IACvB,M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9D,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE,CAAC,IAAI,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,wCAAc;yBAAd,cAAc;IAD1B,IAAA,iBAAU,EAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;GACpB,cAAc,CAuO1B"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ANY_FUNC_SERVICE = void 0;
|
|
4
|
-
exports.injectAnyFunc = injectAnyFunc;
|
|
5
|
-
const core_1 = require("@angular/core");
|
|
6
|
-
exports.ANY_FUNC_SERVICE = new core_1.InjectionToken('[@nx-ddd/any-func] AnyFuncService');
|
|
7
|
-
function injectAnyFunc() {
|
|
8
|
-
var _a;
|
|
9
|
-
return (_a = (0, core_1.inject)(exports.ANY_FUNC_SERVICE, { optional: true })) !== null && _a !== void 0 ? _a : {};
|
|
10
|
-
}
|
|
11
|
-
//# 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":";;;AAKA,sCAEC;AAPD,wCAAuD;AAG1C,QAAA,gBAAgB,GAAG,IAAI,qBAAc,CAAiB,mCAAmC,CAAC,CAAC;AAExG,SAAgB,aAAa;;IAC3B,OAAO,MAAA,IAAA,aAAM,EAAC,wBAAgB,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,6DAAmC"}
|
package/lib/browser.d.ts
DELETED
package/lib/browser.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.provideAnyFuncForBrowser = provideAnyFuncForBrowser;
|
|
4
|
-
const core_1 = require("@angular/core");
|
|
5
|
-
const browser_1 = require("./impl/adapters/local-storage/browser");
|
|
6
|
-
const esmodule_1 = require("./impl/adapters/validator/esmodule");
|
|
7
|
-
const any_func_service_impl_1 = require("./any-func/any-func.service.impl");
|
|
8
|
-
function provideAnyFuncForBrowser(configFactory) {
|
|
9
|
-
return (0, core_1.makeEnvironmentProviders)([
|
|
10
|
-
(0, any_func_service_impl_1.provideAnyFunc)(configFactory),
|
|
11
|
-
(0, esmodule_1.provideValidatorAdapter)(),
|
|
12
|
-
(0, browser_1.provideLocalStorage)(),
|
|
13
|
-
]);
|
|
14
|
-
}
|
|
15
|
-
//# 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":";;AAKA,4DAMC;AAXD,wCAA+E;AAC/E,mEAA4E;AAC5E,iEAA6E;AAC7E,4EAAiF;AAEjF,SAAgB,wBAAwB,CAAC,aAAmC;IAC1E,OAAO,IAAA,+BAAwB,EAAC;QAC9B,IAAA,sCAAc,EAAC,aAAa,CAAC;QAC7B,IAAA,kCAAuB,GAAE;QACzB,IAAA,6BAAmB,GAAE;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,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CacheAdapter = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@angular/core");
|
|
6
|
-
const local_storage_1 = require("../local-storage");
|
|
7
|
-
const crypto_js_1 = tslib_1.__importDefault(require("crypto-js"));
|
|
8
|
-
let CacheAdapter = class CacheAdapter {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.localStorage = local_storage_1.LOCAL_STORAGE.inject();
|
|
11
|
-
}
|
|
12
|
-
get(keyOrObj) {
|
|
13
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
const key = this.makeKey(keyOrObj);
|
|
15
|
-
return this.parseJson(this.localStorage.getItem(key));
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
set(keyOrObj, value) {
|
|
19
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const key = this.makeKey(keyOrObj);
|
|
21
|
-
this.localStorage.setItem(key, this.makeJson(value));
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
call(props, callback) {
|
|
25
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const key = this.makeKey(props);
|
|
27
|
-
let value = yield this.get(key);
|
|
28
|
-
if (value)
|
|
29
|
-
return value;
|
|
30
|
-
value = yield callback(props);
|
|
31
|
-
yield this.set(key, value);
|
|
32
|
-
return value;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
makeKey(keyOrObj) {
|
|
36
|
-
const value = typeof keyOrObj === 'string' ? keyOrObj : JSON.stringify(keyOrObj);
|
|
37
|
-
return crypto_js_1.default.SHA256(value).toString();
|
|
38
|
-
}
|
|
39
|
-
makeJson(valueOrObj) {
|
|
40
|
-
return JSON.stringify(valueOrObj);
|
|
41
|
-
}
|
|
42
|
-
parseJson(value) {
|
|
43
|
-
return JSON.parse(value);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.CacheAdapter = CacheAdapter;
|
|
47
|
-
exports.CacheAdapter = CacheAdapter = tslib_1.__decorate([
|
|
48
|
-
(0, core_1.Injectable)({ providedIn: 'root' })
|
|
49
|
-
], CacheAdapter);
|
|
50
|
-
//# 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,wCAA2C;AAC3C,oDAAiD;AACjD,kEAAiC;AAG1B,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QACK,iBAAY,GAAG,6BAAa,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,CA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AkCxB"}
|
|
@@ -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,0DAAgC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.provideLocalStorage = provideLocalStorage;
|
|
4
|
-
const token_1 = require("./token");
|
|
5
|
-
function provideLocalStorage() {
|
|
6
|
-
return token_1.LOCAL_STORAGE.provide(() => localStorage);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=browser.js.map
|
|
@@ -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":";;AAEA,kDAEC;AAJD,mCAAwC;AAExC,SAAgB,mBAAmB;IACjC,OAAO,qBAAa,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,kDAAwB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.provideLocalStorage = provideLocalStorage;
|
|
4
|
-
const node_localstorage_1 = require("node-localstorage");
|
|
5
|
-
const token_1 = require("./token");
|
|
6
|
-
const core_1 = require("@angular/core");
|
|
7
|
-
function provideLocalStorage() {
|
|
8
|
-
return (0, core_1.makeEnvironmentProviders)([
|
|
9
|
-
token_1.LOCAL_STORAGE.provide(() => new node_localstorage_1.LocalStorage('node_modules/.cache/any-func', 5 * 1024 * 1024 * 1024))
|
|
10
|
-
]);
|
|
11
|
-
}
|
|
12
|
-
//# 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":";;AAIA,kDAIC;AARD,yDAAiD;AACjD,mCAAwC;AACxC,wCAA+E;AAE/E,SAAgB,mBAAmB;IACjC,OAAO,IAAA,+BAAwB,EAAC;QAC9B,qBAAa,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,gCAAY,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,uCAAsC;AAGzB,QAAA,aAAa,GAAG,IAAA,aAAM,EAAe,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,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidatorAdapterCommonjs = void 0;
|
|
4
|
-
exports.provideValidatorAdapter = provideValidatorAdapter;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const json_schema_library_1 = require("json-schema-library");
|
|
7
|
-
const validator_adapter_1 = require("./validator.adapter");
|
|
8
|
-
const core_1 = require("@angular/core");
|
|
9
|
-
const core_2 = require("@angular/core");
|
|
10
|
-
let ValidatorAdapterCommonjs = class ValidatorAdapterCommonjs extends validator_adapter_1.ValidatorAdapter {
|
|
11
|
-
validate(schema, data) {
|
|
12
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
// console.debug('[ValidatorAdapterCommonjs#validate] validate', schema, data);
|
|
14
|
-
const compiledSchema = (0, json_schema_library_1.compileSchema)(schema, { drafts: [json_schema_library_1.draft07] });
|
|
15
|
-
const result = compiledSchema.validate(data);
|
|
16
|
-
// Convert ValidateReturnType to JsonError[]
|
|
17
|
-
if (Array.isArray(result)) {
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
return result.errors || [];
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.ValidatorAdapterCommonjs = ValidatorAdapterCommonjs;
|
|
25
|
-
exports.ValidatorAdapterCommonjs = ValidatorAdapterCommonjs = tslib_1.__decorate([
|
|
26
|
-
(0, core_1.Injectable)({ providedIn: 'root' })
|
|
27
|
-
], ValidatorAdapterCommonjs);
|
|
28
|
-
function provideValidatorAdapter() {
|
|
29
|
-
return (0, core_2.makeEnvironmentProviders)([
|
|
30
|
-
{ provide: validator_adapter_1.ValidatorAdapter, useClass: ValidatorAdapterCommonjs },
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
//# 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":";;;AAqBA,0DAIC;;AAzBD,6DAAoF;AACpF,2DAAuD;AACvD,wCAA2C;AAC3C,wCAA+E;AAIxE,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,oCAAgB;IACtD,QAAQ,CAAC,MAAkB,EAAE,IAAS;;YAC1C,+EAA+E;YAC/E,MAAM,cAAc,GAAG,IAAA,mCAAa,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,6BAAO,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,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,iBAAU,EAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;GACpB,wBAAwB,CAYpC;AAED,SAAgB,uBAAuB;IACrC,OAAO,IAAA,+BAAwB,EAAC;QAC9B,EAAE,OAAO,EAAE,oCAAgB,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,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidatorAdapterCommonjs = void 0;
|
|
4
|
-
exports.provideValidatorAdapter = provideValidatorAdapter;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const validator_adapter_1 = require("./validator.adapter");
|
|
7
|
-
const core_1 = require("@angular/core");
|
|
8
|
-
const json_schema_library_1 = require("json-schema-library");
|
|
9
|
-
let ValidatorAdapterCommonjs = class ValidatorAdapterCommonjs extends validator_adapter_1.ValidatorAdapter {
|
|
10
|
-
validate(schema, data) {
|
|
11
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
return (0, json_schema_library_1.compileSchema)(schema).validate(data).errors;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
exports.ValidatorAdapterCommonjs = ValidatorAdapterCommonjs;
|
|
17
|
-
exports.ValidatorAdapterCommonjs = ValidatorAdapterCommonjs = tslib_1.__decorate([
|
|
18
|
-
(0, core_1.Injectable)({ providedIn: 'root' })
|
|
19
|
-
], ValidatorAdapterCommonjs);
|
|
20
|
-
function provideValidatorAdapter() {
|
|
21
|
-
return [
|
|
22
|
-
{ provide: validator_adapter_1.ValidatorAdapter, useClass: ValidatorAdapterCommonjs },
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
|
-
//# 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":";;;AAaA,0DAIC;;AAhBD,2DAAuD;AACvD,wCAA2C;AAC3C,6DAAoD;AAI7C,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,oCAAgB;IACtD,QAAQ,CAAC,MAAkB,EAAE,IAAS;;YAC1C,OAAO,IAAA,mCAAa,EAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QACrD,CAAC;KAAA;CACF,CAAA;AAJY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,iBAAU,EAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;GACpB,wBAAwB,CAIpC;AAED,SAAgB,uBAAuB;IACrC,OAAO;QACL,EAAE,OAAO,EAAE,oCAAgB,EAAE,QAAQ,EAAE,wBAAwB,EAAE;KAClE,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidatorAdapter = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@angular/core");
|
|
6
|
-
let ValidatorAdapter = class ValidatorAdapter {
|
|
7
|
-
};
|
|
8
|
-
exports.ValidatorAdapter = ValidatorAdapter;
|
|
9
|
-
exports.ValidatorAdapter = ValidatorAdapter = tslib_1.__decorate([
|
|
10
|
-
(0, core_1.Injectable)()
|
|
11
|
-
], ValidatorAdapter);
|
|
12
|
-
//# 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,wCAA2C;AAIpC,IAAe,gBAAgB,GAA/B,MAAe,gBAAgB;CAErC,CAAA;AAFqB,4CAAgB;2BAAhB,gBAAgB;IADrC,IAAA,iBAAU,GAAE;GACS,gBAAgB,CAErC"}
|
package/lib/impl/index.d.ts
DELETED
package/lib/impl/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("../any-func/any-func.service.impl"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./json-schema"), exports);
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
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,4EAAkD;AAClD,wDAA8B"}
|