@zapier/zapier-sdk 0.18.3 → 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 (71) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  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 -109
  6. package/dist/api/schemas.d.ts.map +1 -1
  7. package/dist/api/schemas.js +0 -67
  8. package/dist/api/types.d.ts +2 -1
  9. package/dist/api/types.d.ts.map +1 -1
  10. package/dist/index.cjs +337 -673
  11. package/dist/index.d.mts +52 -105
  12. package/dist/index.mjs +337 -673
  13. package/dist/plugins/listApps/index.d.ts +2 -8
  14. package/dist/plugins/listApps/index.d.ts.map +1 -1
  15. package/dist/plugins/listApps/index.js +4 -6
  16. package/dist/plugins/listApps/index.test.js +62 -82
  17. package/dist/plugins/listApps/schemas.d.ts +35 -14
  18. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  19. package/dist/plugins/listApps/schemas.js +44 -14
  20. package/dist/plugins/listAuthentications/index.test.js +16 -0
  21. package/dist/schemas/App.d.ts +28 -28
  22. package/dist/schemas/App.d.ts.map +1 -1
  23. package/dist/schemas/App.js +3 -8
  24. package/dist/sdk.d.ts +1 -1
  25. package/dist/sdk.test.js +12 -9
  26. package/package.json +1 -1
  27. package/dist/api/client.integration.test.d.ts +0 -5
  28. package/dist/api/client.integration.test.d.ts.map +0 -1
  29. package/dist/api/client.integration.test.js +0 -318
  30. package/dist/api/client.methods.test.d.ts +0 -2
  31. package/dist/api/client.methods.test.d.ts.map +0 -1
  32. package/dist/api/client.methods.test.js +0 -158
  33. package/dist/api/router.d.ts +0 -16
  34. package/dist/api/router.d.ts.map +0 -1
  35. package/dist/api/router.js +0 -31
  36. package/dist/api/router.test.d.ts +0 -2
  37. package/dist/api/router.test.d.ts.map +0 -1
  38. package/dist/api/router.test.js +0 -103
  39. package/dist/temporary-internal-core/handlers/listApps.d.ts +0 -67
  40. package/dist/temporary-internal-core/handlers/listApps.d.ts.map +0 -1
  41. package/dist/temporary-internal-core/handlers/listApps.js +0 -134
  42. package/dist/temporary-internal-core/handlers/listApps.test.d.ts +0 -2
  43. package/dist/temporary-internal-core/handlers/listApps.test.d.ts.map +0 -1
  44. package/dist/temporary-internal-core/handlers/listApps.test.js +0 -367
  45. package/dist/temporary-internal-core/index.d.ts +0 -18
  46. package/dist/temporary-internal-core/index.d.ts.map +0 -1
  47. package/dist/temporary-internal-core/index.js +0 -18
  48. package/dist/temporary-internal-core/schemas/apps/index.d.ts +0 -175
  49. package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +0 -1
  50. package/dist/temporary-internal-core/schemas/apps/index.js +0 -97
  51. package/dist/temporary-internal-core/schemas/errors/index.d.ts +0 -139
  52. package/dist/temporary-internal-core/schemas/errors/index.d.ts.map +0 -1
  53. package/dist/temporary-internal-core/schemas/errors/index.js +0 -129
  54. package/dist/temporary-internal-core/schemas/implementations/index.d.ts +0 -127
  55. package/dist/temporary-internal-core/schemas/implementations/index.d.ts.map +0 -1
  56. package/dist/temporary-internal-core/schemas/implementations/index.js +0 -79
  57. package/dist/temporary-internal-core/types/handler.d.ts +0 -51
  58. package/dist/temporary-internal-core/types/handler.d.ts.map +0 -1
  59. package/dist/temporary-internal-core/types/handler.js +0 -8
  60. package/dist/temporary-internal-core/types/index.d.ts +0 -5
  61. package/dist/temporary-internal-core/types/index.d.ts.map +0 -1
  62. package/dist/temporary-internal-core/types/index.js +0 -4
  63. package/dist/temporary-internal-core/utils/app-locators.d.ts +0 -34
  64. package/dist/temporary-internal-core/utils/app-locators.d.ts.map +0 -1
  65. package/dist/temporary-internal-core/utils/app-locators.js +0 -39
  66. package/dist/temporary-internal-core/utils/string-utils.d.ts +0 -28
  67. package/dist/temporary-internal-core/utils/string-utils.d.ts.map +0 -1
  68. package/dist/temporary-internal-core/utils/string-utils.js +0 -52
  69. package/dist/temporary-internal-core/utils/transformations.d.ts +0 -18
  70. package/dist/temporary-internal-core/utils/transformations.d.ts.map +0 -1
  71. package/dist/temporary-internal-core/utils/transformations.js +0 -36
package/dist/index.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var zod = require('zod');
4
+ var apps = require('@zapier/zapier-sdk-core/v0/schemas/apps');
4
5
  var authentications = require('@zapier/zapier-sdk-core/v0/schemas/authentications');
5
6
  var promises = require('timers/promises');
6
7
  var os = require('os');
@@ -817,462 +818,20 @@ function createPaginatedFunction(coreFn, schema, telemetry, explicitFunctionName
817
818
  };
818
819
  return namedFunctions[functionName];
819
820
  }
