@zapier/zapier-sdk-core 0.3.0 → 0.5.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 (51) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/index.cjs +162 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +20 -0
  5. package/dist/index.d.ts +20 -0
  6. package/dist/index.js +124 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/v0/common/responses.cjs +139 -0
  9. package/dist/v0/common/responses.cjs.map +1 -0
  10. package/dist/v0/common/responses.d.cts +157 -0
  11. package/dist/v0/common/responses.d.ts +157 -0
  12. package/dist/v0/common/responses.js +112 -0
  13. package/dist/v0/common/responses.js.map +1 -0
  14. package/dist/v0/config/metadata.cjs +79 -0
  15. package/dist/v0/config/metadata.cjs.map +1 -0
  16. package/dist/v0/config/metadata.d.cts +70 -0
  17. package/dist/v0/config/metadata.d.ts +70 -0
  18. package/dist/v0/config/metadata.js +50 -0
  19. package/dist/v0/config/metadata.js.map +1 -0
  20. package/dist/v0/schemas/actions.cjs +90 -0
  21. package/dist/v0/schemas/actions.cjs.map +1 -0
  22. package/dist/v0/schemas/actions.d.cts +151 -0
  23. package/dist/v0/schemas/actions.d.ts +151 -0
  24. package/dist/v0/schemas/actions.js +61 -0
  25. package/dist/v0/schemas/actions.js.map +1 -0
  26. package/dist/v0/schemas/apps.cjs +130 -0
  27. package/dist/v0/schemas/apps.cjs.map +1 -0
  28. package/dist/v0/schemas/apps.d.cts +139 -0
  29. package/dist/v0/schemas/apps.d.ts +139 -0
  30. package/dist/v0/schemas/apps.js +103 -0
  31. package/dist/v0/schemas/apps.js.map +1 -0
  32. package/dist/v0/schemas/authentications.cjs +87 -0
  33. package/dist/v0/schemas/authentications.cjs.map +1 -0
  34. package/dist/v0/schemas/authentications.d.cts +112 -0
  35. package/dist/v0/schemas/authentications.d.ts +112 -0
  36. package/dist/v0/schemas/authentications.js +59 -0
  37. package/dist/v0/schemas/authentications.js.map +1 -0
  38. package/dist/v0/schemas/errors.cjs +77 -0
  39. package/dist/v0/schemas/errors.cjs.map +1 -0
  40. package/dist/v0/schemas/errors.d.cts +64 -0
  41. package/dist/v0/schemas/errors.d.ts +64 -0
  42. package/dist/v0/schemas/errors.js +49 -0
  43. package/dist/v0/schemas/errors.js.map +1 -0
  44. package/dist/v0/schemas/implementations.cjs +93 -0
  45. package/dist/v0/schemas/implementations.cjs.map +1 -0
  46. package/dist/v0/schemas/implementations.d.cts +121 -0
  47. package/dist/v0/schemas/implementations.d.ts +121 -0
  48. package/dist/v0/schemas/implementations.js +67 -0
  49. package/dist/v0/schemas/implementations.js.map +1 -0
  50. package/openapi.yaml +392 -2
  51. package/package.json +16 -1
