@atom8n/api-types 1.4.3 → 1.5.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.
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { Z } from 'zod-class';
3
+ declare const GetNodeTypesByIdentifierRequestDto_base: Z.Class<{
4
+ identifiers: z.ZodArray<z.ZodString, "many">;
5
+ }>;
6
+ export declare class GetNodeTypesByIdentifierRequestDto extends GetNodeTypesByIdentifierRequestDto_base {
7
+ }
8
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetNodeTypesByIdentifierRequestDto = void 0;
4
+ const zod_1 = require("zod");
5
+ const zod_class_1 = require("zod-class");
6
+ const nodeTypeIdentifierSchema = zod_1.z
7
+ .string()
8
+ .regex(/^[\w.-]+@\d+(\.\d+)?(\.\d+)?$/, 'Invalid node type identifier format. Expected "name@version"');
9
+ class GetNodeTypesByIdentifierRequestDto extends zod_class_1.Z.class({
10
+ identifiers: zod_1.z.array(nodeTypeIdentifierSchema).min(1).max(1000),
11
+ }) {
12
+ }
13
+ exports.GetNodeTypesByIdentifierRequestDto = GetNodeTypesByIdentifierRequestDto;
@@ -0,0 +1,5 @@
1
+ export interface GitCommitInfo {
2
+ hash: string;
3
+ message: string;
4
+ branch: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,50 @@
1
+ import type { IPinData, IConnections, IDataObject, INode, IWorkflowSettings } from 'n8n-workflow';
2
+ import { z } from 'zod';
3
+ export declare const WORKFLOW_NAME_MAX_LENGTH = 128;
4
+ export declare const workflowNameSchema: z.ZodString;
5
+ export declare const workflowDescriptionSchema: z.ZodNullable<z.ZodString>;
6
+ export declare const workflowNodesSchema: z.ZodType<INode[], z.ZodTypeDef, INode[]>;
7
+ export declare const workflowConnectionsSchema: z.ZodType<IConnections, z.ZodTypeDef, IConnections>;
8
+ export declare const workflowSettingsSchema: z.ZodType<IWorkflowSettings, z.ZodTypeDef, IWorkflowSettings>;
9
+ export declare const workflowStaticDataSchema: z.ZodEffects<z.ZodType<IDataObject | null, z.ZodTypeDef, IDataObject | null>, IDataObject | null, unknown>;
10
+ export declare const workflowPinDataSchema: z.ZodType<IPinData | null, z.ZodTypeDef, IPinData | null>;
11
+ export declare const workflowMetaSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
12
+ export declare const baseWorkflowShape: {
13
+ readonly name: z.ZodString;
14
+ readonly description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ readonly nodes: z.ZodType<INode[], z.ZodTypeDef, INode[]>;
16
+ readonly connections: z.ZodType<IConnections, z.ZodTypeDef, IConnections>;
17
+ readonly settings: z.ZodOptional<z.ZodType<IWorkflowSettings, z.ZodTypeDef, IWorkflowSettings>>;
18
+ readonly staticData: z.ZodOptional<z.ZodEffects<z.ZodType<IDataObject | null, z.ZodTypeDef, IDataObject | null>, IDataObject | null, unknown>>;
19
+ readonly meta: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
20
+ readonly pinData: z.ZodOptional<z.ZodType<IPinData | null, z.ZodTypeDef, IPinData | null>>;
21
+ readonly hash: z.ZodOptional<z.ZodString>;
22
+ readonly parentFolderId: z.ZodOptional<z.ZodString>;
23
+ readonly parentFolder: z.ZodOptional<z.ZodNullable<z.ZodObject<{
24
+ id: z.ZodString;
25
+ name: z.ZodString;
26
+ }, "strip", z.ZodTypeAny, {
27
+ id: string;
28
+ name: string;
29
+ }, {
30
+ id: string;
31
+ name: string;
32
+ }>>>;
33
+ readonly tags: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{
34
+ id: z.ZodString;
35
+ name: z.ZodString;
36
+ }, "strip", z.ZodTypeAny, {
37
+ id: string;
38
+ name: string;
39
+ }, {
40
+ id: string;
41
+ name: string;
42
+ }>, "many">]>, string[], string[] | {
43
+ id: string;
44
+ name: string;
45
+ }[]>>;
46
+ readonly uiContext: z.ZodOptional<z.ZodString>;
47
+ readonly aiBuilderAssisted: z.ZodOptional<z.ZodBoolean>;
48
+ readonly expectedChecksum: z.ZodOptional<z.ZodString>;
49
+ readonly autosaved: z.ZodOptional<z.ZodBoolean>;
50
+ };
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ 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;
4
+ const zod_1 = require("zod");
5
+ exports.WORKFLOW_NAME_MAX_LENGTH = 128;
6
+ exports.workflowNameSchema = zod_1.z
7
+ .string()
8
+ .min(1, { message: 'Workflow name is required' })
9
+ .max(exports.WORKFLOW_NAME_MAX_LENGTH, {
10
+ message: `Workflow name must be ${exports.WORKFLOW_NAME_MAX_LENGTH} characters or less`,
11
+ });
12
+ exports.workflowDescriptionSchema = zod_1.z.string().nullable();
13
+ exports.workflowNodesSchema = zod_1.z.custom((val) => Array.isArray(val), {
14
+ message: 'Nodes must be an array',
15
+ });
16
+ exports.workflowConnectionsSchema = zod_1.z.custom((val) => typeof val === 'object' && val !== null && !Array.isArray(val), {
17
+ message: 'Connections must be an object',
18
+ });
19
+ exports.workflowSettingsSchema = zod_1.z.custom((val) => val === null || (typeof val === 'object' && val !== null && !Array.isArray(val)), {
20
+ message: 'Settings must be an object or null',
21
+ });
22
+ exports.workflowStaticDataSchema = zod_1.z.preprocess((val) => {
23
+ if (typeof val === 'string') {
24
+ try {
25
+ return JSON.parse(val);
26
+ }
27
+ catch {
28
+ throw new Error('Static data string must be valid JSON');
29
+ }
30
+ }
31
+ return val;
32
+ }, zod_1.z.custom((val) => val === null || (typeof val === 'object' && val !== null && !Array.isArray(val)), {
33
+ message: 'Static data must be an object or null',
34
+ }));
35
+ exports.workflowPinDataSchema = zod_1.z.custom((val) => val === null || (typeof val === 'object' && val !== null && !Array.isArray(val)), {
36
+ message: 'Pin data must be an object or null',
37
+ });
38
+ exports.workflowMetaSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable();
39
+ exports.baseWorkflowShape = {
40
+ name: exports.workflowNameSchema,
41
+ description: exports.workflowDescriptionSchema.optional(),
42
+ nodes: exports.workflowNodesSchema,
43
+ connections: exports.workflowConnectionsSchema,
44
+ settings: exports.workflowSettingsSchema.optional(),
45
+ staticData: exports.workflowStaticDataSchema.optional(),
46
+ meta: exports.workflowMetaSchema.optional(),
47
+ pinData: exports.workflowPinDataSchema.optional(),
48
+ hash: zod_1.z.string().optional(),
49
+ parentFolderId: zod_1.z.string().optional(),
50
+ parentFolder: zod_1.z.object({ id: zod_1.z.string(), name: zod_1.z.string() }).nullable().optional(),
51
+ tags: zod_1.z
52
+ .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() }))])
53
+ .transform((val) => {
54
+ if (val.length > 0 && typeof val[0] === 'object' && 'id' in val[0]) {
55
+ return val.map((tag) => tag.id);
56
+ }
57
+ return val;
58
+ })
59
+ .optional(),
60
+ uiContext: zod_1.z.string().optional(),
61
+ aiBuilderAssisted: zod_1.z.boolean().optional(),
62
+ expectedChecksum: zod_1.z.string().optional(),
63
+ autosaved: zod_1.z.boolean().optional(),
64
+ };
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ import { Z } from 'zod-class';
3
+ export declare const workflowIdSchema: z.ZodString;
4
+ declare const CreateWorkflowDto_base: Z.Class<{
5
+ id: z.ZodOptional<z.ZodString>;
6
+ projectId: z.ZodOptional<z.ZodString>;
7
+ name: z.ZodString;
8
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ nodes: z.ZodType<import("n8n-workflow").INode[], z.ZodTypeDef, import("n8n-workflow").INode[]>;
10
+ connections: z.ZodType<import("n8n-workflow").IConnections, z.ZodTypeDef, import("n8n-workflow").IConnections>;
11
+ settings: z.ZodOptional<z.ZodType<import("n8n-workflow").IWorkflowSettings, z.ZodTypeDef, import("n8n-workflow").IWorkflowSettings>>;
12
+ 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>>;
13
+ meta: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
14
+ pinData: z.ZodOptional<z.ZodType<import("n8n-workflow").IPinData | null, z.ZodTypeDef, import("n8n-workflow").IPinData | null>>;
15
+ hash: z.ZodOptional<z.ZodString>;
16
+ parentFolderId: z.ZodOptional<z.ZodString>;
17
+ parentFolder: z.ZodOptional<z.ZodNullable<z.ZodObject<{
18
+ id: z.ZodString;
19
+ name: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ id: string;
22
+ name: string;
23
+ }, {
24
+ id: string;
25
+ name: string;
26
+ }>>>;
27
+ tags: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{
28
+ id: z.ZodString;
29
+ name: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ id: string;
32
+ name: string;
33
+ }, {
34
+ id: string;
35
+ name: string;
36
+ }>, "many">]>, string[], string[] | {
37
+ id: string;
38
+ name: string;
39
+ }[]>>;
40
+ uiContext: z.ZodOptional<z.ZodString>;
41
+ aiBuilderAssisted: z.ZodOptional<z.ZodBoolean>;
42
+ expectedChecksum: z.ZodOptional<z.ZodString>;
43
+ autosaved: z.ZodOptional<z.ZodBoolean>;
44
+ }>;
45
+ export declare class CreateWorkflowDto extends CreateWorkflowDto_base {
46
+ }
47
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateWorkflowDto = exports.workflowIdSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const zod_class_1 = require("zod-class");
6
+ const base_workflow_dto_1 = require("./base-workflow.dto");
7
+ exports.workflowIdSchema = zod_1.z.string();
8
+ class CreateWorkflowDto extends zod_class_1.Z.class({
9
+ ...base_workflow_dto_1.baseWorkflowShape,
10
+ id: exports.workflowIdSchema.optional(),
11
+ projectId: zod_1.z.string().optional(),
12
+ }) {
13
+ }
14
+ exports.CreateWorkflowDto = CreateWorkflowDto;
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ import { Z } from 'zod-class';
3
+ declare const UpdateWorkflowDto_base: Z.Class<{
4
+ readonly name: z.ZodOptional<z.ZodString>;
5
+ readonly description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
6
+ readonly nodes: z.ZodOptional<z.ZodType<import("n8n-workflow").INode[], z.ZodTypeDef, import("n8n-workflow").INode[]>>;
7
+ readonly connections: z.ZodOptional<z.ZodType<import("n8n-workflow").IConnections, z.ZodTypeDef, import("n8n-workflow").IConnections>>;
8
+ readonly settings: z.ZodOptional<z.ZodOptional<z.ZodType<import("n8n-workflow").IWorkflowSettings, z.ZodTypeDef, import("n8n-workflow").IWorkflowSettings>>>;
9
+ 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>>>;
10
+ readonly meta: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
11
+ readonly pinData: z.ZodOptional<z.ZodOptional<z.ZodType<import("n8n-workflow").IPinData | null, z.ZodTypeDef, import("n8n-workflow").IPinData | null>>>;
12
+ readonly hash: z.ZodOptional<z.ZodOptional<z.ZodString>>;
13
+ readonly parentFolderId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
14
+ readonly parentFolder: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
15
+ id: z.ZodString;
16
+ name: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ id: string;
19
+ name: string;
20
+ }, {
21
+ id: string;
22
+ name: string;
23
+ }>>>>;
24
+ readonly tags: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{
25
+ id: z.ZodString;
26
+ name: z.ZodString;
27
+ }, "strip", z.ZodTypeAny, {
28
+ id: string;
29
+ name: string;
30
+ }, {
31
+ id: string;
32
+ name: string;
33
+ }>, "many">]>, string[], string[] | {
34
+ id: string;
35
+ name: string;
36
+ }[]>>>;
37
+ readonly uiContext: z.ZodOptional<z.ZodOptional<z.ZodString>>;
38
+ readonly aiBuilderAssisted: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
39
+ readonly expectedChecksum: z.ZodOptional<z.ZodOptional<z.ZodString>>;
40
+ readonly autosaved: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
41
+ }>;
42
+ export declare class UpdateWorkflowDto extends UpdateWorkflowDto_base {
43
+ }
44
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateWorkflowDto = void 0;
4
+ const zod_1 = require("zod");
5
+ const zod_class_1 = require("zod-class");
6
+ const base_workflow_dto_1 = require("./base-workflow.dto");
7
+ class UpdateWorkflowDto extends zod_class_1.Z.class(zod_1.z.object(base_workflow_dto_1.baseWorkflowShape).partial().shape) {
8
+ }
9
+ exports.UpdateWorkflowDto = UpdateWorkflowDto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atom8n/api-types",
3
- "version": "1.4.3",
3
+ "version": "1.5.0",
4
4
  "scripts": {
5
5
  "clean": "rimraf dist .turbo",
6
6
  "dev": "pnpm watch",
@@ -22,14 +22,14 @@
22
22
  "dist/**/*"
23
23
  ],
24
24
  "devDependencies": {
25
- "@n8n/typescript-config": "npm:@atom8n/typescript-config@1.5.3",
26
- "@n8n/config": "npm:@atom8n/config@2.3.3"
25
+ "@n8n/typescript-config": "npm:@atom8n/typescript-config@1.6.0",
26
+ "@n8n/config": "npm:@atom8n/config@2.4.0"
27
27
  },
28
28
  "dependencies": {
29
- "n8n-workflow": "npm:@atom8n/n8n-workflow@2.4.3",
29
+ "n8n-workflow": "npm:@atom8n/n8n-workflow@2.5.0",
30
30
  "xss": "1.0.15",
31
31
  "zod": "3.25.67",
32
32
  "zod-class": "0.0.16",
33
- "@n8n/permissions": "npm:@atom8n/permissions@0.47.3"
33
+ "@n8n/permissions": "npm:@atom8n/permissions@0.48.0"
34
34
  }
35
35
  }