@keystrokehq/docusign 0.0.1

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 (126) hide show
  1. package/README.md +248 -0
  2. package/dist/_official/index.d.mts +3 -0
  3. package/dist/_official/index.mjs +3 -0
  4. package/dist/_runtime/index.d.mts +1 -0
  5. package/dist/_runtime/index.mjs +1 -0
  6. package/dist/account-custom-fields.d.mts +65 -0
  7. package/dist/account-custom-fields.mjs +63 -0
  8. package/dist/account-stamps.d.mts +164 -0
  9. package/dist/account-stamps.mjs +144 -0
  10. package/dist/account-tabs.d.mts +90 -0
  11. package/dist/account-tabs.mjs +80 -0
  12. package/dist/account.d.mts +233 -0
  13. package/dist/account.mjs +207 -0
  14. package/dist/admin.d.mts +18 -0
  15. package/dist/admin.mjs +20 -0
  16. package/dist/auth.d.mts +37 -0
  17. package/dist/auth.mjs +53 -0
  18. package/dist/bcc-archive.d.mts +64 -0
  19. package/dist/bcc-archive.mjs +70 -0
  20. package/dist/billing.d.mts +217 -0
  21. package/dist/billing.mjs +208 -0
  22. package/dist/brands.d.mts +192 -0
  23. package/dist/brands.mjs +157 -0
  24. package/dist/bulk-send.d.mts +137 -0
  25. package/dist/bulk-send.mjs +115 -0
  26. package/dist/chunked-uploads.d.mts +78 -0
  27. package/dist/chunked-uploads.mjs +74 -0
  28. package/dist/click.d.mts +18 -0
  29. package/dist/click.mjs +20 -0
  30. package/dist/client.d.mts +47 -0
  31. package/dist/client.mjs +286 -0
  32. package/dist/clm.d.mts +18 -0
  33. package/dist/clm.mjs +20 -0
  34. package/dist/cloud-storage.d.mts +122 -0
  35. package/dist/cloud-storage.mjs +115 -0
  36. package/dist/connect.d.mts +252 -0
  37. package/dist/connect.mjs +217 -0
  38. package/dist/connection.d.mts +2 -0
  39. package/dist/connection.mjs +3 -0
  40. package/dist/contacts.d.mts +80 -0
  41. package/dist/contacts.mjs +79 -0
  42. package/dist/enote.d.mts +44 -0
  43. package/dist/enote.mjs +45 -0
  44. package/dist/envelope-attachments.d.mts +86 -0
  45. package/dist/envelope-attachments.mjs +76 -0
  46. package/dist/envelope-custom-fields.d.mts +166 -0
  47. package/dist/envelope-custom-fields.mjs +92 -0
  48. package/dist/envelope-documents.d.mts +271 -0
  49. package/dist/envelope-documents.mjs +219 -0
  50. package/dist/envelope-email.d.mts +65 -0
  51. package/dist/envelope-email.mjs +60 -0
  52. package/dist/envelope-lock.d.mts +65 -0
  53. package/dist/envelope-lock.mjs +60 -0
  54. package/dist/envelope-logs.d.mts +126 -0
  55. package/dist/envelope-logs.mjs +126 -0
  56. package/dist/envelope-notifications.d.mts +47 -0
  57. package/dist/envelope-notifications.mjs +44 -0
  58. package/dist/envelope-recipients.d.mts +171 -0
  59. package/dist/envelope-recipients.mjs +136 -0
  60. package/dist/envelope-tabs.d.mts +52 -0
  61. package/dist/envelope-tabs.mjs +49 -0
  62. package/dist/envelope-views.d.mts +99 -0
  63. package/dist/envelope-views.mjs +88 -0
  64. package/dist/envelope-workflow.d.mts +208 -0
  65. package/dist/envelope-workflow.mjs +176 -0
  66. package/dist/envelopes.d.mts +430 -0
  67. package/dist/envelopes.mjs +190 -0
  68. package/dist/errors.d.mts +48 -0
  69. package/dist/errors.mjs +76 -0
  70. package/dist/events.d.mts +192 -0
  71. package/dist/events.mjs +146 -0
  72. package/dist/factory-wViQTjgN.mjs +8 -0
  73. package/dist/groups.d.mts +191 -0
  74. package/dist/groups.mjs +146 -0
  75. package/dist/index.d.mts +1 -0
  76. package/dist/index.mjs +1 -0
  77. package/dist/integration-CmRztL9R.mjs +229 -0
  78. package/dist/integration-DqwHRkRh.d.mts +73 -0
  79. package/dist/messaging.d.mts +1 -0
  80. package/dist/messaging.mjs +1 -0
  81. package/dist/monitor.d.mts +18 -0
  82. package/dist/monitor.mjs +20 -0
  83. package/dist/notary.d.mts +129 -0
  84. package/dist/notary.mjs +122 -0
  85. package/dist/operation-helpers-BMTArRh9.mjs +102 -0
  86. package/dist/permission-profiles.d.mts +78 -0
  87. package/dist/permission-profiles.mjs +70 -0
  88. package/dist/power-forms.d.mts +51 -0
  89. package/dist/power-forms.mjs +62 -0
  90. package/dist/provider-app-CWp1SuI4.d.mts +88 -0
  91. package/dist/rooms.d.mts +18 -0
  92. package/dist/rooms.mjs +28 -0
  93. package/dist/schemas/index.d.mts +581 -0
  94. package/dist/schemas/index.mjs +309 -0
  95. package/dist/shared-DTUCJayR.mjs +27 -0
  96. package/dist/signing-groups.d.mts +139 -0
  97. package/dist/signing-groups.mjs +117 -0
  98. package/dist/template-custom-fields.d.mts +199 -0
  99. package/dist/template-custom-fields.mjs +107 -0
  100. package/dist/template-documents.d.mts +132 -0
  101. package/dist/template-documents.mjs +109 -0
  102. package/dist/template-lock.d.mts +65 -0
  103. package/dist/template-lock.mjs +60 -0
  104. package/dist/template-sharing.d.mts +129 -0
  105. package/dist/template-sharing.mjs +108 -0
  106. package/dist/template-workflow.d.mts +184 -0
  107. package/dist/template-workflow.mjs +152 -0
  108. package/dist/templates.d.mts +158 -0
  109. package/dist/templates.mjs +110 -0
  110. package/dist/triggers.d.mts +43 -0
  111. package/dist/triggers.mjs +91 -0
  112. package/dist/user-authorizations.d.mts +129 -0
  113. package/dist/user-authorizations.mjs +133 -0
  114. package/dist/user-custom-settings.d.mts +81 -0
  115. package/dist/user-custom-settings.mjs +69 -0
  116. package/dist/user-profile.d.mts +109 -0
  117. package/dist/user-profile.mjs +106 -0
  118. package/dist/user-signatures.d.mts +208 -0
  119. package/dist/user-signatures.mjs +180 -0
  120. package/dist/users.d.mts +128 -0
  121. package/dist/users.mjs +98 -0
  122. package/dist/verification.d.mts +19 -0
  123. package/dist/verification.mjs +59 -0
  124. package/dist/workspaces.d.mts +173 -0
  125. package/dist/workspaces.mjs +143 -0
  126. package/package.json +291 -0
