@ductape/sdk 0.0.6 → 0.0.8
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/dist/apps/services/app.service.js +14 -5
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/apps/utils/string.utils.d.ts +7 -0
- package/dist/apps/utils/string.utils.js +33 -1
- package/dist/apps/utils/string.utils.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js +2 -0
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appEnv.validator.js +1 -0
- package/dist/apps/validators/joi-validators/create.appEnv.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appEnv.validator.js +1 -0
- package/dist/apps/validators/joi-validators/update.appEnv.validator.js.map +1 -1
- package/dist/brokers/brokers.service.d.ts +4 -1
- package/dist/brokers/brokers.service.js +104 -20
- package/dist/brokers/brokers.service.js.map +1 -1
- package/dist/database/databases.service.d.ts +15 -0
- package/dist/database/databases.service.js +183 -14
- package/dist/database/databases.service.js.map +1 -1
- package/dist/graph/graphs.service.d.ts +6 -0
- package/dist/graph/graphs.service.js +155 -35
- package/dist/graph/graphs.service.js.map +1 -1
- package/dist/index.d.ts +28 -10
- package/dist/index.js +88 -10
- package/dist/index.js.map +1 -1
- package/dist/inputs/validators/inputs.validator.parse.js +2 -2
- package/dist/inputs/validators/inputs.validator.parse.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +15 -2
- package/dist/processor/services/processor.service.js +260 -42
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/products/services/products.service.js +36 -25
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/types/appBuilder.types.d.ts +6 -0
- package/dist/vector/vector-database.service.d.ts +6 -0
- package/dist/vector/vector-database.service.js +138 -31
- package/dist/vector/vector-database.service.js.map +1 -1
- package/dist/workflows/workflow-executor.js +99 -44
- package/dist/workflows/workflow-executor.js.map +1 -1
- package/dist/workflows/workflows.service.js +63 -20
- package/dist/workflows/workflows.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -76,6 +76,10 @@ class ProductsBuilderService {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
fetchPrivateKey() {
|
|
79
|
+
var _a;
|
|
80
|
+
if (!((_a = this.product) === null || _a === void 0 ? void 0 : _a.private_key)) {
|
|
81
|
+
throw new Error('Product not initialized or missing private_key (ensure bootstrap/init ran successfully)');
|
|
82
|
+
}
|
|
79
83
|
return this.product.private_key;
|
|
80
84
|
}
|
|
81
85
|
fetchWorkspaceId() {
|
|
@@ -354,10 +358,18 @@ class ProductsBuilderService {
|
|
|
354
358
|
async bootstrapAction(params) {
|
|
355
359
|
try {
|
|
356
360
|
const result = await this.productApi.bootstrapAction(params, this.getUserAccess());
|
|
357
|
-
// Initialize minimal product data
|
|
361
|
+
// Initialize minimal product data so fetchPrivateKey/fetchProductId/fetchWorkspaceId work
|
|
358
362
|
if (result.product_id) {
|
|
359
363
|
this.product_id = result.product_id;
|
|
360
364
|
}
|
|
365
|
+
if (result.private_key != null) {
|
|
366
|
+
this.product = {
|
|
367
|
+
_id: result.product_id,
|
|
368
|
+
workspace_id: result.workspace_id,
|
|
369
|
+
private_key: result.private_key,
|
|
370
|
+
tag: params.product_tag,
|
|
371
|
+
};
|
|
372
|
+
}
|
|
361
373
|
return result;
|
|
362
374
|
}
|
|
363
375
|
catch (e) {
|
|
@@ -2287,32 +2299,31 @@ class ProductsBuilderService {
|
|
|
2287
2299
|
// await this.validateAppAuth(auth, appData);
|
|
2288
2300
|
return app;
|
|
2289
2301
|
}
|
|
2290
|
-
validateVariablesSchema(variables, appVariables) {
|
|
2291
|
-
if (variables
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2302
|
+
validateVariablesSchema(variables, appVariables, baseUrlVariableKeys) {
|
|
2303
|
+
if (!(variables === null || variables === void 0 ? void 0 : variables.length))
|
|
2304
|
+
return;
|
|
2305
|
+
const baseKeys = new Set((baseUrlVariableKeys !== null && baseUrlVariableKeys !== void 0 ? baseUrlVariableKeys : []).map((v) => v.key));
|
|
2306
|
+
variables.forEach((data) => {
|
|
2307
|
+
const appVar = appVariables === null || appVariables === void 0 ? void 0 : appVariables.find((value) => value.key === data.key);
|
|
2308
|
+
if (appVar)
|
|
2309
|
+
return;
|
|
2310
|
+
if (baseKeys.has(data.key))
|
|
2311
|
+
return; // base_url variable (e.g. {{prefix}})
|
|
2312
|
+
throw new Error(`variable key: ${data.key} not found`);
|
|
2313
|
+
});
|
|
2300
2314
|
}
|
|
2301
2315
|
validateVariablesValues(variables, appVariables) {
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2316
|
+
const vars = variables !== null && variables !== void 0 ? variables : [];
|
|
2317
|
+
if (!(appVariables === null || appVariables === void 0 ? void 0 : appVariables.length))
|
|
2318
|
+
return;
|
|
2319
|
+
appVariables.forEach((data) => {
|
|
2320
|
+
const find = vars.find((value) => value.key === data.key);
|
|
2321
|
+
if (data.required && !find) {
|
|
2322
|
+
throw new Error(`variable key: ${data.key} is required`);
|
|
2323
|
+
}
|
|
2324
|
+
if (find)
|
|
2313
2325
|
this.inputsService.validateFeatureInputData(find, data);
|
|
2314
|
-
|
|
2315
|
-
}
|
|
2326
|
+
});
|
|
2316
2327
|
}
|
|
2317
2328
|
validateAppEnvs(envs, version) {
|
|
2318
2329
|
const { envs: appEnvs } = version;
|
|
@@ -2324,7 +2335,7 @@ class ProductsBuilderService {
|
|
|
2324
2335
|
throw new Error(`app_slug ${env.app_env_slug} not found`);
|
|
2325
2336
|
}
|
|
2326
2337
|
// const updates = this.validateAppAuth(auth, version);
|
|
2327
|
-
this.validateVariablesSchema(env.variables, version.variables);
|
|
2338
|
+
this.validateVariablesSchema(env.variables, version.variables, appEnv.base_url_variables);
|
|
2328
2339
|
this.validateVariablesValues(env.variables, version.variables);
|
|
2329
2340
|
/*if (updates && updates.data) {
|
|
2330
2341
|
env.auth.data = updates.data;
|