@keystrokehq/docusign 0.0.11 → 0.0.16-integration-id-canonicalization.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 (130) hide show
  1. package/README.md +3 -2
  2. package/dist/credential-sets/index.d.mts +2 -0
  3. package/dist/credential-sets/index.mjs +4 -0
  4. package/dist/docusign-jwt.credential-set-B0sXS-5i.mjs +39 -0
  5. package/dist/docusign-jwt.credential-set-Bz99DTgx.d.mts +90 -0
  6. package/dist/docusign.credential-set-DRhK9ICD.mjs +183 -0
  7. package/dist/index.d.mts +4 -1
  8. package/dist/index.mjs +6 -1
  9. package/dist/operations/index.d.mts +2 -0
  10. package/dist/operations/index.mjs +3 -0
  11. package/dist/void-envelope.operation-Bim49UXq.mjs +8192 -0
  12. package/dist/void-envelope.operation-D-onxqe_.d.mts +18203 -0
  13. package/package.json +9 -225
  14. package/dist/_official/index.d.mts +0 -89
  15. package/dist/_official/index.mjs +0 -3
  16. package/dist/_runtime/index.d.mts +0 -1
  17. package/dist/_runtime/index.mjs +0 -1
  18. package/dist/account-custom-fields.d.mts +0 -65
  19. package/dist/account-custom-fields.mjs +0 -63
  20. package/dist/account-stamps.d.mts +0 -164
  21. package/dist/account-stamps.mjs +0 -144
  22. package/dist/account-tabs.d.mts +0 -90
  23. package/dist/account-tabs.mjs +0 -80
  24. package/dist/account.d.mts +0 -233
  25. package/dist/account.mjs +0 -207
  26. package/dist/admin.d.mts +0 -18
  27. package/dist/admin.mjs +0 -20
  28. package/dist/auth.d.mts +0 -37
  29. package/dist/auth.mjs +0 -53
  30. package/dist/bcc-archive.d.mts +0 -64
  31. package/dist/bcc-archive.mjs +0 -70
  32. package/dist/billing.d.mts +0 -217
  33. package/dist/billing.mjs +0 -208
  34. package/dist/brands.d.mts +0 -192
  35. package/dist/brands.mjs +0 -157
  36. package/dist/bulk-send.d.mts +0 -137
  37. package/dist/bulk-send.mjs +0 -115
  38. package/dist/chunked-uploads.d.mts +0 -78
  39. package/dist/chunked-uploads.mjs +0 -74
  40. package/dist/click.d.mts +0 -18
  41. package/dist/click.mjs +0 -20
  42. package/dist/client.d.mts +0 -47
  43. package/dist/client.mjs +0 -286
  44. package/dist/clm.d.mts +0 -18
  45. package/dist/clm.mjs +0 -20
  46. package/dist/cloud-storage.d.mts +0 -122
  47. package/dist/cloud-storage.mjs +0 -115
  48. package/dist/connect.d.mts +0 -252
  49. package/dist/connect.mjs +0 -217
  50. package/dist/connection.d.mts +0 -2
  51. package/dist/connection.mjs +0 -3
  52. package/dist/contacts.d.mts +0 -80
  53. package/dist/contacts.mjs +0 -79
  54. package/dist/enote.d.mts +0 -44
  55. package/dist/enote.mjs +0 -45
  56. package/dist/envelope-attachments.d.mts +0 -86
  57. package/dist/envelope-attachments.mjs +0 -76
  58. package/dist/envelope-custom-fields.d.mts +0 -166
  59. package/dist/envelope-custom-fields.mjs +0 -92
  60. package/dist/envelope-documents.d.mts +0 -271
  61. package/dist/envelope-documents.mjs +0 -219
  62. package/dist/envelope-email.d.mts +0 -65
  63. package/dist/envelope-email.mjs +0 -60
  64. package/dist/envelope-lock.d.mts +0 -65
  65. package/dist/envelope-lock.mjs +0 -60
  66. package/dist/envelope-logs.d.mts +0 -126
  67. package/dist/envelope-logs.mjs +0 -126
  68. package/dist/envelope-notifications.d.mts +0 -47
  69. package/dist/envelope-notifications.mjs +0 -44
  70. package/dist/envelope-recipients.d.mts +0 -171
  71. package/dist/envelope-recipients.mjs +0 -136
  72. package/dist/envelope-tabs.d.mts +0 -52
  73. package/dist/envelope-tabs.mjs +0 -49
  74. package/dist/envelope-views.d.mts +0 -99
  75. package/dist/envelope-views.mjs +0 -88
  76. package/dist/envelope-workflow.d.mts +0 -208
  77. package/dist/envelope-workflow.mjs +0 -176
  78. package/dist/envelopes.d.mts +0 -430
  79. package/dist/envelopes.mjs +0 -190
  80. package/dist/errors.d.mts +0 -48
  81. package/dist/errors.mjs +0 -76
  82. package/dist/events.d.mts +0 -192
  83. package/dist/events.mjs +0 -146
  84. package/dist/factory-DFejlPDe.mjs +0 -7
  85. package/dist/groups.d.mts +0 -191
  86. package/dist/groups.mjs +0 -146
  87. package/dist/integration-BcEp_dFX.mjs +0 -365
  88. package/dist/integration-CdIRNjCz.d.mts +0 -72
  89. package/dist/messaging.d.mts +0 -1
  90. package/dist/messaging.mjs +0 -1
  91. package/dist/monitor.d.mts +0 -18
  92. package/dist/monitor.mjs +0 -20
  93. package/dist/notary.d.mts +0 -129
  94. package/dist/notary.mjs +0 -122
  95. package/dist/operation-helpers-Bqp7KoLi.mjs +0 -102
  96. package/dist/permission-profiles.d.mts +0 -78
  97. package/dist/permission-profiles.mjs +0 -70
  98. package/dist/power-forms.d.mts +0 -51
  99. package/dist/power-forms.mjs +0 -62
  100. package/dist/rooms.d.mts +0 -18
  101. package/dist/rooms.mjs +0 -28
  102. package/dist/shared-DTUCJayR.mjs +0 -27
  103. package/dist/signing-groups.d.mts +0 -139
  104. package/dist/signing-groups.mjs +0 -117
  105. package/dist/template-custom-fields.d.mts +0 -199
  106. package/dist/template-custom-fields.mjs +0 -107
  107. package/dist/template-documents.d.mts +0 -132
  108. package/dist/template-documents.mjs +0 -109
  109. package/dist/template-lock.d.mts +0 -65
  110. package/dist/template-lock.mjs +0 -60
  111. package/dist/template-sharing.d.mts +0 -129
  112. package/dist/template-sharing.mjs +0 -108
  113. package/dist/template-workflow.d.mts +0 -184
  114. package/dist/template-workflow.mjs +0 -152
  115. package/dist/templates.d.mts +0 -158
  116. package/dist/templates.mjs +0 -110
  117. package/dist/user-authorizations.d.mts +0 -129
  118. package/dist/user-authorizations.mjs +0 -133
  119. package/dist/user-custom-settings.d.mts +0 -81
  120. package/dist/user-custom-settings.mjs +0 -69
  121. package/dist/user-profile.d.mts +0 -109
  122. package/dist/user-profile.mjs +0 -106
  123. package/dist/user-signatures.d.mts +0 -208
  124. package/dist/user-signatures.mjs +0 -180
  125. package/dist/users.d.mts +0 -128
  126. package/dist/users.mjs +0 -98
  127. package/dist/verification.d.mts +0 -19
  128. package/dist/verification.mjs +0 -59
  129. package/dist/workspaces.d.mts +0 -173
  130. package/dist/workspaces.mjs +0 -143
