@ductape/sdk 0.1.132 → 0.1.134
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/functions/functions.runtime.d.ts +6 -1
- package/dist/functions/functions.runtime.js +79 -48
- package/dist/functions/functions.runtime.js.map +1 -1
- package/dist/functions/types.d.ts +24 -1
- package/dist/functions/types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +2 -2
- package/dist/products/services/products.service.js +45 -33
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -384,9 +384,9 @@ export default class ProcessorService implements IProcessorService {
|
|
|
384
384
|
runBrokerPublish(data: IStepEvent, additional_logs?: Partial<ILogData>): Promise<{
|
|
385
385
|
published: boolean;
|
|
386
386
|
}>;
|
|
387
|
-
processStorageRequest(data: IStepEvent, input: IStorageRequest, storageEnv: IProductStorageEnvs, additional_logs: Partial<ILogData>, decryptionKey?: string): Promise<
|
|
387
|
+
processStorageRequest(data: IStepEvent, input: IStorageRequest, storageEnv: IProductStorageEnvs, additional_logs: Partial<ILogData>, decryptionKey?: string): Promise<{
|
|
388
388
|
url: string;
|
|
389
|
-
}>;
|
|
389
|
+
} | IProcessingFailure>;
|
|
390
390
|
writeResult(status: LogEventStatus, retryable?: boolean): Promise<void>;
|
|
391
391
|
/**
|
|
392
392
|
* Separate credentials into prefixed (e.g., 'headers:Authorization') and non-prefixed (e.g., 'api_key').
|
|
@@ -144,9 +144,10 @@ class ProductsBuilderService {
|
|
|
144
144
|
}
|
|
145
145
|
const event = version.actions.find((act) => act.tag === action);
|
|
146
146
|
data.envs = await Promise.all(data.envs.map(async (env) => {
|
|
147
|
+
var _a, _b, _c;
|
|
147
148
|
const exists = await this.fetchEnv(env.slug);
|
|
148
149
|
if (!exists) {
|
|
149
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
150
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
150
151
|
}
|
|
151
152
|
await this.validateActionDataInput({ input: env.input }, event, env.input, 0, 0);
|
|
152
153
|
env.input = (0, processor_utils_1.encrypt)(JSON.stringify(env.input), this.product.private_key);
|
|
@@ -203,9 +204,10 @@ class ProductsBuilderService {
|
|
|
203
204
|
// 4. Validate and process envs
|
|
204
205
|
if (data.envs) {
|
|
205
206
|
data.envs = await Promise.all(data.envs.map(async (env) => {
|
|
207
|
+
var _a, _b, _c;
|
|
206
208
|
const exists = await this.fetchEnv(env.slug);
|
|
207
209
|
if (!exists) {
|
|
208
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
210
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
209
211
|
}
|
|
210
212
|
// Validate input if present
|
|
211
213
|
if (env.input) {
|
|
@@ -345,7 +347,7 @@ class ProductsBuilderService {
|
|
|
345
347
|
* Every environment carries an explicit payload, including `{}` for actions with no inputs.
|
|
346
348
|
*/
|
|
347
349
|
async validateAppHealthcheckSchema(schema) {
|
|
348
|
-
var _a, _b, _c, _d;
|
|
350
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
349
351
|
const probe = schema.probe;
|
|
350
352
|
const probeType = (_a = probe === null || probe === void 0 ? void 0 : probe.type) !== null && _a !== void 0 ? _a : ((probe === null || probe === void 0 ? void 0 : probe.app) || schema.app ? 'app' : undefined);
|
|
351
353
|
if (probeType !== 'app')
|
|
@@ -372,9 +374,9 @@ class ProductsBuilderService {
|
|
|
372
374
|
}
|
|
373
375
|
for (const env of schema.envs || []) {
|
|
374
376
|
if (!(await this.fetchEnv(env.slug))) {
|
|
375
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
377
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_f = (_e = (_d = this.product) === null || _d === void 0 ? void 0 : _d.tag) !== null && _e !== void 0 ? _e : this.product_id) !== null && _f !== void 0 ? _f : 'unknown'}"`);
|
|
376
378
|
}
|
|
377
|
-
const payload = (
|
|
379
|
+
const payload = (_g = env.input) !== null && _g !== void 0 ? _g : probe === null || probe === void 0 ? void 0 : probe.input;
|
|
378
380
|
if (payload == null) {
|
|
379
381
|
throw new Error(`App healthcheck "${schema.tag}" requires an input payload for env ${env.slug}; use {} when the action has no inputs`);
|
|
380
382
|
}
|
|
@@ -1519,7 +1521,7 @@ class ProductsBuilderService {
|
|
|
1519
1521
|
}
|
|
1520
1522
|
}
|
|
1521
1523
|
async createMessageBroker(data, throwErrorIfExists = false) {
|
|
1522
|
-
var _a;
|
|
1524
|
+
var _a, _b, _c, _d;
|
|
1523
1525
|
const logPrefix = '[MessageBroker:Create]';
|
|
1524
1526
|
console.log(`${logPrefix} Starting creation for broker: ${data.tag}`);
|
|
1525
1527
|
console.log(`${logPrefix} Broker name: ${data.name}`);
|
|
@@ -1542,7 +1544,7 @@ class ProductsBuilderService {
|
|
|
1542
1544
|
const exists = await this.fetchEnv(env.slug);
|
|
1543
1545
|
if (!exists) {
|
|
1544
1546
|
console.error(`${logPrefix} Env ${env.slug} does not exist`);
|
|
1545
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
1547
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_d = (_c = (_b = this.product) === null || _b === void 0 ? void 0 : _b.tag) !== null && _c !== void 0 ? _c : this.product_id) !== null && _d !== void 0 ? _d : 'unknown'}"`);
|
|
1546
1548
|
}
|
|
1547
1549
|
console.log(`${logPrefix} Env ${env.slug} exists, verified`);
|
|
1548
1550
|
const isProvisioning = env.provisionStatus === 'provisioning';
|
|
@@ -1589,7 +1591,7 @@ class ProductsBuilderService {
|
|
|
1589
1591
|
}
|
|
1590
1592
|
}
|
|
1591
1593
|
async updateMessageBroker(tag, data) {
|
|
1592
|
-
var _a, _b;
|
|
1594
|
+
var _a, _b, _c, _d, _e;
|
|
1593
1595
|
const logPrefix = '[MessageBroker:Update]';
|
|
1594
1596
|
console.log(`${logPrefix} Starting update for broker: ${tag}`);
|
|
1595
1597
|
console.log(`${logPrefix} New tag (if changed): ${data.tag || 'unchanged'}`);
|
|
@@ -1629,7 +1631,7 @@ class ProductsBuilderService {
|
|
|
1629
1631
|
const exists = await this.fetchEnv(env.slug);
|
|
1630
1632
|
if (!exists) {
|
|
1631
1633
|
console.error(`${logPrefix} Env ${env.slug} does not exist`);
|
|
1632
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
1634
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_e = (_d = (_c = this.product) === null || _c === void 0 ? void 0 : _c.tag) !== null && _d !== void 0 ? _d : this.product_id) !== null && _e !== void 0 ? _e : 'unknown'}"`);
|
|
1633
1635
|
}
|
|
1634
1636
|
console.log(`${logPrefix} Env ${env.slug} exists, verified`);
|
|
1635
1637
|
if (env.config) {
|
|
@@ -1785,6 +1787,7 @@ class ProductsBuilderService {
|
|
|
1785
1787
|
}
|
|
1786
1788
|
}
|
|
1787
1789
|
async createStorage(data, throwErrorIfExists = false) {
|
|
1790
|
+
var _a, _b, _c;
|
|
1788
1791
|
if (!(await this.fetchStorage(data.tag))) {
|
|
1789
1792
|
const auth = this.getUserAccess();
|
|
1790
1793
|
const cloudApi = new cloudApi_service_1.CloudApiService(this.env_type);
|
|
@@ -1795,7 +1798,7 @@ class ProductsBuilderService {
|
|
|
1795
1798
|
for (const env of data.envs) {
|
|
1796
1799
|
const exists = await this.fetchEnv(env.slug);
|
|
1797
1800
|
if (!exists) {
|
|
1798
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
1801
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
1799
1802
|
}
|
|
1800
1803
|
if (env.type === productsBuilder_types_1.StorageProviders.GCP) {
|
|
1801
1804
|
// @ts-ignore
|
|
@@ -1846,9 +1849,10 @@ class ProductsBuilderService {
|
|
|
1846
1849
|
await create_productStorage_validator_1.UpdateProductStorageSchema.validateAsync(data);
|
|
1847
1850
|
if (data.envs && data.envs.length > 0) {
|
|
1848
1851
|
data.envs = await Promise.all(data.envs.map(async (env) => {
|
|
1852
|
+
var _a, _b, _c;
|
|
1849
1853
|
const exists = await this.fetchEnv(env.slug);
|
|
1850
1854
|
if (!exists) {
|
|
1851
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
1855
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
1852
1856
|
}
|
|
1853
1857
|
if (env.type === productsBuilder_types_1.StorageProviders.GCP) {
|
|
1854
1858
|
// @ts-ignore
|
|
@@ -1947,7 +1951,7 @@ class ProductsBuilderService {
|
|
|
1947
1951
|
* @param throwErrorIfExists Whether to throw error if vector config already exists
|
|
1948
1952
|
*/
|
|
1949
1953
|
async createVector(data, throwErrorIfExists = false) {
|
|
1950
|
-
var _a, _b, _c, _d;
|
|
1954
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1951
1955
|
console.log('[ProductsService.createVector] Starting vector creation:', {
|
|
1952
1956
|
tag: data.tag,
|
|
1953
1957
|
name: data.name,
|
|
@@ -1972,7 +1976,7 @@ class ProductsBuilderService {
|
|
|
1972
1976
|
});
|
|
1973
1977
|
const exists = await this.fetchEnv(env.slug, true);
|
|
1974
1978
|
if (!exists) {
|
|
1975
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
1979
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_e = (_d = (_c = this.product) === null || _c === void 0 ? void 0 : _c.tag) !== null && _d !== void 0 ? _d : this.product_id) !== null && _e !== void 0 ? _e : 'unknown'}"`);
|
|
1976
1980
|
}
|
|
1977
1981
|
if (env.apiKey) {
|
|
1978
1982
|
console.log('[ProductsService.createVector] Converting API key to secret for env:', env.slug);
|
|
@@ -1980,7 +1984,7 @@ class ProductsBuilderService {
|
|
|
1980
1984
|
env.apiKey = await this.storeVectorApiKeyAsSecret(env.apiKey, data.tag, env.slug);
|
|
1981
1985
|
console.log('[ProductsService.createVector] API key after secret conversion:', {
|
|
1982
1986
|
wasConverted: originalApiKey !== env.apiKey,
|
|
1983
|
-
isSecretRef: (
|
|
1987
|
+
isSecretRef: (_f = env.apiKey) === null || _f === void 0 ? void 0 : _f.startsWith('$Secret{'),
|
|
1984
1988
|
});
|
|
1985
1989
|
env.apiKey = (0, processor_utils_1.encrypt)(env.apiKey, this.product.private_key);
|
|
1986
1990
|
console.log('[ProductsService.createVector] API key encrypted');
|
|
@@ -1992,7 +1996,7 @@ class ProductsBuilderService {
|
|
|
1992
1996
|
env.endpoint = await this.storeVectorEndpointAsSecret(env.endpoint, data.tag, env.slug);
|
|
1993
1997
|
console.log('[ProductsService.createVector] Endpoint after secret conversion:', {
|
|
1994
1998
|
wasConverted: originalEndpoint !== env.endpoint,
|
|
1995
|
-
isSecretRef: (
|
|
1999
|
+
isSecretRef: (_g = env.endpoint) === null || _g === void 0 ? void 0 : _g.startsWith('$Secret{'),
|
|
1996
2000
|
});
|
|
1997
2001
|
env.endpoint = (0, processor_utils_1.encrypt)(env.endpoint, this.product.private_key);
|
|
1998
2002
|
console.log('[ProductsService.createVector] Endpoint encrypted');
|
|
@@ -2054,7 +2058,7 @@ class ProductsBuilderService {
|
|
|
2054
2058
|
const cloudApi = new cloudApi_service_1.CloudApiService(this.env_type);
|
|
2055
2059
|
const productTag = this.product.tag;
|
|
2056
2060
|
data.envs = await Promise.all(data.envs.map(async (env) => {
|
|
2057
|
-
var _a, _b;
|
|
2061
|
+
var _a, _b, _c, _d, _e;
|
|
2058
2062
|
const materialized = await (0, cloud_vector_link_util_1.materializeCloudLinkedVectorEnv)(env, {
|
|
2059
2063
|
cloudApi,
|
|
2060
2064
|
auth,
|
|
@@ -2068,7 +2072,7 @@ class ProductsBuilderService {
|
|
|
2068
2072
|
});
|
|
2069
2073
|
const exists = await this.fetchEnv(materialized.slug);
|
|
2070
2074
|
if (!exists) {
|
|
2071
|
-
throw new Error(`Env ${materialized.slug} does not exist`);
|
|
2075
|
+
throw new Error(`Env "${materialized.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
2072
2076
|
}
|
|
2073
2077
|
// Store API key as secret and encrypt
|
|
2074
2078
|
if (materialized.apiKey) {
|
|
@@ -2077,7 +2081,7 @@ class ProductsBuilderService {
|
|
|
2077
2081
|
materialized.apiKey = await this.storeVectorApiKeyAsSecret(materialized.apiKey, data.tag || tag, materialized.slug);
|
|
2078
2082
|
console.log('[ProductsService.updateVector] API key after secret conversion:', {
|
|
2079
2083
|
wasConverted: originalApiKey !== materialized.apiKey,
|
|
2080
|
-
isSecretRef: (
|
|
2084
|
+
isSecretRef: (_d = materialized.apiKey) === null || _d === void 0 ? void 0 : _d.startsWith('$Secret{'),
|
|
2081
2085
|
});
|
|
2082
2086
|
materialized.apiKey = (0, processor_utils_1.encrypt)(materialized.apiKey, this.product.private_key);
|
|
2083
2087
|
console.log('[ProductsService.updateVector] API key encrypted');
|
|
@@ -2089,7 +2093,7 @@ class ProductsBuilderService {
|
|
|
2089
2093
|
materialized.endpoint = await this.storeVectorEndpointAsSecret(materialized.endpoint, data.tag || tag, materialized.slug);
|
|
2090
2094
|
console.log('[ProductsService.updateVector] Endpoint after secret conversion:', {
|
|
2091
2095
|
wasConverted: originalEndpoint !== materialized.endpoint,
|
|
2092
|
-
isSecretRef: (
|
|
2096
|
+
isSecretRef: (_e = materialized.endpoint) === null || _e === void 0 ? void 0 : _e.startsWith('$Secret{'),
|
|
2093
2097
|
});
|
|
2094
2098
|
materialized.endpoint = (0, processor_utils_1.encrypt)(materialized.endpoint, this.product.private_key);
|
|
2095
2099
|
console.log('[ProductsService.updateVector] Endpoint encrypted');
|
|
@@ -2341,6 +2345,7 @@ class ProductsBuilderService {
|
|
|
2341
2345
|
* @param throwErrorIfExists Whether to throw an error if agent already exists
|
|
2342
2346
|
*/
|
|
2343
2347
|
async createAgent(data, throwErrorIfExists = false) {
|
|
2348
|
+
var _a, _b, _c;
|
|
2344
2349
|
if (!(await this.fetchAgent(data.tag))) {
|
|
2345
2350
|
await validators_1.CreateProductAgentSchema.validateAsync(data);
|
|
2346
2351
|
// Validate envs if provided
|
|
@@ -2348,7 +2353,7 @@ class ProductsBuilderService {
|
|
|
2348
2353
|
for (const env of data.envs) {
|
|
2349
2354
|
const exists = await this.fetchEnv(env.slug);
|
|
2350
2355
|
if (!exists) {
|
|
2351
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
2356
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
2352
2357
|
}
|
|
2353
2358
|
}
|
|
2354
2359
|
}
|
|
@@ -2380,6 +2385,7 @@ class ProductsBuilderService {
|
|
|
2380
2385
|
* @param data Updated agent configuration
|
|
2381
2386
|
*/
|
|
2382
2387
|
async updateAgent(tag, data) {
|
|
2388
|
+
var _a, _b, _c;
|
|
2383
2389
|
try {
|
|
2384
2390
|
const agent = await this.fetchAgent(tag);
|
|
2385
2391
|
if (!agent) {
|
|
@@ -2395,7 +2401,7 @@ class ProductsBuilderService {
|
|
|
2395
2401
|
for (const env of data.envs) {
|
|
2396
2402
|
const exists = await this.fetchEnv(env.slug);
|
|
2397
2403
|
if (!exists) {
|
|
2398
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
2404
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
2399
2405
|
}
|
|
2400
2406
|
}
|
|
2401
2407
|
const overwrite = [];
|
|
@@ -2471,13 +2477,14 @@ class ProductsBuilderService {
|
|
|
2471
2477
|
* @param throwErrorIfExists Whether to throw error if model already exists
|
|
2472
2478
|
*/
|
|
2473
2479
|
async createModel(data, throwErrorIfExists = false) {
|
|
2480
|
+
var _a, _b, _c;
|
|
2474
2481
|
if (!(await this.fetchModel(data.tag))) {
|
|
2475
2482
|
await validators_1.CreateProductModelSchema.validateAsync(data);
|
|
2476
2483
|
const processedEnvs = [];
|
|
2477
2484
|
for (const env of data.envs) {
|
|
2478
2485
|
const exists = await this.fetchEnv(env.slug);
|
|
2479
2486
|
if (!exists) {
|
|
2480
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
2487
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
2481
2488
|
}
|
|
2482
2489
|
// Store API key as secret and encrypt
|
|
2483
2490
|
if (env.apiKey) {
|
|
@@ -2519,9 +2526,10 @@ class ProductsBuilderService {
|
|
|
2519
2526
|
}
|
|
2520
2527
|
if (data.envs) {
|
|
2521
2528
|
data.envs = await Promise.all(data.envs.map(async (env) => {
|
|
2529
|
+
var _a, _b, _c;
|
|
2522
2530
|
const exists = await this.fetchEnv(env.slug);
|
|
2523
2531
|
if (!exists) {
|
|
2524
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
2532
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
2525
2533
|
}
|
|
2526
2534
|
// Store API key as secret and encrypt
|
|
2527
2535
|
if (env.apiKey) {
|
|
@@ -4172,6 +4180,7 @@ class ProductsBuilderService {
|
|
|
4172
4180
|
return action;
|
|
4173
4181
|
}
|
|
4174
4182
|
async createDatabase(data, throwErrorIfExists = false) {
|
|
4183
|
+
var _a, _b, _c;
|
|
4175
4184
|
try {
|
|
4176
4185
|
if (!(await this.fetchDatabase(data.tag))) {
|
|
4177
4186
|
const auth = this.getUserAccess();
|
|
@@ -4186,7 +4195,7 @@ class ProductsBuilderService {
|
|
|
4186
4195
|
for (const env of data.envs) {
|
|
4187
4196
|
const exists = await this.fetchEnv(env.slug);
|
|
4188
4197
|
if (!exists) {
|
|
4189
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
4198
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
4190
4199
|
}
|
|
4191
4200
|
if (env.connection_url) {
|
|
4192
4201
|
env.connection_url = (0, processor_utils_1.encrypt)(env.connection_url, this.product.private_key);
|
|
@@ -4235,9 +4244,10 @@ class ProductsBuilderService {
|
|
|
4235
4244
|
await validators_1.UpdateProductDatabaseSchema.validateAsync(data);
|
|
4236
4245
|
if (data.envs && data.envs.length > 0) {
|
|
4237
4246
|
data.envs = await Promise.all(data.envs.map(async (env) => {
|
|
4247
|
+
var _a, _b, _c;
|
|
4238
4248
|
const exists = await this.fetchEnv(env.slug);
|
|
4239
4249
|
if (!exists) {
|
|
4240
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
4250
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
4241
4251
|
}
|
|
4242
4252
|
if (env.connection_url) {
|
|
4243
4253
|
env.connection_url = (0, processor_utils_1.encrypt)(env.connection_url, this.product.private_key);
|
|
@@ -4338,7 +4348,7 @@ class ProductsBuilderService {
|
|
|
4338
4348
|
}
|
|
4339
4349
|
// GRAPH CRUD METHODS
|
|
4340
4350
|
async createGraph(data, throwErrorIfExists = false) {
|
|
4341
|
-
var _a, _b, _c;
|
|
4351
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4342
4352
|
console.log('[ProductsService.createGraph] Starting graph creation:', {
|
|
4343
4353
|
tag: data.tag,
|
|
4344
4354
|
name: data.name,
|
|
@@ -4365,7 +4375,7 @@ class ProductsBuilderService {
|
|
|
4365
4375
|
});
|
|
4366
4376
|
const exists = await this.fetchEnv(env.slug);
|
|
4367
4377
|
if (!exists) {
|
|
4368
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
4378
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_e = (_d = (_c = this.product) === null || _c === void 0 ? void 0 : _c.tag) !== null && _d !== void 0 ? _d : this.product_id) !== null && _e !== void 0 ? _e : 'unknown'}"`);
|
|
4369
4379
|
}
|
|
4370
4380
|
if (env.connection_url) {
|
|
4371
4381
|
console.log('[ProductsService.createGraph] Converting connection URL to secret for env:', env.slug);
|
|
@@ -4373,7 +4383,7 @@ class ProductsBuilderService {
|
|
|
4373
4383
|
env.connection_url = await this.storeGraphConnectionUrlAsSecret(env.connection_url, data.tag, env.slug);
|
|
4374
4384
|
console.log('[ProductsService.createGraph] Connection URL after secret conversion:', {
|
|
4375
4385
|
wasConverted: originalUrl !== env.connection_url,
|
|
4376
|
-
isSecretRef: (
|
|
4386
|
+
isSecretRef: (_f = env.connection_url) === null || _f === void 0 ? void 0 : _f.startsWith('$Secret{'),
|
|
4377
4387
|
});
|
|
4378
4388
|
env.connection_url = (0, processor_utils_1.encrypt)(env.connection_url, this.product.private_key);
|
|
4379
4389
|
console.log('[ProductsService.createGraph] Connection URL encrypted');
|
|
@@ -4442,7 +4452,7 @@ class ProductsBuilderService {
|
|
|
4442
4452
|
const cloudApi = new cloudApi_service_1.CloudApiService(this.env_type);
|
|
4443
4453
|
const productTag = this.product.tag;
|
|
4444
4454
|
data.envs = await Promise.all(data.envs.map(async (env) => {
|
|
4445
|
-
var _a;
|
|
4455
|
+
var _a, _b, _c, _d;
|
|
4446
4456
|
const materialized = await (0, cloud_graph_link_util_1.materializeCloudLinkedGraphEnv)(env, {
|
|
4447
4457
|
cloudApi,
|
|
4448
4458
|
auth,
|
|
@@ -4457,7 +4467,7 @@ class ProductsBuilderService {
|
|
|
4457
4467
|
});
|
|
4458
4468
|
const exists = await this.fetchEnv(materialized.slug);
|
|
4459
4469
|
if (!exists) {
|
|
4460
|
-
throw new Error(`Env ${materialized.slug} does not exist`);
|
|
4470
|
+
throw new Error(`Env "${materialized.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
4461
4471
|
}
|
|
4462
4472
|
if (materialized.connection_url) {
|
|
4463
4473
|
// Store connection URL as secret
|
|
@@ -4466,7 +4476,7 @@ class ProductsBuilderService {
|
|
|
4466
4476
|
materialized.connection_url = await this.storeGraphConnectionUrlAsSecret(materialized.connection_url, data.tag || tag, materialized.slug);
|
|
4467
4477
|
console.log('[ProductsService.updateGraph] Connection URL after secret conversion:', {
|
|
4468
4478
|
wasConverted: originalUrl !== materialized.connection_url,
|
|
4469
|
-
isSecretRef: (
|
|
4479
|
+
isSecretRef: (_d = materialized.connection_url) === null || _d === void 0 ? void 0 : _d.startsWith('$Secret{'),
|
|
4470
4480
|
});
|
|
4471
4481
|
materialized.connection_url = (0, processor_utils_1.encrypt)(materialized.connection_url, this.product.private_key);
|
|
4472
4482
|
console.log('[ProductsService.updateGraph] Connection URL encrypted');
|
|
@@ -5122,6 +5132,7 @@ class ProductsBuilderService {
|
|
|
5122
5132
|
}
|
|
5123
5133
|
// ==================== WORKFLOW CRUD METHODS ====================
|
|
5124
5134
|
async createFeature(data, throwErrorIfExists = false) {
|
|
5135
|
+
var _a, _b, _c;
|
|
5125
5136
|
try {
|
|
5126
5137
|
const productId = this.requireProductId(`createFeature("${data.tag || ''}")`);
|
|
5127
5138
|
const existing = await this.fetchFeature(data.tag);
|
|
@@ -5135,7 +5146,7 @@ class ProductsBuilderService {
|
|
|
5135
5146
|
for (const env of data.envs) {
|
|
5136
5147
|
const exists = await this.fetchEnv(env.slug);
|
|
5137
5148
|
if (!exists) {
|
|
5138
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
5149
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
5139
5150
|
}
|
|
5140
5151
|
}
|
|
5141
5152
|
}
|
|
@@ -5193,6 +5204,7 @@ class ProductsBuilderService {
|
|
|
5193
5204
|
}
|
|
5194
5205
|
}
|
|
5195
5206
|
async updateFeature(tag, data) {
|
|
5207
|
+
var _a, _b, _c;
|
|
5196
5208
|
try {
|
|
5197
5209
|
const feature = await this.fetchFeature(tag);
|
|
5198
5210
|
if (!feature) {
|
|
@@ -5207,7 +5219,7 @@ class ProductsBuilderService {
|
|
|
5207
5219
|
for (const env of data.envs) {
|
|
5208
5220
|
const exists = await this.fetchEnv(env.slug);
|
|
5209
5221
|
if (!exists) {
|
|
5210
|
-
throw new Error(`Env ${env.slug} does not exist`);
|
|
5222
|
+
throw new Error(`Env "${env.slug}" does not exist on product "${(_c = (_b = (_a = this.product) === null || _a === void 0 ? void 0 : _a.tag) !== null && _b !== void 0 ? _b : this.product_id) !== null && _c !== void 0 ? _c : 'unknown'}"`);
|
|
5211
5223
|
}
|
|
5212
5224
|
}
|
|
5213
5225
|
}
|