@zapier/zapier-sdk 0.15.1 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/api/client.d.ts.map +1 -1
  3. package/dist/api/client.integration.test.d.ts +5 -0
  4. package/dist/api/client.integration.test.d.ts.map +1 -0
  5. package/dist/api/client.integration.test.js +318 -0
  6. package/dist/api/client.js +31 -1
  7. package/dist/index.cjs +304 -104
  8. package/dist/index.d.mts +243 -31
  9. package/dist/index.mjs +304 -104
  10. package/dist/plugins/getApp/index.test.js +17 -21
  11. package/dist/plugins/listActions/schemas.d.ts +4 -4
  12. package/dist/plugins/listApps/index.d.ts +1 -3
  13. package/dist/plugins/listApps/index.d.ts.map +1 -1
  14. package/dist/plugins/listApps/index.js +18 -44
  15. package/dist/plugins/listApps/index.test.js +89 -288
  16. package/dist/plugins/listApps/schemas.d.ts +19 -26
  17. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  18. package/dist/plugins/listApps/schemas.js +19 -18
  19. package/dist/plugins/listAuthentications/schemas.d.ts +4 -4
  20. package/dist/plugins/listInputFieldChoices/schemas.d.ts +4 -4
  21. package/dist/plugins/listInputFields/schemas.d.ts +4 -4
  22. package/dist/plugins/runAction/schemas.d.ts +4 -4
  23. package/dist/sdk.d.ts +1 -1
  24. package/dist/temporary-internal-core/handlers/listApps.d.ts +67 -0
  25. package/dist/temporary-internal-core/handlers/listApps.d.ts.map +1 -0
  26. package/dist/temporary-internal-core/handlers/listApps.js +121 -0
  27. package/dist/temporary-internal-core/handlers/listApps.test.d.ts +2 -0
  28. package/dist/temporary-internal-core/handlers/listApps.test.d.ts.map +1 -0
  29. package/dist/temporary-internal-core/handlers/listApps.test.js +328 -0
  30. package/dist/temporary-internal-core/index.d.ts +4 -0
  31. package/dist/temporary-internal-core/index.d.ts.map +1 -1
  32. package/dist/temporary-internal-core/index.js +5 -1
  33. package/dist/temporary-internal-core/schemas/apps/index.d.ts +582 -0
  34. package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +1 -0
  35. package/dist/temporary-internal-core/schemas/apps/index.js +95 -0
  36. package/dist/temporary-internal-core/schemas/implementations/index.d.ts +511 -0
  37. package/dist/temporary-internal-core/schemas/implementations/index.d.ts.map +1 -0
  38. package/dist/temporary-internal-core/schemas/implementations/index.js +79 -0
  39. package/dist/temporary-internal-core/types/handler.d.ts +51 -0
  40. package/dist/temporary-internal-core/types/handler.d.ts.map +1 -0
  41. package/dist/temporary-internal-core/types/handler.js +8 -0
  42. package/dist/temporary-internal-core/types/index.d.ts +5 -0
  43. package/dist/temporary-internal-core/types/index.d.ts.map +1 -0
  44. package/dist/temporary-internal-core/types/index.js +4 -0
  45. package/dist/temporary-internal-core/utils/app-locators.d.ts +54 -0
  46. package/dist/temporary-internal-core/utils/app-locators.d.ts.map +1 -0
  47. package/dist/temporary-internal-core/utils/app-locators.js +83 -0
  48. package/dist/temporary-internal-core/utils/transformations.d.ts +18 -0
  49. package/dist/temporary-internal-core/utils/transformations.d.ts.map +1 -0
  50. package/dist/temporary-internal-core/utils/transformations.js +36 -0
  51. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1564,18 +1564,18 @@ declare const ListInputFieldsSchema: z.ZodObject<{
1564
1564
  appKey: string;
1565
1565
  actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1566
1566
  actionKey: string;
1567
- cursor?: string | undefined;
1568
- maxItems?: number | undefined;
1569
1567
  pageSize?: number | undefined;
1568
+ maxItems?: number | undefined;
1569
+ cursor?: string | undefined;
1570
1570
  authenticationId?: number | null | undefined;
1571
1571
  inputs?: Record<string, unknown> | undefined;
1572
1572
  }, {
1573
1573
  appKey: string;
1574
1574
  actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1575
1575
  actionKey: string;
1576
- cursor?: string | undefined;
1577
- maxItems?: number | undefined;
1578
1576
  pageSize?: number | undefined;
1577
+ maxItems?: number | undefined;
1578
+ cursor?: string | undefined;
1579
1579
  authenticationId?: number | null | undefined;
1580
1580
  inputs?: Record<string, unknown> | undefined;
1581
1581
  }>;
