@atom8n/api-types
Advanced tools
| import { z } from 'zod'; | ||
| import { Z } from 'zod-class'; | ||
| declare const GetNodeTypesByIdentifierRequestDto_base: Z.Class<{ | ||
| identifiers: z.ZodArray<z.ZodString, "many">; | ||
| }>; | ||
| export declare class GetNodeTypesByIdentifierRequestDto extends GetNodeTypesByIdentifierRequestDto_base { | ||
| } | ||
| export {}; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.GetNodeTypesByIdentifierRequestDto = void 0; | ||
| const zod_1 = require("zod"); | ||
| const zod_class_1 = require("zod-class"); | ||
| const nodeTypeIdentifierSchema = zod_1.z | ||
| .string() | ||
| .regex(/^[\w.-]+@\d+(\.\d+)?(\.\d+)?$/, 'Invalid node type identifier format. Expected "name@version"'); | ||
| class GetNodeTypesByIdentifierRequestDto extends zod_class_1.Z.class({ | ||
| identifiers: zod_1.z.array(nodeTypeIdentifierSchema).min(1).max(1000), | ||
| }) { | ||
| } | ||
| exports.GetNodeTypesByIdentifierRequestDto = GetNodeTypesByIdentifierRequestDto; |
| export interface GitCommitInfo { | ||
| hash: string; | ||
| message: string; | ||
| branch: string; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); |
| import type { IPinData, IConnections, IDataObject, INode, IWorkflowSettings } from 'n8n-workflow'; | ||
| import { z } from 'zod'; | ||
| export declare const WORKFLOW_NAME_MAX_LENGTH = 128; | ||
| export declare const workflowNameSchema: z.ZodString; | ||
| export declare const workflowDescriptionSchema: z.ZodNullable<z.ZodString>; | ||
| export declare const workflowNodesSchema: z.ZodType<INode[], z.ZodTypeDef, INode[]>; | ||
| export declare const workflowConnectionsSchema: z.ZodType<IConnections, z.ZodTypeDef, IConnections>; | ||
| export declare const workflowSettingsSchema: z.ZodType<IWorkflowSettings, z.ZodTypeDef, IWorkflowSettings>; | ||
| export declare const workflowStaticDataSchema: z.ZodEffects<z.ZodType<IDataObject | null, z.ZodTypeDef, IDataObject | null>, IDataObject | null, unknown>; | ||
| export declare const workflowPinDataSchema: z.ZodType<IPinData | null, z.ZodTypeDef, IPinData | null>; | ||
| export declare const workflowMetaSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>; | ||
| export declare const baseWorkflowShape: { | ||
| readonly name: z.ZodString; | ||
| readonly description: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
| readonly nodes: z.ZodType<INode[], z.ZodTypeDef, INode[]>; | ||
| readonly connections: z.ZodType<IConnections, z.ZodTypeDef, IConnections>; | ||
| readonly settings: z.ZodOptional<z.ZodType<IWorkflowSettings, z.ZodTypeDef, IWorkflowSettings>>; | ||
| readonly staticData: z.ZodOptional<z.ZodEffects<z.ZodType<IDataObject | null, z.ZodTypeDef, IDataObject | null>, IDataObject | null, unknown>>; | ||
| readonly meta: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>; | ||
| readonly pinData: z.ZodOptional<z.ZodType<IPinData | null, z.ZodTypeDef, IPinData | null>>; | ||
| readonly hash: z.ZodOptional<z.ZodString>; | ||
| readonly parentFolderId: z.ZodOptional<z.ZodString>; | ||
| readonly parentFolder: z.ZodOptional<z.ZodNullable<z.ZodObject<{ | ||
| id: z.ZodString; | ||
| name: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| name: string; | ||
| }, { | ||
| id: string; | ||
| name: string; | ||
| }>>>; | ||
| readonly tags: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{ | ||
| id: z.ZodString; | ||
| name: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| name: string; | ||
| }, { | ||
| id: string; | ||
| name: string; | ||
| }>, "many">]>, string[], string[] | { | ||
| id: string; | ||
| name: string; | ||
| }[]>>; | ||
| readonly uiContext: z.ZodOptional<z.ZodString>; | ||
| readonly aiBuilderAssisted: z.ZodOptional<z.ZodBoolean>; | ||
| readonly expectedChecksum: z.ZodOptional<z.ZodString>; | ||
| readonly autosaved: z.ZodOptional<z.ZodBoolean>; | ||
| }; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.baseWorkflowShape = exports.workflowMetaSchema = exports.workflowPinDataSchema = exports.workflowStaticDataSchema = exports.workflowSettingsSchema = exports.workflowConnectionsSchema = exports.workflowNodesSchema = exports.workflowDescriptionSchema = exports.workflowNameSchema = exports.WORKFLOW_NAME_MAX_LENGTH = void 0; | ||
| const zod_1 = require("zod"); | ||
| exports.WORKFLOW_NAME_MAX_LENGTH = 128; | ||
| exports.workflowNameSchema = zod_1.z | ||
| .string() | ||
| .min(1, { message: 'Workflow name is required' }) | ||
| .max(exports.WORKFLOW_NAME_MAX_LENGTH, { | ||
| message: `Workflow name must be ${exports.WORKFLOW_NAME_MAX_LENGTH} characters or less`, | ||
| }); | ||
| exports.workflowDescriptionSchema = zod_1.z.string().nullable(); | ||
| exports.workflowNodesSchema = zod_1.z.custom((val) => Array.isArray(val), { | ||
| message: 'Nodes must be an array', | ||
| }); | ||
| exports.workflowConnectionsSchema = zod_1.z.custom((val) => typeof val === 'object' && val !== null && !Array.isArray(val), { | ||
| message: 'Connections must be an object', | ||
| }); | ||
| exports.workflowSettingsSchema = zod_1.z.custom((val) => val === null || (typeof val === 'object' && val !== null && !Array.isArray(val)), { | ||
| message: 'Settings must be an object or null', | ||
| }); | ||
| exports.workflowStaticDataSchema = zod_1.z.preprocess((val) => { | ||
| if (typeof val === 'string') { | ||
| try { | ||
| return JSON.parse(val); | ||
| } | ||
| catch { | ||
| throw new Error('Static data string must be valid JSON'); | ||
| } | ||
| } | ||
| return val; | ||
| }, zod_1.z.custom((val) => val === null || (typeof val === 'object' && val !== null && !Array.isArray(val)), { | ||
| message: 'Static data must be an object or null', | ||
| })); | ||
| exports.workflowPinDataSchema = zod_1.z.custom((val) => val === null || (typeof val === 'object' && val !== null && !Array.isArray(val)), { | ||
| message: 'Pin data must be an object or null', | ||
| }); | ||
| exports.workflowMetaSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable(); | ||
| exports.baseWorkflowShape = { | ||
| name: exports.workflowNameSchema, | ||
| description: exports.workflowDescriptionSchema.optional(), | ||
| nodes: exports.workflowNodesSchema, | ||
| connections: exports.workflowConnectionsSchema, | ||
| settings: exports.workflowSettingsSchema.optional(), | ||
| staticData: exports.workflowStaticDataSchema.optional(), | ||
| meta: exports.workflowMetaSchema.optional(), | ||
| pinData: exports.workflowPinDataSchema.optional(), | ||
| hash: zod_1.z.string().optional(), | ||
| parentFolderId: zod_1.z.string().optional(), | ||
| parentFolder: zod_1.z.object({ id: zod_1.z.string(), name: zod_1.z.string() }).nullable().optional(), | ||
| tags: zod_1.z | ||
| .union([zod_1.z.array(zod_1.z.string()), zod_1.z.array(zod_1.z.object({ id: zod_1.z.string(), name: zod_1.z.string() }))]) | ||
| .transform((val) => { | ||
| if (val.length > 0 && typeof val[0] === 'object' && 'id' in val[0]) { | ||
| return val.map((tag) => tag.id); | ||
| } | ||
| return val; | ||
| }) | ||
| .optional(), | ||
| uiContext: zod_1.z.string().optional(), | ||
| aiBuilderAssisted: zod_1.z.boolean().optional(), | ||
| expectedChecksum: zod_1.z.string().optional(), | ||
| autosaved: zod_1.z.boolean().optional(), | ||
| }; |
| import { z } from 'zod'; | ||
| import { Z } from 'zod-class'; | ||
| export declare const workflowIdSchema: z.ZodString; | ||
| declare const CreateWorkflowDto_base: Z.Class<{ | ||
| id: z.ZodOptional<z.ZodString>; | ||
| projectId: z.ZodOptional<z.ZodString>; | ||
| name: z.ZodString; | ||
| description: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
| nodes: z.ZodType<import("n8n-workflow").INode[], z.ZodTypeDef, import("n8n-workflow").INode[]>; | ||
| connections: z.ZodType<import("n8n-workflow").IConnections, z.ZodTypeDef, import("n8n-workflow").IConnections>; | ||
| settings: z.ZodOptional<z.ZodType<import("n8n-workflow").IWorkflowSettings, z.ZodTypeDef, import("n8n-workflow").IWorkflowSettings>>; | ||
| staticData: z.ZodOptional<z.ZodEffects<z.ZodType<import("n8n-workflow").IDataObject | null, z.ZodTypeDef, import("n8n-workflow").IDataObject | null>, import("n8n-workflow").IDataObject | null, unknown>>; | ||
| meta: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>; | ||
| pinData: z.ZodOptional<z.ZodType<import("n8n-workflow").IPinData | null, z.ZodTypeDef, import("n8n-workflow").IPinData | null>>; | ||
| hash: z.ZodOptional<z.ZodString>; | ||
| parentFolderId: z.ZodOptional<z.ZodString>; | ||
| parentFolder: z.ZodOptional<z.ZodNullable<z.ZodObject<{ | ||
| id: z.ZodString; | ||
| name: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| name: string; | ||
| }, { | ||
| id: string; | ||
| name: string; | ||
| }>>>; | ||
| tags: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{ | ||
| id: z.ZodString; | ||
| name: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| name: string; | ||
| }, { | ||
| id: string; | ||
| name: string; | ||
| }>, "many">]>, string[], string[] | { | ||
| id: string; | ||
| name: string; | ||
| }[]>>; | ||
| uiContext: z.ZodOptional<z.ZodString>; | ||
| aiBuilderAssisted: z.ZodOptional<z.ZodBoolean>; | ||
| expectedChecksum: z.ZodOptional<z.ZodString>; | ||
| autosaved: z.ZodOptional<z.ZodBoolean>; | ||
| }>; | ||
| export declare class CreateWorkflowDto extends CreateWorkflowDto_base { | ||
| } | ||
| export {}; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.CreateWorkflowDto = exports.workflowIdSchema = void 0; | ||
| const zod_1 = require("zod"); | ||
| const zod_class_1 = require("zod-class"); | ||
| const base_workflow_dto_1 = require("./base-workflow.dto"); | ||
| exports.workflowIdSchema = zod_1.z.string(); | ||
| class CreateWorkflowDto extends zod_class_1.Z.class({ | ||
| ...base_workflow_dto_1.baseWorkflowShape, | ||
| id: exports.workflowIdSchema.optional(), | ||
| projectId: zod_1.z.string().optional(), | ||
| }) { | ||
| } | ||
| exports.CreateWorkflowDto = CreateWorkflowDto; |
| import { z } from 'zod'; | ||
| import { Z } from 'zod-class'; | ||
| declare const UpdateWorkflowDto_base: Z.Class<{ | ||
| readonly name: z.ZodOptional<z.ZodString>; | ||
| readonly description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>; | ||
| readonly nodes: z.ZodOptional<z.ZodType<import("n8n-workflow").INode[], z.ZodTypeDef, import("n8n-workflow").INode[]>>; | ||
| readonly connections: z.ZodOptional<z.ZodType<import("n8n-workflow").IConnections, z.ZodTypeDef, import("n8n-workflow").IConnections>>; | ||
| readonly settings: z.ZodOptional<z.ZodOptional<z.ZodType<import("n8n-workflow").IWorkflowSettings, z.ZodTypeDef, import("n8n-workflow").IWorkflowSettings>>>; | ||
| readonly staticData: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodType<import("n8n-workflow").IDataObject | null, z.ZodTypeDef, import("n8n-workflow").IDataObject | null>, import("n8n-workflow").IDataObject | null, unknown>>>; | ||
| readonly meta: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>; | ||
| readonly pinData: z.ZodOptional<z.ZodOptional<z.ZodType<import("n8n-workflow").IPinData | null, z.ZodTypeDef, import("n8n-workflow").IPinData | null>>>; | ||
| readonly hash: z.ZodOptional<z.ZodOptional<z.ZodString>>; | ||
| readonly parentFolderId: z.ZodOptional<z.ZodOptional<z.ZodString>>; | ||
| readonly parentFolder: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{ | ||
| id: z.ZodString; | ||
| name: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| name: string; | ||
| }, { | ||
| id: string; | ||
| name: string; | ||
| }>>>>; | ||
| readonly tags: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{ | ||
| id: z.ZodString; | ||
| name: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| name: string; | ||
| }, { | ||
| id: string; | ||
| name: string; | ||
| }>, "many">]>, string[], string[] | { | ||
| id: string; | ||
| name: string; | ||
| }[]>>>; | ||
| readonly uiContext: z.ZodOptional<z.ZodOptional<z.ZodString>>; | ||
| readonly aiBuilderAssisted: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>; | ||
| readonly expectedChecksum: z.ZodOptional<z.ZodOptional<z.ZodString>>; | ||
| readonly autosaved: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>; | ||
| }>; | ||
| export declare class UpdateWorkflowDto extends UpdateWorkflowDto_base { | ||
| } | ||
| export {}; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.UpdateWorkflowDto = void 0; | ||
| const zod_1 = require("zod"); | ||
| const zod_class_1 = require("zod-class"); | ||
| const base_workflow_dto_1 = require("./base-workflow.dto"); | ||
| class UpdateWorkflowDto extends zod_class_1.Z.class(zod_1.z.object(base_workflow_dto_1.baseWorkflowShape).partial().shape) { | ||
| } | ||
| exports.UpdateWorkflowDto = UpdateWorkflowDto; |
+5
-5
| { | ||
| "name": "@atom8n/api-types", | ||
| "version": "1.4.3", | ||
| "version": "1.5.0", | ||
| "scripts": { | ||
@@ -25,12 +25,12 @@ "clean": "rimraf dist .turbo", | ||
| "devDependencies": { | ||
| "@n8n/typescript-config": "npm:@atom8n/typescript-config@1.5.3", | ||
| "@n8n/config": "npm:@atom8n/config@2.3.3" | ||
| "@n8n/typescript-config": "npm:@atom8n/typescript-config@1.6.0", | ||
| "@n8n/config": "npm:@atom8n/config@2.4.0" | ||
| }, | ||
| "dependencies": { | ||
| "n8n-workflow": "npm:@atom8n/n8n-workflow@2.4.3", | ||
| "n8n-workflow": "npm:@atom8n/n8n-workflow@2.5.0", | ||
| "xss": "1.0.15", | ||
| "zod": "3.25.67", | ||
| "zod-class": "0.0.16", | ||
| "@n8n/permissions": "npm:@atom8n/permissions@0.47.3" | ||
| "@n8n/permissions": "npm:@atom8n/permissions@0.48.0" | ||
| } | ||
| } |
Sorry, the diff of this file is not supported yet
742923
1.69%391
2.62%9345
2.83%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed