@zapier/zapier-sdk-cli 0.59.1 → 0.59.2

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 (174) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cli.cjs +2 -2
  3. package/dist/cli.mjs +2 -2
  4. package/dist/experimental.cjs +1 -1
  5. package/dist/experimental.mjs +1 -1
  6. package/dist/index.cjs +2 -2
  7. package/dist/index.mjs +2 -2
  8. package/package.json +3 -3
  9. package/dist/package.json +0 -121
  10. package/dist/src/cli.d.ts +0 -2
  11. package/dist/src/cli.js +0 -219
  12. package/dist/src/experimental.d.ts +0 -33
  13. package/dist/src/experimental.js +0 -86
  14. package/dist/src/generators/ast-generator.d.ts +0 -41
  15. package/dist/src/generators/ast-generator.js +0 -405
  16. package/dist/src/index.d.ts +0 -5
  17. package/dist/src/index.js +0 -5
  18. package/dist/src/login/config.d.ts +0 -4
  19. package/dist/src/login/config.js +0 -21
  20. package/dist/src/login/credentials-revoke.d.ts +0 -14
  21. package/dist/src/login/credentials-revoke.js +0 -95
  22. package/dist/src/login/credentials-store.d.ts +0 -60
  23. package/dist/src/login/credentials-store.js +0 -181
  24. package/dist/src/login/filesystem-cache.d.ts +0 -25
  25. package/dist/src/login/filesystem-cache.js +0 -195
  26. package/dist/src/login/index.d.ts +0 -110
  27. package/dist/src/login/index.js +0 -424
  28. package/dist/src/login/keychain.d.ts +0 -18
  29. package/dist/src/login/keychain.js +0 -74
  30. package/dist/src/login/legacy-jwt.d.ts +0 -4
  31. package/dist/src/login/legacy-jwt.js +0 -18
  32. package/dist/src/login.d.ts +0 -10
  33. package/dist/src/login.js +0 -10
  34. package/dist/src/paths.d.ts +0 -1
  35. package/dist/src/paths.js +0 -6
  36. package/dist/src/plugins/add/index.d.ts +0 -254
  37. package/dist/src/plugins/add/index.js +0 -95
  38. package/dist/src/plugins/add/schemas.d.ts +0 -8
  39. package/dist/src/plugins/add/schemas.js +0 -22
  40. package/dist/src/plugins/auth/credentials-base-url.d.ts +0 -11
  41. package/dist/src/plugins/auth/credentials-base-url.js +0 -24
  42. package/dist/src/plugins/buildManifest/index.d.ts +0 -120
  43. package/dist/src/plugins/buildManifest/index.js +0 -71
  44. package/dist/src/plugins/buildManifest/schemas.d.ts +0 -44
  45. package/dist/src/plugins/buildManifest/schemas.js +0 -17
  46. package/dist/src/plugins/bundleCode/index.d.ts +0 -23
  47. package/dist/src/plugins/bundleCode/index.js +0 -62
  48. package/dist/src/plugins/bundleCode/schemas.d.ts +0 -10
  49. package/dist/src/plugins/bundleCode/schemas.js +0 -19
  50. package/dist/src/plugins/cliOverrides/index.d.ts +0 -21
  51. package/dist/src/plugins/cliOverrides/index.js +0 -17
  52. package/dist/src/plugins/curl/index.d.ts +0 -76
  53. package/dist/src/plugins/curl/index.js +0 -236
  54. package/dist/src/plugins/curl/schemas.d.ts +0 -40
  55. package/dist/src/plugins/curl/schemas.js +0 -108
  56. package/dist/src/plugins/curl/utils.d.ts +0 -34
  57. package/dist/src/plugins/curl/utils.js +0 -150
  58. package/dist/src/plugins/drainTriggerInbox/index.d.ts +0 -46
  59. package/dist/src/plugins/drainTriggerInbox/index.js +0 -178
  60. package/dist/src/plugins/feedback/index.d.ts +0 -24
  61. package/dist/src/plugins/feedback/index.js +0 -52
  62. package/dist/src/plugins/feedback/schemas.d.ts +0 -5
  63. package/dist/src/plugins/feedback/schemas.js +0 -8
  64. package/dist/src/plugins/generateAppTypes/index.d.ts +0 -265
  65. package/dist/src/plugins/generateAppTypes/index.js +0 -129
  66. package/dist/src/plugins/generateAppTypes/schemas.d.ts +0 -58
  67. package/dist/src/plugins/generateAppTypes/schemas.js +0 -21
  68. package/dist/src/plugins/getLoginConfigPath/index.d.ts +0 -16
  69. package/dist/src/plugins/getLoginConfigPath/index.js +0 -9
  70. package/dist/src/plugins/getLoginConfigPath/schemas.d.ts +0 -3
  71. package/dist/src/plugins/getLoginConfigPath/schemas.js +0 -5
  72. package/dist/src/plugins/index.d.ts +0 -15
  73. package/dist/src/plugins/index.js +0 -15
  74. package/dist/src/plugins/init/display.d.ts +0 -9
  75. package/dist/src/plugins/init/display.js +0 -72
  76. package/dist/src/plugins/init/index.d.ts +0 -21
  77. package/dist/src/plugins/init/index.js +0 -56
  78. package/dist/src/plugins/init/schemas.d.ts +0 -9
  79. package/dist/src/plugins/init/schemas.js +0 -19
  80. package/dist/src/plugins/init/steps.d.ts +0 -39
  81. package/dist/src/plugins/init/steps.js +0 -141
  82. package/dist/src/plugins/init/types.d.ts +0 -31
  83. package/dist/src/plugins/init/types.js +0 -1
  84. package/dist/src/plugins/init/utils.d.ts +0 -48
  85. package/dist/src/plugins/init/utils.js +0 -135
  86. package/dist/src/plugins/login/index.d.ts +0 -25
  87. package/dist/src/plugins/login/index.js +0 -12
  88. package/dist/src/plugins/login/schemas.d.ts +0 -9
  89. package/dist/src/plugins/login/schemas.js +0 -27
  90. package/dist/src/plugins/logout/index.d.ts +0 -30
  91. package/dist/src/plugins/logout/index.js +0 -33
  92. package/dist/src/plugins/logout/schemas.d.ts +0 -2
  93. package/dist/src/plugins/logout/schemas.js +0 -4
  94. package/dist/src/plugins/mcp/index.d.ts +0 -28
  95. package/dist/src/plugins/mcp/index.js +0 -24
  96. package/dist/src/plugins/mcp/schemas.d.ts +0 -5
  97. package/dist/src/plugins/mcp/schemas.js +0 -10
  98. package/dist/src/plugins/signup/index.d.ts +0 -25
  99. package/dist/src/plugins/signup/index.js +0 -12
  100. package/dist/src/plugins/signup/schemas.d.ts +0 -9
  101. package/dist/src/plugins/signup/schemas.js +0 -26
  102. package/dist/src/plugins/signup/test-harness.d.ts +0 -34
  103. package/dist/src/plugins/signup/test-harness.js +0 -76
  104. package/dist/src/plugins/watchTriggerInbox/index.d.ts +0 -46
  105. package/dist/src/plugins/watchTriggerInbox/index.js +0 -166
  106. package/dist/src/sdk.d.ts +0 -17
  107. package/dist/src/sdk.js +0 -67
  108. package/dist/src/telemetry/builders.d.ts +0 -44
  109. package/dist/src/telemetry/builders.js +0 -59
  110. package/dist/src/telemetry/events.d.ts +0 -40
  111. package/dist/src/telemetry/events.js +0 -4
  112. package/dist/src/types/sdk.d.ts +0 -6
  113. package/dist/src/types/sdk.js +0 -1
  114. package/dist/src/utils/api/client.d.ts +0 -15
  115. package/dist/src/utils/api/client.js +0 -27
  116. package/dist/src/utils/approval-errors.d.ts +0 -1
  117. package/dist/src/utils/approval-errors.js +0 -9
  118. package/dist/src/utils/approval-progress.d.ts +0 -12
  119. package/dist/src/utils/approval-progress.js +0 -179
  120. package/dist/src/utils/auth/account-auth.d.ts +0 -33
  121. package/dist/src/utils/auth/account-auth.js +0 -302
  122. package/dist/src/utils/auth/client-credentials.d.ts +0 -26
  123. package/dist/src/utils/auth/client-credentials.js +0 -67
  124. package/dist/src/utils/auth/oauth-callback.d.ts +0 -6
  125. package/dist/src/utils/auth/oauth-callback.js +0 -28
  126. package/dist/src/utils/auth/oauth-errors.d.ts +0 -2
  127. package/dist/src/utils/auth/oauth-errors.js +0 -39
  128. package/dist/src/utils/auth/oauth-flow.d.ts +0 -37
  129. package/dist/src/utils/auth/oauth-flow.js +0 -313
  130. package/dist/src/utils/auth/oauth-transaction.d.ts +0 -35
  131. package/dist/src/utils/auth/oauth-transaction.js +0 -69
  132. package/dist/src/utils/cli-generator-utils.d.ts +0 -14
  133. package/dist/src/utils/cli-generator-utils.js +0 -122
  134. package/dist/src/utils/cli-generator.d.ts +0 -4
  135. package/dist/src/utils/cli-generator.js +0 -831
  136. package/dist/src/utils/cli-options.d.ts +0 -16
  137. package/dist/src/utils/cli-options.js +0 -34
  138. package/dist/src/utils/cli-renderer.d.ts +0 -53
  139. package/dist/src/utils/cli-renderer.js +0 -265
  140. package/dist/src/utils/constants.d.ts +0 -3
  141. package/dist/src/utils/constants.js +0 -5
  142. package/dist/src/utils/directory-detection.d.ts +0 -5
  143. package/dist/src/utils/directory-detection.js +0 -21
  144. package/dist/src/utils/errors.d.ts +0 -33
  145. package/dist/src/utils/errors.js +0 -36
  146. package/dist/src/utils/extensions.d.ts +0 -20
  147. package/dist/src/utils/extensions.js +0 -66
  148. package/dist/src/utils/getCallablePromise.d.ts +0 -6
  149. package/dist/src/utils/getCallablePromise.js +0 -14
  150. package/dist/src/utils/log.d.ts +0 -8
  151. package/dist/src/utils/log.js +0 -26
  152. package/dist/src/utils/manifest-helpers.d.ts +0 -10
  153. package/dist/src/utils/manifest-helpers.js +0 -19
  154. package/dist/src/utils/non-interactive.d.ts +0 -14
  155. package/dist/src/utils/non-interactive.js +0 -15
  156. package/dist/src/utils/package-manager-detector.d.ts +0 -18
  157. package/dist/src/utils/package-manager-detector.js +0 -72
  158. package/dist/src/utils/parameter-resolver.d.ts +0 -179
  159. package/dist/src/utils/parameter-resolver.js +0 -1554
  160. package/dist/src/utils/retry.d.ts +0 -6
  161. package/dist/src/utils/retry.js +0 -21
  162. package/dist/src/utils/schema-formatter.d.ts +0 -11
  163. package/dist/src/utils/schema-formatter.js +0 -131
  164. package/dist/src/utils/serializeAsync.d.ts +0 -2
  165. package/dist/src/utils/serializeAsync.js +0 -16
  166. package/dist/src/utils/spinner.d.ts +0 -1
  167. package/dist/src/utils/spinner.js +0 -21
  168. package/dist/src/utils/string-utils.d.ts +0 -1
  169. package/dist/src/utils/string-utils.js +0 -6
  170. package/dist/src/utils/triggerDrain.d.ts +0 -144
  171. package/dist/src/utils/triggerDrain.js +0 -351
  172. package/dist/src/utils/version-checker.d.ts +0 -17
  173. package/dist/src/utils/version-checker.js +0 -154
  174. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,265 +0,0 @@
