@egose/n8n-client 0.1.1

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.
Files changed (118) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +202 -0
  3. package/README.md +400 -0
  4. package/chunk-3SBD4UJS.js +15 -0
  5. package/chunk-4AODYIOB.cjs +36 -0
  6. package/chunk-4FXZT5HT.js +27 -0
  7. package/chunk-5DYA4LAX.cjs +110 -0
  8. package/chunk-5FIB7YIT.js +24 -0
  9. package/chunk-5PHEDSSO.cjs +27 -0
  10. package/chunk-5SY4KM4Q.js +15 -0
  11. package/chunk-7B5DLJYY.cjs +30 -0
  12. package/chunk-BWLFUF76.js +36 -0
  13. package/chunk-CES6KIG5.cjs +36 -0
  14. package/chunk-CUO2M75Z.js +29 -0
  15. package/chunk-DJCG37LZ.js +32 -0
  16. package/chunk-DK5NLZ6U.js +110 -0
  17. package/chunk-DURH6QOX.js +30 -0
  18. package/chunk-FHAZIAHR.js +15 -0
  19. package/chunk-FZX275Y3.js +24 -0
  20. package/chunk-I7NGIQIM.cjs +51 -0
  21. package/chunk-JR7A75YV.js +15 -0
  22. package/chunk-M7GX3MEN.cjs +15 -0
  23. package/chunk-MNL65GQB.js +51 -0
  24. package/chunk-NAZ5MLBL.cjs +32 -0
  25. package/chunk-NM6A7DX4.cjs +15 -0
  26. package/chunk-NSCKTOQK.cjs +15 -0
  27. package/chunk-OOMGKLOT.cjs +24 -0
  28. package/chunk-QLAAM7TG.cjs +27 -0
  29. package/chunk-QYAIEIF5.js +36 -0
  30. package/chunk-RATHO5IW.cjs +15 -0
  31. package/chunk-SK4VCTMD.js +27 -0
  32. package/chunk-TCPZWXKM.js +54 -0
  33. package/chunk-TRHGCMFH.cjs +29 -0
  34. package/chunk-U7PGEXKS.cjs +36 -0
  35. package/chunk-YPK2BDPO.cjs +54 -0
  36. package/chunk-ZAZJHB3O.cjs +24 -0
  37. package/chunk-ZEQL5KU2.js +36 -0
  38. package/handles/audit.cjs +7 -0
  39. package/handles/audit.d.cts +11 -0
  40. package/handles/audit.d.ts +11 -0
  41. package/handles/audit.js +7 -0
  42. package/handles/community-package.cjs +7 -0
  43. package/handles/community-package.d.cts +17 -0
  44. package/handles/community-package.d.ts +17 -0
  45. package/handles/community-package.js +7 -0
  46. package/handles/credential.cjs +7 -0
  47. package/handles/credential.d.cts +18 -0
  48. package/handles/credential.d.ts +18 -0
  49. package/handles/credential.js +7 -0
  50. package/handles/data-table.cjs +7 -0
  51. package/handles/data-table.d.cts +38 -0
  52. package/handles/data-table.d.ts +38 -0
  53. package/handles/data-table.js +7 -0
  54. package/handles/discover.cjs +7 -0
  55. package/handles/discover.d.cts +15 -0
  56. package/handles/discover.d.ts +15 -0
  57. package/handles/discover.js +7 -0
  58. package/handles/execution.cjs +7 -0
  59. package/handles/execution.d.cts +29 -0
  60. package/handles/execution.d.ts +29 -0
  61. package/handles/execution.js +7 -0
  62. package/handles/folder.cjs +7 -0
  63. package/handles/folder.d.cts +23 -0
  64. package/handles/folder.d.ts +23 -0
  65. package/handles/folder.js +7 -0
  66. package/handles/insights.cjs +7 -0
  67. package/handles/insights.d.cts +15 -0
  68. package/handles/insights.d.ts +15 -0
  69. package/handles/insights.js +7 -0
  70. package/handles/n8n-package.cjs +7 -0
  71. package/handles/n8n-package.d.cts +18 -0
  72. package/handles/n8n-package.d.ts +18 -0
  73. package/handles/n8n-package.js +7 -0
  74. package/handles/project.cjs +7 -0
  75. package/handles/project.d.cts +25 -0
  76. package/handles/project.d.ts +25 -0
  77. package/handles/project.js +7 -0
  78. package/handles/source-control.cjs +7 -0
  79. package/handles/source-control.d.cts +11 -0
  80. package/handles/source-control.d.ts +11 -0
  81. package/handles/source-control.js +7 -0
  82. package/handles/tag.cjs +7 -0
  83. package/handles/tag.d.cts +19 -0
  84. package/handles/tag.d.ts +19 -0
  85. package/handles/tag.js +7 -0
  86. package/handles/user.cjs +7 -0
  87. package/handles/user.d.cts +21 -0
  88. package/handles/user.d.ts +21 -0
  89. package/handles/user.js +7 -0
  90. package/handles/variable.cjs +7 -0
  91. package/handles/variable.d.cts +17 -0
  92. package/handles/variable.d.ts +17 -0
  93. package/handles/variable.js +7 -0
  94. package/handles/workflow.cjs +7 -0
  95. package/handles/workflow.d.cts +35 -0
  96. package/handles/workflow.d.ts +35 -0
  97. package/handles/workflow.js +7 -0
  98. package/http-client.cjs +10 -0
  99. package/http-client.d.cts +43 -0
  100. package/http-client.d.ts +43 -0
  101. package/http-client.js +10 -0
  102. package/index.cjs +127 -0
  103. package/index.d.cts +58 -0
  104. package/index.d.ts +58 -0
  105. package/index.js +127 -0
  106. package/package.json +42 -0
  107. package/pagination.cjs +1 -0
  108. package/pagination.d.cts +11 -0
  109. package/pagination.d.ts +11 -0
  110. package/pagination.js +1 -0
  111. package/types.cjs +1 -0
  112. package/types.d.cts +578 -0
  113. package/types.d.ts +578 -0
  114. package/types.js +1 -0
  115. package/utils/retry.cjs +7 -0
  116. package/utils/retry.d.cts +3 -0
  117. package/utils/retry.d.ts +3 -0
  118. package/utils/retry.js +7 -0
