@ductape/sdk 0.2.20 → 0.2.21
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/cloud/cloud-graph-link.util.js +35 -2
- package/dist/cloud/cloud-graph-link.util.js.map +1 -1
- package/dist/graph/graphs.service.js +32 -1
- package/dist/graph/graphs.service.js.map +1 -1
- package/dist/products/services/products.service.js +17 -2
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -28,8 +28,27 @@ function draftToGraphEnv(draft, cloudTag, slug, originalEnv) {
|
|
|
28
28
|
provisionError: draftEnv.provisionError ? String(draftEnv.provisionError) : undefined,
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
+
/** DT-039 trace: shows presence/shape of a possibly-sensitive value, never the plaintext. */
|
|
32
|
+
function redactTraceValue(value) {
|
|
33
|
+
if (value === undefined)
|
|
34
|
+
return 'undefined';
|
|
35
|
+
if (value === null)
|
|
36
|
+
return 'null';
|
|
37
|
+
const str = String(value);
|
|
38
|
+
if (!str)
|
|
39
|
+
return 'empty-string';
|
|
40
|
+
const isSecretRef = str.startsWith('$Secret{') && str.endsWith('}');
|
|
41
|
+
return `len=${str.length}${isSecretRef ? ' isSecretRef=true' : ''} preview="${str.slice(0, 4)}..."`;
|
|
42
|
+
}
|
|
31
43
|
async function materializeCloudLinkedGraphEnv(env, ctx) {
|
|
32
|
-
var _a, _b;
|
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
45
|
+
console.log('[DT-039-TRACE] materializeCloudLinkedGraphEnv() entry:', {
|
|
46
|
+
slug: env.slug,
|
|
47
|
+
cloud: env.cloud,
|
|
48
|
+
instance: env.instance,
|
|
49
|
+
connection_url: redactTraceValue(env.connection_url),
|
|
50
|
+
password: redactTraceValue(env.password),
|
|
51
|
+
});
|
|
33
52
|
const cloudTag = env.cloud;
|
|
34
53
|
if (!cloudTag) {
|
|
35
54
|
return env;
|
|
@@ -42,6 +61,10 @@ async function materializeCloudLinkedGraphEnv(env, ctx) {
|
|
|
42
61
|
// instance), silently breaking `graph.connect()` with "Connection URL is required" long after
|
|
43
62
|
// the graph was first provisioned. Mirrors the same guard in materializeCloudLinkedDatabaseEnv.
|
|
44
63
|
if (env.connection_url) {
|
|
64
|
+
console.log('[DT-039-TRACE] materializeCloudLinkedGraphEnv() short-circuit (connection_url already set):', {
|
|
65
|
+
slug: env.slug,
|
|
66
|
+
connection_url: redactTraceValue(env.connection_url),
|
|
67
|
+
});
|
|
45
68
|
return env;
|
|
46
69
|
}
|
|
47
70
|
const connection = await ctx.cloudApi.fetchConnection(cloudTag, ctx.auth);
|
|
@@ -67,11 +90,21 @@ async function materializeCloudLinkedGraphEnv(env, ctx) {
|
|
|
67
90
|
// to source it automatically. The caller must supply it on env.password; the backend rejects
|
|
68
91
|
// the import with a clear error if it's missing, rather than silently importing with no
|
|
69
92
|
// database credentials and failing later at connect time with an opaque Neo4j auth error.
|
|
93
|
+
console.log('[DT-039-TRACE] materializeCloudLinkedGraphEnv() calling importResource (Aura):', {
|
|
94
|
+
slug: env.slug,
|
|
95
|
+
instance,
|
|
96
|
+
masterPassword: redactTraceValue(env.password),
|
|
97
|
+
});
|
|
70
98
|
const result = await ctx.cloudApi.importResource(Object.assign(Object.assign(Object.assign({}, baseInput), { resource: instance }), (env.password ? { masterPassword: env.password } : {})), ctx.auth);
|
|
71
99
|
const draft = (_a = result.componentDraft) === null || _a === void 0 ? void 0 : _a.draft;
|
|
72
100
|
if (!draft) {
|
|
73
101
|
throw new Error('Cloud graph link did not return a component draft');
|
|
74
102
|
}
|
|
103
|
+
console.log('[DT-039-TRACE] materializeCloudLinkedGraphEnv() Aura import returned draft:', {
|
|
104
|
+
slug: env.slug,
|
|
105
|
+
draftUsername: redactTraceValue((_d = (_c = (_b = draft.envs) === null || _b === void 0 ? void 0 : _b.find((e) => e.slug === env.slug)) === null || _c === void 0 ? void 0 : _c.username) !== null && _d !== void 0 ? _d : draft.username),
|
|
106
|
+
draftPassword: redactTraceValue((_g = (_f = (_e = draft.envs) === null || _e === void 0 ? void 0 : _e.find((e) => e.slug === env.slug)) === null || _f === void 0 ? void 0 : _f.password) !== null && _g !== void 0 ? _g : draft.password),
|
|
107
|
+
});
|
|
75
108
|
return draftToGraphEnv(draft, cloudTag, env.slug, env);
|
|
76
109
|
}
|
|
77
110
|
const result = instance
|
|
@@ -90,7 +123,7 @@ async function materializeCloudLinkedGraphEnv(env, ctx) {
|
|
|
90
123
|
}),
|
|
91
124
|
})
|
|
92
125
|
: await ctx.cloudApi.provisionResource(Object.assign(Object.assign(Object.assign({}, baseInput), { template: 'default', waitForReady: false }), vpcFields({ region, location: region })), ctx.auth);
|
|
93
|
-
const draft = (
|
|
126
|
+
const draft = (_h = result.componentDraft) === null || _h === void 0 ? void 0 : _h.draft;
|
|
94
127
|
if (!draft) {
|
|
95
128
|
throw new Error('Cloud graph link did not return a component draft');
|
|
96
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-graph-link.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-graph-link.util.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cloud-graph-link.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-graph-link.util.ts"],"names":[],"mappings":";;AAiDA,wEAuHC;AArKD,qEAA+D;AAC/D,qEAAqE;AACrE,qEAAyF;AAIzF,SAAS,eAAe,CACtB,KAA8B,EAC9B,QAAgB,EAChB,IAAY,EACZ,WAAiC;IAEjC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAkD,CAAC;IACtE,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAA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,QAAQ;gBAC3B,QAAQ;gBACR,WAAW,EAAE,QAAQ;gBACrB,MAAM;gBACN,QAAQ,EAAE,MAAM;aACjB,CAAC;SACH,CAAC;QACJ,CAAC,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,iBAAiB,+CAE7B,SAAS,KACZ,QAAQ,EAAE,SAAS,EACnB,YAAY,EAAE,KAAK,KAChB,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,GAE5C,GAAG,CAAC,IAAI,CACT,CAAC;IAEN,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,cAAc,0CAAE,KAA4C,CAAC;IAClF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjE,IAAI,KAAK,CAAC,eAAe,KAAK,cAAc,IAAI,QAAQ,CAAC,eAAe,KAAK,cAAc,EAAE,CAAC;QAC5F,QAAQ,CAAC,eAAe,GAAG,cAAc,CAAC;IAC5C,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -79,6 +79,18 @@ function getSharedGraphKey(workspaceId, product, graph, env) {
|
|
|
79
79
|
/** Log debounce: avoid duplicate connect logs across instances */
|
|
80
80
|
const lastGraphConnectLogAt = new Map();
|
|
81
81
|
const GRAPH_CONNECT_LOG_DEBOUNCE_MS = 15000;
|
|
82
|
+
/** DT-039 trace: shows presence/shape of a possibly-sensitive value, never the plaintext. */
|
|
83
|
+
function redactTraceValue(value) {
|
|
84
|
+
if (value === undefined)
|
|
85
|
+
return 'undefined';
|
|
86
|
+
if (value === null)
|
|
87
|
+
return 'null';
|
|
88
|
+
const str = String(value);
|
|
89
|
+
if (!str)
|
|
90
|
+
return 'empty-string';
|
|
91
|
+
const isSecretRef = str.startsWith('$Secret{') && str.endsWith('}');
|
|
92
|
+
return `len=${str.length}${isSecretRef ? ' isSecretRef=true' : ''} preview="${str.slice(0, 4)}..."`;
|
|
93
|
+
}
|
|
82
94
|
/**
|
|
83
95
|
* Main graph database service
|
|
84
96
|
*/
|
|
@@ -294,11 +306,18 @@ class GraphService {
|
|
|
294
306
|
* ```
|
|
295
307
|
*/
|
|
296
308
|
async create(graphConfig, productTag) {
|
|
297
|
-
var _a;
|
|
309
|
+
var _a, _b;
|
|
298
310
|
// Validate required fields
|
|
299
311
|
if (!graphConfig.name || !graphConfig.tag || !graphConfig.type || !((_a = graphConfig.envs) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
300
312
|
throw graph_error_1.GraphError.validationError('Graph configuration requires name, tag, type, and at least one environment');
|
|
301
313
|
}
|
|
314
|
+
console.log('[DT-039-TRACE] GraphService.create() entry envs:', graphConfig.envs.map((e) => ({
|
|
315
|
+
slug: e.slug,
|
|
316
|
+
cloud: e.cloud,
|
|
317
|
+
instance: e.instance,
|
|
318
|
+
password: redactTraceValue(e.password),
|
|
319
|
+
username: redactTraceValue(e.username),
|
|
320
|
+
})));
|
|
302
321
|
const exists = await this.fetchGraphByTag(productTag, graphConfig.tag);
|
|
303
322
|
if (exists) {
|
|
304
323
|
return;
|
|
@@ -324,6 +343,10 @@ class GraphService {
|
|
|
324
343
|
// cloud-linked envs; only manual (non-cloud) envs need it, since there the caller supplies
|
|
325
344
|
// a raw value directly and nothing downstream will resolve/store it otherwise.
|
|
326
345
|
if (env.cloud) {
|
|
346
|
+
console.log('[DT-039-TRACE] GraphService.create() skipping storeAsSecretIfNeeded (cloud-linked env):', {
|
|
347
|
+
slug: env.slug,
|
|
348
|
+
password: redactTraceValue(env.password),
|
|
349
|
+
});
|
|
327
350
|
processedEnvs.push(Object.assign({}, env));
|
|
328
351
|
continue;
|
|
329
352
|
}
|
|
@@ -369,6 +392,14 @@ class GraphService {
|
|
|
369
392
|
});
|
|
370
393
|
}),
|
|
371
394
|
};
|
|
395
|
+
console.log('[DT-039-TRACE] GraphService.create() calling builder.createGraph() with:', {
|
|
396
|
+
envs: (_b = productGraph.envs) === null || _b === void 0 ? void 0 : _b.map((e) => ({
|
|
397
|
+
slug: e.slug,
|
|
398
|
+
cloud: e.cloud,
|
|
399
|
+
password: redactTraceValue(e.password),
|
|
400
|
+
username: redactTraceValue(e.username),
|
|
401
|
+
})),
|
|
402
|
+
});
|
|
372
403
|
await builder.createGraph(productGraph);
|
|
373
404
|
}
|
|
374
405
|
// Create local adapters and connection contexts
|