@zapier/zapier-sdk 0.18.2 → 0.18.4

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 (85) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +13 -13
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +0 -18
  5. package/dist/api/schemas.d.ts +0 -158
  6. package/dist/api/schemas.d.ts.map +1 -1
  7. package/dist/api/schemas.js +0 -95
  8. package/dist/api/types.d.ts +2 -1
  9. package/dist/api/types.d.ts.map +1 -1
  10. package/dist/index.cjs +400 -808
  11. package/dist/index.d.mts +67 -122
  12. package/dist/index.mjs +401 -809
  13. package/dist/plugins/findFirstAuthentication/index.test.js +2 -2
  14. package/dist/plugins/findUniqueAuthentication/index.test.js +2 -2
  15. package/dist/plugins/listApps/index.d.ts +2 -8
  16. package/dist/plugins/listApps/index.d.ts.map +1 -1
  17. package/dist/plugins/listApps/index.js +4 -6
  18. package/dist/plugins/listApps/index.test.js +62 -82
  19. package/dist/plugins/listApps/schemas.d.ts +35 -14
  20. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  21. package/dist/plugins/listApps/schemas.js +44 -14
  22. package/dist/plugins/listAuthentications/index.d.ts +4 -10
  23. package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
  24. package/dist/plugins/listAuthentications/index.js +19 -31
  25. package/dist/plugins/listAuthentications/index.test.js +363 -127
  26. package/dist/plugins/listAuthentications/schemas.d.ts +7 -7
  27. package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
  28. package/dist/plugins/listAuthentications/schemas.js +10 -16
  29. package/dist/schemas/App.d.ts +28 -28
  30. package/dist/schemas/App.d.ts.map +1 -1
  31. package/dist/schemas/App.js +3 -8
  32. package/dist/sdk.d.ts +2 -2
  33. package/dist/sdk.test.js +12 -9
  34. package/dist/utils/domain-utils.d.ts +2 -15
  35. package/dist/utils/domain-utils.d.ts.map +1 -1
  36. package/dist/utils/domain-utils.js +0 -38
  37. package/dist/utils/function-utils.d.ts +1 -0
  38. package/dist/utils/function-utils.d.ts.map +1 -1
  39. package/dist/utils/function-utils.js +15 -3
  40. package/package.json +2 -2
  41. package/dist/api/client.integration.test.d.ts +0 -5
  42. package/dist/api/client.integration.test.d.ts.map +0 -1
  43. package/dist/api/client.integration.test.js +0 -318
  44. package/dist/api/client.methods.test.d.ts +0 -2
  45. package/dist/api/client.methods.test.d.ts.map +0 -1
  46. package/dist/api/client.methods.test.js +0 -158
  47. package/dist/api/router.d.ts +0 -16
  48. package/dist/api/router.d.ts.map +0 -1
  49. package/dist/api/router.js +0 -31
  50. package/dist/api/router.test.d.ts +0 -2
  51. package/dist/api/router.test.d.ts.map +0 -1
  52. package/dist/api/router.test.js +0 -103
  53. package/dist/temporary-internal-core/handlers/listApps.d.ts +0 -67
  54. package/dist/temporary-internal-core/handlers/listApps.d.ts.map +0 -1
  55. package/dist/temporary-internal-core/handlers/listApps.js +0 -134
  56. package/dist/temporary-internal-core/handlers/listApps.test.d.ts +0 -2
  57. package/dist/temporary-internal-core/handlers/listApps.test.d.ts.map +0 -1
  58. package/dist/temporary-internal-core/handlers/listApps.test.js +0 -367
  59. package/dist/temporary-internal-core/index.d.ts +0 -18
  60. package/dist/temporary-internal-core/index.d.ts.map +0 -1
  61. package/dist/temporary-internal-core/index.js +0 -18
  62. package/dist/temporary-internal-core/schemas/apps/index.d.ts +0 -175
  63. package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +0 -1
  64. package/dist/temporary-internal-core/schemas/apps/index.js +0 -97
  65. package/dist/temporary-internal-core/schemas/errors/index.d.ts +0 -139
  66. package/dist/temporary-internal-core/schemas/errors/index.d.ts.map +0 -1
  67. package/dist/temporary-internal-core/schemas/errors/index.js +0 -129
  68. package/dist/temporary-internal-core/schemas/implementations/index.d.ts +0 -127
  69. package/dist/temporary-internal-core/schemas/implementations/index.d.ts.map +0 -1
  70. package/dist/temporary-internal-core/schemas/implementations/index.js +0 -79
  71. package/dist/temporary-internal-core/types/handler.d.ts +0 -51
  72. package/dist/temporary-internal-core/types/handler.d.ts.map +0 -1
  73. package/dist/temporary-internal-core/types/handler.js +0 -8
  74. package/dist/temporary-internal-core/types/index.d.ts +0 -5
  75. package/dist/temporary-internal-core/types/index.d.ts.map +0 -1
  76. package/dist/temporary-internal-core/types/index.js +0 -4
  77. package/dist/temporary-internal-core/utils/app-locators.d.ts +0 -34
  78. package/dist/temporary-internal-core/utils/app-locators.d.ts.map +0 -1
  79. package/dist/temporary-internal-core/utils/app-locators.js +0 -39
  80. package/dist/temporary-internal-core/utils/string-utils.d.ts +0 -28
  81. package/dist/temporary-internal-core/utils/string-utils.d.ts.map +0 -1
  82. package/dist/temporary-internal-core/utils/string-utils.js +0 -52
  83. package/dist/temporary-internal-core/utils/transformations.d.ts +0 -32
  84. package/dist/temporary-internal-core/utils/transformations.d.ts.map +0 -1
  85. package/dist/temporary-internal-core/utils/transformations.js +0 -74
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
- import { AuthenticationSchema, AuthenticationsResponseSchema, GetAuthenticationParam, GetAuthenticationResponse, GetAuthenticationParamSchema } from '@zapier/zapier-sdk-core/v0/schemas/authentications';
3
+ import { AuthenticationSchema, AuthenticationsResponseSchema, AuthenticationItem as AuthenticationItem$1, GetAuthenticationParam, GetAuthenticationResponse, GetAuthenticationParamSchema } from '@zapier/zapier-sdk-core/v0/schemas/authentications';
4
+ import { AppItem as AppItem$1 } from '@zapier/zapier-sdk-core/v0/schemas/apps';
4
5
  import * as zod_v4_core from 'zod/v4/core';