@@ -0,0 +1,17 @@
1
+ import { HttpClient } from '../http-client.js';
2
+ import { VariableListResponse, VariableCreate } from '../types.js';
3
+ import { PaginationParams } from '../pagination.js';
4
+
5
+ declare class VariableHandle {
6
+ protected http: HttpClient;
7
+ constructor(http: HttpClient);
8
+ list(params?: PaginationParams & {
9
+ projectId?: string;
10
+ state?: 'empty';
11
+ }): Promise<VariableListResponse>;
12
+ create(data: VariableCreate): Promise<void>;
13
+ update(id: string, data: VariableCreate): Promise<void>;
14
+ delete(id: string): Promise<void>;
15
+ }
16
+
17
+ export { VariableHandle as default };
@@ -0,0 +1,7 @@
1
+ import {
2
+ VariableHandle
3
+ } from "../chunk-FZX275Y3.js";
4
+ export {
5
+ VariableHandle as default
6
+ };
7
+ //# sourceMappingURL=variable.js.map
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkI7NGIQIMcjs = require('../chunk-I7NGIQIM.cjs');
4
+
5
+
6
+ exports.default = _chunkI7NGIQIMcjs.WorkflowHandle;
7
+ //# sourceMappingURL=workflow.cjs.map
@@ -0,0 +1,35 @@
1
+ import { HttpClient } from '../http-client.cjs';
2
+ import { WorkflowListResponse, Workflow, WorkflowCreate, WorkflowUpdate, Tag, TagId, WorkflowVersion } from '../types.cjs';
3
+ import { PaginationParams } from '../pagination.cjs';
4
+
5
+ declare class WorkflowHandle {
6
+ protected http: HttpClient;
7
+ constructor(http: HttpClient);
8
+ list(params?: PaginationParams & {
9
+ active?: boolean;
10
+ tags?: string;
11
+ name?: string;
12
+ projectId?: string;
13
+ excludePinnedData?: boolean;
14
+ }): Promise<WorkflowListResponse>;
15
+ get(id: string, params?: {
16
+ excludePinnedData?: boolean;
17
+ }): Promise<Workflow>;
18
+ create(data: WorkflowCreate): Promise<Workflow>;
19
+ update(id: string, data: WorkflowUpdate): Promise<Workflow>;
20
+ delete(id: string): Promise<Workflow>;
21
+ activate(id: string, data?: {
22
+ versionId?: string;
23
+ name?: string;
24
+ description?: string;
25
+ }): Promise<Workflow>;
26
+ deactivate(id: string): Promise<Workflow>;
27
+ archive(id: string): Promise<Workflow>;
28
+ unarchive(id: string): Promise<Workflow>;
29
+ transfer(id: string, destinationProjectId: string): Promise<void>;
30
+ getTags(id: string): Promise<Tag[]>;
31
+ updateTags(id: string, tags: TagId[]): Promise<Tag[]>;
32
+ getVersion(id: string, versionId: string): Promise<WorkflowVersion>;
33
+ }
34
+
35
+ export { WorkflowHandle as default };
@@ -0,0 +1,35 @@
1
+ import { HttpClient } from '../http-client.js';
2
+ import { WorkflowListResponse, Workflow, WorkflowCreate, WorkflowUpdate, Tag, TagId, WorkflowVersion } from '../types.js';
3
+ import { PaginationParams } from '../pagination.js';
4
+
5
+ declare class WorkflowHandle {
6
+ protected http: HttpClient;
7
+ constructor(http: HttpClient);
8
+ list(params?: PaginationParams & {
9
+ active?: boolean;
10
+ tags?: string;
11
+ name?: string;
12
+ projectId?: string;
13
+ excludePinnedData?: boolean;
14
+ }): Promise<WorkflowListResponse>;
15
+ get(id: string, params?: {
16
+ excludePinnedData?: boolean;
17
+ }): Promise<Workflow>;
18
+ create(data: WorkflowCreate): Promise<Workflow>;
19
+ update(id: string, data: WorkflowUpdate): Promise<Workflow>;
20
+ delete(id: string): Promise<Workflow>;
21
+ activate(id: string, data?: {
22
+ versionId?: string;
23
+ name?: string;
24
+ description?: string;
25
+ }): Promise<Workflow>;
26
+ deactivate(id: string): Promise<Workflow>;
27
+ archive(id: string): Promise<Workflow>;
28
+ unarchive(id: string): Promise<Workflow>;
29
+ transfer(id: string, destinationProjectId: string): Promise<void>;
30
+ getTags(id: string): Promise<Tag[]>;
31
+ updateTags(id: string, tags: TagId[]): Promise<Tag[]>;
32
+ getVersion(id: string, versionId: string): Promise<WorkflowVersion>;
33
+ }
34
+
35
+ export { WorkflowHandle as default };
@@ -0,0 +1,7 @@
1
+ import {
2
+ WorkflowHandle
3
+ } from "../chunk-MNL65GQB.js";
4
+ export {
5
+ WorkflowHandle as default
6
+ };
7
+ //# sourceMappingURL=workflow.js.map
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunk5DYA4LAXcjs = require('./chunk-5DYA4LAX.cjs');
5
+ require('./chunk-7B5DLJYY.cjs');
6
+
7
+
8
+
9
+ exports.HttpClient = _chunk5DYA4LAXcjs.HttpClient; exports.HttpError = _chunk5DYA4LAXcjs.HttpError;
10
+ //# sourceMappingURL=http-client.cjs.map
@@ -0,0 +1,43 @@
1
+ import { N8nClientConfig } from './types.cjs';
2
+ import './pagination.cjs';
3
+
4
+ declare class HttpError extends Error {
5
+ status: number;
6
+ data: unknown;
7
+ constructor(status: number, message: string, data?: unknown);
8
+ }
9
+ interface RequestOptions {
10
+ method: string;
11
+ path: string;
12
+ body?: unknown;
13
+ query?: {
14
+ [key: string]: unknown;
15
+ };
16
+ headers?: Record<string, string>;
17
+ }
18
+ declare class HttpClient {
19
+ private baseUrl;
20
+ private apiKey?;
21
+ private bearerToken?;
22
+ constructor(config: N8nClientConfig);
23
+ private buildHeaders;
24
+ private parseResponseData;
25
+ request<T>(options: RequestOptions): Promise<T>;
26
+ get<T>(path: string, query?: {
27
+ [key: string]: unknown;
28
+ }, headers?: Record<string, string>): Promise<T>;
29
+ post<T>(path: string, body?: unknown, query?: {
30
+ [key: string]: unknown;
31
+ }, headers?: Record<string, string>): Promise<T>;
32
+ put<T>(path: string, body?: unknown, query?: {
33
+ [key: string]: unknown;
34
+ }, headers?: Record<string, string>): Promise<T>;
35
+ patch<T>(path: string, body?: unknown, query?: {
36
+ [key: string]: unknown;
37
+ }, headers?: Record<string, string>): Promise<T>;
38
+ delete<T>(path: string, query?: {
39
+ [key: string]: unknown;
40
+ }, headers?: Record<string, string>): Promise<T>;
41
+ }
42
+
43
+ export { HttpClient, HttpError, type RequestOptions };
@@ -0,0 +1,43 @@
1
+ import { N8nClientConfig } from './types.js';
2
+ import './pagination.js';
3
+
4
+ declare class HttpError extends Error {
5
+ status: number;
6
+ data: unknown;
7
+ constructor(status: number, message: string, data?: unknown);
8
+ }
9
+ interface RequestOptions {
10
+ method: string;
11
+ path: string;
12
+ body?: unknown;
13
+ query?: {
14
+ [key: string]: unknown;
15
+ };
16
+ headers?: Record<string, string>;
17
+ }
18
+ declare class HttpClient {
19
+ private baseUrl;
20
+ private apiKey?;
21
+ private bearerToken?;
22
+ constructor(config: N8nClientConfig);
23
+ private buildHeaders;
24
+ private parseResponseData;
25
+ request<T>(options: RequestOptions): Promise<T>;
26
+ get<T>(path: string, query?: {
27
+ [key: string]: unknown;
28
+ }, headers?: Record<string, string>): Promise<T>;
29
+ post<T>(path: string, body?: unknown, query?: {
30
+ [key: string]: unknown;
31
+ }, headers?: Record<string, string>): Promise<T>;
32
+ put<T>(path: string, body?: unknown, query?: {
33
+ [key: string]: unknown;
34
+ }, headers?: Record<string, string>): Promise<T>;
35
+ patch<T>(path: string, body?: unknown, query?: {
36
+ [key: string]: unknown;
37
+ }, headers?: Record<string, string>): Promise<T>;
38
+ delete<T>(path: string, query?: {
39
+ [key: string]: unknown;
40
+ }, headers?: Record<string, string>): Promise<T>;
41
+ }
42
+
43
+ export { HttpClient, HttpError, type RequestOptions };
package/http-client.js ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ HttpClient,
3
+ HttpError
4
+ } from "./chunk-DK5NLZ6U.js";
5
+ import "./chunk-DURH6QOX.js";
6
+ export {
7
+ HttpClient,
8
+ HttpError
9
+ };
10
+ //# sourceMappingURL=http-client.js.map
package/index.cjs ADDED
@@ -0,0 +1,127 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkQLAAM7TGcjs = require('./chunk-QLAAM7TG.cjs');
4
+
5
+
6
+ var _chunkZAZJHB3Ocjs = require('./chunk-ZAZJHB3O.cjs');
7
+
8
+
9
+ var _chunkI7NGIQIMcjs = require('./chunk-I7NGIQIM.cjs');
10
+
11
+
12
+ var _chunkRATHO5IWcjs = require('./chunk-RATHO5IW.cjs');
13
+
14
+
15
+ var _chunkU7PGEXKScjs = require('./chunk-U7PGEXKS.cjs');
16
+
17
+
18
+ var _chunkNAZ5MLBLcjs = require('./chunk-NAZ5MLBL.cjs');
19
+
20
+
21
+ var _chunkNSCKTOQKcjs = require('./chunk-NSCKTOQK.cjs');
22
+
23
+
24
+ var _chunkTRHGCMFHcjs = require('./chunk-TRHGCMFH.cjs');
25
+
26
+
27
+ var _chunk4AODYIOBcjs = require('./chunk-4AODYIOB.cjs');
28
+
29
+
30
+ var _chunkNM6A7DX4cjs = require('./chunk-NM6A7DX4.cjs');
31
+
32
+
33
+ var _chunk5PHEDSSOcjs = require('./chunk-5PHEDSSO.cjs');
34
+
35
+
36
+
37
+ var _chunk5DYA4LAXcjs = require('./chunk-5DYA4LAX.cjs');
38
+ require('./chunk-7B5DLJYY.cjs');
39
+
40
+
41
+ var _chunkM7GX3MENcjs = require('./chunk-M7GX3MEN.cjs');
42
+
43
+
44
+ var _chunkOOMGKLOTcjs = require('./chunk-OOMGKLOT.cjs');
45
+
46
+
47
+ var _chunkCES6KIG5cjs = require('./chunk-CES6KIG5.cjs');
48
+
49
+
50
+ var _chunkYPK2BDPOcjs = require('./chunk-YPK2BDPO.cjs');
51
+
52
+ // src/index.ts
53
+ var N8nClient = class {
54
+ #http;
55
+ constructor(config) {
56
+ this.#http = new (0, _chunk5DYA4LAXcjs.HttpClient)(config);
57
+ }
58
+ request(options) {
59
+ return this.#http.request(options);
60
+ }
61
+ get(path, query, headers) {
62
+ return this.#http.get(path, query, headers);
63
+ }
64
+ post(path, body, query, headers) {
65
+ return this.#http.post(path, body, query, headers);
66
+ }
67
+ put(path, body, query, headers) {
68
+ return this.#http.put(path, body, query, headers);
69
+ }
70
+ patch(path, body, query, headers) {
71
+ return this.#http.patch(path, body, query, headers);
72
+ }
73
+ delete(path, query, headers) {
74
+ return this.#http.delete(path, query, headers);
75
+ }
76
+ workflow() {
77
+ return new (0, _chunkI7NGIQIMcjs.WorkflowHandle)(this.#http);
78
+ }
79
+ execution() {
80
+ return new (0, _chunkU7PGEXKScjs.ExecutionHandle)(this.#http);
81
+ }
82
+ credential() {
83
+ return new (0, _chunkCES6KIG5cjs.CredentialHandle)(this.#http);
84
+ }
85
+ tag() {
86
+ return new (0, _chunk5PHEDSSOcjs.TagHandle)(this.#http);
87
+ }
88
+ user() {
89
+ return new (0, _chunkQLAAM7TGcjs.UserHandle)(this.#http);
90
+ }
91
+ variable() {
92
+ return new (0, _chunkZAZJHB3Ocjs.VariableHandle)(this.#http);
93
+ }
94
+ project() {
95
+ return new (0, _chunk4AODYIOBcjs.ProjectHandle)(this.#http);
96
+ }
97
+ dataTable() {
98
+ return new (0, _chunkYPK2BDPOcjs.DataTableHandle)(this.#http);
99
+ }
100
+ folder(projectId) {
101
+ return new (0, _chunkNAZ5MLBLcjs.FolderHandle)(this.#http, projectId);
102
+ }
103
+ communityPackage() {
104
+ return new (0, _chunkOOMGKLOTcjs.CommunityPackageHandle)(this.#http);
105
+ }
106
+ audit() {
107
+ return new (0, _chunkM7GX3MENcjs.AuditHandle)(this.#http);
108
+ }
109
+ insights() {
110
+ return new (0, _chunkNSCKTOQKcjs.InsightsHandle)(this.#http);
111
+ }
112
+ sourceControl() {
113
+ return new (0, _chunkNM6A7DX4cjs.SourceControlHandle)(this.#http);
114
+ }
115
+ discover() {
116
+ return new (0, _chunkRATHO5IWcjs.DiscoverHandle)(this.#http);
117
+ }
118
+ n8nPackage() {
119
+ return new (0, _chunkTRHGCMFHcjs.N8nPackageHandle)(this.#http);
120
+ }
121
+ };
122
+
123
+
124
+
125
+
126
+ exports.HttpClient = _chunk5DYA4LAXcjs.HttpClient; exports.HttpError = _chunk5DYA4LAXcjs.HttpError; exports.default = N8nClient;
127
+ //# sourceMappingURL=index.cjs.map
package/index.d.cts ADDED
@@ -0,0 +1,58 @@
1
+ import { RequestOptions } from './http-client.cjs';
2
+ export { HttpClient, HttpError } from './http-client.cjs';
3
+ import { N8nClientConfig } from './types.cjs';
4
+ export { ActiveVersion, Audit, AuditAdditionalOptions, AuditRequest, AuditRiskReport, AuditRiskSection, CommunityPackage, CreateColumnRequest, CreateDataTableRequest, Credential, CredentialCreate, CredentialListItem, CredentialListResponse, CredentialResponse, CredentialSharedItem, CredentialTestResponse, CredentialUpdate, DataTable, DataTableColumn, DataTableFilter, DataTableListResponse, DataTableRow, DataTableRowListResponse, DeleteRowsBooleanParams, DeleteRowsDataParams, DeleteRowsParams, DiscoverEndpoint, DiscoverFilter, DiscoverResource, DiscoverResponse, Execution, ExecutionListResponse, ExecutionMode, ExecutionStatus, ExportWorkflowsRequest, Folder, FolderCreate, FolderDetail, FolderListResponse, FolderUpdate, ImportPackageBindings, ImportPackageConflictError, ImportPackageResponse, ImportPackageUnprocessableError, ImportPackageWorkflow, InsertRowsAllRequest, InsertRowsCountRequest, InsertRowsIdsRequest, InsertRowsRequest, InsightsMetric, InsightsSummary, InstallCommunityPackageRequest, N8nApiError, Project, ProjectListResponse, ProjectMember, ProjectMemberListResponse, PullRequest, SharedWorkflow, SourceControlledFile, StopManyExecutionsRequest, StopManyExecutionsResponse, Tag, TagId, TagListResponse, UpdateColumnRequest, UpdateDataTableRequest, UpdateRowsBooleanRequest, UpdateRowsDataRequest, UpdateRowsRequest, UpsertRowBooleanRequest, UpsertRowDataRequest, UpsertRowRequest, User, UserCreate, UserCreateResponse, UserListResponse, Variable, VariableCreate, VariableListResponse, Workflow, WorkflowCreate, WorkflowListResponse, WorkflowNode, WorkflowSettings, WorkflowUpdate, WorkflowVersion } from './types.cjs';
5
+ import WorkflowHandle from './handles/workflow.cjs';
6
+ import ExecutionHandle from './handles/execution.cjs';
7
+ import CredentialHandle from './handles/credential.cjs';
8
+ import TagHandle from './handles/tag.cjs';
9
+ import UserHandle from './handles/user.cjs';
10
+ import VariableHandle from './handles/variable.cjs';
11
+ import ProjectHandle from './handles/project.cjs';
12
+ import DataTableHandle from './handles/data-table.cjs';
13
+ import FolderHandle from './handles/folder.cjs';
14
+ import CommunityPackageHandle from './handles/community-package.cjs';
15
+ import AuditHandle from './handles/audit.cjs';
16
+ import InsightsHandle from './handles/insights.cjs';
17
+ import SourceControlHandle from './handles/source-control.cjs';
18
+ import DiscoverHandle from './handles/discover.cjs';
19
+ import N8nPackageHandle from './handles/n8n-package.cjs';
20
+ export { PaginatedResponse, PaginationParams } from './pagination.cjs';
21
+
22
+ declare class N8nClient {
23
+ #private;
24
+ constructor(config: N8nClientConfig);
25
+ request<T>(options: RequestOptions): Promise<T>;
26
+ get<T>(path: string, query?: {
27
+ [key: string]: unknown;
28
+ }, headers?: Record<string, string>): Promise<T>;
29
+ post<T>(path: string, body?: unknown, query?: {
30
+ [key: string]: unknown;
31
+ }, headers?: Record<string, string>): Promise<T>;
32
+ put<T>(path: string, body?: unknown, query?: {
33
+ [key: string]: unknown;
34
+ }, headers?: Record<string, string>): Promise<T>;
35
+ patch<T>(path: string, body?: unknown, query?: {
36
+ [key: string]: unknown;
37
+ }, headers?: Record<string, string>): Promise<T>;
38
+ delete<T>(path: string, query?: {
39
+ [key: string]: unknown;
40
+ }, headers?: Record<string, string>): Promise<T>;
41
+ workflow(): WorkflowHandle;
42
+ execution(): ExecutionHandle;
43
+ credential(): CredentialHandle;
44
+ tag(): TagHandle;
45
+ user(): UserHandle;
46
+ variable(): VariableHandle;
47
+ project(): ProjectHandle;
48
+ dataTable(): DataTableHandle;
49
+ folder(projectId: string): FolderHandle;
50
+ communityPackage(): CommunityPackageHandle;
51
+ audit(): AuditHandle;
52
+ insights(): InsightsHandle;
53
+ sourceControl(): SourceControlHandle;
54
+ discover(): DiscoverHandle;
55
+ n8nPackage(): N8nPackageHandle;
56
+ }
57
+
58
+ export { N8nClientConfig, RequestOptions, N8nClient as default };
package/index.d.ts ADDED
@@ -0,0 +1,58 @@
1
+ import { RequestOptions } from './http-client.js';
2
+ export { HttpClient, HttpError } from './http-client.js';
3
+ import { N8nClientConfig } from './types.js';
4
+ export { ActiveVersion, Audit, AuditAdditionalOptions, AuditRequest, AuditRiskReport, AuditRiskSection, CommunityPackage, CreateColumnRequest, CreateDataTableRequest, Credential, CredentialCreate, CredentialListItem, CredentialListResponse, CredentialResponse, CredentialSharedItem, CredentialTestResponse, CredentialUpdate, DataTable, DataTableColumn, DataTableFilter, DataTableListResponse, DataTableRow, DataTableRowListResponse, DeleteRowsBooleanParams, DeleteRowsDataParams, DeleteRowsParams, DiscoverEndpoint, DiscoverFilter, DiscoverResource, DiscoverResponse, Execution, ExecutionListResponse, ExecutionMode, ExecutionStatus, ExportWorkflowsRequest, Folder, FolderCreate, FolderDetail, FolderListResponse, FolderUpdate, ImportPackageBindings, ImportPackageConflictError, ImportPackageResponse, ImportPackageUnprocessableError, ImportPackageWorkflow, InsertRowsAllRequest, InsertRowsCountRequest, InsertRowsIdsRequest, InsertRowsRequest, InsightsMetric, InsightsSummary, InstallCommunityPackageRequest, N8nApiError, Project, ProjectListResponse, ProjectMember, ProjectMemberListResponse, PullRequest, SharedWorkflow, SourceControlledFile, StopManyExecutionsRequest, StopManyExecutionsResponse, Tag, TagId, TagListResponse, UpdateColumnRequest, UpdateDataTableRequest, UpdateRowsBooleanRequest, UpdateRowsDataRequest, UpdateRowsRequest, UpsertRowBooleanRequest, UpsertRowDataRequest, UpsertRowRequest, User, UserCreate, UserCreateResponse, UserListResponse, Variable, VariableCreate, VariableListResponse, Workflow, WorkflowCreate, WorkflowListResponse, WorkflowNode, WorkflowSettings, WorkflowUpdate, WorkflowVersion } from './types.js';
5
+ import WorkflowHandle from './handles/workflow.js';
6
+ import ExecutionHandle from './handles/execution.js';
7
+ import CredentialHandle from './handles/credential.js';
8
+ import TagHandle from './handles/tag.js';
9
+ import UserHandle from './handles/user.js';
10
+ import VariableHandle from './handles/variable.js';
11
+ import ProjectHandle from './handles/project.js';
12
+ import DataTableHandle from './handles/data-table.js';
13
+ import FolderHandle from './handles/folder.js';
14
+ import CommunityPackageHandle from './handles/community-package.js';
15
+ import AuditHandle from './handles/audit.js';
16
+ import InsightsHandle from './handles/insights.js';
17
+ import SourceControlHandle from './handles/source-control.js';
18
+ import DiscoverHandle from './handles/discover.js';
19
+ import N8nPackageHandle from './handles/n8n-package.js';
20
+ export { PaginatedResponse, PaginationParams } from './pagination.js';
21
+
22
+ declare class N8nClient {
23
+ #private;
24
+ constructor(config: N8nClientConfig);
25
+ request<T>(options: RequestOptions): Promise<T>;
26
+ get<T>(path: string, query?: {
27
+ [key: string]: unknown;
28
+ }, headers?: Record<string, string>): Promise<T>;
29
+ post<T>(path: string, body?: unknown, query?: {
30
+ [key: string]: unknown;
31
+ }, headers?: Record<string, string>): Promise<T>;
32
+ put<T>(path: string, body?: unknown, query?: {
33
+ [key: string]: unknown;
34
+ }, headers?: Record<string, string>): Promise<T>;
35
+ patch<T>(path: string, body?: unknown, query?: {
36
+ [key: string]: unknown;
37
+ }, headers?: Record<string, string>): Promise<T>;
38
+ delete<T>(path: string, query?: {
39
+ [key: string]: unknown;
40
+ }, headers?: Record<string, string>): Promise<T>;
41
+ workflow(): WorkflowHandle;
42
+ execution(): ExecutionHandle;
43
+ credential(): CredentialHandle;
44
+ tag(): TagHandle;
45
+ user(): UserHandle;
46
+ variable(): VariableHandle;
47
+ project(): ProjectHandle;
48
+ dataTable(): DataTableHandle;
49
+ folder(projectId: string): FolderHandle;
50
+ communityPackage(): CommunityPackageHandle;
51
+ audit(): AuditHandle;
52
+ insights(): InsightsHandle;
53
+ sourceControl(): SourceControlHandle;
54
+ discover(): DiscoverHandle;
55
+ n8nPackage(): N8nPackageHandle;
56
+ }
57
+
58
+ export { N8nClientConfig, RequestOptions, N8nClient as default };
package/index.js ADDED
@@ -0,0 +1,127 @@
1
+ import {
2
+ UserHandle
3
+ } from "./chunk-SK4VCTMD.js";
4
+ import {
5
+ VariableHandle
6
+ } from "./chunk-FZX275Y3.js";
7
+ import {
8
+ WorkflowHandle
9
+ } from "./chunk-MNL65GQB.js";
10
+ import {
11
+ DiscoverHandle
12
+ } from "./chunk-FHAZIAHR.js";
13
+ import {
14
+ ExecutionHandle
15
+ } from "./chunk-QYAIEIF5.js";
16
+ import {
17
+ FolderHandle
18
+ } from "./chunk-DJCG37LZ.js";
19
+ import {
20
+ InsightsHandle
21
+ } from "./chunk-5SY4KM4Q.js";
22
+ import {
23
+ N8nPackageHandle
24
+ } from "./chunk-CUO2M75Z.js";
25
+ import {
26
+ ProjectHandle
27
+ } from "./chunk-ZEQL5KU2.js";
28
+ import {
29
+ SourceControlHandle
30
+ } from "./chunk-JR7A75YV.js";
31
+ import {
32
+ TagHandle
33
+ } from "./chunk-4FXZT5HT.js";
34
+ import {
35
+ HttpClient,
36
+ HttpError
37
+ } from "./chunk-DK5NLZ6U.js";
38
+ import "./chunk-DURH6QOX.js";
39
+ import {
40
+ AuditHandle
41
+ } from "./chunk-3SBD4UJS.js";
42
+ import {
43
+ CommunityPackageHandle
44
+ } from "./chunk-5FIB7YIT.js";
45
+ import {
46
+ CredentialHandle
47
+ } from "./chunk-BWLFUF76.js";
48
+ import {
49
+ DataTableHandle
50
+ } from "./chunk-TCPZWXKM.js";
51
+
52
+ // src/index.ts
53
+ var N8nClient = class {
54
+ #http;
55
+ constructor(config) {
56
+ this.#http = new HttpClient(config);
57
+ }
58
+ request(options) {
59
+ return this.#http.request(options);
60
+ }
61
+ get(path, query, headers) {
62
+ return this.#http.get(path, query, headers);
63
+ }
64
+ post(path, body, query, headers) {
65
+ return this.#http.post(path, body, query, headers);
66
+ }
67
+ put(path, body, query, headers) {
68
+ return this.#http.put(path, body, query, headers);
69
+ }
70
+ patch(path, body, query, headers) {
71
+ return this.#http.patch(path, body, query, headers);
72
+ }
73
+ delete(path, query, headers) {
74
+ return this.#http.delete(path, query, headers);
75
+ }
76
+ workflow() {
77
+ return new WorkflowHandle(this.#http);
78
+ }
79
+ execution() {
80
+ return new ExecutionHandle(this.#http);
81
+ }
82
+ credential() {
83
+ return new CredentialHandle(this.#http);
84
+ }
85
+ tag() {
86
+ return new TagHandle(this.#http);
87
+ }
88
+ user() {
89
+ return new UserHandle(this.#http);
90
+ }
91
+ variable() {
92
+ return new VariableHandle(this.#http);
93
+ }
94
+ project() {
95
+ return new ProjectHandle(this.#http);
96
+ }
97
+ dataTable() {
98
+ return new DataTableHandle(this.#http);
99
+ }
100
+ folder(projectId) {
101
+ return new FolderHandle(this.#http, projectId);
102
+ }
103
+ communityPackage() {
104
+ return new CommunityPackageHandle(this.#http);
105
+ }
106
+ audit() {
107
+ return new AuditHandle(this.#http);
108
+ }
109
+ insights() {
110
+ return new InsightsHandle(this.#http);
111
+ }
112
+ sourceControl() {
113
+ return new SourceControlHandle(this.#http);
114
+ }
115
+ discover() {
116
+ return new DiscoverHandle(this.#http);
117
+ }
118
+ n8nPackage() {
119
+ return new N8nPackageHandle(this.#http);
120
+ }
121
+ };
122
+ export {
123
+ HttpClient,
124
+ HttpError,
125
+ N8nClient as default
126
+ };
127
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "version": "0.1.1",
3
+ "description": "TypeScript client for the n8n Public API with cursor-based pagination and typed resource handles.",
4
+ "keywords": [
5
+ "n8n",
6
+ "n8n-api",
7
+ "workflow-automation",
8
+ "automation",
9
+ "typescript",
10
+ "client",
11
+ "api-client"
12
+ ],
13
+ "files": [
14
+ "**/*",
15
+ "!**/*.map"
16
+ ],
17
+ "homepage": "https://n8n-client.pages.dev/",
18
+ "bugs": {
19
+ "url": "https://github.com/egose/n8n-client/issues"
20
+ },
21
+ "license": "Apache-2.0",
22
+ "author": "J.Dev",
23
+ "sideEffects": false,
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/egose/n8n-client"
27
+ },
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
31
+ "main": "./index.cjs",
32
+ "module": "./index.js",
33
+ "types": "./index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./index.d.ts",
37
+ "require": "./index.cjs",
38
+ "import": "./index.js"
39
+ }
40
+ },
41
+ "name": "@egose/n8n-client"
42
+ }
package/pagination.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";//# sourceMappingURL=pagination.cjs.map
@@ -0,0 +1,11 @@
1
+ interface PaginationParams {
2
+ limit?: number;
3
+ cursor?: string;
4
+ [key: string]: unknown;
5
+ }
6
+ interface PaginatedResponse<T> {
7
+ data: T[];
8
+ nextCursor?: string;
9
+ }
10
+
11
+ export type { PaginatedResponse, PaginationParams };
@@ -0,0 +1,11 @@
1
+ interface PaginationParams {
2
+ limit?: number;
3
+ cursor?: string;
4
+ [key: string]: unknown;
5
+ }
6
+ interface PaginatedResponse<T> {
7
+ data: T[];
8
+ nextCursor?: string;
9
+ }
10
+
11
+ export type { PaginatedResponse, PaginationParams };
package/pagination.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=pagination.js.map
package/types.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";//# sourceMappingURL=types.cjs.map