@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.
- package/dist/api/auth.d.ts +8 -0
- package/dist/api/auth.js +29 -0
- package/dist/api/client.d.ts +8 -0
- package/dist/api/client.js +102 -0
- package/dist/api/debug.d.ts +12 -0
- package/dist/api/debug.js +50 -0
- package/dist/api/index.d.ts +26 -0
- package/dist/api/index.js +51 -0
- package/dist/api/polling.d.ts +17 -0
- package/dist/api/polling.js +34 -0
- package/dist/{types.d.ts → api/types.d.ts} +37 -88
- package/dist/api/types.js +9 -0
- package/dist/functions/{bundleCode.d.ts → bundleCode/index.d.ts} +1 -8
- package/dist/functions/bundleCode/info.d.ts +27 -0
- package/dist/functions/bundleCode/info.js +11 -0
- package/dist/functions/bundleCode/schemas.d.ts +27 -0
- package/dist/functions/bundleCode/schemas.js +22 -0
- package/dist/functions/{generateTypes.d.ts → generateTypes/index.d.ts} +2 -7
- package/dist/functions/{generateTypes.js → generateTypes/index.js} +58 -24
- package/dist/functions/generateTypes/info.d.ts +21 -0
- package/dist/functions/generateTypes/info.js +11 -0
- package/dist/functions/generateTypes/schemas.d.ts +30 -0
- package/dist/functions/generateTypes/schemas.js +14 -0
- package/dist/functions/{getAction.d.ts → getAction/index.d.ts} +2 -6
- package/dist/functions/{getAction.js → getAction/index.js} +6 -5
- package/dist/functions/getAction/info.d.ts +18 -0
- package/dist/functions/getAction/info.js +11 -0
- package/dist/functions/getAction/schemas.d.ts +30 -0
- package/dist/functions/getAction/schemas.js +13 -0
- package/dist/functions/{getApp.d.ts → getApp/index.d.ts} +2 -4
- package/dist/functions/{getApp.js → getApp/index.js} +6 -10
- package/dist/functions/getApp/info.d.ts +12 -0
- package/dist/functions/getApp/info.js +11 -0
- package/dist/functions/getApp/schemas.d.ts +24 -0
- package/dist/functions/getApp/schemas.js +11 -0
- package/dist/functions/{listActions.d.ts → listActions/index.d.ts} +3 -6
- package/dist/functions/{listActions.js → listActions/index.js} +4 -3
- package/dist/functions/listActions/info.d.ts +15 -0
- package/dist/functions/listActions/info.js +11 -0
- package/dist/functions/listActions/schemas.d.ts +27 -0
- package/dist/functions/listActions/schemas.js +14 -0
- package/dist/functions/{listApps.d.ts → listApps/index.d.ts} +2 -6
- package/dist/functions/{listApps.js → listApps/index.js} +1 -1
- package/dist/functions/listApps/info.d.ts +18 -0
- package/dist/functions/listApps/info.js +11 -0
- package/dist/functions/listApps/schemas.d.ts +30 -0
- package/dist/functions/listApps/schemas.js +15 -0
- package/dist/functions/{listAuths.d.ts → listAuths/index.d.ts} +3 -9
- package/dist/functions/{listAuths.js → listAuths/index.js} +5 -5
- package/dist/functions/listAuths/info.d.ts +24 -0
- package/dist/functions/listAuths/info.js +11 -0
- package/dist/functions/listAuths/schemas.d.ts +36 -0
- package/dist/functions/listAuths/schemas.js +17 -0
- package/dist/functions/{listFields.d.ts → listFields/index.d.ts} +3 -9
- package/dist/functions/{listFields.js → listFields/index.js} +8 -10
- package/dist/functions/listFields/info.d.ts +24 -0
- package/dist/functions/listFields/info.js +11 -0
- package/dist/functions/listFields/schemas.d.ts +36 -0
- package/dist/functions/listFields/schemas.js +17 -0
- package/dist/functions/{runAction.d.ts → runAction/index.d.ts} +2 -8
- package/dist/functions/{runAction.js → runAction/index.js} +15 -14
- package/dist/functions/runAction/info.d.ts +24 -0
- package/dist/functions/runAction/info.js +11 -0
- package/dist/functions/runAction/schemas.d.ts +36 -0
- package/dist/functions/runAction/schemas.js +15 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +7 -3
- package/dist/plugins/apps/index.d.ts +8 -0
- package/dist/plugins/apps/index.js +77 -0
- package/dist/plugins/apps/info.d.ts +6 -0
- package/dist/plugins/apps/info.js +13 -0
- package/dist/plugins/apps/types.d.ts +21 -0
- package/dist/plugins/apps/types.js +2 -0
- package/dist/resolvers/actionKey.d.ts +8 -0
- package/dist/resolvers/actionKey.js +20 -0
- package/dist/resolvers/actionType.d.ts +8 -0
- package/dist/resolvers/actionType.js +21 -0
- package/dist/resolvers/appKey.d.ts +6 -0
- package/dist/resolvers/appKey.js +8 -0
- package/dist/resolvers/authenticationId.d.ts +8 -0
- package/dist/resolvers/authenticationId.js +29 -0
- package/dist/resolvers/index.d.ts +39 -0
- package/dist/resolvers/index.js +105 -0
- package/dist/resolvers/inputs.d.ts +7 -0
- package/dist/resolvers/inputs.js +15 -0
- package/dist/schema-utils.d.ts +39 -0
- package/dist/schema-utils.js +52 -0
- package/dist/schemas/Action.d.ts +21 -0
- package/dist/schemas/Action.js +31 -0
- package/dist/schemas/App.d.ts +19 -0
- package/dist/schemas/App.js +32 -0
- package/dist/schemas/Auth.d.ts +30 -0
- package/dist/schemas/Auth.js +49 -0
- package/dist/schemas/Field.d.ts +15 -0
- package/dist/schemas/Field.js +25 -0
- package/dist/sdk.d.ts +3 -4
- package/dist/sdk.js +96 -11
- package/dist/types/domain.d.ts +22 -0
- package/dist/types/domain.js +21 -0
- package/dist/types/properties.d.ts +21 -0
- package/dist/types/properties.js +45 -0
- package/dist/types/sdk.d.ts +21 -0
- package/dist/types/sdk.js +2 -0
- package/package.json +4 -2
- package/src/api/auth.ts +28 -0
- package/src/api/client.ts +148 -0
- package/src/api/debug.ts +58 -0
- package/src/api/index.ts +83 -0
- package/src/api/polling.ts +56 -0
- package/src/api/types.ts +177 -0
- package/src/functions/{bundleCode.ts → bundleCode/index.ts} +1 -8
- package/src/functions/bundleCode/info.ts +9 -0
- package/src/functions/bundleCode/schemas.ts +30 -0
- package/src/functions/{generateTypes.ts → generateTypes/index.ts} +70 -31
- package/src/functions/generateTypes/info.ts +9 -0
- package/src/functions/generateTypes/schemas.ts +38 -0
- package/src/functions/{getAction.ts → getAction/index.ts} +11 -12
- package/src/functions/getAction/info.ts +9 -0
- package/src/functions/getAction/schemas.ts +35 -0
- package/src/functions/{getApp.ts → getApp/index.ts} +9 -15
- package/src/functions/getApp/info.ts +9 -0
- package/src/functions/getApp/schemas.ts +31 -0
- package/src/functions/{listActions.ts → listActions/index.ts} +8 -10
- package/src/functions/listActions/info.ts +9 -0
- package/src/functions/listActions/schemas.ts +40 -0
- package/src/functions/{listApps.ts → listApps/index.ts} +3 -8
- package/src/functions/listApps/info.ts +9 -0
- package/src/functions/listApps/schemas.ts +43 -0
- package/src/functions/{listAuths.ts → listAuths/index.ts} +8 -16
- package/src/functions/listAuths/info.ts +9 -0
- package/src/functions/listAuths/schemas.ts +48 -0
- package/src/functions/{listFields.ts → listFields/index.ts} +11 -20
- package/src/functions/listFields/info.ts +9 -0
- package/src/functions/listFields/schemas.ts +46 -0
- package/src/functions/{runAction.ts → runAction/index.ts} +25 -23
- package/src/functions/runAction/info.ts +9 -0
- package/src/functions/runAction/schemas.ts +41 -0
- package/src/index.ts +13 -4
- package/src/plugins/apps/index.ts +144 -0
- package/src/plugins/apps/info.ts +12 -0
- package/src/plugins/apps/types.ts +34 -0
- package/src/resolvers/actionKey.ts +33 -0
- package/src/resolvers/actionType.ts +30 -0
- package/src/resolvers/appKey.ts +11 -0
- package/src/resolvers/authenticationId.ts +38 -0
- package/src/resolvers/index.ts +117 -0
- package/src/resolvers/inputs.ts +23 -0
- package/src/schema-utils.ts +119 -0
- package/src/schemas/Action.ts +40 -0
- package/src/schemas/App.ts +43 -0
- package/src/schemas/Auth.ts +62 -0
- package/src/schemas/Field.ts +34 -0
- package/src/sdk.ts +153 -19
- package/src/types/domain.ts +54 -0
- package/src/types/properties.ts +67 -0
- package/src/types/sdk.ts +42 -0
- package/dist/actions-sdk.d.ts +0 -47
- package/dist/actions-sdk.js +0 -208
- package/dist/api.d.ts +0 -62
- package/dist/api.js +0 -227
- package/dist/output-schemas.d.ts +0 -95
- package/dist/output-schemas.js +0 -138
- package/dist/schemas.d.ts +0 -338
- package/dist/schemas.js +0 -336
- package/dist/types.js +0 -41
- package/src/actions-sdk.ts +0 -356
- package/src/api.ts +0 -361
- package/src/output-schemas.ts +0 -196
- package/src/schemas.ts +0 -467
- package/src/types.ts +0 -257
- /package/dist/functions/{bundleCode.js → bundleCode/index.js} +0 -0
package/src/types.ts
DELETED
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
export interface Integration {
|
|
2
|
-
key: string;
|
|
3
|
-
name: string;
|
|
4
|
-
description: string;
|
|
5
|
-
version: string;
|
|
6
|
-
category?: string;
|
|
7
|
-
actions: Action[];
|
|
8
|
-
triggers: Trigger[];
|
|
9
|
-
current_implementation_id?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Action {
|
|
13
|
-
key: string;
|
|
14
|
-
name: string;
|
|
15
|
-
description: string;
|
|
16
|
-
appKey: string;
|
|
17
|
-
type: "create" | "update" | "search" | "delete" | "read";
|
|
18
|
-
inputFields: Field[];
|
|
19
|
-
outputFields: Field[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface Trigger {
|
|
23
|
-
key: string;
|
|
24
|
-
name: string;
|
|
25
|
-
description: string;
|
|
26
|
-
appKey: string;
|
|
27
|
-
type: "instant" | "polling" | "webhook";
|
|
28
|
-
outputFields: Field[];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface Field {
|
|
32
|
-
key: string;
|
|
33
|
-
label: string;
|
|
34
|
-
type:
|
|
35
|
-
| "string"
|
|
36
|
-
| "number"
|
|
37
|
-
| "boolean"
|
|
38
|
-
| "datetime"
|
|
39
|
-
| "file"
|
|
40
|
-
| "object"
|
|
41
|
-
| "array";
|
|
42
|
-
required: boolean;
|
|
43
|
-
description?: string;
|
|
44
|
-
choices?: Choice[];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface Choice {
|
|
48
|
-
value: string | number;
|
|
49
|
-
label: string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface ListOptions {
|
|
53
|
-
category?: string;
|
|
54
|
-
appKey?: string;
|
|
55
|
-
type?: string;
|
|
56
|
-
limit?: number;
|
|
57
|
-
offset?: number;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface ActionExecutionOptions {
|
|
61
|
-
inputs?: Record<string, any>;
|
|
62
|
-
authId?: number;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface ActionExecutionResult {
|
|
66
|
-
success: boolean;
|
|
67
|
-
data?: any;
|
|
68
|
-
error?: string;
|
|
69
|
-
metadata?: {
|
|
70
|
-
executionTime?: number;
|
|
71
|
-
requestId?: string;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface ActionField {
|
|
76
|
-
key: string;
|
|
77
|
-
label?: string;
|
|
78
|
-
required: boolean;
|
|
79
|
-
type?: string;
|
|
80
|
-
helpText?: string;
|
|
81
|
-
helpTextHtml?: string;
|
|
82
|
-
choices?: ActionFieldChoice[];
|
|
83
|
-
default?: string;
|
|
84
|
-
placeholder?: string;
|
|
85
|
-
computed?: boolean;
|
|
86
|
-
customField?: boolean;
|
|
87
|
-
dependsOn?: string[];
|
|
88
|
-
format?: string;
|
|
89
|
-
inputFormat?: string[];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface ActionFieldChoice {
|
|
93
|
-
value: string | number;
|
|
94
|
-
label: string;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface NeedsRequest {
|
|
98
|
-
selected_api: string;
|
|
99
|
-
action: string;
|
|
100
|
-
type_of: string;
|
|
101
|
-
authentication_id?: number;
|
|
102
|
-
params?: Record<string, any>;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface NeedsResponse {
|
|
106
|
-
success: boolean;
|
|
107
|
-
needs?: ActionField[];
|
|
108
|
-
errors?: string[];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Future extensibility types
|
|
112
|
-
export interface Workflow {
|
|
113
|
-
id: string;
|
|
114
|
-
name: string;
|
|
115
|
-
description: string;
|
|
116
|
-
steps: WorkflowStep[];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface WorkflowStep {
|
|
120
|
-
id: string;
|
|
121
|
-
type: "trigger" | "action";
|
|
122
|
-
appKey: string;
|
|
123
|
-
actionKey?: string;
|
|
124
|
-
triggerKey?: string;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface Interface {
|
|
128
|
-
key: string;
|
|
129
|
-
name: string;
|
|
130
|
-
fields: Field[];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface Table {
|
|
134
|
-
key: string;
|
|
135
|
-
name: string;
|
|
136
|
-
columns: TableColumn[];
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export interface TableColumn {
|
|
140
|
-
key: string;
|
|
141
|
-
name: string;
|
|
142
|
-
type: string;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export interface Authentication {
|
|
146
|
-
id: number;
|
|
147
|
-
date: string;
|
|
148
|
-
lastchanged?: string;
|
|
149
|
-
account_id: number;
|
|
150
|
-
customuser_id?: number;
|
|
151
|
-
selected_api: string;
|
|
152
|
-
destination_selected_api?: string | null;
|
|
153
|
-
is_invite_only: boolean;
|
|
154
|
-
is_private: boolean;
|
|
155
|
-
shared_with_all: boolean;
|
|
156
|
-
is_stale?: string;
|
|
157
|
-
is_shared?: string;
|
|
158
|
-
marked_stale_at?: string | null;
|
|
159
|
-
label?: string | null;
|
|
160
|
-
identifier?: string | null;
|
|
161
|
-
title?: string | null;
|
|
162
|
-
url?: string;
|
|
163
|
-
groups?: string;
|
|
164
|
-
members?: string;
|
|
165
|
-
permissions?: Record<string, boolean>;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export interface AuthenticationsResponse {
|
|
169
|
-
count: number;
|
|
170
|
-
next?: string | null;
|
|
171
|
-
previous?: string | null;
|
|
172
|
-
results: Authentication[];
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export interface AuthenticationListOptions {
|
|
176
|
-
account_id?: string;
|
|
177
|
-
owner?: string;
|
|
178
|
-
appKey?: string;
|
|
179
|
-
limit?: number;
|
|
180
|
-
offset?: number;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Custom error classes for better error handling
|
|
184
|
-
export class ZapierSdkError extends Error {
|
|
185
|
-
constructor(
|
|
186
|
-
message: string,
|
|
187
|
-
public code?: string,
|
|
188
|
-
) {
|
|
189
|
-
super(message);
|
|
190
|
-
this.name = "ZapierSdkError";
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export class AppNotFoundError extends ZapierSdkError {
|
|
195
|
-
constructor(appKey: string) {
|
|
196
|
-
super(`App "${appKey}" not found`);
|
|
197
|
-
this.name = "AppNotFoundError";
|
|
198
|
-
this.code = "APP_NOT_FOUND";
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export class ActionNotFoundError extends ZapierSdkError {
|
|
203
|
-
constructor(appKey: string, actionKey: string) {
|
|
204
|
-
super(`Action "${actionKey}" not found in app "${appKey}"`);
|
|
205
|
-
this.name = "ActionNotFoundError";
|
|
206
|
-
this.code = "ACTION_NOT_FOUND";
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export class AuthenticationError extends ZapierSdkError {
|
|
211
|
-
constructor(message: string) {
|
|
212
|
-
super(message);
|
|
213
|
-
this.name = "AuthenticationError";
|
|
214
|
-
this.code = "AUTHENTICATION_ERROR";
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Auth configuration types
|
|
219
|
-
export interface AuthObject {
|
|
220
|
-
id: number;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Common SDK interfaces
|
|
224
|
-
export interface BaseSdkOptions {
|
|
225
|
-
token?: string;
|
|
226
|
-
authentications?: {
|
|
227
|
-
[appKey: string]: AuthObject[];
|
|
228
|
-
};
|
|
229
|
-
fetch?: typeof fetch;
|
|
230
|
-
baseUrl?: string;
|
|
231
|
-
debug?: boolean;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export interface FunctionConfig {
|
|
235
|
-
/** Base URL for Zapier API */
|
|
236
|
-
baseUrl?: string;
|
|
237
|
-
/** Authentication token */
|
|
238
|
-
token?: string;
|
|
239
|
-
/** Optional pre-instantiated API client */
|
|
240
|
-
api?: any; // ApiClient type would cause circular import
|
|
241
|
-
/** Enable debug logging */
|
|
242
|
-
debug?: boolean;
|
|
243
|
-
/** Custom fetch implementation */
|
|
244
|
-
fetch?: typeof globalThis.fetch;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export interface CombinedSdk {
|
|
248
|
-
[namespace: string]: any;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// Factory function type for creating individual SDKs
|
|
252
|
-
export type SdkFactory<T = any> = (options: BaseSdkOptions) => T;
|
|
253
|
-
|
|
254
|
-
// Utility function to combine multiple SDKs
|
|
255
|
-
export function combineSdks(sdks: Record<string, any>): CombinedSdk {
|
|
256
|
-
return { ...sdks };
|
|
257
|
-
}
|
|
File without changes
|