@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
@@ -1,59 +0,0 @@
1
- import { createHmac, timingSafeEqual } from "node:crypto";
2
-
3
- //#region src/verification.ts
4
- /**
5
- * DocuSign Connect HMAC webhook verification.
6
- *
7
- * DocuSign Connect signs each outbound webhook with HMAC-SHA256 over the raw
8
- * request body for every account-configured shared secret, attaching the
9
- * result as one `X-DocuSign-Signature-{N}` header per secret (N starts at 1
10
- * and rolls up to 10). Verification accepts a delivery if any signature
11
- * header matches any currently-configured secret under constant-time compare.
12
- *
13
- * See: https://developers.docusign.com/platform/webhooks/connect/hmac/
14
- */
15
- function computeDocusignConnectSignature(secret, rawBody) {
16
- return createHmac("sha256", secret).update(rawBody, "utf8").digest("base64");
17
- }
18
- function normalizeHeader(value) {
19
- return value.trim();
20
- }
21
- function collectSignatureHeaders(headers) {
22
- const collected = [];
23
- for (const [key, value] of Object.entries(headers)) if (key.toLowerCase().startsWith("x-docusign-signature-") && typeof value === "string" && value.length > 0) collected.push(normalizeHeader(value));
24
- return collected;
25
- }
26
- function safeEqual(a, b) {
27
- const aBuf = Buffer.from(a, "utf8");
28
- const bBuf = Buffer.from(b, "utf8");
29
- if (aBuf.length !== bBuf.length) return false;
30
- return timingSafeEqual(aBuf, bBuf);
31
- }
32
- function verifyDocusignConnectRequest(input) {
33
- if (input.secrets.length === 0) return false;
34
- const provided = collectSignatureHeaders(input.headers);
35
- if (provided.length === 0) return false;
36
- for (const secret of input.secrets) {
37
- const expected = computeDocusignConnectSignature(secret, input.rawBody);
38
- for (const header of provided) if (safeEqual(header, expected)) return true;
39
- }
40
- return false;
41
- }
42
- /**
43
- * Parse a JSON-format Connect envelope-publish payload. Throws on invalid
44
- * JSON; callers should have already verified the HMAC signature.
45
- */
46
- function parseDocusignConnectEvent(rawBody) {
47
- return JSON.parse(rawBody);
48
- }
49
- /** Narrow a `WebhookRequest` into the shape this module needs. */
50
- function verifyDocusignConnectWebhookRequest(request, secrets) {
51
- return verifyDocusignConnectRequest({
52
- headers: request.headers,
53
- rawBody: request.rawBody,
54
- secrets
55
- });
56
- }
57
-
58
- //#endregion
59
- export { computeDocusignConnectSignature, parseDocusignConnectEvent, verifyDocusignConnectRequest, verifyDocusignConnectWebhookRequest };
@@ -1,173 +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/workspaces.d.ts
6
- declare const createACollaborativeWorkspace: _keystrokehq_core0.Operation<z.ZodObject<{
7
- workspace: 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 listWorkspaces: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
22
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
23
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
24
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
25
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
26
- DOCUSIGN_BASE_URI: z.ZodURL;
27
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
28
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
29
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
30
- DOCUSIGN_BASE_URI: z.ZodURL;
31
- }, z.core.$strip>>[] | undefined>], undefined>;
32
- declare const retrievePropertiesAboutWorkspace: _keystrokehq_core0.Operation<z.ZodObject<{
33
- workspaceId: z.ZodString;
34
- }, z.core.$strip>, z.ZodObject<{
35
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
36
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
37
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
38
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
39
- DOCUSIGN_BASE_URI: z.ZodURL;
40
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
41
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
42
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
43
- DOCUSIGN_BASE_URI: z.ZodURL;
44
- }, z.core.$strip>>[] | undefined>], undefined>;
45
- declare const updateWorkspaceInformation: _keystrokehq_core0.Operation<z.ZodObject<{
46
- workspaceId: z.ZodString;
47
- workspace: z.ZodObject<{
48
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
49
- }, z.core.$catchall<z.ZodUnknown>>;
50
- }, z.core.$strip>, z.ZodObject<{
51
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
52
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
53
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
54
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
55
- DOCUSIGN_BASE_URI: z.ZodURL;
56
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
57
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
58
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
59
- DOCUSIGN_BASE_URI: z.ZodURL;
60
- }, z.core.$strip>>[] | undefined>], undefined>;
61
- declare const deleteExistingWorkspaceLogically: _keystrokehq_core0.Operation<z.ZodObject<{
62
- workspaceId: z.ZodString;
63
- }, z.core.$strip>, z.ZodObject<{
64
- success: z.ZodBoolean;
65
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
66
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
67
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
68
- DOCUSIGN_BASE_URI: z.ZodURL;
69
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
70
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
71
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
72
- DOCUSIGN_BASE_URI: z.ZodURL;
73
- }, z.core.$strip>>[] | undefined>], undefined>;
74
- declare const addFileToWorkspace: _keystrokehq_core0.Operation<z.ZodObject<{
75
- workspaceId: z.ZodString;
76
- folderId: z.ZodString;
77
- file: z.ZodObject<{
78
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
79
- }, z.core.$catchall<z.ZodUnknown>>;
80
- }, z.core.$strip>, z.ZodObject<{
81
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
82
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
83
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
84
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
85
- DOCUSIGN_BASE_URI: z.ZodURL;
86
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
87
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
88
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
89
- DOCUSIGN_BASE_URI: z.ZodURL;
90
- }, z.core.$strip>>[] | undefined>], undefined>;
91
- declare const getWorkspaceFile: _keystrokehq_core0.Operation<z.ZodObject<{
92
- workspaceId: z.ZodString;
93
- folderId: z.ZodString;
94
- fileId: z.ZodString;
95
- }, z.core.$strip>, z.ZodObject<{
96
- contentType: z.ZodOptional<z.ZodString>;
97
- contentDisposition: z.ZodOptional<z.ZodString>;
98
- status: z.ZodNumber;
99
- body: z.ZodString;
100
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
101
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
102
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
103
- DOCUSIGN_BASE_URI: z.ZodURL;
104
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
105
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
106
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
107
- DOCUSIGN_BASE_URI: z.ZodURL;
108
- }, z.core.$strip>>[] | undefined>], undefined>;
109
- declare const listWorkspaceFilePages: _keystrokehq_core0.Operation<z.ZodObject<{
110
- workspaceId: z.ZodString;
111
- folderId: z.ZodString;
112
- fileId: z.ZodString;
113
- }, z.core.$strip>, z.ZodObject<{
114
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
115
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
116
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
117
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
118
- DOCUSIGN_BASE_URI: z.ZodURL;
119
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
120
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
121
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
122
- DOCUSIGN_BASE_URI: z.ZodURL;
123
- }, z.core.$strip>>[] | undefined>], undefined>;
124
- declare const getWorkspaceFolderContents: _keystrokehq_core0.Operation<z.ZodObject<{
125
- workspaceId: z.ZodString;
126
- folderId: z.ZodString;
127
- }, z.core.$strip>, z.ZodObject<{
128
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
129
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
130
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
131
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
132
- DOCUSIGN_BASE_URI: z.ZodURL;
133
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
134
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
135
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
136
- DOCUSIGN_BASE_URI: z.ZodURL;
137
- }, z.core.$strip>>[] | undefined>], undefined>;
138
- declare const deleteWorkspaceFilesOrFolders: _keystrokehq_core0.Operation<z.ZodObject<{
139
- workspaceId: z.ZodString;
140
- items: z.ZodArray<z.ZodObject<{
141
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
142
- }, z.core.$catchall<z.ZodUnknown>>>;
143
- }, z.core.$strip>, z.ZodObject<{
144
- success: z.ZodBoolean;
145
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
146
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
147
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
148
- DOCUSIGN_BASE_URI: z.ZodURL;
149
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
150
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
151
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
152
- DOCUSIGN_BASE_URI: z.ZodURL;
153
- }, z.core.$strip>>[] | undefined>], undefined>;
154
- declare const updateWorkspaceItemMetadata: _keystrokehq_core0.Operation<z.ZodObject<{
155
- workspaceId: z.ZodString;
156
- folderId: z.ZodString;
157
- fileId: z.ZodString;
158
- metadata: z.ZodObject<{
159
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
160
- }, z.core.$catchall<z.ZodUnknown>>;
161
- }, z.core.$strip>, z.ZodObject<{
162
- [x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
163
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"docusign", z.ZodObject<{
164
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
165
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
166
- DOCUSIGN_BASE_URI: z.ZodURL;
167
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
168
- DOCUSIGN_ACCESS_TOKEN: z.ZodString;
169
- DOCUSIGN_ACCOUNT_ID: z.ZodString;
170
- DOCUSIGN_BASE_URI: z.ZodURL;
171
- }, z.core.$strip>>[] | undefined>], undefined>;
172
- //#endregion
173
- export { addFileToWorkspace, createACollaborativeWorkspace, deleteExistingWorkspaceLogically, deleteWorkspaceFilesOrFolders, getWorkspaceFile, getWorkspaceFolderContents, listWorkspaceFilePages, listWorkspaces, retrievePropertiesAboutWorkspace, updateWorkspaceInformation, updateWorkspaceItemMetadata };
@@ -1,143 +0,0 @@
1
- import { docusignGenericObjectSchema, docusignLooseObjectSchema, docusignSuccessSchema } from "./schemas/index.mjs";
2
- import { r as defineRestOperation, t as defineBinaryOperation } from "./operation-helpers-Bqp7KoLi.mjs";
3
- import { z } from "zod";
4
-
5
- //#region src/workspaces.ts
6
- /**
7
- * Collaborative workspaces. Covers PLAN.md § 6.37.
8
- */
9
- const workspaceId = z.object({ workspaceId: z.string().min(1) });
10
- const workspaceItem = workspaceId.extend({ folderId: z.string().min(1) });
11
- const workspaceFile = workspaceItem.extend({ fileId: z.string().min(1) });
12
- const binaryResponseSchema = docusignLooseObjectSchema({
13
- contentType: z.string().optional(),
14
- contentDisposition: z.string().optional(),
15
- status: z.number(),
16
- body: z.string()
17
- });
18
- const createACollaborativeWorkspace = defineRestOperation({
19
- id: "docusign.create-a-collaborative-workspace",
20
- slug: "DOCUSIGN_CREATE_A_COLLABORATIVE_WORKSPACE",
21
- name: "Create Collaborative Workspace",
22
- description: "Create a new collaborative workspace.",
23
- needsApproval: true,
24
- method: "POST",
25
- path: "/workspaces",
26
- input: z.object({ workspace: docusignLooseObjectSchema() }),
27
- output: docusignGenericObjectSchema,
28
- body: (input) => input.workspace
29
- });
30
- const listWorkspaces = defineRestOperation({
31
- id: "docusign.list-workspaces",
32
- slug: "DOCUSIGN_LIST_WORKSPACES",
33
- name: "List Workspaces",
34
- description: "List collaborative workspaces.",
35
- method: "GET",
36
- path: "/workspaces",
37
- input: z.object({}),
38
- output: docusignGenericObjectSchema
39
- });
40
- const retrievePropertiesAboutWorkspace = defineRestOperation({
41
- id: "docusign.retrieve-properties-about-workspace",
42
- slug: "DOCUSIGN_RETRIEVE_PROPERTIES_ABOUT_WORKSPACE",
43
- name: "Retrieve Workspace Properties",
44
- description: "Retrieve properties for a workspace.",
45
- method: "GET",
46
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}`,
47
- input: workspaceId,
48
- output: docusignGenericObjectSchema
49
- });
50
- const updateWorkspaceInformation = defineRestOperation({
51
- id: "docusign.update-workspace-information",
52
- slug: "DOCUSIGN_UPDATE_WORKSPACE_INFORMATION",
53
- name: "Update Workspace Information",
54
- description: "Update workspace information.",
55
- needsApproval: true,
56
- method: "PUT",
57
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}`,
58
- input: workspaceId.extend({ workspace: docusignLooseObjectSchema() }),
59
- output: docusignGenericObjectSchema,
60
- body: (input) => input.workspace
61
- });
62
- const deleteExistingWorkspaceLogically = defineRestOperation({
63
- id: "docusign.delete-existing-workspace-logically",
64
- slug: "DOCUSIGN_DELETE_EXISTING_WORKSPACE_LOGICALLY",
65
- name: "Logically Delete Workspace",
66
- description: "Soft-delete a workspace.",
67
- needsApproval: true,
68
- method: "DELETE",
69
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}`,
70
- input: workspaceId,
71
- output: docusignSuccessSchema,
72
- transformResponse: () => ({ success: true })
73
- });
74
- const addFileToWorkspace = defineRestOperation({
75
- id: "docusign.add-file-to-workspace",
76
- slug: "DOCUSIGN_ADD_FILE_TO_WORKSPACE",
77
- name: "Add File To Workspace",
78
- description: "Upload a file into a workspace folder.",
79
- needsApproval: true,
80
- method: "POST",
81
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}/folders/${ctx.encode(String(ctx.input.folderId))}/files`,
82
- input: workspaceItem.extend({ file: docusignLooseObjectSchema() }),
83
- output: docusignGenericObjectSchema,
84
- body: (input) => input.file
85
- });
86
- const getWorkspaceFile = defineBinaryOperation({
87
- id: "docusign.get-workspace-file",
88
- slug: "DOCUSIGN_GET_WORKSPACE_FILE",
89
- name: "Get Workspace File",
90
- description: "Download a file from a workspace folder.",
91
- method: "GET",
92
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}/folders/${ctx.encode(String(ctx.input.folderId))}/files/${ctx.encode(String(ctx.input.fileId))}`,
93
- input: workspaceFile,
94
- output: binaryResponseSchema
95
- });
96
- const listWorkspaceFilePages = defineRestOperation({
97
- id: "docusign.list-workspace-file-pages",
98
- slug: "DOCUSIGN_LIST_WORKSPACE_FILE_PAGES",
99
- name: "List Workspace File Pages",
100
- description: "List page images for a workspace file.",
101
- method: "GET",
102
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}/folders/${ctx.encode(String(ctx.input.folderId))}/files/${ctx.encode(String(ctx.input.fileId))}/pages`,
103
- input: workspaceFile,
104
- output: docusignGenericObjectSchema
105
- });
106
- const getWorkspaceFolderContents = defineRestOperation({
107
- id: "docusign.get-workspace-folder-contents",
108
- slug: "DOCUSIGN_GET_WORKSPACE_FOLDER_CONTENTS",
109
- name: "Get Workspace Folder Contents",
110
- description: "List the contents of a workspace folder.",
111
- method: "GET",
112
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}/folders/${ctx.encode(String(ctx.input.folderId))}`,
113
- input: workspaceItem,
114
- output: docusignGenericObjectSchema
115
- });
116
- const deleteWorkspaceFilesOrFolders = defineRestOperation({
117
- id: "docusign.delete-workspace-files-or-folders",
118
- slug: "DOCUSIGN_DELETE_WORKSPACE_FILES_OR_FOLDERS",
119
- name: "Delete Workspace Files Or Folders",
120
- description: "Delete files or folders from a workspace.",
121
- needsApproval: true,
122
- method: "PUT",
123
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}/items`,
124
- input: workspaceId.extend({ items: z.array(docusignLooseObjectSchema()).min(1) }),
125
- output: docusignSuccessSchema,
126
- body: (input) => ({ items: input.items }),
127
- transformResponse: () => ({ success: true })
128
- });
129
- const updateWorkspaceItemMetadata = defineRestOperation({
130
- id: "docusign.update-workspace-item-metadata",
131
- slug: "DOCUSIGN_UPDATE_WORKSPACE_ITEM_METADATA",
132
- name: "Update Workspace Item Metadata",
133
- description: "Update metadata on a workspace item.",
134
- needsApproval: true,
135
- method: "PUT",
136
- path: (ctx) => `/workspaces/${ctx.encode(String(ctx.input.workspaceId))}/folders/${ctx.encode(String(ctx.input.folderId))}/files/${ctx.encode(String(ctx.input.fileId))}`,
137
- input: workspaceFile.extend({ metadata: docusignLooseObjectSchema() }),
138
- output: docusignGenericObjectSchema,
139
- body: (input) => input.metadata
140
- });
141
-
142
- //#endregion
143
- export { addFileToWorkspace, createACollaborativeWorkspace, deleteExistingWorkspaceLogically, deleteWorkspaceFilesOrFolders, getWorkspaceFile, getWorkspaceFolderContents, listWorkspaceFilePages, listWorkspaces, retrievePropertiesAboutWorkspace, updateWorkspaceInformation, updateWorkspaceItemMetadata };