5
6
 
6
7
  /**
@@ -1362,23 +1363,29 @@ declare const GetAppSchema: z.ZodObject<{
1362
1363
  type GetAppOptions = z.infer<typeof GetAppSchema>;
1363
1364
 
1364
1365
  /**
1365
- * App and Service schemas
1366
+ * Plugin schemas for listApps
1366
1367
  *
1367
- * Covers:
1368
- * - App metadata
1369
- * - Service definitions
1370
- * - App listings and searches
1368
+ * Imports base query schema from @zapier/zapier-sdk-core (sdkapi) and extends
1369
+ * with SDK-specific options.
1370
+ *
1371
+ * Note: The sdkapi endpoint uses ListAppsQuerySchema (HTTP query params),
1372
+ * but the SDK exposes ListAppsSchema (user-friendly options):
1373
+ * - ListAppsOptions accepts `appKeys` as array, `cursor`, `maxItems`
1374
+ * - ListAppsQuery accepts `appKeys` as comma-separated string, `offset`
1375
+ * - The plugin transforms between these formats
1371
1376
  */
1372
1377
 
1373
1378
  /**
1374
- * Public API schema for listApps operation
1379
+ * SDK user-facing options for listApps
1375
1380
  *
1376
- * This is the user-facing schema that accepts app keys (slugs, implementation names, etc.)
1377
- * The plugin resolves these to implementation IDs before calling the handler.
1381
+ * Extends ListAppsQuerySchema from zapier-sdk-core with SDK-specific options:
1382
+ * - appKeys: array (not comma-separated string)
1383
+ * - cursor: pagination cursor (not offset)
1384
+ * - maxItems: SDK-specific pagination limit
1378
1385
  */
