@zapier/zapier-sdk 0.0.3 → 0.1.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.
Files changed (171) hide show
  1. package/dist/api/auth.d.ts +8 -0
  2. package/dist/api/auth.js +29 -0
  3. package/dist/api/client.d.ts +8 -0
  4. package/dist/api/client.js +102 -0
  5. package/dist/api/debug.d.ts +12 -0
  6. package/dist/api/debug.js +50 -0
  7. package/dist/api/index.d.ts +26 -0
  8. package/dist/api/index.js +51 -0
  9. package/dist/api/polling.d.ts +17 -0
  10. package/dist/api/polling.js +34 -0
  11. package/dist/{types.d.ts → api/types.d.ts} +37 -88
  12. package/dist/api/types.js +9 -0
  13. package/dist/functions/{bundleCode.d.ts → bundleCode/index.d.ts} +1 -8
  14. package/dist/functions/bundleCode/info.d.ts +27 -0
  15. package/dist/functions/bundleCode/info.js +11 -0
  16. package/dist/functions/bundleCode/schemas.d.ts +27 -0
  17. package/dist/functions/bundleCode/schemas.js +22 -0
  18. package/dist/functions/{generateTypes.d.ts → generateTypes/index.d.ts} +2 -7
  19. package/dist/functions/{generateTypes.js → generateTypes/index.js} +58 -24
  20. package/dist/functions/generateTypes/info.d.ts +21 -0
  21. package/dist/functions/generateTypes/info.js +11 -0
  22. package/dist/functions/generateTypes/schemas.d.ts +30 -0
  23. package/dist/functions/generateTypes/schemas.js +14 -0
  24. package/dist/functions/{getAction.d.ts → getAction/index.d.ts} +2 -6
  25. package/dist/functions/{getAction.js → getAction/index.js} +6 -5
  26. package/dist/functions/getAction/info.d.ts +18 -0
  27. package/dist/functions/getAction/info.js +11 -0
  28. package/dist/functions/getAction/schemas.d.ts +30 -0
  29. package/dist/functions/getAction/schemas.js +13 -0
  30. package/dist/functions/{getApp.d.ts → getApp/index.d.ts} +2 -4
  31. package/dist/functions/{getApp.js → getApp/index.js} +6 -10
  32. package/dist/functions/getApp/info.d.ts +12 -0
  33. package/dist/functions/getApp/info.js +11 -0
  34. package/dist/functions/getApp/schemas.d.ts +24 -0
  35. package/dist/functions/getApp/schemas.js +11 -0
  36. package/dist/functions/{listActions.d.ts → listActions/index.d.ts} +3 -6
  37. package/dist/functions/{listActions.js → listActions/index.js} +4 -3
  38. package/dist/functions/listActions/info.d.ts +15 -0
  39. package/dist/functions/listActions/info.js +11 -0
  40. package/dist/functions/listActions/schemas.d.ts +27 -0
  41. package/dist/functions/listActions/schemas.js +14 -0
  42. package/dist/functions/{listApps.d.ts → listApps/index.d.ts} +2 -6
  43. package/dist/functions/{listApps.js → listApps/index.js} +1 -1
  44. package/dist/functions/listApps/info.d.ts +18 -0
  45. package/dist/functions/listApps/info.js +11 -0
  46. package/dist/functions/listApps/schemas.d.ts +30 -0
  47. package/dist/functions/listApps/schemas.js +15 -0
  48. package/dist/functions/{listAuths.d.ts → listAuths/index.d.ts} +3 -9
  49. package/dist/functions/{listAuths.js → listAuths/index.js} +5 -5
  50. package/dist/functions/listAuths/info.d.ts +24 -0
  51. package/dist/functions/listAuths/info.js +11 -0
  52. package/dist/functions/listAuths/schemas.d.ts +36 -0
  53. package/dist/functions/listAuths/schemas.js +17 -0
  54. package/dist/functions/{listFields.d.ts → listFields/index.d.ts} +3 -9
  55. package/dist/functions/{listFields.js → listFields/index.js} +8 -10
  56. package/dist/functions/listFields/info.d.ts +24 -0
  57. package/dist/functions/listFields/info.js +11 -0
  58. package/dist/functions/listFields/schemas.d.ts +36 -0
  59. package/dist/functions/listFields/schemas.js +17 -0
  60. package/dist/functions/{runAction.d.ts → runAction/index.d.ts} +2 -8
  61. package/dist/functions/{runAction.js → runAction/index.js} +15 -14
  62. package/dist/functions/runAction/info.d.ts +24 -0
  63. package/dist/functions/runAction/info.js +11 -0
  64. package/dist/functions/runAction/schemas.d.ts +36 -0
  65. package/dist/functions/runAction/schemas.js +15 -0
  66. package/dist/index.d.ts +6 -3
  67. package/dist/index.js +7 -3
  68. package/dist/plugins/apps/index.d.ts +8 -0
  69. package/dist/plugins/apps/index.js +77 -0
  70. package/dist/plugins/apps/info.d.ts +6 -0
  71. package/dist/plugins/apps/info.js +13 -0
  72. package/dist/plugins/apps/types.d.ts +21 -0
  73. package/dist/plugins/apps/types.js +2 -0
  74. package/dist/resolvers/actionKey.d.ts +8 -0
  75. package/dist/resolvers/actionKey.js +20 -0
  76. package/dist/resolvers/actionType.d.ts +8 -0
  77. package/dist/resolvers/actionType.js +21 -0
  78. package/dist/resolvers/appKey.d.ts +6 -0
  79. package/dist/resolvers/appKey.js +8 -0
  80. package/dist/resolvers/authenticationId.d.ts +8 -0
  81. package/dist/resolvers/authenticationId.js +29 -0
  82. package/dist/resolvers/index.d.ts +39 -0
  83. package/dist/resolvers/index.js +105 -0
  84. package/dist/resolvers/inputs.d.ts +7 -0
  85. package/dist/resolvers/inputs.js +15 -0
  86. package/dist/schema-utils.d.ts +39 -0
  87. package/dist/schema-utils.js +52 -0
  88. package/dist/schemas/Action.d.ts +21 -0
  89. package/dist/schemas/Action.js +31 -0
  90. package/dist/schemas/App.d.ts +19 -0
  91. package/dist/schemas/App.js +32 -0
  92. package/dist/schemas/Auth.d.ts +30 -0
  93. package/dist/schemas/Auth.js +49 -0
  94. package/dist/schemas/Field.d.ts +15 -0
  95. package/dist/schemas/Field.js +25 -0
  96. package/dist/sdk.d.ts +3 -4
  97. package/dist/sdk.js +96 -11
  98. package/dist/types/domain.d.ts +22 -0
  99. package/dist/types/domain.js +21 -0
  100. package/dist/types/properties.d.ts +21 -0
  101. package/dist/types/properties.js +45 -0
  102. package/dist/types/sdk.d.ts +21 -0
  103. package/dist/types/sdk.js +2 -0
  104. package/package.json +4 -2
  105. package/src/api/auth.ts +28 -0
  106. package/src/api/client.ts +148 -0
  107. package/src/api/debug.ts +58 -0
  108. package/src/api/index.ts +83 -0
  109. package/src/api/polling.ts +56 -0
  110. package/src/api/types.ts +177 -0
  111. package/src/functions/{bundleCode.ts → bundleCode/index.ts} +1 -8
  112. package/src/functions/bundleCode/info.ts +9 -0
  113. package/src/functions/bundleCode/schemas.ts +30 -0
  114. package/src/functions/{generateTypes.ts → generateTypes/index.ts} +70 -31
  115. package/src/functions/generateTypes/info.ts +9 -0
  116. package/src/functions/generateTypes/schemas.ts +38 -0
  117. package/src/functions/{getAction.ts → getAction/index.ts} +11 -12
  118. package/src/functions/getAction/info.ts +9 -0
  119. package/src/functions/getAction/schemas.ts +35 -0
  120. package/src/functions/{getApp.ts → getApp/index.ts} +9 -15
  121. package/src/functions/getApp/info.ts +9 -0
  122. package/src/functions/getApp/schemas.ts +31 -0
  123. package/src/functions/{listActions.ts → listActions/index.ts} +8 -10
  124. package/src/functions/listActions/info.ts +9 -0
  125. package/src/functions/listActions/schemas.ts +40 -0
  126. package/src/functions/{listApps.ts → listApps/index.ts} +3 -8
  127. package/src/functions/listApps/info.ts +9 -0
  128. package/src/functions/listApps/schemas.ts +43 -0
  129. package/src/functions/{listAuths.ts → listAuths/index.ts} +8 -16
  130. package/src/functions/listAuths/info.ts +9 -0
  131. package/src/functions/listAuths/schemas.ts +48 -0
  132. package/src/functions/{listFields.ts → listFields/index.ts} +11 -20
  133. package/src/functions/listFields/info.ts +9 -0
  134. package/src/functions/listFields/schemas.ts +46 -0
  135. package/src/functions/{runAction.ts → runAction/index.ts} +25 -23
  136. package/src/functions/runAction/info.ts +9 -0
  137. package/src/functions/runAction/schemas.ts +41 -0
  138. package/src/index.ts +13 -4
  139. package/src/plugins/apps/index.ts +144 -0
  140. package/src/plugins/apps/info.ts +12 -0
  141. package/src/plugins/apps/types.ts +34 -0
  142. package/src/resolvers/actionKey.ts +33 -0
  143. package/src/resolvers/actionType.ts +30 -0
  144. package/src/resolvers/appKey.ts +11 -0
  145. package/src/resolvers/authenticationId.ts +38 -0
  146. package/src/resolvers/index.ts +117 -0
  147. package/src/resolvers/inputs.ts +23 -0
  148. package/src/schema-utils.ts +119 -0
  149. package/src/schemas/Action.ts +40 -0
  150. package/src/schemas/App.ts +43 -0
  151. package/src/schemas/Auth.ts +62 -0
  152. package/src/schemas/Field.ts +34 -0
  153. package/src/sdk.ts +153 -19
  154. package/src/types/domain.ts +54 -0
  155. package/src/types/properties.ts +67 -0
  156. package/src/types/sdk.ts +42 -0
  157. package/dist/actions-sdk.d.ts +0 -47
  158. package/dist/actions-sdk.js +0 -208
  159. package/dist/api.d.ts +0 -62
  160. package/dist/api.js +0 -227
  161. package/dist/output-schemas.d.ts +0 -95
  162. package/dist/output-schemas.js +0 -138
  163. package/dist/schemas.d.ts +0 -338
  164. package/dist/schemas.js +0 -336
  165. package/dist/types.js +0 -41
  166. package/src/actions-sdk.ts +0 -356
  167. package/src/api.ts +0 -361
  168. package/src/output-schemas.ts +0 -196
  169. package/src/schemas.ts +0 -467
  170. package/src/types.ts +0 -257
  171. /package/dist/functions/{bundleCode.js → bundleCode/index.js} +0 -0
