@zapier/zapier-sdk 0.46.0 → 0.47.0

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 (212) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/api/client.d.ts.map +1 -1
  3. package/dist/api/client.js +17 -6
  4. package/dist/api/types.d.ts +11 -0
  5. package/dist/api/types.d.ts.map +1 -1
  6. package/dist/index.cjs +3048 -3629
  7. package/dist/index.d.mts +6700 -2148
  8. package/dist/index.d.ts +5 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -0
  11. package/dist/index.mjs +3045 -3630
  12. package/dist/plugins/api/index.d.ts +22 -10
  13. package/dist/plugins/api/index.d.ts.map +1 -1
  14. package/dist/plugins/api/index.js +4 -4
  15. package/dist/plugins/apps/index.d.ts +108 -7
  16. package/dist/plugins/apps/index.d.ts.map +1 -1
  17. package/dist/plugins/apps/index.js +3 -4
  18. package/dist/plugins/capabilities/index.d.ts +9 -6
  19. package/dist/plugins/capabilities/index.d.ts.map +1 -1
  20. package/dist/plugins/capabilities/index.js +3 -2
  21. package/dist/plugins/connections/index.d.ts +15 -9
  22. package/dist/plugins/connections/index.d.ts.map +1 -1
  23. package/dist/plugins/connections/index.js +3 -2
  24. package/dist/plugins/createClientCredentials/index.d.ts +26 -14
  25. package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
  26. package/dist/plugins/createClientCredentials/index.js +16 -39
  27. package/dist/plugins/createClientCredentials/schemas.d.ts +0 -2
  28. package/dist/plugins/createClientCredentials/schemas.d.ts.map +1 -1
  29. package/dist/plugins/deleteClientCredentials/index.d.ts +20 -14
  30. package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
  31. package/dist/plugins/deleteClientCredentials/index.js +18 -37
  32. package/dist/plugins/deleteClientCredentials/schemas.d.ts +0 -2
  33. package/dist/plugins/deleteClientCredentials/schemas.d.ts.map +1 -1
  34. package/dist/plugins/deprecated/authentications.d.ts +597 -41
  35. package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
  36. package/dist/plugins/deprecated/authentications.js +9 -8
  37. package/dist/plugins/eventEmission/index.d.ts +9 -6
  38. package/dist/plugins/eventEmission/index.d.ts.map +1 -1
  39. package/dist/plugins/eventEmission/index.js +3 -2
  40. package/dist/plugins/fetch/index.d.ts +40 -17
  41. package/dist/plugins/fetch/index.d.ts.map +1 -1
  42. package/dist/plugins/fetch/index.js +6 -4
  43. package/dist/plugins/findFirstConnection/index.d.ts +109 -14
  44. package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
  45. package/dist/plugins/findFirstConnection/index.js +14 -26
  46. package/dist/plugins/findFirstConnection/schemas.d.ts +0 -2
  47. package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -1
  48. package/dist/plugins/findUniqueConnection/index.d.ts +109 -14
  49. package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
  50. package/dist/plugins/findUniqueConnection/index.js +14 -26
  51. package/dist/plugins/findUniqueConnection/schemas.d.ts +0 -2
  52. package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -1
  53. package/dist/plugins/getAction/index.d.ts +68 -15
  54. package/dist/plugins/getAction/index.d.ts.map +1 -1
  55. package/dist/plugins/getAction/index.js +21 -31
  56. package/dist/plugins/getAction/schemas.d.ts +0 -2
  57. package/dist/plugins/getAction/schemas.d.ts.map +1 -1
  58. package/dist/plugins/getApp/index.d.ts +140 -14
  59. package/dist/plugins/getApp/index.d.ts.map +1 -1
  60. package/dist/plugins/getApp/index.js +16 -38
  61. package/dist/plugins/getApp/schemas.d.ts +0 -2
  62. package/dist/plugins/getApp/schemas.d.ts.map +1 -1
  63. package/dist/plugins/getConnection/index.d.ts +50 -16
  64. package/dist/plugins/getConnection/index.d.ts.map +1 -1
  65. package/dist/plugins/getConnection/index.js +22 -29
  66. package/dist/plugins/getConnection/schemas.d.ts +0 -2
  67. package/dist/plugins/getConnection/schemas.d.ts.map +1 -1
  68. package/dist/plugins/getInputFieldsSchema/index.d.ts +59 -13
  69. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
  70. package/dist/plugins/getInputFieldsSchema/index.js +21 -32
  71. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -2
  72. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -1
  73. package/dist/plugins/getProfile/index.d.ts +25 -18
  74. package/dist/plugins/getProfile/index.d.ts.map +1 -1
  75. package/dist/plugins/getProfile/index.js +13 -26
  76. package/dist/plugins/getProfile/schemas.d.ts +0 -8
  77. package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
  78. package/dist/plugins/getProfile/schemas.js +0 -1
  79. package/dist/plugins/listActions/index.d.ts +73 -23
  80. package/dist/plugins/listActions/index.d.ts.map +1 -1
  81. package/dist/plugins/listActions/index.js +25 -53
  82. package/dist/plugins/listActions/schemas.d.ts +0 -11
  83. package/dist/plugins/listActions/schemas.d.ts.map +1 -1
  84. package/dist/plugins/listApps/index.d.ts +121 -13
  85. package/dist/plugins/listApps/index.d.ts.map +1 -1
  86. package/dist/plugins/listApps/index.js +22 -31
  87. package/dist/plugins/listApps/schemas.d.ts +0 -2
  88. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  89. package/dist/plugins/listClientCredentials/index.d.ts +29 -16
  90. package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
  91. package/dist/plugins/listClientCredentials/index.js +17 -37
  92. package/dist/plugins/listClientCredentials/schemas.d.ts +0 -2
  93. package/dist/plugins/listClientCredentials/schemas.d.ts.map +1 -1
  94. package/dist/plugins/listConnections/index.d.ts +95 -17
  95. package/dist/plugins/listConnections/index.d.ts.map +1 -1
  96. package/dist/plugins/listConnections/index.js +25 -49
  97. package/dist/plugins/listConnections/schemas.d.ts +0 -2
  98. package/dist/plugins/listConnections/schemas.d.ts.map +1 -1
  99. package/dist/plugins/listInputFieldChoices/index.d.ts +77 -22
  100. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
  101. package/dist/plugins/listInputFieldChoices/index.js +27 -50
  102. package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -2
  103. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
  104. package/dist/plugins/listInputFields/index.d.ts +154 -22
  105. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  106. package/dist/plugins/listInputFields/index.js +28 -41
  107. package/dist/plugins/listInputFields/schemas.d.ts +0 -2
  108. package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
  109. package/dist/plugins/manifest/index.d.ts +40 -36
  110. package/dist/plugins/manifest/index.d.ts.map +1 -1
  111. package/dist/plugins/manifest/index.js +3 -2
  112. package/dist/plugins/registry/index.d.ts +11 -9
  113. package/dist/plugins/registry/index.d.ts.map +1 -1
  114. package/dist/plugins/registry/index.js +3 -2
  115. package/dist/plugins/request/index.d.ts +61 -15
  116. package/dist/plugins/request/index.d.ts.map +1 -1
  117. package/dist/plugins/request/index.js +14 -22
  118. package/dist/plugins/request/schemas.d.ts +0 -2
  119. package/dist/plugins/request/schemas.d.ts.map +1 -1
  120. package/dist/plugins/runAction/index.d.ts +137 -23
  121. package/dist/plugins/runAction/index.d.ts.map +1 -1
  122. package/dist/plugins/runAction/index.js +65 -78
  123. package/dist/plugins/runAction/schemas.d.ts +0 -10
  124. package/dist/plugins/runAction/schemas.d.ts.map +1 -1
  125. package/dist/plugins/tables/createTable/index.d.ts +43 -11
  126. package/dist/plugins/tables/createTable/index.d.ts.map +1 -1
  127. package/dist/plugins/tables/createTable/index.js +16 -44
  128. package/dist/plugins/tables/createTable/schemas.d.ts +0 -2
  129. package/dist/plugins/tables/createTable/schemas.d.ts.map +1 -1
  130. package/dist/plugins/tables/createTableFields/index.d.ts +54 -11
  131. package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
  132. package/dist/plugins/tables/createTableFields/index.js +17 -41
  133. package/dist/plugins/tables/createTableFields/schemas.d.ts +0 -2
  134. package/dist/plugins/tables/createTableFields/schemas.d.ts.map +1 -1
  135. package/dist/plugins/tables/createTableRecords/index.d.ts +47 -11
  136. package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
  137. package/dist/plugins/tables/createTableRecords/index.js +17 -43
  138. package/dist/plugins/tables/createTableRecords/schemas.d.ts +0 -2
  139. package/dist/plugins/tables/createTableRecords/schemas.d.ts.map +1 -1
  140. package/dist/plugins/tables/deleteTable/index.d.ts +36 -13
  141. package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
  142. package/dist/plugins/tables/deleteTable/index.js +18 -40
  143. package/dist/plugins/tables/deleteTable/schemas.d.ts +0 -2
  144. package/dist/plugins/tables/deleteTable/schemas.d.ts.map +1 -1
  145. package/dist/plugins/tables/deleteTableFields/index.d.ts +36 -11
  146. package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
  147. package/dist/plugins/tables/deleteTableFields/index.js +17 -39
  148. package/dist/plugins/tables/deleteTableFields/schemas.d.ts +0 -2
  149. package/dist/plugins/tables/deleteTableFields/schemas.d.ts.map +1 -1
  150. package/dist/plugins/tables/deleteTableRecords/index.d.ts +36 -11
  151. package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
  152. package/dist/plugins/tables/deleteTableRecords/index.js +18 -41
  153. package/dist/plugins/tables/deleteTableRecords/schemas.d.ts +0 -2
  154. package/dist/plugins/tables/deleteTableRecords/schemas.d.ts.map +1 -1
  155. package/dist/plugins/tables/getTable/index.d.ts +43 -12
  156. package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
  157. package/dist/plugins/tables/getTable/index.js +18 -43
  158. package/dist/plugins/tables/getTable/schemas.d.ts +0 -2
  159. package/dist/plugins/tables/getTable/schemas.d.ts.map +1 -1
  160. package/dist/plugins/tables/getTableRecord/index.d.ts +43 -11
  161. package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
  162. package/dist/plugins/tables/getTableRecord/index.js +18 -42
  163. package/dist/plugins/tables/getTableRecord/schemas.d.ts +0 -2
  164. package/dist/plugins/tables/getTableRecord/schemas.d.ts.map +1 -1
  165. package/dist/plugins/tables/listTableFields/index.d.ts +46 -11
  166. package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
  167. package/dist/plugins/tables/listTableFields/index.js +17 -41
  168. package/dist/plugins/tables/listTableFields/schemas.d.ts +0 -2
  169. package/dist/plugins/tables/listTableFields/schemas.d.ts.map +1 -1
  170. package/dist/plugins/tables/listTableRecords/index.d.ts +66 -18
  171. package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
  172. package/dist/plugins/tables/listTableRecords/index.js +27 -50
  173. package/dist/plugins/tables/listTableRecords/schemas.d.ts +0 -2
  174. package/dist/plugins/tables/listTableRecords/schemas.d.ts.map +1 -1
  175. package/dist/plugins/tables/listTables/index.d.ts +53 -20
  176. package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
  177. package/dist/plugins/tables/listTables/index.js +24 -51
  178. package/dist/plugins/tables/listTables/schemas.d.ts +0 -2
  179. package/dist/plugins/tables/listTables/schemas.d.ts.map +1 -1
  180. package/dist/plugins/tables/shared.d.ts +10 -0
  181. package/dist/plugins/tables/shared.d.ts.map +1 -0
  182. package/dist/plugins/tables/shared.js +9 -0
  183. package/dist/plugins/tables/updateTableRecords/index.d.ts +49 -11
  184. package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
  185. package/dist/plugins/tables/updateTableRecords/index.js +20 -43
  186. package/dist/plugins/tables/updateTableRecords/schemas.d.ts +0 -2
  187. package/dist/plugins/tables/updateTableRecords/schemas.d.ts.map +1 -1
  188. package/dist/plugins/tables/utils.d.ts.map +1 -1
  189. package/dist/plugins/tables/utils.js +1 -0
  190. package/dist/registry.d.ts.map +1 -1
  191. package/dist/registry.js +21 -1
  192. package/dist/resolvers/actionKey.d.ts +1 -2
  193. package/dist/resolvers/actionKey.d.ts.map +1 -1
  194. package/dist/resolvers/actionType.d.ts +1 -2
  195. package/dist/resolvers/actionType.d.ts.map +1 -1
  196. package/dist/sdk.d.ts +2942 -2
  197. package/dist/sdk.d.ts.map +1 -1
  198. package/dist/types/errors.d.ts +13 -10
  199. package/dist/types/errors.d.ts.map +1 -1
  200. package/dist/types/errors.js +15 -12
  201. package/dist/types/functions.d.ts +18 -2
  202. package/dist/types/functions.d.ts.map +1 -1
  203. package/dist/types/plugin.d.ts +1 -1
  204. package/dist/types/plugin.d.ts.map +1 -1
  205. package/dist/types/registry.d.ts +1 -1
  206. package/dist/types/registry.d.ts.map +1 -1
  207. package/dist/utils/function-utils.d.ts +11 -12
  208. package/dist/utils/function-utils.d.ts.map +1 -1
  209. package/dist/utils/plugin-utils.d.ts +243 -0
  210. package/dist/utils/plugin-utils.d.ts.map +1 -0
  211. package/dist/utils/plugin-utils.js +232 -0
  212. package/package.json +2 -1
