@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,7 +1,4 @@
1
1
  import { z } from "zod";
2
- import type { ActionItem } from "../../types/domain";
3
- import type { PaginatedSdkFunction } from "../../types/functions";
4
- import type { ZapierAuthenticationError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
5
2
  export declare const ListActionsSchema: z.ZodObject<{
6
3
  app: z.ZodString & {
7
4
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
@@ -77,13 +74,5 @@ export type ListActionsOptions = z.infer<typeof ListActionsSchema> | (Omit<z.inf
77
74
  /** @deprecated Use `app` instead. */
78
75
  appKey: z.infer<typeof ListActionsSchemaDeprecated>["appKey"];
79
76
  });
80
- export interface ListActionsPage {
81
- data: ActionItem[];
82
- nextCursor?: string;
83
- }
84
- export type ListActionsError = ZapierAuthenticationError | ZapierValidationError | ZapierUnknownError;
85
- export interface ListActionsSdkFunction {
86
- listActions: PaginatedSdkFunction<ListActionsOptions, ActionItem>;
87
- }
88
77
  export {};
89
78
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,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BASF,CAAC;AAGhC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAGpC,MAAM,MAAM,kBAAkB,GAC1B,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,GACjC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,EAAE,QAAQ,CAAC,GAAG;IAC7D,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC/D,CAAC,CAAC"}
@@ -1,19 +1,127 @@
1
- import type { Plugin } from "../../types/plugin";
2
- import { ListAppsSchema, type ListAppsOptions, type ListAppsPage, type AppItem } from "./schemas";
3
- import type { ManifestPluginProvides } from "../manifest";
4
- import type { ApiPluginProvides } from "../api";
5
- import type { EventEmissionProvides } from "../eventEmission";
6
- export interface ListAppsPluginProvides {
7
- listApps: (options?: ListAppsOptions) => Promise<ListAppsPage> & AsyncIterable<ListAppsPage> & {
8
- items(): AsyncIterable<AppItem>;
1
+ export declare const listAppsPlugin: (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: {
19
+ getResolvedManifest: () => Promise<import("../manifest").Manifest | null>;
20
+ getVersionedImplementationId: (appKey: string) => Promise<string | null>;
21
+ resolveAppKeys: ({ appKeys }: {
22
+ appKeys: string[];
23
+ }) => Promise<import("../..").ResolvedAppLocator[]>;
24
+ updateManifestEntry: (options: import("../manifest").UpdateManifestEntryOptions) => Promise<import("../manifest").UpdateManifestEntryResult>;
25
+ addActionEntry: (options: import("../manifest").AddActionEntryOptions) => Promise<import("../manifest").AddActionEntryResult>;
26
+ findActionEntry: ({ name, manifest, }: {
27
+ name: string;
28
+ manifest: import("../manifest").Manifest;
29
+ }) => import("../manifest").ActionEntry | null;
30
+ listActionEntries: ({ configPath, }?: {
31
+ configPath?: string;
32
+ }) => Promise<Array<[string, import("../manifest").ActionEntry]>>;
33
+ deleteActionEntry: ({ name, configPath, skipWrite, }: {
34
+ name: string;
35
+ configPath?: string;
36
+ skipWrite?: boolean;
37
+ }) => Promise<import("../manifest").Manifest>;
38
+ hasActionEntry: ({ name, manifest, }: {
39
+ name: string;
40
+ manifest: import("../manifest").Manifest;
41
+ }) => boolean;
42
+ findManifestEntry: typeof import("../manifest").findManifestEntry;
43
+ readManifestFromFile: typeof import("../manifest").readManifestFromFile;
44
+ getManifestConnections: () => Promise<Record<string, {
45
+ connectionId: string | number;
46
+ }> | null>;
47
+ };
48
+ } & {
49
+ context: import("../eventEmission").EventEmissionContext;
50
+ } & {
51
+ context: {
52
+ meta: Record<string, import("../..").PluginMeta>;
9
53
  };
54
+ }) => {
55
+ listApps: (options?: ({
56
+ search?: string | undefined;
57
+ apps?: string[] | undefined;
58
+ appKeys?: string[] | undefined;
59
+ pageSize?: number | undefined;
60
+ maxItems?: number | undefined;
61
+ cursor?: string | undefined;
62
+ } & {
63
+ cursor?: string;
64
+ pageSize?: number;
65
+ maxItems?: number;
66
+ }) | undefined) => import("../..").PaginatedSdkResult<{
67
+ slug: string;
68
+ title: string;
69
+ key: string;
70
+ implementation_id: string;
71
+ description?: string | undefined;
72
+ is_hidden?: boolean | undefined;
73
+ auth_type?: string | undefined;
74
+ actions?: {
75
+ read?: number | undefined;
76
+ read_bulk?: number | undefined;
77
+ write?: number | undefined;
78
+ search?: number | undefined;
79
+ search_or_write?: number | undefined;
80
+ search_and_write?: number | undefined;
81
+ filter?: number | undefined;
82
+ } | undefined;
83
+ is_deprecated?: boolean | undefined;
84
+ is_beta?: boolean | undefined;
85
+ is_premium?: boolean | undefined;
86
+ age_in_days?: number | undefined;
87
+ banner?: string | undefined;
88
+ categories?: {
89
+ id: number;
90
+ name: string;
91
+ slug: string;
92
+ }[] | undefined;
93
+ images?: {
94
+ url_16x16?: string | undefined;
95
+ url_32x32?: string | undefined;
96
+ url_64x64?: string | undefined;
97
+ url_128x128?: string | undefined;
98
+ } | undefined;
99
+ popularity?: number | undefined;
100
+ has_filters?: boolean | undefined;
101
+ has_reads?: boolean | undefined;
102
+ has_searches?: boolean | undefined;
103
+ has_searches_or_writes?: boolean | undefined;
104
+ has_upfront_fields?: boolean | undefined;
105
+ has_writes?: boolean | undefined;
106
+ is_built_in?: boolean | undefined;
107
+ is_featured?: boolean | undefined;
108
+ is_invite?: boolean | undefined;
109
+ is_public?: boolean | undefined;
110
+ is_upcoming?: boolean | undefined;
111
+ visibility?: string | undefined;
112
+ primary_color?: string | undefined;
113
+ secondary_color?: string | undefined;
114
+ classification?: string | undefined;
115
+ api_docs_url?: string | undefined;
116
+ image?: string | undefined;
117
+ version?: string | undefined;
118
+ }>;
119
+ } & {
10
120
  context: {
11
121
  meta: {
12
- listApps: {
13
- inputSchema: typeof ListAppsSchema;
14
- };
122
+ listApps: import("../..").PluginMeta;
15
123
  };
16
124
  };
17
- }
18
- export declare const listAppsPlugin: Plugin<ApiPluginProvides & ManifestPluginProvides & EventEmissionProvides, ListAppsPluginProvides>;
125
+ };
126
+ export type ListAppsPluginProvides = ReturnType<typeof listAppsPlugin>;
19
127
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,OAAO,EACb,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAI9D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,YAAY,CAAC,GAC5D,aAAa,CAAC,YAAY,CAAC,GAAG;QAC5B,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;KACjC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR,WAAW,EAAE,OAAO,cAAc,CAAC;aACpC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,iBAAiB,GAAG,sBAAsB,GAAG,qBAAqB,EAClE,sBAAsB,CAqFvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAoEkzW,CAAC;;;;sBAAiX,CAAC;qBAAyB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAHztX,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -1,16 +1,21 @@
1
- import { createPaginatedFunction } from "../../utils/function-utils";
1
+ import { definePlugin } from "../../utils/plugin-utils";
2
+ import { createPaginatedPluginMethod } from "../../utils/plugin-utils";
2
3
  import { DEFAULT_PAGE_SIZE } from "../../constants";
3
- import { ListAppsSchema, } from "./schemas";
4
+ import { ListAppsSchema } from "./schemas";
4
5
  import { AppItemSchema } from "../../schemas/App";
5
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
6
- import { stripPageSuffix } from "../../utils/string-utils";
7
- export const listAppsPlugin = (sdk) => {
8
- async function listAppsPage(options) {
6
+ import { extractCursor } from "../../utils/function-utils";
7
+ export const listAppsPlugin = definePlugin((sdk) => createPaginatedPluginMethod(sdk, {
8
+ name: "listApps",
9
+ categories: ["app"],
10
+ type: "list",
11
+ itemType: "App",
12
+ inputSchema: ListAppsSchema,
13
+ outputSchema: AppItemSchema,
14
+ defaultPageSize: DEFAULT_PAGE_SIZE,
15
+ handler: async ({ sdk, options }) => {
9
16
  const { api, resolveAppKeys } = sdk.context;
10
17
  const appKeys = options.apps ?? options.appKeys ?? [];
11
- const appLocators = await resolveAppKeys({
12
- appKeys: [...appKeys],
13
- });
18
+ const appLocators = await resolveAppKeys({ appKeys: [...appKeys] });
14
19
  const implementationNameToLocator = {};
15
20
  for (const locator of appLocators) {
16
21
  implementationNameToLocator[locator.implementationName] = [
@@ -26,9 +31,10 @@ export const listAppsPlugin = (sdk) => {
26
31
  if (duplicatedLookupAppKeys.length > 0) {
27
32
  throw new Error(`Duplicate lookup app keys found: ${duplicatedLookupAppKeys.join(", ")}`);
28
33
  }
29
- // Step 2: Early return if user provided appKeys but they resolved to nothing AND no search
30
- // This prevents the handler from returning all apps when the user explicitly filtered
31
- // If search is provided, let the handler augment with search results
34
+ // Early return if user provided appKeys but they resolved to nothing
35
+ // AND no search. Prevents the handler from returning all apps when
36
+ // the user explicitly filtered. If search is provided, let the API
37
+ // augment with search results.
32
38
  if (appKeys.length > 0 && appLocators.length === 0 && !options.search) {
33
39
  return {
34
40
  data: [],
@@ -40,7 +46,7 @@ export const listAppsPlugin = (sdk) => {
40
46
  const version = locator.version || "latest";
41
47
  return `${locator.implementationName}@${version}`;
42
48
  });
43
- return await api.get("/api/v0/apps", {
49
+ return api.get("/api/v0/apps", {
44
50
  searchParams: {
45
51
  app_keys: implementationIds.join(","),
46
52
  ...(options.search && { search: options.search }),
@@ -50,21 +56,6 @@ export const listAppsPlugin = (sdk) => {
50
56
  ...(options.cursor && { offset: options.cursor }),
51
57
  },
52
58
  });
53
- }
54
- const methodName = stripPageSuffix(listAppsPage.name);
55
- const listAppsDefinition = createPaginatedFunction(listAppsPage, ListAppsSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
56
- return {
57
- listApps: listAppsDefinition,
58
- context: {
59
- meta: {
60
- listApps: {
61
- categories: ["app"],
62
- type: "list",
63
- itemType: "App",
64
- inputSchema: ListAppsSchema,
65
- outputSchema: AppItemSchema,
66
- },
67
- },
68
- },
69
- };
70
- };
59
+ },
60
+ extractCursor: (response) => extractCursor(response.links),
61
+ }));
@@ -12,7 +12,6 @@
12
12
  */
13
13
  import { z } from "zod";
14
14
  import type { PaginatedSdkFunction } from "../../types/functions";
15
- import type { ZapierApiError, ZapierValidationError } from "../../types/errors";
16
15
  import { AppItemSchema as AppItemSchemaBase, ListAppsResponseSchema as ListAppsResponseSchemaBase, type AppItem, type ListAppsResponse } from "@zapier/zapier-sdk-core/v0/schemas/apps";
17
16
  export { AppItemSchemaBase as AppItemSchema };
18
17
  export { ListAppsResponseSchemaBase as ListAppsResponseSchema };
@@ -38,7 +37,6 @@ export interface ListAppsPage {
38
37
  data: AppItem[];
39
38
  nextCursor?: string;
40
39
  }
41
- export type ListAppsError = ZapierApiError | ZapierValidationError;
42
40
  export interface ListAppsSdkFunction {
43
41
  listApps: PaginatedSdkFunction<ListAppsOptions | undefined, AppItem>;
44
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAA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;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;;;;;iBA8BmC,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAG7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC,eAAe,GAAG,SAAS,EAAE,OAAO,CAAC,CAAC;CACtE"}
@@ -1,23 +1,36 @@
1
- import type { Plugin } from "../../types/plugin";
2
1
  import type { ApiClient } from "../../api";
3
- import type { ClientCredentialsItem } from "@zapier/zapier-sdk-core/v0/schemas/client-credentials";
4
- import { ListClientCredentialsQuerySchema, type ListClientCredentialsOptions, type ListClientCredentialsPage } from "./schemas";
5
- import type { EventEmissionProvides } from "../eventEmission";
6
- export interface ListClientCredentialsPluginProvides {
7
- listClientCredentials: (options?: ListClientCredentialsOptions) => Promise<ListClientCredentialsPage> & AsyncIterable<ListClientCredentialsPage> & {
8
- items(): AsyncIterable<ClientCredentialsItem>;
2
+ export declare const listClientCredentialsPlugin: (sdk: {
3
+ context: {
4
+ api: ApiClient;
9
5
  };
6
+ } & {
7
+ context: import("../eventEmission").EventEmissionContext;
8
+ } & {
10
9
  context: {
11
- meta: {
12
- listClientCredentials: {
13
- inputSchema: typeof ListClientCredentialsQuerySchema;
14
- };
15
- };
10
+ meta: Record<string, import("../..").PluginMeta>;
16
11
  };
17
- }
18
- export declare const listClientCredentialsPlugin: Plugin<{
12
+ }) => {
13
+ listClientCredentials: (options?: ({
14
+ pageSize?: number | undefined;
15
+ maxItems?: number | undefined;
16
+ cursor?: string | undefined;
17
+ } & {
18
+ cursor?: string;
19
+ pageSize?: number;
20
+ maxItems?: number;
21
+ }) | undefined) => import("../..").PaginatedSdkResult<{
22
+ client_id: string;
23
+ name: string;
24
+ allowed_scopes: ("external" | "credentials")[];
25
+ created_at?: string | null | undefined;
26
+ updated_at?: string | undefined;
27
+ }>;
28
+ } & {
19
29
  context: {
20
- api: ApiClient;
30
+ meta: {
31
+ listClientCredentials: import("../..").PluginMeta;
32
+ };
21
33
  };
22
- } & EventEmissionProvides, ListClientCredentialsPluginProvides>;
34
+ };
35
+ export type ListClientCredentialsPluginProvides = ReturnType<typeof listClientCredentialsPlugin>;
23
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,EACL,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC/B,MAAM,WAAW,CAAC;AAKnB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,MAAM,WAAW,mCAAmC;IAClD,qBAAqB,EAAE,CACrB,OAAO,CAAC,EAAE,4BAA4B,KACnC,OAAO,CAAC,yBAAyB,CAAC,GACrC,aAAa,CAAC,yBAAyB,CAAC,GAAG;QACzC,KAAK,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAAC;KAC/C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,qBAAqB,EAAE;gBACrB,WAAW,EAAE,OAAO,gCAAgC,CAAC;aACtD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C;IACE,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC;KAChB,CAAC;CACH,GAAG,qBAAqB,EACzB,mCAAmC,CAyEpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAQ3C,eAAO,MAAM,2BAA2B;aACrB;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BpC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,UAAU,CAC1D,OAAO,2BAA2B,CACnC,CAAC"}
@@ -1,13 +1,18 @@
1
- import { ListClientCredentialsQuerySchema, } from "./schemas";
2
- import { createPaginatedFunction } from "../../utils/function-utils";
1
+ import { definePlugin } from "../../utils/plugin-utils";
2
+ import { createPaginatedPluginMethod } from "../../utils/plugin-utils";
3
+ import { ListClientCredentialsQuerySchema } from "./schemas";
4
+ import { extractCursor } from "../../utils/function-utils";
3
5
  import { DEFAULT_PAGE_SIZE } from "../../constants";
4
6
  import { ClientCredentialsItemSchema } from "../../schemas/ClientCredentials";
5
- import { createTelemetryCallback } from "../../utils/telemetry-utils";
6
- import { stripPageSuffix } from "../../utils/string-utils";
7
- import { ZapierAuthenticationError } from "../../types/errors";
8
- export const listClientCredentialsPlugin = (sdk) => {
9
- async function listClientCredentialsPage(options) {
10
- const { api } = sdk.context;
7
+ export const listClientCredentialsPlugin = definePlugin((sdk) => createPaginatedPluginMethod(sdk, {
8
+ name: "listClientCredentials",
9
+ categories: ["client-credentials"],
10
+ type: "list",
11
+ itemType: "ClientCredentials",
12
+ inputSchema: ListClientCredentialsQuerySchema,
13
+ outputSchema: ClientCredentialsItemSchema,
14
+ defaultPageSize: DEFAULT_PAGE_SIZE,
15
+ handler: async ({ sdk, options, }) => {
11
16
  const searchParams = {};
12
17
  if (options.pageSize !== undefined) {
13
18
  searchParams.page_size = options.pageSize.toString();
@@ -15,36 +20,11 @@ export const listClientCredentialsPlugin = (sdk) => {
15
20
  if (options.cursor) {
16
21
  searchParams.offset = options.cursor;
17
22
  }
18
- const response = await api.get("/api/v0/client-credentials", {
23
+ return sdk.context.api.get("/api/v0/client-credentials", {
19
24
  searchParams,
20
- customErrorHandler: ({ status }) => {
21
- if (status === 401) {
22
- return new ZapierAuthenticationError(`Authentication failed. Your token may not have permission to access client credentials or may be expired. (HTTP ${status})`, { statusCode: status });
23
- }
24
- if (status === 403) {
25
- return new ZapierAuthenticationError(`Access forbidden. Your token may not have the required scopes to list client credentials. (HTTP ${status})`, { statusCode: status });
26
- }
27
- return undefined;
28
- },
29
25
  authRequired: true,
30
26
  requiredScopes: ["credentials"],
31
27
  });
32
- return response;
33
- }
34
- const methodName = stripPageSuffix(listClientCredentialsPage.name);
35
- const listClientCredentialsDefinition = createPaginatedFunction(listClientCredentialsPage, ListClientCredentialsQuerySchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
36
- return {
37
- listClientCredentials: listClientCredentialsDefinition,
38
- context: {
39
- meta: {
40
- listClientCredentials: {
41
- categories: ["client-credentials"],
42
- type: "list",
43
- itemType: "ClientCredentials",
44
- inputSchema: ListClientCredentialsQuerySchema,
45
- outputSchema: ClientCredentialsItemSchema,
46
- },
47
- },
48
- },
49
- };
50
- };
28
+ },
29
+ extractCursor: (response) => extractCursor(response.links),
30
+ }));
@@ -1,7 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { PaginatedSdkFunction } from "../../types/functions";
3
3
  import type { ClientCredentialsItem } from "@zapier/zapier-sdk-core/v0/schemas/client-credentials";
4
- import type { ZapierAuthenticationError, ZapierApiError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
5
4
  export declare const ListClientCredentialsQuerySchema: z.ZodObject<{
6
5
  pageSize: z.ZodOptional<z.ZodNumber>;
7
6
  maxItems: z.ZodOptional<z.ZodNumber>;
@@ -12,7 +11,6 @@ export interface ListClientCredentialsPage {
12
11
  data: ClientCredentialsItem[];
13
12
  nextCursor?: string;
14
13
  }
15
- export type ListClientCredentialsError = ZapierAuthenticationError | ZapierApiError | ZapierValidationError | ZapierUnknownError;
16
14
  export interface ListClientCredentialsSdkFunction {
17
15
  listClientCredentials: PaginatedSdkFunction<ListClientCredentialsOptions, ClientCredentialsItem>;
18
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAEnG,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,eAAO,MAAM,gCAAgC;;;;iBAqBsB,CAAC;AAGpE,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,gCAAgC,CACxC,CAAC;AAGF,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,qBAAqB,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,0BAA0B,GAClC,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,gCAAgC;IAC/C,qBAAqB,EAAE,oBAAoB,CACzC,4BAA4B,EAC5B,qBAAqB,CACtB,CAAC;CACH"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAEnG,eAAO,MAAM,gCAAgC;;;;iBAqBsB,CAAC;AAGpE,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,gCAAgC,CACxC,CAAC;AAGF,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,qBAAqB,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,gCAAgC;IAC/C,qBAAqB,EAAE,oBAAoB,CACzC,4BAA4B,EAC5B,qBAAqB,CACtB,CAAC;CACH"}
@@ -1,28 +1,106 @@
1
- import type { Plugin } from "../../types/plugin";
2
1
  import type { ApiClient } from "../../api";
3
- import type { ConnectionItem } from "@zapier/zapier-sdk-core/v0/schemas/connections";
4
- import { ListConnectionsQuerySchema, type ListConnectionsOptions, type ListConnectionsPage } from "./schemas";
5
2
  import type { GetVersionedImplementationId } from "../manifest/schemas";
6
- import type { ManifestPluginProvides } from "../manifest";
7
- import type { EventEmissionProvides } from "../eventEmission";
8
3
  import type { CapabilitiesContext } from "../capabilities";
9
4
  import type { ConnectionsPluginProvides } from "../connections";
10
- export interface ListConnectionsPluginProvides {
11
- listConnections: (options?: ListConnectionsOptions) => Promise<ListConnectionsPage> & AsyncIterable<ListConnectionsPage> & {
12
- items(): AsyncIterable<ConnectionItem>;
13
- };
5
+ export declare const listConnectionsPlugin: (sdk: {
14
6
  context: {
15
- meta: {
16
- listConnections: {
17
- inputSchema: typeof ListConnectionsQuerySchema;
18
- };
19
- };
7
+ getResolvedManifest: () => Promise<import("../manifest").Manifest | null>;
8
+ getVersionedImplementationId: (appKey: string) => Promise<string | null>;
9
+ resolveAppKeys: ({ appKeys }: {
10
+ appKeys: string[];
11
+ }) => Promise<import("../..").ResolvedAppLocator[]>;
12
+ updateManifestEntry: (options: import("../manifest").UpdateManifestEntryOptions) => Promise<import("../manifest").UpdateManifestEntryResult>;
13
+ addActionEntry: (options: import("../manifest").AddActionEntryOptions) => Promise<import("../manifest").AddActionEntryResult>;
14
+ findActionEntry: ({ name, manifest, }: {
15
+ name: string;
16
+ manifest: import("../manifest").Manifest;
17
+ }) => import("../manifest").ActionEntry | null;
18
+ listActionEntries: ({ configPath, }?: {
19
+ configPath?: string;
20
+ }) => Promise<Array<[string, import("../manifest").ActionEntry]>>;
21
+ deleteActionEntry: ({ name, configPath, skipWrite, }: {
22
+ name: string;
23
+ configPath?: string;
24
+ skipWrite?: boolean;
25
+ }) => Promise<import("../manifest").Manifest>;
26
+ hasActionEntry: ({ name, manifest, }: {
27
+ name: string;
28
+ manifest: import("../manifest").Manifest;
29
+ }) => boolean;
30
+ findManifestEntry: typeof import("../manifest").findManifestEntry;
31
+ readManifestFromFile: typeof import("../manifest").readManifestFromFile;
32
+ getManifestConnections: () => Promise<Record<string, {
33
+ connectionId: string | number;
34
+ }> | null>;
20
35
  };
21
- }
22
- export declare const listConnectionsPlugin: Plugin<ManifestPluginProvides & {
36
+ } & {
23
37
  context: {
24
38
  api: ApiClient;
25
39
  getVersionedImplementationId: GetVersionedImplementationId;
26
40
  } & CapabilitiesContext & ConnectionsPluginProvides["context"];
27
- } & EventEmissionProvides, ListConnectionsPluginProvides>;
41
+ } & {
42
+ context: import("../eventEmission").EventEmissionContext;
43
+ } & {
44
+ context: {
45
+ meta: Record<string, import("../..").PluginMeta>;
46
+ };
47
+ }) => {
48
+ listConnections: (options?: ({
49
+ title?: string | undefined;
50
+ search?: string | undefined;
51
+ owner?: string | undefined;
52
+ app?: string | undefined;
53
+ appKey?: string | undefined;
54
+ connections?: string[] | undefined;
55
+ connectionIds?: string[] | undefined;
56
+ authenticationIds?: string[] | undefined;
57
+ account?: string | undefined;
58
+ accountId?: string | undefined;
59
+ includeShared?: boolean | undefined;
60
+ isExpired?: boolean | undefined;
61
+ expired?: boolean | undefined;
62
+ pageSize?: number | undefined;
63
+ maxItems?: number | undefined;
64
+ cursor?: string | undefined;
65
+ } & {
66
+ cursor?: string;
67
+ pageSize?: number;
68
+ maxItems?: number;
69
+ }) | undefined) => import("../..").PaginatedSdkResult<{
70
+ date: string;
71
+ is_invite_only: boolean;
72
+ is_private: boolean;
73
+ shared_with_all: boolean;
74
+ id: string;
75
+ account_id: string;
76
+ title?: string | null | undefined;
77
+ lastchanged?: string | undefined;
78
+ destination_selected_api?: string | null | undefined;
79
+ is_stale?: string | undefined;
80
+ is_shared?: string | undefined;
81
+ marked_stale_at?: string | null | undefined;
82
+ label?: string | null | undefined;
83
+ identifier?: string | null | undefined;
84
+ url?: string | undefined;
85
+ groups?: Record<string, unknown>[] | undefined;
86
+ members?: string | undefined;
87
+ permissions?: Record<string, boolean> | undefined;
88
+ public_id?: string | undefined;
89
+ account_public_id?: string | undefined;
90
+ customuser_public_id?: string | undefined;
91
+ implementation_id?: string | undefined;
92
+ profile_id?: string | undefined;
93
+ is_expired?: string | undefined;
94
+ expired_at?: string | null | undefined;
95
+ app_key?: string | undefined;
96
+ app_version?: string | undefined;
97
+ }>;
98
+ } & {
99
+ context: {
100
+ meta: {
101
+ listConnections: import("../..").PluginMeta;
102
+ };
103
+ };
104
+ };
105
+ export type ListConnectionsPluginProvides = ReturnType<typeof listConnectionsPlugin>;
28
106
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listConnections/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EACL,0BAA0B,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACzB,MAAM,WAAW,CAAC;AASnB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAG1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;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