@@ -0,0 +1,62 @@
1
+ import { z } from "zod";
2
+ import { withFormatter } from "../schema-utils";
3
+
4
+ // ============================================================================
5
+ // Auth Schemas
6
+ // ============================================================================
7
+
8
+ export const AuthItemSchema = withFormatter(
9
+ z.object({
10
+ id: z.number(),
11
+ title: z.string().optional(),
12
+ label: z.string().optional(),
13
+ identifier: z.string().optional(),
14
+ account_id: z.string().optional(),
15
+ is_private: z.boolean().optional(),
16
+ shared_with_all: z.boolean().optional(),
17
+ marked_stale_at: z.string().optional(),
18
+ }),
19
+ {
20
+ format: (item) => {
21
+ const details = [];
22
+
23
+ if (item.identifier) {
24
+ details.push({
25
+ text: `Identifier: ${item.identifier}`,
26
+ style: "accent" as const,
27
+ });
28
+ }
29
+
30
+ if (item.label && item.title && item.label !== item.title) {
31
+ details.push({
32
+ text: `Label: ${item.label}`,
33
+ style: "normal" as const,
34
+ });
35
+ }
36
+
37
+ details.push({
38
+ text: `Account: ${item.account_id || "unknown"} | Private: ${item.is_private || false} | Shared: ${item.shared_with_all || false}`,
39
+ style: "dim" as const,
40
+ });
41
+
42
+ if (item.marked_stale_at) {
43
+ details.push({
44
+ text: `⚠️ Marked stale: ${new Date(item.marked_stale_at).toLocaleDateString()}`,
45
+ style: "warning" as const,
46
+ });
47
+ }
48
+
49
+ return {
50
+ title: item.title || item.label || `Authentication ${item.id}`,
51
+ subtitle: `(ID: ${item.id})`,
52
+ details,
53
+ };
54
+ },
55
+ },
56
+ );
57
+
58
+ // ============================================================================
59
+ // Type Exports
60
+ // ============================================================================
61
+
62
+ export type AuthItem = z.infer<typeof AuthItemSchema>;
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ import { withFormatter } from "../schema-utils";
3
+
4
+ // ============================================================================
5
+ // Field Schemas
6
+ // ============================================================================
7
+
8
+ export const FieldItemSchema = withFormatter(
9
+ z.object({
10
+ key: z.string(),
11
+ name: z.string().optional(),
12
+ description: z.string().optional(),
13
+ }),
14
+ {
15
+ format: (item) => {
16
+ const details = [];
17
+ if (item.description) {
18
+ details.push({ text: item.description, style: "dim" as const });
19
+ }
20
+
21
+ return {
22
+ title: item.name || item.key,
23
+ subtitle: `(${item.key})`,
24
+ details,
25
+ };
26
+ },
27
+ },
28
+ );
29
+
30
+ // ============================================================================
31
+ // Type Exports
32
+ // ============================================================================
33
+
34
+ export type FieldItem = z.infer<typeof FieldItemSchema>;
package/src/sdk.ts CHANGED
@@ -1,26 +1,160 @@
1
- import { createActionsSdk, ActionsSdk } from "./actions-sdk";
2
- import { BaseSdkOptions } from "./types";
3
-
4
- export interface ZapierSdk extends ActionsSdk {
5
- // Future SDK namespaces will be added here
6
- // workflows: WorkflowsSdk
7
- // interfaces: InterfacesSdk
8
- // tables: TablesSdk
1
+ import { createZapierApi } from "./api";
2
+ import { BaseSdkOptions } from "./types/domain";
3
+ // Import function implementations
4
+ import { listApps } from "./functions/listApps";
5
+ import { getApp } from "./functions/getApp";
6
+ import { listActions } from "./functions/listActions";
7
+ import { getAction } from "./functions/getAction";
8
+ import { runAction } from "./functions/runAction";
9
+ import { listAuths } from "./functions/listAuths";
10
+ import { listFields } from "./functions/listFields";
11
+ import { generateTypes } from "./functions/generateTypes";
12
+ import { bundleCode } from "./functions/bundleCode";
13
+
14
+ // Import function registry info objects (only for CLI registry)
15
+ import { listAppsInfo } from "./functions/listApps/info";
16
+ import { getAppInfo } from "./functions/getApp/info";
17
+ import { listActionsInfo } from "./functions/listActions/info";
18
+ import { getActionInfo } from "./functions/getAction/info";
19
+ import { runActionInfo } from "./functions/runAction/info";
20
+ import { listAuthsInfo } from "./functions/listAuths/info";
21
+ import { listFieldsInfo } from "./functions/listFields/info";
22
+ import { generateTypesInfo } from "./functions/generateTypes/info";
23
+ import { bundleCodeInfo } from "./functions/bundleCode/info";
24
+
25
+ // Function registry as array - uses names from function info objects
26
+ const functionRegistry = [
27
+ listAppsInfo,
28
+ getAppInfo,
29
+ listActionsInfo,
30
+ getActionInfo,
31
+ runActionInfo,
32
+ listAuthsInfo,
33
+ listFieldsInfo,
34
+ generateTypesInfo,
35
+ bundleCodeInfo,
36
+ ];
37
+
38
+ // Import the properly typed SDK interface
39
+ import type { ZapierSdk } from "./types/sdk";
40
+
41
+ // Import plugin functions
42
+ import { createAppsPlugin } from "./plugins/apps/index";
43
+
44
+ // TODO: Add plugin registry back when needed for CLI compatibility
45
+
46
+ // Base SDK functions interface (functions + registry, no plugins)
47
+ interface BaseZapierSdkWithFunctions {
48
+ __registry: Array<{
49
+ name: string;
50
+ inputSchema: any;
51
+ implementation: Function;
52
+ }>;
53
+ listApps: ZapierSdk["listApps"];
54
+ getApp: ZapierSdk["getApp"];
55
+ listActions: ZapierSdk["listActions"];
56
+ getAction: ZapierSdk["getAction"];
57
+ runAction: ZapierSdk["runAction"];
58
+ listAuths: ZapierSdk["listAuths"];
59
+ listFields: ZapierSdk["listFields"];
60
+ generateTypes: ZapierSdk["generateTypes"];
61
+ bundleCode: ZapierSdk["bundleCode"];
9
62
  }
10
63
 
64
+ // Full SDK interface with plugins applied
65
+ export type { ZapierSdk } from "./types/sdk";
66
+
11
67
  export interface ZapierSdkOptions extends BaseSdkOptions {}
12
68
 
69
+ function createBaseZapierSdk(
70
+ options: ZapierSdkOptions = {},
71
+ ): BaseZapierSdkWithFunctions {
72
+ // Auto-load .env files (searches up directory tree)
73
+ try {
74
+ const { findUpSync } = require("find-up");
75
+ const envPath = findUpSync(".env");
76
+ if (envPath) {
77
+ require("dotenv").config({ path: envPath, quiet: true });
78
+ }
79
+ } catch {
80
+ // Silently fail if dotenv/find-up not available or .env not found
81
+ }
82
+
83
+ const {
84
+ fetch: customFetch = globalThis.fetch,
85
+ baseUrl = "https://zapier.com",
86
+ token,
87
+ debug = false,
88
+ } = options;
89
+
90
+ // If no token provided, try to get it from environment variable
91
+ const finalToken = token || process.env.ZAPIER_TOKEN;
92
+
93
+ // Create the API client
94
+ const api = createZapierApi({
95
+ baseUrl,
96
+ token: finalToken,
97
+ debug,
98
+ fetch: customFetch,
99
+ });
100
+
101
+ // Build SDK directly - TypeScript will enforce correct implementation
102
+ const sdk: BaseZapierSdkWithFunctions = {
103
+ // Registry for CLI
104
+ __registry: functionRegistry,
105
+
106
+ // Function implementations with API config injection
107
+ listApps: (options = {}) =>
108
+ listApps({ ...options, api, token: finalToken }),
109
+ getApp: (options) => getApp({ ...options, api, token: finalToken }),
110
+ listActions: (options = {}) =>
111
+ listActions({ ...options, api, token: finalToken }),
112
+ getAction: (options) => getAction({ ...options, api, token: finalToken }),
113
+ runAction: (options) => runAction({ ...options, api, token: finalToken }),
114
+ listAuths: (options = {}) =>
115
+ listAuths({ ...options, api, token: finalToken }),
116
+ listFields: (options) => listFields({ ...options, api, token: finalToken }),
117
+ generateTypes: (options) =>
118
+ generateTypes({ ...options, api, token: finalToken }),
119
+ bundleCode: (options) => bundleCode(options), // No API config needed
120
+ };
121
+
122
+ return sdk;
123
+ }
124
+
13
125
  export function createZapierSdk(options: ZapierSdkOptions = {}): ZapierSdk {
14
- // Create individual SDKs
15
- const actionsSdk = createActionsSdk(options);
16
-
17
- // For now, we just return the actions SDK
18
- // Later we'll combine multiple SDKs here
19
- return {
20
- ...actionsSdk,
21
- // Future SDKs will be spread here:
22
- // ...workflowsSdk,
23
- // ...interfacesSdk,
24
- // ...tablesSdk,
126
+ // Create base SDK
127
+ const baseSdk = createBaseZapierSdk(options);
128
+
129
+ // Extract options needed for plugins
130
+ const {
131
+ fetch: customFetch = globalThis.fetch,
132
+ baseUrl = "https://zapier.com",
133
+ token,
134
+ debug = false,
135
+ } = options;
136
+
137
+ const finalToken = token || process.env.ZAPIER_TOKEN;
138
+
139
+ // Create the API client for plugins
140
+ const api = createZapierApi({
141
+ baseUrl,
142
+ token: finalToken,
143
+ debug,
144
+ fetch: customFetch,
145
+ });
146
+
147
+ // Create plugins directly - TypeScript will enforce correct implementation
148
+ const appsPlugin = createAppsPlugin({
149
+ api,
150
+ token: finalToken,
151
+ });
152
+
153
+ // Compose final SDK - TypeScript will enforce we have all required properties
154
+ const fullSdk: ZapierSdk = {
155
+ ...baseSdk,
156
+ apps: appsPlugin,
25
157
  };
158
+
159
+ return fullSdk;
26
160
  }
@@ -0,0 +1,54 @@
1
+ // Re-export API types from the API module
2
+ export type {
3
+ Integration,
4
+ Action,
5
+ Trigger,
6
+ Field,
7
+ Choice,
8
+ ActionExecutionResult,
9
+ ActionField,
10
+ ActionFieldChoice,
11
+ NeedsRequest,
12
+ NeedsResponse,
13
+ Authentication,
14
+ AuthenticationsResponse,
15
+ } from "../api/types";
16
+
17
+ // SDK Configuration Types
18
+ export interface ActionExecutionOptions {
19
+ inputs?: Record<string, any>;
20
+ authenticationId?: number;
21
+ }
22
+
23
+ export interface AuthObject {
24
+ id: number;
25
+ }
26
+
27
+ export interface BaseSdkOptions {
28
+ token?: string;
29
+ fetch?: typeof fetch;
30
+ baseUrl?: string;
31
+ debug?: boolean;
32
+ }
33
+
34
+ // Error Classes
35
+ export class ZapierSdkError extends Error {
36
+ constructor(
37
+ message: string,
38
+ public code?: string,
39
+ ) {
40
+ super(message);
41
+ this.name = "ZapierSdkError";
42
+ }
43
+ }
44
+
45
+ export class AppNotFoundError extends ZapierSdkError {
46
+ appKey: string;
47
+
48
+ constructor(appKey: string) {
49
+ super(`App "${appKey}" not found`);
50
+ this.name = "AppNotFoundError";
51
+ this.code = "APP_NOT_FOUND";
52
+ this.appKey = appKey;
53
+ }
54
+ }
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+
3
+ // Shared property definitions for common parameters across functions
4
+ // These can be reused in function schemas without duplication
5
+
6
+ export const AppKeyPropertySchema = z
7
+ .string()
8
+ .min(1)
9
+ .describe("App slug (e.g., 'slack', 'github')");
10
+
11
+ export const ActionTypePropertySchema = z
12
+ .enum(["read", "write", "search", "create", "update", "delete"])
13
+ .describe("Action type that matches the action's defined type");
14
+
15
+ export const ActionKeyPropertySchema = z
16
+ .string()
17
+ .min(1)
18
+ .describe("Action key to execute");
19
+
20
+ export const AuthenticationIdPropertySchema = z
21
+ .number()
22
+ .int()
23
+ .describe("Authentication ID to use for this action");
24
+
25
+ export const InputsPropertySchema = z
26
+ .record(z.any())
27
+ .describe("Input parameters for the action");
28
+
29
+ export const LimitPropertySchema = z
30
+ .number()
31
+ .int()
32
+ .min(1)
33
+ .max(1000)
34
+ .default(50)
35
+ .describe("Maximum number of items to return");
36
+
37
+ export const OffsetPropertySchema = z
38
+ .number()
39
+ .int()
40
+ .min(0)
41
+ .default(0)
42
+ .describe("Number of items to skip for pagination");
43
+
44
+ export const OutputPropertySchema = z.string().describe("Output file path");
45
+
46
+ export const DebugPropertySchema = z
47
+ .boolean()
48
+ .default(false)
49
+ .describe("Enable debug logging");
50
+
51
+ export const ParamsPropertySchema = z
52
+ .record(z.any())
53
+ .describe("Additional parameters");
54
+
55
+ // Inferred TypeScript types for the properties
56
+ export type AppKeyProperty = z.infer<typeof AppKeyPropertySchema>;
57
+ export type ActionTypeProperty = z.infer<typeof ActionTypePropertySchema>;
58
+ export type ActionKeyProperty = z.infer<typeof ActionKeyPropertySchema>;
59
+ export type AuthenticationIdProperty = z.infer<
60
+ typeof AuthenticationIdPropertySchema
61
+ >;
62
+ export type InputsProperty = z.infer<typeof InputsPropertySchema>;
63
+ export type LimitProperty = z.infer<typeof LimitPropertySchema>;
64
+ export type OffsetProperty = z.infer<typeof OffsetPropertySchema>;
65
+ export type OutputProperty = z.infer<typeof OutputPropertySchema>;
66
+ export type DebugProperty = z.infer<typeof DebugPropertySchema>;
67
+ export type ParamsProperty = z.infer<typeof ParamsPropertySchema>;
@@ -0,0 +1,42 @@
1
+ // SDK interface composed from individual function interfaces
2
+ import type { ListActionsSdkFunction } from "../functions/listActions/schemas";
3
+ import type { GetActionSdkFunction } from "../functions/getAction/schemas";
4
+ import type { GetAppSdkFunction } from "../functions/getApp/schemas";
5
+ import type { RunActionSdkFunction } from "../functions/runAction/schemas";
6
+ import type { ListFieldsSdkFunction } from "../functions/listFields/schemas";
7
+ import type { ListAuthsSdkFunction } from "../functions/listAuths/schemas";
8
+ import type { GenerateTypesSdkFunction } from "../functions/generateTypes/schemas";
9
+ import type { ListAppsSdkFunction } from "../functions/listApps/schemas";
10
+ import type { BundleCodeSdkFunction } from "../functions/bundleCode/schemas";
11
+
12
+ // Plugin interfaces
13
+ import type { AppsPluginSdkExtension } from "../plugins/apps/types";
14
+
15
+ // Compose SDK functions from individual function interfaces
16
+ export interface ZapierSdkFunctions
17
+ extends ListActionsSdkFunction,
18
+ GetActionSdkFunction,
19
+ GetAppSdkFunction,
20
+ RunActionSdkFunction,
21
+ ListFieldsSdkFunction,
22
+ ListAuthsSdkFunction,
23
+ GenerateTypesSdkFunction,
24
+ ListAppsSdkFunction,
25
+ BundleCodeSdkFunction {
26
+ // All functions now properly typed!
27
+ }
28
+
29
+ // Compose SDK plugins from individual plugin interfaces
30
+ export interface ZapierSdkPlugins extends AppsPluginSdkExtension {
31
+ // All plugins now properly typed!
32
+ }
33
+
34
+ // Main SDK interface with functions and plugins
35
+ export interface ZapierSdk extends ZapierSdkFunctions, ZapierSdkPlugins {
36
+ // Special property for CLI to access schemas
37
+ __registry: Array<{
38
+ name: string;
39
+ inputSchema: any;
40
+ implementation: Function;
41
+ }>;
42
+ }
@@ -1,47 +0,0 @@
1
- import { Integration, Action, ActionExecutionOptions, ActionExecutionResult, ActionField, Authentication, BaseSdkOptions } from "./types";
2
- import { AppsListOptions, AppsGetOptions, ActionsListOptions, ActionsGetOptions, ActionsRunOptions, AuthsListOptions, AuthsFindOptions, FieldsListOptions, GenerateOptions, BundleOptions } from "./schemas";
3
- export * from "./schemas";
4
- export * from "./output-schemas";
5
- export interface ActionsSdk {
6
- apps: AppsService;
7
- actions: ActionsService;
8
- auths: AuthsService;
9
- fields: FieldsService;
10
- generate: GenerateFunction;
11
- bundle: BundleFunction;
12
- }
13
- export interface AppsService {
14
- list(options?: AppsListOptions): Promise<Integration[]>;
15
- get(options: AppsGetOptions): Promise<Integration>;
16
- }
17
- interface ActionRunner {
18
- (params: ActionsRunOptions): Promise<ActionExecutionResult>;
19
- }
20
- interface ActionProxy {
21
- [app: string]: {
22
- [type: string]: {
23
- [action: string]: (options?: ActionExecutionOptions) => Promise<ActionExecutionResult>;
24
- };
25
- };
26
- }
27
- export interface GenerateFunction {
28
- (options: GenerateOptions): Promise<string>;
29
- }
30
- export interface BundleFunction {
31
- (options: BundleOptions): Promise<string>;
32
- }
33
- export interface ActionsService {
34
- list(options?: ActionsListOptions): Promise<Action[]>;
35
- get(options: ActionsGetOptions): Promise<Action>;
36
- run: ActionRunner & ActionProxy;
37
- }
38
- export interface AuthsService {
39
- list(options?: AuthsListOptions): Promise<Authentication[]>;
40
- find(options: AuthsFindOptions): number;
41
- }
42
- export interface FieldsService {
43
- list(options: FieldsListOptions): Promise<ActionField[]>;
44
- }
45
- export interface ActionsSdkOptions extends BaseSdkOptions {
46
- }
47
- export declare function createActionsSdk(options?: ActionsSdkOptions): ActionsSdk;