820
- var ImplementationMetaSchema = zod.z.object({
821
- id: zod.z.string(),
822
- name: zod.z.string(),
823
- slug: zod.z.string(),
824
- age_in_days: zod.z.number().optional(),
825
- auth_type: zod.z.string().optional(),
826
- banner: zod.z.string().optional(),
827
- categories: zod.z.array(
828
- zod.z.object({
829
- id: zod.z.number(),
830
- name: zod.z.string(),
831
- slug: zod.z.string()
832
- })
833
- ).optional(),
834
- images: zod.z.object({
835
- url_16x16: zod.z.string().optional(),
836
- url_32x32: zod.z.string().optional(),
837
- url_64x64: zod.z.string().optional(),
838
- url_128x128: zod.z.string().optional()
839
- }).optional(),
840
- popularity: zod.z.number().optional(),
841
- has_filters: zod.z.boolean().optional(),
842
- has_reads: zod.z.boolean().optional(),
843
- has_searches: zod.z.boolean().optional(),
844
- has_searches_or_writes: zod.z.boolean().optional(),
845
- has_upfront_fields: zod.z.boolean().optional(),
846
- has_writes: zod.z.boolean().optional(),
847
- is_beta: zod.z.boolean().optional(),
848
- is_built_in: zod.z.boolean().optional(),
849
- is_deprecated: zod.z.boolean().optional(),
850
- is_featured: zod.z.boolean().optional(),
851
- is_hidden: zod.z.boolean().optional(),
852
- is_invite: zod.z.boolean().optional(),
853
- is_premium: zod.z.boolean().optional(),
854
- is_public: zod.z.boolean().optional(),
855
- is_upcoming: zod.z.boolean().optional(),
856
- version: zod.z.string().optional(),
857
- visibility: zod.z.string().optional(),
858
- actions: zod.z.object({
859
- read: zod.z.number().optional(),
860
- read_bulk: zod.z.number().optional(),
861
- write: zod.z.number().optional(),
862
- search: zod.z.number().optional(),
863
- search_or_write: zod.z.number().optional(),
864
- search_and_write: zod.z.number().optional(),
865
- filter: zod.z.number().optional()
866
- }).optional(),
867
- description: zod.z.string().optional(),
868
- primary_color: zod.z.string().optional(),
869
- secondary_color: zod.z.string().optional(),
870
- classification: zod.z.string().optional(),
871
- api_docs_url: zod.z.string().optional(),
872
- image: zod.z.string().optional()
873
- });
874
- zod.z.object({
875
- count: zod.z.number(),
876
- next: zod.z.string().nullable().optional(),
877
- previous: zod.z.string().nullable().optional(),
878
- results: zod.z.array(ImplementationMetaSchema)
879
- });
880
-
881
- // src/temporary-internal-core/schemas/apps/index.ts
882
- var ListAppsOptionsSchema = zod.z.object({
821
+ var ListAppsSchema = apps.ListAppsQuerySchema.omit({
822
+ offset: true
823
+ }).extend({
824
+ // Override appKeys to be an array instead of comma-separated string
883
825
  appKeys: zod.z.array(zod.z.string()).optional().describe(
884
826
  "Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"
885
827
  ),
886
- search: zod.z.string().optional().describe("Search for apps by name"),
828
+ // Override pageSize to make optional (base has default value)
887
829
  pageSize: zod.z.number().min(1).optional().describe("Number of apps per page"),
830
+ // SDK specific property for pagination/iterator helpers
888
831
  maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
832
+ // SDK specific property for pagination/iterator helpers
889
833
  cursor: zod.z.string().optional().describe("Cursor to start from")
890
834
  }).merge(TelemetryMarkerSchema).describe("List all available apps with optional filtering");
891
- var AppItemSchema = ImplementationMetaSchema.omit({
892
- name: true,
893
- id: true
894
- }).extend({
895
- title: zod.z.string(),
896
- key: zod.z.string(),
897
- implementation_id: zod.z.string(),
898
- version: zod.z.string().optional()
899
- });
900
- zod.z.object({
901
- data: zod.z.array(AppItemSchema),
902
- nextCursor: zod.z.string().optional()
903
- });
904
- var ListAppsHandlerRequestSchema = zod.z.object({
905
- implementationIds: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]).optional().describe(
906
- "Pre-resolved implementation IDs - array or comma-separated string"
907
- ),
908
- search: zod.z.string().optional().describe("Optional search term to augment results"),
909
- pageSize: zod.z.union([zod.z.string(), zod.z.number()]).optional().describe("Number of apps per page"),
910
- cursor: zod.z.string().optional().describe("Pagination cursor")
911
- }).transform((data) => ({
912
- // Normalize implementationIds to array
913
- implementationIds: typeof data.implementationIds === "string" ? data.implementationIds === "" ? [] : data.implementationIds.split(",") : data.implementationIds ?? [],
914
- search: data.search,
915
- // Normalize pageSize to number
916
- pageSize: typeof data.pageSize === "string" ? parseInt(data.pageSize, 10) : data.pageSize,
917
- cursor: data.cursor
918
- }));
919
- var NeedChoicesSchema = zod.z.object({
920
- key: zod.z.string().optional(),
921
- label: zod.z.string().optional(),
922
- sample: zod.z.string().optional(),
923
- value: zod.z.string().optional()
924
- });
925
- var NeedSchema = zod.z.object({
926
- key: zod.z.string(),
927
- alters_custom_fields: zod.z.boolean().nullable().optional(),
928
- capabilities: zod.z.array(zod.z.string()).optional(),
929
- choices: zod.z.array(NeedChoicesSchema).optional(),
930
- computed: zod.z.boolean().nullable().optional(),
931
- custom_field: zod.z.boolean().optional(),
932
- default: zod.z.string().optional(),
933
- depends_on: zod.z.array(zod.z.string()).optional(),
934
- format: zod.z.literal("SELECT").optional(),
935
- from_search: zod.z.boolean().optional(),
936
- from_write: zod.z.boolean().optional(),
937
- help_text: zod.z.string().optional(),
938
- help_text_html: zod.z.string().optional(),
939
- input_format: zod.z.array(zod.z.string()).optional(),
940
- label: zod.z.string().optional(),
941
- language: zod.z.string().optional(),
942
- parent_key: zod.z.string().optional(),
943
- placeholder: zod.z.string().optional(),
944
- prefill: zod.z.string().optional(),
945
- required: zod.z.boolean().optional(),
946
- searchfill: zod.z.string().optional(),
947
- send_in_json: zod.z.boolean().optional(),
948
- regex: zod.z.string().optional(),
949
- type: zod.z.enum([
950
- "integer",
951
- "string",
952
- "text",
953
- "datetime",
954
- "boolean",
955
- "file",
956
- "decimal",
957
- "copy",
958
- "password",
959
- "dict",
960
- "code",
961
- "filter",
962
- "json"
963
- ]).optional(),
964
- list: zod.z.boolean().optional()
965
- });
966
- zod.z.object({
967
- action_url: zod.z.string().optional()
968
- });
969
- zod.z.object({
970
- can_use: zod.z.boolean().optional()
971
- });
972
- var ActionSchema = zod.z.object({
973
- id: zod.z.string().optional(),
974
- type: zod.z.enum([
975
- "filter",
976
- "read",
977
- "read_bulk",
978
- "run",
979
- "search",
980
- "search_and_write",
981
- "search_or_write",
982
- "write"
983
- ]),
984
- key: zod.z.string(),
985
- name: zod.z.string(),
986
- description: zod.z.string(),
987
- is_important: zod.z.boolean().optional(),
988
- is_hidden: zod.z.boolean().optional(),
989
- selected_api: zod.z.string().optional()
990
- });
991
- var ChoiceSchema = zod.z.object({
992
- value: zod.z.union([zod.z.string(), zod.z.number()]),
993
- label: zod.z.string()
994
- });
995
- zod.z.object({
996
- key: zod.z.string(),
997
- label: zod.z.string(),
998
- type: zod.z.enum([
999
- "string",
1000
- "number",
1001
- "boolean",
1002
- "datetime",
1003
- "file",
1004
- "object",
1005
- "array"
1006
- ]),
1007
- required: zod.z.boolean(),
1008
- description: zod.z.string().optional(),
1009
- choices: zod.z.array(ChoiceSchema).optional()
1010
- });
1011
- zod.z.object({
1012
- data: zod.z.array(zod.z.unknown())
1013
- });
1014
- var ActionFieldChoiceSchema = zod.z.object({
1015
- value: zod.z.union([zod.z.string(), zod.z.number()]),
1016
- label: zod.z.string()
1017
- });
1018
- zod.z.object({
1019
- key: zod.z.string(),
1020
- label: zod.z.string().optional(),
1021
- required: zod.z.boolean(),
1022
- type: zod.z.string().optional(),
1023
- helpText: zod.z.string().optional(),
1024
- helpTextHtml: zod.z.string().optional(),
1025
- choices: zod.z.array(ActionFieldChoiceSchema).optional(),
1026
- default: zod.z.string().optional(),
1027
- placeholder: zod.z.string().optional(),
1028
- computed: zod.z.boolean().optional(),
1029
- customField: zod.z.boolean().optional(),
1030
- dependsOn: zod.z.array(zod.z.string()).optional(),
1031
- format: zod.z.string().optional(),
1032
- inputFormat: zod.z.array(zod.z.string()).optional()
1033
- });
1034
- zod.z.object({
1035
- id: zod.z.number(),
1036
- code: zod.z.string(),
1037
- user_id: zod.z.number(),
1038
- auto_provisioned: zod.z.boolean(),
1039
- first_name: zod.z.string(),
1040
- last_name: zod.z.string(),
1041
- username: zod.z.string(),
1042
- personas: zod.z.string(),
1043
- user_generated_personas: zod.z.string(),
1044
- last_login: zod.z.string(),
1045
- email: zod.z.string(),
1046
- email_hash: zod.z.string(),
1047
- email_confirmed: zod.z.boolean(),
1048
- timezone: zod.z.string(),
1049
- photo_url: zod.z.string(),
1050
- has_seen_notifications: zod.z.record(zod.z.string(), zod.z.boolean().nullable()),
1051
- signup: zod.z.string(),
1052
- since_signup: zod.z.string(),
1053
- has_activated: zod.z.boolean(),
1054
- enable_gz_creator: zod.z.boolean(),
1055
- should_see_nps_survey: zod.z.boolean(),
1056
- is_developer: zod.z.boolean(),
1057
- is_expert: zod.z.boolean(),
1058
- tos_agreement: zod.z.boolean(),
1059
- should_renew_tos: zod.z.boolean(),
1060
- is_gdpr_consented: zod.z.boolean(),
1061
- disable_ssl_check: zod.z.boolean(),
1062
- identity: zod.z.number(),
1063
- summary_schedule: zod.z.string(),
1064
- alert_triggers: zod.z.string(),
1065
- alert_actions: zod.z.string(),
1066
- is_staff: zod.z.boolean(),
1067
- is_zt_reviewer: zod.z.boolean(),
1068
- is_high_value: zod.z.boolean(),
1069
- is_temporary: zod.z.boolean(),
1070
- banner_message: zod.z.string(),
1071
- enable_totp_2fa: zod.z.boolean(),
1072
- viewed_help: zod.z.record(zod.z.string(), zod.z.boolean()),
1073
- show_editor_migration_mesaging: zod.z.boolean(),
1074
- switches: zod.z.record(zod.z.string(), zod.z.unknown()),
1075
- organizations: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
1076
- primary_organization: zod.z.record(zod.z.string(), zod.z.unknown()).nullable(),
1077
- has_active_zaps: zod.z.boolean(),
1078
- has_google_sso: zod.z.boolean(),
1079
- auth_realm: zod.z.string(),
1080
- roles: zod.z.array(
1081
- zod.z.object({
1082
- account_id: zod.z.number(),
1083
- role: zod.z.string()
1084
- })
1085
- )
1086
- });
1087
- zod.z.object({
1088
- age_in_days: zod.z.string().optional(),
1089
- api_docs_url: zod.z.string().nullable().optional(),
1090
- app_profile_url: zod.z.string(),
1091
- banner: zod.z.string().optional(),
1092
- categories: zod.z.array(zod.z.string()).optional(),
1093
- // Service category names
1094
- canonical_id: zod.z.string().optional(),
1095
- current_implementation_id: zod.z.string(),
1096
- days_since_last_update: zod.z.string().optional(),
1097
- description: zod.z.string(),
1098
- external_url: zod.z.string(),
1099
- hashtag: zod.z.string().optional(),
1100
- id: zod.z.number().optional(),
1101
- image: zod.z.string().optional(),
1102
- images: zod.z.string().optional(),
1103
- integration_overview_html: zod.z.string().nullable().optional(),
1104
- internal_id: zod.z.string(),
1105
- invite_url: zod.z.string().nullable().optional(),
1106
- is_beta: zod.z.string().optional(),
1107
- is_built_in: zod.z.string().optional(),
1108
- is_featured: zod.z.string().optional(),
1109
- is_premium: zod.z.boolean().optional(),
1110
- is_public: zod.z.string().optional(),
1111
- is_upcoming: zod.z.string().optional(),
1112
- learn_more_url: zod.z.string(),
1113
- name: zod.z.string(),
1114
- popularity: zod.z.number(),
1115
- primary_color: zod.z.string(),
1116
- request_count: zod.z.string().optional(),
1117
- slug: zod.z.string(),
1118
- zap_usage_count: zod.z.number().nullable().optional()
1119
- });
1120
- var ServiceSchema = zod.z.object({
1121
- id: zod.z.number().optional(),
1122
- canonical_id: zod.z.string().optional(),
1123
- current_implementation_id: zod.z.string(),
1124
- name: zod.z.string(),
1125
- slug: zod.z.string(),
1126
- app_url: zod.z.string().optional(),
1127
- learn_more_url: zod.z.string().optional(),
1128
- description: zod.z.string(),
1129
- primary_color: zod.z.string(),
1130
- popularity: zod.z.number(),
1131
- image: zod.z.string().optional(),
1132
- images: zod.z.string().optional()
1133
- });
1134
- zod.z.object({
1135
- results: zod.z.array(ServiceSchema),
1136
- next: zod.z.string().nullable().optional(),
1137
- previous: zod.z.string().nullable().optional()
1138
- });
1139
- zod.z.object({
1140
- selected_api: zod.z.string(),
1141
- action: zod.z.string(),
1142
- type_of: zod.z.string(),
1143
- authentication_id: zod.z.number().optional(),
1144
- params: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1145
- });
1146
- zod.z.object({
1147
- success: zod.z.boolean(),
1148
- needs: zod.z.array(NeedSchema).optional(),
1149
- errors: zod.z.array(zod.z.string()).optional(),
1150
- last_fetched_at: zod.z.string().optional(),
1151
- schema: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1152
- });
1153
- var ImplementationSchema = zod.z.object({
1154
- selected_api: zod.z.string(),
1155
- app_id: zod.z.number().optional(),
1156
- auth_type: zod.z.string().optional(),
1157
- auth_fields: zod.z.string().optional(),
1158
- actions: zod.z.array(ActionSchema).optional(),
1159
- is_deprecated: zod.z.boolean().optional(),
1160
- is_private_only: zod.z.boolean().optional(),
1161
- is_invite_only: zod.z.boolean().optional(),
1162
- is_beta: zod.z.boolean().optional().default(false),
1163
- is_premium: zod.z.boolean().optional().default(false),
1164
- is_hidden: zod.z.string().optional(),
1165
- name: zod.z.string().optional(),
1166
- slug: zod.z.string().optional(),
1167
- images: zod.z.record(zod.z.string(), zod.z.string().nullable()).optional(),
1168
- primary_color: zod.z.string().optional(),
1169
- secondary_color: zod.z.string().optional(),
1170
- current_implementation: zod.z.string().optional(),
1171
- other_implementations: zod.z.string().optional()
1172
- });
1173
- zod.z.object({
1174
- count: zod.z.number(),
1175
- next: zod.z.string().nullable().optional(),
1176
- previous: zod.z.string().nullable().optional(),
1177
- results: zod.z.array(ImplementationSchema)
1178
- });
1179
- var ImplementationMetaSchema2 = zod.z.object({
1180
- id: zod.z.string(),
1181
- // e.g. "100HiresCLIAPI@1.2.1"
1182
- name: zod.z.string(),
1183
- slug: zod.z.string(),
1184
- age_in_days: zod.z.number().optional(),
1185
- auth_type: zod.z.string().optional(),
1186
- banner: zod.z.string().optional(),
1187
- categories: zod.z.array(
1188
- zod.z.object({
1189
- id: zod.z.number(),
1190
- name: zod.z.string(),
1191
- slug: zod.z.string()
1192
- })
1193
- ).optional(),
1194
- images: zod.z.object({
1195
- url_16x16: zod.z.string().optional(),
1196
- url_32x32: zod.z.string().optional(),
1197
- url_64x64: zod.z.string().optional(),
1198
- url_128x128: zod.z.string().optional()
1199
- }).optional(),
1200
- popularity: zod.z.number().optional(),
1201
- has_filters: zod.z.boolean().optional(),
1202
- has_reads: zod.z.boolean().optional(),
1203
- has_searches: zod.z.boolean().optional(),
1204
- has_searches_or_writes: zod.z.boolean().optional(),
1205
- has_upfront_fields: zod.z.boolean().optional(),
1206
- has_writes: zod.z.boolean().optional(),
1207
- is_beta: zod.z.boolean().optional(),
1208
- is_built_in: zod.z.boolean().optional(),
1209
- is_deprecated: zod.z.boolean().optional(),
1210
- is_featured: zod.z.boolean().optional(),
1211
- is_hidden: zod.z.boolean().optional(),
1212
- is_invite: zod.z.boolean().optional(),
1213
- is_premium: zod.z.boolean().optional(),
1214
- is_public: zod.z.boolean().optional(),
1215
- is_upcoming: zod.z.boolean().optional(),
1216
- version: zod.z.string().optional(),
1217
- visibility: zod.z.string().optional(),
1218
- actions: zod.z.object({
1219
- read: zod.z.number().optional(),
1220
- read_bulk: zod.z.number().optional(),
1221
- write: zod.z.number().optional(),
1222
- search: zod.z.number().optional(),
1223
- search_or_write: zod.z.number().optional(),
1224
- search_and_write: zod.z.number().optional(),
1225
- filter: zod.z.number().optional()
1226
- }).optional(),
1227
- description: zod.z.string().optional(),
1228
- primary_color: zod.z.string().optional(),
1229
- secondary_color: zod.z.string().optional(),
1230
- classification: zod.z.string().optional(),
1231
- api_docs_url: zod.z.string().optional(),
1232
- image: zod.z.string().optional()
1233
- });
1234
- zod.z.object({
1235
- count: zod.z.number(),
1236
- next: zod.z.string().nullable().optional(),
1237
- previous: zod.z.string().nullable().optional(),
1238
- results: zod.z.array(ImplementationMetaSchema2)
1239
- });
1240
- var NeedChoicesResponseMetaSchema = zod.z.object({
1241
- page: zod.z.string().nullable().optional()
1242
- });
1243
- var NeedChoicesResponseLinksSchema = zod.z.object({
1244
- next: zod.z.string().nullable().optional(),
1245
- prev: zod.z.string().nullable().optional()
1246
- });
1247
- zod.z.object({
1248
- selected_api: zod.z.string().optional().describe(
1249
- "Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."
1250
- ),
1251
- authentication_id: zod.z.coerce.number().optional().describe(
1252
- "If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."
1253
- ),
1254
- params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe(
1255
- "Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
1256
- ),
1257
- page: zod.z.number().optional().default(0),
1258
- prefill: zod.z.string().optional().describe(
1259
- "The prefill string to indicate what we're fetching choices for. Likely something like `spreadsheet.id.title`. Must be provided alongside `selected_api` if both `action_id` and `input_field_id` are not."
1260
- ),
1261
- action_id: zod.z.string().optional().describe(
1262
- "The id that will be used to lookup the Action for prefill lookup. If provided, `input_field_id` is required, else `prefill` must be provided."
1263
- ),
1264
- input_field_id: zod.z.string().optional().describe(
1265
- "The id (key) of the input field (Need) that dynamic choices are being retrieved for. If provided, `action_id` is required, else `prefill` must be provided."
1266
- )
1267
- });
1268
- zod.z.object({
1269
- success: zod.z.boolean(),
1270
- choices: zod.z.array(NeedChoicesSchema).optional(),
1271
- next_page: zod.z.number().optional(),
1272
- errors: zod.z.array(zod.z.string()).optional(),
1273
- meta: NeedChoicesResponseMetaSchema.optional(),
1274
- links: NeedChoicesResponseLinksSchema.optional()
1275
- });
1276
835
 