package/README.md ADDED
@@ -0,0 +1,248 @@
1
+ # @keystrokehq/docusign
2
+
3
+ Official DocuSign integration for [Keystroke](https://github.com/keystrokehq/keystroke) — eSignature, templates, bulk send, Connect webhooks, and account/admin surfaces.
4
+
5
+ - **342** typed operations across 48 domain modules, covering the full Composio DocuSign catalog (v1 ships full runtime for the eSignature + Connect slice; `rooms`, `clm`, `admin`, `click`, `monitor` ship as plan-gated stubs).
6
+ - **25** direct-binding Connect webhook triggers with HMAC-SHA256 verification and multi-secret rotation.
7
+ - **OAuth 2.0 Authorization Code Grant** with provider-specific hooks that resolve `baseUri` + `accountId` via `/oauth/userinfo` on every connect and refresh.
8
+ - Hand-rolled typed `fetch` client — no Node-only dependencies. Runs in Cloudflare Workers / V8 isolates.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ pnpm add @keystrokehq/docusign
14
+ ```
15
+
16
+ Required peer deps (already workspace-linked inside the monorepo): `@keystrokehq/core`, `@keystrokehq/integration-authoring`, `zod` v4.
17
+
18
+ ## Connect the account
19
+
20
+ DocuSign connections are OAuth. Connect from the Keystroke CLI or a browser flow:
21
+
22
+ ```bash
23
+ keystroke connect docusign
24
+ ```
25
+
26
+ The OAuth exchange writes three values into the vault:
27
+
28
+ - `DOCUSIGN_ACCESS_TOKEN` — refreshable access token
29
+ - `DOCUSIGN_ACCOUNT_ID` — the default account id returned from `/oauth/userinfo`
30
+ - `DOCUSIGN_BASE_URI` — the region-scoped base URI (e.g. `https://na1.docusign.net`)
31
+
32
+ DocuSign routes accounts between regions (`na1..na4`, `eu`, `au`, `ca`). Every refresh re-resolves both `accountId` and `baseUri` so cached URIs never go stale.
33
+
34
+ ### Keystroke-managed DocuSign app
35
+
36
+ To enable the OAuth flow, set two env vars on the platform (the Keystroke deployment, not the user):
37
+
38
+ ```bash
39
+ KEYSTROKE_PLATFORM_DOCUSIGN_CLIENT_ID=<docusign-integrator-key>
40
+ KEYSTROKE_PLATFORM_DOCUSIGN_CLIENT_SECRET=<docusign-client-secret>
41
+ ```
42
+
43
+ To enable Connect webhook triggers, also configure the HMAC shared secrets (up to 10 for rotation, comma-separated, newest first):
44
+
45
+ ```bash
46
+ KEYSTROKE_PLATFORM_DOCUSIGN_CONNECT_HMAC_SECRETS=rotating-secret-1,rotating-secret-2
47
+ ```
48
+
49
+ ## Subpath imports
50
+
51
+ Authored code imports operations by domain. The package root is intentionally empty.
52
+
53
+ ```ts
54
+ import { docusign } from '@keystrokehq/docusign/connection';
55
+ import { createDocusignClient } from '@keystrokehq/docusign/client';
56
+ import { DocusignApiError } from '@keystrokehq/docusign/errors';
57
+ import { getEnvelope, sendEnvelope, voidEnvelope } from '@keystrokehq/docusign/envelopes';
58
+ import { listAllTemplates } from '@keystrokehq/docusign/templates';
59
+ import { webhooks } from '@keystrokehq/docusign/triggers';
60
+ ```
61
+
62
+ ### Full subpath catalog
63
+
64
+ | Surface | Subpath | Notes |
65
+ |---|---|---|
66
+ | Public connection | `@keystrokehq/docusign/connection` | `docusign` CredentialSet + `DocusignCredentials` type |
67
+ | Typed client | `@keystrokehq/docusign/client` | `createDocusignClient` — use inside custom operations |
68
+ | Error class | `@keystrokehq/docusign/errors` | `DocusignApiError` with discriminated `kind` |
69
+ | Shared schemas | `@keystrokehq/docusign/schemas` | `docusignEnvelopeSchema`, enums, helpers |
70
+ | Connect events | `@keystrokehq/docusign/events` | Per-family event schemas + name enums |
71
+ | Webhook triggers | `@keystrokehq/docusign/triggers` | `webhooks.*` direct-binding namespace |
72
+ | Webhook verification | `@keystrokehq/docusign/verification` | Multi-secret HMAC verifier |
73
+ | eSignature operations | `@keystrokehq/docusign/envelopes`, `/envelope-documents`, `/envelope-recipients`, `/envelope-tabs`, `/envelope-custom-fields`, `/envelope-attachments`, `/envelope-workflow`, `/envelope-views`, `/envelope-email`, `/envelope-notifications`, `/envelope-lock`, `/envelope-logs` | 95 operations |
74
+ | Template operations | `/templates`, `/template-documents`, `/template-custom-fields`, `/template-workflow`, `/template-lock`, `/template-sharing` | 47 operations |
75
+ | Bulk & transport | `/bulk-send`, `/chunked-uploads` | 13 operations |
76
+ | People | `/contacts`, `/users`, `/user-signatures`, `/user-profile`, `/user-authorizations`, `/user-custom-settings`, `/cloud-storage`, `/signing-groups`, `/groups`, `/permission-profiles` | 65 operations |
77
+ | Account admin | `/account`, `/account-custom-fields`, `/account-tabs`, `/account-stamps`, `/brands`, `/billing` | 66 operations |
78
+ | Integrations | `/connect`, `/workspaces`, `/notary`, `/enote`, `/bcc-archive`, `/power-forms`, `/auth` | 46 operations + 2 auth helpers |
79
+ | Plan-gated (stubs) | `/rooms`, `/clm`, `/admin`, `/click`, `/monitor` | Throw `DocusignApiError.notImplemented({ kind: 'plan_gated' })` |
80
+
81
+ Hidden surfaces used by the Keystroke platform only:
82
+
83
+ - `@keystrokehq/docusign/_official` — bundle definition; consumed by `@keystrokehq/official-integration-catalog`
84
+ - `@keystrokehq/docusign/_runtime` — hosted-runtime hooks
85
+ - `@keystrokehq/docusign/messaging` — internal credential sets (DocuSign App, Connect HMAC, JWT)
86
+
87
+ Do not import the hidden surfaces from end-user code.
88
+
89
+ ## Quickstart
90
+
91
+ ### Send an envelope
92
+
93
+ ```ts
94
+ import { sendEnvelope } from '@keystrokehq/docusign/envelopes';
95
+ import { Workflow } from '@keystrokehq/core';
96
+ import { z } from 'zod';
97
+
98
+ export const sendContract = new Workflow({
99
+ id: 'send-contract',
100
+ name: 'Send Contract',
101
+ input: z.object({
102
+ email: z.email(),
103
+ name: z.string().min(1),
104
+ documentBase64: z.string().min(1),
105
+ }),
106
+ output: z.object({ envelopeId: z.string().min(1) }),
107
+ run: async (input, ctx) => {
108
+ const result = await ctx.step(sendEnvelope, {
109
+ emailSubject: `Please sign — ${input.name}`,
110
+ status: 'sent',
111
+ documents: [
112
+ {
113
+ documentId: '1',
114
+ name: 'contract.pdf',
115
+ fileExtension: 'pdf',
116
+ documentBase64: input.documentBase64,
117
+ },
118
+ ],
119
+ recipients: {
120
+ signers: [
121
+ {
122
+ email: input.email,
123
+ name: input.name,
124
+ recipientId: '1',
125
+ routingOrder: '1',
126
+ },
127
+ ],
128
+ },
129
+ });
130
+ return { envelopeId: result.envelopeId ?? '' };
131
+ },
132
+ });
133
+ ```
134
+
135
+ ### Bind a Connect webhook
136
+
137
+ ```ts
138
+ import { webhooks } from '@keystrokehq/docusign/triggers';
139
+ import { Workflow } from '@keystrokehq/core';
140
+ import { z } from 'zod';
141
+
142
+ export const onEnvelopeCompleted = new Workflow({
143
+ id: 'on-envelope-completed',
144
+ name: 'On Envelope Completed',
145
+ trigger: webhooks.envelopeCompleted({
146
+ filter: (payload) => payload.data.envelopeSummary?.status === 'completed',
147
+ transform: (payload) => ({
148
+ envelopeId: payload.data.envelopeId,
149
+ signedAt: payload.generatedDateTime,
150
+ }),
151
+ }),
152
+ input: z.object({ envelopeId: z.string(), signedAt: z.string().optional() }),
153
+ output: z.object({ success: z.boolean() }),
154
+ run: async () => ({ success: true }),
155
+ });
156
+ ```
157
+
158
+ ### Void an envelope
159
+
160
+ ```ts
161
+ import { voidEnvelope } from '@keystrokehq/docusign/envelopes';
162
+
163
+ // DocuSign has no standalone `voidEnvelope` endpoint — voiding is a PUT on the
164
+ // envelope with `status: 'voided'` + `voidedReason`. This package models it as
165
+ // a dedicated named operation for DX while sharing the underlying slug.
166
+ await ctx.step(voidEnvelope, {
167
+ envelopeId: 'envelope-123',
168
+ voidedReason: 'Customer requested cancellation',
169
+ });
170
+ ```
171
+
172
+ ### Use the raw client inside custom code
173
+
174
+ ```ts
175
+ import { createDocusignClient } from '@keystrokehq/docusign/client';
176
+ import { DocusignApiError } from '@keystrokehq/docusign/errors';
177
+
178
+ async function searchEnvelopesByStatus(
179
+ credentials: Parameters<typeof createDocusignClient>[0],
180
+ status: string
181
+ ) {
182
+ const client = createDocusignClient(credentials);
183
+ try {
184
+ return await client.request<{ envelopes?: unknown[] }>({
185
+ path: '/envelopes',
186
+ query: { status, from_date: '2026-01-01' },
187
+ });
188
+ } catch (error) {
189
+ if (error instanceof DocusignApiError && error.kind === 'rate_limit') {
190
+ // use `error.retryAfterMs` to back off in a calling step
191
+ }
192
+ throw error;
193
+ }
194
+ }
195
+ ```
196
+
197
+ ## Connect configuration
198
+
199
+ To receive webhooks at `/docusign`:
200
+
201
+ 1. In the DocuSign admin console, create a Connect configuration and set the publish URL to your Keystroke callback.
202
+ 2. Enable HMAC signing and configure at least one shared secret. Optionally configure up to 10 for rotation.
203
+ 3. Copy the secrets into the `KEYSTROKE_PLATFORM_DOCUSIGN_CONNECT_HMAC_SECRETS` env var (comma-separated).
204
+
205
+ The package's `verifyDocusignConnectRequest` helper accepts a delivery if **any** of the `X-DocuSign-Signature-{N}` headers matches **any** configured secret under a constant-time compare. Rotating secrets is safe: add the new secret, let DocuSign start signing with it, then remove the old one once no old-signature deliveries remain in flight.
206
+
207
+ ## Plan-gated surfaces
208
+
209
+ `rooms`, `clm`, `admin`, `click`, `monitor`, and the historical-envelope replay (`submitBatchHistoricalEnvelopesToWebhook`) live in the package so the slug surface is complete, but throw `DocusignApiError.notImplemented({ kind: 'plan_gated' })` in v1. Each has its own gating rationale:
210
+
211
+ - **Rooms** — different base host, requires Rooms license.
212
+ - **CLM / SpringCM** — region-specific host, separate OAuth app.
213
+ - **Admin** — requires `organization_read`/`permission_read` scopes not in the v1 scope set.
214
+ - **Click** — requires `click.manage`/`click.send` scopes.
215
+ - **Monitor** — separate host (`lens.docusign.net`) and license.
216
+ - **Historical-replay** — requires JWT Grant + admin consent (see [JWT follow-up](#jwt-grant-follow-up)).
217
+
218
+ ## JWT Grant follow-up
219
+
220
+ DocuSign also supports JWT Grant for server-to-server impersonation. v1 declares an internal `docusign-jwt` CredentialSet for forward compatibility but does not wire a runtime path. When JWT Grant ships, existing workflows keep working — only historical-replay operations change from throwing `plan_gated` to executing.
221
+
222
+ ## Errors
223
+
224
+ All operations throw `DocusignApiError` on failure. The class exposes a discriminated `kind`:
225
+
226
+ - `'http'` — generic 4xx/5xx
227
+ - `'rate_limit'` — 429, carries `retryAfterMs`
228
+ - `'auth'` — 401/403; the runtime also flags the credential as revoked
229
+ - `'validation'` — input validation at the client boundary
230
+ - `'plan_gated'` / `'not_implemented'` — surfaces the package intentionally ships but doesn't execute
231
+ - `'webhook_signature'` — HMAC verification failed
232
+ - `'network'` — `fetch` threw after all retries
233
+
234
+ ## Testing
235
+
236
+ ```bash
237
+ turbo run lint --filter=@keystrokehq/docusign
238
+ turbo run typecheck --filter=@keystrokehq/docusign
239
+ turbo run build --filter=@keystrokehq/docusign
240
+ turbo run test:unit --filter=@keystrokehq/docusign
241
+ ```
242
+
243
+ ## References
244
+
245
+ - [DocuSign eSignature REST v2.1](https://developers.docusign.com/docs/esign-rest-api/)
246
+ - [DocuSign Connect (HMAC)](https://developers.docusign.com/platform/webhooks/connect/hmac/)
247
+ - [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/)
248
+ - [JWT Grant](https://developers.docusign.com/platform/auth/jwt/)
@@ -0,0 +1,3 @@
1
+ import { i as docusignOfficialIntegration, r as docusignBundle } from "../integration-DqwHRkRh.mjs";
2
+ import { a as docusignConnectCredentialSet, c as parseHmacSecrets, i as docusignAppCredentialSet, n as DocusignConnectCredentials, o as docusignJwtCredentialSet, r as DocusignJwtCredentials, s as docusignPlatformProviderSeed, t as DocusignAppCredentials } from "../provider-app-CWp1SuI4.mjs";
3
+ export { DocusignAppCredentials, DocusignConnectCredentials, DocusignJwtCredentials, docusignAppCredentialSet, docusignBundle, docusignConnectCredentialSet, docusignJwtCredentialSet, docusignOfficialIntegration, docusignPlatformProviderSeed, parseHmacSecrets };
@@ -0,0 +1,3 @@
1
+ import { c as docusignJwtCredentialSet, l as docusignPlatformProviderSeed, n as docusignBundle, o as docusignAppCredentialSet, r as docusignOfficialIntegration, s as docusignConnectCredentialSet, u as parseHmacSecrets } from "../integration-CmRztL9R.mjs";
2
+
3
+ export { docusignAppCredentialSet, docusignBundle, docusignConnectCredentialSet, docusignJwtCredentialSet, docusignOfficialIntegration, docusignPlatformProviderSeed, parseHmacSecrets };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,65 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/account-custom-fields.d.ts
6
+ declare const createAccountCustomField: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ applyToTemplates: z.ZodOptional<z.ZodBoolean>;
8
+ customField: z.ZodObject<{
9
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
10
+ }, z.core.$catchall<z.ZodUnknown>>;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
13
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
14
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
15
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
16
+ DOCUSIGN_BASE_URI: z.ZodURL;
17
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
18
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
19
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
20
+ DOCUSIGN_BASE_URI: z.ZodURL;
21
+ }, z.core.$strip>>[] | undefined>], undefined>;
22
+ declare const updateAccountCustomField: _keystrokehq_core0.Operation<z.ZodObject<{
23
+ customFieldId: z.ZodString;
24
+ customField: z.ZodObject<{
25
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
26
+ }, z.core.$catchall<z.ZodUnknown>>;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
29
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
30
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
31
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
32
+ DOCUSIGN_BASE_URI: z.ZodURL;
33
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
34
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
35
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
36
+ DOCUSIGN_BASE_URI: z.ZodURL;
37
+ }, z.core.$strip>>[] | undefined>], undefined>;
38
+ declare const deleteAccountCustomField: _keystrokehq_core0.Operation<z.ZodObject<{
39
+ customFieldId: z.ZodString;
40
+ }, z.core.$strip>, z.ZodObject<{
41
+ success: z.ZodBoolean;
42
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
43
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
44
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
45
+ DOCUSIGN_BASE_URI: z.ZodURL;
46
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
47
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
48
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
49
+ DOCUSIGN_BASE_URI: z.ZodURL;
50
+ }, z.core.$strip>>[] | undefined>], undefined>;
51
+ declare const retrieveAllAccountTabs: _keystrokehq_core0.Operation<z.ZodObject<{
52
+ customTabOnly: z.ZodOptional<z.ZodBoolean>;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
55
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
56
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
57
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
58
+ DOCUSIGN_BASE_URI: z.ZodURL;
59
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
60
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
61
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
62
+ DOCUSIGN_BASE_URI: z.ZodURL;
63
+ }, z.core.$strip>>[] | undefined>], undefined>;
64
+ //#endregion
65
+ export { createAccountCustomField, deleteAccountCustomField, retrieveAllAccountTabs, updateAccountCustomField };
@@ -0,0 +1,63 @@
1
+ import { docusignGenericObjectSchema, docusignLooseObjectSchema, docusignSuccessSchema } from "./schemas/index.mjs";
2
+ import { r as defineRestOperation } from "./operation-helpers-BMTArRh9.mjs";
3
+ import { z } from "zod";
4
+
5
+ //#region src/account-custom-fields.ts
6
+ /**
7
+ * Account custom fields. Covers PLAN.md § 6.32.
8
+ */
9
+ const fieldId = z.object({ customFieldId: z.string().min(1) });
10
+ const createAccountCustomField = defineRestOperation({
11
+ id: "create_account_custom_field",
12
+ slug: "DOCUSIGN_CREATE_ACCOUNT_CUSTOM_FIELD",
13
+ name: "Create Account Custom Field",
14
+ description: "Create a custom field at the account level.",
15
+ needsApproval: true,
16
+ method: "POST",
17
+ path: "/custom_fields",
18
+ input: z.object({
19
+ applyToTemplates: z.boolean().optional(),
20
+ customField: docusignLooseObjectSchema()
21
+ }),
22
+ output: docusignGenericObjectSchema,
23
+ query: (input) => ({ apply_to_templates: input.applyToTemplates }),
24
+ body: (input) => input.customField
25
+ });
26
+ const updateAccountCustomField = defineRestOperation({
27
+ id: "update_account_custom_field",
28
+ slug: "DOCUSIGN_UPDATE_ACCOUNT_CUSTOM_FIELD",
29
+ name: "Update Account Custom Field",
30
+ description: "Update an account-level custom field.",
31
+ needsApproval: true,
32
+ method: "PUT",
33
+ path: (ctx) => `/custom_fields/${ctx.encode(String(ctx.input.customFieldId))}`,
34
+ input: fieldId.extend({ customField: docusignLooseObjectSchema() }),
35
+ output: docusignGenericObjectSchema,
36
+ body: (input) => input.customField
37
+ });
38
+ const deleteAccountCustomField = defineRestOperation({
39
+ id: "delete_account_custom_field",
40
+ slug: "DOCUSIGN_DELETE_ACCOUNT_CUSTOM_FIELD",
41
+ name: "Delete Account Custom Field",
42
+ description: "Delete an account-level custom field.",
43
+ needsApproval: true,
44
+ method: "DELETE",
45
+ path: (ctx) => `/custom_fields/${ctx.encode(String(ctx.input.customFieldId))}`,
46
+ input: fieldId,
47
+ output: docusignSuccessSchema,
48
+ transformResponse: () => ({ success: true })
49
+ });
50
+ const retrieveAllAccountTabs = defineRestOperation({
51
+ id: "retrieve_all_account_tabs",
52
+ slug: "DOCUSIGN_RETRIEVE_ALL_ACCOUNT_TABS",
53
+ name: "Retrieve All Account Tabs",
54
+ description: "Retrieve all tabs available on the account.",
55
+ method: "GET",
56
+ path: "/tabs",
57
+ input: z.object({ customTabOnly: z.boolean().optional() }),
58
+ output: docusignGenericObjectSchema,
59
+ query: (input) => ({ custom_tab_only: input.customTabOnly })
60
+ });
61
+
62
+ //#endregion
63
+ export { createAccountCustomField, deleteAccountCustomField, retrieveAllAccountTabs, updateAccountCustomField };
@@ -0,0 +1,164 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/account-stamps.d.ts
6
+ declare const addOrUpdateAccountStamps: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ stamps: z.ZodArray<z.ZodObject<{
8
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
9
+ }, z.core.$catchall<z.ZodUnknown>>>;
10
+ }, z.core.$strip>, z.ZodObject<{
11
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
12
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
13
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
14
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
15
+ DOCUSIGN_BASE_URI: z.ZodURL;
16
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
17
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
18
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
19
+ DOCUSIGN_BASE_URI: z.ZodURL;
20
+ }, z.core.$strip>>[] | undefined>], undefined>;
21
+ declare const retrieveAvailableAccountStamps: _keystrokehq_core0.Operation<z.ZodObject<{
22
+ status: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
25
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
26
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
27
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
28
+ DOCUSIGN_BASE_URI: z.ZodURL;
29
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
30
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
31
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
32
+ DOCUSIGN_BASE_URI: z.ZodURL;
33
+ }, z.core.$strip>>[] | undefined>], undefined>;
34
+ declare const getSpecifiedAccountStampInfo: _keystrokehq_core0.Operation<z.ZodObject<{
35
+ stampId: z.ZodString;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
38
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
39
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
40
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
41
+ DOCUSIGN_BASE_URI: z.ZodURL;
42
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
43
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
44
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
45
+ DOCUSIGN_BASE_URI: z.ZodURL;
46
+ }, z.core.$strip>>[] | undefined>], undefined>;
47
+ declare const getAccountStampImage: _keystrokehq_core0.Operation<z.ZodObject<{
48
+ stampId: z.ZodString;
49
+ stampFormat: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ contentType: z.ZodOptional<z.ZodString>;
52
+ contentDisposition: z.ZodOptional<z.ZodString>;
53
+ status: z.ZodNumber;
54
+ body: z.ZodString;
55
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
56
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
57
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
58
+ DOCUSIGN_BASE_URI: z.ZodURL;
59
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
60
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
61
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
62
+ DOCUSIGN_BASE_URI: z.ZodURL;
63
+ }, z.core.$strip>>[] | undefined>], undefined>;
64
+ declare const updateAccountStampById: _keystrokehq_core0.Operation<z.ZodObject<{
65
+ stampId: z.ZodString;
66
+ stamp: z.ZodObject<{
67
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
68
+ }, z.core.$catchall<z.ZodUnknown>>;
69
+ }, z.core.$strip>, z.ZodObject<{
70
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
71
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
72
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
73
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
74
+ DOCUSIGN_BASE_URI: z.ZodURL;
75
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
76
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
77
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
78
+ DOCUSIGN_BASE_URI: z.ZodURL;
79
+ }, z.core.$strip>>[] | undefined>], undefined>;
80
+ declare const updateAccountStamps: _keystrokehq_core0.Operation<z.ZodObject<{
81
+ stamps: z.ZodArray<z.ZodObject<{
82
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
83
+ }, z.core.$catchall<z.ZodUnknown>>>;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
86
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
87
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
88
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
89
+ DOCUSIGN_BASE_URI: z.ZodURL;
90
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
91
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
92
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
93
+ DOCUSIGN_BASE_URI: z.ZodURL;
94
+ }, z.core.$strip>>[] | undefined>], undefined>;
95
+ declare const deleteAccountStamp: _keystrokehq_core0.Operation<z.ZodObject<{
96
+ stampId: z.ZodString;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ success: z.ZodBoolean;
99
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
100
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
101
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
102
+ DOCUSIGN_BASE_URI: z.ZodURL;
103
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
104
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
105
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
106
+ DOCUSIGN_BASE_URI: z.ZodURL;
107
+ }, z.core.$strip>>[] | undefined>], undefined>;
108
+ declare const deleteStampImageForAccount: _keystrokehq_core0.Operation<z.ZodObject<{
109
+ stampId: z.ZodString;
110
+ stampFormat: z.ZodOptional<z.ZodString>;
111
+ }, z.core.$strip>, z.ZodObject<{
112
+ success: z.ZodBoolean;
113
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
114
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
115
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
116
+ DOCUSIGN_BASE_URI: z.ZodURL;
117
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
118
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
119
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
120
+ DOCUSIGN_BASE_URI: z.ZodURL;
121
+ }, z.core.$strip>>[] | undefined>], undefined>;
122
+ declare const getWatermarkDetailsForAccount: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
123
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
124
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
125
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
126
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
127
+ DOCUSIGN_BASE_URI: z.ZodURL;
128
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
129
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
130
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
131
+ DOCUSIGN_BASE_URI: z.ZodURL;
132
+ }, z.core.$strip>>[] | undefined>], undefined>;
133
+ declare const updateAccountWatermarkInformation: _keystrokehq_core0.Operation<z.ZodObject<{
134
+ watermark: z.ZodObject<{
135
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
136
+ }, z.core.$catchall<z.ZodUnknown>>;
137
+ }, z.core.$strip>, z.ZodObject<{
138
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
139
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
140
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
141
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
142
+ DOCUSIGN_BASE_URI: z.ZodURL;
143
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
144
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
145
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
146
+ DOCUSIGN_BASE_URI: z.ZodURL;
147
+ }, z.core.$strip>>[] | undefined>], undefined>;
148
+ declare const updateAccountWatermarkPreview: _keystrokehq_core0.Operation<z.ZodObject<{
149
+ watermark: z.ZodObject<{
150
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
151
+ }, z.core.$catchall<z.ZodUnknown>>;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
154
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
155
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
156
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
157
+ DOCUSIGN_BASE_URI: z.ZodURL;
158
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
159
+ DOCUSIGN_ACCESS_TOKEN: z.ZodString;
160
+ DOCUSIGN_ACCOUNT_ID: z.ZodString;
161
+ DOCUSIGN_BASE_URI: z.ZodURL;
162
+ }, z.core.$strip>>[] | undefined>], undefined>;
163
+ //#endregion
164
+ export { addOrUpdateAccountStamps, deleteAccountStamp, deleteStampImageForAccount, getAccountStampImage, getSpecifiedAccountStampInfo, getWatermarkDetailsForAccount, retrieveAvailableAccountStamps, updateAccountStampById, updateAccountStamps, updateAccountWatermarkInformation, updateAccountWatermarkPreview };