@@ -0,0 +1,87 @@
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/authentications.ts
21
+ var authentications_exports = {};
22
+ __export(authentications_exports, {
23
+ AuthenticationItemSchema: () => AuthenticationItemSchema,
24
+ AuthenticationSchema: () => AuthenticationSchema,
25
+ AuthenticationsResponseSchema: () => AuthenticationsResponseSchema,
26
+ GetAuthenticationParamSchema: () => GetAuthenticationParamSchema
27
+ });
28
+ module.exports = __toCommonJS(authentications_exports);
29
+ var import_zod = require("zod");
30
+ var AuthenticationSchema = import_zod.z.object({
31
+ id: import_zod.z.number().describe("Unique identifier for the authentication"),
32
+ date: import_zod.z.string().describe("Date created"),
33
+ lastchanged: import_zod.z.string().optional().describe("Date last changed"),
34
+ account_id: import_zod.z.number().describe("Account ID associated with this authentication"),
35
+ customuser_id: import_zod.z.number().optional().describe("Custom user ID (if applicable)"),
36
+ selected_api: import_zod.z.string().describe("Selected API key (internal identifier)"),
37
+ destination_selected_api: import_zod.z.string().nullable().optional().describe("Destination API key (if applicable)"),
38
+ is_invite_only: import_zod.z.boolean().describe("Whether the authentication is invite-only"),
39
+ is_private: import_zod.z.boolean().describe("Whether the authentication is private"),
40
+ shared_with_all: import_zod.z.boolean().describe("Whether the authentication is shared with all users"),
41
+ is_stale: import_zod.z.string().optional().describe("Stale status string"),
42
+ is_shared: import_zod.z.string().optional().describe("Shared status string"),
43
+ marked_stale_at: import_zod.z.string().nullable().optional().describe("Date when marked stale"),
44
+ label: import_zod.z.string().nullable().optional().describe("User label for the authentication"),
45
+ identifier: import_zod.z.string().nullable().optional().describe("Identifier"),
46
+ title: import_zod.z.string().nullable().optional().describe("Title of the authentication"),
47
+ url: import_zod.z.string().optional().describe("URL to the authentication resource"),
48
+ groups: import_zod.z.array(
49
+ import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).describe("Groups associated with the authentication")
50
+ ).optional().describe("Array of groups associated with the authentication"),
51
+ members: import_zod.z.string().optional().describe("Members associated with the authentication"),
52
+ permissions: import_zod.z.record(import_zod.z.string(), import_zod.z.boolean()).optional().describe("Permissions for the authentication")
53
+ });
54
+ var AuthenticationItemSchema = AuthenticationSchema.omit({
55
+ selected_api: true,
56
+ customuser_id: true
57
+ }).extend({
58
+ // Override numeric IDs with string versions (converted by normalizeAuthenticationItem)
59
+ id: import_zod.z.string().describe("Unique identifier for the authentication"),
60
+ account_id: import_zod.z.string().describe("Account ID associated with this authentication"),
61
+ // Renamed fields
62
+ implementation_id: import_zod.z.string().optional().describe("Implementation ID (was selected_api)"),
63
+ profile_id: import_zod.z.string().optional().describe("Profile ID (was customuser_id)"),
64
+ // Mapped fields (originals preserved in ...restOfAuth)
65
+ is_expired: import_zod.z.string().optional().describe("Whether the authentication is expired (mapped from is_stale)"),
66
+ expired_at: import_zod.z.string().nullable().optional().describe("Date when authentication expired (mapped from marked_stale_at)"),
67
+ // Computed fields
68
+ app_key: import_zod.z.string().optional().describe("App Key extracted from implementation_id"),
69
+ app_version: import_zod.z.string().optional().describe("App Version extracted from implementation_id")
70
+ });
71
+ var AuthenticationsResponseSchema = import_zod.z.object({
72
+ count: import_zod.z.number().describe("Total number of items"),
73
+ next: import_zod.z.string().nullable().optional().describe("Cursor for the next page of results (if available)"),
74
+ previous: import_zod.z.string().nullable().optional().describe("Cursor for the previous page of results (if available)"),
75
+ results: import_zod.z.array(AuthenticationSchema).describe("Array of authentication items")
76
+ });
77
+ var GetAuthenticationParamSchema = import_zod.z.object({
78
+ authenticationId: import_zod.z.string().describe("Authentication ID to retrieve")
79
+ }).describe("Get a specific authentication by ID");
80
+ // Annotate the CommonJS export names for ESM import in node:
81
+ 0 && (module.exports = {
82
+ AuthenticationItemSchema,
83
+ AuthenticationSchema,
84
+ AuthenticationsResponseSchema,
85
+ GetAuthenticationParamSchema
86
+ });
87
+ //# sourceMappingURL=authentications.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/v0/schemas/authentications.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Base Authentication schema matching the API response\n */\nexport const AuthenticationSchema = z.object({\n id: z.number().describe(\"Unique identifier for the authentication\"),\n date: z.string().describe(\"Date created\"),\n lastchanged: z.string().optional().describe(\"Date last changed\"),\n account_id: z\n .number()\n .describe(\"Account ID associated with this authentication\"),\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\n .boolean()\n .describe(\"Whether the authentication is invite-only\"),\n is_private: z.boolean().describe(\"Whether the authentication is private\"),\n shared_with_all: z\n .boolean()\n .describe(\"Whether the authentication 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 authentication\"),\n identifier: z.string().nullable().optional().describe(\"Identifier\"),\n title: z\n .string()\n .nullable()\n .optional()\n .describe(\"Title of the authentication\"),\n url: z.string().optional().describe(\"URL to the authentication resource\"),\n groups: z\n .array(\n z\n .record(z.string(), z.unknown())\n .describe(\"Groups associated with the authentication\"),\n )\n .optional()\n .describe(\"Array of groups associated with the authentication\"),\n members: z\n .string()\n .optional()\n .describe(\"Members associated with the authentication\"),\n permissions: z\n .record(z.string(), z.boolean())\n .optional()\n .describe(\"Permissions for the authentication\"),\n});\n\n/**\n * Normalized authentication item returned by getAuthentication 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 AuthenticationItemSchema = AuthenticationSchema.omit({\n selected_api: true,\n customuser_id: true,\n}).extend({\n // Override numeric IDs with string versions (converted by normalizeAuthenticationItem)\n id: z.string().describe(\"Unique identifier for the authentication\"),\n account_id: z\n .string()\n .describe(\"Account ID associated with this authentication\"),\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 authentication is expired (mapped from is_stale)\"),\n expired_at: z\n .string()\n .nullable()\n .optional()\n .describe(\"Date when authentication 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 AuthenticationsResponseSchema = 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\n .array(AuthenticationSchema)\n .describe(\"Array of authentication items\"),\n});\n\nexport type Authentication = z.infer<typeof AuthenticationSchema>;\nexport type AuthenticationItem = z.infer<typeof AuthenticationItemSchema>;\nexport type AuthenticationsResponse = z.infer<\n typeof AuthenticationsResponseSchema\n>;\n\n/**\n * Path parameters schema for getAuthentication endpoint.\n */\nexport const GetAuthenticationParamSchema = z\n .object({\n authenticationId: z.string().describe(\"Authentication ID to retrieve\"),\n })\n .describe(\"Get a specific authentication by ID\");\n\nexport type GetAuthenticationParam = z.infer<\n typeof GetAuthenticationParamSchema\n>;\n\n/**\n * Response type for getAuthentication endpoint.\n * Wraps AuthenticationItem in the standard API response envelope.\n */\nexport type GetAuthenticationResponse = { data: AuthenticationItem };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAKX,IAAM,uBAAuB,aAAE,OAAO;AAAA,EAC3C,IAAI,aAAE,OAAO,EAAE,SAAS,0CAA0C;AAAA,EAClE,MAAM,aAAE,OAAO,EAAE,SAAS,cAAc;AAAA,EACxC,aAAa,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mBAAmB;AA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Ac;AAAA,EACd,eAAe;AACjB,CAAC,EAAE,OAAO;AAAA;AAAA,EAER,IAAI,aAAE,OAAO,EAAE,SAAS,0CAA0C;AAAA,EAClE,YAAY,aACT,OAAO,EACP,SAAS,gDAAgD;AAAA;AAAA,EAG5D,mBAAmB,aAChB,OAAO,EACP,SAAS,EACT,SAAS,sCAAsC;AAAA,EAClD,YAAY,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,gCAAgC;AAAA;AAAA,EAG3E,YAAY,aACT,OAAO,EACP,SAAS,EACT,SAAS,8DAA8D;AAAA,EAC1E,YAAY,aACT,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,gEAAgE;AAAA;AAAA,EAG5E,SAAS,aACN,OAAO,EACP,SAAS,EACT,SAAS,0CAA0C;AAAA,EACtD,aAAa,aACV,OAAO,EACP,SAAS,EACT,SAAS,8CAA8C;AAC5D,CAAC;AAEM,IAAM,gCAAgC,aAAE,OAAO;AAAA,EACpD,OAAO,aAAE,OAAO,EAAE,SAAS,uBAAuB;AAAA,EAClD,MAAM,aACH,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,oDAAoD;AAAA,EAChE,UAAU,aACP,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,wDAAwD;AAAA,EACpE,SAAS,aACN,MAAM,oBAAoB,EAC1B,SAAS,+BAA+B;AAC7C,CAAC;AAWM,IAAM,+BAA+B,aACzC,OAAO;AAAA,EACN,kBAAkB,aAAE,OAAO,EAAE,SAAS,+BAA+B;AACvE,CAAC,EACA,SAAS,qCAAqC;","names":[]}
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Base Authentication schema matching the API response
5
+ */
6
+ declare const AuthenticationSchema: z.ZodObject<{
7
+ id: z.ZodNumber;
8
+ date: z.ZodString;
9
+ lastchanged: z.ZodOptional<z.ZodString>;
10
+ account_id: z.ZodNumber;
11
+ customuser_id: z.ZodOptional<z.ZodNumber>;
12
+ selected_api: z.ZodString;
13
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ is_invite_only: z.ZodBoolean;
15
+ is_private: z.ZodBoolean;
16
+ shared_with_all: z.ZodBoolean;
17
+ is_stale: z.ZodOptional<z.ZodString>;
18
+ is_shared: z.ZodOptional<z.ZodString>;
19
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ url: z.ZodOptional<z.ZodString>;
24
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
25
+ members: z.ZodOptional<z.ZodString>;
26
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
27
+ }, z.core.$strip>;
28
+ /**
29
+ * Normalized authentication item returned by getAuthentication handler
30
+ *
31
+ * Transforms API response fields:
32
+ * - selected_api → implementation_id
33
+ * - customuser_id → profile_id
34
+ * - is_stale → is_expired (preserved as is_stale too)
35
+ * - marked_stale_at → expired_at (preserved as marked_stale_at too)
36
+ *
37
+ * Adds computed fields:
38
+ * - app_key: Extracted from selected_api (e.g., "SlackCLIAPI@1.0.0" → "SlackCLIAPI")
39
+ * - app_version: Extracted from selected_api (e.g., "SlackCLIAPI@1.0.0" → "1.0.0")
40
+ */
41
+ declare const AuthenticationItemSchema: z.ZodObject<{
42
+ date: z.ZodString;
43
+ lastchanged: z.ZodOptional<z.ZodString>;
44
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ is_invite_only: z.ZodBoolean;
46
+ is_private: z.ZodBoolean;
47
+ shared_with_all: z.ZodBoolean;
48
+ is_stale: z.ZodOptional<z.ZodString>;
49
+ is_shared: z.ZodOptional<z.ZodString>;
50
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ url: z.ZodOptional<z.ZodString>;
55
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
56
+ members: z.ZodOptional<z.ZodString>;
57
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
58
+ id: z.ZodString;
59
+ account_id: z.ZodString;
60
+ implementation_id: z.ZodOptional<z.ZodString>;
61
+ profile_id: z.ZodOptional<z.ZodString>;
62
+ is_expired: z.ZodOptional<z.ZodString>;
63
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
+ app_key: z.ZodOptional<z.ZodString>;
65
+ app_version: z.ZodOptional<z.ZodString>;
66
+ }, z.core.$strip>;
67
+ declare const AuthenticationsResponseSchema: z.ZodObject<{
68
+ count: z.ZodNumber;
69
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
+ previous: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ results: z.ZodArray<z.ZodObject<{
72
+ id: z.ZodNumber;
73
+ date: z.ZodString;
74
+ lastchanged: z.ZodOptional<z.ZodString>;
75
+ account_id: z.ZodNumber;
76
+ customuser_id: z.ZodOptional<z.ZodNumber>;
77
+ selected_api: z.ZodString;
78
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
+ is_invite_only: z.ZodBoolean;
80
+ is_private: z.ZodBoolean;
81
+ shared_with_all: z.ZodBoolean;
82
+ is_stale: z.ZodOptional<z.ZodString>;
83
+ is_shared: z.ZodOptional<z.ZodString>;
84
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ url: z.ZodOptional<z.ZodString>;
89
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
90
+ members: z.ZodOptional<z.ZodString>;
91
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>;
94
+ type Authentication = z.infer<typeof AuthenticationSchema>;
95
+ type AuthenticationItem = z.infer<typeof AuthenticationItemSchema>;
96
+ type AuthenticationsResponse = z.infer<typeof AuthenticationsResponseSchema>;
97
+ /**
98
+ * Path parameters schema for getAuthentication endpoint.
99
+ */
100
+ declare const GetAuthenticationParamSchema: z.ZodObject<{
101
+ authenticationId: z.ZodString;
102
+ }, z.core.$strip>;
103
+ type GetAuthenticationParam = z.infer<typeof GetAuthenticationParamSchema>;
104
+ /**
105
+ * Response type for getAuthentication endpoint.
106
+ * Wraps AuthenticationItem in the standard API response envelope.
107
+ */
108
+ type GetAuthenticationResponse = {
109
+ data: AuthenticationItem;
110
+ };
111
+
112
+ export { type Authentication, type AuthenticationItem, AuthenticationItemSchema, AuthenticationSchema, type AuthenticationsResponse, AuthenticationsResponseSchema, type GetAuthenticationParam, GetAuthenticationParamSchema, type GetAuthenticationResponse };
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Base Authentication schema matching the API response
5
+ */
6
+ declare const AuthenticationSchema: z.ZodObject<{
7
+ id: z.ZodNumber;
8
+ date: z.ZodString;
9
+ lastchanged: z.ZodOptional<z.ZodString>;
10
+ account_id: z.ZodNumber;
11
+ customuser_id: z.ZodOptional<z.ZodNumber>;
12
+ selected_api: z.ZodString;
13
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ is_invite_only: z.ZodBoolean;
15
+ is_private: z.ZodBoolean;
16
+ shared_with_all: z.ZodBoolean;
17
+ is_stale: z.ZodOptional<z.ZodString>;
18
+ is_shared: z.ZodOptional<z.ZodString>;
19
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ url: z.ZodOptional<z.ZodString>;
24
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
25
+ members: z.ZodOptional<z.ZodString>;
26
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
27
+ }, z.core.$strip>;
28
+ /**
29
+ * Normalized authentication item returned by getAuthentication handler
30
+ *
31
+ * Transforms API response fields:
32
+ * - selected_api → implementation_id
33
+ * - customuser_id → profile_id
34
+ * - is_stale → is_expired (preserved as is_stale too)
35
+ * - marked_stale_at → expired_at (preserved as marked_stale_at too)
36
+ *
37
+ * Adds computed fields:
38
+ * - app_key: Extracted from selected_api (e.g., "SlackCLIAPI@1.0.0" → "SlackCLIAPI")
39
+ * - app_version: Extracted from selected_api (e.g., "SlackCLIAPI@1.0.0" → "1.0.0")
40
+ */
41
+ declare const AuthenticationItemSchema: z.ZodObject<{
42
+ date: z.ZodString;
43
+ lastchanged: z.ZodOptional<z.ZodString>;
44
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ is_invite_only: z.ZodBoolean;
46
+ is_private: z.ZodBoolean;
47
+ shared_with_all: z.ZodBoolean;
48
+ is_stale: z.ZodOptional<z.ZodString>;
49
+ is_shared: z.ZodOptional<z.ZodString>;
50
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ url: z.ZodOptional<z.ZodString>;
55
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
56
+ members: z.ZodOptional<z.ZodString>;
57
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
58
+ id: z.ZodString;
59
+ account_id: z.ZodString;
60
+ implementation_id: z.ZodOptional<z.ZodString>;
61
+ profile_id: z.ZodOptional<z.ZodString>;
62
+ is_expired: z.ZodOptional<z.ZodString>;
63
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
+ app_key: z.ZodOptional<z.ZodString>;
65
+ app_version: z.ZodOptional<z.ZodString>;
66
+ }, z.core.$strip>;
67
+ declare const AuthenticationsResponseSchema: z.ZodObject<{
68
+ count: z.ZodNumber;
69
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
+ previous: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ results: z.ZodArray<z.ZodObject<{
72
+ id: z.ZodNumber;
73
+ date: z.ZodString;
74
+ lastchanged: z.ZodOptional<z.ZodString>;
75
+ account_id: z.ZodNumber;
76
+ customuser_id: z.ZodOptional<z.ZodNumber>;
77
+ selected_api: z.ZodString;
78
+ destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
+ is_invite_only: z.ZodBoolean;
80
+ is_private: z.ZodBoolean;
81
+ shared_with_all: z.ZodBoolean;
82
+ is_stale: z.ZodOptional<z.ZodString>;
83
+ is_shared: z.ZodOptional<z.ZodString>;
84
+ marked_stale_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ url: z.ZodOptional<z.ZodString>;
89
+ groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
90
+ members: z.ZodOptional<z.ZodString>;
91
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>;
94
+ type Authentication = z.infer<typeof AuthenticationSchema>;
95
+ type AuthenticationItem = z.infer<typeof AuthenticationItemSchema>;
96
+ type AuthenticationsResponse = z.infer<typeof AuthenticationsResponseSchema>;
97
+ /**
98
+ * Path parameters schema for getAuthentication endpoint.
99
+ */
100
+ declare const GetAuthenticationParamSchema: z.ZodObject<{
101
+ authenticationId: z.ZodString;
102
+ }, z.core.$strip>;
103
+ type GetAuthenticationParam = z.infer<typeof GetAuthenticationParamSchema>;
104
+ /**
105
+ * Response type for getAuthentication endpoint.
106
+ * Wraps AuthenticationItem in the standard API response envelope.
107
+ */
108
+ type GetAuthenticationResponse = {
109
+ data: AuthenticationItem;
110
+ };
111
+
112
+ export { type Authentication, type AuthenticationItem, AuthenticationItemSchema, AuthenticationSchema, type AuthenticationsResponse, AuthenticationsResponseSchema, type GetAuthenticationParam, GetAuthenticationParamSchema, type GetAuthenticationResponse };
@@ -0,0 +1,59 @@
1
+ // src/v0/schemas/authentications.ts
2
+ import { z } from "zod";
3
+ var AuthenticationSchema = z.object({
4
+ id: z.number().describe("Unique identifier for the authentication"),
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 authentication"),
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 authentication is invite-only"),
12
+ is_private: z.boolean().describe("Whether the authentication is private"),
13
+ shared_with_all: z.boolean().describe("Whether the authentication 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 authentication"),
18
+ identifier: z.string().nullable().optional().describe("Identifier"),
19
+ title: z.string().nullable().optional().describe("Title of the authentication"),
20
+ url: z.string().optional().describe("URL to the authentication resource"),
21
+ groups: z.array(
22
+ z.record(z.string(), z.unknown()).describe("Groups associated with the authentication")
23
+ ).optional().describe("Array of groups associated with the authentication"),
24
+ members: z.string().optional().describe("Members associated with the authentication"),
25
+ permissions: z.record(z.string(), z.boolean()).optional().describe("Permissions for the authentication")
26
+ });
27
+ var AuthenticationItemSchema = AuthenticationSchema.omit({
28
+ selected_api: true,
29
+ customuser_id: true
30
+ }).extend({
31
+ // Override numeric IDs with string versions (converted by normalizeAuthenticationItem)
32
+ id: z.string().describe("Unique identifier for the authentication"),
33
+ account_id: z.string().describe("Account ID associated with this authentication"),
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 authentication is expired (mapped from is_stale)"),
39
+ expired_at: z.string().nullable().optional().describe("Date when authentication 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 AuthenticationsResponseSchema = 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(AuthenticationSchema).describe("Array of authentication items")
49
+ });
50
+ var GetAuthenticationParamSchema = z.object({
51
+ authenticationId: z.string().describe("Authentication ID to retrieve")
52
+ }).describe("Get a specific authentication by ID");
53
+ export {
54
+ AuthenticationItemSchema,
55
+ AuthenticationSchema,
56
+ AuthenticationsResponseSchema,
57
+ GetAuthenticationParamSchema
58
+ };
59
+ //# sourceMappingURL=authentications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/v0/schemas/authentications.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Base Authentication schema matching the API response\n */\nexport const AuthenticationSchema = z.object({\n id: z.number().describe(\"Unique identifier for the authentication\"),\n date: z.string().describe(\"Date created\"),\n lastchanged: z.string().optional().describe(\"Date last changed\"),\n account_id: z\n .number()\n .describe(\"Account ID associated with this authentication\"),\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\n .boolean()\n .describe(\"Whether the authentication is invite-only\"),\n is_private: z.boolean().describe(\"Whether the authentication is private\"),\n shared_with_all: z\n .boolean()\n .describe(\"Whether the authentication 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 authentication\"),\n identifier: z.string().nullable().optional().describe(\"Identifier\"),\n title: z\n .string()\n .nullable()\n .optional()\n .describe(\"Title of the authentication\"),\n url: z.string().optional().describe(\"URL to the authentication resource\"),\n groups: z\n .array(\n z\n .record(z.string(), z.unknown())\n .describe(\"Groups associated with the authentication\"),\n )\n .optional()\n .describe(\"Array of groups associated with the authentication\"),\n members: z\n .string()\n .optional()\n .describe(\"Members associated with the authentication\"),\n permissions: z\n .record(z.string(), z.boolean())\n .optional()\n .describe(\"Permissions for the authentication\"),\n});\n\n/**\n * Normalized authentication item returned by getAuthentication 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 AuthenticationItemSchema = AuthenticationSchema.omit({\n selected_api: true,\n customuser_id: true,\n}).extend({\n // Override numeric IDs with string versions (converted by normalizeAuthenticationItem)\n id: z.string().describe(\"Unique identifier for the authentication\"),\n account_id: z\n .string()\n .describe(\"Account ID associated with this authentication\"),\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 authentication is expired (mapped from is_stale)\"),\n expired_at: z\n .string()\n .nullable()\n .optional()\n .describe(\"Date when authentication 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 AuthenticationsResponseSchema = 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\n .array(AuthenticationSchema)\n .describe(\"Array of authentication items\"),\n});\n\nexport type Authentication = z.infer<typeof AuthenticationSchema>;\nexport type AuthenticationItem = z.infer<typeof AuthenticationItemSchema>;\nexport type AuthenticationsResponse = z.infer<\n typeof AuthenticationsResponseSchema\n>;\n\n/**\n * Path parameters schema for getAuthentication endpoint.\n */\nexport const GetAuthenticationParamSchema = z\n .object({\n authenticationId: z.string().describe(\"Authentication ID to retrieve\"),\n })\n .describe(\"Get a specific authentication by ID\");\n\nexport type GetAuthenticationParam = z.infer<\n typeof GetAuthenticationParamSchema\n>;\n\n/**\n * Response type for getAuthentication endpoint.\n * Wraps AuthenticationItem in the standard API response envelope.\n */\nexport type GetAuthenticationResponse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 @@
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/errors.ts
21
+ var errors_exports = {};
22
+ __export(errors_exports, {
23
+ ErrorCodeSchema: () => ErrorCodeSchema,
24
+ ErrorObjectSchema: () => ErrorObjectSchema,
25
+ ErrorSourceSchema: () => ErrorSourceSchema,
26
+ ErrorsResponseSchema: () => ErrorsResponseSchema
27
+ });
28
+ module.exports = __toCommonJS(errors_exports);
29
+ var import_zod = require("zod");
30
+ var ErrorCodeSchema = import_zod.z.string().describe("An application-specific error code, expressed as a string value.");
31
+ var ErrorSourceSchema = import_zod.z.object({
32
+ pointer: import_zod.z.string().optional().describe(
33
+ "A JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) to the associated entity in the request document [e.g. `/data` for a primary data object, or `/data/attributes/title` for a specific attribute]."
34
+ ),
35
+ parameter: import_zod.z.string().optional().describe(
36
+ "A string indicating which URI query parameter caused the error."
37
+ ),
38
+ header: import_zod.z.string().optional().describe("A string indicating the header that caused the error.")
39
+ }).strict().nullable().describe(
40
+ "Identifies the source of the error within the request payload, if relevant."
41
+ );
42
+ var ErrorObjectSchema = import_zod.z.object({
43
+ id: import_zod.z.string().nullable().optional().describe(
44
+ "A unique identifier for this particular occurrence of the problem."
45
+ ),
46
+ links: import_zod.z.object({
47
+ about: import_zod.z.string().url().describe(
48
+ "A link that leads to further details about this particular occurrence of the problem."
49
+ )
50
+ }).strict().nullable().optional().describe("Relevant links about the error"),
51
+ status: import_zod.z.string().optional().describe(
52
+ "The HTTP status code applicable to this problem, expressed as a string value."
53
+ ),
54
+ code: ErrorCodeSchema.optional(),
55
+ title: import_zod.z.string().optional().describe(
56
+ "A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."
57
+ ),
58
+ detail: import_zod.z.string().optional().describe(
59
+ "A human-readable explanation specific to this occurrence of the problem. Like `title`, this field's value can be localized."
60
+ ),
61
+ source: ErrorSourceSchema.optional()
62
+ }).strict().describe(
63
+ "An error object provides additional information about problems encountered while performing an operation. Error objects MUST be returned as an array keyed by `errors` in the top level of a JSON:API document."
64
+ );
65
+ var ErrorsResponseSchema = import_zod.z.object({
66
+ errors: import_zod.z.array(ErrorObjectSchema).describe("A collection of the errors returned.")
67
+ }).describe(
68
+ "A JSON:API error response document containing an array of error objects."
69
+ );
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ ErrorCodeSchema,
73
+ ErrorObjectSchema,
74
+ ErrorSourceSchema,
75
+ ErrorsResponseSchema
76
+ });
77
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/v0/schemas/errors.ts"],"sourcesContent":["/**\n * Error schema definitions for API error responses\n * Following JSON:API error object specification\n */\n\nimport { z } from \"zod\";\n\n/**\n * An application-specific error code, expressed as a string value.\n */\nexport const ErrorCodeSchema = z\n .string()\n .describe(\"An application-specific error code, expressed as a string value.\");\n\n/**\n * Identifies the source of the error within the request payload, if relevant.\n */\nexport const ErrorSourceSchema = z\n .object({\n pointer: z\n .string()\n .optional()\n .describe(\n \"A JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) to the associated entity in the request document [e.g. `/data` for a primary data object, or `/data/attributes/title` for a specific attribute].\",\n ),\n parameter: z\n .string()\n .optional()\n .describe(\n \"A string indicating which URI query parameter caused the error.\",\n ),\n header: z\n .string()\n .optional()\n .describe(\"A string indicating the header that caused the error.\"),\n })\n .strict()\n .nullable()\n .describe(\n \"Identifies the source of the error within the request payload, if relevant.\",\n );\n\n/**\n * An error object provides additional information about problems encountered while performing an operation.\n * Error objects MUST be returned as an array keyed by `errors` in the top level of a JSON:API document.\n */\nexport const ErrorObjectSchema = z\n .object({\n id: z\n .string()\n .nullable()\n .optional()\n .describe(\n \"A unique identifier for this particular occurrence of the problem.\",\n ),\n links: z\n .object({\n about: z\n .string()\n .url()\n .describe(\n \"A link that leads to further details about this particular occurrence of the problem.\",\n ),\n })\n .strict()\n .nullable()\n .optional()\n .describe(\"Relevant links about the error\"),\n status: z\n .string()\n .optional()\n .describe(\n \"The HTTP status code applicable to this problem, expressed as a string value.\",\n ),\n code: ErrorCodeSchema.optional(),\n title: z\n .string()\n .optional()\n .describe(\n \"A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.\",\n ),\n detail: z\n .string()\n .optional()\n .describe(\n \"A human-readable explanation specific to this occurrence of the problem. Like `title`, this field's value can be localized.\",\n ),\n source: ErrorSourceSchema.optional(),\n })\n .strict()\n .describe(\n \"An error object provides additional information about problems encountered while performing an operation. Error objects MUST be returned as an array keyed by `errors` in the top level of a JSON:API document.\",\n );\n\n/**\n * A JSON:API error response document containing an array of error objects.\n */\nexport const ErrorsResponseSchema = z\n .object({\n errors: z\n .array(ErrorObjectSchema)\n .describe(\"A collection of the errors returned.\"),\n })\n .describe(\n \"A JSON:API error response document containing an array of error objects.\",\n );\n\n// Export TypeScript types\nexport type ErrorCode = z.infer<typeof ErrorCodeSchema>;\nexport type ErrorSource = z.infer<typeof ErrorSourceSchema>;\nexport type ErrorObject = z.infer<typeof ErrorObjectSchema>;\nexport type ErrorsResponse = z.infer<typeof ErrorsResponseSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,iBAAkB;AAKX,IAAM,kBAAkB,aAC5B,OAAO,EACP,SAAS,kEAAkE;AAKvE,IAAM,oBAAoB,aAC9B,OAAO;AAAA,EACN,SAAS,aACN,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,WAAW,aACR,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP,SAAS,EACT,SAAS,uDAAuD;AACrE,CAAC,EACA,OAAO,EACP,SAAS,EACT;AAAA,EACC;AACF;AAMK,IAAM,oBAAoB,aAC9B,OAAO;AAAA,EACN,IAAI,aACD,OAAO,EACP,SAAS,EACT,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,aACJ,OAAO;AAAA,IACN,OAAO,aACJ,OAAO,EACP,IAAI,EACJ;AAAA,MACC;AAAA,IACF;AAAA,EACJ,CAAC,EACA,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,gCAAgC;AAAA,EAC5C,QAAQ,aACL,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,MAAM,gBAAgB,SAAS;AAAA,EAC/B,OAAO,aACJ,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,kBAAkB,SAAS;AACrC,CAAC,EACA,OAAO,EACP;AAAA,EACC;AACF;AAKK,IAAM,uBAAuB,aACjC,OAAO;AAAA,EACN,QAAQ,aACL,MAAM,iBAAiB,EACvB,SAAS,sCAAsC;AACpD,CAAC,EACA;AAAA,EACC;AACF;","names":[]}
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Error schema definitions for API error responses
5
+ * Following JSON:API error object specification
6
+ */
7
+
8
+ /**
9
+ * An application-specific error code, expressed as a string value.
10
+ */
11
+ declare const ErrorCodeSchema: z.ZodString;
12
+ /**
13
+ * Identifies the source of the error within the request payload, if relevant.
14
+ */
15
+ declare const ErrorSourceSchema: z.ZodNullable<z.ZodObject<{
16
+ pointer: z.ZodOptional<z.ZodString>;
17
+ parameter: z.ZodOptional<z.ZodString>;
18
+ header: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strict>>;
20
+ /**
21
+ * An error object provides additional information about problems encountered while performing an operation.
22
+ * Error objects MUST be returned as an array keyed by `errors` in the top level of a JSON:API document.
23
+ */
24
+ declare const ErrorObjectSchema: z.ZodObject<{
25
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ links: z.ZodOptional<z.ZodNullable<z.ZodObject<{
27
+ about: z.ZodString;
28
+ }, z.core.$strict>>>;
29
+ status: z.ZodOptional<z.ZodString>;
30
+ code: z.ZodOptional<z.ZodString>;
31
+ title: z.ZodOptional<z.ZodString>;
32
+ detail: z.ZodOptional<z.ZodString>;
33
+ source: z.ZodOptional<z.ZodNullable<z.ZodObject<{
34
+ pointer: z.ZodOptional<z.ZodString>;
35
+ parameter: z.ZodOptional<z.ZodString>;
36
+ header: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strict>>>;
38
+ }, z.core.$strict>;
39
+ /**
40
+ * A JSON:API error response document containing an array of error objects.
41
+ */
42
+ declare const ErrorsResponseSchema: z.ZodObject<{
43
+ errors: z.ZodArray<z.ZodObject<{
44
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ links: z.ZodOptional<z.ZodNullable<z.ZodObject<{
46
+ about: z.ZodString;
47
+ }, z.core.$strict>>>;
48
+ status: z.ZodOptional<z.ZodString>;
49
+ code: z.ZodOptional<z.ZodString>;
50
+ title: z.ZodOptional<z.ZodString>;
51
+ detail: z.ZodOptional<z.ZodString>;
52
+ source: z.ZodOptional<z.ZodNullable<z.ZodObject<{
53
+ pointer: z.ZodOptional<z.ZodString>;
54
+ parameter: z.ZodOptional<z.ZodString>;
55
+ header: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strict>>>;
57
+ }, z.core.$strict>>;
58
+ }, z.core.$strip>;
59
+ type ErrorCode = z.infer<typeof ErrorCodeSchema>;
60
+ type ErrorSource = z.infer<typeof ErrorSourceSchema>;
61
+ type ErrorObject = z.infer<typeof ErrorObjectSchema>;
62
+ type ErrorsResponse = z.infer<typeof ErrorsResponseSchema>;
63
+
64
+ export { type ErrorCode, ErrorCodeSchema, type ErrorObject, ErrorObjectSchema, type ErrorSource, ErrorSourceSchema, type ErrorsResponse, ErrorsResponseSchema };
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Error schema definitions for API error responses
5
+ * Following JSON:API error object specification
6
+ */
7
+
8
+ /**
9
+ * An application-specific error code, expressed as a string value.
10
+ */
11
+ declare const ErrorCodeSchema: z.ZodString;
12
+ /**
13
+ * Identifies the source of the error within the request payload, if relevant.
14
+ */
15
+ declare const ErrorSourceSchema: z.ZodNullable<z.ZodObject<{
16
+ pointer: z.ZodOptional<z.ZodString>;
17
+ parameter: z.ZodOptional<z.ZodString>;
18
+ header: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strict>>;
20
+ /**
21
+ * An error object provides additional information about problems encountered while performing an operation.
22
+ * Error objects MUST be returned as an array keyed by `errors` in the top level of a JSON:API document.
23
+ */
24
+ declare const ErrorObjectSchema: z.ZodObject<{
25
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ links: z.ZodOptional<z.ZodNullable<z.ZodObject<{
27
+ about: z.ZodString;
28
+ }, z.core.$strict>>>;
29
+ status: z.ZodOptional<z.ZodString>;
30
+ code: z.ZodOptional<z.ZodString>;
31
+ title: z.ZodOptional<z.ZodString>;
32
+ detail: z.ZodOptional<z.ZodString>;
33
+ source: z.ZodOptional<z.ZodNullable<z.ZodObject<{
34
+ pointer: z.ZodOptional<z.ZodString>;
35
+ parameter: z.ZodOptional<z.ZodString>;
36
+ header: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strict>>>;
38
+ }, z.core.$strict>;
39
+ /**
40
+ * A JSON:API error response document containing an array of error objects.
41
+ */
42
+ declare const ErrorsResponseSchema: z.ZodObject<{
43
+ errors: z.ZodArray<z.ZodObject<{
44
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ links: z.ZodOptional<z.ZodNullable<z.ZodObject<{
46
+ about: z.ZodString;
47
+ }, z.core.$strict>>>;
48
+ status: z.ZodOptional<z.ZodString>;
49
+ code: z.ZodOptional<z.ZodString>;
50
+ title: z.ZodOptional<z.ZodString>;
51
+ detail: z.ZodOptional<z.ZodString>;
52
+ source: z.ZodOptional<z.ZodNullable<z.ZodObject<{
53
+ pointer: z.ZodOptional<z.ZodString>;
54
+ parameter: z.ZodOptional<z.ZodString>;
55
+ header: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strict>>>;
57
+ }, z.core.$strict>>;
58
+ }, z.core.$strip>;
59
+ type ErrorCode = z.infer<typeof ErrorCodeSchema>;
60
+ type ErrorSource = z.infer<typeof ErrorSourceSchema>;
61
+ type ErrorObject = z.infer<typeof ErrorObjectSchema>;
62
+ type ErrorsResponse = z.infer<typeof ErrorsResponseSchema>;
63
+
64
+ export { type ErrorCode, ErrorCodeSchema, type ErrorObject, ErrorObjectSchema, type ErrorSource, ErrorSourceSchema, type ErrorsResponse, ErrorsResponseSchema };