1379
- declare const ListAppsOptionsSchema: z.ZodObject<{
1380
- appKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
1386
+ declare const ListAppsSchema: z.ZodObject<{
1381
1387
  search: z.ZodOptional<z.ZodString>;
1388
+ appKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
1382
1389
  pageSize: z.ZodOptional<z.ZodNumber>;
1383
1390
  maxItems: z.ZodOptional<z.ZodNumber>;
1384
1391
  cursor: z.ZodOptional<z.ZodString>;
@@ -1386,80 +1393,20 @@ declare const ListAppsOptionsSchema: z.ZodObject<{
1386
1393
  isNested: z.ZodOptional<z.ZodBoolean>;
1387
1394
  }, z.core.$strip>>;
1388
1395
  }, z.core.$strip>;
1389
- type ListAppsOptions = z.infer<typeof ListAppsOptionsSchema>;
1390
- /**
1391
- * Normalized app item returned by listApps
1392
- * This extends ImplementationMetaSchema with transformed fields (title, key, implementation_id)
1393
- */
1394
- declare const AppItemSchema$1: z.ZodObject<{
1395
- categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
1396
- id: z.ZodNumber;
1397
- name: z.ZodString;
1398
- slug: z.ZodString;
1399
- }, z.core.$strip>>>;
1400
- actions: z.ZodOptional<z.ZodObject<{
1401
- read: z.ZodOptional<z.ZodNumber>;
1402
- read_bulk: z.ZodOptional<z.ZodNumber>;
1403
- write: z.ZodOptional<z.ZodNumber>;
1404
- search: z.ZodOptional<z.ZodNumber>;
1405
- search_or_write: z.ZodOptional<z.ZodNumber>;
1406
- search_and_write: z.ZodOptional<z.ZodNumber>;
1407
- filter: z.ZodOptional<z.ZodNumber>;
1408
- }, z.core.$strip>>;
1409
- description: z.ZodOptional<z.ZodString>;
1410
- is_hidden: z.ZodOptional<z.ZodBoolean>;
1411
- age_in_days: z.ZodOptional<z.ZodNumber>;
1412
- api_docs_url: z.ZodOptional<z.ZodString>;
1413
- banner: z.ZodOptional<z.ZodString>;
1414
- image: z.ZodOptional<z.ZodString>;
1415
- images: z.ZodOptional<z.ZodObject<{
1416
- url_16x16: z.ZodOptional<z.ZodString>;
1417
- url_32x32: z.ZodOptional<z.ZodString>;
1418
- url_64x64: z.ZodOptional<z.ZodString>;
1419
- url_128x128: z.ZodOptional<z.ZodString>;
1420
- }, z.core.$strip>>;
1421
- is_beta: z.ZodOptional<z.ZodBoolean>;
1422
- is_built_in: z.ZodOptional<z.ZodBoolean>;
1423
- is_featured: z.ZodOptional<z.ZodBoolean>;
1424
- is_premium: z.ZodOptional<z.ZodBoolean>;
1425
- is_public: z.ZodOptional<z.ZodBoolean>;
1426
- is_upcoming: z.ZodOptional<z.ZodBoolean>;
1427
- popularity: z.ZodOptional<z.ZodNumber>;
1428
- primary_color: z.ZodOptional<z.ZodString>;
1429
- slug: z.ZodString;
1430
- auth_type: z.ZodOptional<z.ZodString>;
1431
- is_deprecated: z.ZodOptional<z.ZodBoolean>;
1432
- secondary_color: z.ZodOptional<z.ZodString>;
1433
- has_filters: z.ZodOptional<z.ZodBoolean>;
1434
- has_reads: z.ZodOptional<z.ZodBoolean>;
1435
- has_searches: z.ZodOptional<z.ZodBoolean>;
1436
- has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
1437
- has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
1438
- has_writes: z.ZodOptional<z.ZodBoolean>;
1439
- is_invite: z.ZodOptional<z.ZodBoolean>;
1440
- visibility: z.ZodOptional<z.ZodString>;
1441
- classification: z.ZodOptional<z.ZodString>;
1442
- title: z.ZodString;
1443
- key: z.ZodString;
1444
- implementation_id: z.ZodString;
1445
- version: z.ZodOptional<z.ZodString>;
1446
- }, z.core.$strip>;
1447
- type AppItem$1 = z.infer<typeof AppItemSchema$1>;
1396
+ type ListAppsOptions = z.infer<typeof ListAppsSchema>;
1397
+ interface ListAppsPage {
1398
+ data: AppItem$1[];
1399
+ nextCursor?: string;
1400
+ }
1448
1401
 
