@zapier/zapier-sdk 0.15.0 → 0.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4c78fb0: Added `getInputFieldsSchema` plugin to retrieve JSON Schema for action inputs
8
+
3
9
  ## 0.15.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -9,6 +9,7 @@
9
9
  - [`getProfile`](#getprofile)
10
10
  - [Actions](#actions)
11
11
  - [`getAction`](#getaction)
12
+ - [`getInputFieldsSchema`](#getinputfieldsschema)
12
13
  - [`listActions`](#listactions)
13
14
  - [`listInputFieldChoices`](#listinputfieldchoices)
14
15
  - [`listInputFields`](#listinputfields)
@@ -256,6 +257,33 @@ const { data: action } = await sdk.getAction({
256
257
  });
257
258
  ```
258
259
 
260
+ #### `getInputFieldsSchema`
261
+
262
+ Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters.
263
+
264
+ **Parameters:**
265
+
266
+ | Name | Type | Required | Default | Possible Values | Description |
267
+ | -------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
268
+ | `options` | `object` | ✅ | — | — | |
269
+ | ↳ `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for |
270
+ | ↳ `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
271
+ | ↳ `actionKey` | `string` | ✅ | — | — | Action key to get the input schema for |
272
+ | ↳ `authenticationId` | `string` | ❌ | — | — | Authentication ID to use when fetching the schema. Required if the action needs authentication to determine available fields. |
273
+ | ↳ `inputs` | `object` | ❌ | — | — | Current input values that may affect the schema (e.g., when fields depend on other field values) |
274
+
275
+ **Returns:** `Promise<InputSchemaItem>`
276
+
277
+ **Example:**
278
+
279
+ ```typescript
280
+ const { data: inputSchema } = await sdk.getInputFieldsSchema({
281
+ appKey: "example-key",
282
+ actionType: "read",
283
+ actionKey: "example-key",
284
+ });
285
+ ```
286
+
259
287
  #### `listActions`
260
288
 
261
289
  List all actions for a specific app
@@ -972,6 +972,7 @@ export declare const NeedsResponseSchema: z.ZodObject<{
972
972
  }>, "many">>;
973
973
  errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
974
974
  last_fetched_at: z.ZodOptional<z.ZodString>;
975
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
975
976
  }, "strip", z.ZodTypeAny, {
976
977
  success: boolean;
977
978
  needs?: {
@@ -1008,6 +1009,7 @@ export declare const NeedsResponseSchema: z.ZodObject<{
1008
1009
  }[] | undefined;
1009
1010
  errors?: string[] | undefined;
1010
1011
  last_fetched_at?: string | undefined;
1012
+ schema?: Record<string, unknown> | undefined;
1011
1013
  }, {
1012
1014
  success: boolean;
1013
1015
  needs?: {
@@ -1044,6 +1046,7 @@ export declare const NeedsResponseSchema: z.ZodObject<{
1044
1046
  }[] | undefined;
1045
1047
  errors?: string[] | undefined;
1046
1048
  last_fetched_at?: string | undefined;
1049
+ schema?: Record<string, unknown> | undefined;
1047
1050
  }>;
1048
1051
  export declare const ImplementationSchema: z.ZodObject<{
1049
1052
  selected_api: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/api/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAMH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5C,CAAC;AAMH,eAAO,MAAM,6BAA6B;;;;;;EAExC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;EAsCnC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC"}
@@ -272,6 +272,7 @@ export const NeedsResponseSchema = z.object({
272
272
  needs: z.array(NeedSchema).optional(),
273
273
  errors: z.array(z.string()).optional(),
274
274
  last_fetched_at: z.string().optional(),
275
+ schema: z.record(z.unknown()).optional(),
275
276
  });
276
277
  // ============================================================================
277
278
  // Implementation Schema
package/dist/index.cjs CHANGED
@@ -978,7 +978,8 @@ zod.z.object({
978
978
  success: zod.z.boolean(),
979
979
  needs: zod.z.array(NeedSchema).optional(),
980
980
  errors: zod.z.array(zod.z.string()).optional(),
981
- last_fetched_at: zod.z.string().optional()
981
+ last_fetched_at: zod.z.string().optional(),
982
+ schema: zod.z.record(zod.z.unknown()).optional()
982
983
  });
983
984
  var ImplementationSchema = zod.z.object({
984
985
  selected_api: zod.z.string(),
@@ -3919,6 +3920,85 @@ var registryPlugin = ({ sdk, context }) => {
3919
3920
  getRegistry
3920
3921
  };
3921
3922
  };
3923
+ var GetInputFieldsSchemaSchema = zod.z.object({
3924
+ appKey: AppKeyPropertySchema.describe(
3925
+ "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
3926
+ ),
3927
+ actionType: ActionTypePropertySchema.describe(
3928
+ "Action type that matches the action's defined type"
3929
+ ),
3930
+ actionKey: ActionKeyPropertySchema.describe(
3931
+ "Action key to get the input schema for"
3932
+ ),
3933
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
3934
+ "Authentication ID to use when fetching the schema. Required if the action needs authentication to determine available fields."
3935
+ ),
3936
+ inputs: InputsPropertySchema.optional().describe(
3937
+ "Current input values that may affect the schema (e.g., when fields depend on other field values)"
3938
+ )
3939
+ }).describe(
3940
+ "Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters."
3941
+ );
3942
+
3943
+ // src/plugins/getInputFieldsSchema/index.ts
3944
+ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
3945
+ const getInputFieldsSchema = createFunction(
3946
+ async function getInputFieldsSchema2(options) {
3947
+ const { api, getVersionedImplementationId } = context;
3948
+ const {
3949
+ appKey,
3950
+ actionKey,
3951
+ actionType,
3952
+ authenticationId = null,
3953
+ inputs
3954
+ } = options;
3955
+ const selectedApi = await getVersionedImplementationId(appKey);
3956
+ if (!selectedApi) {
3957
+ throw new ZapierConfigurationError(
3958
+ "No current_implementation_id found for app",
3959
+ { configType: "current_implementation_id" }
3960
+ );
3961
+ }
3962
+ const { data: action } = await sdk.getAction({
3963
+ appKey,
3964
+ actionType,
3965
+ actionKey
3966
+ });
3967
+ const needsData = await fetchImplementationNeeds({
3968
+ api,
3969
+ selectedApi,
3970
+ action: action.key,
3971
+ actionType,
3972
+ authenticationId,
3973
+ inputs
3974
+ });
3975
+ return {
3976
+ data: needsData.schema || {}
3977
+ };
3978
+ },
3979
+ GetInputFieldsSchemaSchema
3980
+ );
3981
+ return {
3982
+ getInputFieldsSchema,
3983
+ context: {
3984
+ meta: {
3985
+ getInputFieldsSchema: {
3986
+ categories: ["action"],
3987
+ type: "item",
3988
+ itemType: "InputSchema",
3989
+ inputSchema: GetInputFieldsSchemaSchema,
3990
+ resolvers: {
3991
+ appKey: appKeyResolver,
3992
+ actionType: actionTypeResolver,
3993
+ actionKey: actionKeyResolver,
3994
+ authenticationId: authenticationIdResolver,
3995
+ inputs: inputsAllOptionalResolver
3996
+ }
3997
+ }
3998
+ }
3999
+ }
4000
+ };
4001
+ };
3922
4002
  var InputFieldChoiceItemSchema = withFormatter(NeedChoicesSchema, {
3923
4003
  format: (item) => {
3924
4004
  const title = item.label || item.key || "Choice";
@@ -4222,7 +4302,7 @@ function getCpuTime() {
4222
4302
 
4223
4303
  // package.json
4224
4304
  var package_default = {
4225
- version: "0.15.0"};
4305
+ version: "0.15.1"};
4226
4306
 
4227
4307
  // src/plugins/eventEmission/builders.ts
4228
4308
  function createBaseEvent(context = {}) {
@@ -4538,7 +4618,7 @@ function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} })
4538
4618
  };
4539
4619
  }
4540
4620
  function createZapierSdkWithoutRegistry(options = {}) {
4541
- return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
4621
+ return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
4542
4622
  }
4543
4623
  function createZapierSdk(options = {}) {
4544
4624
  return createZapierSdkWithoutRegistry(options).addPlugin(registryPlugin);
package/dist/index.d.mts CHANGED
@@ -1157,6 +1157,7 @@ declare const NeedsResponseSchema: z.ZodObject<{
1157
1157
  }>, "many">>;
1158
1158
  errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1159
1159
  last_fetched_at: z.ZodOptional<z.ZodString>;
1160
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1160
1161
  }, "strip", z.ZodTypeAny, {
1161
1162
  success: boolean;
1162
1163
  needs?: {
@@ -1193,6 +1194,7 @@ declare const NeedsResponseSchema: z.ZodObject<{
1193
1194
  }[] | undefined;
1194
1195
  errors?: string[] | undefined;
1195
1196
  last_fetched_at?: string | undefined;
1197
+ schema?: Record<string, unknown> | undefined;
1196
1198
  }, {
1197
1199
  success: boolean;
1198
1200
  needs?: {
@@ -1229,6 +1231,7 @@ declare const NeedsResponseSchema: z.ZodObject<{
1229
1231
  }[] | undefined;
1230
1232
  errors?: string[] | undefined;
1231
1233
  last_fetched_at?: string | undefined;
1234
+ schema?: Record<string, unknown> | undefined;
1232
1235
  }>;
1233
1236
 
1234
1237
  /**
@@ -2184,6 +2187,42 @@ declare const listInputFieldsPlugin: Plugin<GetSdkType<GetAppPluginProvides & Ge
2184
2187
  }, // requires api and getVersionedImplementationId in context
2185
2188
  ListInputFieldsPluginProvides>;
2186
2189
 
2190
+ declare const GetInputFieldsSchemaSchema: z.ZodObject<{
2191
+ appKey: z.ZodString & {
2192
+ _def: z.ZodStringDef & PositionalMetadata;
2193
+ };
2194
+ actionType: z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>;
2195
+ actionKey: z.ZodString;
2196
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2197
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2198
+ }, "strip", z.ZodTypeAny, {
2199
+ appKey: string;
2200
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
2201
+ actionKey: string;
2202
+ authenticationId?: number | null | undefined;
2203
+ inputs?: Record<string, unknown> | undefined;
2204
+ }, {
2205
+ appKey: string;
2206
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
2207
+ actionKey: string;
2208
+ authenticationId?: number | null | undefined;
2209
+ inputs?: Record<string, unknown> | undefined;
2210
+ }>;
2211
+ type GetInputFieldsSchemaOptions = z.infer<typeof GetInputFieldsSchemaSchema>;
2212
+
2213
+ interface GetInputFieldsSchemaPluginProvides {
2214
+ getInputFieldsSchema: (options: GetInputFieldsSchemaOptions) => Promise<{
2215
+ data: Record<string, unknown>;
2216
+ }>;
2217
+ context: {
2218
+ meta: {
2219
+ getInputFieldsSchema: {
2220
+ inputSchema: typeof GetInputFieldsSchemaSchema;
2221
+ };
2222
+ };
2223
+ };
2224
+ }
2225
+
2187
2226
  declare const InputFieldChoiceItemSchema: z.ZodObject<{
2188
2227
  key: z.ZodOptional<z.ZodString>;
2189
2228
  label: z.ZodOptional<z.ZodString>;
@@ -2292,7 +2331,7 @@ interface FunctionRegistryEntry {
2292
2331
  resolvers?: Record<string, any>;
2293
2332
  packages?: string[];
2294
2333
  }
2295
- interface ZapierSdk extends GetSdkType<RegistryPluginProvides & FetchPluginProvides & AppsPluginProvides & ListAppsPluginProvides & ManifestPluginProvides & GetAppPluginProvides & ListActionsPluginProvides & GetActionPluginProvides & RunActionPluginProvides & ListAuthenticationsPluginProvides & GetAuthenticationPluginProvides & FindFirstAuthenticationPluginProvides & FindUniqueAuthenticationPluginProvides & ListInputFieldsPluginProvides & ListInputFieldChoicesPluginProvides & RequestPluginProvides & GetProfilePluginProvides & EventEmissionProvides & ApiPluginProvides> {
2334
+ interface ZapierSdk extends GetSdkType<RegistryPluginProvides & FetchPluginProvides & AppsPluginProvides & ListAppsPluginProvides & ManifestPluginProvides & GetAppPluginProvides & ListActionsPluginProvides & GetActionPluginProvides & RunActionPluginProvides & ListAuthenticationsPluginProvides & GetAuthenticationPluginProvides & FindFirstAuthenticationPluginProvides & FindUniqueAuthenticationPluginProvides & ListInputFieldsPluginProvides & GetInputFieldsSchemaPluginProvides & ListInputFieldChoicesPluginProvides & RequestPluginProvides & GetProfilePluginProvides & EventEmissionProvides & ApiPluginProvides> {
2296
2335
  apps: ActionProxy & ZapierSdkApps;
2297
2336
  }
2298
2337
 
@@ -3317,7 +3356,7 @@ declare function createSdk<TCurrentSdk = {}, TCurrentContext extends {
3317
3356
  getContext(): TCurrentContext;
3318
3357
  }, TRequiresContext, TProvides>, addPluginOptions?: Record<string, unknown>): Sdk<TCurrentSdk & ExtractSdkProperties<TProvides>, TCurrentContext & NonNullable<ExtractContextProperties<TProvides>>>;
3319
3358
  };
3320
- declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk<ExtractSdkProperties<EventEmissionProvides> & ExtractSdkProperties<ApiPluginProvides> & ExtractSdkProperties<ManifestPluginProvides> & ExtractSdkProperties<ListAppsPluginProvides> & ExtractSdkProperties<GetAppPluginProvides> & ExtractSdkProperties<ListActionsPluginProvides> & ExtractSdkProperties<GetActionPluginProvides> & ExtractSdkProperties<ListInputFieldsPluginProvides> & ExtractSdkProperties<ListInputFieldChoicesPluginProvides> & ExtractSdkProperties<RunActionPluginProvides> & ExtractSdkProperties<ListAuthenticationsPluginProvides> & ExtractSdkProperties<GetAuthenticationPluginProvides> & ExtractSdkProperties<FindFirstAuthenticationPluginProvides> & ExtractSdkProperties<FindUniqueAuthenticationPluginProvides> & ExtractSdkProperties<RequestPluginProvides> & ExtractSdkProperties<FetchPluginProvides> & ExtractSdkProperties<AppsPluginProvides> & ExtractSdkProperties<GetProfilePluginProvides>, {
3359
+ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk<ExtractSdkProperties<EventEmissionProvides> & ExtractSdkProperties<ApiPluginProvides> & ExtractSdkProperties<ManifestPluginProvides> & ExtractSdkProperties<ListAppsPluginProvides> & ExtractSdkProperties<GetAppPluginProvides> & ExtractSdkProperties<ListActionsPluginProvides> & ExtractSdkProperties<GetActionPluginProvides> & ExtractSdkProperties<ListInputFieldsPluginProvides> & ExtractSdkProperties<GetInputFieldsSchemaPluginProvides> & ExtractSdkProperties<ListInputFieldChoicesPluginProvides> & ExtractSdkProperties<RunActionPluginProvides> & ExtractSdkProperties<ListAuthenticationsPluginProvides> & ExtractSdkProperties<GetAuthenticationPluginProvides> & ExtractSdkProperties<FindFirstAuthenticationPluginProvides> & ExtractSdkProperties<FindUniqueAuthenticationPluginProvides> & ExtractSdkProperties<RequestPluginProvides> & ExtractSdkProperties<FetchPluginProvides> & ExtractSdkProperties<AppsPluginProvides> & ExtractSdkProperties<GetProfilePluginProvides>, {
3321
3360
  meta: Record<string, PluginMeta>;
3322
3361
  } & EventEmissionContext & {
3323
3362
  api: ApiClient;
@@ -3355,6 +3394,12 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
3355
3394
  inputSchema: typeof ListInputFieldsSchema;
3356
3395
  };
3357
3396
  };
3397
+ } & {
3398
+ meta: {
3399
+ getInputFieldsSchema: {
3400
+ inputSchema: typeof GetInputFieldsSchemaSchema;
3401
+ };
3402
+ };
3358
3403
  } & {
3359
3404
  meta: {
3360
3405
  listInputFieldChoices: {
package/dist/index.mjs CHANGED
@@ -956,7 +956,8 @@ z.object({
956
956
  success: z.boolean(),
957
957
  needs: z.array(NeedSchema).optional(),
958
958
  errors: z.array(z.string()).optional(),
959
- last_fetched_at: z.string().optional()
959
+ last_fetched_at: z.string().optional(),
960
+ schema: z.record(z.unknown()).optional()
960
961
  });
961
962
  var ImplementationSchema = z.object({
962
963
  selected_api: z.string(),
@@ -3897,6 +3898,85 @@ var registryPlugin = ({ sdk, context }) => {
3897
3898
  getRegistry
3898
3899
  };
3899
3900
  };
3901
+ var GetInputFieldsSchemaSchema = z.object({
3902
+ appKey: AppKeyPropertySchema.describe(
3903
+ "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
3904
+ ),
3905
+ actionType: ActionTypePropertySchema.describe(
3906
+ "Action type that matches the action's defined type"
3907
+ ),
3908
+ actionKey: ActionKeyPropertySchema.describe(
3909
+ "Action key to get the input schema for"
3910
+ ),
3911
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
3912
+ "Authentication ID to use when fetching the schema. Required if the action needs authentication to determine available fields."
3913
+ ),
3914
+ inputs: InputsPropertySchema.optional().describe(
3915
+ "Current input values that may affect the schema (e.g., when fields depend on other field values)"
3916
+ )
3917
+ }).describe(
3918
+ "Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters."
3919
+ );
3920
+
3921
+ // src/plugins/getInputFieldsSchema/index.ts
3922
+ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
3923
+ const getInputFieldsSchema = createFunction(
3924
+ async function getInputFieldsSchema2(options) {
3925
+ const { api, getVersionedImplementationId } = context;
3926
+ const {
3927
+ appKey,
3928
+ actionKey,
3929
+ actionType,
3930
+ authenticationId = null,
3931
+ inputs
3932
+ } = options;
3933
+ const selectedApi = await getVersionedImplementationId(appKey);
3934
+ if (!selectedApi) {
3935
+ throw new ZapierConfigurationError(
3936
+ "No current_implementation_id found for app",
3937
+ { configType: "current_implementation_id" }
3938
+ );
3939
+ }
3940
+ const { data: action } = await sdk.getAction({
3941
+ appKey,
3942
+ actionType,
3943
+ actionKey
3944
+ });
3945
+ const needsData = await fetchImplementationNeeds({
3946
+ api,
3947
+ selectedApi,
3948
+ action: action.key,
3949
+ actionType,
3950
+ authenticationId,
3951
+ inputs
3952
+ });
3953
+ return {
3954
+ data: needsData.schema || {}
3955
+ };
3956
+ },
3957
+ GetInputFieldsSchemaSchema
3958
+ );
3959
+ return {
3960
+ getInputFieldsSchema,
3961
+ context: {
3962
+ meta: {
3963
+ getInputFieldsSchema: {
3964
+ categories: ["action"],
3965
+ type: "item",
3966
+ itemType: "InputSchema",
3967
+ inputSchema: GetInputFieldsSchemaSchema,
3968
+ resolvers: {
3969
+ appKey: appKeyResolver,
3970
+ actionType: actionTypeResolver,
3971
+ actionKey: actionKeyResolver,
3972
+ authenticationId: authenticationIdResolver,
3973
+ inputs: inputsAllOptionalResolver
3974
+ }
3975
+ }
3976
+ }
3977
+ }
3978
+ };
3979
+ };
3900
3980
  var InputFieldChoiceItemSchema = withFormatter(NeedChoicesSchema, {
3901
3981
  format: (item) => {
3902
3982
  const title = item.label || item.key || "Choice";
@@ -4200,7 +4280,7 @@ function getCpuTime() {
4200
4280
 
4201
4281
  // package.json
4202
4282
  var package_default = {
4203
- version: "0.15.0"};
4283
+ version: "0.15.1"};
4204
4284
 
4205
4285
  // src/plugins/eventEmission/builders.ts
4206
4286
  function createBaseEvent(context = {}) {
@@ -4516,7 +4596,7 @@ function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} })
4516
4596
  };
4517
4597
  }
4518
4598
  function createZapierSdkWithoutRegistry(options = {}) {
4519
- return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
4599
+ return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
4520
4600
  }
4521
4601
  function createZapierSdk(options = {}) {
4522
4602
  return createZapierSdkWithoutRegistry(options).addPlugin(registryPlugin);
@@ -0,0 +1,22 @@
1
+ import type { Plugin, GetSdkType } from "../../types/plugin";
2
+ import type { ApiClient } from "../../api";
3
+ import { GetInputFieldsSchemaSchema, type GetInputFieldsSchemaOptions as GetInputFieldsSchemaOptions } from "./schemas";
4
+ import type { GetActionPluginProvides } from "../getAction";
5
+ import type { GetVersionedImplementationId } from "../manifest/schemas";
6
+ export interface GetInputFieldsSchemaPluginProvides {
7
+ getInputFieldsSchema: (options: GetInputFieldsSchemaOptions) => Promise<{
8
+ data: Record<string, unknown>;
9
+ }>;
10
+ context: {
11
+ meta: {
12
+ getInputFieldsSchema: {
13
+ inputSchema: typeof GetInputFieldsSchemaSchema;
14
+ };
15
+ };
16
+ };
17
+ }
18
+ export declare const getInputFieldsSchemaPlugin: Plugin<GetSdkType<GetActionPluginProvides>, {
19
+ api: ApiClient;
20
+ getVersionedImplementationId: GetVersionedImplementationId;
21
+ }, GetInputFieldsSchemaPluginProvides>;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getInputFieldsSchema/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,0BAA0B,EAC1B,KAAK,2BAA2B,IAAI,2BAA2B,EAChE,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAUxE,MAAM,WAAW,kCAAkC;IACjD,oBAAoB,EAAE,CACpB,OAAO,EAAE,2BAA2B,KACjC,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAChD,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,oBAAoB,EAAE;gBACpB,WAAW,EAAE,OAAO,0BAA0B,CAAC;aAChD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,UAAU,CAAC,uBAAuB,CAAC,EACnC;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,EACD,kCAAkC,CAmEnC,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { GetInputFieldsSchemaSchema, } from "./schemas";
2
+ import { ZapierConfigurationError } from "../../types/errors";
3
+ import { createFunction } from "../../utils/function-utils";
4
+ import { appKeyResolver, actionTypeResolver, actionKeyResolver, authenticationIdResolver, inputsAllOptionalResolver, } from "../../resolvers";
5
+ import { fetchImplementationNeeds } from "../../services/implementations";
6
+ export const getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7
+ const getInputFieldsSchema = createFunction(async function getInputFieldsSchema(options) {
8
+ const { api, getVersionedImplementationId } = context;
9
+ const { appKey, actionKey, actionType, authenticationId = null, inputs, } = options;
10
+ const selectedApi = await getVersionedImplementationId(appKey);
11
+ if (!selectedApi) {
12
+ throw new ZapierConfigurationError("No current_implementation_id found for app", { configType: "current_implementation_id" });
13
+ }
14
+ const { data: action } = await sdk.getAction({
15
+ appKey,
16
+ actionType,
17
+ actionKey,
18
+ });
19
+ const needsData = await fetchImplementationNeeds({
20
+ api,
21
+ selectedApi,
22
+ action: action.key,
23
+ actionType,
24
+ authenticationId,
25
+ inputs,
26
+ });
27
+ return {
28
+ data: needsData.schema || {},
29
+ };
30
+ }, GetInputFieldsSchemaSchema);
31
+ return {
32
+ getInputFieldsSchema,
33
+ context: {
34
+ meta: {
35
+ getInputFieldsSchema: {
36
+ categories: ["action"],
37
+ type: "item",
38
+ itemType: "InputSchema",
39
+ inputSchema: GetInputFieldsSchemaSchema,
40
+ resolvers: {
41
+ appKey: appKeyResolver,
42
+ actionType: actionTypeResolver,
43
+ actionKey: actionKeyResolver,
44
+ authenticationId: authenticationIdResolver,
45
+ inputs: inputsAllOptionalResolver,
46
+ },
47
+ },
48
+ },
49
+ },
50
+ };
51
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/getInputFieldsSchema/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,288 @@
1
+ import { describe, it, expect, vi, beforeEach } from "vitest";
2
+ import { ZapierValidationError, ZapierConfigurationError, ZapierApiError, } from "../../types/errors";
3
+ import { getInputFieldsSchemaPlugin } from "./index";
4
+ import { getActionPlugin } from "../getAction";
5
+ import { getAppPlugin } from "../getApp";
6
+ import { listActionsPlugin } from "../listActions";
7
+ import { listAppsPlugin } from "../listApps";
8
+ import { createSdk } from "../../sdk";
9
+ const mockSchema = {
10
+ type: "object",
11
+ properties: {
12
+ message: {
13
+ type: "string",
14
+ title: "Message",
15
+ description: "The message to send",
16
+ },
17
+ channel: {
18
+ type: "string",
19
+ title: "Channel",
20
+ description: "The channel to send to",
21
+ },
22
+ tags: {
23
+ type: "array",
24
+ items: {
25
+ type: "string",
26
+ },
27
+ title: "Tags",
28
+ description: "List of tags",
29
+ },
30
+ },
31
+ required: ["message", "channel"],
32
+ };
33
+ const mockNeedsResponse = {
34
+ success: true,
35
+ needs: [],
36
+ schema: mockSchema,
37
+ };
38
+ const mockActionsResponse = {
39
+ results: [
40
+ {
41
+ slug: "slack",
42
+ selected_api: "slack",
43
+ actions: [
44
+ {
45
+ key: "send_message",
46
+ name: "Send Message",
47
+ description: "Send a message to a channel",
48
+ type_of: "write",
49
+ type: "write",
50
+ id: "core:12345",
51
+ },
52
+ ],
53
+ },
54
+ ],
55
+ meta: {
56
+ next_cursor: null,
57
+ },
58
+ };
59
+ describe("getInputFieldsSchema plugin", () => {
60
+ let mockApiClient;
61
+ let mockGetVersionedImplementationId;
62
+ beforeEach(() => {
63
+ vi.clearAllMocks();
64
+ mockApiClient = {
65
+ get: vi.fn().mockResolvedValue(mockActionsResponse),
66
+ post: vi.fn().mockResolvedValue(mockNeedsResponse),
67
+ };
68
+ mockGetVersionedImplementationId = vi
69
+ .fn()
70
+ .mockResolvedValue("SlackCLIAPI@1.21.1");
71
+ });
72
+ function createTestSdk() {
73
+ return createSdk({}, {}, {
74
+ api: mockApiClient,
75
+ meta: {},
76
+ getVersionedImplementationId: mockGetVersionedImplementationId,
77
+ })
78
+ .addPlugin(listAppsPlugin)
79
+ .addPlugin(listActionsPlugin)
80
+ .addPlugin(getAppPlugin)
81
+ .addPlugin(getActionPlugin)
82
+ .addPlugin(getInputFieldsSchemaPlugin);
83
+ }
84
+ describe("schema validation", () => {
85
+ it("should throw validation error for missing required fields", async () => {
86
+ const sdk = createTestSdk();
87
+ await expect(sdk.getInputFieldsSchema({
88
+ // Missing required fields
89
+ })).rejects.toThrow(ZapierValidationError);
90
+ });
91
+ it("should throw validation error for invalid field types", async () => {
92
+ const sdk = createTestSdk();
93
+ await expect(sdk.getInputFieldsSchema({
94
+ appKey: 123,
95
+ actionType: "write",
96
+ actionKey: "send_message",
97
+ })).rejects.toThrow(ZapierValidationError);
98
+ });
99
+ it("should pass validation with all required fields", async () => {
100
+ const sdk = createTestSdk();
101
+ const result = await sdk.getInputFieldsSchema({
102
+ appKey: "slack",
103
+ actionType: "write",
104
+ actionKey: "send_message",
105
+ });
106
+ expect(result.data).toBeDefined();
107
+ });
108
+ it("should pass validation with optional fields", async () => {
109
+ const sdk = createTestSdk();
110
+ const result = await sdk.getInputFieldsSchema({
111
+ appKey: "slack",
112
+ actionType: "write",
113
+ actionKey: "send_message",
114
+ authenticationId: 123,
115
+ inputs: { channel: "#general" },
116
+ });
117
+ expect(result.data).toBeDefined();
118
+ });
119
+ });
120
+ describe("API integration", () => {
121
+ it("should call the correct API endpoint", async () => {
122
+ const sdk = createTestSdk();
123
+ await sdk.getInputFieldsSchema({
124
+ appKey: "slack",
125
+ actionType: "write",
126
+ actionKey: "send_message",
127
+ });
128
+ expect(mockApiClient.post).toHaveBeenCalledWith("/zapier/api/v4/implementations/needs/", {
129
+ selected_api: "SlackCLIAPI@1.21.1",
130
+ action: "send_message",
131
+ type_of: "write",
132
+ params: {},
133
+ });
134
+ });
135
+ it("should include authentication_id when provided", async () => {
136
+ const sdk = createTestSdk();
137
+ await sdk.getInputFieldsSchema({
138
+ appKey: "slack",
139
+ actionType: "write",
140
+ actionKey: "send_message",
141
+ authenticationId: 123,
142
+ });
143
+ expect(mockApiClient.post).toHaveBeenCalledWith("/zapier/api/v4/implementations/needs/", {
144
+ selected_api: "SlackCLIAPI@1.21.1",
145
+ action: "send_message",
146
+ type_of: "write",
147
+ params: {},
148
+ authentication_id: 123,
149
+ });
150
+ });
151
+ it("should exclude authentication_id when null", async () => {
152
+ const sdk = createTestSdk();
153
+ await sdk.getInputFieldsSchema({
154
+ appKey: "slack",
155
+ actionType: "write",
156
+ actionKey: "send_message",
157
+ authenticationId: null,
158
+ });
159
+ expect(mockApiClient.post).toHaveBeenCalledWith("/zapier/api/v4/implementations/needs/", {
160
+ selected_api: "SlackCLIAPI@1.21.1",
161
+ action: "send_message",
162
+ type_of: "write",
163
+ params: {},
164
+ // No authentication_id
165
+ });
166
+ });
167
+ it("should include inputs when provided", async () => {
168
+ const sdk = createTestSdk();
169
+ const inputs = { channel: "#general", message: "test" };
170
+ await sdk.getInputFieldsSchema({
171
+ appKey: "slack",
172
+ actionType: "write",
173
+ actionKey: "send_message",
174
+ inputs,
175
+ });
176
+ expect(mockApiClient.post).toHaveBeenCalledWith("/zapier/api/v4/implementations/needs/", {
177
+ selected_api: "SlackCLIAPI@1.21.1",
178
+ action: "send_message",
179
+ type_of: "write",
180
+ params: inputs,
181
+ });
182
+ });
183
+ });
184
+ describe("data return", () => {
185
+ it("should return the schema object from the API response", async () => {
186
+ const sdk = createTestSdk();
187
+ const result = await sdk.getInputFieldsSchema({
188
+ appKey: "slack",
189
+ actionType: "write",
190
+ actionKey: "send_message",
191
+ });
192
+ expect(result.data).toEqual(mockSchema);
193
+ });
194
+ it("should return empty object when schema is not present", async () => {
195
+ mockApiClient.post = vi.fn().mockResolvedValue({
196
+ success: true,
197
+ needs: [],
198
+ // No schema field
199
+ });
200
+ const sdk = createTestSdk();
201
+ const result = await sdk.getInputFieldsSchema({
202
+ appKey: "slack",
203
+ actionType: "write",
204
+ actionKey: "send_message",
205
+ });
206
+ expect(result.data).toEqual({});
207
+ });
208
+ it("should handle complex schema structures", async () => {
209
+ const complexSchema = {
210
+ type: "object",
211
+ properties: {
212
+ user: {
213
+ type: "object",
214
+ properties: {
215
+ name: { type: "string" },
216
+ age: { type: "number" },
217
+ },
218
+ required: ["name"],
219
+ },
220
+ tags: {
221
+ type: "array",
222
+ items: { type: "string" },
223
+ },
224
+ },
225
+ required: ["user"],
226
+ };
227
+ mockApiClient.post = vi.fn().mockResolvedValue({
228
+ success: true,
229
+ needs: [],
230
+ schema: complexSchema,
231
+ });
232
+ const sdk = createTestSdk();
233
+ const result = await sdk.getInputFieldsSchema({
234
+ appKey: "slack",
235
+ actionType: "write",
236
+ actionKey: "send_message",
237
+ });
238
+ expect(result.data).toEqual(complexSchema);
239
+ });
240
+ });
241
+ describe("error handling", () => {
242
+ it("should throw ZapierConfigurationError when app has no current_implementation_id", async () => {
243
+ mockGetVersionedImplementationId.mockResolvedValue(null);
244
+ const sdk = createTestSdk();
245
+ await expect(sdk.getInputFieldsSchema({
246
+ appKey: "invalid",
247
+ actionType: "write",
248
+ actionKey: "send_message",
249
+ })).rejects.toThrow(ZapierConfigurationError);
250
+ });
251
+ it("should throw ZapierApiError when API response indicates failure", async () => {
252
+ mockApiClient.post = vi.fn().mockResolvedValue({
253
+ success: false,
254
+ errors: ["Authentication failed", "Invalid credentials"],
255
+ });
256
+ const sdk = createTestSdk();
257
+ await expect(sdk.getInputFieldsSchema({
258
+ appKey: "slack",
259
+ actionType: "write",
260
+ actionKey: "send_message",
261
+ })).rejects.toThrow(ZapierApiError);
262
+ await expect(sdk.getInputFieldsSchema({
263
+ appKey: "slack",
264
+ actionType: "write",
265
+ actionKey: "send_message",
266
+ })).rejects.toThrow("Failed to get input fields: Authentication failed, Invalid credentials");
267
+ });
268
+ it("should handle API errors gracefully", async () => {
269
+ mockApiClient.post = vi
270
+ .fn()
271
+ .mockRejectedValue(new Error("Network error"));
272
+ const sdk = createTestSdk();
273
+ await expect(sdk.getInputFieldsSchema({
274
+ appKey: "slack",
275
+ actionType: "write",
276
+ actionKey: "send_message",
277
+ })).rejects.toThrow("Network error");
278
+ });
279
+ });
280
+ describe("context and metadata", () => {
281
+ it("should provide context with meta information", () => {
282
+ const sdk = createTestSdk();
283
+ const context = sdk.getContext();
284
+ expect(context.meta.getInputFieldsSchema).toBeDefined();
285
+ expect(context.meta.getInputFieldsSchema.inputSchema).toBeDefined();
286
+ });
287
+ });
288
+ });
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ import type { ZapierConfigurationError, ZapierApiError, ZapierAuthenticationError, ZapierAppNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
3
+ export declare const GetInputFieldsSchemaSchema: z.ZodObject<{
4
+ appKey: z.ZodString & {
5
+ _def: z.ZodStringDef & import("../..").PositionalMetadata;
6
+ };
7
+ actionType: z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>;
8
+ actionKey: z.ZodString;
9
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
10
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ appKey: string;
13
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
14
+ actionKey: string;
15
+ authenticationId?: number | null | undefined;
16
+ inputs?: Record<string, unknown> | undefined;
17
+ }, {
18
+ appKey: string;
19
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
20
+ actionKey: string;
21
+ authenticationId?: number | null | undefined;
22
+ inputs?: Record<string, unknown> | undefined;
23
+ }>;
24
+ export type GetInputFieldsSchemaOptions = z.infer<typeof GetInputFieldsSchemaSchema>;
25
+ export type GetInputFieldsSchemaError = ZapierConfigurationError | ZapierApiError | ZapierAuthenticationError | ZapierAppNotFoundError | ZapierValidationError | ZapierUnknownError;
26
+ export interface GetInputFieldsSchemaSdkFunction {
27
+ getInputFieldsSchema: (options: GetInputFieldsSchemaOptions) => Promise<{
28
+ data: Record<string, unknown>;
29
+ }>;
30
+ }
31
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getInputFieldsSchema/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;EAsBpC,CAAC;AAEJ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,0BAA0B,CAClC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GACjC,wBAAwB,GACxB,cAAc,GACd,yBAAyB,GACzB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,+BAA+B;IAC9C,oBAAoB,EAAE,CACpB,OAAO,EAAE,2BAA2B,KACjC,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CACjD"}
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ import { AppKeyPropertySchema, ActionTypePropertySchema, ActionKeyPropertySchema, AuthenticationIdPropertySchema, InputsPropertySchema, } from "../../types/properties";
3
+ export const GetInputFieldsSchemaSchema = z
4
+ .object({
5
+ appKey: AppKeyPropertySchema.describe("App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"),
6
+ actionType: ActionTypePropertySchema.describe("Action type that matches the action's defined type"),
7
+ actionKey: ActionKeyPropertySchema.describe("Action key to get the input schema for"),
8
+ authenticationId: AuthenticationIdPropertySchema.nullable()
9
+ .optional()
10
+ .describe("Authentication ID to use when fetching the schema. Required if the action needs authentication to determine available fields."),
11
+ inputs: InputsPropertySchema.optional().describe("Current input values that may affect the schema (e.g., when fields depend on other field values)"),
12
+ })
13
+ .describe("Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters.");
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,qBAAqB,EACrB,KAAK,sBAAsB,EAE5B,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE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cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAoKxE,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC;QAC7D,IAAI,EAAE,aAAa,EAAE,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,aAAa,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC9D,KAAK,IAAI,aAAa,CAAC,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC,CAAC;KACvE,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,eAAe,EAAE;gBACf,WAAW,EAAE,OAAO,qBAAqB,CAAC;aAC3C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,UAAU,CAAC,oBAAoB,GAAG,uBAAuB,CAAC,EAAE,uCAAuC;AACnG;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,EAAE,2DAA2D;AAC9D,6BAA6B,CAgF9B,CAAC"}
@@ -154,6 +154,8 @@ export const listInputFieldsPlugin = ({ sdk, context }) => {
154
154
  if (!selectedApi) {
155
155
  throw new ZapierConfigurationError("No current_implementation_id found for app", { configType: "current_implementation_id" });
156
156
  }
157
+ // Need to call getAction here because it resolves both action.key AND action.id
158
+ // eg: `create_report` or `core:39487493`
157
159
  const { data: action } = await sdk.getAction({
158
160
  appKey,
159
161
  actionType,
package/dist/sdk.d.ts CHANGED
@@ -13,7 +13,7 @@ export declare function createSdk<TCurrentSdk = {}, TCurrentContext extends {
13
13
  getContext(): TCurrentContext;
14
14
  }, TRequiresContext, TProvides>, addPluginOptions?: Record<string, unknown>): Sdk<TCurrentSdk & ExtractSdkProperties<TProvides>, TCurrentContext & NonNullable<ExtractContextProperties<TProvides>>>;
15
15
  };
16
- export declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk<ExtractSdkProperties<import("./plugins/eventEmission").EventEmissionProvides> & ExtractSdkProperties<import(".").ApiPluginProvides> & ExtractSdkProperties<import(".").ManifestPluginProvides> & ExtractSdkProperties<import(".").ListAppsPluginProvides> & ExtractSdkProperties<import(".").GetAppPluginProvides> & ExtractSdkProperties<import(".").ListActionsPluginProvides> & ExtractSdkProperties<import(".").GetActionPluginProvides> & ExtractSdkProperties<import(".").ListInputFieldsPluginProvides> & ExtractSdkProperties<import("./plugins/listInputFieldChoices").ListInputFieldChoicesPluginProvides> & ExtractSdkProperties<import(".").RunActionPluginProvides> & ExtractSdkProperties<import(".").ListAuthenticationsPluginProvides> & ExtractSdkProperties<import(".").GetAuthenticationPluginProvides> & ExtractSdkProperties<import(".").FindFirstAuthenticationPluginProvides> & ExtractSdkProperties<import(".").FindUniqueAuthenticationPluginProvides> & ExtractSdkProperties<import(".").RequestPluginProvides> & ExtractSdkProperties<import(".").FetchPluginProvides> & ExtractSdkProperties<import(".").AppsPluginProvides> & ExtractSdkProperties<import(".").GetProfilePluginProvides>, {
16
+ export declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk<ExtractSdkProperties<import("./plugins/eventEmission").EventEmissionProvides> & ExtractSdkProperties<import(".").ApiPluginProvides> & ExtractSdkProperties<import(".").ManifestPluginProvides> & ExtractSdkProperties<import(".").ListAppsPluginProvides> & ExtractSdkProperties<import(".").GetAppPluginProvides> & ExtractSdkProperties<import(".").ListActionsPluginProvides> & ExtractSdkProperties<import(".").GetActionPluginProvides> & ExtractSdkProperties<import(".").ListInputFieldsPluginProvides> & ExtractSdkProperties<import("./plugins/getInputFieldsSchema").GetInputFieldsSchemaPluginProvides> & ExtractSdkProperties<import("./plugins/listInputFieldChoices").ListInputFieldChoicesPluginProvides> & ExtractSdkProperties<import(".").RunActionPluginProvides> & ExtractSdkProperties<import(".").ListAuthenticationsPluginProvides> & ExtractSdkProperties<import(".").GetAuthenticationPluginProvides> & ExtractSdkProperties<import(".").FindFirstAuthenticationPluginProvides> & ExtractSdkProperties<import(".").FindUniqueAuthenticationPluginProvides> & ExtractSdkProperties<import(".").RequestPluginProvides> & ExtractSdkProperties<import(".").FetchPluginProvides> & ExtractSdkProperties<import(".").AppsPluginProvides> & ExtractSdkProperties<import(".").GetProfilePluginProvides>, {
17
17
  meta: Record<string, PluginMeta>;
18
18
  } & import(".").EventEmissionContext & {
19
19
  api: import("./api").ApiClient;
@@ -51,6 +51,12 @@ export declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOption
51
51
  inputSchema: typeof import("./plugins/listInputFields/schemas").ListInputFieldsSchema;
52
52
  };
53
53
  };
54
+ } & {
55
+ meta: {
56
+ getInputFieldsSchema: {
57
+ inputSchema: typeof import("./plugins/getInputFieldsSchema/schemas").GetInputFieldsSchemaSchema;
58
+ };
59
+ };
54
60
  } & {
55
61
  meta: {
56
62
  listInputFieldChoices: {
package/dist/sdk.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EACV,GAAG,EACH,MAAM,EACN,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,EACd,UAAU,EACX,MAAM,gBAAgB,CAAC;AA0BxB,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAAG;AAG3D,wBAAgB,SAAS,CACvB,WAAW,GAAG,EAAE,EAChB,eAAe,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CAAE,GAAG;IAC7D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC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,EAED,OAAO,GAAE,gBAAqB,EAC9B,UAAU,GAAE,WAA+B,EAC3C,cAAc,GAAE,eAAiD;;cAKrD,gBAAgB,EAAE,SAAS,SAAS,cAAc,UAClD,MAAM,CACZ,WAAW,GAAG;QAAE,UAAU,IAAI,eAAe,CAAA;KAAE,EAC/C,gBAAgB,EAChB,SAAS,CACV,qBACiB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACxC,GAAG,CACJ,WAAW,GAAG,oBAAoB,CAAC,SAAS,CAAC,EAC7C,eAAe,GAAG,WAAW,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,CACnE;EA8DJ;AAED,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,gBAAqB;UApFnE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4HnC;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG,SAAS,CAMzE"}
package/dist/sdk.js CHANGED
@@ -14,6 +14,7 @@ import { getAuthenticationPlugin } from "./plugins/getAuthentication";
14
14
  import { findFirstAuthenticationPlugin } from "./plugins/findFirstAuthentication";
15
15
  import { findUniqueAuthenticationPlugin } from "./plugins/findUniqueAuthentication";
16
16
  import { listInputFieldsPlugin } from "./plugins/listInputFields";
17
+ import { getInputFieldsSchemaPlugin } from "./plugins/getInputFieldsSchema";
17
18
  import { listInputFieldChoicesPlugin } from "./plugins/listInputFieldChoices";
18
19
  import { requestPlugin } from "./plugins/request";
19
20
  import { manifestPlugin } from "./plugins/manifest";
@@ -87,6 +88,7 @@ export function createZapierSdkWithoutRegistry(options = {}) {
87
88
  .addPlugin(listActionsPlugin)
88
89
  .addPlugin(getActionPlugin)
89
90
  .addPlugin(listInputFieldsPlugin)
91
+ .addPlugin(getInputFieldsSchemaPlugin)
90
92
  .addPlugin(listInputFieldChoicesPlugin)
91
93
  // Run action
92
94
  .addPlugin(runActionPlugin)
@@ -0,0 +1,14 @@
1
+ /**
2
+ * temporary-internal-core
3
+ *
4
+ * Temporary internal directory for SDK core API extraction.
5
+ * This will be extracted and moved to @sdkapi/ as @zapier/zapier-sdk-core.
6
+ *
7
+ * Purpose:
8
+ * - Single source of truth for SDK API schemas
9
+ * - Zod schemas for request/response shapes
10
+ * - API endpoint contracts
11
+ * - Lives inside zapier-sdk during extraction/migration (bundles when published)
12
+ * - Will be extracted to separate package
13
+ */
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/temporary-internal-core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /**
3
+ * temporary-internal-core
4
+ *
5
+ * Temporary internal directory for SDK core API extraction.
6
+ * This will be extracted and moved to @sdkapi/ as @zapier/zapier-sdk-core.
7
+ *
8
+ * Purpose:
9
+ * - Single source of truth for SDK API schemas
10
+ * - Zod schemas for request/response shapes
11
+ * - API endpoint contracts
12
+ * - Lives inside zapier-sdk during extraction/migration (bundles when published)
13
+ * - Will be extracted to separate package
14
+ */
@@ -41,6 +41,7 @@ import type { GetAuthenticationPluginProvides } from "../plugins/getAuthenticati
41
41
  import type { FindFirstAuthenticationPluginProvides } from "../plugins/findFirstAuthentication";
42
42
  import type { FindUniqueAuthenticationPluginProvides } from "../plugins/findUniqueAuthentication";
43
43
  import type { ListInputFieldsPluginProvides } from "../plugins/listInputFields";
44
+ import type { GetInputFieldsSchemaPluginProvides } from "../plugins/getInputFieldsSchema";
44
45
  import type { ListInputFieldChoicesPluginProvides } from "../plugins/listInputFieldChoices";
45
46
  import type { RequestPluginProvides } from "../plugins/request";
46
47
  import type { GetSdkType } from "./plugin";
@@ -62,7 +63,7 @@ export interface FunctionRegistryEntry {
62
63
  }
63
64
  export interface ZapierSdkFunctions extends ListInputFieldsSdkFunction, GetAuthenticationSdkFunction, FindFirstAuthenticationSdkFunction, FindUniqueAuthenticationSdkFunction, RelayRequestSdkFunction {
64
65
  }
65
- export interface ZapierSdk extends GetSdkType<RegistryPluginProvides & FetchPluginProvides & AppsPluginProvides & ListAppsPluginProvides & ManifestPluginProvides & GetAppPluginProvides & ListActionsPluginProvides & GetActionPluginProvides & RunActionPluginProvides & ListAuthenticationsPluginProvides & GetAuthenticationPluginProvides & FindFirstAuthenticationPluginProvides & FindUniqueAuthenticationPluginProvides & ListInputFieldsPluginProvides & ListInputFieldChoicesPluginProvides & RequestPluginProvides & GetProfilePluginProvides & EventEmissionProvides & ApiPluginProvides> {
66
+ export interface ZapierSdk extends GetSdkType<RegistryPluginProvides & FetchPluginProvides & AppsPluginProvides & ListAppsPluginProvides & ManifestPluginProvides & GetAppPluginProvides & ListActionsPluginProvides & GetActionPluginProvides & RunActionPluginProvides & ListAuthenticationsPluginProvides & GetAuthenticationPluginProvides & FindFirstAuthenticationPluginProvides & FindUniqueAuthenticationPluginProvides & ListInputFieldsPluginProvides & GetInputFieldsSchemaPluginProvides & ListInputFieldChoicesPluginProvides & RequestPluginProvides & GetProfilePluginProvides & EventEmissionProvides & ApiPluginProvides> {
66
67
  apps: ActionProxy & ZapierSdkApps;
67
68
  }
68
69
  //# sourceMappingURL=sdk.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/types/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,M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,UAAU,CAChB,sBAAsB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,sBAAsB,GACtB,sBAAsB,GACtB,oBAAoB,GACpB,yBAAyB,GACzB,uBAAuB,GACvB,uBAAuB,GACvB,iCAAiC,GACjC,+BAA+B,GAC/B,qCAAqC,GACrC,sCAAsC,GACtC,6BAA6B,GAC7B,kCAAkC,GAClC,mCAAmC,GACnC,qBAAqB,GACrB,wBAAwB,GACxB,qBAAqB,GACrB,iBAAiB,CACpB;IAED,IAAI,EAAE,WAAW,GAAG,aAAa,CAAC;CACnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",