@@ -1855,18 +1855,18 @@ declare const RunActionSchema: z.ZodObject<{
1855
1855
  appKey: string;
1856
1856
  actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1857
1857
  actionKey: string;
1858
- cursor?: string | undefined;
1859
- maxItems?: number | undefined;
1860
1858
  pageSize?: number | undefined;
1859
+ maxItems?: number | undefined;
1860
+ cursor?: string | undefined;
1861
1861
  authenticationId?: number | null | undefined;
1862
1862
  inputs?: Record<string, unknown> | undefined;
1863
1863
  }, {
1864
1864
  appKey: string;
1865
1865
  actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1866
1866
  actionKey: string;
1867
- cursor?: string | undefined;
1868
- maxItems?: number | undefined;
1869
1867
  pageSize?: number | undefined;
1868
+ maxItems?: number | undefined;
1869
+ cursor?: string | undefined;
1870
1870
  authenticationId?: number | null | undefined;
1871
1871
  inputs?: Record<string, unknown> | undefined;
1872
1872
  }>;
@@ -1899,15 +1899,15 @@ declare const ListActionsSchema: z.ZodObject<{
1899
1899
  cursor: z.ZodOptional<z.ZodString>;
1900
1900
  }, "strip", z.ZodTypeAny, {
1901
1901
  appKey: string;
1902
- cursor?: string | undefined;
1903
- maxItems?: number | undefined;
1904
1902
  pageSize?: number | undefined;
1903
+ maxItems?: number | undefined;
1904
+ cursor?: string | undefined;
1905
1905
  actionType?: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write" | undefined;
1906
1906
  }, {
1907
1907
  appKey: string;
1908
- cursor?: string | undefined;
1909
- maxItems?: number | undefined;
1910
1908
  pageSize?: number | undefined;
1909
+ maxItems?: number | undefined;
1910
+ cursor?: string | undefined;
1911
1911
  actionType?: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write" | undefined;
1912
1912
  }>;
1913
1913
  type ListActionsOptions = z.infer<typeof ListActionsSchema>;
@@ -1964,7 +1964,22 @@ declare const GetAppSchema: z.ZodObject<{
1964
1964
  }>;
1965
1965
  type GetAppOptions = z.infer<typeof GetAppSchema>;
1966
1966
 
