@workglow/task-graph 0.2.8 → 0.2.10
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/browser.js +9 -7
- package/dist/browser.js.map +3 -3
- package/dist/bun.js +9 -7
- package/dist/bun.js.map +3 -3
- package/dist/node.js +9 -7
- package/dist/node.js.map +3 -3
- package/dist/task-graph/GraphFormatScanner.d.ts +6 -3
- package/dist/task-graph/GraphFormatScanner.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/node.js
CHANGED
|
@@ -567,29 +567,31 @@ function scanGraphForFormat(graph, targetFormat) {
|
|
|
567
567
|
function scanGraphForCredentials(graph) {
|
|
568
568
|
const credentialFormats = new Set;
|
|
569
569
|
for (const task of graph.getTasks()) {
|
|
570
|
-
|
|
571
|
-
|
|
570
|
+
collectUsedCredentialFormats(task.inputSchema(), task.defaults ?? {}, credentialFormats);
|
|
571
|
+
collectUsedCredentialFormats(task.configSchema(), task.config ?? {}, credentialFormats);
|
|
572
572
|
}
|
|
573
573
|
return {
|
|
574
574
|
needsCredentials: credentialFormats.size > 0,
|
|
575
575
|
credentialFormats
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function collectUsedCredentialFormats(schema, data, formats) {
|
|
579
579
|
if (typeof schema === "boolean" || typeof schema !== "object" || schema === null)
|
|
580
580
|
return;
|
|
581
581
|
const s = schema;
|
|
582
582
|
const properties = s.properties;
|
|
583
583
|
if (!properties || typeof properties !== "object")
|
|
584
584
|
return;
|
|
585
|
-
|
|
585
|
+
const dataObj = typeof data === "object" && data !== null ? data : {};
|
|
586
|
+
for (const [propName, propSchema] of Object.entries(properties)) {
|
|
586
587
|
const format = getSchemaFormat(propSchema);
|
|
587
|
-
|
|
588
|
+
const value = dataObj[propName];
|
|
589
|
+
if (format === "credential" && typeof value === "string" && value.length > 0) {
|
|
588
590
|
formats.add(format);
|
|
589
591
|
}
|
|
590
592
|
const objectSchema = getObjectSchema(propSchema);
|
|
591
593
|
if (objectSchema) {
|
|
592
|
-
|
|
594
|
+
collectUsedCredentialFormats(objectSchema, value, formats);
|
|
593
595
|
}
|
|
594
596
|
}
|
|
595
597
|
}
|
|
@@ -7603,4 +7605,4 @@ export {
|
|
|
7603
7605
|
BROWSER_GRANTS
|
|
7604
7606
|
};
|
|
7605
7607
|
|
|
7606
|
-
//# debugId=
|
|
7608
|
+
//# debugId=6A4EF9DF50D86DE564756E2164756E21
|