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