@keystrokehq/docusign 0.0.15 → 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.
- package/README.md +3 -2
- package/dist/credential-sets/index.d.mts +2 -0
- package/dist/credential-sets/index.mjs +4 -0
- package/dist/docusign-jwt.credential-set-B0sXS-5i.mjs +39 -0
- package/dist/docusign-jwt.credential-set-Bz99DTgx.d.mts +90 -0
- package/dist/docusign.credential-set-DRhK9ICD.mjs +183 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +6 -1
- package/dist/operations/index.d.mts +2 -0
- package/dist/operations/index.mjs +3 -0
- package/dist/void-envelope.operation-Bim49UXq.mjs +8192 -0
- package/dist/void-envelope.operation-D-onxqe_.d.mts +18203 -0
- package/package.json +11 -226
- package/dist/_official/index.d.mts +0 -75
- package/dist/_official/index.mjs +0 -3
- package/dist/_runtime/index.d.mts +0 -1
- package/dist/_runtime/index.mjs +0 -1
- package/dist/account-custom-fields.d.mts +0 -48
- package/dist/account-custom-fields.mjs +0 -63
- package/dist/account-stamps.d.mts +0 -119
- package/dist/account-stamps.mjs +0 -144
- package/dist/account-tabs.d.mts +0 -65
- package/dist/account-tabs.mjs +0 -80
- package/dist/account.d.mts +0 -160
- package/dist/account.mjs +0 -207
- package/dist/admin.d.mts +0 -13
- package/dist/admin.mjs +0 -20
- package/dist/auth.d.mts +0 -28
- package/dist/auth.mjs +0 -64
- package/dist/bcc-archive.d.mts +0 -47
- package/dist/bcc-archive.mjs +0 -70
- package/dist/billing.d.mts +0 -152
- package/dist/billing.mjs +0 -208
- package/dist/brands.d.mts +0 -147
- package/dist/brands.mjs +0 -157
- package/dist/bulk-send.d.mts +0 -104
- package/dist/bulk-send.mjs +0 -115
- package/dist/chunked-uploads.d.mts +0 -57
- package/dist/chunked-uploads.mjs +0 -74
- package/dist/click.d.mts +0 -13
- package/dist/click.mjs +0 -20
- package/dist/client.d.mts +0 -47
- package/dist/client.mjs +0 -286
- package/dist/clm.d.mts +0 -13
- package/dist/clm.mjs +0 -20
- package/dist/cloud-storage.d.mts +0 -93
- package/dist/cloud-storage.mjs +0 -115
- package/dist/connect.d.mts +0 -183
- package/dist/connect.mjs +0 -217
- package/dist/connection.d.mts +0 -2
- package/dist/connection.mjs +0 -3
- package/dist/contacts.d.mts +0 -59
- package/dist/contacts.mjs +0 -79
- package/dist/enote.d.mts +0 -31
- package/dist/enote.mjs +0 -45
- package/dist/envelope-attachments.d.mts +0 -65
- package/dist/envelope-attachments.mjs +0 -76
- package/dist/envelope-custom-fields.d.mts +0 -137
- package/dist/envelope-custom-fields.mjs +0 -92
- package/dist/envelope-documents.d.mts +0 -206
- package/dist/envelope-documents.mjs +0 -219
- package/dist/envelope-email.d.mts +0 -48
- package/dist/envelope-email.mjs +0 -60
- package/dist/envelope-lock.d.mts +0 -48
- package/dist/envelope-lock.mjs +0 -60
- package/dist/envelope-logs.d.mts +0 -89
- package/dist/envelope-logs.mjs +0 -126
- package/dist/envelope-notifications.d.mts +0 -34
- package/dist/envelope-notifications.mjs +0 -44
- package/dist/envelope-recipients.d.mts +0 -126
- package/dist/envelope-recipients.mjs +0 -136
- package/dist/envelope-tabs.d.mts +0 -39
- package/dist/envelope-tabs.mjs +0 -49
- package/dist/envelope-views.d.mts +0 -74
- package/dist/envelope-views.mjs +0 -88
- package/dist/envelope-workflow.d.mts +0 -151
- package/dist/envelope-workflow.mjs +0 -176
- package/dist/envelopes.d.mts +0 -377
- package/dist/envelopes.mjs +0 -190
- package/dist/errors.d.mts +0 -48
- package/dist/errors.mjs +0 -76
- package/dist/events.d.mts +0 -192
- package/dist/events.mjs +0 -146
- package/dist/factory-5kY-Jnda.mjs +0 -8
- package/dist/groups.d.mts +0 -150
- package/dist/groups.mjs +0 -146
- package/dist/integration-H05G5JY8.mjs +0 -112
- package/dist/integration-Mk1ScWT6.d.mts +0 -30
- package/dist/messaging.d.mts +0 -1
- package/dist/messaging.mjs +0 -1
- package/dist/monitor.d.mts +0 -13
- package/dist/monitor.mjs +0 -20
- package/dist/notary.d.mts +0 -92
- package/dist/notary.mjs +0 -122
- package/dist/operation-helpers-D25WHTo1.mjs +0 -102
- package/dist/permission-profiles.d.mts +0 -57
- package/dist/permission-profiles.mjs +0 -70
- package/dist/power-forms.d.mts +0 -38
- package/dist/power-forms.mjs +0 -62
- package/dist/rooms.d.mts +0 -13
- package/dist/rooms.mjs +0 -28
- package/dist/shared-DTUCJayR.mjs +0 -27
- package/dist/signing-groups.d.mts +0 -102
- package/dist/signing-groups.mjs +0 -117
- package/dist/template-custom-fields.d.mts +0 -166
- package/dist/template-custom-fields.mjs +0 -107
- package/dist/template-documents.d.mts +0 -99
- package/dist/template-documents.mjs +0 -109
- package/dist/template-lock.d.mts +0 -48
- package/dist/template-lock.mjs +0 -60
- package/dist/template-sharing.d.mts +0 -96
- package/dist/template-sharing.mjs +0 -108
- package/dist/template-workflow.d.mts +0 -135
- package/dist/template-workflow.mjs +0 -152
- package/dist/templates.d.mts +0 -129
- package/dist/templates.mjs +0 -110
- package/dist/user-authorizations.d.mts +0 -96
- package/dist/user-authorizations.mjs +0 -133
- package/dist/user-custom-settings.d.mts +0 -60
- package/dist/user-custom-settings.mjs +0 -69
- package/dist/user-profile.d.mts +0 -80
- package/dist/user-profile.mjs +0 -106
- package/dist/user-signatures.d.mts +0 -155
- package/dist/user-signatures.mjs +0 -180
- package/dist/users.d.mts +0 -103
- package/dist/users.mjs +0 -98
- package/dist/verification.d.mts +0 -19
- package/dist/verification.mjs +0 -59
- package/dist/workspaces.d.mts +0 -128
- package/dist/workspaces.mjs +0 -143
package/dist/groups.mjs
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { docusignGenericObjectSchema, docusignGroupListSchema, docusignListPaginationInputSchema, docusignLooseObjectSchema, docusignSuccessSchema } from "./schemas/index.mjs";
|
|
2
|
-
import { r as defineRestOperation } from "./operation-helpers-D25WHTo1.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
//#region src/groups.ts
|
|
6
|
-
/**
|
|
7
|
-
* Account groups (groups + brands + users). Covers PLAN.md § 6.28.
|
|
8
|
-
*/
|
|
9
|
-
const groupId = z.object({ groupId: z.string().min(1) });
|
|
10
|
-
const groupBrand = groupId.extend({ brandId: z.string().min(1) });
|
|
11
|
-
const createGroupsForAccount = defineRestOperation({
|
|
12
|
-
id: "docusign.create-groups-for-account",
|
|
13
|
-
slug: "DOCUSIGN_CREATE_GROUPS_FOR_ACCOUNT",
|
|
14
|
-
name: "Create Groups For Account",
|
|
15
|
-
description: "Create new groups on the account.",
|
|
16
|
-
needsApproval: true,
|
|
17
|
-
method: "POST",
|
|
18
|
-
path: "/groups",
|
|
19
|
-
input: z.object({ groups: z.array(docusignLooseObjectSchema()).min(1) }),
|
|
20
|
-
output: docusignGroupListSchema,
|
|
21
|
-
body: (input) => ({ groups: input.groups })
|
|
22
|
-
});
|
|
23
|
-
const getGroupsInformationForAccount = defineRestOperation({
|
|
24
|
-
id: "docusign.get-groups-information-for-account",
|
|
25
|
-
slug: "DOCUSIGN_GET_GROUPS_INFORMATION_FOR_ACCOUNT",
|
|
26
|
-
name: "Get Groups For Account",
|
|
27
|
-
description: "List groups on the account.",
|
|
28
|
-
method: "GET",
|
|
29
|
-
path: "/groups",
|
|
30
|
-
input: docusignListPaginationInputSchema.extend({
|
|
31
|
-
groupType: z.string().optional(),
|
|
32
|
-
searchText: z.string().optional()
|
|
33
|
-
}),
|
|
34
|
-
output: docusignGroupListSchema,
|
|
35
|
-
query: (input) => ({
|
|
36
|
-
start_position: input.startPosition,
|
|
37
|
-
count: input.count,
|
|
38
|
-
group_type: input.groupType,
|
|
39
|
-
search_text: input.searchText
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
const updateGroupInformation = defineRestOperation({
|
|
43
|
-
id: "docusign.update-group-information",
|
|
44
|
-
slug: "DOCUSIGN_UPDATE_GROUP_INFORMATION",
|
|
45
|
-
name: "Update Group Information",
|
|
46
|
-
description: "Update information on a group.",
|
|
47
|
-
needsApproval: true,
|
|
48
|
-
method: "PUT",
|
|
49
|
-
path: "/groups",
|
|
50
|
-
input: z.object({ groups: z.array(docusignLooseObjectSchema()).min(1) }),
|
|
51
|
-
output: docusignGroupListSchema,
|
|
52
|
-
body: (input) => ({ groups: input.groups })
|
|
53
|
-
});
|
|
54
|
-
const deleteUserGroup = defineRestOperation({
|
|
55
|
-
id: "docusign.delete-user-group",
|
|
56
|
-
slug: "DOCUSIGN_DELETE_USER_GROUP",
|
|
57
|
-
name: "Delete User Group",
|
|
58
|
-
description: "Delete groups by id.",
|
|
59
|
-
needsApproval: true,
|
|
60
|
-
method: "DELETE",
|
|
61
|
-
path: "/groups",
|
|
62
|
-
input: z.object({ groups: z.array(docusignLooseObjectSchema()).min(1) }),
|
|
63
|
-
output: docusignSuccessSchema,
|
|
64
|
-
body: (input) => ({ groups: input.groups }),
|
|
65
|
-
transformResponse: () => ({ success: true })
|
|
66
|
-
});
|
|
67
|
-
const addUsersToExistingGroup = defineRestOperation({
|
|
68
|
-
id: "docusign.add-users-to-existing-group",
|
|
69
|
-
slug: "DOCUSIGN_ADD_USERS_TO_EXISTING_GROUP",
|
|
70
|
-
name: "Add Users To Existing Group",
|
|
71
|
-
description: "Add users to an existing group.",
|
|
72
|
-
needsApproval: true,
|
|
73
|
-
method: "PUT",
|
|
74
|
-
path: (ctx) => `/groups/${ctx.encode(String(ctx.input.groupId))}/users`,
|
|
75
|
-
input: groupId.extend({ users: z.array(docusignLooseObjectSchema()).min(1) }),
|
|
76
|
-
output: docusignGenericObjectSchema,
|
|
77
|
-
body: (input) => ({ users: input.users })
|
|
78
|
-
});
|
|
79
|
-
const getUsersInGroup = defineRestOperation({
|
|
80
|
-
id: "docusign.get-users-in-group",
|
|
81
|
-
slug: "DOCUSIGN_GET_USERS_IN_GROUP",
|
|
82
|
-
name: "Get Users In Group",
|
|
83
|
-
description: "List users in a group.",
|
|
84
|
-
method: "GET",
|
|
85
|
-
path: (ctx) => `/groups/${ctx.encode(String(ctx.input.groupId))}/users`,
|
|
86
|
-
input: groupId.extend({
|
|
87
|
-
startPosition: z.number().int().nonnegative().optional(),
|
|
88
|
-
count: z.number().int().positive().optional()
|
|
89
|
-
}),
|
|
90
|
-
output: docusignGenericObjectSchema,
|
|
91
|
-
query: (input) => ({
|
|
92
|
-
start_position: input.startPosition,
|
|
93
|
-
count: input.count
|
|
94
|
-
})
|
|
95
|
-
});
|
|
96
|
-
const deleteUsersFromGroup = defineRestOperation({
|
|
97
|
-
id: "docusign.delete-users-from-group",
|
|
98
|
-
slug: "DOCUSIGN_DELETE_USERS_FROM_GROUP",
|
|
99
|
-
name: "Delete Users From Group",
|
|
100
|
-
description: "Remove users from a group.",
|
|
101
|
-
needsApproval: true,
|
|
102
|
-
method: "DELETE",
|
|
103
|
-
path: (ctx) => `/groups/${ctx.encode(String(ctx.input.groupId))}/users`,
|
|
104
|
-
input: groupId.extend({ users: z.array(docusignLooseObjectSchema()).min(1) }),
|
|
105
|
-
output: docusignSuccessSchema,
|
|
106
|
-
body: (input) => ({ users: input.users }),
|
|
107
|
-
transformResponse: () => ({ success: true })
|
|
108
|
-
});
|
|
109
|
-
const addExistingBrandToGroup = defineRestOperation({
|
|
110
|
-
id: "docusign.add-existing-brand-to-group",
|
|
111
|
-
slug: "DOCUSIGN_ADD_EXISTING_BRAND_TO_GROUP",
|
|
112
|
-
name: "Add Existing Brand To Group",
|
|
113
|
-
description: "Associate an existing brand with a group.",
|
|
114
|
-
needsApproval: true,
|
|
115
|
-
method: "PUT",
|
|
116
|
-
path: (ctx) => `/groups/${ctx.encode(String(ctx.input.groupId))}/brands`,
|
|
117
|
-
input: groupId.extend({ brands: z.array(docusignLooseObjectSchema()).min(1) }),
|
|
118
|
-
output: docusignGenericObjectSchema,
|
|
119
|
-
body: (input) => ({ brands: input.brands })
|
|
120
|
-
});
|
|
121
|
-
const deleteBrandFromGroup = defineRestOperation({
|
|
122
|
-
id: "docusign.delete-brand-from-group",
|
|
123
|
-
slug: "DOCUSIGN_DELETE_BRAND_FROM_GROUP",
|
|
124
|
-
name: "Delete Brand From Group",
|
|
125
|
-
description: "Disassociate a brand from a group.",
|
|
126
|
-
needsApproval: true,
|
|
127
|
-
method: "DELETE",
|
|
128
|
-
path: (ctx) => `/groups/${ctx.encode(String(ctx.input.groupId))}/brands`,
|
|
129
|
-
input: groupBrand,
|
|
130
|
-
output: docusignSuccessSchema,
|
|
131
|
-
body: (input) => ({ brands: [{ brandId: input.brandId }] }),
|
|
132
|
-
transformResponse: () => ({ success: true })
|
|
133
|
-
});
|
|
134
|
-
const getBrandsInformationForGroup = defineRestOperation({
|
|
135
|
-
id: "docusign.get-brands-information-for-group",
|
|
136
|
-
slug: "DOCUSIGN_GET_BRANDS_INFORMATION_FOR_GROUP",
|
|
137
|
-
name: "Get Brands For Group",
|
|
138
|
-
description: "List brands associated with a group.",
|
|
139
|
-
method: "GET",
|
|
140
|
-
path: (ctx) => `/groups/${ctx.encode(String(ctx.input.groupId))}/brands`,
|
|
141
|
-
input: groupId,
|
|
142
|
-
output: docusignGenericObjectSchema
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
//#endregion
|
|
146
|
-
export { addExistingBrandToGroup, addUsersToExistingGroup, createGroupsForAccount, deleteBrandFromGroup, deleteUserGroup, deleteUsersFromGroup, getBrandsInformationForGroup, getGroupsInformationForAccount, getUsersInGroup, updateGroupInformation };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { defineOfficialIntegration, officialCredentialSetId } from "@keystrokehq/integration-authoring/official";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { CredentialSet } from "@keystrokehq/core";
|
|
4
|
-
|
|
5
|
-
//#region src/_official/provider-app.ts
|
|
6
|
-
/**
|
|
7
|
-
* Keystroke-owned OAuth client definition for the DocuSign public connection.
|
|
8
|
-
*
|
|
9
|
-
* Used for: OAuth authorization-code exchange, refresh, and the embedded
|
|
10
|
-
* `/oauth/userinfo` lookup that resolves an account's `baseUri`.
|
|
11
|
-
*/
|
|
12
|
-
const docusignAppCredentialSet = new CredentialSet({
|
|
13
|
-
id: officialCredentialSetId("docusign-app"),
|
|
14
|
-
credentialType: "manual",
|
|
15
|
-
exposure: "platform-only",
|
|
16
|
-
name: "DocuSign App",
|
|
17
|
-
auth: z.object({
|
|
18
|
-
clientId: z.string().min(1),
|
|
19
|
-
clientSecret: z.string().min(1)
|
|
20
|
-
})
|
|
21
|
-
});
|
|
22
|
-
/**
|
|
23
|
-
* Keystroke-owned Connect webhook signing secrets.
|
|
24
|
-
*
|
|
25
|
-
* DocuSign Connect allows up to 10 concurrent HMAC shared secrets for rotation.
|
|
26
|
-
* Each outbound webhook is signed with every enabled secret as a separate
|
|
27
|
-
* `X-DocuSign-Signature-{N}` header. Verification accepts a delivery if any
|
|
28
|
-
* header matches any configured secret under a constant-time compare.
|
|
29
|
-
*
|
|
30
|
-
* Secrets are parsed from `KEYSTROKE_OFFICIAL_DOCUSIGN_CONNECT_HMAC_SECRETS`,
|
|
31
|
-
* a comma-separated list with newest first.
|
|
32
|
-
*/
|
|
33
|
-
const docusignConnectCredentialSet = new CredentialSet({
|
|
34
|
-
id: officialCredentialSetId("docusign-connect"),
|
|
35
|
-
credentialType: "manual",
|
|
36
|
-
exposure: "platform-only",
|
|
37
|
-
name: "DocuSign Connect",
|
|
38
|
-
auth: z.object({ hmacSecrets: z.array(z.string().min(1)).min(1) })
|
|
39
|
-
});
|
|
40
|
-
/**
|
|
41
|
-
* Keystroke-owned JWT Grant integrator key + RSA private key.
|
|
42
|
-
*
|
|
43
|
-
* Declared for forward compatibility: runtime paths that require JWT Grant
|
|
44
|
-
* (historical envelope replay, backend impersonation) will consume this
|
|
45
|
-
* credential set in a follow-up without a registry change. Not wired to any
|
|
46
|
-
* runtime path in v1 — any operation that would need JWT throws
|
|
47
|
-
* `DocusignApiError.notImplemented({ kind: 'plan_gated' })` until then.
|
|
48
|
-
*/
|
|
49
|
-
const docusignJwtCredentialSet = new CredentialSet({
|
|
50
|
-
id: officialCredentialSetId("docusign-jwt"),
|
|
51
|
-
credentialType: "manual",
|
|
52
|
-
exposure: "platform-only",
|
|
53
|
-
name: "DocuSign JWT",
|
|
54
|
-
auth: z.object({
|
|
55
|
-
integratorKey: z.string().min(1),
|
|
56
|
-
impersonatedUserId: z.uuid(),
|
|
57
|
-
privateKeyPem: z.string().min(1),
|
|
58
|
-
oauthHost: z.enum(["account.docusign.com", "account-d.docusign.com"])
|
|
59
|
-
})
|
|
60
|
-
});
|
|
61
|
-
/**
|
|
62
|
-
* Parse the comma-separated `KEYSTROKE_OFFICIAL_DOCUSIGN_CONNECT_HMAC_SECRETS`
|
|
63
|
-
* env value into the array shape the internal credential set expects. Empty
|
|
64
|
-
* input resolves to `[]`, which fails the `.min(1)` parse so Connect triggers
|
|
65
|
-
* reject deliveries until the env is populated.
|
|
66
|
-
*/
|
|
67
|
-
function parseHmacSecrets(raw) {
|
|
68
|
-
if (!raw) return [];
|
|
69
|
-
return raw.split(",").map((secret) => secret.trim()).filter((secret) => secret.length > 0);
|
|
70
|
-
}
|
|
71
|
-
const docusignOfficialProviderSeed = {
|
|
72
|
-
provider: "docusign",
|
|
73
|
-
appRef: "docusign-platform",
|
|
74
|
-
displayName: "DocuSign Platform",
|
|
75
|
-
credentialSetName: "Keystroke DocuSign Platform App",
|
|
76
|
-
envShape: {
|
|
77
|
-
KEYSTROKE_OFFICIAL_DOCUSIGN_CLIENT_ID: z.string().optional(),
|
|
78
|
-
KEYSTROKE_OFFICIAL_DOCUSIGN_CLIENT_SECRET: z.string().optional()
|
|
79
|
-
},
|
|
80
|
-
requiredEnvKeys: ["KEYSTROKE_OFFICIAL_DOCUSIGN_CLIENT_ID", "KEYSTROKE_OFFICIAL_DOCUSIGN_CLIENT_SECRET"],
|
|
81
|
-
externalAppIdEnvKey: "KEYSTROKE_OFFICIAL_DOCUSIGN_CLIENT_ID",
|
|
82
|
-
buildCredentials: (env) => ({
|
|
83
|
-
clientId: env.KEYSTROKE_OFFICIAL_DOCUSIGN_CLIENT_ID,
|
|
84
|
-
clientSecret: env.KEYSTROKE_OFFICIAL_DOCUSIGN_CLIENT_SECRET
|
|
85
|
-
})
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/integration.ts
|
|
90
|
-
const docusignAuthSchema = z.object({
|
|
91
|
-
DOCUSIGN_ACCESS_TOKEN: z.string().min(1),
|
|
92
|
-
DOCUSIGN_ACCOUNT_ID: z.string().min(1),
|
|
93
|
-
DOCUSIGN_BASE_URI: z.url()
|
|
94
|
-
});
|
|
95
|
-
const docusignOfficialIntegration = {
|
|
96
|
-
id: "docusign",
|
|
97
|
-
name: "DocuSign",
|
|
98
|
-
description: "DocuSign eSignature, templates, bulk-send, Connect webhooks, and account/admin surfaces for Keystroke workflows",
|
|
99
|
-
credentialType: "oauth",
|
|
100
|
-
auth: docusignAuthSchema
|
|
101
|
-
};
|
|
102
|
-
const docusignBundle = defineOfficialIntegration({
|
|
103
|
-
...docusignOfficialIntegration,
|
|
104
|
-
internal: {
|
|
105
|
-
providerApp: docusignAppCredentialSet,
|
|
106
|
-
other: [docusignConnectCredentialSet, docusignJwtCredentialSet]
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
const docusign = docusignBundle.credentialSet;
|
|
110
|
-
|
|
111
|
-
//#endregion
|
|
112
|
-
export { docusignConnectCredentialSet as a, parseHmacSecrets as c, docusignAppCredentialSet as i, docusignBundle as n, docusignJwtCredentialSet as o, docusignOfficialIntegration as r, docusignOfficialProviderSeed as s, docusign as t };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
4
|
-
import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
|
|
5
|
-
|
|
6
|
-
//#region src/integration.d.ts
|
|
7
|
-
declare const docusignOfficialIntegration: {
|
|
8
|
-
id: "docusign";
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
credentialType: "oauth";
|
|
12
|
-
auth: z.ZodObject<{
|
|
13
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
14
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
15
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
};
|
|
18
|
-
declare const docusignBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"docusign", z.ZodObject<{
|
|
19
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
20
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
21
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
22
|
-
}, z.core.$strip>>;
|
|
23
|
-
declare const docusign: _keystrokehq_core0.CredentialSet<"keystroke: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>>;
|
|
28
|
-
type DocusignCredentials = InferCredentialSetAuth<typeof docusign>;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { docusignOfficialIntegration as i, docusign as n, docusignBundle as r, DocusignCredentials as t };
|
package/dist/messaging.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/messaging.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/monitor.d.mts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region src/monitor.d.ts
|
|
5
|
-
declare const monitorNotImplemented: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>, z.ZodObject<{
|
|
6
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
7
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
8
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
9
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
10
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
11
|
-
}, z.core.$strip>>], undefined>;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { monitorNotImplemented };
|
package/dist/monitor.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { docusignGenericObjectSchema } from "./schemas/index.mjs";
|
|
2
|
-
import { n as definePlanGatedOperation } from "./operation-helpers-D25WHTo1.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
//#region src/monitor.ts
|
|
6
|
-
/**
|
|
7
|
-
* DocuSign Monitor — plan-gated in v1.
|
|
8
|
-
*/
|
|
9
|
-
const monitorNotImplemented = definePlanGatedOperation({
|
|
10
|
-
id: "docusign.monitor-not-implemented",
|
|
11
|
-
slug: "DOCUSIGN_MONITOR_NOT_IMPLEMENTED",
|
|
12
|
-
name: "DocuSign Monitor (not implemented)",
|
|
13
|
-
description: "Placeholder for DocuSign Monitor (security event stream).",
|
|
14
|
-
input: z.object({}).catchall(z.unknown()),
|
|
15
|
-
output: docusignGenericObjectSchema,
|
|
16
|
-
reason: "DocuSign Monitor requires a dedicated Monitor license and a separate host (`https://lens.docusign.net`)."
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { monitorNotImplemented };
|
package/dist/notary.d.mts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region src/notary.d.ts
|
|
5
|
-
declare const registerCurrentUserAsNotary: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
6
|
-
notary: z.ZodObject<{
|
|
7
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
8
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
9
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
11
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
12
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
13
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
14
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
15
|
-
}, z.core.$strip>>], undefined>;
|
|
16
|
-
declare const getNotaryUserSettings: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
17
|
-
includeJurisdictions: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
20
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
21
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
22
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
23
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
24
|
-
}, z.core.$strip>>], undefined>;
|
|
25
|
-
declare const updateUserNotaryInformation: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
26
|
-
notary: z.ZodObject<{
|
|
27
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
28
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
29
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
31
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
32
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
33
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
34
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
35
|
-
}, z.core.$strip>>], undefined>;
|
|
36
|
-
declare const createNotaryJurisdictionObject: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
37
|
-
jurisdiction: z.ZodObject<{
|
|
38
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
39
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
40
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
42
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
43
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
44
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
45
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
46
|
-
}, z.core.$strip>>], undefined>;
|
|
47
|
-
declare const getNotaryJurisdictionObject: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
48
|
-
jurisdictionId: z.ZodString;
|
|
49
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
51
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
52
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
53
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
54
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
55
|
-
}, z.core.$strip>>], undefined>;
|
|
56
|
-
declare const getNotaryJurisdictionsForUser: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
57
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
58
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
59
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
60
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
61
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
62
|
-
}, z.core.$strip>>], undefined>;
|
|
63
|
-
declare const updateNotaryJurisdictionInfo: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
64
|
-
jurisdictionId: z.ZodString;
|
|
65
|
-
jurisdiction: z.ZodObject<{
|
|
66
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
67
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
68
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
70
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
71
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
72
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
73
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
74
|
-
}, z.core.$strip>>], undefined>;
|
|
75
|
-
declare const deleteNotaryJurisdiction: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
76
|
-
jurisdictionId: z.ZodString;
|
|
77
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
-
success: z.ZodBoolean;
|
|
79
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
80
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
81
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
82
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
83
|
-
}, z.core.$strip>>], undefined>;
|
|
84
|
-
declare const listRegisteredNotaryJurisdictions: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
85
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
86
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:docusign", z.ZodObject<{
|
|
87
|
-
DOCUSIGN_ACCESS_TOKEN: z.ZodString;
|
|
88
|
-
DOCUSIGN_ACCOUNT_ID: z.ZodString;
|
|
89
|
-
DOCUSIGN_BASE_URI: z.ZodURL;
|
|
90
|
-
}, z.core.$strip>>], undefined>;
|
|
91
|
-
//#endregion
|
|
92
|
-
export { createNotaryJurisdictionObject, deleteNotaryJurisdiction, getNotaryJurisdictionObject, getNotaryJurisdictionsForUser, getNotaryUserSettings, listRegisteredNotaryJurisdictions, registerCurrentUserAsNotary, updateNotaryJurisdictionInfo, updateUserNotaryInformation };
|
package/dist/notary.mjs
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { docusignGenericObjectSchema, docusignLooseObjectSchema, docusignSuccessSchema } from "./schemas/index.mjs";
|
|
2
|
-
import { r as defineRestOperation } from "./operation-helpers-D25WHTo1.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
//#region src/notary.ts
|
|
6
|
-
/**
|
|
7
|
-
* Notary registration + jurisdictions. Covers PLAN.md § 6.38.
|
|
8
|
-
*/
|
|
9
|
-
const jurisdictionId = z.object({ jurisdictionId: z.string().min(1) });
|
|
10
|
-
const registerCurrentUserAsNotary = defineRestOperation({
|
|
11
|
-
id: "docusign.register-current-user-as-notary",
|
|
12
|
-
slug: "DOCUSIGN_REGISTER_CURRENT_USER_AS_NOTARY",
|
|
13
|
-
name: "Register Current User As Notary",
|
|
14
|
-
description: "Register the current user as a notary.",
|
|
15
|
-
needsApproval: true,
|
|
16
|
-
method: "POST",
|
|
17
|
-
path: "/current_user/notary",
|
|
18
|
-
input: z.object({ notary: docusignLooseObjectSchema() }),
|
|
19
|
-
output: docusignGenericObjectSchema,
|
|
20
|
-
body: (input) => input.notary,
|
|
21
|
-
accountScoped: false
|
|
22
|
-
});
|
|
23
|
-
const getNotaryUserSettings = defineRestOperation({
|
|
24
|
-
id: "docusign.get-notary-user-settings",
|
|
25
|
-
slug: "DOCUSIGN_GET_NOTARY_USER_SETTINGS",
|
|
26
|
-
name: "Get Notary User Settings",
|
|
27
|
-
description: "Retrieve notary user settings.",
|
|
28
|
-
method: "GET",
|
|
29
|
-
path: "/current_user/notary",
|
|
30
|
-
input: z.object({ includeJurisdictions: z.boolean().optional() }),
|
|
31
|
-
output: docusignGenericObjectSchema,
|
|
32
|
-
accountScoped: false,
|
|
33
|
-
query: (input) => ({ include_jurisdictions: input.includeJurisdictions })
|
|
34
|
-
});
|
|
35
|
-
const updateUserNotaryInformation = defineRestOperation({
|
|
36
|
-
id: "docusign.update-user-notary-information",
|
|
37
|
-
slug: "DOCUSIGN_UPDATE_USER_NOTARY_INFORMATION",
|
|
38
|
-
name: "Update Notary User Information",
|
|
39
|
-
description: "Update notary user information.",
|
|
40
|
-
needsApproval: true,
|
|
41
|
-
method: "PUT",
|
|
42
|
-
path: "/current_user/notary",
|
|
43
|
-
input: z.object({ notary: docusignLooseObjectSchema() }),
|
|
44
|
-
output: docusignGenericObjectSchema,
|
|
45
|
-
body: (input) => input.notary,
|
|
46
|
-
accountScoped: false
|
|
47
|
-
});
|
|
48
|
-
const createNotaryJurisdictionObject = defineRestOperation({
|
|
49
|
-
id: "docusign.create-notary-jurisdiction-object",
|
|
50
|
-
slug: "DOCUSIGN_CREATE_NOTARY_JURISDICTION_OBJECT",
|
|
51
|
-
name: "Create Notary Jurisdiction",
|
|
52
|
-
description: "Add a notary jurisdiction for the current user.",
|
|
53
|
-
needsApproval: true,
|
|
54
|
-
method: "POST",
|
|
55
|
-
path: "/current_user/notary/jurisdictions",
|
|
56
|
-
input: z.object({ jurisdiction: docusignLooseObjectSchema() }),
|
|
57
|
-
output: docusignGenericObjectSchema,
|
|
58
|
-
body: (input) => input.jurisdiction,
|
|
59
|
-
accountScoped: false
|
|
60
|
-
});
|
|
61
|
-
const getNotaryJurisdictionObject = defineRestOperation({
|
|
62
|
-
id: "docusign.get-notary-jurisdiction-object",
|
|
63
|
-
slug: "DOCUSIGN_GET_NOTARY_JURISDICTION_OBJECT",
|
|
64
|
-
name: "Get Notary Jurisdiction",
|
|
65
|
-
description: "Retrieve a notary jurisdiction by id.",
|
|
66
|
-
method: "GET",
|
|
67
|
-
path: (ctx) => `/current_user/notary/jurisdictions/${ctx.encode(String(ctx.input.jurisdictionId))}`,
|
|
68
|
-
input: jurisdictionId,
|
|
69
|
-
output: docusignGenericObjectSchema,
|
|
70
|
-
accountScoped: false
|
|
71
|
-
});
|
|
72
|
-
const getNotaryJurisdictionsForUser = defineRestOperation({
|
|
73
|
-
id: "docusign.get-notary-jurisdictions-for-user",
|
|
74
|
-
slug: "DOCUSIGN_GET_NOTARY_JURISDICTIONS_FOR_USER",
|
|
75
|
-
name: "Get Notary Jurisdictions",
|
|
76
|
-
description: "List notary jurisdictions for the current user.",
|
|
77
|
-
method: "GET",
|
|
78
|
-
path: "/current_user/notary/jurisdictions",
|
|
79
|
-
input: z.object({}),
|
|
80
|
-
output: docusignGenericObjectSchema,
|
|
81
|
-
accountScoped: false
|
|
82
|
-
});
|
|
83
|
-
const updateNotaryJurisdictionInfo = defineRestOperation({
|
|
84
|
-
id: "docusign.update-notary-jurisdiction-info",
|
|
85
|
-
slug: "DOCUSIGN_UPDATE_NOTARY_JURISDICTION_INFO",
|
|
86
|
-
name: "Update Notary Jurisdiction",
|
|
87
|
-
description: "Update a notary jurisdiction.",
|
|
88
|
-
needsApproval: true,
|
|
89
|
-
method: "PUT",
|
|
90
|
-
path: (ctx) => `/current_user/notary/jurisdictions/${ctx.encode(String(ctx.input.jurisdictionId))}`,
|
|
91
|
-
input: jurisdictionId.extend({ jurisdiction: docusignLooseObjectSchema() }),
|
|
92
|
-
output: docusignGenericObjectSchema,
|
|
93
|
-
body: (input) => input.jurisdiction,
|
|
94
|
-
accountScoped: false
|
|
95
|
-
});
|
|
96
|
-
const deleteNotaryJurisdiction = defineRestOperation({
|
|
97
|
-
id: "docusign.delete-notary-jurisdiction",
|
|
98
|
-
slug: "DOCUSIGN_DELETE_NOTARY_JURISDICTION",
|
|
99
|
-
name: "Delete Notary Jurisdiction",
|
|
100
|
-
description: "Delete a notary jurisdiction.",
|
|
101
|
-
needsApproval: true,
|
|
102
|
-
method: "DELETE",
|
|
103
|
-
path: (ctx) => `/current_user/notary/jurisdictions/${ctx.encode(String(ctx.input.jurisdictionId))}`,
|
|
104
|
-
input: jurisdictionId,
|
|
105
|
-
output: docusignSuccessSchema,
|
|
106
|
-
accountScoped: false,
|
|
107
|
-
transformResponse: () => ({ success: true })
|
|
108
|
-
});
|
|
109
|
-
const listRegisteredNotaryJurisdictions = defineRestOperation({
|
|
110
|
-
id: "docusign.list-registered-notary-jurisdictions",
|
|
111
|
-
slug: "DOCUSIGN_LIST_REGISTERED_NOTARY_JURISDICTIONS",
|
|
112
|
-
name: "List Registered Notary Jurisdictions",
|
|
113
|
-
description: "List jurisdictions that DocuSign supports for notary work.",
|
|
114
|
-
method: "GET",
|
|
115
|
-
path: "/notary/jurisdictions",
|
|
116
|
-
input: z.object({}),
|
|
117
|
-
output: docusignGenericObjectSchema,
|
|
118
|
-
accountScoped: false
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
//#endregion
|
|
122
|
-
export { createNotaryJurisdictionObject, deleteNotaryJurisdiction, getNotaryJurisdictionObject, getNotaryJurisdictionsForUser, getNotaryUserSettings, listRegisteredNotaryJurisdictions, registerCurrentUserAsNotary, updateNotaryJurisdictionInfo, updateUserNotaryInformation };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { DocusignApiError } from "./errors.mjs";
|
|
2
|
-
import { n as omitUndefined, t as encodeDocusignPathSegment } from "./shared-DTUCJayR.mjs";
|
|
3
|
-
import { createDocusignClient } from "./client.mjs";
|
|
4
|
-
import { t as docusignOperation } from "./factory-5kY-Jnda.mjs";
|
|
5
|
-
|
|
6
|
-
//#region src/operation-helpers.ts
|
|
7
|
-
function defineRestOperation(config) {
|
|
8
|
-
const op = docusignOperation({
|
|
9
|
-
id: config.id,
|
|
10
|
-
name: config.name,
|
|
11
|
-
description: config.description,
|
|
12
|
-
input: config.input,
|
|
13
|
-
output: config.output,
|
|
14
|
-
needsApproval: config.needsApproval,
|
|
15
|
-
run: async (input, credentials) => {
|
|
16
|
-
const client = createDocusignClient(credentials);
|
|
17
|
-
const path = resolvePath(config.path, input);
|
|
18
|
-
const response = await client.request({
|
|
19
|
-
method: config.method,
|
|
20
|
-
path,
|
|
21
|
-
query: normalizeQuery(config.query?.(input)),
|
|
22
|
-
body: config.body?.(input),
|
|
23
|
-
accept: config.accept,
|
|
24
|
-
accountScoped: config.accountScoped
|
|
25
|
-
});
|
|
26
|
-
const transformed = config.transformResponse ? config.transformResponse(response, input) : response;
|
|
27
|
-
return config.output.parse(transformed);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
markSlug(op, config.slug);
|
|
31
|
-
return op;
|
|
32
|
-
}
|
|
33
|
-
function defineBinaryOperation(config) {
|
|
34
|
-
const op = docusignOperation({
|
|
35
|
-
id: config.id,
|
|
36
|
-
name: config.name,
|
|
37
|
-
description: config.description,
|
|
38
|
-
input: config.input,
|
|
39
|
-
output: config.output,
|
|
40
|
-
run: async (input, credentials) => {
|
|
41
|
-
const client = createDocusignClient(credentials);
|
|
42
|
-
const path = resolvePath(config.path, input);
|
|
43
|
-
const response = await client.requestBinary({
|
|
44
|
-
method: config.method,
|
|
45
|
-
path,
|
|
46
|
-
query: normalizeQuery(config.query?.(input)),
|
|
47
|
-
body: config.body?.(input),
|
|
48
|
-
accept: config.accept,
|
|
49
|
-
accountScoped: config.accountScoped
|
|
50
|
-
});
|
|
51
|
-
const parsed = {
|
|
52
|
-
contentType: response.contentType,
|
|
53
|
-
contentDisposition: response.contentDisposition,
|
|
54
|
-
status: response.status,
|
|
55
|
-
body: base64FromBytes(response.body)
|
|
56
|
-
};
|
|
57
|
-
return config.output.parse(parsed);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
markSlug(op, config.slug);
|
|
61
|
-
return op;
|
|
62
|
-
}
|
|
63
|
-
function definePlanGatedOperation(config) {
|
|
64
|
-
const op = docusignOperation({
|
|
65
|
-
id: config.id,
|
|
66
|
-
name: config.name,
|
|
67
|
-
description: config.description,
|
|
68
|
-
input: config.input,
|
|
69
|
-
output: config.output,
|
|
70
|
-
needsApproval: config.needsApproval,
|
|
71
|
-
run: async () => {
|
|
72
|
-
throw DocusignApiError.notImplemented({
|
|
73
|
-
slug: config.slug,
|
|
74
|
-
reason: config.reason,
|
|
75
|
-
kind: config.kind ?? "plan_gated"
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
markSlug(op, config.slug);
|
|
80
|
-
return op;
|
|
81
|
-
}
|
|
82
|
-
function resolvePath(path, input) {
|
|
83
|
-
if (typeof path === "string") return path;
|
|
84
|
-
return path({
|
|
85
|
-
input,
|
|
86
|
-
encode: encodeDocusignPathSegment
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function normalizeQuery(query) {
|
|
90
|
-
if (!query) return void 0;
|
|
91
|
-
return omitUndefined(query);
|
|
92
|
-
}
|
|
93
|
-
function base64FromBytes(bytes) {
|
|
94
|
-
return Buffer.from(bytes).toString("base64");
|
|
95
|
-
}
|
|
96
|
-
const slugRegistry = /* @__PURE__ */ new WeakMap();
|
|
97
|
-
function markSlug(op, slug) {
|
|
98
|
-
slugRegistry.set(op, slug);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
export { definePlanGatedOperation as n, defineRestOperation as r, defineBinaryOperation as t };
|