1967
- declare const ListAppsSchema: z.ZodObject<{
1967
+ /**
1968
+ * App and Service schemas
1969
+ *
1970
+ * Covers:
1971
+ * - App metadata
1972
+ * - Service definitions
1973
+ * - App listings and searches
1974
+ */
1975
+
1976
+ /**
1977
+ * Public API schema for listApps operation
1978
+ *
1979
+ * This is the user-facing schema that accepts app keys (slugs, implementation names, etc.)
1980
+ * The plugin resolves these to implementation IDs before calling the handler.
1981
+ */
1982
+ declare const ListAppsOptionsSchema: z.ZodObject<{
1968
1983
  appKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1969
1984
  search: z.ZodOptional<z.ZodString>;
1970
1985
  pageSize: z.ZodOptional<z.ZodNumber>;
@@ -1973,32 +1988,229 @@ declare const ListAppsSchema: z.ZodObject<{
1973
1988
  }, "strip", z.ZodTypeAny, {
1974
1989
  search?: string | undefined;
1975
1990
  appKeys?: string[] | undefined;
1976
- cursor?: string | undefined;
1977
- maxItems?: number | undefined;
1978
1991
  pageSize?: number | undefined;
1992
+ maxItems?: number | undefined;
1993
+ cursor?: string | undefined;
1979
1994
  }, {
1980
1995
  search?: string | undefined;
1981
1996
  appKeys?: string[] | undefined;
1982
- cursor?: string | undefined;
1983
- maxItems?: number | undefined;
1984
1997
  pageSize?: number | undefined;
1998
+ maxItems?: number | undefined;
1999
+ cursor?: string | undefined;
2000
+ }>;
2001
+ type ListAppsOptions = z.infer<typeof ListAppsOptionsSchema>;
2002
+ /**
2003
+ * Normalized app item returned by listApps
2004
+ * This extends ImplementationMetaSchema with transformed fields (title, key, implementation_id)
2005
+ */
2006
+ declare const AppItemSchema$1: z.ZodObject<{
2007
+ categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
2008
+ id: z.ZodNumber;
2009
+ name: z.ZodString;
2010
+ slug: z.ZodString;
2011
+ }, "strip", z.ZodTypeAny, {
2012
+ id: number;
2013
+ name: string;
2014
+ slug: string;
2015
+ }, {
2016
+ id: number;
2017
+ name: string;
2018
+ slug: string;
2019
+ }>, "many">>;
2020
+ actions: z.ZodOptional<z.ZodObject<{
2021
+ read: z.ZodOptional<z.ZodNumber>;
2022
+ read_bulk: z.ZodOptional<z.ZodNumber>;
2023
+ write: z.ZodOptional<z.ZodNumber>;
2024
+ search: z.ZodOptional<z.ZodNumber>;
2025
+ search_or_write: z.ZodOptional<z.ZodNumber>;
2026
+ search_and_write: z.ZodOptional<z.ZodNumber>;
2027
+ filter: z.ZodOptional<z.ZodNumber>;
2028
+ }, "strip", z.ZodTypeAny, {
2029
+ search?: number | undefined;
2030
+ filter?: number | undefined;
2031
+ read?: number | undefined;
2032
+ read_bulk?: number | undefined;
2033
+ search_and_write?: number | undefined;
2034
+ search_or_write?: number | undefined;
2035
+ write?: number | undefined;
2036
+ }, {
2037
+ search?: number | undefined;
2038
+ filter?: number | undefined;
2039
+ read?: number | undefined;
2040
+ read_bulk?: number | undefined;
2041
+ search_and_write?: number | undefined;
2042
+ search_or_write?: number | undefined;
2043
+ write?: number | undefined;
2044
+ }>>;
2045
+ description: z.ZodOptional<z.ZodString>;
2046
+ is_hidden: z.ZodOptional<z.ZodBoolean>;
2047
+ age_in_days: z.ZodOptional<z.ZodNumber>;
2048
+ api_docs_url: z.ZodOptional<z.ZodString>;
2049
+ banner: z.ZodOptional<z.ZodString>;
2050
+ image: z.ZodOptional<z.ZodString>;
2051
+ images: z.ZodOptional<z.ZodObject<{
2052
+ url_16x16: z.ZodOptional<z.ZodString>;
2053
+ url_32x32: z.ZodOptional<z.ZodString>;
2054
+ url_64x64: z.ZodOptional<z.ZodString>;
2055
+ url_128x128: z.ZodOptional<z.ZodString>;
2056
+ }, "strip", z.ZodTypeAny, {
2057
+ url_16x16?: string | undefined;
2058
+ url_32x32?: string | undefined;
2059
+ url_64x64?: string | undefined;
2060
+ url_128x128?: string | undefined;
2061
+ }, {
2062
+ url_16x16?: string | undefined;
2063
+ url_32x32?: string | undefined;
2064
+ url_64x64?: string | undefined;
2065
+ url_128x128?: string | undefined;
2066
+ }>>;
2067
+ is_beta: z.ZodOptional<z.ZodBoolean>;
2068
+ is_built_in: z.ZodOptional<z.ZodBoolean>;
2069
+ is_featured: z.ZodOptional<z.ZodBoolean>;
2070
+ is_premium: z.ZodOptional<z.ZodBoolean>;
2071
+ is_public: z.ZodOptional<z.ZodBoolean>;
2072
+ is_upcoming: z.ZodOptional<z.ZodBoolean>;
2073
+ popularity: z.ZodOptional<z.ZodNumber>;
2074
+ primary_color: z.ZodOptional<z.ZodString>;
2075
+ slug: z.ZodString;
2076
+ auth_type: z.ZodOptional<z.ZodString>;
2077
+ is_deprecated: z.ZodOptional<z.ZodBoolean>;
2078
+ secondary_color: z.ZodOptional<z.ZodString>;
2079
+ has_filters: z.ZodOptional<z.ZodBoolean>;
2080
+ has_reads: z.ZodOptional<z.ZodBoolean>;
2081
+ has_searches: z.ZodOptional<z.ZodBoolean>;
2082
+ has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
2083
+ has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
2084
+ has_writes: z.ZodOptional<z.ZodBoolean>;
2085
+ is_invite: z.ZodOptional<z.ZodBoolean>;
2086
+ visibility: z.ZodOptional<z.ZodString>;
2087
+ classification: z.ZodOptional<z.ZodString>;
2088
+ } & {
2089
+ title: z.ZodString;
2090
+ key: z.ZodString;
2091
+ implementation_id: z.ZodString;
2092
+ version: z.ZodOptional<z.ZodString>;
2093
+ }, "strip", z.ZodTypeAny, {
2094
+ key: string;
2095
+ title: string;
2096
+ slug: string;
2097
+ implementation_id: string;
2098
+ categories?: {
2099
+ id: number;
2100
+ name: string;
2101
+ slug: string;
2102
+ }[] | undefined;
2103
+ actions?: {
2104
+ search?: number | undefined;
2105
+ filter?: number | undefined;
2106
+ read?: number | undefined;
2107
+ read_bulk?: number | undefined;
2108
+ search_and_write?: number | undefined;
2109
+ search_or_write?: number | undefined;
2110
+ write?: number | undefined;
2111
+ } | undefined;
2112
+ description?: string | undefined;
2113
+ is_hidden?: boolean | undefined;
2114
+ age_in_days?: number | undefined;
2115
+ api_docs_url?: string | undefined;
2116
+ banner?: string | undefined;
2117
+ image?: string | undefined;
2118
+ images?: {
2119
+ url_16x16?: string | undefined;
2120
+ url_32x32?: string | undefined;
2121
+ url_64x64?: string | undefined;
2122
+ url_128x128?: string | undefined;
2123
+ } | undefined;
2124
+ is_beta?: boolean | undefined;
2125
+ is_built_in?: boolean | undefined;
2126
+ is_featured?: boolean | undefined;
2127
+ is_premium?: boolean | undefined;
2128
+ is_public?: boolean | undefined;
2129
+ is_upcoming?: boolean | undefined;
2130
+ popularity?: number | undefined;
2131
+ primary_color?: string | undefined;
2132
+ auth_type?: string | undefined;
2133
+ is_deprecated?: boolean | undefined;
2134
+ secondary_color?: string | undefined;
2135
+ has_filters?: boolean | undefined;
2136
+ has_reads?: boolean | undefined;
2137
+ has_searches?: boolean | undefined;
2138
+ has_searches_or_writes?: boolean | undefined;
2139
+ has_upfront_fields?: boolean | undefined;
2140
+ has_writes?: boolean | undefined;
2141
+ is_invite?: boolean | undefined;
2142
+ version?: string | undefined;
2143
+ visibility?: string | undefined;
2144
+ classification?: string | undefined;
2145
+ }, {
2146
+ key: string;
2147
+ title: string;
2148
+ slug: string;
2149
+ implementation_id: string;
2150
+ categories?: {
2151
+ id: number;
2152
+ name: string;
2153
+ slug: string;
2154
+ }[] | undefined;
2155
+ actions?: {
2156
+ search?: number | undefined;
2157
+ filter?: number | undefined;
2158
+ read?: number | undefined;
2159
+ read_bulk?: number | undefined;
2160
+ search_and_write?: number | undefined;
2161
+ search_or_write?: number | undefined;
2162
+ write?: number | undefined;
2163
+ } | undefined;
2164
+ description?: string | undefined;
2165
+ is_hidden?: boolean | undefined;
2166
+ age_in_days?: number | undefined;
2167
+ api_docs_url?: string | undefined;
2168
+ banner?: string | undefined;
2169
+ image?: string | undefined;
2170
+ images?: {
2171
+ url_16x16?: string | undefined;
2172
+ url_32x32?: string | undefined;
2173
+ url_64x64?: string | undefined;
2174
+ url_128x128?: string | undefined;
2175
+ } | undefined;
2176
+ is_beta?: boolean | undefined;
2177
+ is_built_in?: boolean | undefined;
2178
+ is_featured?: boolean | undefined;
2179
+ is_premium?: boolean | undefined;
2180
+ is_public?: boolean | undefined;
2181
+ is_upcoming?: boolean | undefined;
2182
+ popularity?: number | undefined;
2183
+ primary_color?: string | undefined;
2184
+ auth_type?: string | undefined;
2185
+ is_deprecated?: boolean | undefined;
2186
+ secondary_color?: string | undefined;
2187
+ has_filters?: boolean | undefined;
2188
+ has_reads?: boolean | undefined;
2189
+ has_searches?: boolean | undefined;
2190
+ has_searches_or_writes?: boolean | undefined;
2191
+ has_upfront_fields?: boolean | undefined;
2192
+ has_writes?: boolean | undefined;
2193
+ is_invite?: boolean | undefined;
2194
+ version?: string | undefined;
2195
+ visibility?: string | undefined;
2196
+ classification?: string | undefined;
1985
2197
  }>;
1986
- type ListAppsOptions = z.infer<typeof ListAppsSchema>;
2198
+ type AppItem$1 = z.infer<typeof AppItemSchema$1>;
1987
2199
 
1988
2200
  interface ListAppsPluginProvides {
1989
2201
  listApps: (options?: ListAppsOptions) => Promise<{
1990
- data: AppItem[];
2202
+ data: AppItem$1[];
1991
2203
  nextCursor?: string;
1992
2204
  }> & AsyncIterable<{
1993
- data: AppItem[];
2205
+ data: AppItem$1[];
1994
2206
  nextCursor?: string;
1995
2207
  }> & {
1996
- items(): AsyncIterable<AppItem>;
2208
+ items(): AsyncIterable<AppItem$1>;
1997
2209
  };
1998
2210
  context: {
1999
2211
  meta: {
2000
2212
  listApps: {
2001
- inputSchema: typeof ListAppsSchema;
2213
+ inputSchema: typeof ListAppsOptionsSchema;
2002
2214
  };
2003
2215
  };
2004
2216
  };
@@ -2070,9 +2282,9 @@ declare const ListAuthenticationsSchema: z.ZodObject<{
2070
2282
  search?: string | undefined;
2071
2283
  title?: string | undefined;
2072
2284
  appKey?: string | undefined;
2073
- cursor?: string | undefined;
2074
- maxItems?: number | undefined;
2075
2285
  pageSize?: number | undefined;
2286
+ maxItems?: number | undefined;
2287
+ cursor?: string | undefined;
2076
2288
  accountId?: string | undefined;
2077
2289
  owner?: string | undefined;
2078
2290
  authenticationIds?: string[] | undefined;
@@ -2080,9 +2292,9 @@ declare const ListAuthenticationsSchema: z.ZodObject<{
2080
2292
  search?: string | undefined;
2081
2293
  title?: string | undefined;
2082
2294
  appKey?: string | undefined;
2083
- cursor?: string | undefined;
2084
- maxItems?: number | undefined;
2085
2295
  pageSize?: number | undefined;
2296
+ maxItems?: number | undefined;
2297
+ cursor?: string | undefined;
2086
2298
  accountId?: string | undefined;
2087
2299
  owner?: string | undefined;
2088
2300
  authenticationIds?: string[] | undefined;
@@ -2259,9 +2471,9 @@ declare const ListInputFieldChoicesSchema: z.ZodObject<{
2259
2471
  actionKey: string;
2260
2472
  inputFieldKey: string;
2261
2473
  page?: number | undefined;
2262
- cursor?: string | undefined;
2263
- maxItems?: number | undefined;
2264
2474
  pageSize?: number | undefined;
2475
+ maxItems?: number | undefined;
2476
+ cursor?: string | undefined;
2265
2477
  authenticationId?: number | null | undefined;
2266
2478
  inputs?: Record<string, unknown> | undefined;
2267
2479
  }, {
@@ -2270,9 +2482,9 @@ declare const ListInputFieldChoicesSchema: z.ZodObject<{
2270
2482
  actionKey: string;
2271
2483
  inputFieldKey: string;
2272
2484
  page?: number | undefined;
2273
- cursor?: string | undefined;
2274
- maxItems?: number | undefined;
2275
2485
  pageSize?: number | undefined;
2486
+ maxItems?: number | undefined;
2487
+ cursor?: string | undefined;
2276
2488
  authenticationId?: number | null | undefined;
2277
2489
  inputs?: Record<string, unknown> | undefined;
2278
2490
  }>;
@@ -3367,7 +3579,7 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
3367
3579
  } & {
3368
3580
  meta: {
3369
3581
  listApps: {
3370
- inputSchema: typeof ListAppsSchema;
3582
+ inputSchema: typeof ListAppsOptionsSchema;
3371
3583
  };
3372
3584
  };
3373
3585
  } & {