1
- import { type GenerateAppTypesOptions, type GenerateAppTypesResult } from "./schemas";
2
- export declare const generateAppTypesPlugin: (sdk: {
3
- listApps: (options?: ({
4
- search?: string | undefined;
5
- apps?: string[] | undefined;
6
- appKeys?: string[] | undefined;
7
- pageSize?: number | undefined;
8
- maxItems?: number | undefined;
9
- cursor?: string | undefined;
10
- } & {
11
- cursor?: string;
12
- pageSize?: number;
13
- maxItems?: number;
14
- }) | undefined) => import("@zapier/zapier-sdk").PaginatedSdkResult<{
15
- slug: string;
16
- title: string;
17
- key: string;
18
- implementation_id: string;
19
- description?: string | undefined;
20
- is_hidden?: boolean | undefined;
21
- auth_type?: string | undefined;
22
- actions?: {
23
- read?: number | undefined;
24
- read_bulk?: number | undefined;
25
- write?: number | undefined;
26
- search?: number | undefined;
27
- search_or_write?: number | undefined;
28
- search_and_write?: number | undefined;
29
- filter?: number | undefined;
30
- } | undefined;
31
- is_deprecated?: boolean | undefined;
32
- is_beta?: boolean | undefined;
33
- is_premium?: boolean | undefined;
34
- age_in_days?: number | undefined;
35
- banner?: string | undefined;
36
- categories?: {
37
- id: number;
38
- name: string;
39
- slug: string;
40
- }[] | undefined;
41
- images?: {
42
- url_16x16?: string | undefined;
43
- url_32x32?: string | undefined;
44
- url_64x64?: string | undefined;
45
- url_128x128?: string | undefined;
46
- } | undefined;
47
- popularity?: number | undefined;
48
- has_filters?: boolean | undefined;
49
- has_reads?: boolean | undefined;
50
- has_searches?: boolean | undefined;
51
- has_searches_or_writes?: boolean | undefined;
52
- has_upfront_fields?: boolean | undefined;
53
- has_writes?: boolean | undefined;
54
- is_built_in?: boolean | undefined;
55
- is_featured?: boolean | undefined;
56
- is_invite?: boolean | undefined;
57
- is_public?: boolean | undefined;
58
- is_upcoming?: boolean | undefined;
59
- visibility?: string | undefined;
60
- primary_color?: string | undefined;
61
- secondary_color?: string | undefined;
62
- classification?: string | undefined;
63
- api_docs_url?: string | undefined;
64
- image?: string | undefined;
65
- version?: string | undefined;
66
- }>;
67
- } & {
68
- context: {
69
- meta: {
70
- listApps: import("@zapier/zapier-sdk").PluginMeta<unknown>;
71
- };
72
- };
73
- } & {
74
- listActions: (options?: (({
75
- app: string;
76
- actionType?: "read" | "read_bulk" | "write" | "search" | "search_or_write" | "search_and_write" | "filter" | "run" | undefined;
77
- pageSize?: number | undefined;
78
- maxItems?: number | undefined;
79
- cursor?: string | undefined;
80
- } | {
81
- appKey: string;
82
- actionType?: "read" | "read_bulk" | "write" | "search" | "search_or_write" | "search_and_write" | "filter" | "run" | undefined;
83
- pageSize?: number | undefined;
84
- maxItems?: number | undefined;
85
- cursor?: string | undefined;
86
- }) & {
87
- cursor?: string;
88
- pageSize?: number;
89
- maxItems?: number;
90
- }) | undefined) => import("@zapier/zapier-sdk").PaginatedSdkResult<{
91
- description: string;
92
- key: string;
93
- app_key: string;
94
- action_type: "read" | "read_bulk" | "write" | "search" | "search_or_write" | "search_and_write" | "filter" | "run";
95
- title: string;
96
- type: "action";
97
- is_hidden?: boolean | undefined;
98
- id?: string | undefined;
99
- is_important?: boolean | undefined;
100
- app_version?: string | undefined;
101
- }>;
102
- } & {
103
- context: {
104
- meta: {
105
- listActions: import("@zapier/zapier-sdk").PluginMeta<unknown>;
106
- };
107
- };
108
- } & {
109
- listActionInputFields: (options?: (({
110
- app: string;
111
- actionType: "read" | "read_bulk" | "write" | "search" | "search_or_write" | "search_and_write" | "filter" | "run";
112
- action: string;
113
- connection?: string | number | undefined;
114
- connectionId?: string | number | null | undefined;
115
- authenticationId?: string | number | null | undefined;
116
- inputs?: Record<string, unknown> | undefined;
117
- pageSize?: number | undefined;
118
- maxItems?: number | undefined;
119
- cursor?: string | undefined;
120
- } | {
121
- appKey: string;
122
- actionType: "read" | "read_bulk" | "write" | "search" | "search_or_write" | "search_and_write" | "filter" | "run";
123
- actionKey: string;
124
- connection?: string | number | undefined;
125
- connectionId?: string | number | null | undefined;
126
- authenticationId?: string | number | null | undefined;
127
- inputs?: Record<string, unknown> | undefined;
128
- pageSize?: number | undefined;
129
- maxItems?: number | undefined;
130
- cursor?: string | undefined;
131
- }) & {
132
- cursor?: string;
133
- pageSize?: number;
134
- maxItems?: number;
135
- }) | undefined) => import("@zapier/zapier-sdk").PaginatedSdkResult<{
136
- key: string;
137
- type: "input_field";
138
- default_value: string;
139
- depends_on: string[];
140
- description: string;
141
- invalidates_input_fields: boolean;
142
- is_required: boolean;
143
- placeholder: string;
144
- title: string;
145
- value_type: string;
146
- format?: string | undefined;
147
- items?: {
148
- type: string;
149
- } | undefined;
150
- } | {
151
- key: string;
152
- type: "info_field";
153
- description: string;
154
- title?: string | undefined;
155
- } | import("@zapier/zapier-sdk").FieldsetItem>;
156
- } & {
157
- context: {
158
- meta: {
159
- listActionInputFields: import("@zapier/zapier-sdk").PluginMeta<unknown>;
160
- };
161
- };
162
- } & {
163
- listConnections: (options?: ({
164
- title?: string | undefined;
165
- search?: string | undefined;
166
- owner?: string | undefined;
167
- app?: string | undefined;
168
- appKey?: string | undefined;
169
- connections?: string[] | undefined;
170
- connectionIds?: string[] | undefined;
171
- authenticationIds?: string[] | undefined;
172
- account?: string | undefined;
173
- accountId?: string | undefined;
174
- includeShared?: boolean | undefined;
175
- isExpired?: boolean | undefined;
176
- expired?: boolean | undefined;
177
- pageSize?: number | undefined;
178
- maxItems?: number | undefined;
179
- cursor?: string | undefined;
180
- } & {
181
- cursor?: string;
182
- pageSize?: number;
183
- maxItems?: number;
184
- }) | undefined) => import("@zapier/zapier-sdk").PaginatedSdkResult<{
185
- date: string;
186
- is_invite_only: boolean;
187
- is_private: boolean;
188
- shared_with_all: boolean;
189
- id: string;
190
- account_id: string;
191
- title?: string | null | undefined;
192
- lastchanged?: string | undefined;
193
- destination_selected_api?: string | null | undefined;
194
- is_stale?: string | undefined;
195
- is_shared?: string | undefined;
196
- marked_stale_at?: string | null | undefined;
197
- label?: string | null | undefined;
198
- identifier?: string | null | undefined;
199
- url?: string | undefined;
200
- groups?: Record<string, unknown>[] | undefined;
201
- members?: string | undefined;
202
- permissions?: Record<string, boolean> | undefined;
203
- public_id?: string | undefined;
204
- account_public_id?: string | undefined;
205
- customuser_public_id?: string | undefined;
206
- implementation_id?: string | undefined;
207
- profile_id?: string | undefined;
208
- is_expired?: string | undefined;
209
- expired_at?: string | null | undefined;
210
- app_key?: string | undefined;
211
- app_version?: string | undefined;
212
- }>;
213
- } & {
214
- context: {
215
- meta: {
216
- listConnections: import("@zapier/zapier-sdk").PluginMeta<unknown>;
217
- };
218
- };
219
- } & {
220
- context: {
221
- getResolvedManifest: () => Promise<import("@zapier/zapier-sdk").Manifest | null>;
222
- getVersionedImplementationId: (appKey: string) => Promise<string | null>;
223
- resolveAppKeys: ({ appKeys }: {
224
- appKeys: string[];
225
- }) => Promise<import("@zapier/zapier-sdk").ResolvedAppLocator[]>;
226
- updateManifestEntry: (options: import("@zapier/zapier-sdk").UpdateManifestEntryOptions) => Promise<import("@zapier/zapier-sdk").UpdateManifestEntryResult>;
227
- addActionEntry: (options: import("@zapier/zapier-sdk").AddActionEntryOptions) => Promise<import("@zapier/zapier-sdk").AddActionEntryResult>;
228
- findActionEntry: ({ name, manifest, }: {
229
- name: string;
230
- manifest: import("@zapier/zapier-sdk").Manifest;
231
- }) => import("@zapier/zapier-sdk").ActionEntry | null;
232
- listActionEntries: ({ configPath, }?: {
233
- configPath?: string;
234
- }) => Promise<Array<[string, import("@zapier/zapier-sdk").ActionEntry]>>;
235
- deleteActionEntry: ({ name, configPath, skipWrite, }: {
236
- name: string;
237
- configPath?: string;
238
- skipWrite?: boolean;
239
- }) => Promise<import("@zapier/zapier-sdk").Manifest>;
240
- hasActionEntry: ({ name, manifest, }: {
241
- name: string;
242
- manifest: import("@zapier/zapier-sdk").Manifest;
243
- }) => boolean;
244
- findManifestEntry: typeof import("@zapier/zapier-sdk").findManifestEntry;
245
- readManifestFromFile: typeof import("@zapier/zapier-sdk").readManifestFromFile;
246
- getManifestConnections: () => Promise<Record<string, {
247
- connectionId: string | number;
248
- }> | null>;
249
- };
250
- } & {
251
- context: import("@zapier/zapier-sdk").EventEmissionContext;
252
- } & {
253
- context: {
254
- meta: Record<string, import("@zapier/zapier-sdk").PluginMeta>;
255
- };
256
- }) => {
257
- generateAppTypes: (options?: GenerateAppTypesOptions | undefined) => Promise<GenerateAppTypesResult>;
258
- } & {
259
- context: {
260
- meta: {
261
- generateAppTypes: import("@zapier/zapier-sdk").PluginMeta<unknown>;
262
- };
263
- };
264
- };
265
- export type GenerateAppTypesPluginProvides = ReturnType<typeof generateAppTypesPlugin>;
@@ -1,129 +0,0 @@
1
- import { createPluginMethod, definePlugin, ZapierValidationError, ZapierUnknownError, } from "@zapier/zapier-sdk";
2
- import { GenerateAppTypesSchema, } from "./schemas";
3
- import { AstTypeGenerator } from "../../generators/ast-generator";
4
- import { getManifestKey } from "../../utils/manifest-helpers";
5
- import { mkdir, writeFile } from "fs/promises";
6
- import { join, resolve } from "path";
7
- import { detectTypesOutputDirectory } from "../../utils/directory-detection";
8
- export const generateAppTypesPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
9
- name: "generateAppTypes",
10
- categories: ["utility"],
11
- // Cast: schema validates JSON fields only; GenerateAppTypesOptions adds
12
- // the runtime-only `onProgress` callback (passthrough via createFunction).
13
- inputSchema: GenerateAppTypesSchema,
14
- handler: async ({ sdk, options }) => {
15
- const { apps: appKeys, connections: connectionIds, skipWrite = false, typesOutputDirectory = await detectTypesOutputDirectory(), onProgress, } = options;
16
- const resolvedTypesOutput = resolve(typesOutputDirectory);
17
- const result = { typeDefinitions: {} };
18
- // Get apps via listApps (respects existing manifest for version locking).
19
- onProgress?.({ type: "apps_lookup_start", count: appKeys.length });
20
- const appsIterable = sdk.listApps({ apps: appKeys }).items();
21
- const apps = [];
22
- for await (const app of appsIterable) {
23
- apps.push(app);
24
- onProgress?.({ type: "app_found", app });
25
- }
26
- onProgress?.({ type: "apps_lookup_complete", count: apps.length });
27
- if (apps.length === 0) {
28
- return result;
29
- }
30
- const connections = [];
31
- if (connectionIds && connectionIds.length > 0) {
32
- onProgress?.({
33
- type: "connections_lookup_start",
34
- count: connectionIds.length,
35
- });
36
- const connectionsIterable = sdk
37
- .listConnections({ connections: connectionIds })
38
- .items();
39
- for await (const connection of connectionsIterable) {
40
- connections.push(connection);
41
- }
42
- onProgress?.({
43
- type: "connections_lookup_complete",
44
- count: connections.length,
45
- });
46
- }
47
- if (!skipWrite && resolvedTypesOutput) {
48
- await mkdir(resolvedTypesOutput, { recursive: true });
49
- }
50
- if (!skipWrite) {
51
- result.writtenFiles = {};
52
- }
53
- for (const app of apps) {
54
- onProgress?.({
55
- type: "app_processing_start",
56
- app: app.key,
57
- slug: app.slug,
58
- });
59
- try {
60
- if (!app.version) {
61
- const errorMessage = `Invalid implementation ID format: ${app.implementation_id}. Expected format: <implementationName>@<version>`;
62
- onProgress?.({
63
- type: "app_processing_error",
64
- app: app.key,
65
- error: errorMessage,
66
- });
67
- throw new ZapierValidationError(errorMessage, {
68
- details: {
69
- appKey: app.key,
70
- implementationId: app.implementation_id,
71
- },
72
- });
73
- }
74
- let connectionId;
75
- if (connections.length > 0) {
76
- const matchingConnection = connections.find((conn) => conn.app_key === app.key);
77
- if (matchingConnection) {
78
- connectionId = matchingConnection.id;
79
- onProgress?.({
80
- type: "connection_matched",
81
- app: app.key,
82
- connectionId: matchingConnection.id,
83
- connectionTitle: matchingConnection.title || "",
84
- });
85
- }
86
- else {
87
- onProgress?.({
88
- type: "connection_not_matched",
89
- app: app.key,
90
- });
91
- }
92
- }
93
- const manifestKey = getManifestKey(app);
94
- const generator = new AstTypeGenerator();
95
- const typeDefinitionString = await generator.generateTypes({
96
- app,
97
- connectionId,
98
- sdk,
99
- });
100
- result.typeDefinitions[manifestKey] = typeDefinitionString;
101
- onProgress?.({
102
- type: "type_generated",
103
- manifestKey,
104
- sizeBytes: typeDefinitionString.length,
105
- });
106
- if (!skipWrite && resolvedTypesOutput && result.writtenFiles) {
107
- const filePath = join(resolvedTypesOutput, `${manifestKey}.d.ts`);
108
- await writeFile(filePath, typeDefinitionString, "utf8");
109
- result.writtenFiles[manifestKey] = filePath;
110
- onProgress?.({ type: "file_written", manifestKey, filePath });
111
- }
112
- onProgress?.({ type: "app_processing_complete", app: app.key });
113
- }
114
- catch (error) {
115
- const errorMessage = `Failed to process app ${app.key}: ${error instanceof Error ? error.message : String(error)}`;
116
- onProgress?.({
117
- type: "app_processing_error",
118
- app: app.key,
119
- error: errorMessage,
120
- });
121
- if (error instanceof ZapierValidationError) {
122
- throw error;
123
- }
124
- throw new ZapierUnknownError(errorMessage, { cause: error });
125
- }
126
- }
127
- return result;
128
- },
129
- }));
@@ -1,58 +0,0 @@
1
- import { z } from "zod";
2
- import type { AppItem } from "@zapier/zapier-sdk";
3
- export declare const GenerateAppTypesSchema: z.ZodObject<{
4
- apps: z.ZodArray<z.ZodString>;
5
- connections: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
- skipWrite: z.ZodOptional<z.ZodBoolean>;
7
- typesOutputDirectory: z.ZodOptional<z.ZodString>;
8
- }, z.core.$strip>;
9
- export type GenerateAppTypesOptions = z.infer<typeof GenerateAppTypesSchema> & {
10
- onProgress?: (event: AppTypesProgressEvent) => void;
11
- };
12
- export type AppTypesProgressEvent = {
13
- type: "apps_lookup_start";
14
- count: number;
15
- } | {
16
- type: "app_found";
17
- app: AppItem;
18
- } | {
19
- type: "apps_lookup_complete";
20
- count: number;
21
- } | {
22
- type: "connections_lookup_start";
23
- count: number;
24
- } | {
25
- type: "connections_lookup_complete";
26
- count: number;
27
- } | {
28
- type: "app_processing_start";
29
- app: string;
30
- slug?: string;
31
- } | {
32
- type: "connection_matched";
33
- app: string;
34
- connectionId: string;
35
- connectionTitle: string;
36
- } | {
37
- type: "connection_not_matched";
38
- app: string;
39
- } | {
40
- type: "type_generated";
41
- manifestKey: string;
42
- sizeBytes: number;
43
- } | {
44
- type: "file_written";
45
- manifestKey: string;
46
- filePath: string;
47
- } | {
48
- type: "app_processing_complete";
49
- app: string;
50
- } | {
51
- type: "app_processing_error";
52
- app: string;
53
- error: string;
54
- };
55
- export interface GenerateAppTypesResult {
56
- typeDefinitions: Record<string, string>;
57
- writtenFiles?: Record<string, string>;
58
- }
@@ -1,21 +0,0 @@
1
- import { z } from "zod";
2
- export const GenerateAppTypesSchema = z
3
- .object({
4
- apps: z
5
- .array(z.string().min(1, "App key cannot be empty"))
6
- .min(1, "At least one app key is required")
7
- .describe("One or more app keys to generate types for (e.g., 'slack', 'github', 'trello')"),
8
- connections: z
9
- .array(z.string())
10
- .optional()
11
- .describe("Connection IDs to use for type generation (e.g., ['123', '456'])"),
12
- skipWrite: z
13
- .boolean()
14
- .optional()
15
- .describe("If true, returns type definitions without writing to disk. If false or omitted, writes type files."),
16
- typesOutputDirectory: z
17
- .string()
18
- .optional()
19
- .describe("Directory for TypeScript type files. Required when skipWrite is false or omitted."),
20
- })
21
- .describe("Generate TypeScript type definitions for apps - can optionally write to disk or just return type strings");
@@ -1,16 +0,0 @@
1
- export declare const getLoginConfigPathPlugin: (sdk: {
2
- context: import("@zapier/zapier-sdk").EventEmissionContext;
3
- } & {
4
- context: {
5
- meta: Record<string, import("@zapier/zapier-sdk").PluginMeta>;
6
- };
7
- }) => {
8
- getLoginConfigPath: (options?: Record<string, never> | undefined) => Promise<string>;
9
- } & {
10
- context: {
11
- meta: {
12
- getLoginConfigPath: import("@zapier/zapier-sdk").PluginMeta<unknown>;
13
- };
14
- };
15
- };
16
- export type GetLoginConfigPathPluginProvides = ReturnType<typeof getLoginConfigPathPlugin>;
@@ -1,9 +0,0 @@
1
- import { GetLoginConfigPathSchema } from "./schemas";
2
- import { createPluginMethod, definePlugin, } from "@zapier/zapier-sdk";
3
- import { getConfigPath } from "../../login";
4
- export const getLoginConfigPathPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
5
- name: "getLoginConfigPath",
6
- categories: ["utility"],
7
- inputSchema: GetLoginConfigPathSchema,
8
- handler: async () => getConfigPath(),
9
- }));
@@ -1,3 +0,0 @@
1
- import { z } from "zod";
2
- export declare const GetLoginConfigPathSchema: z.ZodObject<{}, z.core.$strip>;
3
- export type GetLoginConfigPathOptions = z.infer<typeof GetLoginConfigPathSchema>;
@@ -1,5 +0,0 @@
1
- import { z } from "zod";
2
- // Get login config path schema - simple command with no parameters
3
- export const GetLoginConfigPathSchema = z
4
- .object({})
5
- .describe("Show the path to the login configuration file");
@@ -1,15 +0,0 @@
1
- export { loginPlugin } from "./login";
2
- export { signupPlugin } from "./signup";
3
- export { logoutPlugin } from "./logout";
4
- export { mcpPlugin } from "./mcp";
5
- export { bundleCodePlugin } from "./bundleCode";
6
- export { getLoginConfigPathPlugin } from "./getLoginConfigPath";
7
- export { addAppsPlugin } from "./add";
8
- export { generateAppTypesPlugin } from "./generateAppTypes";
9
- export { buildManifestPlugin } from "./buildManifest";
10
- export { feedbackPlugin } from "./feedback";
11
- export { curlPlugin } from "./curl";
12
- export { cliOverridesPlugin } from "./cliOverrides";
13
- export { initPlugin } from "./init";
14
- export { drainTriggerInboxCliPlugin } from "./drainTriggerInbox";
15
- export { watchTriggerInboxCliPlugin } from "./watchTriggerInbox";
@@ -1,15 +0,0 @@
1
- export { loginPlugin } from "./login";
2
- export { signupPlugin } from "./signup";
3
- export { logoutPlugin } from "./logout";
4
- export { mcpPlugin } from "./mcp";
5
- export { bundleCodePlugin } from "./bundleCode";
6
- export { getLoginConfigPathPlugin } from "./getLoginConfigPath";
7
- export { addAppsPlugin } from "./add";
8
- export { generateAppTypesPlugin } from "./generateAppTypes";
9
- export { buildManifestPlugin } from "./buildManifest";
10
- export { feedbackPlugin } from "./feedback";
11
- export { curlPlugin } from "./curl";
12
- export { cliOverridesPlugin } from "./cliOverrides";
13
- export { initPlugin } from "./init";
14
- export { drainTriggerInboxCliPlugin } from "./drainTriggerInbox";
15
- export { watchTriggerInboxCliPlugin } from "./watchTriggerInbox";
@@ -1,9 +0,0 @@
1
- import type { DisplayHooks, RunnableSetupStep, SetupStepId } from "./types";
2
- import type { PackageManager } from "../../utils/package-manager-detector";
3
- export declare function createConsoleDisplayHooks(): DisplayHooks;
4
- export declare function displaySummaryAndNextSteps({ projectName, steps, completedSetupStepIds, packageManager, }: {
5
- projectName: string;
6
- steps: RunnableSetupStep[];
7
- completedSetupStepIds: SetupStepId[];
8
- packageManager: PackageManager;
9
- }): void;
@@ -1,72 +0,0 @@
1
- import chalk from "chalk";
2
- import { buildNextSteps } from "./steps";
3
- import { getPackageManagerCommands } from "./utils";
4
- export function createConsoleDisplayHooks() {
5
- return {
6
- onItemComplete: (message) => console.log(" " + chalk.green("✓") + " " + chalk.dim(message)),
7
- onWarn: (message) => console.warn(chalk.yellow("!") + " " + message),
8
- onStepStart: ({ description, stepNumber, totalSteps, command, nonInteractive, }) => {
9
- const progressMessage = `${description}...`;
10
- const stepCounter = chalk.dim(`${stepNumber}/${totalSteps}`);
11
- if (nonInteractive) {
12
- console.log("\n" +
13
- chalk.bold(`❯ ${progressMessage}`) +
14
- " " +
15
- stepCounter +
16
- "\n");
17
- }
18
- else {
19
- console.log(chalk.dim("→") + " " + progressMessage + " " + stepCounter);
20
- }
21
- if (command) {
22
- console.log(" " + chalk.cyan(`$ ${command}`));
23
- }
24
- },
25
- onStepSuccess: ({ stepNumber, totalSteps }) => console.log("\n" +
26
- chalk.green("✓") +
27
- " " +
28
- chalk.dim(`Step ${stepNumber}/${totalSteps} complete`) +
29
- "\n"),
30
- onStepError: ({ description, command, err }) => {
31
- const detail = err instanceof Error && err.message
32
- ? `\n ${chalk.dim(err.message)}`
33
- : "";
34
- const hint = command
35
- ? `\n ${chalk.dim("run manually:")} ${chalk.cyan(`$ ${command}`)}`
36
- : "";
37
- console.error(`\n${chalk.red("✖")} ${chalk.bold(description)}${chalk.dim(" failed")}${detail}${hint}`);
38
- },
39
- };
40
- }
41
- export function displaySummaryAndNextSteps({ projectName, steps, completedSetupStepIds, packageManager, }) {
42
- const formatStatus = (complete) => ({
43
- icon: complete ? chalk.green("✓") : chalk.yellow("!"),
44
- text: complete
45
- ? chalk.green("Setup complete")
46
- : chalk.yellow("Setup interrupted"),
47
- });
48
- const formatNextStep = (step, i) => " " + chalk.dim(`${i + 1}.`) + " " + chalk.bold(step.description);
49
- const formatCommand = (cmd) => " " + chalk.cyan(`$ ${cmd}`);
50
- const formatCompletedStep = (step) => " " + chalk.green("✓") + " " + step.description;
51
- const { execCmd } = getPackageManagerCommands({ packageManager });
52
- const leftoverSteps = steps.filter((s) => !completedSetupStepIds.includes(s.id));
53
- const isComplete = leftoverSteps.length === 0;
54
- const status = formatStatus(isComplete);
55
- console.log("\n" + chalk.bold("❯ Summary") + "\n");
56
- console.log(" " + chalk.dim("Project") + " " + chalk.bold(projectName));
57
- console.log(" " + chalk.dim("Status") + " " + status.icon + " " + status.text);
58
- const completedSteps = steps.filter((s) => completedSetupStepIds.includes(s.id));
59
- if (completedSteps.length > 0) {
60
- console.log();
61
- for (const step of completedSteps)
62
- console.log(formatCompletedStep(step));
63
- }
64
- const nextSteps = buildNextSteps({ projectName, leftoverSteps, execCmd });
65
- console.log("\n" + chalk.bold("❯ Next Steps") + "\n");
66
- nextSteps.forEach((step, i) => {
67
- console.log(formatNextStep(step, i));
68
- if (step.command)
69
- console.log(formatCommand(step.command));
70
- console.log();
71
- });
72
- }
@@ -1,21 +0,0 @@
1
- export { toProjectName } from "./utils";
2
- export declare const initPlugin: (sdk: {
3
- context: import("@zapier/zapier-sdk").EventEmissionContext;
4
- } & {
5
- context: {
6
- meta: Record<string, import("@zapier/zapier-sdk").PluginMeta>;
7
- };
8
- }) => {
9
- init: (options?: {
10
- projectName: string;
11
- nonInteractive?: boolean | undefined;
12
- skipPrompts?: boolean | undefined;
13
- } | undefined) => Promise<void>;
14
- } & {
15
- context: {
16
- meta: {
17
- init: import("@zapier/zapier-sdk").PluginMeta<unknown>;
18
- };
19
- };
20
- };
21
- export type InitPluginProvides = ReturnType<typeof initPlugin>;