@zapier/zapier-sdk-core 0.7.1 → 0.8.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.
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/v0/schemas/connections.ts
21
+ var connections_exports = {};
22
+ __export(connections_exports, {
23
+ ConnectionItemSchema: () => ConnectionItemSchema,
24
+ ConnectionSchema: () => ConnectionSchema,
25
+ ConnectionsResponseSchema: () => ConnectionsResponseSchema,
26
+ GetConnectionParamSchema: () => GetConnectionParamSchema,
27
+ ListConnectionsQuerySchema: () => ListConnectionsQuerySchema,
28
+ ListConnectionsResponseSchema: () => ListConnectionsResponseSchema
29
+ });
30
+ module.exports = __toCommonJS(connections_exports);
31
+ var import_zod = require("zod");
32
+ var ConnectionSchema = import_zod.z.object({
33
+ id: import_zod.z.number().describe("Unique identifier for the connection"),
34
+ date: import_zod.z.string().describe("Date created"),
35
+ lastchanged: import_zod.z.string().optional().describe("Date last changed"),
36
+ account_id: import_zod.z.number().describe("Account ID associated with this connection"),
37
+ customuser_id: import_zod.z.number().optional().describe("Custom user ID (if applicable)"),
38
+ selected_api: import_zod.z.string().describe("Selected API key (internal identifier)"),
39
+ destination_selected_api: import_zod.z.string().nullable().optional().describe("Destination API key (if applicable)"),
40
+ is_invite_only: import_zod.z.boolean().describe("Whether the connection is invite-only"),
41
+ is_private: import_zod.z.boolean().describe("Whether the connection is private"),
42
+ shared_with_all: import_zod.z.boolean().describe("Whether the connection is shared with all users"),
43
+ is_stale: import_zod.z.string().optional().describe("Stale status string"),
44
+ is_shared: import_zod.z.string().optional().describe("Shared status string"),
45
+ marked_stale_at: import_zod.z.string().nullable().optional().describe("Date when marked stale"),
46
+ label: import_zod.z.string().nullable().optional().describe("User label for the connection"),
47
+ identifier: import_zod.z.string().nullable().optional().describe("Identifier"),
48
+ title: import_zod.z.string().nullable().optional().describe("Title of the connection"),
49
+ url: import_zod.z.string().optional().describe("URL to the connection resource"),
50
+ groups: import_zod.z.array(
51
+ import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).describe("Groups associated with the connection")
52
+ ).optional().describe("Array of groups associated with the connection"),
53
+ members: import_zod.z.string().optional().describe("Members associated with the connection"),
54
+ permissions: import_zod.z.record(import_zod.z.string(), import_zod.z.boolean()).optional().describe("Permissions for the connection")
55
+ });
56
+ var ConnectionItemSchema = ConnectionSchema.omit({
57
+ selected_api: true,
58
+ customuser_id: true
59
+ }).extend({
60
+ // Override numeric IDs with string versions (converted by normalizeConnectionItem)
61
+ id: import_zod.z.string().describe("Unique identifier for the connection"),
62
+ account_id: import_zod.z.string().describe("Account ID associated with this connection"),
63
+ // Renamed fields
64
+ implementation_id: import_zod.z.string().optional().describe("Implementation ID (was selected_api)"),
65
+ profile_id: import_zod.z.string().optional().describe("Profile ID (was customuser_id)"),
66
+ // Mapped fields (originals preserved in ...restOfAuth)
67
+ is_expired: import_zod.z.string().optional().describe("Whether the connection is expired (mapped from is_stale)"),
68
+ expired_at: import_zod.z.string().nullable().optional().describe("Date when connection expired (mapped from marked_stale_at)"),
69
+ // Computed fields
70
+ app_key: import_zod.z.string().optional().describe("App Key extracted from implementation_id"),
71
+ app_version: import_zod.z.string().optional().describe("App Version extracted from implementation_id")
72
+ });
73
+ var ConnectionsResponseSchema = import_zod.z.object({
74
+ count: import_zod.z.number().describe("Total number of items"),
75
+ next: import_zod.z.string().nullable().optional().describe("Cursor for the next page of results (if available)"),
76
+ previous: import_zod.z.string().nullable().optional().describe("Cursor for the previous page of results (if available)"),
77
+ results: import_zod.z.array(ConnectionSchema).describe("Array of connection items")
78
+ });
79
+ var GetConnectionParamSchema = import_zod.z.object({
80
+ connectionId: import_zod.z.string().describe("Connection ID to retrieve")
81
+ }).describe("Get a specific connection by ID");
82
+ var ListConnectionsQuerySchema = import_zod.z.object({
83
+ app_key: import_zod.z.string().optional().describe(
84
+ "Filter connections by app key (e.g., 'SlackCLIAPI' or slug like 'github')"
85
+ ),
86
+ connection_ids: import_zod.z.string().optional().describe("Comma-separated list of connection IDs to filter by"),
87
+ search: import_zod.z.string().optional().describe("Search term to filter connections by title"),
88
+ title: import_zod.z.string().optional().describe(
89
+ "Filter connections by exact title match (searches first, then filters locally)"
90
+ ),
91
+ account_id: import_zod.z.string().optional().describe("Filter connections by account ID"),
92
+ owner: import_zod.z.string().optional().describe(
93
+ "Filter by owner, 'me' for your own connections or a specific user ID"
94
+ ),
95
+ is_expired: import_zod.z.boolean().optional().describe(
96
+ "Filter by expired status (true = expired only, false = non-expired only)"
97
+ ),
98
+ page_size: import_zod.z.number().min(1).optional().describe("Number of connections per page"),
99
+ offset: import_zod.z.string().optional().describe("Pagination offset from previous response")
100
+ }).describe("Query parameters for listing connections");
101
+ var ListConnectionsResponseSchema = import_zod.z.object({
102
+ data: import_zod.z.array(ConnectionItemSchema).describe("Array of connection items"),
103
+ links: import_zod.z.object({
104
+ next: import_zod.z.string().nullable().optional().describe(
105
+ "Fully qualified URL for the next page of results (if available), e.g. https://sdkapi.zapier.com/api/v0/connections?offset=100&page_size=50"
106
+ )
107
+ }).describe("Pagination links for navigating through results"),
108
+ meta: import_zod.z.object({
109
+ count: import_zod.z.number().describe("Total number of items"),
110
+ limit: import_zod.z.number().describe("Number of items per page"),
111
+ offset: import_zod.z.number().describe("Offset of the current page")
112
+ }).describe("Metadata for the paginated result set")
113
+ }).describe("Response schema for listing connections");
114
+ // Annotate the CommonJS export names for ESM import in node:
115
+ 0 && (module.exports = {
116
+ ConnectionItemSchema,
117
+ ConnectionSchema,
118
+ ConnectionsResponseSchema,
119
+ GetConnectionParamSchema,
120
+ ListConnectionsQuerySchema,
121
+ ListConnectionsResponseSchema
122
+ });
123
+ //# sourceMappingURL=connections.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/v0/schemas/connections.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Base Connection schema matching the API response\n * (internally uses the same v4 authentications API)\n */\nexport const ConnectionSchema = z.object({\n id: z.number().describe(\"Unique identifier for the connection\"),\n date: z.string().describe(\"Date created\"),\n lastchanged: z.string().optional().describe(\"Date last changed\"),\n account_id: z.number().describe(\"Account ID associated with this connection\"),\n customuser_id: z\n .number()\n .optional()\n .describe(\"Custom user ID (if applicable)\"),\n selected_api: z.string().describe(\"Selected API key (internal identifier)\"),\n destination_selected_api: z\n .string()\n .nullable()\n .optional()\n .describe(\"Destination API key (if applicable)\"),\n is_invite_only: z.boolean().describe(\"Whether the connection is invite-only\"),\n is_private: z.boolean().describe(\"Whether the connection is private\"),\n shared_with_all: z\n .boolean()\n .describe(\"Whether the connection is shared with all users\"),\n is_stale: z.string().optional().describe(\"Stale status string\"),\n is_shared: z.string().optional().describe(\"Shared status string\"),\n marked_stale_at: z\n .string()\n .nullable()\n .optional()\n .describe(\"Date when marked stale\"),\n label: z\n .string()\n .nullable()\n .optional()\n .describe(\"User label for the connection\"),\n identifier: z.string().nullable().optional().describe(\"Identifier\"),\n title: z.string().nullable().optional().describe(\"Title of the connection\"),\n url: z.string().optional().describe(\"URL to the connection resource\"),\n groups: z\n .array(\n z\n .record(z.string(), z.unknown())\n .describe(\"Groups associated with the connection\"),\n )\n .optional()\n .describe(\"Array of groups associated with the connection\"),\n members: z\n .string()\n .optional()\n .describe(\"Members associated with the connection\"),\n permissions: z\n .record(z.string(), z.boolean())\n .optional()\n .describe(\"Permissions for the connection\"),\n});\n\n/**\n * Normalized connection item returned by getConnection handler\n *\n * Transforms API response fields:\n * - selected_api → implementation_id\n * - customuser_id → profile_id\n * - is_stale → is_expired (preserved as is_stale too)\n * - marked_stale_at → expired_at (preserved as marked_stale_at too)\n *\n * Adds computed fields:\n * - app_key: Extracted from selected_api (e.g., \"SlackCLIAPI@1.0.0\" → \"SlackCLIAPI\")\n * - app_version: Extracted from selected_api (e.g., \"SlackCLIAPI@1.0.0\" → \"1.0.0\")\n */\nexport const ConnectionItemSchema = ConnectionSchema.omit({\n selected_api: true,\n customuser_id: true,\n}).extend({\n // Override numeric IDs with string versions (converted by normalizeConnectionItem)\n id: z.string().describe(\"Unique identifier for the connection\"),\n account_id: z.string().describe(\"Account ID associated with this connection\"),\n\n // Renamed fields\n implementation_id: z\n .string()\n .optional()\n .describe(\"Implementation ID (was selected_api)\"),\n profile_id: z.string().optional().describe(\"Profile ID (was customuser_id)\"),\n\n // Mapped fields (originals preserved in ...restOfAuth)\n is_expired: z\n .string()\n .optional()\n .describe(\"Whether the connection is expired (mapped from is_stale)\"),\n expired_at: z\n .string()\n .nullable()\n .optional()\n .describe(\"Date when connection expired (mapped from marked_stale_at)\"),\n\n // Computed fields\n app_key: z\n .string()\n .optional()\n .describe(\"App Key extracted from implementation_id\"),\n app_version: z\n .string()\n .optional()\n .describe(\"App Version extracted from implementation_id\"),\n});\n\nexport const ConnectionsResponseSchema = z.object({\n count: z.number().describe(\"Total number of items\"),\n next: z\n .string()\n .nullable()\n .optional()\n .describe(\"Cursor for the next page of results (if available)\"),\n previous: z\n .string()\n .nullable()\n .optional()\n .describe(\"Cursor for the previous page of results (if available)\"),\n results: z.array(ConnectionSchema).describe(\"Array of connection items\"),\n});\n\nexport type Connection = z.infer<typeof ConnectionSchema>;\nexport type ConnectionItem = z.infer<typeof ConnectionItemSchema>;\nexport type ConnectionsResponse = z.infer<typeof ConnectionsResponseSchema>;\n\n/**\n * Path parameters schema for getConnection endpoint.\n */\nexport const GetConnectionParamSchema = z\n .object({\n connectionId: z.string().describe(\"Connection ID to retrieve\"),\n })\n .describe(\"Get a specific connection by ID\");\n\nexport type GetConnectionParam = z.infer<typeof GetConnectionParamSchema>;\n\n/**\n * Response type for getConnection endpoint.\n * Wraps ConnectionItem in the standard API response envelope.\n */\nexport type GetConnectionResponse = { data: ConnectionItem };\n\n/**\n * Query parameters for listing connections\n */\nexport const ListConnectionsQuerySchema = z\n .object({\n app_key: z\n .string()\n .optional()\n .describe(\n \"Filter connections by app key (e.g., 'SlackCLIAPI' or slug like 'github')\",\n ),\n connection_ids: z\n .string()\n .optional()\n .describe(\"Comma-separated list of connection IDs to filter by\"),\n search: z\n .string()\n .optional()\n .describe(\"Search term to filter connections by title\"),\n title: z\n .string()\n .optional()\n .describe(\n \"Filter connections by exact title match (searches first, then filters locally)\",\n ),\n account_id: z\n .string()\n .optional()\n .describe(\"Filter connections by account ID\"),\n owner: z\n .string()\n .optional()\n .describe(\n \"Filter by owner, 'me' for your own connections or a specific user ID\",\n ),\n is_expired: z\n .boolean()\n .optional()\n .describe(\n \"Filter by expired status (true = expired only, false = non-expired only)\",\n ),\n page_size: z\n .number()\n .min(1)\n .optional()\n .describe(\"Number of connections per page\"),\n offset: z\n .string()\n .optional()\n .describe(\"Pagination offset from previous response\"),\n })\n .describe(\"Query parameters for listing connections\");\n\n/**\n * Response schema for listConnections\n */\nexport const ListConnectionsResponseSchema = z\n .object({\n data: z.array(ConnectionItemSchema).describe(\"Array of connection items\"),\n links: z\n .object({\n next: z\n .string()\n .nullable()\n .optional()\n .describe(\n \"Fully qualified URL for the next page of results (if available), e.g. https://sdkapi.zapier.com/api/v0/connections?offset=100&page_size=50\",\n ),\n })\n .describe(\"Pagination links for navigating through results\"),\n meta: z\n .object({\n count: z.number().describe(\"Total number of items\"),\n limit: z.number().describe(\"Number of items per page\"),\n offset: z.number().describe(\"Offset of the current page\"),\n })\n .describe(\"Metadata for the paginated result set\"),\n })\n .describe(\"Response schema for listing connections\");\n\n/**\n * TypeScript types for request and response\n */\nexport type ListConnectionsQuery = z.infer<typeof ListConnectionsQuerySchema>;\nexport type ListConnectionsResponse = z.infer<\n typeof ListConnectionsResponseSchema\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAMX,IAAM,mBAAmB,aAAE,OAAO;AAAA,EACvC,IAAI,aAAE,OAAO,EAAE,SAAS,sCAAsC;AAAA,EAC9D,MAAM,aAAE,OAAO,EAAE,SAAS,cAAc;AAAA,EACxC,aAAa,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mBAAmB;AAAA,EAC/D,YAAY,aAAE,OAAO,EAAE,SAAS,4CAA4C;AAAA,EAC5E,eAAe,aACZ,OAAO,EACP,SAAS,EACT,SAAS,gCAAgC;AAAA,EAC5C,cAAc,aAAE,OAAO,EAAE,SAAS,wCAAwC;AAAA,EAC1E,0BAA0B,aACvB,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,qCAAqC;AAAA,EACjD,gBAAgB,aAAE,QAAQ,EAAE,SAAS,uCAAuC;AAAA,EAC5E,YAAY,aAAE,QAAQ,EAAE,SAAS,mCAAmC;AAAA,EACpE,iBAAiB,aACd,QAAQ,EACR,SAAS,iDAAiD;AAAA,EAC7D,UAAU,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,qBAAqB;AAAA,EAC9D,WAAW,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,sBAAsB;AAAA,EAChE,iBAAiB,aACd,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,wBAAwB;AAAA,EACpC,OAAO,aACJ,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,+BAA+B;AAAA,EAC3C,YAAY,aAAE,OA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AAS,uBAAuB;AAAA,IAClD,OAAO,aAAE,OAAO,EAAE,SAAS,0BAA0B;AAAA,IACrD,QAAQ,aAAE,OAAO,EAAE,SAAS,4BAA4B;AAAA,EAC1D,CAAC,EACA,SAAS,uCAAuC;AACrD,CAAC,EACA,SAAS,yCAAyC;","names":[]}
@@ -0,0 +1,171 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Base Connection schema matching the API response
5
+ * (internally uses the same v4 authentications API)
6
+ */
7
+ declare const ConnectionSchema: z.ZodObject<{
8
+ id: z.ZodNumber;
9
+ date: z.ZodString;
10
+ lastchanged: z.ZodOptional<z.ZodString>;
11
+ account_id: z.ZodNumber;
12
+ customuser_id: z.ZodOptional<z.ZodNumber>;
13
+ selected_api: z.ZodString;
14
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ is_invite_only: z.ZodBoolean;
16
+ is_private: z.ZodBoolean;
17
+ shared_with_all: z.ZodBoolean;
18
+ is_stale: z.ZodOptional<z.ZodString>;
19
+ is_shared: z.ZodOptional<z.ZodString>;
20
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ url: z.ZodOptional<z.ZodString>;
25
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
26
+ members: z.ZodOptional<z.ZodString>;
27
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
28
+ }, z.core.$strip>;
29
+ /**
30
+ * Normalized connection item returned by getConnection handler
31
+ *
32
+ * Transforms API response fields:
33
+ * - selected_api → implementation_id
34
+ * - customuser_id → profile_id
35
+ * - is_stale → is_expired (preserved as is_stale too)
36
+ * - marked_stale_at → expired_at (preserved as marked_stale_at too)
37
+ *
38
+ * Adds computed fields:
39
+ * - app_key: Extracted from selected_api (e.g., "SlackCLIAPI@1.0.0" → "SlackCLIAPI")
40
+ * - app_version: Extracted from selected_api (e.g., "SlackCLIAPI@1.0.0" → "1.0.0")
41
+ */
42
+ declare const ConnectionItemSchema: z.ZodObject<{
43
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ date: z.ZodString;
45
+ is_invite_only: z.ZodBoolean;
46
+ lastchanged: z.ZodOptional<z.ZodString>;
47
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
+ is_private: z.ZodBoolean;
49
+ shared_with_all: z.ZodBoolean;
50
+ is_stale: z.ZodOptional<z.ZodString>;
51
+ is_shared: z.ZodOptional<z.ZodString>;
52
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ url: z.ZodOptional<z.ZodString>;
56
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
57
+ members: z.ZodOptional<z.ZodString>;
58
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
59
+ id: z.ZodString;
60
+ account_id: z.ZodString;
61
+ implementation_id: z.ZodOptional<z.ZodString>;
62
+ profile_id: z.ZodOptional<z.ZodString>;
63
+ is_expired: z.ZodOptional<z.ZodString>;
64
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ app_key: z.ZodOptional<z.ZodString>;
66
+ app_version: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>;
68
+ declare const ConnectionsResponseSchema: z.ZodObject<{
69
+ count: z.ZodNumber;
70
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ previous: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
+ results: z.ZodArray<z.ZodObject<{
73
+ id: z.ZodNumber;
74
+ date: z.ZodString;
75
+ lastchanged: z.ZodOptional<z.ZodString>;
76
+ account_id: z.ZodNumber;
77
+ customuser_id: z.ZodOptional<z.ZodNumber>;
78
+ selected_api: z.ZodString;
79
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
+ is_invite_only: z.ZodBoolean;
81
+ is_private: z.ZodBoolean;
82
+ shared_with_all: z.ZodBoolean;
83
+ is_stale: z.ZodOptional<z.ZodString>;
84
+ is_shared: z.ZodOptional<z.ZodString>;
85
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
+ url: z.ZodOptional<z.ZodString>;
90
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
91
+ members: z.ZodOptional<z.ZodString>;
92
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
93
+ }, z.core.$strip>>;
94
+ }, z.core.$strip>;
95
+ type Connection = z.infer<typeof ConnectionSchema>;
96
+ type ConnectionItem = z.infer<typeof ConnectionItemSchema>;
97
+ type ConnectionsResponse = z.infer<typeof ConnectionsResponseSchema>;
98
+ /**
99
+ * Path parameters schema for getConnection endpoint.
100
+ */
101
+ declare const GetConnectionParamSchema: z.ZodObject<{
102
+ connectionId: z.ZodString;
103
+ }, z.core.$strip>;
104
+ type GetConnectionParam = z.infer<typeof GetConnectionParamSchema>;
105
+ /**
106
+ * Response type for getConnection endpoint.
107
+ * Wraps ConnectionItem in the standard API response envelope.
108
+ */
109
+ type GetConnectionResponse = {
110
+ data: ConnectionItem;
111
+ };
112
+ /**
113
+ * Query parameters for listing connections
114
+ */
115
+ declare const ListConnectionsQuerySchema: z.ZodObject<{
116
+ app_key: z.ZodOptional<z.ZodString>;
117
+ connection_ids: z.ZodOptional<z.ZodString>;
118
+ search: z.ZodOptional<z.ZodString>;
119
+ title: z.ZodOptional<z.ZodString>;
120
+ account_id: z.ZodOptional<z.ZodString>;
121
+ owner: z.ZodOptional<z.ZodString>;
122
+ is_expired: z.ZodOptional<z.ZodBoolean>;
123
+ page_size: z.ZodOptional<z.ZodNumber>;
124
+ offset: z.ZodOptional<z.ZodString>;
125
+ }, z.core.$strip>;
126
+ /**
127
+ * Response schema for listConnections
128
+ */
129
+ declare const ListConnectionsResponseSchema: z.ZodObject<{
130
+ data: z.ZodArray<z.ZodObject<{
131
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
132
+ date: z.ZodString;
133
+ is_invite_only: z.ZodBoolean;
134
+ lastchanged: z.ZodOptional<z.ZodString>;
135
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
+ is_private: z.ZodBoolean;
137
+ shared_with_all: z.ZodBoolean;
138
+ is_stale: z.ZodOptional<z.ZodString>;
139
+ is_shared: z.ZodOptional<z.ZodString>;
140
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
+ url: z.ZodOptional<z.ZodString>;
144
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
145
+ members: z.ZodOptional<z.ZodString>;
146
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
147
+ id: z.ZodString;
148
+ account_id: z.ZodString;
149
+ implementation_id: z.ZodOptional<z.ZodString>;
150
+ profile_id: z.ZodOptional<z.ZodString>;
151
+ is_expired: z.ZodOptional<z.ZodString>;
152
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
153
+ app_key: z.ZodOptional<z.ZodString>;
154
+ app_version: z.ZodOptional<z.ZodString>;
155
+ }, z.core.$strip>>;
156
+ links: z.ZodObject<{
157
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
158
+ }, z.core.$strip>;
159
+ meta: z.ZodObject<{
160
+ count: z.ZodNumber;
161
+ limit: z.ZodNumber;
162
+ offset: z.ZodNumber;
163
+ }, z.core.$strip>;
164
+ }, z.core.$strip>;
165
+ /**
166
+ * TypeScript types for request and response
167
+ */
168
+ type ListConnectionsQuery = z.infer<typeof ListConnectionsQuerySchema>;
169
+ type ListConnectionsResponse = z.infer<typeof ListConnectionsResponseSchema>;
170
+
171
+ export { type Connection, type ConnectionItem, ConnectionItemSchema, ConnectionSchema, type ConnectionsResponse, ConnectionsResponseSchema, type GetConnectionParam, GetConnectionParamSchema, type GetConnectionResponse, type ListConnectionsQuery, ListConnectionsQuerySchema, type ListConnectionsResponse, ListConnectionsResponseSchema };
@@ -0,0 +1,171 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Base Connection schema matching the API response
5
+ * (internally uses the same v4 authentications API)
6
+ */
7
+ declare const ConnectionSchema: z.ZodObject<{
8
+ id: z.ZodNumber;
9
+ date: z.ZodString;
10
+ lastchanged: z.ZodOptional<z.ZodString>;
11
+ account_id: z.ZodNumber;
12
+ customuser_id: z.ZodOptional<z.ZodNumber>;
13
+ selected_api: z.ZodString;
14
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ is_invite_only: z.ZodBoolean;
16
+ is_private: z.ZodBoolean;
17
+ shared_with_all: z.ZodBoolean;
18
+ is_stale: z.ZodOptional<z.ZodString>;
19
+ is_shared: z.ZodOptional<z.ZodString>;
20
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ url: z.ZodOptional<z.ZodString>;
25
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
26
+ members: z.ZodOptional<z.ZodString>;
27
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
28
+ }, z.core.$strip>;
29
+ /**
30
+ * Normalized connection item returned by getConnection handler
31
+ *
32
+ * Transforms API response fields:
33
+ * - selected_api → implementation_id
34
+ * - customuser_id → profile_id
35
+ * - is_stale → is_expired (preserved as is_stale too)
36
+ * - marked_stale_at → expired_at (preserved as marked_stale_at too)
37
+ *
38
+ * Adds computed fields:
39
+ * - app_key: Extracted from selected_api (e.g., "SlackCLIAPI@1.0.0" → "SlackCLIAPI")
40
+ * - app_version: Extracted from selected_api (e.g., "SlackCLIAPI@1.0.0" → "1.0.0")
41
+ */
42
+ declare const ConnectionItemSchema: z.ZodObject<{
43
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ date: z.ZodString;
45
+ is_invite_only: z.ZodBoolean;
46
+ lastchanged: z.ZodOptional<z.ZodString>;
47
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
+ is_private: z.ZodBoolean;
49
+ shared_with_all: z.ZodBoolean;
50
+ is_stale: z.ZodOptional<z.ZodString>;
51
+ is_shared: z.ZodOptional<z.ZodString>;
52
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ url: z.ZodOptional<z.ZodString>;
56
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
57
+ members: z.ZodOptional<z.ZodString>;
58
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
59
+ id: z.ZodString;
60
+ account_id: z.ZodString;
61
+ implementation_id: z.ZodOptional<z.ZodString>;
62
+ profile_id: z.ZodOptional<z.ZodString>;
63
+ is_expired: z.ZodOptional<z.ZodString>;
64
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ app_key: z.ZodOptional<z.ZodString>;
66
+ app_version: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>;
68
+ declare const ConnectionsResponseSchema: z.ZodObject<{
69
+ count: z.ZodNumber;
70
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ previous: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
+ results: z.ZodArray<z.ZodObject<{
73
+ id: z.ZodNumber;
74
+ date: z.ZodString;
75
+ lastchanged: z.ZodOptional<z.ZodString>;
76
+ account_id: z.ZodNumber;
77
+ customuser_id: z.ZodOptional<z.ZodNumber>;
78
+ selected_api: z.ZodString;
79
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
+ is_invite_only: z.ZodBoolean;
81
+ is_private: z.ZodBoolean;
82
+ shared_with_all: z.ZodBoolean;
83
+ is_stale: z.ZodOptional<z.ZodString>;
84
+ is_shared: z.ZodOptional<z.ZodString>;
85
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
+ url: z.ZodOptional<z.ZodString>;
90
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
91
+ members: z.ZodOptional<z.ZodString>;
92
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
93
+ }, z.core.$strip>>;
94
+ }, z.core.$strip>;
95
+ type Connection = z.infer<typeof ConnectionSchema>;
96
+ type ConnectionItem = z.infer<typeof ConnectionItemSchema>;
97
+ type ConnectionsResponse = z.infer<typeof ConnectionsResponseSchema>;
98
+ /**
99
+ * Path parameters schema for getConnection endpoint.
100
+ */
101
+ declare const GetConnectionParamSchema: z.ZodObject<{
102
+ connectionId: z.ZodString;
103
+ }, z.core.$strip>;
104
+ type GetConnectionParam = z.infer<typeof GetConnectionParamSchema>;
105
+ /**
106
+ * Response type for getConnection endpoint.
107
+ * Wraps ConnectionItem in the standard API response envelope.
108
+ */
109
+ type GetConnectionResponse = {
110
+ data: ConnectionItem;
111
+ };
112
+ /**
113
+ * Query parameters for listing connections
114
+ */
115
+ declare const ListConnectionsQuerySchema: z.ZodObject<{
116
+ app_key: z.ZodOptional<z.ZodString>;
117
+ connection_ids: z.ZodOptional<z.ZodString>;
118
+ search: z.ZodOptional<z.ZodString>;
119
+ title: z.ZodOptional<z.ZodString>;
120
+ account_id: z.ZodOptional<z.ZodString>;
121
+ owner: z.ZodOptional<z.ZodString>;
122
+ is_expired: z.ZodOptional<z.ZodBoolean>;
123
+ page_size: z.ZodOptional<z.ZodNumber>;
124
+ offset: z.ZodOptional<z.ZodString>;
125
+ }, z.core.$strip>;
126
+ /**
127
+ * Response schema for listConnections
128
+ */
129
+ declare const ListConnectionsResponseSchema: z.ZodObject<{
130
+ data: z.ZodArray<z.ZodObject<{
131
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
132
+ date: z.ZodString;
133
+ is_invite_only: z.ZodBoolean;
134
+ lastchanged: z.ZodOptional<z.ZodString>;
135
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
+ is_private: z.ZodBoolean;
137
+ shared_with_all: z.ZodBoolean;
138
+ is_stale: z.ZodOptional<z.ZodString>;
139
+ is_shared: z.ZodOptional<z.ZodString>;
140
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
+ url: z.ZodOptional<z.ZodString>;
144
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
145
+ members: z.ZodOptional<z.ZodString>;
146
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
147
+ id: z.ZodString;
148
+ account_id: z.ZodString;
149
+ implementation_id: z.ZodOptional<z.ZodString>;
150
+ profile_id: z.ZodOptional<z.ZodString>;
151
+ is_expired: z.ZodOptional<z.ZodString>;
152
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
153
+ app_key: z.ZodOptional<z.ZodString>;
154
+ app_version: z.ZodOptional<z.ZodString>;
155
+ }, z.core.$strip>>;
156
+ links: z.ZodObject<{
157
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
158
+ }, z.core.$strip>;
159
+ meta: z.ZodObject<{
160
+ count: z.ZodNumber;
161
+ limit: z.ZodNumber;
162
+ offset: z.ZodNumber;
163
+ }, z.core.$strip>;
164
+ }, z.core.$strip>;
165
+ /**
166
+ * TypeScript types for request and response
167
+ */
168
+ type ListConnectionsQuery = z.infer<typeof ListConnectionsQuerySchema>;
169
+ type ListConnectionsResponse = z.infer<typeof ListConnectionsResponseSchema>;
170
+
171
+ export { type Connection, type ConnectionItem, ConnectionItemSchema, ConnectionSchema, type ConnectionsResponse, ConnectionsResponseSchema, type GetConnectionParam, GetConnectionParamSchema, type GetConnectionResponse, type ListConnectionsQuery, ListConnectionsQuerySchema, type ListConnectionsResponse, ListConnectionsResponseSchema };
@@ -0,0 +1,93 @@
1
+ // src/v0/schemas/connections.ts
2
+ import { z } from "zod";
3
+ var ConnectionSchema = z.object({
4
+ id: z.number().describe("Unique identifier for the connection"),
5
+ date: z.string().describe("Date created"),
6
+ lastchanged: z.string().optional().describe("Date last changed"),
7
+ account_id: z.number().describe("Account ID associated with this connection"),
8
+ customuser_id: z.number().optional().describe("Custom user ID (if applicable)"),
9
+ selected_api: z.string().describe("Selected API key (internal identifier)"),
10
+ destination_selected_api: z.string().nullable().optional().describe("Destination API key (if applicable)"),
11
+ is_invite_only: z.boolean().describe("Whether the connection is invite-only"),
12
+ is_private: z.boolean().describe("Whether the connection is private"),
13
+ shared_with_all: z.boolean().describe("Whether the connection is shared with all users"),
14
+ is_stale: z.string().optional().describe("Stale status string"),
15
+ is_shared: z.string().optional().describe("Shared status string"),
16
+ marked_stale_at: z.string().nullable().optional().describe("Date when marked stale"),
17
+ label: z.string().nullable().optional().describe("User label for the connection"),
18
+ identifier: z.string().nullable().optional().describe("Identifier"),
19
+ title: z.string().nullable().optional().describe("Title of the connection"),
20
+ url: z.string().optional().describe("URL to the connection resource"),
21
+ groups: z.array(
22
+ z.record(z.string(), z.unknown()).describe("Groups associated with the connection")
23
+ ).optional().describe("Array of groups associated with the connection"),
24
+ members: z.string().optional().describe("Members associated with the connection"),
25
+ permissions: z.record(z.string(), z.boolean()).optional().describe("Permissions for the connection")
26
+ });
27
+ var ConnectionItemSchema = ConnectionSchema.omit({
28
+ selected_api: true,
29
+ customuser_id: true
30
+ }).extend({
31
+ // Override numeric IDs with string versions (converted by normalizeConnectionItem)
32
+ id: z.string().describe("Unique identifier for the connection"),
33
+ account_id: z.string().describe("Account ID associated with this connection"),
34
+ // Renamed fields
35
+ implementation_id: z.string().optional().describe("Implementation ID (was selected_api)"),
36
+ profile_id: z.string().optional().describe("Profile ID (was customuser_id)"),
37
+ // Mapped fields (originals preserved in ...restOfAuth)
38
+ is_expired: z.string().optional().describe("Whether the connection is expired (mapped from is_stale)"),
39
+ expired_at: z.string().nullable().optional().describe("Date when connection expired (mapped from marked_stale_at)"),
40
+ // Computed fields
41
+ app_key: z.string().optional().describe("App Key extracted from implementation_id"),
42
+ app_version: z.string().optional().describe("App Version extracted from implementation_id")
43
+ });
44
+ var ConnectionsResponseSchema = z.object({
45
+ count: z.number().describe("Total number of items"),
46
+ next: z.string().nullable().optional().describe("Cursor for the next page of results (if available)"),
47
+ previous: z.string().nullable().optional().describe("Cursor for the previous page of results (if available)"),
48
+ results: z.array(ConnectionSchema).describe("Array of connection items")
49
+ });
50
+ var GetConnectionParamSchema = z.object({
51
+ connectionId: z.string().describe("Connection ID to retrieve")
52
+ }).describe("Get a specific connection by ID");
53
+ var ListConnectionsQuerySchema = z.object({
54
+ app_key: z.string().optional().describe(
55
+ "Filter connections by app key (e.g., 'SlackCLIAPI' or slug like 'github')"
56
+ ),
57
+ connection_ids: z.string().optional().describe("Comma-separated list of connection IDs to filter by"),
58
+ search: z.string().optional().describe("Search term to filter connections by title"),
59
+ title: z.string().optional().describe(
60
+ "Filter connections by exact title match (searches first, then filters locally)"
61
+ ),
62
+ account_id: z.string().optional().describe("Filter connections by account ID"),
63
+ owner: z.string().optional().describe(
64
+ "Filter by owner, 'me' for your own connections or a specific user ID"
65
+ ),
66
+ is_expired: z.boolean().optional().describe(
67
+ "Filter by expired status (true = expired only, false = non-expired only)"
68
+ ),
69
+ page_size: z.number().min(1).optional().describe("Number of connections per page"),
70
+ offset: z.string().optional().describe("Pagination offset from previous response")
71
+ }).describe("Query parameters for listing connections");
72
+ var ListConnectionsResponseSchema = z.object({
73
+ data: z.array(ConnectionItemSchema).describe("Array of connection items"),
74
+ links: z.object({
75
+ next: z.string().nullable().optional().describe(
76
+ "Fully qualified URL for the next page of results (if available), e.g. https://sdkapi.zapier.com/api/v0/connections?offset=100&page_size=50"
77
+ )
78
+ }).describe("Pagination links for navigating through results"),
79
+ meta: z.object({
80
+ count: z.number().describe("Total number of items"),
81
+ limit: z.number().describe("Number of items per page"),
82
+ offset: z.number().describe("Offset of the current page")
83
+ }).describe("Metadata for the paginated result set")
84
+ }).describe("Response schema for listing connections");
85
+ export {
86
+ ConnectionItemSchema,
87
+ ConnectionSchema,
88
+ ConnectionsResponseSchema,
89
+ GetConnectionParamSchema,
90
+ ListConnectionsQuerySchema,
91
+ ListConnectionsResponseSchema
92
+ };
93
+ //# sourceMappingURL=connections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/v0/schemas/connections.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Base Connection schema matching the API response\n * (internally uses the same v4 authentications API)\n */\nexport const ConnectionSchema = z.object({\n id: z.number().describe(\"Unique identifier for the connection\"),\n date: z.string().describe(\"Date created\"),\n lastchanged: z.string().optional().describe(\"Date last changed\"),\n account_id: z.number().describe(\"Account ID associated with this connection\"),\n customuser_id: z\n .number()\n .optional()\n .describe(\"Custom user ID (if applicable)\"),\n selected_api: z.string().describe(\"Selected API key (internal identifier)\"),\n destination_selected_api: z\n .string()\n .nullable()\n .optional()\n .describe(\"Destination API key (if applicable)\"),\n is_invite_only: z.boolean().describe(\"Whether the connection is invite-only\"),\n is_private: z.boolean().describe(\"Whether the connection is private\"),\n shared_with_all: z\n .boolean()\n .describe(\"Whether the connection is shared with all users\"),\n is_stale: z.string().optional().describe(\"Stale status string\"),\n is_shared: z.string().optional().describe(\"Shared status string\"),\n marked_stale_at: z\n .string()\n .nullable()\n .optional()\n .describe(\"Date when marked stale\"),\n label: z\n .string()\n .nullable()\n .optional()\n .describe(\"User label for the connection\"),\n identifier: z.string().nullable().optional().describe(\"Identifier\"),\n title: z.string().nullable().optional().describe(\"Title of the connection\"),\n url: z.string().optional().describe(\"URL to the connection resource\"),\n groups: z\n .array(\n z\n .record(z.string(), z.unknown())\n .describe(\"Groups associated with the connection\"),\n )\n .optional()\n .describe(\"Array of groups associated with the connection\"),\n members: z\n .string()\n .optional()\n .describe(\"Members associated with the connection\"),\n permissions: z\n .record(z.string(), z.boolean())\n .optional()\n .describe(\"Permissions for the connection\"),\n});\n\n/**\n * Normalized connection item returned by getConnection handler\n *\n * Transforms API response fields:\n * - selected_api → implementation_id\n * - customuser_id → profile_id\n * - is_stale → is_expired (preserved as is_stale too)\n * - marked_stale_at → expired_at (preserved as marked_stale_at too)\n *\n * Adds computed fields:\n * - app_key: Extracted from selected_api (e.g., \"SlackCLIAPI@1.0.0\" → \"SlackCLIAPI\")\n * - app_version: Extracted from selected_api (e.g., \"SlackCLIAPI@1.0.0\" → \"1.0.0\")\n */\nexport const ConnectionItemSchema = ConnectionSchema.omit({\n selected_api: true,\n customuser_id: true,\n}).extend({\n // Override numeric IDs with string versions (converted by normalizeConnectionItem)\n id: z.string().describe(\"Unique identifier for the connection\"),\n account_id: z.string().describe(\"Account ID associated with this connection\"),\n\n // Renamed fields\n implementation_id: z\n .string()\n .optional()\n .describe(\"Implementation ID (was selected_api)\"),\n profile_id: z.string().optional().describe(\"Profile ID (was customuser_id)\"),\n\n // Mapped fields (originals preserved in ...restOfAuth)\n is_expired: z\n .string()\n .optional()\n .describe(\"Whether the connection is expired (mapped from is_stale)\"),\n expired_at: z\n .string()\n .nullable()\n .optional()\n .describe(\"Date when connection expired (mapped from marked_stale_at)\"),\n\n // Computed fields\n app_key: z\n .string()\n .optional()\n .describe(\"App Key extracted from implementation_id\"),\n app_version: z\n .string()\n .optional()\n .describe(\"App Version extracted from implementation_id\"),\n});\n\nexport const ConnectionsResponseSchema = z.object({\n count: z.number().describe(\"Total number of items\"),\n next: z\n .string()\n .nullable()\n .optional()\n .describe(\"Cursor for the next page of results (if available)\"),\n previous: z\n .string()\n .nullable()\n .optional()\n .describe(\"Cursor for the previous page of results (if available)\"),\n results: z.array(ConnectionSchema).describe(\"Array of connection items\"),\n});\n\nexport type Connection = z.infer<typeof ConnectionSchema>;\nexport type ConnectionItem = z.infer<typeof ConnectionItemSchema>;\nexport type ConnectionsResponse = z.infer<typeof ConnectionsResponseSchema>;\n\n/**\n * Path parameters schema for getConnection endpoint.\n */\nexport const GetConnectionParamSchema = z\n .object({\n connectionId: z.string().describe(\"Connection ID to retrieve\"),\n })\n .describe(\"Get a specific connection by ID\");\n\nexport type GetConnectionParam = z.infer<typeof GetConnectionParamSchema>;\n\n/**\n * Response type for getConnection endpoint.\n * Wraps ConnectionItem in the standard API response envelope.\n */\nexport type GetConnectionResponse = { data: ConnectionItem };\n\n/**\n * Query parameters for listing connections\n */\nexport const ListConnectionsQuerySchema = z\n .object({\n app_key: z\n .string()\n .optional()\n .describe(\n \"Filter connections by app key (e.g., 'SlackCLIAPI' or slug like 'github')\",\n ),\n connection_ids: z\n .string()\n .optional()\n .describe(\"Comma-separated list of connection IDs to filter by\"),\n search: z\n .string()\n .optional()\n .describe(\"Search term to filter connections by title\"),\n title: z\n .string()\n .optional()\n .describe(\n \"Filter connections by exact title match (searches first, then filters locally)\",\n ),\n account_id: z\n .string()\n .optional()\n .describe(\"Filter connections by account ID\"),\n owner: z\n .string()\n .optional()\n .describe(\n \"Filter by owner, 'me' for your own connections or a specific user ID\",\n ),\n is_expired: z\n .boolean()\n .optional()\n .describe(\n \"Filter by expired status (true = expired only, false = non-expired only)\",\n ),\n page_size: z\n .number()\n .min(1)\n .optional()\n .describe(\"Number of connections per page\"),\n offset: z\n .string()\n .optional()\n .describe(\"Pagination offset from previous response\"),\n })\n .describe(\"Query parameters for listing connections\");\n\n/**\n * Response schema for listConnections\n */\nexport const ListConnectionsResponseSchema = z\n .object({\n data: z.array(ConnectionItemSchema).describe(\"Array of connection items\"),\n links: z\n .object({\n next: z\n .string()\n .nullable()\n .optional()\n .describe(\n \"Fully qualified URL for the next page of results (if available), e.g. https://sdkapi.zapier.com/api/v0/connections?offset=100&page_size=50\",\n ),\n })\n .describe(\"Pagination links for navigating through results\"),\n meta: z\n .object({\n count: z.number().describe(\"Total number of items\"),\n limit: z.number().describe(\"Number of items per page\"),\n offset: z.number().describe(\"Offset of the current page\"),\n })\n .describe(\"Metadata for the paginated result set\"),\n })\n .describe(\"Response schema for listing connections\");\n\n/**\n * TypeScript types for request and response\n */\nexport type ListConnectionsQuery = z.infer<typeof ListConnectionsQuerySchema>;\nexport type ListConnectionsResponse = z.infer<\n typeof ListConnectionsResponseSchema\n>;\n"],"mappings":";AAAA,SAAS,SAAS;AAMX,IAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,IAAI,EAAE,OAAO,EAAE,SAAS,sCAAsC;AAAA,EAC9D,MAAM,EAAE,OAAO,EAAE,SAAS,cAAc;AAAA,EACxC,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mBAAmB;AAAA,EAC/D,YAAY,EAAE,OAAO,EAAE,SAAS,4CAA4C;AAAA,EAC5E,eAAe,EACZ,OAAO,EACP,SAAS,EACT,SAAS,gCAAgC;AAAA,EAC5C,cAAc,EA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