@ductape/sdk 0.0.6 → 0.0.7
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.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/processor/services/processor.service.d.ts +15 -2
- package/dist/processor/services/processor.service.js +246 -28
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/products/services/products.service.js +23 -24
- 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
|
@@ -2287,32 +2287,31 @@ class ProductsBuilderService {
|
|
|
2287
2287
|
// await this.validateAppAuth(auth, appData);
|
|
2288
2288
|
return app;
|
|
2289
2289
|
}
|
|
2290
|
-
validateVariablesSchema(variables, appVariables) {
|
|
2291
|
-
if (variables
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2290
|
+
validateVariablesSchema(variables, appVariables, baseUrlVariableKeys) {
|
|
2291
|
+
if (!(variables === null || variables === void 0 ? void 0 : variables.length))
|
|
2292
|
+
return;
|
|
2293
|
+
const baseKeys = new Set((baseUrlVariableKeys !== null && baseUrlVariableKeys !== void 0 ? baseUrlVariableKeys : []).map((v) => v.key));
|
|
2294
|
+
variables.forEach((data) => {
|
|
2295
|
+
const appVar = appVariables === null || appVariables === void 0 ? void 0 : appVariables.find((value) => value.key === data.key);
|
|
2296
|
+
if (appVar)
|
|
2297
|
+
return;
|
|
2298
|
+
if (baseKeys.has(data.key))
|
|
2299
|
+
return; // base_url variable (e.g. {{prefix}})
|
|
2300
|
+
throw new Error(`variable key: ${data.key} not found`);
|
|
2301
|
+
});
|
|
2300
2302
|
}
|
|
2301
2303
|
validateVariablesValues(variables, appVariables) {
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2304
|
+
const vars = variables !== null && variables !== void 0 ? variables : [];
|
|
2305
|
+
if (!(appVariables === null || appVariables === void 0 ? void 0 : appVariables.length))
|
|
2306
|
+
return;
|
|
2307
|
+
appVariables.forEach((data) => {
|
|
2308
|
+
const find = vars.find((value) => value.key === data.key);
|
|
2309
|
+
if (data.required && !find) {
|
|
2310
|
+
throw new Error(`variable key: ${data.key} is required`);
|
|
2311
|
+
}
|
|
2312
|
+
if (find)
|
|
2313
2313
|
this.inputsService.validateFeatureInputData(find, data);
|
|
2314
|
-
|
|
2315
|
-
}
|
|
2314
|
+
});
|
|
2316
2315
|
}
|
|
2317
2316
|
validateAppEnvs(envs, version) {
|
|
2318
2317
|
const { envs: appEnvs } = version;
|
|
@@ -2324,7 +2323,7 @@ class ProductsBuilderService {
|
|
|
2324
2323
|
throw new Error(`app_slug ${env.app_env_slug} not found`);
|
|
2325
2324
|
}
|
|
2326
2325
|
// const updates = this.validateAppAuth(auth, version);
|
|
2327
|
-
this.validateVariablesSchema(env.variables, version.variables);
|
|
2326
|
+
this.validateVariablesSchema(env.variables, version.variables, appEnv.base_url_variables);
|
|
2328
2327
|
this.validateVariablesValues(env.variables, version.variables);
|
|
2329
2328
|
/*if (updates && updates.data) {
|
|
2330
2329
|
env.auth.data = updates.data;
|