@zapier/zapier-sdk 0.13.5 → 0.13.7

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 (129) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/api/schemas.d.ts +38 -38
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.mts +170 -177
  5. package/dist/index.mjs +1 -1
  6. package/dist/plugins/fetch/schemas.d.ts +4 -4
  7. package/dist/plugins/getAction/schemas.d.ts +2 -2
  8. package/dist/plugins/listActions/schemas.d.ts +6 -6
  9. package/dist/plugins/listApps/schemas.d.ts +6 -6
  10. package/dist/plugins/listAuthentications/schemas.d.ts +4 -4
  11. package/dist/plugins/listInputFieldChoices/schemas.d.ts +8 -8
  12. package/dist/plugins/listInputFields/schemas.d.ts +8 -8
  13. package/dist/plugins/request/schemas.d.ts +8 -8
  14. package/dist/plugins/runAction/schemas.d.ts +8 -8
  15. package/dist/schemas/Action.d.ts +2 -2
  16. package/dist/schemas/App.d.ts +8 -8
  17. package/dist/types/sdk.d.ts +2 -8
  18. package/dist/types/sdk.d.ts.map +1 -1
  19. package/package.json +8 -3
  20. package/src/api/auth.ts +0 -28
  21. package/src/api/client.ts +0 -491
  22. package/src/api/debug.test.ts +0 -76
  23. package/src/api/debug.ts +0 -154
  24. package/src/api/index.ts +0 -90
  25. package/src/api/polling.test.ts +0 -405
  26. package/src/api/polling.ts +0 -253
  27. package/src/api/schemas.ts +0 -465
  28. package/src/api/types.ts +0 -152
  29. package/src/auth.ts +0 -72
  30. package/src/constants.ts +0 -16
  31. package/src/index.ts +0 -111
  32. package/src/plugins/api/index.ts +0 -43
  33. package/src/plugins/apps/index.ts +0 -203
  34. package/src/plugins/apps/schemas.ts +0 -64
  35. package/src/plugins/eventEmission/builders.ts +0 -115
  36. package/src/plugins/eventEmission/index.test.ts +0 -169
  37. package/src/plugins/eventEmission/index.ts +0 -294
  38. package/src/plugins/eventEmission/transport.test.ts +0 -214
  39. package/src/plugins/eventEmission/transport.ts +0 -135
  40. package/src/plugins/eventEmission/types.ts +0 -58
  41. package/src/plugins/eventEmission/utils.ts +0 -121
  42. package/src/plugins/fetch/index.ts +0 -83
  43. package/src/plugins/fetch/schemas.ts +0 -37
  44. package/src/plugins/findFirstAuthentication/index.test.ts +0 -209
  45. package/src/plugins/findFirstAuthentication/index.ts +0 -68
  46. package/src/plugins/findFirstAuthentication/schemas.ts +0 -47
  47. package/src/plugins/findUniqueAuthentication/index.test.ts +0 -197
  48. package/src/plugins/findUniqueAuthentication/index.ts +0 -77
  49. package/src/plugins/findUniqueAuthentication/schemas.ts +0 -49
  50. package/src/plugins/getAction/index.test.ts +0 -239
  51. package/src/plugins/getAction/index.ts +0 -75
  52. package/src/plugins/getAction/schemas.ts +0 -41
  53. package/src/plugins/getApp/index.test.ts +0 -181
  54. package/src/plugins/getApp/index.ts +0 -60
  55. package/src/plugins/getApp/schemas.ts +0 -33
  56. package/src/plugins/getAuthentication/index.test.ts +0 -294
  57. package/src/plugins/getAuthentication/index.ts +0 -95
  58. package/src/plugins/getAuthentication/schemas.ts +0 -38
  59. package/src/plugins/getProfile/index.ts +0 -60
  60. package/src/plugins/getProfile/schemas.ts +0 -24
  61. package/src/plugins/listActions/index.test.ts +0 -526
  62. package/src/plugins/listActions/index.ts +0 -132
  63. package/src/plugins/listActions/schemas.ts +0 -55
  64. package/src/plugins/listApps/index.test.ts +0 -378
  65. package/src/plugins/listApps/index.ts +0 -159
  66. package/src/plugins/listApps/schemas.ts +0 -41
  67. package/src/plugins/listAuthentications/index.test.ts +0 -739
  68. package/src/plugins/listAuthentications/index.ts +0 -152
  69. package/src/plugins/listAuthentications/schemas.ts +0 -77
  70. package/src/plugins/listInputFieldChoices/index.test.ts +0 -653
  71. package/src/plugins/listInputFieldChoices/index.ts +0 -173
  72. package/src/plugins/listInputFieldChoices/schemas.ts +0 -125
  73. package/src/plugins/listInputFields/index.test.ts +0 -439
  74. package/src/plugins/listInputFields/index.ts +0 -294
  75. package/src/plugins/listInputFields/schemas.ts +0 -68
  76. package/src/plugins/manifest/index.test.ts +0 -776
  77. package/src/plugins/manifest/index.ts +0 -461
  78. package/src/plugins/manifest/schemas.ts +0 -60
  79. package/src/plugins/registry/index.ts +0 -160
  80. package/src/plugins/request/index.test.ts +0 -333
  81. package/src/plugins/request/index.ts +0 -105
  82. package/src/plugins/request/schemas.ts +0 -69
  83. package/src/plugins/runAction/index.test.ts +0 -388
  84. package/src/plugins/runAction/index.ts +0 -215
  85. package/src/plugins/runAction/schemas.ts +0 -60
  86. package/src/resolvers/actionKey.ts +0 -37
  87. package/src/resolvers/actionType.ts +0 -34
  88. package/src/resolvers/appKey.ts +0 -7
  89. package/src/resolvers/authenticationId.ts +0 -54
  90. package/src/resolvers/index.ts +0 -11
  91. package/src/resolvers/inputFieldKey.ts +0 -70
  92. package/src/resolvers/inputs.ts +0 -69
  93. package/src/schemas/Action.ts +0 -52
  94. package/src/schemas/App.ts +0 -45
  95. package/src/schemas/Auth.ts +0 -59
  96. package/src/schemas/Field.ts +0 -169
  97. package/src/schemas/Run.ts +0 -40
  98. package/src/schemas/UserProfile.ts +0 -60
  99. package/src/sdk.test.ts +0 -212
  100. package/src/sdk.ts +0 -178
  101. package/src/types/domain.test.ts +0 -50
  102. package/src/types/domain.ts +0 -66
  103. package/src/types/errors.ts +0 -278
  104. package/src/types/events.ts +0 -43
  105. package/src/types/functions.ts +0 -28
  106. package/src/types/optional-zapier-sdk-cli-login.d.ts +0 -37
  107. package/src/types/plugin.ts +0 -125
  108. package/src/types/properties.ts +0 -80
  109. package/src/types/sdk.ts +0 -117
  110. package/src/types/telemetry-events.ts +0 -85
  111. package/src/utils/array-utils.test.ts +0 -131
  112. package/src/utils/array-utils.ts +0 -41
  113. package/src/utils/domain-utils.test.ts +0 -433
  114. package/src/utils/domain-utils.ts +0 -267
  115. package/src/utils/file-utils.test.ts +0 -73
  116. package/src/utils/file-utils.ts +0 -94
  117. package/src/utils/function-utils.test.ts +0 -141
  118. package/src/utils/function-utils.ts +0 -245
  119. package/src/utils/pagination-utils.test.ts +0 -620
  120. package/src/utils/pagination-utils.ts +0 -242
  121. package/src/utils/schema-utils.ts +0 -207
  122. package/src/utils/string-utils.test.ts +0 -45
  123. package/src/utils/string-utils.ts +0 -54
  124. package/src/utils/validation.test.ts +0 -51
  125. package/src/utils/validation.ts +0 -44
  126. package/tsconfig.build.json +0 -18
  127. package/tsconfig.json +0 -20
  128. package/tsconfig.tsbuildinfo +0 -1
  129. package/tsup.config.ts +0 -23
