@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,190 +0,0 @@
1
- import { docusignEnvelopeCreateInputSchema, docusignEnvelopeIdSchema, docusignEnvelopeSchema, docusignEnvelopeSummarySchema, docusignGenericObjectSchema, docusignIncludeSchema, 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/envelopes.ts
6
- /**
7
- * Envelope core lifecycle — get, send, replay, audit, transcripts.
8
- * Covers PLAN.md § 6.1.
9
- */
10
- const binaryResponseSchema = docusignLooseObjectSchema({
11
- contentType: z.string().optional(),
12
- contentDisposition: z.string().optional(),
13
- status: z.number(),
14
- body: z.string()
15
- });
16
- const getEnvelope = defineRestOperation({
17
- id: "docusign.get-envelope",
18
- slug: "DOCUSIGN_GET_ENVELOPE",
19
- name: "Get Envelope",
20
- description: "Fetch a DocuSign envelope by id, optionally expanding recipients/tabs/custom_fields/documents.",
21
- method: "GET",
22
- path: (ctx) => `/envelopes/${ctx.encode(String(ctx.input.envelopeId))}`,
23
- input: z.object({
24
- envelopeId: docusignEnvelopeIdSchema,
25
- include: docusignIncludeSchema.optional(),
26
- advancedUpdate: z.boolean().optional()
27
- }),
28
- output: docusignEnvelopeSchema,
29
- query: (input) => ({
30
- include: input.include,
31
- advanced_update: input.advancedUpdate
32
- })
33
- });
34
- const sendEnvelope = defineRestOperation({
35
- id: "docusign.send-envelope",
36
- slug: "DOCUSIGN_SEND_ENVELOPE",
37
- name: "Send Envelope",
38
- description: "Create and send an envelope in one call (status=sent) or save it as a draft.",
39
- needsApproval: true,
40
- method: "POST",
41
- path: "/envelopes",
42
- input: docusignEnvelopeCreateInputSchema,
43
- output: docusignEnvelopeSummarySchema,
44
- body: (input) => input
45
- });
46
- const voidEnvelope = defineRestOperation({
47
- id: "docusign.void-envelope",
48
- slug: "DOCUSIGN_SEND_ENVELOPE",
49
- name: "Void Envelope",
50
- description: "Void an in-flight envelope. Modeled as a PUT on the envelope with status=voided + voidedReason.",
51
- needsApproval: true,
52
- method: "PUT",
53
- path: (ctx) => `/envelopes/${ctx.encode(String(ctx.input.envelopeId))}`,
54
- input: z.object({
55
- envelopeId: docusignEnvelopeIdSchema,
56
- voidedReason: z.string().min(1)
57
- }),
58
- output: docusignEnvelopeSchema,
59
- body: (input) => ({
60
- status: "voided",
61
- voidedReason: input.voidedReason
62
- })
63
- });
64
- const createEnvelopeFromTemplate = defineRestOperation({
65
- id: "docusign.create-envelope-from-template",
66
- slug: "DOCUSIGN_CREATE_ENVELOPE_FROM_TEMPLATE",
67
- name: "Create Envelope From Template",
68
- description: "Create a new envelope bound to an existing DocuSign template, filling template roles from input.",
69
- needsApproval: true,
70
- method: "POST",
71
- path: "/envelopes",
72
- input: docusignEnvelopeCreateInputSchema.extend({
73
- templateId: z.string().min(1),
74
- templateRoles: z.array(docusignLooseObjectSchema()).min(1),
75
- status: z.enum(["created", "sent"]).optional()
76
- }),
77
- output: docusignEnvelopeSummarySchema,
78
- body: (input) => input
79
- });
80
- const retrieveEnvelopeAuditEvents = defineRestOperation({
81
- id: "docusign.retrieve-envelope-audit-events",
82
- slug: "DOCUSIGN_RETRIEVE_ENVELOPE_AUDIT_EVENTS",
83
- name: "Retrieve Envelope Audit Events",
84
- description: "Fetch the audit trail for an envelope (send, view, sign, decline, void, etc).",
85
- method: "GET",
86
- path: (ctx) => `/envelopes/${ctx.encode(String(ctx.input.envelopeId))}/audit_events`,
87
- input: z.object({ envelopeId: docusignEnvelopeIdSchema }),
88
- output: docusignLooseObjectSchema({ auditEvents: z.array(docusignLooseObjectSchema()).optional() })
89
- });
90
- const republishConnectDataForEnvelope = defineRestOperation({
91
- id: "docusign.republish-connect-data-for-envelope",
92
- slug: "DOCUSIGN_REPUBLISH_CONNECT_DATA_FOR_ENVELOPE",
93
- name: "Republish Connect Data For Envelope",
94
- description: "Retrigger Connect webhooks for a specific envelope.",
95
- needsApproval: true,
96
- method: "PUT",
97
- path: (ctx) => `/connect/envelopes/${ctx.encode(String(ctx.input.envelopeId))}/retry_queue`,
98
- input: z.object({ envelopeId: docusignEnvelopeIdSchema }),
99
- output: docusignGenericObjectSchema
100
- });
101
- const republishConnectInfoForEnvelopes = defineRestOperation({
102
- id: "docusign.republish-connect-info-for-envelopes",
103
- slug: "DOCUSIGN_REPUBLISH_CONNECT_INFO_FOR_ENVELOPES",
104
- name: "Republish Connect Info For Envelopes",
105
- description: "Retrigger Connect webhooks for a set of envelopes by id (bulk version of the single-envelope call).",
106
- needsApproval: true,
107
- method: "PUT",
108
- path: "/connect/envelopes/retry_queue",
109
- input: z.object({ envelopeIds: z.array(docusignEnvelopeIdSchema).min(1) }),
110
- output: docusignGenericObjectSchema,
111
- body: (input) => ({ envelopeIds: input.envelopeIds })
112
- });
113
- const submitBatchHistoricalEnvelopesToWebhook = defineRestOperation({
114
- id: "docusign.submit-batch-historical-envelopes-to-webhook",
115
- slug: "DOCUSIGN_SUBMIT_BATCH_HISTORICAL_ENVELOPES_TO_WEBHOOK",
116
- name: "Submit Batch Historical Envelopes To Webhook",
117
- description: "Queue historical envelopes for delivery to a Connect consumer. Requires JWT Grant + admin consent — v1 ships this as a pass-through; production use is plan-gated until JWT is enabled.",
118
- needsApproval: true,
119
- method: "POST",
120
- path: "/connect/envelopes/publish/historical",
121
- input: z.object({
122
- connectId: z.string().min(1),
123
- envelopeIds: z.array(docusignEnvelopeIdSchema).min(1)
124
- }),
125
- output: docusignGenericObjectSchema,
126
- body: (input) => ({
127
- connectId: input.connectId,
128
- envelopeIds: input.envelopeIds
129
- })
130
- });
131
- const retrieveEnvelopeHtmlDefinition = defineRestOperation({
132
- id: "docusign.retrieve-envelope-html-definition",
133
- slug: "DOCUSIGN_RETRIEVE_ENVELOPE_HTML_DEFINITION",
134
- name: "Retrieve Envelope HTML Definition",
135
- description: "Get the responsive HTML definition for an envelope.",
136
- method: "GET",
137
- path: (ctx) => `/envelopes/${ctx.encode(String(ctx.input.envelopeId))}/html_definitions`,
138
- input: z.object({ envelopeId: docusignEnvelopeIdSchema }),
139
- output: docusignGenericObjectSchema
140
- });
141
- const retrieveHtmlDefinitionForResponsiveDocument = defineRestOperation({
142
- id: "docusign.retrieve-html-definition-for-responsive-document",
143
- slug: "DOCUSIGN_RETRIEVE_HTMLDEFINITION_FOR_RESPONSIVE_DOCUMENT",
144
- name: "Retrieve HTML Definition For Responsive Document",
145
- description: "Get the responsive HTML definition for a specific document within an envelope.",
146
- method: "GET",
147
- path: (ctx) => `/envelopes/${ctx.encode(String(ctx.input.envelopeId))}/documents/${ctx.encode(String(ctx.input.documentId))}/html_definitions`,
148
- input: z.object({
149
- envelopeId: docusignEnvelopeIdSchema,
150
- documentId: z.string().min(1)
151
- }),
152
- output: docusignGenericObjectSchema
153
- });
154
- const getPdfTranscriptOfEnvelopeComments = defineBinaryOperation({
155
- id: "docusign.get-pdf-transcript-of-envelope-comments",
156
- slug: "DOCUSIGN_GET_PDFTRANSCRIPT_OF_ENVELOPE_COMMENTS",
157
- name: "Get PDF Transcript Of Envelope Comments",
158
- description: "Download a PDF transcript of the comments thread on an envelope.",
159
- method: "GET",
160
- path: (ctx) => `/envelopes/${ctx.encode(String(ctx.input.envelopeId))}/comments/transcript`,
161
- input: z.object({ envelopeId: docusignEnvelopeIdSchema }),
162
- accept: "application/pdf",
163
- output: binaryResponseSchema
164
- });
165
- const deleteEnvelopeTransferRule = defineRestOperation({
166
- id: "docusign.delete-envelope-transfer-rule",
167
- slug: "DOCUSIGN_DELETE_ENVELOPE_TRANSFER_RULE",
168
- name: "Delete Envelope Transfer Rule",
169
- description: "Remove a single envelope-transfer rule by id.",
170
- needsApproval: true,
171
- method: "DELETE",
172
- path: (ctx) => `/envelopes/transfer_rules/${ctx.encode(String(ctx.input.transferRuleId))}`,
173
- input: z.object({ transferRuleId: z.string().min(1) }),
174
- output: docusignSuccessSchema,
175
- transformResponse: () => ({ success: true })
176
- });
177
- const fetchRecipientNamesForEmail = defineRestOperation({
178
- id: "docusign.fetch-recipient-names-for-email",
179
- slug: "DOCUSIGN_FETCH_RECIPIENT_NAMES_FOR_EMAIL",
180
- name: "Fetch Recipient Names For Email",
181
- description: "Look up known recipient names for a given email address on the account.",
182
- method: "GET",
183
- path: "/recipient_names",
184
- input: z.object({ email: z.email() }),
185
- output: docusignLooseObjectSchema({ recipientNames: z.array(z.string()).optional() }),
186
- query: (input) => ({ email: input.email })
187
- });
188
-
189
- //#endregion
190
- export { createEnvelopeFromTemplate, deleteEnvelopeTransferRule, fetchRecipientNamesForEmail, getEnvelope, getPdfTranscriptOfEnvelopeComments, republishConnectDataForEnvelope, republishConnectInfoForEnvelopes, retrieveEnvelopeAuditEvents, retrieveEnvelopeHtmlDefinition, retrieveHtmlDefinitionForResponsiveDocument, sendEnvelope, submitBatchHistoricalEnvelopesToWebhook, voidEnvelope };
package/dist/errors.d.mts DELETED
@@ -1,48 +0,0 @@
1
- //#region src/errors.d.ts
2
- /**
3
- * Package-local error class for DocuSign API failures.
4
- *
5
- * Carries the provider-returned HTTP status, DocuSign error code (when
6
- * structured), trace token (`X-DocuSign-TraceToken` echoes back in support
7
- * queries), and a discriminated `kind` that operations can branch on without
8
- * string-matching error messages.
9
- */
10
- type DocusignApiErrorKind = 'http' | 'rate_limit' | 'auth' | 'validation' | 'plan_gated' | 'webhook_signature' | 'not_implemented' | 'network';
11
- interface DocusignApiErrorInit {
12
- readonly kind: DocusignApiErrorKind;
13
- readonly status?: number;
14
- readonly providerErrorCode?: string;
15
- readonly requestId?: string;
16
- readonly retryable?: boolean;
17
- readonly retryAfterMs?: number;
18
- readonly body?: unknown;
19
- readonly cause?: unknown;
20
- }
21
- declare class DocusignApiError extends Error {
22
- readonly kind: DocusignApiErrorKind;
23
- readonly status: number | undefined;
24
- readonly providerErrorCode: string | undefined;
25
- readonly requestId: string | undefined;
26
- readonly retryable: boolean;
27
- readonly retryAfterMs: number | undefined;
28
- readonly body: unknown;
29
- constructor(message: string, init: DocusignApiErrorInit);
30
- static notImplemented(init: {
31
- slug?: string;
32
- reason?: string;
33
- kind?: Extract<DocusignApiErrorKind, 'plan_gated' | 'not_implemented'>;
34
- }): DocusignApiError;
35
- static fromResponse(params: {
36
- status: number;
37
- body: unknown;
38
- requestId?: string;
39
- retryAfterMs?: number;
40
- url: string;
41
- method: string;
42
- }): DocusignApiError;
43
- static webhookSignature(message: string): DocusignApiError;
44
- static validation(message: string, cause?: unknown): DocusignApiError;
45
- }
46
- declare function isDocusignApiError(value: unknown): value is DocusignApiError;
47
- //#endregion
48
- export { DocusignApiError, DocusignApiErrorInit, DocusignApiErrorKind, isDocusignApiError };
package/dist/errors.mjs DELETED
@@ -1,76 +0,0 @@
1
- //#region src/errors.ts
2
- var DocusignApiError = class DocusignApiError extends Error {
3
- kind;
4
- status;
5
- providerErrorCode;
6
- requestId;
7
- retryable;
8
- retryAfterMs;
9
- body;
10
- constructor(message, init) {
11
- super(message, { cause: init.cause });
12
- this.name = "DocusignApiError";
13
- this.kind = init.kind;
14
- this.status = init.status;
15
- this.providerErrorCode = init.providerErrorCode;
16
- this.requestId = init.requestId;
17
- this.retryable = init.retryable ?? defaultRetryable(init.kind, init.status);
18
- this.retryAfterMs = init.retryAfterMs;
19
- this.body = init.body;
20
- }
21
- static notImplemented(init) {
22
- const kind = init.kind ?? "not_implemented";
23
- const slugSuffix = init.slug ? ` (${init.slug})` : "";
24
- return new DocusignApiError(`${init.reason ?? "DocuSign operation is not implemented in this release."}${slugSuffix}`, {
25
- kind,
26
- retryable: false
27
- });
28
- }
29
- static fromResponse(params) {
30
- const { status, body, requestId, retryAfterMs, url, method } = params;
31
- const bodyRecord = isRecord(body) ? body : void 0;
32
- const providerErrorCode = readString(bodyRecord?.errorCode) ?? readString(bodyRecord?.code);
33
- const providerMessage = readString(bodyRecord?.message) ?? readString(bodyRecord?.error_description) ?? readString(bodyRecord?.error);
34
- const kind = status === 401 || status === 403 ? "auth" : status === 429 ? "rate_limit" : "http";
35
- return new DocusignApiError(`DocuSign ${method} ${url} failed (${status}): ${providerMessage ?? `HTTP ${status}`}`, {
36
- kind,
37
- status,
38
- providerErrorCode,
39
- requestId,
40
- retryAfterMs,
41
- body,
42
- retryable: status === 429 || status >= 500
43
- });
44
- }
45
- static webhookSignature(message) {
46
- return new DocusignApiError(message, {
47
- kind: "webhook_signature",
48
- retryable: false
49
- });
50
- }
51
- static validation(message, cause) {
52
- return new DocusignApiError(message, {
53
- kind: "validation",
54
- retryable: false,
55
- cause
56
- });
57
- }
58
- };
59
- function defaultRetryable(kind, status) {
60
- if (kind === "rate_limit") return true;
61
- if (kind === "network") return true;
62
- if (typeof status === "number" && status >= 500) return true;
63
- return false;
64
- }
65
- function isRecord(value) {
66
- return typeof value === "object" && value !== null;
67
- }
68
- function readString(value) {
69
- return typeof value === "string" && value.trim().length > 0 ? value : void 0;
70
- }
71
- function isDocusignApiError(value) {
72
- return value instanceof DocusignApiError;
73
- }
74
-
75
- //#endregion
76
- export { DocusignApiError, isDocusignApiError };
package/dist/events.d.mts DELETED
@@ -1,192 +0,0 @@
1
- import { z } from "zod";
2
-
3
- //#region src/events.d.ts
4
- declare const docusignEnvelopeEventNames: readonly ["envelope-sent", "envelope-resent", "envelope-delivered", "envelope-signed", "envelope-completed", "envelope-declined", "envelope-voided", "envelope-corrected", "envelope-discard", "envelope-purge", "envelope-reassign", "envelope-deleted", "envelope-documents-purged"];
5
- declare const docusignRecipientEventNames: readonly ["recipient-sent", "recipient-resent", "recipient-delivered", "recipient-completed", "recipient-declined", "recipient-authenticationfailed", "recipient-autoresponded", "recipient-delegate", "recipient-finish-later", "recipient-reassign"];
6
- declare const docusignTemplateEventNames: readonly ["template-created", "template-modified"];
7
- declare const docusignConnectEventNames: readonly ["envelope-sent", "envelope-resent", "envelope-delivered", "envelope-signed", "envelope-completed", "envelope-declined", "envelope-voided", "envelope-corrected", "envelope-discard", "envelope-purge", "envelope-reassign", "envelope-deleted", "envelope-documents-purged", "recipient-sent", "recipient-resent", "recipient-delivered", "recipient-completed", "recipient-declined", "recipient-authenticationfailed", "recipient-autoresponded", "recipient-delegate", "recipient-finish-later", "recipient-reassign", "template-created", "template-modified"];
8
- declare const docusignConnectEventNameSchema: z.ZodEnum<{
9
- "envelope-sent": "envelope-sent";
10
- "envelope-resent": "envelope-resent";
11
- "envelope-delivered": "envelope-delivered";
12
- "envelope-signed": "envelope-signed";
13
- "envelope-completed": "envelope-completed";
14
- "envelope-declined": "envelope-declined";
15
- "envelope-voided": "envelope-voided";
16
- "envelope-corrected": "envelope-corrected";
17
- "envelope-discard": "envelope-discard";
18
- "envelope-purge": "envelope-purge";
19
- "envelope-reassign": "envelope-reassign";
20
- "envelope-deleted": "envelope-deleted";
21
- "envelope-documents-purged": "envelope-documents-purged";
22
- "recipient-sent": "recipient-sent";
23
- "recipient-resent": "recipient-resent";
24
- "recipient-delivered": "recipient-delivered";
25
- "recipient-completed": "recipient-completed";
26
- "recipient-declined": "recipient-declined";
27
- "recipient-authenticationfailed": "recipient-authenticationfailed";
28
- "recipient-autoresponded": "recipient-autoresponded";
29
- "recipient-delegate": "recipient-delegate";
30
- "recipient-finish-later": "recipient-finish-later";
31
- "recipient-reassign": "recipient-reassign";
32
- "template-created": "template-created";
33
- "template-modified": "template-modified";
34
- }>;
35
- declare const docusignConnectEnvelopeEventSchema: z.ZodObject<{
36
- event: z.ZodEnum<{
37
- "envelope-sent": "envelope-sent";
38
- "envelope-resent": "envelope-resent";
39
- "envelope-delivered": "envelope-delivered";
40
- "envelope-signed": "envelope-signed";
41
- "envelope-completed": "envelope-completed";
42
- "envelope-declined": "envelope-declined";
43
- "envelope-voided": "envelope-voided";
44
- "envelope-corrected": "envelope-corrected";
45
- "envelope-discard": "envelope-discard";
46
- "envelope-purge": "envelope-purge";
47
- "envelope-reassign": "envelope-reassign";
48
- "envelope-deleted": "envelope-deleted";
49
- "envelope-documents-purged": "envelope-documents-purged";
50
- }>;
51
- apiVersion: z.ZodOptional<z.ZodString>;
52
- configurationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
53
- generatedDateTime: z.ZodOptional<z.ZodString>;
54
- retryCount: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
55
- uri: z.ZodOptional<z.ZodString>;
56
- data: z.ZodObject<{
57
- accountId: z.ZodOptional<z.ZodString>;
58
- userId: z.ZodOptional<z.ZodString>;
59
- envelopeId: z.ZodString;
60
- envelopeSummary: z.ZodOptional<z.ZodObject<{
61
- envelopeId: z.ZodOptional<z.ZodString>;
62
- status: z.ZodOptional<z.ZodString>;
63
- emailSubject: z.ZodOptional<z.ZodString>;
64
- emailBlurb: z.ZodOptional<z.ZodString>;
65
- statusChangedDateTime: z.ZodOptional<z.ZodString>;
66
- sentDateTime: z.ZodOptional<z.ZodString>;
67
- completedDateTime: z.ZodOptional<z.ZodString>;
68
- voidedReason: z.ZodOptional<z.ZodString>;
69
- senderAccountId: z.ZodOptional<z.ZodString>;
70
- senderUserId: z.ZodOptional<z.ZodString>;
71
- }, z.core.$catchall<z.ZodUnknown>>>;
72
- }, z.core.$catchall<z.ZodUnknown>>;
73
- }, z.core.$strip>;
74
- declare const docusignConnectRecipientEventSchema: z.ZodObject<{
75
- event: z.ZodEnum<{
76
- "recipient-sent": "recipient-sent";
77
- "recipient-resent": "recipient-resent";
78
- "recipient-delivered": "recipient-delivered";
79
- "recipient-completed": "recipient-completed";
80
- "recipient-declined": "recipient-declined";
81
- "recipient-authenticationfailed": "recipient-authenticationfailed";
82
- "recipient-autoresponded": "recipient-autoresponded";
83
- "recipient-delegate": "recipient-delegate";
84
- "recipient-finish-later": "recipient-finish-later";
85
- "recipient-reassign": "recipient-reassign";
86
- }>;
87
- apiVersion: z.ZodOptional<z.ZodString>;
88
- configurationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
89
- generatedDateTime: z.ZodOptional<z.ZodString>;
90
- retryCount: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
91
- uri: z.ZodOptional<z.ZodString>;
92
- data: z.ZodObject<{
93
- accountId: z.ZodOptional<z.ZodString>;
94
- userId: z.ZodOptional<z.ZodString>;
95
- envelopeId: z.ZodString;
96
- recipientId: z.ZodOptional<z.ZodString>;
97
- recipientIdGuid: z.ZodOptional<z.ZodString>;
98
- envelopeSummary: z.ZodOptional<z.ZodObject<{
99
- envelopeId: z.ZodOptional<z.ZodString>;
100
- status: z.ZodOptional<z.ZodString>;
101
- emailSubject: z.ZodOptional<z.ZodString>;
102
- emailBlurb: z.ZodOptional<z.ZodString>;
103
- statusChangedDateTime: z.ZodOptional<z.ZodString>;
104
- sentDateTime: z.ZodOptional<z.ZodString>;
105
- completedDateTime: z.ZodOptional<z.ZodString>;
106
- voidedReason: z.ZodOptional<z.ZodString>;
107
- senderAccountId: z.ZodOptional<z.ZodString>;
108
- senderUserId: z.ZodOptional<z.ZodString>;
109
- }, z.core.$catchall<z.ZodUnknown>>>;
110
- recipientSummary: z.ZodOptional<z.ZodObject<{
111
- recipientId: z.ZodOptional<z.ZodString>;
112
- recipientIdGuid: z.ZodOptional<z.ZodString>;
113
- email: z.ZodOptional<z.ZodString>;
114
- userName: z.ZodOptional<z.ZodString>;
115
- status: z.ZodOptional<z.ZodString>;
116
- routingOrder: z.ZodOptional<z.ZodString>;
117
- }, z.core.$catchall<z.ZodUnknown>>>;
118
- }, z.core.$catchall<z.ZodUnknown>>;
119
- }, z.core.$strip>;
120
- declare const docusignConnectTemplateEventSchema: z.ZodObject<{
121
- event: z.ZodEnum<{
122
- "template-created": "template-created";
123
- "template-modified": "template-modified";
124
- }>;
125
- apiVersion: z.ZodOptional<z.ZodString>;
126
- configurationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
127
- generatedDateTime: z.ZodOptional<z.ZodString>;
128
- retryCount: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
129
- uri: z.ZodOptional<z.ZodString>;
130
- data: z.ZodObject<{
131
- accountId: z.ZodOptional<z.ZodString>;
132
- templateId: z.ZodString;
133
- templateSummary: z.ZodOptional<z.ZodObject<{
134
- templateId: z.ZodOptional<z.ZodString>;
135
- name: z.ZodOptional<z.ZodString>;
136
- description: z.ZodOptional<z.ZodString>;
137
- }, z.core.$catchall<z.ZodUnknown>>>;
138
- }, z.core.$catchall<z.ZodUnknown>>;
139
- }, z.core.$strip>;
140
- /**
141
- * The root envelope that wraps every Connect delivery. We keep this loose so
142
- * downstream `definitionFilter` can branch on `event` without failing parse
143
- * when DocuSign adds a new event type — the specific per-event schemas above
144
- * validate the narrowed shape inside each trigger.
145
- */
146
- declare const docusignConnectEnvelopeSchema: z.ZodObject<{
147
- event: z.ZodString;
148
- apiVersion: z.ZodOptional<z.ZodString>;
149
- configurationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
150
- generatedDateTime: z.ZodOptional<z.ZodString>;
151
- retryCount: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
152
- uri: z.ZodOptional<z.ZodString>;
153
- data: z.ZodObject<{
154
- accountId: z.ZodOptional<z.ZodString>;
155
- userId: z.ZodOptional<z.ZodString>;
156
- envelopeId: z.ZodOptional<z.ZodString>;
157
- recipientId: z.ZodOptional<z.ZodString>;
158
- templateId: z.ZodOptional<z.ZodString>;
159
- envelopeSummary: z.ZodOptional<z.ZodObject<{
160
- envelopeId: z.ZodOptional<z.ZodString>;
161
- status: z.ZodOptional<z.ZodString>;
162
- emailSubject: z.ZodOptional<z.ZodString>;
163
- emailBlurb: z.ZodOptional<z.ZodString>;
164
- statusChangedDateTime: z.ZodOptional<z.ZodString>;
165
- sentDateTime: z.ZodOptional<z.ZodString>;
166
- completedDateTime: z.ZodOptional<z.ZodString>;
167
- voidedReason: z.ZodOptional<z.ZodString>;
168
- senderAccountId: z.ZodOptional<z.ZodString>;
169
- senderUserId: z.ZodOptional<z.ZodString>;
170
- }, z.core.$catchall<z.ZodUnknown>>>;
171
- recipientSummary: z.ZodOptional<z.ZodObject<{
172
- recipientId: z.ZodOptional<z.ZodString>;
173
- recipientIdGuid: z.ZodOptional<z.ZodString>;
174
- email: z.ZodOptional<z.ZodString>;
175
- userName: z.ZodOptional<z.ZodString>;
176
- status: z.ZodOptional<z.ZodString>;
177
- routingOrder: z.ZodOptional<z.ZodString>;
178
- }, z.core.$catchall<z.ZodUnknown>>>;
179
- templateSummary: z.ZodOptional<z.ZodObject<{
180
- templateId: z.ZodOptional<z.ZodString>;
181
- name: z.ZodOptional<z.ZodString>;
182
- description: z.ZodOptional<z.ZodString>;
183
- }, z.core.$catchall<z.ZodUnknown>>>;
184
- }, z.core.$catchall<z.ZodUnknown>>;
185
- }, z.core.$strip>;
186
- type DocusignConnectEnvelope = z.infer<typeof docusignConnectEnvelopeSchema>;
187
- type DocusignConnectEnvelopeEvent = z.infer<typeof docusignConnectEnvelopeEventSchema>;
188
- type DocusignConnectRecipientEvent = z.infer<typeof docusignConnectRecipientEventSchema>;
189
- type DocusignConnectTemplateEvent = z.infer<typeof docusignConnectTemplateEventSchema>;
190
- type DocusignConnectEventName = (typeof docusignConnectEventNames)[number];
191
- //#endregion
192
- export { DocusignConnectEnvelope, DocusignConnectEnvelopeEvent, DocusignConnectEventName, DocusignConnectRecipientEvent, DocusignConnectTemplateEvent, docusignConnectEnvelopeEventSchema, docusignConnectEnvelopeSchema, docusignConnectEventNameSchema, docusignConnectEventNames, docusignConnectRecipientEventSchema, docusignConnectTemplateEventSchema, docusignEnvelopeEventNames, docusignRecipientEventNames, docusignTemplateEventNames };
package/dist/events.mjs DELETED
@@ -1,146 +0,0 @@
1
- import { docusignLooseObjectSchema } from "./schemas/index.mjs";
2
- import { z } from "zod";
3
-
4
- //#region src/events.ts
5
- /**
6
- * DocuSign Connect webhook event schemas.
7
- *
8
- * Connect delivers envelope, recipient, and template lifecycle events as
9
- * JSON payloads under the `envelope-publish v2` format. These schemas
10
- * describe the shape operations receive after HMAC verification has passed.
11
- * The envelope union is deliberately loose where DocuSign returns polymorphic
12
- * sub-shapes that depend on the Connect configuration; inner fields are
13
- * parsed strictly where they're used for idempotency.
14
- *
15
- * See: https://developers.docusign.com/platform/webhooks/connect/event-model/
16
- */
17
- const docusignEnvelopeEventNames = [
18
- "envelope-sent",
19
- "envelope-resent",
20
- "envelope-delivered",
21
- "envelope-signed",
22
- "envelope-completed",
23
- "envelope-declined",
24
- "envelope-voided",
25
- "envelope-corrected",
26
- "envelope-discard",
27
- "envelope-purge",
28
- "envelope-reassign",
29
- "envelope-deleted",
30
- "envelope-documents-purged"
31
- ];
32
- const docusignRecipientEventNames = [
33
- "recipient-sent",
34
- "recipient-resent",
35
- "recipient-delivered",
36
- "recipient-completed",
37
- "recipient-declined",
38
- "recipient-authenticationfailed",
39
- "recipient-autoresponded",
40
- "recipient-delegate",
41
- "recipient-finish-later",
42
- "recipient-reassign"
43
- ];
44
- const docusignTemplateEventNames = ["template-created", "template-modified"];
45
- const docusignConnectEventNames = [
46
- ...docusignEnvelopeEventNames,
47
- ...docusignRecipientEventNames,
48
- ...docusignTemplateEventNames
49
- ];
50
- const docusignConnectEventNameSchema = z.enum(docusignConnectEventNames);
51
- const envelopeSummarySchema = docusignLooseObjectSchema({
52
- envelopeId: z.string().optional(),
53
- status: z.string().optional(),
54
- emailSubject: z.string().optional(),
55
- emailBlurb: z.string().optional(),
56
- statusChangedDateTime: z.string().optional(),
57
- sentDateTime: z.string().optional(),
58
- completedDateTime: z.string().optional(),
59
- voidedReason: z.string().optional(),
60
- senderAccountId: z.string().optional(),
61
- senderUserId: z.string().optional()
62
- });
63
- const recipientSummarySchema = docusignLooseObjectSchema({
64
- recipientId: z.string().optional(),
65
- recipientIdGuid: z.string().optional(),
66
- email: z.string().optional(),
67
- userName: z.string().optional(),
68
- status: z.string().optional(),
69
- routingOrder: z.string().optional()
70
- });
71
- const templateSummarySchema = docusignLooseObjectSchema({
72
- templateId: z.string().optional(),
73
- name: z.string().optional(),
74
- description: z.string().optional()
75
- });
76
- const docusignConnectEnvelopeEventSchema = z.object({
77
- event: z.enum(docusignEnvelopeEventNames),
78
- apiVersion: z.string().optional(),
79
- configurationId: z.union([z.string(), z.number()]).optional(),
80
- generatedDateTime: z.string().optional(),
81
- retryCount: z.union([z.string(), z.number()]).optional(),
82
- uri: z.string().optional(),
83
- data: docusignLooseObjectSchema({
84
- accountId: z.string().optional(),
85
- userId: z.string().optional(),
86
- envelopeId: z.string().min(1),
87
- envelopeSummary: envelopeSummarySchema.optional()
88
- })
89
- });
90
- const docusignConnectRecipientEventSchema = z.object({
91
- event: z.enum(docusignRecipientEventNames),
92
- apiVersion: z.string().optional(),
93
- configurationId: z.union([z.string(), z.number()]).optional(),
94
- generatedDateTime: z.string().optional(),
95
- retryCount: z.union([z.string(), z.number()]).optional(),
96
- uri: z.string().optional(),
97
- data: docusignLooseObjectSchema({
98
- accountId: z.string().optional(),
99
- userId: z.string().optional(),
100
- envelopeId: z.string().min(1),
101
- recipientId: z.string().optional(),
102
- recipientIdGuid: z.string().optional(),
103
- envelopeSummary: envelopeSummarySchema.optional(),
104
- recipientSummary: recipientSummarySchema.optional()
105
- })
106
- });
107
- const docusignConnectTemplateEventSchema = z.object({
108
- event: z.enum(docusignTemplateEventNames),
109
- apiVersion: z.string().optional(),
110
- configurationId: z.union([z.string(), z.number()]).optional(),
111
- generatedDateTime: z.string().optional(),
112
- retryCount: z.union([z.string(), z.number()]).optional(),
113
- uri: z.string().optional(),
114
- data: docusignLooseObjectSchema({
115
- accountId: z.string().optional(),
116
- templateId: z.string().min(1),
117
- templateSummary: templateSummarySchema.optional()
118
- })
119
- });
120
- /**
121
- * The root envelope that wraps every Connect delivery. We keep this loose so
122
- * downstream `definitionFilter` can branch on `event` without failing parse
123
- * when DocuSign adds a new event type — the specific per-event schemas above
124
- * validate the narrowed shape inside each trigger.
125
- */
126
- const docusignConnectEnvelopeSchema = z.object({
127
- event: z.string().min(1),
128
- apiVersion: z.string().optional(),
129
- configurationId: z.union([z.string(), z.number()]).optional(),
130
- generatedDateTime: z.string().optional(),
131
- retryCount: z.union([z.string(), z.number()]).optional(),
132
- uri: z.string().optional(),
133
- data: docusignLooseObjectSchema({
134
- accountId: z.string().optional(),
135
- userId: z.string().optional(),
136
- envelopeId: z.string().optional(),
137
- recipientId: z.string().optional(),
138
- templateId: z.string().optional(),
139
- envelopeSummary: envelopeSummarySchema.optional(),
140
- recipientSummary: recipientSummarySchema.optional(),
141
- templateSummary: templateSummarySchema.optional()
142
- })
143
- });
144
-
145
- //#endregion
146
- export { docusignConnectEnvelopeEventSchema, docusignConnectEnvelopeSchema, docusignConnectEventNameSchema, docusignConnectEventNames, docusignConnectRecipientEventSchema, docusignConnectTemplateEventSchema, docusignEnvelopeEventNames, docusignRecipientEventNames, docusignTemplateEventNames };
@@ -1,7 +0,0 @@
1
- import { d as createOfficialOperationFactory, t as docusign } from "./integration-BcEp_dFX.mjs";
2
-
3
- //#region src/factory.ts
4
- const docusignOperation = createOfficialOperationFactory(docusign);
5
-
6
- //#endregion
7
- export { docusignOperation as t };