1449
1402
  interface ListAppsPluginProvides {
1450
- listApps: (options?: ListAppsOptions) => Promise<{
1451
- data: AppItem$1[];
1452
- nextCursor?: string;
1453
- }> & AsyncIterable<{
1454
- data: AppItem$1[];
1455
- nextCursor?: string;
1456
- }> & {
1403
+ listApps: (options?: ListAppsOptions) => Promise<ListAppsPage> & AsyncIterable<ListAppsPage> & {
1457
1404
  items(): AsyncIterable<AppItem$1>;
1458
1405
  };
1459
1406
  context: {
1460
1407
  meta: {
1461
1408
  listApps: {
1462
- inputSchema: typeof ListAppsOptionsSchema;
1409
+ inputSchema: typeof ListAppsSchema;
1463
1410
  };
1464
1411
  };
1465
1412
  };
@@ -1516,15 +1463,15 @@ AppsPluginProvides>;
1516
1463
  interface ZapierSdkApps {
1517
1464
  }
1518
1465
 
1519
- declare const ListAuthenticationsSchema: z.ZodObject<{
1466
+ declare const ListAuthenticationsQuerySchema: z.ZodObject<{
1467
+ search: z.ZodOptional<z.ZodString>;
1468
+ title: z.ZodOptional<z.ZodString>;
1469
+ accountId: z.ZodOptional<z.ZodString>;
1470
+ owner: z.ZodOptional<z.ZodString>;
1520
1471
  appKey: z.ZodOptional<z.ZodString & {
1521
1472
  _def: z.core.$ZodStringDef & PositionalMetadata;
1522
1473
  }>;
1523
1474
  authenticationIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1524
- search: z.ZodOptional<z.ZodString>;
1525
- title: z.ZodOptional<z.ZodString>;
1526
- accountId: z.ZodOptional<z.ZodString>;
1527
- owner: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"me">]>>;
1528
1475
  pageSize: z.ZodOptional<z.ZodNumber>;
1529
1476
  maxItems: z.ZodOptional<z.ZodNumber>;
1530
1477
  cursor: z.ZodOptional<z.ZodString>;
@@ -1532,22 +1479,20 @@ declare const ListAuthenticationsSchema: z.ZodObject<{
1532
1479
  isNested: z.ZodOptional<z.ZodBoolean>;
1533
1480
  }, z.core.$strip>>;
1534
1481
  }, z.core.$strip>;
1535
- type ListAuthenticationsOptions = z.infer<typeof ListAuthenticationsSchema>;
1482
+ type ListAuthenticationsOptions = z.infer<typeof ListAuthenticationsQuerySchema>;
1483
+ interface ListAuthenticationsPage {
1484
+ data: AuthenticationItem$1[];
1485
+ nextCursor?: string;
1486
+ }
1536
1487
 
1537
1488
  interface ListAuthenticationsPluginProvides {
1538
- listAuthentications: (options?: ListAuthenticationsOptions) => Promise<{
1539
- data: AuthenticationItem[];
1540
- nextCursor?: string;
1541
- }> & AsyncIterable<{
1542
- data: AuthenticationItem[];
1543
- nextCursor?: string;
1544
- }> & {
1545
- items(): AsyncIterable<AuthenticationItem>;
1489
+ listAuthentications: (options?: ListAuthenticationsOptions) => Promise<ListAuthenticationsPage> & AsyncIterable<ListAuthenticationsPage> & {
1490
+ items(): AsyncIterable<AuthenticationItem$1>;
1546
1491
  };
1547
1492
  context: {
1548
1493
  meta: {
1549
1494
  listAuthentications: {
1550
- inputSchema: typeof ListAuthenticationsSchema;
1495
+ inputSchema: typeof ListAuthenticationsQuerySchema;
1551
1496
  };
1552
1497
  };
1553
1498
  };
@@ -1852,57 +1797,57 @@ interface PositionalMetadata {
1852
1797
  declare function isPositional(schema: z.ZodType): boolean;
1853
1798
 
1854
1799
  declare const AppItemSchema: z.ZodObject<{
1800
+ slug: z.ZodString;
1801
+ age_in_days: z.ZodOptional<z.ZodNumber>;
1802
+ auth_type: z.ZodOptional<z.ZodString>;
1803
+ banner: z.ZodOptional<z.ZodString>;
1855
1804
  categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
1856
1805
  id: z.ZodNumber;
1857
1806
  name: z.ZodString;
1858
1807
  slug: z.ZodString;
1859
1808
  }, z.core.$strip>>>;
1860
- actions: z.ZodOptional<z.ZodObject<{
1861
- read: z.ZodOptional<z.ZodNumber>;
1862
- read_bulk: z.ZodOptional<z.ZodNumber>;
1863
- write: z.ZodOptional<z.ZodNumber>;
1864
- search: z.ZodOptional<z.ZodNumber>;
1865
- search_or_write: z.ZodOptional<z.ZodNumber>;
1866
- search_and_write: z.ZodOptional<z.ZodNumber>;
1867
- filter: z.ZodOptional<z.ZodNumber>;
1868
- }, z.core.$strip>>;
1869
- description: z.ZodOptional<z.ZodString>;
1870
- is_hidden: z.ZodOptional<z.ZodBoolean>;
1871
- age_in_days: z.ZodOptional<z.ZodNumber>;
1872
- api_docs_url: z.ZodOptional<z.ZodString>;
1873
- banner: z.ZodOptional<z.ZodString>;
1874
- image: z.ZodOptional<z.ZodString>;
1875
1809
  images: z.ZodOptional<z.ZodObject<{
1876
1810
  url_16x16: z.ZodOptional<z.ZodString>;
1877
1811
  url_32x32: z.ZodOptional<z.ZodString>;
1878
1812
  url_64x64: z.ZodOptional<z.ZodString>;
1879
1813
  url_128x128: z.ZodOptional<z.ZodString>;
1880
1814
  }, z.core.$strip>>;
1881
- is_beta: z.ZodOptional<z.ZodBoolean>;
1882
- is_built_in: z.ZodOptional<z.ZodBoolean>;
1883
- is_featured: z.ZodOptional<z.ZodBoolean>;
1884
- is_premium: z.ZodOptional<z.ZodBoolean>;
1885
- is_public: z.ZodOptional<z.ZodBoolean>;
1886
- is_upcoming: z.ZodOptional<z.ZodBoolean>;
1887
1815
  popularity: z.ZodOptional<z.ZodNumber>;
1888
- primary_color: z.ZodOptional<z.ZodString>;
1889
- slug: z.ZodString;
1890
- auth_type: z.ZodOptional<z.ZodString>;
1891
- is_deprecated: z.ZodOptional<z.ZodBoolean>;
1892
- secondary_color: z.ZodOptional<z.ZodString>;
1893
1816
  has_filters: z.ZodOptional<z.ZodBoolean>;
1894
1817
  has_reads: z.ZodOptional<z.ZodBoolean>;
1895
1818
  has_searches: z.ZodOptional<z.ZodBoolean>;
1896
1819
  has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
1897
1820
  has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
1898
1821
  has_writes: z.ZodOptional<z.ZodBoolean>;
1822
+ is_beta: z.ZodOptional<z.ZodBoolean>;
1823
+ is_built_in: z.ZodOptional<z.ZodBoolean>;
1824
+ is_deprecated: z.ZodOptional<z.ZodBoolean>;
1825
+ is_featured: z.ZodOptional<z.ZodBoolean>;
1826
+ is_hidden: z.ZodOptional<z.ZodBoolean>;
1899
1827
  is_invite: z.ZodOptional<z.ZodBoolean>;
1900
- version: z.ZodOptional<z.ZodString>;
1828
+ is_premium: z.ZodOptional<z.ZodBoolean>;
1829
+ is_public: z.ZodOptional<z.ZodBoolean>;
1830
+ is_upcoming: z.ZodOptional<z.ZodBoolean>;
1901
1831
  visibility: z.ZodOptional<z.ZodString>;
1832
+ actions: z.ZodOptional<z.ZodObject<{
1833
+ read: z.ZodOptional<z.ZodNumber>;
1834
+ read_bulk: z.ZodOptional<z.ZodNumber>;
1835
+ write: z.ZodOptional<z.ZodNumber>;
1836
+ search: z.ZodOptional<z.ZodNumber>;
1837
+ search_or_write: z.ZodOptional<z.ZodNumber>;
1838
+ search_and_write: z.ZodOptional<z.ZodNumber>;
1839
+ filter: z.ZodOptional<z.ZodNumber>;
1840
+ }, z.core.$strip>>;
1841
+ description: z.ZodOptional<z.ZodString>;
1842
+ primary_color: z.ZodOptional<z.ZodString>;
1843
+ secondary_color: z.ZodOptional<z.ZodString>;
1902
1844
  classification: z.ZodOptional<z.ZodString>;
1845
+ api_docs_url: z.ZodOptional<z.ZodString>;
1846
+ image: z.ZodOptional<z.ZodString>;
1903
1847
  title: z.ZodString;
1904
1848
  key: z.ZodString;
1905
1849
  implementation_id: z.ZodString;
1850
+ version: z.ZodOptional<z.ZodString>;
1906
1851
  }, z.core.$strip>;
1907
1852
 
1908
1853
  declare const AuthenticationItemSchema: z.ZodObject<{
@@ -2308,7 +2253,7 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
2308
2253
  } & {
2309
2254
  meta: {
2310
2255
  listApps: {
2311
- inputSchema: typeof ListAppsOptionsSchema;
2256
+ inputSchema: typeof ListAppsSchema;
2312
2257
  };
2313
2258
  };
2314
2259
  } & {
@@ -2356,7 +2301,7 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
2356
2301
  } & {
2357
2302
  meta: {
2358
2303
  listAuthentications: {
2359
- inputSchema: typeof ListAuthenticationsSchema;
2304
+ inputSchema: typeof ListAuthenticationsQuerySchema;
2360
2305
  };
2361
2306
  };
2362
2307
  } & {