@openapi-flow/n8n 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +101 -2
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/legacy/workflow/common/plan-validation.d.ts +1 -0
- package/dist/legacy/workflow/common/plan-validation.js +11 -0
- package/dist/legacy/workflow/common/workflow-id.d.ts +1 -0
- package/dist/legacy/workflow/common/workflow-id.js +8 -0
- package/dist/legacy/workflow/inbound/build-inbound-workflow.d.ts +2 -0
- package/dist/legacy/workflow/inbound/build-inbound-workflow.js +60 -0
- package/dist/legacy/workflow/inbound/compile-inbound-workflow.d.ts +2 -0
- package/dist/legacy/workflow/inbound/compile-inbound-workflow.js +25 -0
- package/dist/legacy/workflow/inbound/inbound-response.d.ts +2 -0
- package/dist/legacy/workflow/inbound/inbound-response.js +51 -0
- package/dist/legacy/workflow/request/base-url.d.ts +1 -0
- package/dist/legacy/workflow/request/base-url.js +14 -0
- package/dist/legacy/workflow/request/build-request-workflow.d.ts +3 -0
- package/dist/legacy/workflow/request/build-request-workflow.js +47 -0
- package/dist/legacy/workflow/request/build-sequence-workflow.d.ts +3 -0
- package/dist/legacy/workflow/request/build-sequence-workflow.js +53 -0
- package/dist/legacy/workflow/request/compile-catalog-sequence.d.ts +2 -0
- package/dist/legacy/workflow/request/compile-catalog-sequence.js +122 -0
- package/dist/legacy/workflow/request/compile-sequence.d.ts +2 -0
- package/dist/legacy/workflow/request/compile-sequence.js +41 -0
- package/dist/legacy/workflow/request/compile-workflow.d.ts +4 -0
- package/dist/legacy/workflow/request/compile-workflow.js +93 -0
- package/dist/legacy/workflow/request/credential-binding.d.ts +5 -0
- package/dist/legacy/workflow/request/credential-binding.js +31 -0
- package/dist/legacy/workflow/request/effect-policy.d.ts +4 -0
- package/dist/legacy/workflow/request/effect-policy.js +16 -0
- package/dist/legacy/workflow/request/http-request-node.d.ts +2 -0
- package/dist/legacy/workflow/request/http-request-node.js +69 -0
- package/dist/legacy/workflow/request/prepare-sequence.d.ts +4 -0
- package/dist/legacy/workflow/request/prepare-sequence.js +103 -0
- package/dist/legacy/workflow/request/request-body.d.ts +4 -0
- package/dist/legacy/workflow/request/request-body.js +64 -0
- package/dist/legacy/workflow/request/request-headers.d.ts +4 -0
- package/dist/legacy/workflow/request/request-headers.js +30 -0
- package/dist/legacy/workflow/request/request-url.d.ts +4 -0
- package/dist/legacy/workflow/request/request-url.js +34 -0
- package/dist/legacy/workflow/request/response-assertion-code.d.ts +3 -0
- package/dist/legacy/workflow/request/response-assertion-code.js +28 -0
- package/dist/legacy/workflow/request/sequence-url.d.ts +4 -0
- package/dist/legacy/workflow/request/sequence-url.js +104 -0
- package/dist/legacy-api.d.ts +25 -0
- package/dist/legacy-api.js +20 -0
- package/dist/nodes/common/validation/compile-standalone-validator.d.ts +3 -0
- package/dist/nodes/common/validation/compile-standalone-validator.js +44 -0
- package/dist/nodes/gap/create-gap-node.d.ts +3 -0
- package/dist/nodes/gap/create-gap-node.js +35 -0
- package/dist/nodes/native/arrays/create-array-node-fragment.d.ts +4 -0
- package/dist/nodes/native/arrays/create-array-node-fragment.js +42 -0
- package/dist/nodes/native/arrays/create-array-reader-code.d.ts +3 -0
- package/dist/nodes/native/arrays/create-array-reader-code.js +12 -0
- package/dist/nodes/native/arrays/create-native-array-capability.d.ts +3 -0
- package/dist/nodes/native/arrays/create-native-array-capability.js +64 -0
- package/dist/nodes/native/common/create-native-fragment.d.ts +2 -0
- package/dist/nodes/native/common/create-native-fragment.js +10 -0
- package/dist/nodes/native/common/response-references.d.ts +3 -0
- package/dist/nodes/native/common/response-references.js +5 -0
- package/dist/nodes/native/create-exclusive-branch-merge-capability.d.ts +3 -0
- package/dist/nodes/native/create-exclusive-branch-merge-capability.js +33 -0
- package/dist/nodes/native/create-json-output-capability.d.ts +3 -0
- package/dist/nodes/native/create-json-output-capability.js +38 -0
- package/dist/nodes/native/create-native-capabilities.d.ts +2 -0
- package/dist/nodes/native/create-native-capabilities.js +14 -0
- package/dist/nodes/native/create-pass-through-capability.d.ts +3 -0
- package/dist/nodes/native/create-pass-through-capability.js +30 -0
- package/dist/nodes/native/create-response-array-capability.d.ts +3 -0
- package/dist/nodes/native/create-response-array-capability.js +73 -0
- package/dist/nodes/native/create-response-collection-capability.d.ts +3 -0
- package/dist/nodes/native/create-response-collection-capability.js +132 -0
- package/dist/nodes/native/if-capability.d.ts +2 -0
- package/dist/nodes/native/if-capability.js +76 -0
- package/dist/nodes/native/item-join/create-item-join-capability.d.ts +3 -0
- package/dist/nodes/native/item-join/create-item-join-capability.js +153 -0
- package/dist/nodes/native/item-join/create-item-join-reader-code.d.ts +2 -0
- package/dist/nodes/native/item-join/create-item-join-reader-code.js +18 -0
- package/dist/nodes/native/item-join/runtime/item-join-runtime.bundle.js +24 -0
- package/dist/nodes/native/item-join/runtime/join-api-items.d.ts +3 -0
- package/dist/nodes/native/item-join/runtime/join-api-items.js +37 -0
- package/dist/nodes/native/merge-append-capability.d.ts +2 -0
- package/dist/nodes/native/merge-append-capability.js +31 -0
- package/dist/nodes/native/response-assertion-capability.d.ts +2 -0
- package/dist/nodes/native/response-assertion-capability.js +53 -0
- package/dist/nodes/native/response-check-code.d.ts +3 -0
- package/dist/nodes/native/response-check-code.js +59 -0
- package/dist/nodes/native/response-checks/create-response-check-guard.d.ts +4 -0
- package/dist/nodes/native/response-checks/create-response-check-guard.js +22 -0
- package/dist/nodes/native/response-checks/create-response-check-reader.d.ts +3 -0
- package/dist/nodes/native/response-checks/create-response-check-reader.js +23 -0
- package/dist/nodes/native/stop-and-error-capability.d.ts +2 -0
- package/dist/nodes/native/stop-and-error-capability.js +29 -0
- package/dist/nodes/request/authentication/credential-field-name.d.ts +1 -0
- package/dist/nodes/request/authentication/credential-field-name.js +3 -0
- package/dist/nodes/request/authentication/resolve-http-request-authentication.d.ts +2 -0
- package/dist/nodes/request/authentication/resolve-http-request-authentication.js +42 -0
- package/dist/nodes/request/bindings/compile-native-output-validators.d.ts +3 -0
- package/dist/nodes/request/bindings/compile-native-output-validators.js +12 -0
- package/dist/nodes/request/bindings/compile-request-validator.d.ts +3 -0
- package/dist/nodes/request/bindings/compile-request-validator.js +13 -0
- package/dist/nodes/request/bindings/compile-source-response-validators.d.ts +2 -0
- package/dist/nodes/request/bindings/compile-source-response-validators.js +12 -0
- package/dist/nodes/request/bindings/create-bound-request-fragment.d.ts +3 -0
- package/dist/nodes/request/bindings/create-bound-request-fragment.js +77 -0
- package/dist/nodes/request/bindings/create-output-reader-code.d.ts +3 -0
- package/dist/nodes/request/bindings/create-output-reader-code.js +26 -0
- package/dist/nodes/request/bindings/resolve-output-binding-sources.d.ts +3 -0
- package/dist/nodes/request/bindings/resolve-output-binding-sources.js +36 -0
- package/dist/nodes/request/create-http-request-node.d.ts +2 -0
- package/dist/nodes/request/create-http-request-node.js +94 -0
- package/dist/nodes/request/deployment/create-request-deployment-notes.d.ts +2 -0
- package/dist/nodes/request/deployment/create-request-deployment-notes.js +3 -0
- package/dist/nodes/request/deployment/resolve-http-request-deployment.d.ts +2 -0
- package/dist/nodes/request/deployment/resolve-http-request-deployment.js +33 -0
- package/dist/nodes/request/response/create-http-response-decoder.d.ts +4 -0
- package/dist/nodes/request/response/create-http-response-decoder.js +56 -0
- package/dist/nodes/request/response/decode-http-response.d.ts +3 -0
- package/dist/nodes/request/response/decode-http-response.js +42 -0
- package/dist/nodes/request/response/http-response-media.d.ts +2 -0
- package/dist/nodes/request/response/http-response-media.js +32 -0
- package/dist/nodes/request/response/response-runtime.bundle.js +24 -0
- package/dist/nodes/request/runtime/materialize-http-request.d.ts +3 -0
- package/dist/nodes/request/runtime/materialize-http-request.js +17 -0
- package/dist/nodes/request/runtime/request-runtime.bundle.js +24 -0
- package/dist/nodes/request/serialization/create-serialized-http-request-node.d.ts +3 -0
- package/dist/nodes/request/serialization/create-serialized-http-request-node.js +17 -0
- package/dist/nodes/request/serialization/serialize-http-request.d.ts +5 -0
- package/dist/nodes/request/serialization/serialize-http-request.js +70 -0
- package/dist/public-api.d.ts +30 -0
- package/dist/public-api.js +17 -0
- package/dist/schemas/batch-execution-schema.d.ts +15 -0
- package/dist/schemas/batch-execution-schema.js +14 -0
- package/dist/schemas/create-native-comparison-planning-schema.d.ts +81 -0
- package/dist/schemas/create-native-comparison-planning-schema.js +36 -0
- package/dist/schemas/exclusive-branch-merge-schema.d.ts +4 -0
- package/dist/schemas/exclusive-branch-merge-schema.js +7 -0
- package/dist/schemas/item-join-schema.d.ts +13 -0
- package/dist/schemas/item-join-schema.js +26 -0
- package/dist/schemas/native-array-schema.d.ts +11 -0
- package/dist/schemas/native-array-schema.js +19 -0
- package/dist/schemas/native-capability-schemas.d.ts +100 -0
- package/dist/schemas/native-capability-schemas.js +62 -0
- package/dist/schemas/request-deployment-schema.d.ts +9 -0
- package/dist/schemas/request-deployment-schema.js +27 -0
- package/dist/schemas/response-array-schema.d.ts +11 -0
- package/dist/schemas/response-array-schema.js +19 -0
- package/dist/schemas/response-collection-schema.d.ts +11 -0
- package/dist/schemas/response-collection-schema.js +19 -0
- package/dist/types/array-iteration.d.ts +8 -0
- package/dist/types/array-iteration.js +1 -0
- package/dist/types/array-split.d.ts +13 -0
- package/dist/types/array-split.js +1 -0
- package/dist/types/authentication.d.ts +14 -0
- package/dist/types/authentication.js +1 -0
- package/dist/types/batch-execution.d.ts +23 -0
- package/dist/types/batch-execution.js +1 -0
- package/dist/types/http-response-decoding.d.ts +16 -0
- package/dist/types/http-response-decoding.js +1 -0
- package/dist/types/item-join.d.ts +40 -0
- package/dist/types/item-join.js +1 -0
- package/dist/types/legacy/catalog-workflow.d.ts +37 -0
- package/dist/types/legacy/catalog-workflow.js +1 -0
- package/dist/types/legacy/inbound-workflow.d.ts +27 -0
- package/dist/types/legacy/inbound-workflow.js +1 -0
- package/dist/types/legacy/request-node.d.ts +23 -0
- package/dist/types/legacy/request-node.js +1 -0
- package/dist/types/legacy/request-workflow.d.ts +43 -0
- package/dist/types/legacy/request-workflow.js +1 -0
- package/dist/types/legacy/sequence-workflow.d.ts +57 -0
- package/dist/types/legacy/sequence-workflow.js +1 -0
- package/dist/types/native-array.d.ts +8 -0
- package/dist/types/native-array.js +1 -0
- package/dist/types/native-capability.d.ts +37 -0
- package/dist/types/native-capability.js +1 -0
- package/dist/types/node-fragment.d.ts +51 -0
- package/dist/types/node-fragment.js +1 -0
- package/dist/types/output-binding-source.d.ts +22 -0
- package/dist/types/output-binding-source.js +1 -0
- package/dist/types/request-deployment.d.ts +17 -0
- package/dist/types/request-deployment.js +1 -0
- package/dist/types/request-materialization.d.ts +22 -0
- package/dist/types/request-materialization.js +1 -0
- package/dist/types/response-check-compilation.d.ts +11 -0
- package/dist/types/response-check-compilation.js +1 -0
- package/dist/types/response-check-guard.d.ts +6 -0
- package/dist/types/response-check-guard.js +1 -0
- package/dist/types/response-collection.d.ts +7 -0
- package/dist/types/response-collection.js +1 -0
- package/dist/types/reviewable-workflow.d.ts +27 -0
- package/dist/types/reviewable-workflow.js +1 -0
- package/dist/types/schema-compilation.d.ts +5 -0
- package/dist/types/schema-compilation.js +1 -0
- package/dist/types/serialized-http-request.d.ts +4 -0
- package/dist/types/serialized-http-request.js +1 -0
- package/dist/types/workflow-compilation.d.ts +36 -0
- package/dist/types/workflow-compilation.js +1 -0
- package/dist/utils/bundled-license-banner.d.ts +3 -0
- package/dist/utils/bundled-license-banner.js +32 -0
- package/dist/utils/javascript-json-literal.d.ts +2 -0
- package/dist/utils/javascript-json-literal.js +10 -0
- package/dist/utils/json-values-equal.cjs +24 -0
- package/dist/utils/json-values-equal.d.cts +1 -0
- package/dist/workflow/assemble-n8n-workflow.d.ts +2 -0
- package/dist/workflow/assemble-n8n-workflow.js +11 -0
- package/dist/workflow/batch/compile-batched-n8n-workflow.d.ts +3 -0
- package/dist/workflow/batch/compile-batched-n8n-workflow.js +18 -0
- package/dist/workflow/batch/create-batch-execution-scopes.d.ts +3 -0
- package/dist/workflow/batch/create-batch-execution-scopes.js +59 -0
- package/dist/workflow/batch/validate-batch-exclusive-rejoin.d.ts +3 -0
- package/dist/workflow/batch/validate-batch-exclusive-rejoin.js +49 -0
- package/dist/workflow/batch/validate-batch-item-flow.d.ts +3 -0
- package/dist/workflow/batch/validate-batch-item-flow.js +98 -0
- package/dist/workflow/build-n8n-workflow.d.ts +2 -0
- package/dist/workflow/build-n8n-workflow.js +143 -0
- package/dist/workflow/compile-native-workflow-nodes.d.ts +3 -0
- package/dist/workflow/compile-native-workflow-nodes.js +26 -0
- package/dist/workflow/compile-planned-n8n-workflow.d.ts +3 -0
- package/dist/workflow/compile-planned-n8n-workflow.js +17 -0
- package/dist/workflow/compile-reviewable-n8n-workflow.d.ts +3 -0
- package/dist/workflow/compile-reviewable-n8n-workflow.js +70 -0
- package/dist/workflow/compile-validated-workflow-fragments.d.ts +3 -0
- package/dist/workflow/compile-validated-workflow-fragments.js +20 -0
- package/dist/workflow/create-n8n-native-output-sources.d.ts +3 -0
- package/dist/workflow/create-n8n-native-output-sources.js +17 -0
- package/dist/workflow/review/create-gap-review-content.d.ts +2 -0
- package/dist/workflow/review/create-gap-review-content.js +28 -0
- package/dist/workflow/review/create-gap-review-region.d.ts +2 -0
- package/dist/workflow/review/create-gap-review-region.js +23 -0
- package/dist/workflow/review/escape-review-markdown.d.ts +1 -0
- package/dist/workflow/review/escape-review-markdown.js +7 -0
- package/dist/workflow/review/gap-review-region-layout.d.ts +4 -0
- package/dist/workflow/review/gap-review-region-layout.js +21 -0
- package/dist/workflow/validate-compiled-binding-sources.d.ts +4 -0
- package/dist/workflow/validate-compiled-binding-sources.js +40 -0
- package/dist/workflow/validate-node-fragments.d.ts +3 -0
- package/dist/workflow/validate-node-fragments.js +58 -0
- package/package.json +54 -4
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Disjoint source literals retain the same validation contract with anyOf.
|
|
3
|
+
// OpenAI-compatible strict tools reject the oneOf emitted by discriminatedUnion.
|
|
4
|
+
export const nativeOperandSchema = z.union([
|
|
5
|
+
z.strictObject({
|
|
6
|
+
source: z.literal('response'),
|
|
7
|
+
nodeId: z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1)
|
|
10
|
+
.describe('API callId whose response is guaranteed to have executed.'),
|
|
11
|
+
pointer: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe('RFC 6901 pointer into the response body. Empty string means the whole body.'),
|
|
14
|
+
}),
|
|
15
|
+
z.strictObject({
|
|
16
|
+
source: z.literal('literal'),
|
|
17
|
+
value: z
|
|
18
|
+
.union([z.string(), z.number(), z.boolean(), z.null()])
|
|
19
|
+
.describe('An explicitly requested scalar comparison value; no expressions or code.'),
|
|
20
|
+
}),
|
|
21
|
+
]);
|
|
22
|
+
export const nativeCheckSchema = z.strictObject({
|
|
23
|
+
left: nativeOperandSchema,
|
|
24
|
+
operator: z
|
|
25
|
+
.enum(['equals', 'notEquals', 'greaterThan', 'lessThan', 'keysEqual'])
|
|
26
|
+
.describe('equals is deep, type-strict JSON equality. keysEqual compares object key sets. Numeric operators require numbers.'),
|
|
27
|
+
right: nativeOperandSchema,
|
|
28
|
+
});
|
|
29
|
+
export const ifParametersSchema = z.strictObject({
|
|
30
|
+
combinator: z
|
|
31
|
+
.enum(['and', 'or'])
|
|
32
|
+
.describe('Combine all conditions. Outputs: true, false; input: main.'),
|
|
33
|
+
conditions: z
|
|
34
|
+
.array(nativeCheckSchema)
|
|
35
|
+
.min(1)
|
|
36
|
+
.describe('Only conditions required by the scenario, with OAS-derived response pointers.'),
|
|
37
|
+
});
|
|
38
|
+
export const mergeParametersSchema = z.strictObject({
|
|
39
|
+
numberInputs: z
|
|
40
|
+
.number()
|
|
41
|
+
.int()
|
|
42
|
+
.min(2)
|
|
43
|
+
.describe('Append waits for ALL inputs named input1..inputN. Output: main. Never join mutually exclusive branches.'),
|
|
44
|
+
});
|
|
45
|
+
export const assertionParametersSchema = z.strictObject({
|
|
46
|
+
checks: z
|
|
47
|
+
.array(nativeCheckSchema.extend({
|
|
48
|
+
message: z
|
|
49
|
+
.string()
|
|
50
|
+
.min(1)
|
|
51
|
+
.describe('Actionable failure message for this scenario assertion.'),
|
|
52
|
+
}))
|
|
53
|
+
.min(1)
|
|
54
|
+
.describe('Declarative assertions over API responses; compiled to Code by the library, never model-written JavaScript. Input/output: main.'),
|
|
55
|
+
});
|
|
56
|
+
export const stopParametersSchema = z.strictObject({
|
|
57
|
+
message: z
|
|
58
|
+
.string()
|
|
59
|
+
.min(1)
|
|
60
|
+
.describe('StopAndError message when this branch executes. Input: main; no output.'),
|
|
61
|
+
});
|
|
62
|
+
export const passThroughParametersSchema = z.strictObject({});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const httpRequestDeploymentOptionsSchema: z.ZodObject<{
|
|
3
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
4
|
+
credentialBindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
}, z.core.$strict>>>;
|
|
8
|
+
securityRequirementIndex: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { originFrom } from '../legacy/workflow/request/base-url.js';
|
|
3
|
+
export const httpRequestDeploymentOptionsSchema = z.strictObject({
|
|
4
|
+
baseUrl: z
|
|
5
|
+
.string()
|
|
6
|
+
.superRefine((value, context) => {
|
|
7
|
+
try {
|
|
8
|
+
originFrom(value);
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
if (!(error instanceof Error))
|
|
12
|
+
throw error;
|
|
13
|
+
context.addIssue({
|
|
14
|
+
code: 'custom',
|
|
15
|
+
message: error.message,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
.optional(),
|
|
20
|
+
credentialBindings: z
|
|
21
|
+
.record(z.string().min(1), z.strictObject({
|
|
22
|
+
id: z.string().refine((value) => value.trim().length > 0),
|
|
23
|
+
name: z.string().refine((value) => value.trim().length > 0),
|
|
24
|
+
}))
|
|
25
|
+
.optional(),
|
|
26
|
+
securityRequirementIndex: z.number().int().nonnegative().optional(),
|
|
27
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const responseArrayParametersSchema: z.ZodObject<{
|
|
3
|
+
sourceNodeId: z.ZodString;
|
|
4
|
+
pointer: z.ZodString;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare function createResponseArrayParametersSchema(callIds: string[]): z.ZodObject<{
|
|
7
|
+
pointer: z.ZodString;
|
|
8
|
+
sourceNodeId: z.ZodEnum<{
|
|
9
|
+
[x: string]: string;
|
|
10
|
+
}>;
|
|
11
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const responseArrayParametersSchema = z.strictObject({
|
|
3
|
+
sourceNodeId: z
|
|
4
|
+
.string()
|
|
5
|
+
.min(1)
|
|
6
|
+
.describe('Existing API callId whose declared OAS response contains the scenario-required array.'),
|
|
7
|
+
pointer: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('RFC 6901 pointer into that response body selecting the array. Empty string selects an array body. Never select a first element instead of iterating.'),
|
|
10
|
+
});
|
|
11
|
+
export function createResponseArrayParametersSchema(callIds) {
|
|
12
|
+
if (!callIds.length)
|
|
13
|
+
throw new Error('array parameters require API callIds');
|
|
14
|
+
return responseArrayParametersSchema.extend({
|
|
15
|
+
sourceNodeId: z
|
|
16
|
+
.enum(callIds)
|
|
17
|
+
.describe('Only a supplied API callId; code derives and validates the response array contract.'),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const responseCollectionParametersSchema: z.ZodObject<{
|
|
3
|
+
sourceNodeId: z.ZodString;
|
|
4
|
+
pointer: z.ZodString;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare function createResponseCollectionParametersSchema(callIds: string[]): z.ZodObject<{
|
|
7
|
+
pointer: z.ZodString;
|
|
8
|
+
sourceNodeId: z.ZodEnum<{
|
|
9
|
+
[x: string]: string;
|
|
10
|
+
}>;
|
|
11
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const responseCollectionParametersSchema = z.strictObject({
|
|
3
|
+
sourceNodeId: z
|
|
4
|
+
.string()
|
|
5
|
+
.min(1)
|
|
6
|
+
.describe('An existing API callId whose item-linked responses must be collected.'),
|
|
7
|
+
pointer: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('RFC 6901 pointer into each API response body. Empty string collects the entire unchanged body.'),
|
|
10
|
+
});
|
|
11
|
+
export function createResponseCollectionParametersSchema(callIds) {
|
|
12
|
+
if (!callIds.length)
|
|
13
|
+
throw new Error('collection parameters require API callIds');
|
|
14
|
+
return responseCollectionParametersSchema.extend({
|
|
15
|
+
sourceNodeId: z
|
|
16
|
+
.enum(callIds)
|
|
17
|
+
.describe('Only a supplied API callId. Code derives response schemas and validates each source.'),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ApiBindingMaterial } from '@openapi-flow/core';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { responseArrayParametersSchema } from '../schemas/response-array-schema.js';
|
|
4
|
+
import type { NativeItemExecutionOptions } from './native-capability.js';
|
|
5
|
+
export type ResponseArrayParameters = z.infer<typeof responseArrayParametersSchema>;
|
|
6
|
+
export interface CreateResponseArrayCapabilityInput extends NativeItemExecutionOptions {
|
|
7
|
+
materials: ApiBindingMaterial[];
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PlannedNativeNode } from '@openapi-flow/core';
|
|
2
|
+
import type { N8nOutputBindingSource } from './output-binding-source.js';
|
|
3
|
+
export interface ArraySplitParameters {
|
|
4
|
+
sourceNodeId: string;
|
|
5
|
+
pointer: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateArrayNodeFragmentInput {
|
|
8
|
+
planned: PlannedNativeNode;
|
|
9
|
+
position: [number, number];
|
|
10
|
+
source: N8nOutputBindingSource;
|
|
11
|
+
parameters: ArraySplitParameters;
|
|
12
|
+
linked: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ApiOperationContract } from '@openapi-flow/core';
|
|
2
|
+
export type HttpRequestCredentialType = 'httpBearerAuth' | 'httpBasicAuth' | 'httpDigestAuth' | 'httpHeaderAuth' | 'httpQueryAuth' | 'oAuth2Api';
|
|
3
|
+
export interface HttpRequestAuthenticationMapping {
|
|
4
|
+
schemeName: string;
|
|
5
|
+
credentialType: HttpRequestCredentialType;
|
|
6
|
+
credentialRequirements?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ResolveHttpRequestAuthenticationInput {
|
|
9
|
+
operation: ApiOperationContract;
|
|
10
|
+
securityRequirementIndex?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface CredentialBindingRequest {
|
|
13
|
+
authentication?: HttpRequestAuthenticationMapping;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { batchExecutionScopeSchema } from '../schemas/batch-execution-schema.js';
|
|
3
|
+
import type { CompilePlannedN8nWorkflowInput } from './native-capability.js';
|
|
4
|
+
import type { N8nSdkNode, N8nNodeFragment } from './node-fragment.js';
|
|
5
|
+
import type { AssembleN8nWorkflowInput } from './workflow-compilation.js';
|
|
6
|
+
export type N8nBatchExecutionScope = z.infer<typeof batchExecutionScopeSchema>;
|
|
7
|
+
export interface CompileBatchedN8nWorkflowInput extends CompilePlannedN8nWorkflowInput {
|
|
8
|
+
batchScopes: N8nBatchExecutionScope[];
|
|
9
|
+
}
|
|
10
|
+
export interface CreateBatchExecutionScopesInput extends AssembleN8nWorkflowInput {
|
|
11
|
+
batchScopes: N8nBatchExecutionScope[];
|
|
12
|
+
}
|
|
13
|
+
export interface CompiledN8nBatchExecutionScope {
|
|
14
|
+
scope: N8nBatchExecutionScope;
|
|
15
|
+
controller: N8nSdkNode;
|
|
16
|
+
}
|
|
17
|
+
export interface ValidateBatchItemFlowInput {
|
|
18
|
+
scope: N8nBatchExecutionScope;
|
|
19
|
+
fragments: Map<string, N8nNodeFragment>;
|
|
20
|
+
edges: AssembleN8nWorkflowInput['edges'];
|
|
21
|
+
/** A completed earlier batch is not the original exit node's latest run. */
|
|
22
|
+
otherBatchNodeIds: Set<string>;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ApiResponseEnvelope } from '@openapi-flow/core';
|
|
2
|
+
import type { N8nNodeFragment } from './node-fragment.js';
|
|
3
|
+
export interface HttpResponseDecodeInput {
|
|
4
|
+
response: ApiResponseEnvelope;
|
|
5
|
+
bytes: Uint8Array;
|
|
6
|
+
method: string;
|
|
7
|
+
sourceNodeId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DecodedHttpResponse {
|
|
10
|
+
response: ApiResponseEnvelope;
|
|
11
|
+
kind: 'json' | 'text' | 'binary' | 'empty';
|
|
12
|
+
}
|
|
13
|
+
export interface CreateHttpResponseDecoderInput {
|
|
14
|
+
fragment: N8nNodeFragment;
|
|
15
|
+
method: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { ApiBindingMaterial, JsonValue } from '@openapi-flow/core';
|
|
3
|
+
import type { N8nNativeOutputSource, N8nOutputBindingSource } from './output-binding-source.js';
|
|
4
|
+
import type { itemJoinParametersSchema } from '../schemas/item-join-schema.js';
|
|
5
|
+
export type ItemJoinParameters = z.infer<typeof itemJoinParametersSchema>;
|
|
6
|
+
export interface CreateItemJoinCapabilityInput {
|
|
7
|
+
materials: ApiBindingMaterial[];
|
|
8
|
+
scopes: N8nNativeOutputSource[];
|
|
9
|
+
}
|
|
10
|
+
export interface CreateItemJoinReaderCodeInput {
|
|
11
|
+
scope: N8nNativeOutputSource;
|
|
12
|
+
sourceCallId: string;
|
|
13
|
+
sources: N8nOutputBindingSource[];
|
|
14
|
+
}
|
|
15
|
+
export interface ItemJoinRow {
|
|
16
|
+
scopeIndex: number;
|
|
17
|
+
sourceCallId: string;
|
|
18
|
+
response: JsonValue;
|
|
19
|
+
}
|
|
20
|
+
export interface ItemJoinInputItem {
|
|
21
|
+
json: ItemJoinRow;
|
|
22
|
+
}
|
|
23
|
+
export interface JoinApiItemsInput {
|
|
24
|
+
items: ItemJoinInputItem[];
|
|
25
|
+
sourceCallIds: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface ItemJoinValues {
|
|
28
|
+
responses: Record<string, JsonValue>;
|
|
29
|
+
}
|
|
30
|
+
export interface ItemJoinOutputItem {
|
|
31
|
+
json: ItemJoinValues;
|
|
32
|
+
pairedItem: ItemJoinPair[];
|
|
33
|
+
}
|
|
34
|
+
export interface ItemJoinPair {
|
|
35
|
+
item: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ItemJoinGroup {
|
|
38
|
+
values: Map<string, JsonValue>;
|
|
39
|
+
inputIndexes: number[];
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { WorkflowJSON } from '@n8n/workflow-sdk';
|
|
2
|
+
import type { CatalogSource, CatalogSequencePlan, CatalogDiagnostic } from '@openapi-flow/core/internal';
|
|
3
|
+
import type { Operation } from '@openapi-flow/core/internal';
|
|
4
|
+
import type { CredentialBindings, EffectPolicy } from '@openapi-flow/n8n/legacy';
|
|
5
|
+
import type { SequenceEvidence, SequencePlan, SequenceStep } from '@openapi-flow/n8n/legacy';
|
|
6
|
+
import type { CompileRequest } from '@openapi-flow/n8n/legacy';
|
|
7
|
+
export interface ResolvedSequenceStep {
|
|
8
|
+
operation: Operation;
|
|
9
|
+
origin: URL;
|
|
10
|
+
effectPolicy: EffectPolicy;
|
|
11
|
+
credentialBindings: CredentialBindings;
|
|
12
|
+
}
|
|
13
|
+
export interface PrepareStepsInput {
|
|
14
|
+
profile: CompileRequest['profile'];
|
|
15
|
+
plan: SequencePlan;
|
|
16
|
+
resolveStep: (step: SequenceStep) => ResolvedSequenceStep;
|
|
17
|
+
}
|
|
18
|
+
export interface N8nCatalogSource extends CatalogSource {
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
effectPolicy: EffectPolicy;
|
|
21
|
+
credentialBindings: CredentialBindings;
|
|
22
|
+
}
|
|
23
|
+
export interface CatalogSequenceRequest {
|
|
24
|
+
sources: N8nCatalogSource[];
|
|
25
|
+
profile: CompileRequest['profile'];
|
|
26
|
+
plan: CatalogSequencePlan;
|
|
27
|
+
}
|
|
28
|
+
export interface CatalogSequenceEvidence extends SequenceEvidence {
|
|
29
|
+
documentId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CatalogSequenceResult {
|
|
32
|
+
status: 'complete' | 'needs_capability' | 'needs_input' | 'blocked';
|
|
33
|
+
plan: CatalogSequencePlan;
|
|
34
|
+
evidence: CatalogSequenceEvidence[];
|
|
35
|
+
diagnostics: CatalogDiagnostic[];
|
|
36
|
+
workflow?: WorkflowJSON;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { WorkflowJSON } from '@n8n/workflow-sdk';
|
|
2
|
+
import type { OpenApiDocument, ParsedDocument } from '@openapi-flow/core/internal';
|
|
3
|
+
import type { InboundOperationCandidate, InboundOperationSource } from '@openapi-flow/core/internal';
|
|
4
|
+
export interface InboundPlan {
|
|
5
|
+
version: '1';
|
|
6
|
+
goal: string;
|
|
7
|
+
operationRef: string;
|
|
8
|
+
webhookPath: string;
|
|
9
|
+
responseStatus: number;
|
|
10
|
+
responseMediaType?: string;
|
|
11
|
+
responseBody?: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface InboundRequest {
|
|
14
|
+
spec: OpenApiDocument;
|
|
15
|
+
plan: InboundPlan;
|
|
16
|
+
}
|
|
17
|
+
export interface InboundWorkflowContext {
|
|
18
|
+
document: ParsedDocument;
|
|
19
|
+
selected: InboundOperationSource;
|
|
20
|
+
plan: InboundPlan;
|
|
21
|
+
}
|
|
22
|
+
export interface InboundResult {
|
|
23
|
+
status: 'complete';
|
|
24
|
+
plan: InboundPlan;
|
|
25
|
+
evidence: InboundOperationCandidate;
|
|
26
|
+
workflow: WorkflowJSON;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { NodeConfig } from '@n8n/workflow-sdk';
|
|
2
|
+
import type { Operation } from '@openapi-flow/core/internal';
|
|
3
|
+
export type RequiredFields = Record<string, string>;
|
|
4
|
+
export type ResolvedAuthentication = Required<Pick<NodeConfig, 'parameters' | 'credentials'>>;
|
|
5
|
+
export interface RequestHeader {
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PreparedRequestBody {
|
|
10
|
+
contentType: 'json' | 'form-urlencoded';
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
export interface HttpRequestNodeInput {
|
|
14
|
+
operation: Operation;
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
position: [number, number];
|
|
18
|
+
url: string;
|
|
19
|
+
body?: PreparedRequestBody;
|
|
20
|
+
headers: RequestHeader[];
|
|
21
|
+
authentication?: ResolvedAuthentication;
|
|
22
|
+
shouldAssert: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ExpectedBody, WorkflowPlan } from '@openapi-flow/core/internal';
|
|
2
|
+
export type { ExpectedBody, WorkflowInputs, InputValues, WorkflowPlan, } from '@openapi-flow/core/internal';
|
|
3
|
+
import type { WorkflowJSON } from '@n8n/workflow-sdk';
|
|
4
|
+
import type { OpenApiDocument } from '@openapi-flow/core/internal';
|
|
5
|
+
import type { Operation } from '@openapi-flow/core/internal';
|
|
6
|
+
import type { PreparedRequestBody, RequestHeader, ResolvedAuthentication } from './request-node.js';
|
|
7
|
+
export type CompileStatus = 'complete' | 'needs_input' | 'blocked';
|
|
8
|
+
export type OperationEffect = 'read' | 'write' | 'unknown';
|
|
9
|
+
export type EffectPolicy = Record<string, 'read' | 'write'>;
|
|
10
|
+
export interface CredentialBinding {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
export type CredentialBindings = Record<string, CredentialBinding>;
|
|
15
|
+
export interface OperationEvidence extends Pick<Operation, 'operationRef' | 'operationId' | 'method' | 'path'> {
|
|
16
|
+
effect: OperationEffect;
|
|
17
|
+
}
|
|
18
|
+
export interface CompileRequest {
|
|
19
|
+
spec: OpenApiDocument;
|
|
20
|
+
baseUrl: string;
|
|
21
|
+
profile: 'read-only' | 'test';
|
|
22
|
+
effectPolicy: EffectPolicy;
|
|
23
|
+
credentialBindings: CredentialBindings;
|
|
24
|
+
plan: WorkflowPlan;
|
|
25
|
+
}
|
|
26
|
+
export type CompileOperationRequest = Pick<CompileRequest, 'baseUrl' | 'profile' | 'effectPolicy' | 'credentialBindings' | 'plan'>;
|
|
27
|
+
export interface CompileResult {
|
|
28
|
+
status: CompileStatus;
|
|
29
|
+
plan: WorkflowPlan;
|
|
30
|
+
evidence: OperationEvidence;
|
|
31
|
+
missingInputs: string[];
|
|
32
|
+
workflow?: WorkflowJSON;
|
|
33
|
+
}
|
|
34
|
+
export interface BuildRequestWorkflowInput {
|
|
35
|
+
baseUrl: string;
|
|
36
|
+
plan: WorkflowPlan;
|
|
37
|
+
operation: Operation;
|
|
38
|
+
url: string;
|
|
39
|
+
body?: PreparedRequestBody;
|
|
40
|
+
headers: RequestHeader[];
|
|
41
|
+
authentication?: ResolvedAuthentication;
|
|
42
|
+
expectedBody: ExpectedBody;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { SequencePlan } from '@openapi-flow/core/internal';
|
|
2
|
+
export type { ResponseReference, SequenceStep, SequencePlan, } from '@openapi-flow/core/internal';
|
|
3
|
+
import type { WorkflowJSON } from '@n8n/workflow-sdk';
|
|
4
|
+
import type { OpenApiDocument, ParsedDocument } from '@openapi-flow/core/internal';
|
|
5
|
+
import type { Operation } from '@openapi-flow/core/internal';
|
|
6
|
+
import type { PreparedRequestBody, RequestHeader, ResolvedAuthentication } from './request-node.js';
|
|
7
|
+
import type { CompileRequest, CompileStatus, CredentialBindings, EffectPolicy, ExpectedBody, OperationEvidence } from './request-workflow.js';
|
|
8
|
+
export type PreviousOperations = Map<string, Operation>;
|
|
9
|
+
export type RequiredOutputs = Map<string, Set<string>>;
|
|
10
|
+
export interface SequenceRequest {
|
|
11
|
+
spec: OpenApiDocument;
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
profile: CompileRequest['profile'];
|
|
14
|
+
effectPolicy: EffectPolicy;
|
|
15
|
+
credentialBindings: CredentialBindings;
|
|
16
|
+
plan: SequencePlan;
|
|
17
|
+
}
|
|
18
|
+
export interface SequenceEvidence extends OperationEvidence {
|
|
19
|
+
stepId: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SequenceResult {
|
|
22
|
+
status: CompileStatus;
|
|
23
|
+
plan: SequencePlan;
|
|
24
|
+
evidence: SequenceEvidence[];
|
|
25
|
+
missingInputs: string[];
|
|
26
|
+
workflow?: WorkflowJSON;
|
|
27
|
+
}
|
|
28
|
+
export interface PreparedSequenceNode {
|
|
29
|
+
operation: Operation;
|
|
30
|
+
id: string;
|
|
31
|
+
url: string;
|
|
32
|
+
body?: PreparedRequestBody;
|
|
33
|
+
headers: RequestHeader[];
|
|
34
|
+
expectedBody: ExpectedBody;
|
|
35
|
+
authentication?: ResolvedAuthentication;
|
|
36
|
+
}
|
|
37
|
+
export interface PrepareSequenceInput {
|
|
38
|
+
document: ParsedDocument;
|
|
39
|
+
origin: URL;
|
|
40
|
+
profile: SequenceRequest['profile'];
|
|
41
|
+
effectPolicy: EffectPolicy;
|
|
42
|
+
credentialBindings: CredentialBindings;
|
|
43
|
+
plan: SequencePlan;
|
|
44
|
+
}
|
|
45
|
+
export interface PreparedSequence {
|
|
46
|
+
evidence: SequenceEvidence[];
|
|
47
|
+
missingInputs: string[];
|
|
48
|
+
nodes: PreparedSequenceNode[];
|
|
49
|
+
requiredOutputs: RequiredOutputs;
|
|
50
|
+
blocked: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface BuildSequenceWorkflowInput {
|
|
53
|
+
baseUrl: string;
|
|
54
|
+
plan: SequencePlan;
|
|
55
|
+
nodes: PreparedSequenceNode[];
|
|
56
|
+
requiredOutputs: RequiredOutputs;
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { nativeArrayParametersSchema } from '../schemas/native-array-schema.js';
|
|
3
|
+
import type { N8nNativeOutputSource } from './output-binding-source.js';
|
|
4
|
+
import type { NativeItemExecutionOptions } from './native-capability.js';
|
|
5
|
+
export type NativeArrayParameters = z.infer<typeof nativeArrayParametersSchema>;
|
|
6
|
+
export interface CreateNativeArrayCapabilityInput extends NativeItemExecutionOptions {
|
|
7
|
+
sources: N8nNativeOutputSource[];
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { PlannedNativeNode, WorkflowCapability, WorkflowGraphPlan, WorkflowApiMaterial, ApiOperationContract } from '@openapi-flow/core';
|
|
3
|
+
import type { N8nNodeFragment } from './node-fragment.js';
|
|
4
|
+
import type { nativeOperandSchema, nativeCheckSchema, ifParametersSchema, mergeParametersSchema, assertionParametersSchema, stopParametersSchema } from '../schemas/native-capability-schemas.js';
|
|
5
|
+
export type NativeOperand = z.infer<typeof nativeOperandSchema>;
|
|
6
|
+
export type NativeCheck = z.infer<typeof nativeCheckSchema>;
|
|
7
|
+
export type IfParameters = z.infer<typeof ifParametersSchema>;
|
|
8
|
+
export type MergeParameters = z.infer<typeof mergeParametersSchema>;
|
|
9
|
+
export type AssertionParameters = z.infer<typeof assertionParametersSchema>;
|
|
10
|
+
export type StopParameters = z.infer<typeof stopParametersSchema>;
|
|
11
|
+
export interface NativeItemExecutionOptions {
|
|
12
|
+
itemMode?: 'linked';
|
|
13
|
+
}
|
|
14
|
+
export interface CompileNativeNodeInput {
|
|
15
|
+
planned: PlannedNativeNode;
|
|
16
|
+
apiNodeNames: Record<string, string>;
|
|
17
|
+
position: [number, number];
|
|
18
|
+
/** Original OAS contracts are required by compilers that read API responses. */
|
|
19
|
+
apiResponseContracts?: Record<string, ApiOperationContract>;
|
|
20
|
+
}
|
|
21
|
+
export interface N8nNativeCapability extends WorkflowCapability {
|
|
22
|
+
compile: (input: CompileNativeNodeInput) => N8nNodeFragment;
|
|
23
|
+
}
|
|
24
|
+
export interface CreateJsonOutputCapabilityInput {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
parametersSchema: WorkflowCapability['parametersSchema'];
|
|
28
|
+
}
|
|
29
|
+
export interface CompilePlannedN8nWorkflowInput {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
plan: WorkflowGraphPlan;
|
|
33
|
+
materials: WorkflowApiMaterial[];
|
|
34
|
+
apiNodes: N8nNodeFragment[];
|
|
35
|
+
capabilities: N8nNativeCapability[];
|
|
36
|
+
}
|
|
37
|
+
export type CompileNativeWorkflowNodesInput = Pick<CompilePlannedN8nWorkflowInput, 'plan' | 'apiNodes' | 'capabilities' | 'materials'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { NodeInstance } from '@n8n/workflow-sdk';
|
|
2
|
+
import type { ApiOperationContract, ApiCallArguments } from '@openapi-flow/core';
|
|
3
|
+
import type { HttpRequestDeploymentOptions, ResolvedHttpRequestDeployment } from './request-deployment.js';
|
|
4
|
+
import type { N8nNativeOutputSource, N8nOutputBindingSource } from './output-binding-source.js';
|
|
5
|
+
export type N8nSdkNode = NodeInstance<string, string, unknown>;
|
|
6
|
+
export interface N8nFragmentEdge {
|
|
7
|
+
from: string;
|
|
8
|
+
output: number;
|
|
9
|
+
to: string;
|
|
10
|
+
input: number;
|
|
11
|
+
}
|
|
12
|
+
export interface N8nFragmentInputEndpoint {
|
|
13
|
+
nodeId: string;
|
|
14
|
+
input: number;
|
|
15
|
+
}
|
|
16
|
+
export interface N8nItemAncestryJoin {
|
|
17
|
+
/** One output per shared scope ancestor, retaining every contributing link. */
|
|
18
|
+
scopeNodeId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface N8nNodeFragment {
|
|
21
|
+
nodeId: string;
|
|
22
|
+
/** Compiler-owned contract: one linked output per input, or an execution error. */
|
|
23
|
+
preservesInputItems?: boolean;
|
|
24
|
+
/** Compiler-owned reduction of complete branches, not a positional or value join. */
|
|
25
|
+
joinsInputItemsByAncestry?: N8nItemAncestryJoin;
|
|
26
|
+
/** Exactly one linked item across the declared mutually exclusive output ports. */
|
|
27
|
+
partitionsInputItems?: boolean;
|
|
28
|
+
/** Append complete alternatives from the named partition producer. */
|
|
29
|
+
rejoinsExclusiveOutputs?: string;
|
|
30
|
+
nodes: N8nSdkNode[];
|
|
31
|
+
entry: N8nSdkNode;
|
|
32
|
+
exit: N8nSdkNode;
|
|
33
|
+
inputPorts: Record<string, number>;
|
|
34
|
+
/** Explicit per-port SDK entry nodes for fragments with independent input readers. */
|
|
35
|
+
inputEndpoints?: Record<string, N8nFragmentInputEndpoint>;
|
|
36
|
+
outputPorts: Record<string, number>;
|
|
37
|
+
internalEdges?: N8nFragmentEdge[];
|
|
38
|
+
bindingSources?: N8nOutputBindingSource[];
|
|
39
|
+
}
|
|
40
|
+
export interface CreateHttpRequestNodeInput extends HttpRequestDeploymentOptions {
|
|
41
|
+
operation: ApiOperationContract;
|
|
42
|
+
arguments: ApiCallArguments;
|
|
43
|
+
position: [number, number];
|
|
44
|
+
apiNodeNames?: Record<string, string>;
|
|
45
|
+
nativeOutputSources?: N8nNativeOutputSource[];
|
|
46
|
+
/** Linked mode uses n8n ancestry, never index-zipping independent source arrays. */
|
|
47
|
+
itemMode?: 'linked';
|
|
48
|
+
/** When supplied, every referenced API must have its original response contract. */
|
|
49
|
+
apiResponseContracts?: Record<string, ApiOperationContract>;
|
|
50
|
+
}
|
|
51
|
+
export type CreateBoundHttpRequestNodeInput = CreateHttpRequestNodeInput & ResolvedHttpRequestDeployment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { NativeOutputContract } from '@openapi-flow/core';
|
|
2
|
+
import type { PlannedNativeNode } from '@openapi-flow/core';
|
|
3
|
+
import type { N8nNativeCapability } from './native-capability.js';
|
|
4
|
+
import type { ApiOperationContract } from '@openapi-flow/core';
|
|
5
|
+
export interface N8nNativeOutputSource extends NativeOutputContract {
|
|
6
|
+
nodeName: string;
|
|
7
|
+
}
|
|
8
|
+
export interface N8nApiResponseSource {
|
|
9
|
+
kind: 'api-response';
|
|
10
|
+
nodeId: string;
|
|
11
|
+
nodeName: string;
|
|
12
|
+
operation?: ApiOperationContract;
|
|
13
|
+
}
|
|
14
|
+
export interface N8nNativeJsonSource extends N8nNativeOutputSource {
|
|
15
|
+
kind: 'native-json';
|
|
16
|
+
}
|
|
17
|
+
export type N8nOutputBindingSource = N8nApiResponseSource | N8nNativeJsonSource;
|
|
18
|
+
export interface CreateN8nNativeOutputSourcesInput {
|
|
19
|
+
nativeNodes: PlannedNativeNode[];
|
|
20
|
+
capabilities: N8nNativeCapability[];
|
|
21
|
+
apiNodeNames: Record<string, string>;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|