package/dist/index.d.mts CHANGED
@@ -380,8 +380,9 @@ declare const NeedSchema: z.ZodObject<{
380
380
  list: z.ZodOptional<z.ZodBoolean>;
381
381
  }, "strip", z.ZodTypeAny, {
382
382
  key: string;
383
- type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
383
+ type?: "string" | "boolean" | "code" | "filter" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
384
384
  list?: boolean | undefined;
385
+ default?: string | undefined;
385
386
  label?: string | undefined;
386
387
  alters_custom_fields?: boolean | null | undefined;
387
388
  capabilities?: string[] | undefined;
@@ -393,7 +394,6 @@ declare const NeedSchema: z.ZodObject<{
393
394
  }[] | undefined;
394
395
  computed?: boolean | null | undefined;
395
396
  custom_field?: boolean | undefined;
396
- default?: string | undefined;
397
397
  depends_on?: string[] | undefined;
398
398
  format?: "SELECT" | undefined;
399
399
  from_search?: boolean | undefined;
@@ -411,8 +411,9 @@ declare const NeedSchema: z.ZodObject<{
411
411
  regex?: string | undefined;
412
412
  }, {
413
413
  key: string;
414
- type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
414
+ type?: "string" | "boolean" | "code" | "filter" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
415
415
  list?: boolean | undefined;
416
+ default?: string | undefined;
416
417
  label?: string | undefined;
417
418
  alters_custom_fields?: boolean | null | undefined;
418
419
  capabilities?: string[] | undefined;
@@ -424,7 +425,6 @@ declare const NeedSchema: z.ZodObject<{
424
425
  }[] | undefined;
425
426
  computed?: boolean | null | undefined;
426
427
  custom_field?: boolean | undefined;
427
- default?: string | undefined;
428
428
  depends_on?: string[] | undefined;
429
429
  format?: "SELECT" | undefined;
430
430
  from_search?: boolean | undefined;
@@ -451,7 +451,7 @@ declare const ActionSchema: z.ZodObject<{
451
451
  is_hidden: z.ZodOptional<z.ZodBoolean>;
452
452
  selected_api: z.ZodOptional<z.ZodString>;
453
453
  }, "strip", z.ZodTypeAny, {
454
- type: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
454
+ type: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
455
455
  key: string;
456
456
  name: string;
457
457
  description: string;
@@ -460,7 +460,7 @@ declare const ActionSchema: z.ZodObject<{
460
460
  is_hidden?: boolean | undefined;
461
461
  selected_api?: string | undefined;
462
462
  }, {
463
- type: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
463
+ type: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
464
464
  key: string;
465
465
  name: string;
466
466
  description: string;
@@ -561,13 +561,13 @@ declare const ActionFieldSchema: z.ZodObject<{
561
561
  key: string;
562
562
  required: boolean;
563
563
  type?: string | undefined;
564
+ default?: string | undefined;
564
565
  label?: string | undefined;
565
566
  choices?: {
566
567
  value: string | number;
567
568
  label: string;
568
569
  }[] | undefined;
569
570
  computed?: boolean | undefined;
570
- default?: string | undefined;
571
571
  format?: string | undefined;
572
572
  placeholder?: string | undefined;
573
573
  helpText?: string | undefined;
@@ -579,13 +579,13 @@ declare const ActionFieldSchema: z.ZodObject<{
579
579
  key: string;
580
580
  required: boolean;
581
581
  type?: string | undefined;
582
+ default?: string | undefined;
582
583
  label?: string | undefined;
583
584
  choices?: {
584
585
  value: string | number;
585
586
  label: string;
586
587
  }[] | undefined;
587
588
  computed?: boolean | undefined;
588
- default?: string | undefined;
589
589
  format?: string | undefined;
590
590
  placeholder?: string | undefined;
591
591
  helpText?: string | undefined;
@@ -1094,8 +1094,9 @@ declare const NeedsResponseSchema: z.ZodObject<{
1094
1094
  list: z.ZodOptional<z.ZodBoolean>;
1095
1095
  }, "strip", z.ZodTypeAny, {
1096
1096
  key: string;
1097
- type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
1097
+ type?: "string" | "boolean" | "code" | "filter" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
1098
1098
  list?: boolean | undefined;
1099
+ default?: string | undefined;
1099
1100
  label?: string | undefined;
1100
1101
  alters_custom_fields?: boolean | null | undefined;
1101
1102
  capabilities?: string[] | undefined;
@@ -1107,7 +1108,6 @@ declare const NeedsResponseSchema: z.ZodObject<{
1107
1108
  }[] | undefined;
1108
1109
  computed?: boolean | null | undefined;
1109
1110
  custom_field?: boolean | undefined;
1110
- default?: string | undefined;
1111
1111
  depends_on?: string[] | undefined;
1112
1112
  format?: "SELECT" | undefined;
1113
1113
  from_search?: boolean | undefined;
@@ -1125,8 +1125,9 @@ declare const NeedsResponseSchema: z.ZodObject<{
1125
1125
  regex?: string | undefined;
1126
1126
  }, {
1127
1127
  key: string;
1128
- type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
1128
+ type?: "string" | "boolean" | "code" | "filter" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
1129
1129
  list?: boolean | undefined;
1130
+ default?: string | undefined;
1130
1131
  label?: string | undefined;
1131
1132
  alters_custom_fields?: boolean | null | undefined;
1132
1133
  capabilities?: string[] | undefined;
@@ -1138,7 +1139,6 @@ declare const NeedsResponseSchema: z.ZodObject<{
1138
1139
  }[] | undefined;
1139
1140
  computed?: boolean | null | undefined;
1140
1141
  custom_field?: boolean | undefined;
1141
- default?: string | undefined;
1142
1142
  depends_on?: string[] | undefined;
1143
1143
  format?: "SELECT" | undefined;
1144
1144
  from_search?: boolean | undefined;
@@ -1161,8 +1161,9 @@ declare const NeedsResponseSchema: z.ZodObject<{
1161
1161
  success: boolean;
1162
1162
  needs?: {
1163
1163
  key: string;
1164
- type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
1164
+ type?: "string" | "boolean" | "code" | "filter" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
1165
1165
  list?: boolean | undefined;
1166
+ default?: string | undefined;
1166
1167
  label?: string | undefined;
1167
1168
  alters_custom_fields?: boolean | null | undefined;
1168
1169
  capabilities?: string[] | undefined;
@@ -1174,7 +1175,6 @@ declare const NeedsResponseSchema: z.ZodObject<{
1174
1175
  }[] | undefined;
1175
1176
  computed?: boolean | null | undefined;
1176
1177
  custom_field?: boolean | undefined;
1177
- default?: string | undefined;
1178
1178
  depends_on?: string[] | undefined;
1179
1179
  format?: "SELECT" | undefined;
1180
1180
  from_search?: boolean | undefined;
@@ -1197,8 +1197,9 @@ declare const NeedsResponseSchema: z.ZodObject<{
1197
1197
  success: boolean;
1198
1198
  needs?: {
1199
1199
  key: string;
1200
- type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
1200
+ type?: "string" | "boolean" | "code" | "filter" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
1201
1201
  list?: boolean | undefined;
1202
+ default?: string | undefined;
1202
1203
  label?: string | undefined;
1203
1204
  alters_custom_fields?: boolean | null | undefined;
1204
1205
  capabilities?: string[] | undefined;
@@ -1210,7 +1211,6 @@ declare const NeedsResponseSchema: z.ZodObject<{
1210
1211
  }[] | undefined;
1211
1212
  computed?: boolean | null | undefined;
1212
1213
  custom_field?: boolean | undefined;
1213
- default?: string | undefined;
1214
1214
  depends_on?: string[] | undefined;
1215
1215
  format?: "SELECT" | undefined;
1216
1216
  from_search?: boolean | undefined;
@@ -1284,6 +1284,99 @@ type App = z.infer<typeof AppSchema>;
1284
1284
  type NeedsRequest = z.infer<typeof NeedsRequestSchema>;
1285
1285
  type NeedsResponse = z.infer<typeof NeedsResponseSchema>;
1286
1286
 
1287
+ /**
1288
+ * Domain utility functions for working with app identifiers and data normalization
1289
+ */
1290
+
1291
+ interface AppLocator {
1292
+ lookupAppKey: string;
1293
+ slug?: string;
1294
+ implementationName?: string;
1295
+ version?: string;
1296
+ }
1297
+ interface ResolvedAppLocator extends AppLocator {
1298
+ implementationName: string;
1299
+ }
1300
+
1301
+ declare const DEFAULT_CONFIG_PATH: ".zapierrc";
1302
+ type ManifestEntry = {
1303
+ implementationName: string;
1304
+ version?: string;
1305
+ };
1306
+ type GetVersionedImplementationId = (appKey: string) => Promise<string | null>;
1307
+ type Manifest = {
1308
+ apps: Record<string, ManifestEntry>;
1309
+ };
1310
+ type ResolveAppKeys = ({ appKeys, }: {
1311
+ appKeys: string[];
1312
+ }) => Promise<ResolvedAppLocator[]>;
1313
+ declare const ManifestPluginOptionsSchema: z.ZodObject<{
1314
+ manifestPath: z.ZodOptional<z.ZodString>;
1315
+ manifest: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1316
+ implementationName: z.ZodString;
1317
+ version: z.ZodOptional<z.ZodString>;
1318
+ }, "strip", z.ZodTypeAny, {
1319
+ implementationName: string;
1320
+ version?: string | undefined;
1321
+ }, {
1322
+ implementationName: string;
1323
+ version?: string | undefined;
1324
+ }>>>;
1325
+ }, "strip", z.ZodTypeAny, {
1326
+ manifestPath?: string | undefined;
1327
+ manifest?: Record<string, {
1328
+ implementationName: string;
1329
+ version?: string | undefined;
1330
+ }> | undefined;
1331
+ }, {
1332
+ manifestPath?: string | undefined;
1333
+ manifest?: Record<string, {
1334
+ implementationName: string;
1335
+ version?: string | undefined;
1336
+ }> | undefined;
1337
+ }>;
1338
+
1339
+ type ManifestPluginOptions = z.infer<typeof ManifestPluginOptionsSchema>;
1340
+ interface UpdateManifestEntryOptions {
1341
+ appKey: string;
1342
+ entry: ManifestEntry;
1343
+ configPath?: string;
1344
+ skipWrite?: boolean;
1345
+ manifest?: Manifest;
1346
+ }
1347
+ interface ManifestPluginProvides {
1348
+ context: {
1349
+ getVersionedImplementationId: GetVersionedImplementationId;
1350
+ resolveAppKeys: ResolveAppKeys;
1351
+ updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise<[string, ManifestEntry, Manifest]>;
1352
+ };
1353
+ }
1354
+ /**
1355
+ * Read manifest from a file path asynchronously
1356
+ * Supports local files (Node.js) and browser environments (fallback to global filesystem)
1357
+ */
1358
+ declare function readManifestFromFile(filePath: string): Promise<Manifest | null>;
1359
+ /**
1360
+ * Get the preferred key for storing an app in the manifest
1361
+ * Extracted from plugin to make it easier to test
1362
+ */
1363
+ declare function getPreferredManifestEntryKey({ appKey, api, }: {
1364
+ appKey: string;
1365
+ api: ApiClient;
1366
+ }): Promise<string>;
1367
+ /**
1368
+ * Find a manifest entry by any app key (implementation name, slug, etc.).
1369
+ */
1370
+ declare function findManifestEntry({ appKey, manifest, }: {
1371
+ appKey: string;
1372
+ manifest: Manifest;
1373
+ }): [string, ManifestEntry] | null;
1374
+
1375
+ declare const manifestPlugin: Plugin<{}, // no SDK dependencies
1376
+ {
1377
+ api: ApiClient;
1378
+ }, ManifestPluginProvides>;
1379
+
1287
1380
  /**
1288
1381
  * Function-related types and interfaces
1289
1382
  */
@@ -1466,22 +1559,22 @@ declare const ListInputFieldsSchema: z.ZodObject<{
1466
1559
  cursor: z.ZodOptional<z.ZodString>;
1467
1560
  }, "strip", z.ZodTypeAny, {
1468
1561
  appKey: string;
1469
- actionType: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
1562
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1470
1563
  actionKey: string;
1564
+ cursor?: string | undefined;
1565
+ maxItems?: number | undefined;
1566
+ pageSize?: number | undefined;
1471
1567
  authenticationId?: number | null | undefined;
1472
1568
  inputs?: Record<string, unknown> | undefined;
1473
- pageSize?: number | undefined;
1474
- maxItems?: number | undefined;
1475
- cursor?: string | undefined;
1476
1569
  }, {
1477
1570
  appKey: string;
1478
- actionType: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
1571
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1479
1572
  actionKey: string;
1573
+ cursor?: string | undefined;
1574
+ maxItems?: number | undefined;
1575
+ pageSize?: number | undefined;
1480
1576
  authenticationId?: number | null | undefined;
1481
1577
  inputs?: Record<string, unknown> | undefined;
1482
- pageSize?: number | undefined;
1483
- maxItems?: number | undefined;
1484
- cursor?: string | undefined;
1485
1578
  }>;
1486
1579
  type ListInputFieldsOptions = z.infer<typeof ListInputFieldsSchema>;
1487
1580
 
@@ -1553,20 +1646,20 @@ declare const RelayRequestSchema: z.ZodObject<{
1553
1646
  }, "strip", z.ZodTypeAny, {
1554
1647
  url: string;
1555
1648
  method?: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
1556
- authenticationId?: number | undefined;
1649
+ headers?: Record<string, string> | [string, string][] | Headers | undefined;
1557
1650
  body?: any;
1651
+ authenticationId?: number | undefined;
1558
1652
  callbackUrl?: string | undefined;
1559
1653
  authenticationTemplate?: string | undefined;
1560
- headers?: Record<string, string> | [string, string][] | Headers | undefined;
1561
1654
  relayBaseUrl?: string | undefined;
1562
1655
  }, {
1563
1656
  url: string;
1564
1657
  method?: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
1565
- authenticationId?: number | undefined;
1658
+ headers?: Record<string, string> | [string, string][] | Headers | undefined;
1566
1659
  body?: any;
1660
+ authenticationId?: number | undefined;
1567
1661
  callbackUrl?: string | undefined;
1568
1662
  authenticationTemplate?: string | undefined;
1569
- headers?: Record<string, string> | [string, string][] | Headers | undefined;
1570
1663
  relayBaseUrl?: string | undefined;
1571
1664
  }>;
1572
1665
  type RelayRequestOptions = z.infer<typeof RelayRequestSchema>;
@@ -1583,20 +1676,20 @@ declare const RelayFetchSchema: z.ZodObject<{
1583
1676
  }, "strip", z.ZodTypeAny, {
1584
1677
  url: string;
1585
1678
  method?: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
1586
- authenticationId?: number | undefined;
1679
+ headers?: Record<string, string> | [string, string][] | Headers | undefined;
1587
1680
  body?: any;
1681
+ authenticationId?: number | undefined;
1588
1682
  callbackUrl?: string | undefined;
1589
1683
  authenticationTemplate?: string | undefined;
1590
- headers?: Record<string, string> | [string, string][] | Headers | undefined;
1591
1684
  relayBaseUrl?: string | undefined;
1592
1685
  }, {
1593
1686
  url: string;
1594
1687
  method?: "POST" | "GET" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
1595
- authenticationId?: number | undefined;
1688
+ headers?: Record<string, string> | [string, string][] | Headers | undefined;
1596
1689
  body?: any;
1690
+ authenticationId?: number | undefined;
1597
1691
  callbackUrl?: string | undefined;
1598
1692
  authenticationTemplate?: string | undefined;
1599
- headers?: Record<string, string> | [string, string][] | Headers | undefined;
1600
1693
  relayBaseUrl?: string | undefined;
1601
1694
  }>;
1602
1695
 
@@ -1757,22 +1850,22 @@ declare const RunActionSchema: z.ZodObject<{
1757
1850
  cursor: z.ZodOptional<z.ZodString>;
1758
1851
  }, "strip", z.ZodTypeAny, {
1759
1852
  appKey: string;
1760
- actionType: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
1853
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1761
1854
  actionKey: string;
1855
+ cursor?: string | undefined;
1856
+ maxItems?: number | undefined;
1857
+ pageSize?: number | undefined;
1762
1858
  authenticationId?: number | null | undefined;
1763
1859
  inputs?: Record<string, unknown> | undefined;
1764
- pageSize?: number | undefined;
1765
- maxItems?: number | undefined;
1766
- cursor?: string | undefined;
1767
1860
  }, {
1768
1861
  appKey: string;
1769
- actionType: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
1862
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1770
1863
  actionKey: string;
1864
+ cursor?: string | undefined;
1865
+ maxItems?: number | undefined;
1866
+ pageSize?: number | undefined;
1771
1867
  authenticationId?: number | null | undefined;
1772
1868
  inputs?: Record<string, unknown> | undefined;
1773
- pageSize?: number | undefined;
1774
- maxItems?: number | undefined;
1775
- cursor?: string | undefined;
1776
1869
  }>;
1777
1870
  type RunActionOptions = z.infer<typeof RunActionSchema>;
1778
1871
 
@@ -1784,11 +1877,11 @@ declare const GetActionSchema: z.ZodObject<{
1784
1877
  actionKey: z.ZodString;
1785
1878
  }, "strip", z.ZodTypeAny, {
1786
1879
  appKey: string;
1787
- actionType: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
1880
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1788
1881
  actionKey: string;
1789
1882
  }, {
1790
1883
  appKey: string;
1791
- actionType: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
1884
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
1792
1885
  actionKey: string;
1793
1886
  }>;
1794
1887
  type GetActionOptions = z.infer<typeof GetActionSchema>;
@@ -1803,112 +1896,19 @@ declare const ListActionsSchema: z.ZodObject<{
1803
1896
  cursor: z.ZodOptional<z.ZodString>;
1804
1897
  }, "strip", z.ZodTypeAny, {
1805
1898
  appKey: string;
1806
- actionType?: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write" | undefined;
1807
- pageSize?: number | undefined;
1808
- maxItems?: number | undefined;
1809
1899
  cursor?: string | undefined;
1900
+ maxItems?: number | undefined;
1901
+ pageSize?: number | undefined;
1902
+ actionType?: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write" | undefined;
1810
1903
  }, {
1811
1904
  appKey: string;
1812
- actionType?: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write" | undefined;
1813
- pageSize?: number | undefined;
1814
- maxItems?: number | undefined;
1815
1905
  cursor?: string | undefined;
1906
+ maxItems?: number | undefined;
1907
+ pageSize?: number | undefined;
1908
+ actionType?: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write" | undefined;
1816
1909
  }>;
1817
1910
  type ListActionsOptions = z.infer<typeof ListActionsSchema>;
1818
1911
 
1819
- /**
1820
- * Domain utility functions for working with app identifiers and data normalization
1821
- */
1822
-
1823
- interface AppLocator {
1824
- lookupAppKey: string;
1825
- slug?: string;
1826
- implementationName?: string;
1827
- version?: string;
1828
- }
1829
- interface ResolvedAppLocator extends AppLocator {
1830
- implementationName: string;
1831
- }
1832
-
1833
- declare const DEFAULT_CONFIG_PATH: ".zapierrc";
1834
- type ManifestEntry = {
1835
- implementationName: string;
1836
- version?: string;
1837
- };
1838
- type GetVersionedImplementationId = (appKey: string) => Promise<string | null>;
1839
- type Manifest = {
1840
- apps: Record<string, ManifestEntry>;
1841
- };
1842
- type ResolveAppKeys = ({ appKeys, }: {
1843
- appKeys: string[];
1844
- }) => Promise<ResolvedAppLocator[]>;
1845
- declare const ManifestPluginOptionsSchema: z.ZodObject<{
1846
- manifestPath: z.ZodOptional<z.ZodString>;
1847
- manifest: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1848
- implementationName: z.ZodString;
1849
- version: z.ZodOptional<z.ZodString>;
1850
- }, "strip", z.ZodTypeAny, {
1851
- implementationName: string;
1852
- version?: string | undefined;
1853
- }, {
1854
- implementationName: string;
1855
- version?: string | undefined;
1856
- }>>>;
1857
- }, "strip", z.ZodTypeAny, {
1858
- manifestPath?: string | undefined;
1859
- manifest?: Record<string, {
1860
- implementationName: string;
1861
- version?: string | undefined;
1862
- }> | undefined;
1863
- }, {
1864
- manifestPath?: string | undefined;
1865
- manifest?: Record<string, {
1866
- implementationName: string;
1867
- version?: string | undefined;
1868
- }> | undefined;
1869
- }>;
1870
-
1871
- type ManifestPluginOptions = z.infer<typeof ManifestPluginOptionsSchema>;
1872
- interface UpdateManifestEntryOptions {
1873
- appKey: string;
1874
- entry: ManifestEntry;
1875
- configPath?: string;
1876
- skipWrite?: boolean;
1877
- manifest?: Manifest;
1878
- }
1879
- interface ManifestPluginProvides {
1880
- context: {
1881
- getVersionedImplementationId: GetVersionedImplementationId;
1882
- resolveAppKeys: ResolveAppKeys;
1883
- updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise<[string, ManifestEntry, Manifest]>;
1884
- };
1885
- }
1886
- /**
1887
- * Read manifest from a file path asynchronously
1888
- * Supports local files (Node.js) and browser environments (fallback to global filesystem)
1889
- */
1890
- declare function readManifestFromFile(filePath: string): Promise<Manifest | null>;
1891
- /**
1892
- * Get the preferred key for storing an app in the manifest
1893
- * Extracted from plugin to make it easier to test
1894
- */
1895
- declare function getPreferredManifestEntryKey({ appKey, api, }: {
1896
- appKey: string;
1897
- api: ApiClient;
1898
- }): Promise<string>;
1899
- /**
1900
- * Find a manifest entry by any app key (implementation name, slug, etc.).
1901
- */
1902
- declare function findManifestEntry({ appKey, manifest, }: {
1903
- appKey: string;
1904
- manifest: Manifest;
1905
- }): [string, ManifestEntry] | null;
1906
-
1907
- declare const manifestPlugin: Plugin<{}, // no SDK dependencies
1908
- {
1909
- api: ApiClient;
1910
- }, ManifestPluginProvides>;
1911
-
1912
1912
  interface ListActionsPluginProvides {
1913
1913
  listActions: (options?: ListActionsOptions) => Promise<{
1914
1914
  data: ActionItem$1[];
@@ -1969,16 +1969,16 @@ declare const ListAppsSchema: z.ZodObject<{
1969
1969
  cursor: z.ZodOptional<z.ZodString>;
1970
1970
  }, "strip", z.ZodTypeAny, {
1971
1971
  search?: string | undefined;
1972
- pageSize?: number | undefined;
1973
- maxItems?: number | undefined;
1974
- cursor?: string | undefined;
1975
1972
  appKeys?: string[] | undefined;
1973
+ cursor?: string | undefined;
1974
+ maxItems?: number | undefined;
1975
+ pageSize?: number | undefined;
1976
1976
  }, {
1977
1977
  search?: string | undefined;
1978
- pageSize?: number | undefined;
1979
- maxItems?: number | undefined;
1980
- cursor?: string | undefined;
1981
1978
  appKeys?: string[] | undefined;
1979
+ cursor?: string | undefined;
1980
+ maxItems?: number | undefined;
1981
+ pageSize?: number | undefined;
1982
1982
  }>;
1983
1983
  type ListAppsOptions = z.infer<typeof ListAppsSchema>;
1984
1984
 
@@ -2067,9 +2067,9 @@ declare const ListAuthenticationsSchema: z.ZodObject<{
2067
2067
  search?: string | undefined;
2068
2068
  title?: string | undefined;
2069
2069
  appKey?: string | undefined;
2070
- pageSize?: number | undefined;
2071
- maxItems?: number | undefined;
2072
2070
  cursor?: string | undefined;
2071
+ maxItems?: number | undefined;
2072
+ pageSize?: number | undefined;
2073
2073
  accountId?: string | undefined;
2074
2074
  owner?: string | undefined;
2075
2075
  authenticationIds?: string[] | undefined;
@@ -2077,9 +2077,9 @@ declare const ListAuthenticationsSchema: z.ZodObject<{
2077
2077
  search?: string | undefined;
2078
2078
  title?: string | undefined;
2079
2079
  appKey?: string | undefined;
2080
- pageSize?: number | undefined;
2081
- maxItems?: number | undefined;
2082
2080
  cursor?: string | undefined;
2081
+ maxItems?: number | undefined;
2082
+ pageSize?: number | undefined;
2083
2083
  accountId?: string | undefined;
2084
2084
  owner?: string | undefined;
2085
2085
  authenticationIds?: string[] | undefined;
@@ -2216,26 +2216,26 @@ declare const ListInputFieldChoicesSchema: z.ZodObject<{
2216
2216
  cursor: z.ZodOptional<z.ZodString>;
2217
2217
  }, "strip", z.ZodTypeAny, {
2218
2218
  appKey: string;
2219
- actionType: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
2219
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
2220
2220
  actionKey: string;
2221
2221
  inputFieldKey: string;
2222
2222
  page?: number | undefined;
2223
+ cursor?: string | undefined;
2224
+ maxItems?: number | undefined;
2225
+ pageSize?: number | undefined;
2223
2226
  authenticationId?: number | null | undefined;
2224
2227
  inputs?: Record<string, unknown> | undefined;
2225
- pageSize?: number | undefined;
2226
- maxItems?: number | undefined;
2227
- cursor?: string | undefined;
2228
2228
  }, {
2229
2229
  appKey: string;
2230
- actionType: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
2230
+ actionType: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
2231
2231
  actionKey: string;
2232
2232
  inputFieldKey: string;
2233
2233
  page?: number | undefined;
2234
+ cursor?: string | undefined;
2235
+ maxItems?: number | undefined;
2236
+ pageSize?: number | undefined;
2234
2237
  authenticationId?: number | null | undefined;
2235
2238
  inputs?: Record<string, unknown> | undefined;
2236
- pageSize?: number | undefined;
2237
- maxItems?: number | undefined;
2238
- cursor?: string | undefined;
2239
2239
  }>;
2240
2240
  type ListInputFieldChoicesOptions = z.infer<typeof ListInputFieldChoicesSchema>;
2241
2241
 
@@ -2270,14 +2270,7 @@ interface BaseSdkOptions {
2270
2270
  baseUrl?: string;
2271
2271
  debug?: boolean;
2272
2272
  manifestPath?: string;
2273
- manifest?: {
2274
- apps: {
2275
- [appKey: string]: {
2276
- implementationName: string;
2277
- version?: string;
2278
- };
2279
- };
2280
- };
2273
+ manifest?: Manifest;
2281
2274
  eventEmission?: EventEmissionConfig;
2282
2275
  }
2283
2276
 
@@ -2556,17 +2549,17 @@ declare const AppItemSchema: z.ZodObject<Omit<{
2556
2549
  filter?: number | undefined;
2557
2550
  read?: number | undefined;
2558
2551
  read_bulk?: number | undefined;
2559
- write?: number | undefined;
2560
- search_or_write?: number | undefined;
2561
2552
  search_and_write?: number | undefined;
2553
+ search_or_write?: number | undefined;
2554
+ write?: number | undefined;
2562
2555
  }, {
2563
2556
  search?: number | undefined;
2564
2557
  filter?: number | undefined;
2565
2558
  read?: number | undefined;
2566
2559
  read_bulk?: number | undefined;
2567
- write?: number | undefined;
2568
- search_or_write?: number | undefined;
2569
2560
  search_and_write?: number | undefined;
2561
+ search_or_write?: number | undefined;
2562
+ write?: number | undefined;
2570
2563
  }>>;
2571
2564
  description: z.ZodOptional<z.ZodString>;
2572
2565
  primary_color: z.ZodOptional<z.ZodString>;
@@ -2593,9 +2586,9 @@ declare const AppItemSchema: z.ZodObject<Omit<{
2593
2586
  filter?: number | undefined;
2594
2587
  read?: number | undefined;
2595
2588
  read_bulk?: number | undefined;
2596
- write?: number | undefined;
2597
- search_or_write?: number | undefined;
2598
2589
  search_and_write?: number | undefined;
2590
+ search_or_write?: number | undefined;
2591
+ write?: number | undefined;
2599
2592
  } | undefined;
2600
2593
  description?: string | undefined;
2601
2594
  is_hidden?: boolean | undefined;
@@ -2645,9 +2638,9 @@ declare const AppItemSchema: z.ZodObject<Omit<{
2645
2638
  filter?: number | undefined;
2646
2639
  read?: number | undefined;
2647
2640
  read_bulk?: number | undefined;
2648
- write?: number | undefined;
2649
- search_or_write?: number | undefined;
2650
2641
  search_and_write?: number | undefined;
2642
+ search_or_write?: number | undefined;
2643
+ write?: number | undefined;
2651
2644
  } | undefined;
2652
2645
  description?: string | undefined;
2653
2646
  is_hidden?: boolean | undefined;
@@ -2865,7 +2858,7 @@ declare const ActionItemSchema: z.ZodObject<Omit<{
2865
2858
  description: string;
2866
2859
  title: string;
2867
2860
  app_key: string;
2868
- action_type: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
2861
+ action_type: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
2869
2862
  id?: string | undefined;
2870
2863
  is_important?: boolean | undefined;
2871
2864
  is_hidden?: boolean | undefined;
@@ -2876,7 +2869,7 @@ declare const ActionItemSchema: z.ZodObject<Omit<{
2876
2869
  description: string;
2877
2870
  title: string;
2878
2871
  app_key: string;
2879
- action_type: "search" | "filter" | "read" | "read_bulk" | "write" | "run" | "search_or_write" | "search_and_write";
2872
+ action_type: "search" | "filter" | "read" | "read_bulk" | "run" | "search_and_write" | "search_or_write" | "write";
2880
2873
  id?: string | undefined;
2881
2874
  is_important?: boolean | undefined;
2882
2875
  is_hidden?: boolean | undefined;
package/dist/index.mjs CHANGED
@@ -3978,7 +3978,7 @@ function getCpuTime() {
3978
3978
 
3979
3979
  // package.json
3980
3980
  var package_default = {
3981
- version: "0.13.5"};
3981
+ version: "0.13.7"};
3982
3982
 
3983
3983
  // src/plugins/eventEmission/builders.ts
3984
3984
  function createBaseEvent(context = {}) {