@zapier/zapier-sdk-core 0.10.0 → 0.11.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.
- package/CHANGELOG.md +6 -0
- package/dist/v0/config/metadata.cjs +4 -0
- package/dist/v0/config/metadata.cjs.map +1 -1
- package/dist/v0/config/metadata.js +4 -0
- package/dist/v0/config/metadata.js.map +1 -1
- package/dist/v0/schemas/approvals.cjs +45 -0
- package/dist/v0/schemas/approvals.cjs.map +1 -0
- package/dist/v0/schemas/approvals.d.cts +37 -0
- package/dist/v0/schemas/approvals.d.ts +37 -0
- package/dist/v0/schemas/approvals.js +18 -0
- package/dist/v0/schemas/approvals.js.map +1 -0
- package/openapi.yaml +76 -0
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-core
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- eb026a9: Add `GET /api/v0/approvals/{approvalId}` polling endpoint. The SDK uses this to poll approval status. On resolution, sdkapi invalidates the token-exchange cache so the next request re-fetches a fresh JWT with the updated `policy_urn`.
|
|
8
|
+
|
|
3
9
|
## 0.10.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/v0/config/metadata.ts"],"sourcesContent":["/**\n * OpenAPI specification metadata\n *\n * This file contains all the base metadata for the OpenAPI specification\n * that was previously stored in openapi-base.yaml.\n *\n * Note on 'as const' usage:\n * - We use 'as const' on literal values that should be treated as enums\n * (e.g., \"apiKey\", \"header\", \"3.1.0\") to get precise literal types\n * - We avoid 'as const' on top-level configuration objects to prevent\n * deep readonly types that can cause compatibility issues with libraries\n * expecting mutable types (like zod-to-openapi)\n * - If you encounter readonly type errors, check whether the consuming\n * library expects mutable types and remove 'as const' accordingly\n */\n\nexport const apiInfo = {\n title: \"Zapier SDK API\",\n version: \"1.0.0\",\n contact: {\n email: \"engineering@zapier.com\",\n },\n description: \"The Zapier SDK API serves as a backend for the Zapier SDK.\",\n};\n\nexport const servers: Array<{ url: string; description: string }> = [];\n\nexport const tags = [\n {\n name: \"Actions\",\n description: \"Action-related routes\",\n },\n {\n name: \"Apps\",\n description: \"App-related routes\",\n },\n {\n name: \"Authentications\",\n description: \"Authentication-related routes (deprecated, use Connections)\",\n },\n {\n name: \"Client Credentials\",\n description: \"Client credentials management routes\",\n },\n {\n name: \"Connections\",\n description: \"Connection-related routes\",\n },\n {\n name: \"Deduplication\",\n description: \"Deduplication-related routes\",\n },\n {\n name: \"Documentation\",\n description: \"Documentation-related routes\",\n },\n];\n\n/**\n * Security schemes for OpenAPI specification\n *\n * Note: 'as const' is used on enum-like literal values (\"apiKey\", \"header\")\n * to ensure TypeScript treats them as literal types rather than generic strings.\n * This provides better type safety when the OpenAPI generator validates these values.\n */\nexport const securitySchemes = {\n userJwt: {\n type: \"apiKey\" as const,\n in: \"header\" as const,\n name: \"Authorization\",\n description:\n \"Format should be `JWT <your-jwt>` (you must ensure that the JWT prefix \" +\n \"is included in your requests).\\\\n\\\\n\" +\n \"Example: `Authorization: JWT your.jwt.value.here`\",\n },\n} as const;\n\n/**\n * Complete OpenAPI metadata for document generation\n */\nexport const openApiMetadata = {\n openapi: \"3.1.0\" as const,\n info: apiInfo,\n servers,\n tags,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,IAAM,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,aAAa;AACf;AAEO,IAAM,UAAuD,CAAC;AAE9D,IAAM,OAAO;AAAA,EAClB;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AACF;AASO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,IACP,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EAGJ;AACF;AAKO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,MAAM;AAAA,EACN;AAAA,EACA;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/v0/config/metadata.ts"],"sourcesContent":["/**\n * OpenAPI specification metadata\n *\n * This file contains all the base metadata for the OpenAPI specification\n * that was previously stored in openapi-base.yaml.\n *\n * Note on 'as const' usage:\n * - We use 'as const' on literal values that should be treated as enums\n * (e.g., \"apiKey\", \"header\", \"3.1.0\") to get precise literal types\n * - We avoid 'as const' on top-level configuration objects to prevent\n * deep readonly types that can cause compatibility issues with libraries\n * expecting mutable types (like zod-to-openapi)\n * - If you encounter readonly type errors, check whether the consuming\n * library expects mutable types and remove 'as const' accordingly\n */\n\nexport const apiInfo = {\n title: \"Zapier SDK API\",\n version: \"1.0.0\",\n contact: {\n email: \"engineering@zapier.com\",\n },\n description: \"The Zapier SDK API serves as a backend for the Zapier SDK.\",\n};\n\nexport const servers: Array<{ url: string; description: string }> = [];\n\nexport const tags = [\n {\n name: \"Actions\",\n description: \"Action-related routes\",\n },\n {\n name: \"Apps\",\n description: \"App-related routes\",\n },\n {\n name: \"Authentications\",\n description: \"Authentication-related routes (deprecated, use Connections)\",\n },\n {\n name: \"Client Credentials\",\n description: \"Client credentials management routes\",\n },\n {\n name: \"Connections\",\n description: \"Connection-related routes\",\n },\n {\n name: \"Deduplication\",\n description: \"Deduplication-related routes\",\n },\n {\n name: \"Documentation\",\n description: \"Documentation-related routes\",\n },\n {\n name: \"Approvals\",\n description: \"Approval request management routes\",\n },\n];\n\n/**\n * Security schemes for OpenAPI specification\n *\n * Note: 'as const' is used on enum-like literal values (\"apiKey\", \"header\")\n * to ensure TypeScript treats them as literal types rather than generic strings.\n * This provides better type safety when the OpenAPI generator validates these values.\n */\nexport const securitySchemes = {\n userJwt: {\n type: \"apiKey\" as const,\n in: \"header\" as const,\n name: \"Authorization\",\n description:\n \"Format should be `JWT <your-jwt>` (you must ensure that the JWT prefix \" +\n \"is included in your requests).\\\\n\\\\n\" +\n \"Example: `Authorization: JWT your.jwt.value.here`\",\n },\n} as const;\n\n/**\n * Complete OpenAPI metadata for document generation\n */\nexport const openApiMetadata = {\n openapi: \"3.1.0\" as const,\n info: apiInfo,\n servers,\n tags,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,IAAM,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,aAAa;AACf;AAEO,IAAM,UAAuD,CAAC;AAE9D,IAAM,OAAO;AAAA,EAClB;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AACF;AASO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,IACP,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EAGJ;AACF;AAKO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,MAAM;AAAA,EACN;AAAA,EACA;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/v0/config/metadata.ts"],"sourcesContent":["/**\n * OpenAPI specification metadata\n *\n * This file contains all the base metadata for the OpenAPI specification\n * that was previously stored in openapi-base.yaml.\n *\n * Note on 'as const' usage:\n * - We use 'as const' on literal values that should be treated as enums\n * (e.g., \"apiKey\", \"header\", \"3.1.0\") to get precise literal types\n * - We avoid 'as const' on top-level configuration objects to prevent\n * deep readonly types that can cause compatibility issues with libraries\n * expecting mutable types (like zod-to-openapi)\n * - If you encounter readonly type errors, check whether the consuming\n * library expects mutable types and remove 'as const' accordingly\n */\n\nexport const apiInfo = {\n title: \"Zapier SDK API\",\n version: \"1.0.0\",\n contact: {\n email: \"engineering@zapier.com\",\n },\n description: \"The Zapier SDK API serves as a backend for the Zapier SDK.\",\n};\n\nexport const servers: Array<{ url: string; description: string }> = [];\n\nexport const tags = [\n {\n name: \"Actions\",\n description: \"Action-related routes\",\n },\n {\n name: \"Apps\",\n description: \"App-related routes\",\n },\n {\n name: \"Authentications\",\n description: \"Authentication-related routes (deprecated, use Connections)\",\n },\n {\n name: \"Client Credentials\",\n description: \"Client credentials management routes\",\n },\n {\n name: \"Connections\",\n description: \"Connection-related routes\",\n },\n {\n name: \"Deduplication\",\n description: \"Deduplication-related routes\",\n },\n {\n name: \"Documentation\",\n description: \"Documentation-related routes\",\n },\n];\n\n/**\n * Security schemes for OpenAPI specification\n *\n * Note: 'as const' is used on enum-like literal values (\"apiKey\", \"header\")\n * to ensure TypeScript treats them as literal types rather than generic strings.\n * This provides better type safety when the OpenAPI generator validates these values.\n */\nexport const securitySchemes = {\n userJwt: {\n type: \"apiKey\" as const,\n in: \"header\" as const,\n name: \"Authorization\",\n description:\n \"Format should be `JWT <your-jwt>` (you must ensure that the JWT prefix \" +\n \"is included in your requests).\\\\n\\\\n\" +\n \"Example: `Authorization: JWT your.jwt.value.here`\",\n },\n} as const;\n\n/**\n * Complete OpenAPI metadata for document generation\n */\nexport const openApiMetadata = {\n openapi: \"3.1.0\" as const,\n info: apiInfo,\n servers,\n tags,\n};\n"],"mappings":";AAgBO,IAAM,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,aAAa;AACf;AAEO,IAAM,UAAuD,CAAC;AAE9D,IAAM,OAAO;AAAA,EAClB;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AACF;AASO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,IACP,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EAGJ;AACF;AAKO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,MAAM;AAAA,EACN;AAAA,EACA;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/v0/config/metadata.ts"],"sourcesContent":["/**\n * OpenAPI specification metadata\n *\n * This file contains all the base metadata for the OpenAPI specification\n * that was previously stored in openapi-base.yaml.\n *\n * Note on 'as const' usage:\n * - We use 'as const' on literal values that should be treated as enums\n * (e.g., \"apiKey\", \"header\", \"3.1.0\") to get precise literal types\n * - We avoid 'as const' on top-level configuration objects to prevent\n * deep readonly types that can cause compatibility issues with libraries\n * expecting mutable types (like zod-to-openapi)\n * - If you encounter readonly type errors, check whether the consuming\n * library expects mutable types and remove 'as const' accordingly\n */\n\nexport const apiInfo = {\n title: \"Zapier SDK API\",\n version: \"1.0.0\",\n contact: {\n email: \"engineering@zapier.com\",\n },\n description: \"The Zapier SDK API serves as a backend for the Zapier SDK.\",\n};\n\nexport const servers: Array<{ url: string; description: string }> = [];\n\nexport const tags = [\n {\n name: \"Actions\",\n description: \"Action-related routes\",\n },\n {\n name: \"Apps\",\n description: \"App-related routes\",\n },\n {\n name: \"Authentications\",\n description: \"Authentication-related routes (deprecated, use Connections)\",\n },\n {\n name: \"Client Credentials\",\n description: \"Client credentials management routes\",\n },\n {\n name: \"Connections\",\n description: \"Connection-related routes\",\n },\n {\n name: \"Deduplication\",\n description: \"Deduplication-related routes\",\n },\n {\n name: \"Documentation\",\n description: \"Documentation-related routes\",\n },\n {\n name: \"Approvals\",\n description: \"Approval request management routes\",\n },\n];\n\n/**\n * Security schemes for OpenAPI specification\n *\n * Note: 'as const' is used on enum-like literal values (\"apiKey\", \"header\")\n * to ensure TypeScript treats them as literal types rather than generic strings.\n * This provides better type safety when the OpenAPI generator validates these values.\n */\nexport const securitySchemes = {\n userJwt: {\n type: \"apiKey\" as const,\n in: \"header\" as const,\n name: \"Authorization\",\n description:\n \"Format should be `JWT <your-jwt>` (you must ensure that the JWT prefix \" +\n \"is included in your requests).\\\\n\\\\n\" +\n \"Example: `Authorization: JWT your.jwt.value.here`\",\n },\n} as const;\n\n/**\n * Complete OpenAPI metadata for document generation\n */\nexport const openApiMetadata = {\n openapi: \"3.1.0\" as const,\n info: apiInfo,\n servers,\n tags,\n};\n"],"mappings":";AAgBO,IAAM,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,aAAa;AACf;AAEO,IAAM,UAAuD,CAAC;AAE9D,IAAM,OAAO;AAAA,EAClB;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AACF;AASO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,IACP,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EAGJ;AACF;AAKO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,MAAM;AAAA,EACN;AAAA,EACA;AACF;","names":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
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/approvals.ts
|
|
21
|
+
var approvals_exports = {};
|
|
22
|
+
__export(approvals_exports, {
|
|
23
|
+
ApprovalResponseSchema: () => ApprovalResponseSchema,
|
|
24
|
+
ApprovalStatusSchema: () => ApprovalStatusSchema,
|
|
25
|
+
GetApprovalParamSchema: () => GetApprovalParamSchema
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(approvals_exports);
|
|
28
|
+
var import_zod = require("zod");
|
|
29
|
+
var ApprovalStatusSchema = import_zod.z.enum(["pending_approval", "approved", "denied"]).describe("The current status of the approval request");
|
|
30
|
+
var ApprovalResponseSchema = import_zod.z.object({
|
|
31
|
+
status: ApprovalStatusSchema,
|
|
32
|
+
approval_id: import_zod.z.string().describe("Unique identifier for the approval request"),
|
|
33
|
+
approval_url: import_zod.z.string().optional().describe("URL for the user to visit and approve/deny the request"),
|
|
34
|
+
poll_url: import_zod.z.string().optional().describe("URL for the SDK to poll for status changes")
|
|
35
|
+
});
|
|
36
|
+
var GetApprovalParamSchema = import_zod.z.object({
|
|
37
|
+
approvalId: import_zod.z.string().describe("The unique identifier of the approval request")
|
|
38
|
+
});
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
ApprovalResponseSchema,
|
|
42
|
+
ApprovalStatusSchema,
|
|
43
|
+
GetApprovalParamSchema
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=approvals.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/v0/schemas/approvals.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Shared approval schemas used by both route definitions and core models.\n */\n\n/**\n * Approval status enum\n */\nexport const ApprovalStatusSchema = z\n .enum([\"pending_approval\", \"approved\", \"denied\"])\n .describe(\"The current status of the approval request\");\n\n/**\n * Approval response shape returned by both the poll endpoint and the 202 proxy response.\n */\nexport const ApprovalResponseSchema = z.object({\n status: ApprovalStatusSchema,\n approval_id: z\n .string()\n .describe(\"Unique identifier for the approval request\"),\n approval_url: z\n .string()\n .optional()\n .describe(\"URL for the user to visit and approve/deny the request\"),\n poll_url: z\n .string()\n .optional()\n .describe(\"URL for the SDK to poll for status changes\"),\n});\n\nexport type ApprovalStatus = z.infer<typeof ApprovalStatusSchema>;\nexport type ApprovalResponse = z.infer<typeof ApprovalResponseSchema>;\n\n/**\n * Path parameters for get approval\n */\nexport const GetApprovalParamSchema = z.object({\n approvalId: z\n .string()\n .describe(\"The unique identifier of the approval request\"),\n});\n\nexport type GetApprovalParam = z.infer<typeof GetApprovalParamSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AASX,IAAM,uBAAuB,aACjC,KAAK,CAAC,oBAAoB,YAAY,QAAQ,CAAC,EAC/C,SAAS,4CAA4C;AAKjD,IAAM,yBAAyB,aAAE,OAAO;AAAA,EAC7C,QAAQ;AAAA,EACR,aAAa,aACV,OAAO,EACP,SAAS,4CAA4C;AAAA,EACxD,cAAc,aACX,OAAO,EACP,SAAS,EACT,SAAS,wDAAwD;AAAA,EACpE,UAAU,aACP,OAAO,EACP,SAAS,EACT,SAAS,4CAA4C;AAC1D,CAAC;AAQM,IAAM,yBAAyB,aAAE,OAAO;AAAA,EAC7C,YAAY,aACT,OAAO,EACP,SAAS,+CAA+C;AAC7D,CAAC;","names":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared approval schemas used by both route definitions and core models.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Approval status enum
|
|
8
|
+
*/
|
|
9
|
+
declare const ApprovalStatusSchema: z.ZodEnum<{
|
|
10
|
+
pending_approval: "pending_approval";
|
|
11
|
+
approved: "approved";
|
|
12
|
+
denied: "denied";
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Approval response shape returned by both the poll endpoint and the 202 proxy response.
|
|
16
|
+
*/
|
|
17
|
+
declare const ApprovalResponseSchema: z.ZodObject<{
|
|
18
|
+
status: z.ZodEnum<{
|
|
19
|
+
pending_approval: "pending_approval";
|
|
20
|
+
approved: "approved";
|
|
21
|
+
denied: "denied";
|
|
22
|
+
}>;
|
|
23
|
+
approval_id: z.ZodString;
|
|
24
|
+
approval_url: z.ZodOptional<z.ZodString>;
|
|
25
|
+
poll_url: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
type ApprovalStatus = z.infer<typeof ApprovalStatusSchema>;
|
|
28
|
+
type ApprovalResponse = z.infer<typeof ApprovalResponseSchema>;
|
|
29
|
+
/**
|
|
30
|
+
* Path parameters for get approval
|
|
31
|
+
*/
|
|
32
|
+
declare const GetApprovalParamSchema: z.ZodObject<{
|
|
33
|
+
approvalId: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
type GetApprovalParam = z.infer<typeof GetApprovalParamSchema>;
|
|
36
|
+
|
|
37
|
+
export { type ApprovalResponse, ApprovalResponseSchema, type ApprovalStatus, ApprovalStatusSchema, type GetApprovalParam, GetApprovalParamSchema };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared approval schemas used by both route definitions and core models.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Approval status enum
|
|
8
|
+
*/
|
|
9
|
+
declare const ApprovalStatusSchema: z.ZodEnum<{
|
|
10
|
+
pending_approval: "pending_approval";
|
|
11
|
+
approved: "approved";
|
|
12
|
+
denied: "denied";
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Approval response shape returned by both the poll endpoint and the 202 proxy response.
|
|
16
|
+
*/
|
|
17
|
+
declare const ApprovalResponseSchema: z.ZodObject<{
|
|
18
|
+
status: z.ZodEnum<{
|
|
19
|
+
pending_approval: "pending_approval";
|
|
20
|
+
approved: "approved";
|
|
21
|
+
denied: "denied";
|
|
22
|
+
}>;
|
|
23
|
+
approval_id: z.ZodString;
|
|
24
|
+
approval_url: z.ZodOptional<z.ZodString>;
|
|
25
|
+
poll_url: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
type ApprovalStatus = z.infer<typeof ApprovalStatusSchema>;
|
|
28
|
+
type ApprovalResponse = z.infer<typeof ApprovalResponseSchema>;
|
|
29
|
+
/**
|
|
30
|
+
* Path parameters for get approval
|
|
31
|
+
*/
|
|
32
|
+
declare const GetApprovalParamSchema: z.ZodObject<{
|
|
33
|
+
approvalId: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
type GetApprovalParam = z.infer<typeof GetApprovalParamSchema>;
|
|
36
|
+
|
|
37
|
+
export { type ApprovalResponse, ApprovalResponseSchema, type ApprovalStatus, ApprovalStatusSchema, type GetApprovalParam, GetApprovalParamSchema };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/v0/schemas/approvals.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var ApprovalStatusSchema = z.enum(["pending_approval", "approved", "denied"]).describe("The current status of the approval request");
|
|
4
|
+
var ApprovalResponseSchema = z.object({
|
|
5
|
+
status: ApprovalStatusSchema,
|
|
6
|
+
approval_id: z.string().describe("Unique identifier for the approval request"),
|
|
7
|
+
approval_url: z.string().optional().describe("URL for the user to visit and approve/deny the request"),
|
|
8
|
+
poll_url: z.string().optional().describe("URL for the SDK to poll for status changes")
|
|
9
|
+
});
|
|
10
|
+
var GetApprovalParamSchema = z.object({
|
|
11
|
+
approvalId: z.string().describe("The unique identifier of the approval request")
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
ApprovalResponseSchema,
|
|
15
|
+
ApprovalStatusSchema,
|
|
16
|
+
GetApprovalParamSchema
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=approvals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/v0/schemas/approvals.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Shared approval schemas used by both route definitions and core models.\n */\n\n/**\n * Approval status enum\n */\nexport const ApprovalStatusSchema = z\n .enum([\"pending_approval\", \"approved\", \"denied\"])\n .describe(\"The current status of the approval request\");\n\n/**\n * Approval response shape returned by both the poll endpoint and the 202 proxy response.\n */\nexport const ApprovalResponseSchema = z.object({\n status: ApprovalStatusSchema,\n approval_id: z\n .string()\n .describe(\"Unique identifier for the approval request\"),\n approval_url: z\n .string()\n .optional()\n .describe(\"URL for the user to visit and approve/deny the request\"),\n poll_url: z\n .string()\n .optional()\n .describe(\"URL for the SDK to poll for status changes\"),\n});\n\nexport type ApprovalStatus = z.infer<typeof ApprovalStatusSchema>;\nexport type ApprovalResponse = z.infer<typeof ApprovalResponseSchema>;\n\n/**\n * Path parameters for get approval\n */\nexport const GetApprovalParamSchema = z.object({\n approvalId: z\n .string()\n .describe(\"The unique identifier of the approval request\"),\n});\n\nexport type GetApprovalParam = z.infer<typeof GetApprovalParamSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AASX,IAAM,uBAAuB,EACjC,KAAK,CAAC,oBAAoB,YAAY,QAAQ,CAAC,EAC/C,SAAS,4CAA4C;AAKjD,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,QAAQ;AAAA,EACR,aAAa,EACV,OAAO,EACP,SAAS,4CAA4C;AAAA,EACxD,cAAc,EACX,OAAO,EACP,SAAS,EACT,SAAS,wDAAwD;AAAA,EACpE,UAAU,EACP,OAAO,EACP,SAAS,EACT,SAAS,4CAA4C;AAC1D,CAAC;AAQM,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,YAAY,EACT,OAAO,EACP,SAAS,+CAA+C;AAC7D,CAAC;","names":[]}
|
package/openapi.yaml
CHANGED
|
@@ -25,6 +25,8 @@ tags:
|
|
|
25
25
|
description: Deduplication-related routes
|
|
26
26
|
- name: Documentation
|
|
27
27
|
description: Documentation-related routes
|
|
28
|
+
- name: Approvals
|
|
29
|
+
description: Approval request management routes
|
|
28
30
|
components:
|
|
29
31
|
schemas:
|
|
30
32
|
ErrorCode:
|
|
@@ -249,6 +251,28 @@ components:
|
|
|
249
251
|
- name
|
|
250
252
|
- allowed_scopes
|
|
251
253
|
description: Request body for creating client credentials
|
|
254
|
+
ApprovalResponse:
|
|
255
|
+
type: object
|
|
256
|
+
properties:
|
|
257
|
+
status:
|
|
258
|
+
type: string
|
|
259
|
+
enum:
|
|
260
|
+
- pending_approval
|
|
261
|
+
- approved
|
|
262
|
+
- denied
|
|
263
|
+
description: The current status of the approval request
|
|
264
|
+
approval_id:
|
|
265
|
+
type: string
|
|
266
|
+
description: Unique identifier for the approval request
|
|
267
|
+
approval_url:
|
|
268
|
+
type: string
|
|
269
|
+
description: URL for the user to visit and approve/deny the request
|
|
270
|
+
poll_url:
|
|
271
|
+
type: string
|
|
272
|
+
description: URL for the SDK to poll for status changes
|
|
273
|
+
required:
|
|
274
|
+
- status
|
|
275
|
+
- approval_id
|
|
252
276
|
AuthenticationItem:
|
|
253
277
|
type: object
|
|
254
278
|
properties:
|
|
@@ -1455,6 +1479,58 @@ paths:
|
|
|
1455
1479
|
headers: *a6
|
|
1456
1480
|
content:
|
|
1457
1481
|
application/json: *a7
|
|
1482
|
+
/api/v0/approvals/{approvalId}:
|
|
1483
|
+
get:
|
|
1484
|
+
summary: Get approval status
|
|
1485
|
+
description: Returns the current status of an approval request. Used by the SDK to poll for approval resolution.
|
|
1486
|
+
tags:
|
|
1487
|
+
- Approvals
|
|
1488
|
+
operationId: v0_get_approval
|
|
1489
|
+
security:
|
|
1490
|
+
- userJwt: []
|
|
1491
|
+
parameters:
|
|
1492
|
+
- schema:
|
|
1493
|
+
type: string
|
|
1494
|
+
description: The unique identifier of the approval request
|
|
1495
|
+
required: true
|
|
1496
|
+
description: The unique identifier of the approval request
|
|
1497
|
+
name: approvalId
|
|
1498
|
+
in: path
|
|
1499
|
+
responses:
|
|
1500
|
+
"200":
|
|
1501
|
+
description: Success
|
|
1502
|
+
content:
|
|
1503
|
+
application/json:
|
|
1504
|
+
schema:
|
|
1505
|
+
$ref: "#/components/schemas/ApprovalResponse"
|
|
1506
|
+
"400":
|
|
1507
|
+
description: Bad Request
|
|
1508
|
+
content:
|
|
1509
|
+
application/json: *a1
|
|
1510
|
+
"401":
|
|
1511
|
+
description: Unauthorized
|
|
1512
|
+
content:
|
|
1513
|
+
application/json: *a2
|
|
1514
|
+
"404":
|
|
1515
|
+
description: Approval not found
|
|
1516
|
+
content:
|
|
1517
|
+
application/json:
|
|
1518
|
+
schema:
|
|
1519
|
+
$ref: "#/components/schemas/ErrorsResponse"
|
|
1520
|
+
"429":
|
|
1521
|
+
description: Too Many Requests
|
|
1522
|
+
headers: *a3
|
|
1523
|
+
content:
|
|
1524
|
+
application/json: *a4
|
|
1525
|
+
"500":
|
|
1526
|
+
description: Server Error
|
|
1527
|
+
content:
|
|
1528
|
+
application/json: *a5
|
|
1529
|
+
"503":
|
|
1530
|
+
description: Service Unavailable
|
|
1531
|
+
headers: *a6
|
|
1532
|
+
content:
|
|
1533
|
+
application/json: *a7
|
|
1458
1534
|
/api/v0/authentications/{authenticationId}:
|
|
1459
1535
|
get:
|
|
1460
1536
|
summary: Get an authentication
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/zapier-sdk-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Core schemas and TypeScript types for the Zapier SDK API",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Zapier, Inc.",
|
|
@@ -61,6 +61,11 @@
|
|
|
61
61
|
"import": "./dist/v0/schemas/client-credentials.js",
|
|
62
62
|
"require": "./dist/v0/schemas/client-credentials.cjs"
|
|
63
63
|
},
|
|
64
|
+
"./v0/schemas/approvals": {
|
|
65
|
+
"types": "./dist/v0/schemas/approvals.d.ts",
|
|
66
|
+
"import": "./dist/v0/schemas/approvals.js",
|
|
67
|
+
"require": "./dist/v0/schemas/approvals.cjs"
|
|
68
|
+
},
|
|
64
69
|
"./v0/common/responses": {
|
|
65
70
|
"types": "./dist/v0/common/responses.d.ts",
|
|
66
71
|
"import": "./dist/v0/common/responses.js",
|