@@ -1,36 +1,150 @@
1
- import type { Plugin } from "../../types/plugin";
2
1
  import type { ApiClient } from "../../api";
3
- import { RunActionSchema, type RunActionOptions } from "./schemas";
4
- import type { GetActionPluginProvides } from "../getAction";
5
- import type { GetAppPluginProvides } from "../getApp";
6
2
  import type { GetVersionedImplementationId } from "../manifest/schemas";
7
3
  import type { ConnectionsPluginProvides } from "../connections";
8
- import type { EventEmissionProvides } from "../eventEmission";
9
- export interface RunActionPluginProvides {
10
- runAction: (options?: RunActionOptions) => Promise<{
11
- data: any[];
12
- nextCursor?: string;
13
- }> & AsyncIterable<{
14
- data: any[];
15
- nextCursor?: string;
16
- }> & {
17
- items(): AsyncIterable<any>;
4
+ export declare const CONTEXT_CACHE_TTL_MS = 60000;
5
+ export declare const CONTEXT_CACHE_MAX_SIZE = 500;
6
+ export declare const runActionPlugin: (sdk: {
7
+ getAction: (options?: {
8
+ app: string;
9
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
10
+ action: string;
11
+ } | {
12
+ appKey: string;
13
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
14
+ actionKey: string;
15
+ } | undefined) => Promise<{
16
+ data: {
17
+ description: string;
18
+ key: string;
19
+ app_key: string;
20
+ action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
21
+ title: string;
22
+ type: "action";
23
+ id?: string | undefined;
24
+ is_important?: boolean | undefined;
25
+ is_hidden?: boolean | undefined;
26
+ app_version?: string | undefined;
27
+ };
28
+ }>;
29
+ } & {
30
+ context: {
31
+ meta: {
32
+ getAction: import("../..").PluginMeta;
33
+ };
18
34
  };
35
+ } & {
36
+ getApp: (options?: {
37
+ app: string;
38
+ } | {
39
+ appKey: string;
40
+ } | undefined) => Promise<{
41
+ data: {
42
+ slug: string;
43
+ title: string;
44
+ key: string;
45
+ implementation_id: string;
46
+ description?: string | undefined;
47
+ is_hidden?: boolean | undefined;
48
+ auth_type?: string | undefined;
49
+ actions?: {
50
+ read?: number | undefined;
51
+ read_bulk?: number | undefined;
52
+ write?: number | undefined;
53
+ search?: number | undefined;
54
+ search_or_write?: number | undefined;
55
+ search_and_write?: number | undefined;
56
+ filter?: number | undefined;
57
+ } | undefined;
58
+ is_deprecated?: boolean | undefined;
59
+ is_beta?: boolean | undefined;
60
+ is_premium?: boolean | undefined;
61
+ age_in_days?: number | undefined;
62
+ banner?: string | undefined;
63
+ categories?: {
64
+ id: number;
65
+ name: string;
66
+ slug: string;
67
+ }[] | undefined;
68
+ images?: {
69
+ url_16x16?: string | undefined;
70
+ url_32x32?: string | undefined;
71
+ url_64x64?: string | undefined;
72
+ url_128x128?: string | undefined;
73
+ } | undefined;
74
+ popularity?: number | undefined;
75
+ has_filters?: boolean | undefined;
76
+ has_reads?: boolean | undefined;
77
+ has_searches?: boolean | undefined;
78
+ has_searches_or_writes?: boolean | undefined;
79
+ has_upfront_fields?: boolean | undefined;
80
+ has_writes?: boolean | undefined;
81
+ is_built_in?: boolean | undefined;
82
+ is_featured?: boolean | undefined;
83
+ is_invite?: boolean | undefined;
84
+ is_public?: boolean | undefined;
85
+ is_upcoming?: boolean | undefined;
86
+ visibility?: string | undefined;
87
+ primary_color?: string | undefined;
88
+ secondary_color?: string | undefined;
89
+ classification?: string | undefined;
90
+ api_docs_url?: string | undefined;
91
+ image?: string | undefined;
92
+ version?: string | undefined;
93
+ };
94
+ }>;
95
+ } & {
19
96
  context: {
20
97
  meta: {
21
- runAction: {
22
- inputSchema: typeof RunActionSchema;
23
- };
98
+ getApp: import("../..").PluginMeta;
24
99
  };
25
100
  };
26
- }
27
- export declare const CONTEXT_CACHE_TTL_MS = 60000;
28
- export declare const CONTEXT_CACHE_MAX_SIZE = 500;
29
- export declare const runActionPlugin: Plugin<GetActionPluginProvides & GetAppPluginProvides & {
101
+ } & {
30
102
  context: {
31
103
  api: ApiClient;
32
104
  getVersionedImplementationId: GetVersionedImplementationId;
33
105
  } & ConnectionsPluginProvides["context"];
34
- } & EventEmissionProvides, // requires getAction and getApp in SDK, api, connections, and eventEmission in context
35
- RunActionPluginProvides>;
106
+ } & {
107
+ context: import("../eventEmission").EventEmissionContext;
108
+ } & {
109
+ context: {
110
+ meta: Record<string, import("../..").PluginMeta>;
111
+ };
112
+ }) => {
113
+ runAction: (options?: (({
114
+ app: string;
115
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
116
+ action: string;
117
+ connection?: string | number | undefined;
118
+ connectionId?: string | number | null | undefined;
119
+ authenticationId?: string | number | null | undefined;
120
+ inputs?: Record<string, unknown> | undefined;
121
+ timeoutMs?: number | undefined;
122
+ pageSize?: number | undefined;
123
+ maxItems?: number | undefined;
124
+ cursor?: string | undefined;
125
+ } | {
126
+ appKey: string;
127
+ actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
128
+ actionKey: string;
129
+ connection?: string | number | undefined;
130
+ connectionId?: string | number | null | undefined;
131
+ authenticationId?: string | number | null | undefined;
132
+ inputs?: Record<string, unknown> | undefined;
133
+ timeoutMs?: number | undefined;
134
+ pageSize?: number | undefined;
135
+ maxItems?: number | undefined;
136
+ cursor?: string | undefined;
137
+ }) & {
138
+ cursor?: string;
139
+ pageSize?: number;
140
+ maxItems?: number;
141
+ }) | undefined) => import("../..").PaginatedSdkResult<unknown>;
142
+ } & {
143
+ context: {
144
+ meta: {
145
+ runAction: import("../..").PluginMeta;
146
+ };
147
+ };
148
+ };
149
+ export type RunActionPluginProvides = ReturnType<typeof runActionPlugin>;
36
150
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/runAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,eAAe,EAEf,KAAK,gBAAgB,EAEtB,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAQtD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAS9D,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC;QACjD,IAAI,EAAE,GAAG,EAAE,CAAC;QACZ,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACpD,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;KAC7B,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,SAAS,EAAE;gBACT,WAAW,EAAE,OAAO,eAAe,CAAC;aACrC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAkGD,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAC3C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,uBAAuB,GACrB,oBAAoB,GAAG;IACrB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;CAC1C,GAAG,qBAAqB,EAAE,uFAAuF;AACpH,uBAAuB,CAyMxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/runAction/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAiB3C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AA0GhE,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAC3C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAIX;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuL/C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -1,11 +1,10 @@
1
- import { RunActionSchema, RunActionInputSchema, } from "./schemas";
1
+ import { definePlugin } from "../../utils/plugin-utils";
2
+ import { createPaginatedPluginMethod } from "../../utils/plugin-utils";
3
+ import { RunActionInputSchema } from "./schemas";
2
4
  import { ActionResultItemSchema } from "../../schemas/Run";
3
5
  import { ZapierValidationError, ZapierConfigurationError, ZapierActionError, } from "../../types/errors";
4
- import { createPaginatedFunction } from "../../utils/function-utils";
5
6
  import { appKeyResolver, actionTypeResolver, actionKeyResolver, connectionIdResolver, inputsResolver, } from "../../resolvers";
6
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
7
7
  import { resolveConnectionId } from "../../utils/domain-utils";
8
- import { stripPageSuffix } from "../../utils/string-utils";
9
8
  import { DEFAULT_ACTION_TIMEOUT_MS } from "../../constants";
10
9
  import { setMethodMetadata } from "../../utils/telemetry-context";
11
10
  import { buildActionRunContext } from "@zapier/policy-context";
@@ -46,6 +45,7 @@ async function executeAction(actionOptions) {
46
45
  successStatus: 200,
47
46
  pendingStatus: 202,
48
47
  timeoutMs: timeoutMs ?? DEFAULT_ACTION_TIMEOUT_MS,
48
+ resource: { type: "run", id: runId },
49
49
  isPending: (result) => {
50
50
  const data = result?.data;
51
51
  return data?.status === "waiting";
@@ -55,7 +55,7 @@ async function executeAction(actionOptions) {
55
55
  }
56
56
  export const CONTEXT_CACHE_TTL_MS = 60000;
57
57
  export const CONTEXT_CACHE_MAX_SIZE = 500;
58
- export const runActionPlugin = (sdk) => {
58
+ export const runActionPlugin = definePlugin((sdk) => {
59
59
  // Intentionally kept inline — only this plugin needs this pattern today.
60
60
  // If a second plugin needs a bounded TTL cache, extract to a shared utility.
61
61
  const runActionContextCache = new Map();
@@ -119,80 +119,67 @@ export const runActionPlugin = (sdk) => {
119
119
  }
120
120
  return { selectedApi, actionId: actionData.data.id };
121
121
  }
122
- async function runActionPage(options) {
123
- const { api } = sdk.context;
124
- const appKey = "app" in options ? options.app : options.appKey;
125
- const actionKey = "action" in options ? options.action : options.actionKey;
126
- const { actionType, connectionId, connection, authenticationId, inputs = {}, cursor, timeoutMs, } = options;
127
- const resolvedConnectionId = await resolveConnectionId({
128
- connectionId,
129
- connection,
130
- authenticationId,
131
- resolveConnection: sdk.context.resolveConnection,
132
- });
133
- const { selectedApi, actionId } = await getRunActionContext({
134
- appKey,
135
- actionKey,
136
- actionType,
137
- });
138
- setMethodMetadata({
139
- selectedApi,
140
- operationType: actionType,
141
- operationKey: actionKey,
142
- });
143
- // Execute the action using the Actions API (supports all action types)
144
- const result = await executeAction({
145
- api,
146
- selectedApi,
147
- // Some actions require the action ID to run them, but technically the ID is not guaranteed to be available when
148
- // we retrieve actions (probably legacy reasons), so we just pass along all the things!
149
- actionId,
150
- actionKey,
151
- actionType,
152
- executionOptions: { inputs },
153
- cursor,
154
- connectionId: resolvedConnectionId,
155
- timeoutMs,
156
- });
157
- // Check for errors in the result and throw if present
158
- if (result.errors && result.errors.length > 0) {
159
- const errorMessage = result.errors
160
- .map((error) => error.detail || error.title || "Unknown error")
161
- .join("; ");
162
- throw new ZapierActionError(`Action execution failed: ${errorMessage}`, {
122
+ // No defaultPageSize — we leave the default to the Actions API rather
123
+ // than eagerly running more actions than the user intends to (and avoid
124
+ // hitting app rate limits).
125
+ return createPaginatedPluginMethod(sdk, {
126
+ name: "runAction",
127
+ categories: ["action"],
128
+ type: "list",
129
+ itemType: "ActionResult",
130
+ inputSchema: RunActionInputSchema,
131
+ outputSchema: ActionResultItemSchema,
132
+ resolvers: {
133
+ app: appKeyResolver,
134
+ actionType: actionTypeResolver,
135
+ action: actionKeyResolver,
136
+ connection: connectionIdResolver,
137
+ inputs: inputsResolver,
138
+ },
139
+ handler: async ({ sdk, options, }) => {
140
+ const { api } = sdk.context;
141
+ const appKey = "app" in options ? options.app : options.appKey;
142
+ const actionKey = "action" in options ? options.action : options.actionKey;
143
+ const { actionType, connectionId, connection, authenticationId, inputs = {}, cursor, timeoutMs, } = options;
144
+ const resolvedConnectionId = await resolveConnectionId({
145
+ connectionId,
146
+ connection,
147
+ authenticationId,
148
+ resolveConnection: sdk.context.resolveConnection,
149
+ });
150
+ const { selectedApi, actionId } = await getRunActionContext({
163
151
  appKey,
164
152
  actionKey,
153
+ actionType,
165
154
  });
166
- }
167
- return {
168
- data: result.results || [],
169
- nextCursor: result.next_page,
170
- };
171
- }
172
- const methodName = stripPageSuffix(runActionPage.name);
173
- // No defaultPageSize — we leave the default to the Actions API rather than
174
- // eagerly running more actions than the user intends to
175
- // (and avoid potentially hitting app rate limits).
176
- const runActionDefinition = createPaginatedFunction(runActionPage, RunActionInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName);
177
- return {
178
- runAction: runActionDefinition,
179
- context: {
180
- meta: {
181
- runAction: {
182
- categories: ["action"],
183
- type: "list",
184
- itemType: "ActionResult",
185
- inputSchema: RunActionSchema,
186
- outputSchema: ActionResultItemSchema,
187
- resolvers: {
188
- app: appKeyResolver,
189
- actionType: actionTypeResolver,
190
- action: actionKeyResolver,
191
- connection: connectionIdResolver,
192
- inputs: inputsResolver,
193
- },
194
- },
195
- },
155
+ setMethodMetadata({
156
+ selectedApi,
157
+ operationType: actionType,
158
+ operationKey: actionKey,
159
+ });
160
+ const result = await executeAction({
161
+ api,
162
+ selectedApi,
163
+ // Some actions require the action ID, but it's not guaranteed
164
+ // available at retrieval time (legacy), so pass everything through.
165
+ actionId,
166
+ actionKey,
167
+ actionType,
168
+ executionOptions: { inputs },
169
+ cursor,
170
+ connectionId: resolvedConnectionId,
171
+ timeoutMs,
172
+ });
173
+ if (result.errors && result.errors.length > 0) {
174
+ const errorMessage = result.errors
175
+ .map((error) => error.detail || error.title || "Unknown error")
176
+ .join("; ");
177
+ throw new ZapierActionError(`Action execution failed: ${errorMessage}`, { appKey, actionKey });
178
+ }
179
+ return {
180
+ data: result.results || [],
181
+ nextCursor: result.next_page,
182
+ };
196
183
  },
197
- };
198
- };
184
+ });
185
+ });
@@ -1,6 +1,4 @@
1
1
  import { z } from "zod";
2
- import type { PaginatedSdkFunction } from "../../types/functions";
3
- import type { ZapierActionError, ZapierValidationError, ZapierConfigurationError, ZapierUnknownError } from "../../types/errors";
4
2
  export declare const RunActionSchema: z.ZodObject<{
5
3
  app: z.ZodString & {
6
4
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
@@ -106,13 +104,5 @@ export type RunActionOptions = z.infer<typeof RunActionSchema> | (Omit<z.infer<t
106
104
  /** @deprecated Use `action` instead. */
107
105
  actionKey: z.infer<typeof RunActionSchemaDeprecated>["actionKey"];
108
106
  });
109
- export interface RunActionPage {
110
- data: unknown[];
111
- nextCursor?: string;
112
- }
113
- export type RunActionError = ZapierActionError | ZapierValidationError | ZapierConfigurationError | ZapierUnknownError;
114
- export interface RunActionSdkFunction {
115
- runAction: PaginatedSdkFunction<RunActionOptions, unknown>;
116
- }
117
107
  export {};
118
108
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/runAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAiC5B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBAexB,CAAC;AAGL,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;iBAMF,CAAC;AAG9B,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAGlC,MAAM,MAAM,gBAAgB,GACxB,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GAC/B,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG;IACzE,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,wCAAwC;IACxC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC,WAAW,CAAC,CAAC;CACnE,CAAC,CAAC;AAGP,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,qBAAqB,GACrB,wBAAwB,GACxB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CAC5D"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/runAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6CxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBAexB,CAAC;AAGL,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;iBAMF,CAAC;AAG9B,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAGlC,MAAM,MAAM,gBAAgB,GACxB,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GAC/B,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG;IACzE,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,wCAAwC;IACxC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC,WAAW,CAAC,CAAC;CACnE,CAAC,CAAC"}
@@ -1,16 +1,48 @@
1
- import type { Plugin } from "../../../types/plugin";
2
- import { CreateTableOptionsSchema, type CreateTableOptions, type CreateTableResult } from "./schemas";
3
- import type { ApiPluginProvides } from "../../api";
4
- import type { EventEmissionProvides } from "../../eventEmission";
5
- export interface CreateTablePluginProvides {
6
- createTable: (options: CreateTableOptions) => Promise<CreateTableResult>;
1
+ export declare const createTablePlugin: (sdk: {
2
+ context: {
3
+ api: import("../../../api").ApiClient;
4
+ resolveCredentials: () => Promise<string | {
5
+ clientId: string;
6
+ clientSecret: string;
7
+ type?: "client_credentials" | undefined;
8
+ baseUrl?: string | undefined;
9
+ scope?: string | undefined;
10
+ } | {
11
+ clientId: string;
12
+ type?: "pkce" | undefined;
13
+ baseUrl?: string | undefined;
14
+ scope?: string | undefined;
15
+ } | undefined>;
16
+ };
17
+ } & {
18
+ context: import("../../eventEmission").EventEmissionContext;
19
+ } & {
20
+ context: {
21
+ meta: Record<string, import("../../..").PluginMeta>;
22
+ };
23
+ }) => {
24
+ createTable: (options?: {
25
+ name: string;
26
+ description?: string | undefined;
27
+ } | undefined) => Promise<{
28
+ data: {
29
+ id: string;
30
+ name: string;
31
+ created_at: string;
32
+ edited_at: string;
33
+ kind: "table" | "virtual_table";
34
+ account_id: string;
35
+ profile_id: string;
36
+ description?: string | undefined;
37
+ parent_table_id?: string | undefined;
38
+ };
39
+ }>;
40
+ } & {
7
41
  context: {
8
42
  meta: {
9
- createTable: {
10
- inputSchema: typeof CreateTableOptionsSchema;
11
- };
43
+ createTable: import("../../..").PluginMeta;
12
44
  };
13
45
  };
14
- }
15
- export declare const createTablePlugin: Plugin<ApiPluginProvides & EventEmissionProvides, CreateTablePluginProvides>;
46
+ };
47
+ export type CreateTablePluginProvides = ReturnType<typeof createTablePlugin>;
16
48
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,wBAAwB,EAGxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,OAAO,wBAAwB,CAAC;aAC9C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,iBAAiB,GAAG,qBAAqB,EACzC,yBAAyB,CAkE1B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTable/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB7B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1,48 +1,20 @@
1
- import { createFunction } from "../../../utils/function-utils";
1
+ import { definePlugin } from "../../../utils/plugin-utils";
2
+ import { createPluginMethod } from "../../../utils/plugin-utils";
2
3
  import { CreateTableOptionsSchema, CreateTableApiResponseSchema, TableItemSchema, } from "./schemas";
3
- import { createTelemetryCallback } from "../../../utils/telemetry-utils";
4
- import { ZapierAuthenticationError } from "../../../types/errors";
5
4
  import { tableNameResolver } from "../../../resolvers";
6
5
  import { transformTableItem } from "../utils";
7
- export const createTablePlugin = (sdk) => {
8
- async function createTable(options) {
9
- const { api } = sdk.context;
10
- const rawResponse = await api.post("/tables/api/v1/tables", {
11
- name: options.name,
12
- description: options.description,
13
- }, {
14
- customErrorHandler: ({ status }) => {
15
- if (status === 401) {
16
- return new ZapierAuthenticationError(`Authentication failed. Your token may not have permission to create tables or may be expired. (HTTP ${status})`, { statusCode: status });
17
- }
18
- if (status === 403) {
19
- return new ZapierAuthenticationError(`Access forbidden. Your token may not have the required scopes to create tables. (HTTP ${status})`, { statusCode: status });
20
- }
21
- return undefined;
22
- },
23
- authRequired: true,
24
- });
6
+ import { tablesDefaults } from "../shared";
7
+ export const createTablePlugin = definePlugin((sdk) => createPluginMethod(sdk, {
8
+ ...tablesDefaults,
9
+ name: "createTable",
10
+ type: "create",
11
+ itemType: "Table",
12
+ inputSchema: CreateTableOptionsSchema,
13
+ outputSchema: TableItemSchema,
14
+ resolvers: { name: tableNameResolver },
15
+ handler: async ({ sdk, options }) => {
16
+ const rawResponse = await sdk.context.api.post("/tables/api/v1/tables", { name: options.name, description: options.description }, { authRequired: true });
25
17
  const response = CreateTableApiResponseSchema.parse(rawResponse);
26
- return {
27
- data: transformTableItem(response.data),
28
- };
29
- }
30
- const createTableDefinition = createFunction(createTable, CreateTableOptionsSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, createTable.name));
31
- return {
32
- createTable: createTableDefinition,
33
- context: {
34
- meta: {
35
- createTable: {
36
- categories: ["table"],
37
- type: "create",
38
- itemType: "Table",
39
- inputSchema: CreateTableOptionsSchema,
40
- outputSchema: TableItemSchema,
41
- resolvers: {
42
- name: tableNameResolver,
43
- },
44
- },
45
- },
46
- },
47
- };
48
- };
18
+ return { data: transformTableItem(response.data) };
19
+ },
20
+ }));
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import type { FunctionOptions } from "../../../types/functions";
3
- import type { ZapierAuthenticationError, ZapierApiError, ZapierValidationError, ZapierUnknownError } from "../../../types/errors";
4
3
  import { TableItemSchema, TableApiItemSchema, type TableItem, type TableApiItem } from "../listTables/schemas";
5
4
  export { TableItemSchema, TableApiItemSchema };
6
5
  export type { TableItem, TableApiItem };
@@ -32,7 +31,6 @@ export type CreateTableOptions = z.infer<typeof CreateTableOptionsSchema> & Func
32
31
  export interface CreateTableResult {
33
32
  data: TableItem;
34
33
  }
35
- export type CreateTableError = ZapierAuthenticationError | ZapierApiError | ZapierValidationError | ZapierUnknownError;
36
34
  export interface CreateTableSdkFunction {
37
35
  createTable: (options: CreateTableOptions) => Promise<CreateTableResult>;
38
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AAExC,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;iBAEvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;iBAQJ,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,GACvE,eAAe,CAAC;AAGlB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;CACjB;AAGD,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1E"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AAExC,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;iBAEvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;iBAQJ,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,GACvE,eAAe,CAAC;AAGlB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;CACjB;AAGD,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1E"}
@@ -1,16 +1,59 @@
1
- import type { Plugin } from "../../../types/plugin";
2
- import { CreateTableFieldsOptionsSchema, type CreateTableFieldsOptions, type CreateTableFieldsResult } from "./schemas";
3
- import type { ApiPluginProvides } from "../../api";
4
- import type { EventEmissionProvides } from "../../eventEmission";
5
- export interface CreateTableFieldsPluginProvides {
6
- createTableFields: (options: CreateTableFieldsOptions) => Promise<CreateTableFieldsResult>;
1
+ export declare const createTableFieldsPlugin: (sdk: {
2
+ context: {
3
+ api: import("../../../api").ApiClient;
4
+ resolveCredentials: () => Promise<string | {
5
+ clientId: string;
6
+ clientSecret: string;
7
+ type?: "client_credentials" | undefined;
8
+ baseUrl?: string | undefined;
9
+ scope?: string | undefined;
10
+ } | {
11
+ clientId: string;
12
+ type?: "pkce" | undefined;
13
+ baseUrl?: string | undefined;
14
+ scope?: string | undefined;
15
+ } | undefined>;
16
+ };
17
+ } & {
18
+ context: import("../../eventEmission").EventEmissionContext;
19
+ } & {
20
+ context: {
21
+ meta: Record<string, import("../../..").PluginMeta>;
22
+ };
23
+ }) => {
24
+ createTableFields: (options?: {
25
+ table: string;
26
+ fields: {
27
+ type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record";
28
+ name: string;
29
+ options?: Record<string, unknown> | undefined;
30
+ config?: Record<string, unknown> | undefined;
31
+ }[];
32
+ } | {
33
+ tableId: string;
34
+ fields: {
35
+ type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record";
36
+ name: string;
37
+ options?: Record<string, unknown> | undefined;
38
+ config?: Record<string, unknown> | undefined;
39
+ }[];
40
+ } | undefined) => Promise<{
41
+ data: {
42
+ id: string;
43
+ type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record";
44
+ name: string;
45
+ created_at?: string | undefined;
46
+ edited_at?: string | undefined;
47
+ options?: Record<string, unknown> | undefined;
48
+ config?: Record<string, unknown> | undefined;
49
+ }[];
50
+ }>;
51
+ } & {
7
52
  context: {
8
53
  meta: {
9
- createTableFields: {
10
- inputSchema: typeof CreateTableFieldsOptionsSchema;
11
- };
54
+ createTableFields: import("../../..").PluginMeta;
12
55
  };
13
56
  };
14
- }
15
- export declare const createTableFieldsPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, CreateTableFieldsPluginProvides>;
57
+ };
58
+ export type CreateTableFieldsPluginProvides = ReturnType<typeof createTableFieldsPlugin>;
16
59
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,8BAA8B,EAI9B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,EAAE,CACjB,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,OAAO,8BAA8B,CAAC;aACpD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,iBAAiB,GAAG,qBAAqB,EACzC,+BAA+B,CAoEhC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableFields/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BnC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,UAAU,CACtD,OAAO,uBAAuB,CAC/B,CAAC"}