package/dist/client.mjs DELETED
@@ -1,286 +0,0 @@
1
- import { DocusignApiError } from "./errors.mjs";
2
- import { r as toQueryValue } from "./shared-DTUCJayR.mjs";
3
- import { CredentialRevokedError } from "@keystrokehq/core/errors";
4
-
5
- //#region src/client.ts
6
- /**
7
- * Hand-rolled typed DocuSign eSignature REST v2.1 client.
8
- *
9
- * Responsibilities:
10
- * - account-scoped URL construction (`{baseUri}/restapi/v2.1/accounts/{accountId}`)
11
- * - JSON, binary, and multipart request/response handling
12
- * - retry on 429 + 5xx with `Retry-After` honoring and jittered exponential
13
- * backoff for transient failures
14
- * - error normalization through `DocusignApiError`
15
- * - `listAll` pagination walker for endpoints that expose `nextUri`
16
- * - minimal surface — each domain file builds a typed request from the
17
- * low-level `request`/`requestBinary`/`requestMultipart` helpers instead
18
- * of depending on a huge method-per-endpoint wrapper object.
19
- *
20
- * Why not the official `docusign-esign` SDK: it pulls `superagent`, `node:fs`,
21
- * and `jsonwebtoken` which do not work in Cloudflare Workers / V8 isolates.
22
- * See IMPLEMENTATION_NOTES.md § 3.
23
- */
24
- const ESIGNATURE_API_PREFIX = "/restapi/v2.1/accounts";
25
- const MAX_RETRIES = 3;
26
- const BASE_RETRY_DELAY_MS = 250;
27
- const MAX_RETRY_DELAY_MS = 8e3;
28
- function normalizeBaseUri(baseUri) {
29
- return baseUri.endsWith("/") ? baseUri.slice(0, -1) : baseUri;
30
- }
31
- function jitter(ms) {
32
- return ms + Math.floor(Math.random() * ms * .25);
33
- }
34
- function parseRetryAfterHeader(value) {
35
- if (!value) return void 0;
36
- const asNumber = Number(value);
37
- if (Number.isFinite(asNumber)) return Math.max(0, asNumber * 1e3);
38
- const asDate = Date.parse(value);
39
- if (Number.isFinite(asDate)) return Math.max(0, asDate - Date.now());
40
- }
41
- async function sleep(ms) {
42
- await new Promise((resolve) => setTimeout(resolve, ms));
43
- }
44
- function applyQuery(url, query) {
45
- if (!query) return;
46
- for (const [key, value] of Object.entries(query)) {
47
- const serialized = toQueryValue(value);
48
- if (serialized !== void 0) url.searchParams.set(key, serialized);
49
- }
50
- }
51
- function resolveUrl(internals, init) {
52
- const base = normalizeBaseUri(internals.baseUri);
53
- const prefix = init.accountScoped === false ? "" : `${ESIGNATURE_API_PREFIX}/${internals.accountId}`;
54
- const path = init.path.startsWith("/") ? init.path : `/${init.path}`;
55
- const url = new URL(`${base}${prefix}${path}`);
56
- applyQuery(url, init.query);
57
- return url.toString();
58
- }
59
- function buildResolvedRequest(internals, init) {
60
- const method = init.method ?? "GET";
61
- const url = resolveUrl(internals, init);
62
- const headers = {
63
- Authorization: `Bearer ${internals.accessToken}`,
64
- Accept: init.accept ?? "application/json",
65
- ...init.headers ?? {}
66
- };
67
- let body;
68
- if (init.body !== void 0) if (init.body instanceof Uint8Array) {
69
- body = init.body;
70
- headers["Content-Type"] = headers["Content-Type"] ?? "application/octet-stream";
71
- } else if (typeof init.body === "string") {
72
- body = init.body;
73
- headers["Content-Type"] = headers["Content-Type"] ?? "application/json";
74
- } else {
75
- body = JSON.stringify(init.body);
76
- headers["Content-Type"] = headers["Content-Type"] ?? "application/json";
77
- }
78
- return {
79
- url,
80
- method,
81
- headers,
82
- body
83
- };
84
- }
85
- function extractRequestId(headers) {
86
- return headers.get("X-DocuSign-TraceToken") ?? headers.get("x-docusign-tracetoken") ?? void 0;
87
- }
88
- function collectHeaders(headers) {
89
- const collected = {};
90
- headers.forEach((value, key) => {
91
- collected[key.toLowerCase()] = value;
92
- });
93
- return collected;
94
- }
95
- async function readErrorBody(response) {
96
- const contentType = response.headers.get("content-type") ?? "";
97
- try {
98
- if (contentType.includes("application/json")) return await response.json();
99
- return await response.text();
100
- } catch {
101
- return;
102
- }
103
- }
104
- async function readJsonBody(response) {
105
- if (response.status === 204) return void 0;
106
- if ((response.headers.get("content-type") ?? "").includes("application/json")) return await response.json();
107
- return await response.text();
108
- }
109
- function isAuthError(error) {
110
- if (error instanceof DocusignApiError) return error.kind === "auth";
111
- return false;
112
- }
113
- function buildMultipartBody(parts) {
114
- const boundary = `----docusign-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
115
- const delimiter = `--${boundary}`;
116
- const closing = `--${boundary}--`;
117
- const chunks = [];
118
- const encoder = new TextEncoder();
119
- for (const part of parts) {
120
- const header = `${delimiter}\r\nContent-Disposition: ${part.filename ? `form-data; name="${part.name}"; filename="${part.filename}"` : `form-data; name="${part.name}"`}\r\nContent-Type: ${part.contentType}\r\n\r\n`;
121
- chunks.push(encoder.encode(header));
122
- const rawContent = part.serializeAsJson ? JSON.stringify(part.content) : part.content;
123
- if (typeof rawContent === "string") chunks.push(encoder.encode(rawContent));
124
- else if (rawContent instanceof Uint8Array) chunks.push(rawContent);
125
- else chunks.push(encoder.encode(JSON.stringify(rawContent)));
126
- chunks.push(encoder.encode("\r\n"));
127
- }
128
- chunks.push(encoder.encode(`${closing}\r\n`));
129
- const totalLength = chunks.reduce((size, chunk) => size + chunk.length, 0);
130
- const combined = new Uint8Array(totalLength);
131
- let offset = 0;
132
- for (const chunk of chunks) {
133
- combined.set(chunk, offset);
134
- offset += chunk.length;
135
- }
136
- return {
137
- body: combined,
138
- contentType: `multipart/form-data; boundary=${boundary}`
139
- };
140
- }
141
- async function performRequest(resolved, internals) {
142
- let attempt = 0;
143
- while (true) {
144
- let response;
145
- try {
146
- response = await fetch(resolved.url, {
147
- method: resolved.method,
148
- headers: resolved.headers,
149
- body: resolved.body
150
- });
151
- } catch (cause) {
152
- if (attempt >= MAX_RETRIES) throw new DocusignApiError(`DocuSign ${resolved.method} ${resolved.url} network error.`, {
153
- kind: "network",
154
- retryable: true,
155
- cause
156
- });
157
- await sleep(Math.min(MAX_RETRY_DELAY_MS, jitter(BASE_RETRY_DELAY_MS * 2 ** attempt)));
158
- attempt += 1;
159
- continue;
160
- }
161
- if (response.status === 429 || response.status >= 500) {
162
- if (attempt >= MAX_RETRIES) return response;
163
- const delay = parseRetryAfterHeader(response.headers.get("retry-after")) ?? jitter(BASE_RETRY_DELAY_MS * 2 ** attempt);
164
- await sleep(Math.min(MAX_RETRY_DELAY_MS, delay));
165
- attempt += 1;
166
- continue;
167
- }
168
- return response;
169
- }
170
- }
171
- async function resolveErrorFromResponse(resolved, response) {
172
- const body = await readErrorBody(response);
173
- return DocusignApiError.fromResponse({
174
- status: response.status,
175
- body,
176
- requestId: extractRequestId(response.headers),
177
- retryAfterMs: parseRetryAfterHeader(response.headers.get("retry-after")),
178
- url: resolved.url,
179
- method: resolved.method
180
- });
181
- }
182
- function createDocusignClient(credentials) {
183
- const accessToken = credentials.DOCUSIGN_ACCESS_TOKEN.trim();
184
- const accountId = credentials.DOCUSIGN_ACCOUNT_ID.trim();
185
- const baseUri = credentials.DOCUSIGN_BASE_URI.trim();
186
- if (accessToken.length === 0 || accountId.length === 0 || baseUri.length === 0) throw new CredentialRevokedError("docusign", "DocuSign credentials are missing required fields (access token, account id, base URI). Re-run `keystroke connect docusign`.");
187
- const internals = {
188
- accessToken,
189
- accountId,
190
- baseUri
191
- };
192
- async function request(init) {
193
- const resolved = buildResolvedRequest(internals, init);
194
- const response = await performRequest(resolved, internals);
195
- if (!response.ok) {
196
- const error = await resolveErrorFromResponse(resolved, response);
197
- if (isAuthError(error)) throw new CredentialRevokedError("docusign", `DocuSign authentication failed while calling ${resolved.method} ${resolved.url}. The stored credentials may be revoked or expired.`);
198
- throw error;
199
- }
200
- return await readJsonBody(response);
201
- }
202
- async function requestBinary(init) {
203
- const resolved = buildResolvedRequest(internals, {
204
- ...init,
205
- accept: init.accept ?? "application/pdf"
206
- });
207
- const response = await performRequest(resolved, internals);
208
- if (!response.ok) {
209
- const error = await resolveErrorFromResponse(resolved, response);
210
- if (isAuthError(error)) throw new CredentialRevokedError("docusign", `DocuSign authentication failed while downloading ${resolved.method} ${resolved.url}.`);
211
- throw error;
212
- }
213
- return {
214
- body: new Uint8Array(await response.arrayBuffer()),
215
- contentType: response.headers.get("content-type") ?? void 0,
216
- contentDisposition: response.headers.get("content-disposition") ?? void 0,
217
- status: response.status,
218
- headers: collectHeaders(response.headers)
219
- };
220
- }
221
- async function requestMultipart(init) {
222
- const { parts, headers, ...rest } = init;
223
- const { body, contentType } = buildMultipartBody(parts);
224
- return request({
225
- ...rest,
226
- body,
227
- headers: {
228
- ...headers ?? {},
229
- "Content-Type": contentType
230
- }
231
- });
232
- }
233
- async function* listAll(init, options) {
234
- let cursor = {
235
- path: init.path,
236
- query: init.query
237
- };
238
- while (true) {
239
- const payload = await request({
240
- ...init,
241
- path: cursor.path ?? init.path,
242
- query: cursor.query ?? init.query
243
- });
244
- for (const item of options.items(payload)) yield item;
245
- const nextUri = extractNextUri(payload);
246
- if (!nextUri) return;
247
- const relative = extractRelativePath(nextUri, internals);
248
- if (!relative) return;
249
- cursor = relative;
250
- }
251
- }
252
- return {
253
- accountId,
254
- baseUri,
255
- request,
256
- requestBinary,
257
- requestMultipart,
258
- listAll
259
- };
260
- }
261
- function extractNextUri(payload) {
262
- if (typeof payload !== "object" || payload === null) return void 0;
263
- const nextUri = payload.nextUri;
264
- return typeof nextUri === "string" && nextUri.length > 0 ? nextUri : void 0;
265
- }
266
- function extractRelativePath(nextUri, internals) {
267
- try {
268
- const absolute = nextUri.startsWith("http") ? new URL(nextUri) : new URL(nextUri, normalizeBaseUri(internals.baseUri));
269
- const prefix = `${ESIGNATURE_API_PREFIX}/${internals.accountId}`;
270
- const pathname = absolute.pathname;
271
- const path = pathname.startsWith(prefix) ? pathname.slice(prefix.length) : pathname;
272
- const query = {};
273
- absolute.searchParams.forEach((value, key) => {
274
- query[key] = value;
275
- });
276
- return {
277
- path,
278
- query
279
- };
280
- } catch {
281
- return;
282
- }
283
- }
284
-
285
- //#endregion
286
- export { createDocusignClient };
package/dist/clm.d.mts DELETED
@@ -1,18 +0,0 @@
1
- import * as _keystrokehq_core0 from "@keystrokehq/core";
2
- import { z } from "zod";
3
- import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
-
5
- //#region src/clm.d.ts
6
- declare const clmNotImplemented: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>, z.ZodObject<{
7
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
8
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
9
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
10
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
11
- DOCUSIGN_BASE_URI: z.ZodURL;
12
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
13
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
14
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
15
- DOCUSIGN_BASE_URI: z.ZodURL;
16
- }, z.core.$strip>>[] | undefined>], undefined>;
17
- //#endregion
18
- export { clmNotImplemented };
package/dist/clm.mjs DELETED
@@ -1,20 +0,0 @@
1
- import { docusignGenericObjectSchema } from "./schemas/index.mjs";
2
- import { n as definePlanGatedOperation } from "./operation-helpers-Bqp7KoLi.mjs";
3
- import { z } from "zod";
4
-
5
- //#region src/clm.ts
6
- /**
7
- * DocuSign CLM (SpringCM) — plan-gated in v1.
8
- */
9
- const clmNotImplemented = definePlanGatedOperation({
10
- id: "docusign.clm-not-implemented",
11
- slug: "DOCUSIGN_CLM_NOT_IMPLEMENTED",
12
- name: "DocuSign CLM (not implemented)",
13
- description: "Placeholder for DocuSign Contract Lifecycle Management. Plan-gated in v1.",
14
- input: z.object({}).catchall(z.unknown()),
15
- output: docusignGenericObjectSchema,
16
- reason: "DocuSign CLM is a plan-gated product with a region-specific host (`https://apiuatna11.springcm.com/v2/...`). Not enabled in this Keystroke deployment."
17
- });
18
-
19
- //#endregion
20
- export { clmNotImplemented };
@@ -1,122 +0,0 @@
1
- import * as _keystrokehq_core0 from "@keystrokehq/core";
2
- import { z } from "zod";
3
- import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
-
5
- //#region src/cloud-storage.d.ts
6
- declare const configureCloudStorageRedirectUrl: _keystrokehq_core0.Operation<z.ZodObject<{
7
- userId: z.ZodString;
8
- serviceId: z.ZodString;
9
- cloudStorage: z.ZodObject<{
10
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
11
- }, z.core.$catchall<z.ZodUnknown>>;
12
- }, z.core.$strip>, z.ZodObject<{
13
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
14
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
15
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
16
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
17
- DOCUSIGN_BASE_URI: z.ZodURL;
18
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
19
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
20
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
21
- DOCUSIGN_BASE_URI: z.ZodURL;
22
- }, z.core.$strip>>[] | undefined>], undefined>;
23
- declare const getUserCloudStorageProviderConfiguration: _keystrokehq_core0.Operation<z.ZodObject<{
24
- userId: z.ZodString;
25
- serviceId: z.ZodString;
26
- }, z.core.$strip>, z.ZodObject<{
27
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
28
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
29
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
30
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
31
- DOCUSIGN_BASE_URI: z.ZodURL;
32
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
33
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
34
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
35
- DOCUSIGN_BASE_URI: z.ZodURL;
36
- }, z.core.$strip>>[] | undefined>], undefined>;
37
- declare const retrieveCloudStorageProviderConfiguration: _keystrokehq_core0.Operation<z.ZodObject<{
38
- userId: z.ZodString;
39
- }, z.core.$strip>, z.ZodObject<{
40
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
41
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
42
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
43
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
44
- DOCUSIGN_BASE_URI: z.ZodURL;
45
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
46
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
47
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
48
- DOCUSIGN_BASE_URI: z.ZodURL;
49
- }, z.core.$strip>>[] | undefined>], undefined>;
50
- declare const deleteUserAuthForCloudStorageProviders: _keystrokehq_core0.Operation<z.ZodObject<{
51
- userId: z.ZodString;
52
- cloudStorage: z.ZodObject<{
53
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
54
- }, z.core.$catchall<z.ZodUnknown>>;
55
- }, z.core.$strip>, z.ZodObject<{
56
- success: z.ZodBoolean;
57
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
58
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
59
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
60
- DOCUSIGN_BASE_URI: z.ZodURL;
61
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
62
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
63
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
64
- DOCUSIGN_BASE_URI: z.ZodURL;
65
- }, z.core.$strip>>[] | undefined>], undefined>;
66
- declare const deleteUserCloudStorageAuthentication: _keystrokehq_core0.Operation<z.ZodObject<{
67
- userId: z.ZodString;
68
- serviceId: z.ZodString;
69
- }, z.core.$strip>, z.ZodObject<{
70
- success: z.ZodBoolean;
71
- }, z.core.$strip>, 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 listCloudStorageItems: _keystrokehq_core0.Operation<z.ZodObject<{
81
- userId: z.ZodString;
82
- serviceId: z.ZodString;
83
- cloudStorageFolderPath: z.ZodOptional<z.ZodString>;
84
- cloudStorageFolderidPlain: z.ZodOptional<z.ZodString>;
85
- count: z.ZodOptional<z.ZodNumber>;
86
- order: z.ZodOptional<z.ZodEnum<{
87
- asc: "asc";
88
- desc: "desc";
89
- }>>;
90
- orderBy: z.ZodOptional<z.ZodString>;
91
- searchText: z.ZodOptional<z.ZodString>;
92
- startPosition: z.ZodOptional<z.ZodNumber>;
93
- }, z.core.$strip>, z.ZodObject<{
94
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
95
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
96
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
97
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
98
- DOCUSIGN_BASE_URI: z.ZodURL;
99
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
100
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
101
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
102
- DOCUSIGN_BASE_URI: z.ZodURL;
103
- }, z.core.$strip>>[] | undefined>], undefined>;
104
- declare const retrieveItemsInCloudStorageFolder: _keystrokehq_core0.Operation<z.ZodObject<{
105
- userId: z.ZodString;
106
- serviceId: z.ZodString;
107
- folderId: z.ZodString;
108
- count: z.ZodOptional<z.ZodNumber>;
109
- startPosition: z.ZodOptional<z.ZodNumber>;
110
- }, z.core.$strip>, z.ZodObject<{
111
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
112
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
113
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
114
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
115
- DOCUSIGN_BASE_URI: z.ZodURL;
116
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
117
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
118
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
119
- DOCUSIGN_BASE_URI: z.ZodURL;
120
- }, z.core.$strip>>[] | undefined>], undefined>;
121
- //#endregion
122
- export { configureCloudStorageRedirectUrl, deleteUserAuthForCloudStorageProviders, deleteUserCloudStorageAuthentication, getUserCloudStorageProviderConfiguration, listCloudStorageItems, retrieveCloudStorageProviderConfiguration, retrieveItemsInCloudStorageFolder };
@@ -1,115 +0,0 @@
1
- import { docusignGenericObjectSchema, docusignLooseObjectSchema, docusignSuccessSchema } from "./schemas/index.mjs";
2
- import { r as defineRestOperation } from "./operation-helpers-Bqp7KoLi.mjs";
3
- import { z } from "zod";
4
-
5
- //#region src/cloud-storage.ts
6
- /**
7
- * Cloud storage integration (per-user provider config + items). Covers PLAN.md § 6.27.
8
- */
9
- const userId = z.object({ userId: z.string().min(1) });
10
- const userProvider = userId.extend({ serviceId: z.string().min(1) });
11
- const configureCloudStorageRedirectUrl = defineRestOperation({
12
- id: "docusign.configure-cloud-storage-redirect-url",
13
- slug: "DOCUSIGN_CONFIGURE_CLOUD_STORAGE_REDIRECT_URL",
14
- name: "Configure Cloud Storage Redirect URL",
15
- description: "Configure the OAuth redirect URL for a cloud-storage provider for a user.",
16
- needsApproval: true,
17
- method: "POST",
18
- path: (ctx) => `/users/${ctx.encode(String(ctx.input.userId))}/cloud_storage/${ctx.encode(String(ctx.input.serviceId))}`,
19
- input: userProvider.extend({ cloudStorage: docusignLooseObjectSchema() }),
20
- output: docusignGenericObjectSchema,
21
- body: (input) => input.cloudStorage
22
- });
23
- const getUserCloudStorageProviderConfiguration = defineRestOperation({
24
- id: "docusign.get-user-cloud-storage-provider-configuration",
25
- slug: "DOCUSIGN_GET_USER_CLOUD_STORAGE_PROVIDER_CONFIGURATION",
26
- name: "Get User Cloud Storage Provider",
27
- description: "Get the cloud-storage provider config for a user.",
28
- method: "GET",
29
- path: (ctx) => `/users/${ctx.encode(String(ctx.input.userId))}/cloud_storage/${ctx.encode(String(ctx.input.serviceId))}`,
30
- input: userProvider,
31
- output: docusignGenericObjectSchema
32
- });
33
- const retrieveCloudStorageProviderConfiguration = defineRestOperation({
34
- id: "docusign.retrieve-cloud-storage-provider-configuration",
35
- slug: "DOCUSIGN_RETRIEVE_CLOUD_STORAGE_PROVIDER_CONFIGURATION",
36
- name: "Retrieve Cloud Storage Provider",
37
- description: "List configured cloud-storage providers for a user.",
38
- method: "GET",
39
- path: (ctx) => `/users/${ctx.encode(String(ctx.input.userId))}/cloud_storage`,
40
- input: userId,
41
- output: docusignGenericObjectSchema
42
- });
43
- const deleteUserAuthForCloudStorageProviders = defineRestOperation({
44
- id: "docusign.delete-user-auth-for-cloud-storage-providers",
45
- slug: "DOCUSIGN_DELETE_USER_AUTH_FOR_CLOUD_STORAGE_PROVIDERS",
46
- name: "Delete User Cloud Storage Auth (bulk)",
47
- description: "Remove a user authentication from a cloud-storage provider.",
48
- needsApproval: true,
49
- method: "DELETE",
50
- path: (ctx) => `/users/${ctx.encode(String(ctx.input.userId))}/cloud_storage`,
51
- input: userId.extend({ cloudStorage: docusignLooseObjectSchema() }),
52
- output: docusignSuccessSchema,
53
- body: (input) => input.cloudStorage,
54
- transformResponse: () => ({ success: true })
55
- });
56
- const deleteUserCloudStorageAuthentication = defineRestOperation({
57
- id: "docusign.delete-user-cloud-storage-authentication",
58
- slug: "DOCUSIGN_DELETE_USER_CLOUD_STORAGE_AUTHENTICATION",
59
- name: "Delete User Cloud Storage Authentication",
60
- description: "Remove a single cloud-storage authentication for a user.",
61
- needsApproval: true,
62
- method: "DELETE",
63
- path: (ctx) => `/users/${ctx.encode(String(ctx.input.userId))}/cloud_storage/${ctx.encode(String(ctx.input.serviceId))}`,
64
- input: userProvider,
65
- output: docusignSuccessSchema,
66
- transformResponse: () => ({ success: true })
67
- });
68
- const listCloudStorageItems = defineRestOperation({
69
- id: "docusign.list-cloud-storage-items",
70
- slug: "DOCUSIGN_LIST_CLOUD_STORAGE_ITEMS",
71
- name: "List Cloud Storage Items",
72
- description: "List items available in a configured cloud-storage provider for a user.",
73
- method: "GET",
74
- path: (ctx) => `/users/${ctx.encode(String(ctx.input.userId))}/cloud_storage/${ctx.encode(String(ctx.input.serviceId))}/folders`,
75
- input: userProvider.extend({
76
- cloudStorageFolderPath: z.string().optional(),
77
- cloudStorageFolderidPlain: z.string().optional(),
78
- count: z.number().int().positive().optional(),
79
- order: z.enum(["asc", "desc"]).optional(),
80
- orderBy: z.string().optional(),
81
- searchText: z.string().optional(),
82
- startPosition: z.number().int().nonnegative().optional()
83
- }),
84
- output: docusignGenericObjectSchema,
85
- query: (input) => ({
86
- cloud_storage_folder_path: input.cloudStorageFolderPath,
87
- cloud_storage_folderid_plain: input.cloudStorageFolderidPlain,
88
- count: input.count,
89
- order: input.order,
90
- order_by: input.orderBy,
91
- search_text: input.searchText,
92
- start_position: input.startPosition
93
- })
94
- });
95
- const retrieveItemsInCloudStorageFolder = defineRestOperation({
96
- id: "docusign.retrieve-items-in-cloud-storage-folder",
97
- slug: "DOCUSIGN_RETRIEVE_ITEMS_IN_CLOUD_STORAGE_FOLDER",
98
- name: "Retrieve Items In Cloud Storage Folder",
99
- description: "Retrieve items inside a specific cloud-storage folder.",
100
- method: "GET",
101
- path: (ctx) => `/users/${ctx.encode(String(ctx.input.userId))}/cloud_storage/${ctx.encode(String(ctx.input.serviceId))}/folders/${ctx.encode(String(ctx.input.folderId))}`,
102
- input: userProvider.extend({
103
- folderId: z.string().min(1),
104
- count: z.number().int().positive().optional(),
105
- startPosition: z.number().int().nonnegative().optional()
106
- }),
107
- output: docusignGenericObjectSchema,
108
- query: (input) => ({
109
- count: input.count,
110
- start_position: input.startPosition
111
- })
112
- });
113
-
114
- //#endregion
115
- export { configureCloudStorageRedirectUrl, deleteUserAuthForCloudStorageProviders, deleteUserCloudStorageAuthentication, getUserCloudStorageProviderConfiguration, listCloudStorageItems, retrieveCloudStorageProviderConfiguration, retrieveItemsInCloudStorageFolder };