1277
836
  // src/utils/string-utils.ts
1278
837
  function toTitleCase(input) {
@@ -1290,35 +849,25 @@ function stripPageSuffix(functionName) {
1290
849
  }
1291
850
 
1292
851
  // src/schemas/App.ts
1293
- var AppItemSchema2 = withFormatter(
1294
- ImplementationMetaSchema2.omit({ name: true, id: true }).extend({
1295
- title: zod.z.string(),
1296
- // Mapped from name
1297
- key: zod.z.string(),
1298
- // Extracted from id (base part without version)
1299
- implementation_id: zod.z.string()
1300
- // Mapped from id (full versioned ID)
1301
- }),
1302
- {
1303
- format: (item) => {
1304
- const additionalKeys = [];
1305
- if (item.slug && item.slug !== item.key) {
1306
- additionalKeys.push(item.slug);
1307
- const snakeCaseSlug = toSnakeCase(item.slug);
1308
- if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
1309
- additionalKeys.push(snakeCaseSlug);
1310
- }
852
+ var AppItemSchema = withFormatter(apps.AppItemSchema, {
853
+ format: (item) => {
854
+ const additionalKeys = [];
855
+ if (item.slug && item.slug !== item.key) {
856
+ additionalKeys.push(item.slug);
857
+ const snakeCaseSlug = toSnakeCase(item.slug);
858
+ if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
859
+ additionalKeys.push(snakeCaseSlug);
1311
860
  }
1312
- return {
1313
- title: item.title,
1314
- key: item.key,
1315
- keys: [item.key, ...additionalKeys],
1316
- description: item.description,
1317
- details: []
1318
- };
1319
861
  }
862
+ return {
863
+ title: item.title,
864
+ key: item.key,
865
+ keys: [item.key, ...additionalKeys],
866
+ description: item.description,
867
+ details: []
868
+ };
1320
869
  }
1321
- );
870
+ });
1322
871
 
1323
872
  // src/utils/telemetry-utils.ts
1324
873
  function createTelemetryCallback(emitMethodCalled, methodName) {
@@ -1361,7 +910,8 @@ var listAppsPlugin = ({ context }) => {
1361
910
  if (appKeys.length > 0 && appLocators.length === 0 && !options.search) {
1362
911
  return {
1363
912
  data: [],
1364
- nextCursor: void 0
913
+ links: { next: null },
914
+ meta: { count: 0, limit: 0, offset: 0 }
1365
915
  };
1366
916
  }
1367
917
  const implementationIds = appLocators.map((locator) => {
@@ -1370,17 +920,17 @@ var listAppsPlugin = ({ context }) => {
1370
920
  });
1371
921
  return await api.get("/api/v0/apps", {
1372
922
  searchParams: {
1373
- implementationIds: implementationIds.join(","),
923
+ appKeys: implementationIds.join(","),
1374
924
  ...options.search && { search: options.search },
1375
925
  pageSize: options.pageSize.toString(),
1376
- ...options.cursor && { cursor: options.cursor }
926
+ ...options.cursor && { offset: options.cursor }
1377
927
  }
1378
928
  });
1379
929
  }
1380
930
  const methodName = stripPageSuffix(listAppsPage.name);
1381
931
  const listAppsDefinition = createPaginatedFunction(
1382
932
  listAppsPage,
1383
- ListAppsOptionsSchema,
933
+ ListAppsSchema,
1384
934
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
1385
935
  methodName
1386
936
  );
@@ -1392,8 +942,8 @@ var listAppsPlugin = ({ context }) => {
1392
942
  categories: ["app"],
1393
943
  type: "list",
1394
944
  itemType: "App",
1395
- inputSchema: ListAppsOptionsSchema,
1396
- outputSchema: AppItemSchema2
945
+ inputSchema: ListAppsSchema,
946
+ outputSchema: AppItemSchema
1397
947
  }
1398
948
  }
1399
949
  }
@@ -1485,13 +1035,311 @@ var ListActionsSchema = zod.z.object({
1485
1035
  appKey: AppKeyPropertySchema.describe(
1486
1036
  "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1487
1037
  ),
1488
- actionType: ActionTypePropertySchema.optional().describe(
1489
- "Filter actions by type"
1038
+ actionType: ActionTypePropertySchema.optional().describe(
1039
+ "Filter actions by type"
1040
+ ),
1041
+ pageSize: zod.z.number().min(1).optional().describe("Number of actions per page"),
1042
+ maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1043
+ cursor: zod.z.string().optional().describe("Cursor to start from")
1044
+ }).merge(TelemetryMarkerSchema).describe("List all actions for a specific app");
1045
+ var NeedChoicesSchema = zod.z.object({
1046
+ key: zod.z.string().optional(),
1047
+ label: zod.z.string().optional(),
1048
+ sample: zod.z.string().optional(),
1049
+ value: zod.z.string().optional()
1050
+ });
1051
+ var NeedSchema = zod.z.object({
1052
+ key: zod.z.string(),
1053
+ alters_custom_fields: zod.z.boolean().nullable().optional(),
1054
+ capabilities: zod.z.array(zod.z.string()).optional(),
1055
+ choices: zod.z.array(NeedChoicesSchema).optional(),
1056
+ computed: zod.z.boolean().nullable().optional(),
1057
+ custom_field: zod.z.boolean().optional(),
1058
+ default: zod.z.string().optional(),
1059
+ depends_on: zod.z.array(zod.z.string()).optional(),
1060
+ format: zod.z.literal("SELECT").optional(),
1061
+ from_search: zod.z.boolean().optional(),
1062
+ from_write: zod.z.boolean().optional(),
1063
+ help_text: zod.z.string().optional(),
1064
+ help_text_html: zod.z.string().optional(),
1065
+ input_format: zod.z.array(zod.z.string()).optional(),
1066
+ label: zod.z.string().optional(),
1067
+ language: zod.z.string().optional(),
1068
+ parent_key: zod.z.string().optional(),
1069
+ placeholder: zod.z.string().optional(),
1070
+ prefill: zod.z.string().optional(),
1071
+ required: zod.z.boolean().optional(),
1072
+ searchfill: zod.z.string().optional(),
1073
+ send_in_json: zod.z.boolean().optional(),
1074
+ regex: zod.z.string().optional(),
1075
+ type: zod.z.enum([
1076
+ "integer",
1077
+ "string",
1078
+ "text",
1079
+ "datetime",
1080
+ "boolean",
1081
+ "file",
1082
+ "decimal",
1083
+ "copy",
1084
+ "password",
1085
+ "dict",
1086
+ "code",
1087
+ "filter",
1088
+ "json"
1089
+ ]).optional(),
1090
+ list: zod.z.boolean().optional()
1091
+ });
1092
+ zod.z.object({
1093
+ action_url: zod.z.string().optional()
1094
+ });
1095
+ zod.z.object({
1096
+ can_use: zod.z.boolean().optional()
1097
+ });
1098
+ var ActionSchema = zod.z.object({
1099
+ id: zod.z.string().optional(),
1100
+ type: zod.z.enum([
1101
+ "filter",
1102
+ "read",
1103
+ "read_bulk",
1104
+ "run",
1105
+ "search",
1106
+ "search_and_write",
1107
+ "search_or_write",
1108
+ "write"
1109
+ ]),
1110
+ key: zod.z.string(),
1111
+ name: zod.z.string(),
1112
+ description: zod.z.string(),
1113
+ is_important: zod.z.boolean().optional(),
1114
+ is_hidden: zod.z.boolean().optional(),
1115
+ selected_api: zod.z.string().optional()
1116
+ });
1117
+ var ChoiceSchema = zod.z.object({
1118
+ value: zod.z.union([zod.z.string(), zod.z.number()]),
1119
+ label: zod.z.string()
1120
+ });
1121
+ zod.z.object({
1122
+ key: zod.z.string(),
1123
+ label: zod.z.string(),
1124
+ type: zod.z.enum([
1125
+ "string",
1126
+ "number",
1127
+ "boolean",
1128
+ "datetime",
1129
+ "file",
1130
+ "object",
1131
+ "array"
1132
+ ]),
1133
+ required: zod.z.boolean(),
1134
+ description: zod.z.string().optional(),
1135
+ choices: zod.z.array(ChoiceSchema).optional()
1136
+ });
1137
+ zod.z.object({
1138
+ data: zod.z.array(zod.z.unknown())
1139
+ });
1140
+ var ActionFieldChoiceSchema = zod.z.object({
1141
+ value: zod.z.union([zod.z.string(), zod.z.number()]),
1142
+ label: zod.z.string()
1143
+ });
1144
+ zod.z.object({
1145
+ key: zod.z.string(),
1146
+ label: zod.z.string().optional(),
1147
+ required: zod.z.boolean(),
1148
+ type: zod.z.string().optional(),
1149
+ helpText: zod.z.string().optional(),
1150
+ helpTextHtml: zod.z.string().optional(),
1151
+ choices: zod.z.array(ActionFieldChoiceSchema).optional(),
1152
+ default: zod.z.string().optional(),
1153
+ placeholder: zod.z.string().optional(),
1154
+ computed: zod.z.boolean().optional(),
1155
+ customField: zod.z.boolean().optional(),
1156
+ dependsOn: zod.z.array(zod.z.string()).optional(),
1157
+ format: zod.z.string().optional(),
1158
+ inputFormat: zod.z.array(zod.z.string()).optional()
1159
+ });
1160
+ zod.z.object({
1161
+ id: zod.z.number(),
1162
+ code: zod.z.string(),
1163
+ user_id: zod.z.number(),
1164
+ auto_provisioned: zod.z.boolean(),
1165
+ first_name: zod.z.string(),
1166
+ last_name: zod.z.string(),
1167
+ username: zod.z.string(),
1168
+ personas: zod.z.string(),
1169
+ user_generated_personas: zod.z.string(),
1170
+ last_login: zod.z.string(),
1171
+ email: zod.z.string(),
1172
+ email_hash: zod.z.string(),
1173
+ email_confirmed: zod.z.boolean(),
1174
+ timezone: zod.z.string(),
1175
+ photo_url: zod.z.string(),
1176
+ has_seen_notifications: zod.z.record(zod.z.string(), zod.z.boolean().nullable()),
1177
+ signup: zod.z.string(),
1178
+ since_signup: zod.z.string(),
1179
+ has_activated: zod.z.boolean(),
1180
+ enable_gz_creator: zod.z.boolean(),
1181
+ should_see_nps_survey: zod.z.boolean(),
1182
+ is_developer: zod.z.boolean(),
1183
+ is_expert: zod.z.boolean(),
1184
+ tos_agreement: zod.z.boolean(),
1185
+ should_renew_tos: zod.z.boolean(),
1186
+ is_gdpr_consented: zod.z.boolean(),
1187
+ disable_ssl_check: zod.z.boolean(),
1188
+ identity: zod.z.number(),
1189
+ summary_schedule: zod.z.string(),
1190
+ alert_triggers: zod.z.string(),
1191
+ alert_actions: zod.z.string(),
1192
+ is_staff: zod.z.boolean(),
1193
+ is_zt_reviewer: zod.z.boolean(),
1194
+ is_high_value: zod.z.boolean(),
1195
+ is_temporary: zod.z.boolean(),
1196
+ banner_message: zod.z.string(),
1197
+ enable_totp_2fa: zod.z.boolean(),
1198
+ viewed_help: zod.z.record(zod.z.string(), zod.z.boolean()),
1199
+ show_editor_migration_mesaging: zod.z.boolean(),
1200
+ switches: zod.z.record(zod.z.string(), zod.z.unknown()),
1201
+ organizations: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
1202
+ primary_organization: zod.z.record(zod.z.string(), zod.z.unknown()).nullable(),
1203
+ has_active_zaps: zod.z.boolean(),
1204
+ has_google_sso: zod.z.boolean(),
1205
+ auth_realm: zod.z.string(),
1206
+ roles: zod.z.array(
1207
+ zod.z.object({
1208
+ account_id: zod.z.number(),
1209
+ role: zod.z.string()
1210
+ })
1211
+ )
1212
+ });
1213
+ zod.z.object({
1214
+ age_in_days: zod.z.string().optional(),
1215
+ api_docs_url: zod.z.string().nullable().optional(),
1216
+ app_profile_url: zod.z.string(),
1217
+ banner: zod.z.string().optional(),
1218
+ categories: zod.z.array(zod.z.string()).optional(),
1219
+ // Service category names
1220
+ canonical_id: zod.z.string().optional(),
1221
+ current_implementation_id: zod.z.string(),
1222
+ days_since_last_update: zod.z.string().optional(),
1223
+ description: zod.z.string(),
1224
+ external_url: zod.z.string(),
1225
+ hashtag: zod.z.string().optional(),
1226
+ id: zod.z.number().optional(),
1227
+ image: zod.z.string().optional(),
1228
+ images: zod.z.string().optional(),
1229
+ integration_overview_html: zod.z.string().nullable().optional(),
1230
+ internal_id: zod.z.string(),
1231
+ invite_url: zod.z.string().nullable().optional(),
1232
+ is_beta: zod.z.string().optional(),
1233
+ is_built_in: zod.z.string().optional(),
1234
+ is_featured: zod.z.string().optional(),
1235
+ is_premium: zod.z.boolean().optional(),
1236
+ is_public: zod.z.string().optional(),
1237
+ is_upcoming: zod.z.string().optional(),
1238
+ learn_more_url: zod.z.string(),
1239
+ name: zod.z.string(),
1240
+ popularity: zod.z.number(),
1241
+ primary_color: zod.z.string(),
1242
+ request_count: zod.z.string().optional(),
1243
+ slug: zod.z.string(),
1244
+ zap_usage_count: zod.z.number().nullable().optional()
1245
+ });
1246
+ var ServiceSchema = zod.z.object({
1247
+ id: zod.z.number().optional(),
1248
+ canonical_id: zod.z.string().optional(),
1249
+ current_implementation_id: zod.z.string(),
1250
+ name: zod.z.string(),
1251
+ slug: zod.z.string(),
1252
+ app_url: zod.z.string().optional(),
1253
+ learn_more_url: zod.z.string().optional(),
1254
+ description: zod.z.string(),
1255
+ primary_color: zod.z.string(),
1256
+ popularity: zod.z.number(),
1257
+ image: zod.z.string().optional(),
1258
+ images: zod.z.string().optional()
1259
+ });
1260
+ zod.z.object({
1261
+ results: zod.z.array(ServiceSchema),
1262
+ next: zod.z.string().nullable().optional(),
1263
+ previous: zod.z.string().nullable().optional()
1264
+ });
1265
+ zod.z.object({
1266
+ selected_api: zod.z.string(),
1267
+ action: zod.z.string(),
1268
+ type_of: zod.z.string(),
1269
+ authentication_id: zod.z.number().optional(),
1270
+ params: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1271
+ });
1272
+ zod.z.object({
1273
+ success: zod.z.boolean(),
1274
+ needs: zod.z.array(NeedSchema).optional(),
1275
+ errors: zod.z.array(zod.z.string()).optional(),
1276
+ last_fetched_at: zod.z.string().optional(),
1277
+ schema: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1278
+ });
1279
+ var ImplementationSchema = zod.z.object({
1280
+ selected_api: zod.z.string(),
1281
+ app_id: zod.z.number().optional(),
1282
+ auth_type: zod.z.string().optional(),
1283
+ auth_fields: zod.z.string().optional(),
1284
+ actions: zod.z.array(ActionSchema).optional(),
1285
+ is_deprecated: zod.z.boolean().optional(),
1286
+ is_private_only: zod.z.boolean().optional(),
1287
+ is_invite_only: zod.z.boolean().optional(),
1288
+ is_beta: zod.z.boolean().optional().default(false),
1289
+ is_premium: zod.z.boolean().optional().default(false),
1290
+ is_hidden: zod.z.string().optional(),
1291
+ name: zod.z.string().optional(),
1292
+ slug: zod.z.string().optional(),
1293
+ images: zod.z.record(zod.z.string(), zod.z.string().nullable()).optional(),
1294
+ primary_color: zod.z.string().optional(),
1295
+ secondary_color: zod.z.string().optional(),
1296
+ current_implementation: zod.z.string().optional(),
1297
+ other_implementations: zod.z.string().optional()
1298
+ });
1299
+ zod.z.object({
1300
+ count: zod.z.number(),
1301
+ next: zod.z.string().nullable().optional(),
1302
+ previous: zod.z.string().nullable().optional(),
1303
+ results: zod.z.array(ImplementationSchema)
1304
+ });
1305
+ var NeedChoicesResponseMetaSchema = zod.z.object({
1306
+ page: zod.z.string().nullable().optional()
1307
+ });
1308
+ var NeedChoicesResponseLinksSchema = zod.z.object({
1309
+ next: zod.z.string().nullable().optional(),
1310
+ prev: zod.z.string().nullable().optional()
1311
+ });
1312
+ zod.z.object({
1313
+ selected_api: zod.z.string().optional().describe(
1314
+ "Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."
1315
+ ),
1316
+ authentication_id: zod.z.coerce.number().optional().describe(
1317
+ "If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."
1490
1318
  ),
1491
- pageSize: zod.z.number().min(1).optional().describe("Number of actions per page"),
1492
- maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1493
- cursor: zod.z.string().optional().describe("Cursor to start from")
1494
- }).merge(TelemetryMarkerSchema).describe("List all actions for a specific app");
1319
+ params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe(
1320
+ "Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
1321
+ ),
1322
+ page: zod.z.number().optional().default(0),
1323
+ prefill: zod.z.string().optional().describe(
1324
+ "The prefill string to indicate what we're fetching choices for. Likely something like `spreadsheet.id.title`. Must be provided alongside `selected_api` if both `action_id` and `input_field_id` are not."
1325
+ ),
1326
+ action_id: zod.z.string().optional().describe(
1327
+ "The id that will be used to lookup the Action for prefill lookup. If provided, `input_field_id` is required, else `prefill` must be provided."
1328
+ ),
1329
+ input_field_id: zod.z.string().optional().describe(
1330
+ "The id (key) of the input field (Need) that dynamic choices are being retrieved for. If provided, `action_id` is required, else `prefill` must be provided."
1331
+ )
1332
+ });
1333
+ zod.z.object({
1334
+ success: zod.z.boolean(),
1335
+ choices: zod.z.array(NeedChoicesSchema).optional(),
1336
+ next_page: zod.z.number().optional(),
1337
+ errors: zod.z.array(zod.z.string()).optional(),
1338
+ meta: NeedChoicesResponseMetaSchema.optional(),
1339
+ links: NeedChoicesResponseLinksSchema.optional()
1340
+ });
1341
+
1342
+ // src/schemas/Action.ts
1495
1343
  var ActionItemSchema = withFormatter(
1496
1344
  ActionSchema.omit({ type: true, name: true, selected_api: true }).extend({
1497
1345
  app_key: zod.z.string(),
@@ -2352,7 +2200,7 @@ var getAppPlugin = ({ sdk, context }) => {
2352
2200
  type: "item",
2353
2201
  itemType: "App",
2354
2202
  inputSchema: GetAppSchema,
2355
- outputSchema: AppItemSchema2,
2203
+ outputSchema: AppItemSchema,
2356
2204
  resolvers: {
2357
2205
  appKey: appKeyResolver
2358
2206
  }
@@ -3695,176 +3543,6 @@ function getTrackingBaseUrl({
3695
3543
  return ZAPIER_BASE_URL;
3696
3544
  }
3697
3545
 
3698
- // src/temporary-internal-core/utils/string-utils.ts
3699
- function splitVersionedKey2(versionedKey) {
3700
- const parts = versionedKey.split("@");
3701
- if (parts.length >= 2) {
3702
- const baseKey = parts[0];
3703
- const version = parts.slice(1).join("@");
3704
- return [baseKey, version];
3705
- }
3706
- return [versionedKey, void 0];
3707
- }
3708
-
3709
- // src/temporary-internal-core/utils/transformations.ts
3710
- function transformImplementationMetaToAppItem(implementationMeta) {
3711
- const [selectedApi, appVersion] = splitVersionedKey2(implementationMeta.id);
3712
- const { id, name, ...restOfImplementationMeta } = implementationMeta;
3713
- return {
3714
- ...restOfImplementationMeta,
3715
- title: name,
3716
- key: selectedApi,
3717
- implementation_id: id,
3718
- version: appVersion
3719
- };
3720
- }
3721
- function extractPaginationCursor(response) {
3722
- if (!response.next) {
3723
- return void 0;
3724
- }
3725
- try {
3726
- const url = new URL(response.next);
3727
- const offset = url.searchParams.get("offset");
3728
- return offset || void 0;
3729
- } catch {
3730
- return void 0;
3731
- }
3732
- }
3733
-
3734
- // src/temporary-internal-core/handlers/listApps.ts
3735
- var DEFAULT_PAGE_SIZE = 20;
3736
- async function augmentWithSearchResults({
3737
- searchTerm,
3738
- implementationIds,
3739
- httpClient
3740
- }) {
3741
- const searchResponse = await httpClient.get(
3742
- "/zapier/api/v4/implementations-meta/search/",
3743
- {
3744
- searchParams: { term: searchTerm }
3745
- }
3746
- );
3747
- const byImplementationName = /* @__PURE__ */ new Map();
3748
- for (const result of searchResponse.results) {
3749
- const [implementationName] = splitVersionedKey2(result.id);
3750
- const isPublic = result.visibility === "public";
3751
- const existing = byImplementationName.get(implementationName);
3752
- if (!existing || isPublic && !existing.isPublic) {
3753
- byImplementationName.set(implementationName, { result, isPublic });
3754
- }
3755
- }
3756
- const searchResults = Array.from(byImplementationName.values()).map(
3757
- (entry) => transformImplementationMetaToAppItem(entry.result)
3758
- );
3759
- const implementationNameSet = new Set(
3760
- implementationIds.map((id) => {
3761
- const [name] = splitVersionedKey2(id);
3762
- return name;
3763
- })
3764
- );
3765
- const additionalIds = [];
3766
- for (const result of searchResults) {
3767
- const [implementationName] = splitVersionedKey2(result.key);
3768
- if (!implementationNameSet.has(implementationName)) {
3769
- implementationNameSet.add(implementationName);
3770
- additionalIds.push(result.implementation_id);
3771
- }
3772
- }
3773
- return [...implementationIds, ...additionalIds];
3774
- }
3775
- var handleListApps = async ({ request, deps }) => {
3776
- const validatedRequest = ListAppsHandlerRequestSchema.parse(request);
3777
- const { httpClient } = deps;
3778
- let { implementationIds } = validatedRequest;
3779
- const pageSize = validatedRequest.pageSize ?? DEFAULT_PAGE_SIZE;
3780
- if (validatedRequest.search) {
3781
- implementationIds = await augmentWithSearchResults({
3782
- searchTerm: validatedRequest.search,
3783
- implementationIds,
3784
- httpClient
3785
- });
3786
- }
3787
- if (implementationIds.length === 0) {
3788
- if (validatedRequest.search) {
3789
- return {
3790
- data: [],
3791
- nextCursor: void 0
3792
- };
3793
- }
3794
- const searchParams2 = {
3795
- latest_only: "true",
3796
- selected_apis: "",
3797
- limit: pageSize.toString()
3798
- };
3799
- if (validatedRequest.cursor) {
3800
- searchParams2.offset = validatedRequest.cursor;
3801
- }
3802
- const implementationsResponse2 = await httpClient.get(
3803
- "/zapier/api/v4/implementations-meta/lookup/",
3804
- {
3805
- searchParams: searchParams2
3806
- }
3807
- );
3808
- return {
3809
- data: implementationsResponse2.results.map(
3810
- transformImplementationMetaToAppItem
3811
- ),
3812
- nextCursor: extractPaginationCursor(implementationsResponse2)
3813
- };
3814
- }
3815
- const searchParams = {
3816
- selected_apis: implementationIds.join(","),
3817
- limit: pageSize.toString()
3818
- };
3819
- if (validatedRequest.cursor) {
3820
- searchParams.offset = validatedRequest.cursor;
3821
- }
3822
- const implementationsResponse = await httpClient.get(
3823
- "/zapier/api/v4/implementations-meta/lookup/",
3824
- {
3825
- searchParams
3826
- }
3827
- );
3828
- return {
3829
- data: implementationsResponse.results.map(
3830
- transformImplementationMetaToAppItem
3831
- ),
3832
- nextCursor: extractPaginationCursor(implementationsResponse)
3833
- };
3834
- };
3835
-
3836
- // src/api/router.ts
3837
- var routes = [
3838
- {
3839
- method: "GET",
3840
- pattern: /^\/api\/v0\/apps$/,
3841
- handler: handleListApps,
3842
- paramMap: []
3843
- }
3844
- ];
3845
- function findMatchingRoute(routeList, method, path) {
3846
- for (const route of routeList) {
3847
- if (route.method !== method) {
3848
- continue;
3849
- }
3850
- const match = path.match(route.pattern);
3851
- if (match) {
3852
- const params = {};
3853
- route.paramMap.forEach((name, index) => {
3854
- params[name] = match[index + 1];
3855
- });
3856
- return {
3857
- handler: route.handler,
3858
- params
3859
- };
3860
- }
3861
- }
3862
- return null;
3863
- }
3864
- function matchRoute(method, path) {
3865
- return findMatchingRoute(routes, method, path);
3866
- }
3867
-
3868
3546
  // src/api/client.ts
3869
3547
  var pathConfig = {
3870
3548
  // e.g. /relay -> https://sdkapi.zapier.com/api/v0/sdk/relay/...
@@ -4113,20 +3791,6 @@ var ZapierApiClient = class {
4113
3791
  }
4114
3792
  // Helper to perform HTTP requests with JSON handling
4115
3793
  async fetchJson(method, path, data, options = {}) {
4116
- const routeMatch = matchRoute(method, path);
4117
- if (routeMatch) {
4118
- const handlerRequest = {
4119
- ...typeof data === "object" ? data : {},
4120
- ...options.searchParams,
4121
- ...routeMatch.params
4122
- };
4123
- return routeMatch.handler({
4124
- request: handlerRequest,
4125
- deps: {
4126
- httpClient: this
4127
- }
4128
- });
4129
- }
4130
3794
  const headers = { ...options.headers };
4131
3795
  if (data && typeof data === "object") {
4132
3796
  headers["Content-Type"] = "application/json";
@@ -4809,7 +4473,7 @@ function getCpuTime() {
4809
4473
 
4810
4474
  // package.json
4811
4475
  var package_default = {
4812
- version: "0.18.3"};
4476
+ version: "0.18.4"};
4813
4477
 
4814
4478
  // src/plugins/eventEmission/builders.ts
4815
4479
  function createBaseEvent(context = {}) {