@verdocs/js-sdk 3.10.30 → 4.0.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/dist/README.md +75 -0
- package/dist/index.d.mts +41294 -0
- package/dist/index.d.ts +41294 -0
- package/dist/index.js +3045 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3036 -0
- package/dist/index.mjs.map +1 -0
- package/dist/package.json +85 -0
- package/dist/tsconfig.json +16 -0
- package/package.json +29 -12
- package/.github/workflows/generate-docs.yml +0 -41
- package/Envelopes/Envelopes.d.ts +0 -242
- package/Envelopes/Envelopes.js +0 -339
- package/Envelopes/Initials.d.ts +0 -15
- package/Envelopes/Initials.js +0 -13
- package/Envelopes/Permissions.d.ts +0 -52
- package/Envelopes/Permissions.js +0 -84
- package/Envelopes/Recipients.d.ts +0 -89
- package/Envelopes/Recipients.js +0 -112
- package/Envelopes/Reminders.d.ts +0 -23
- package/Envelopes/Reminders.js +0 -33
- package/Envelopes/Signatures.d.ts +0 -28
- package/Envelopes/Signatures.js +0 -37
- package/Envelopes/Types.d.ts +0 -390
- package/Envelopes/Types.js +0 -45
- package/Envelopes/index.d.ts +0 -7
- package/Envelopes/index.js +0 -7
- package/Organizations/ApiKeys.d.ts +0 -64
- package/Organizations/ApiKeys.js +0 -82
- package/Organizations/Groups.d.ts +0 -47
- package/Organizations/Groups.js +0 -76
- package/Organizations/Invitations.d.ts +0 -24
- package/Organizations/Invitations.js +0 -45
- package/Organizations/Members.d.ts +0 -12
- package/Organizations/Members.js +0 -30
- package/Organizations/Organizations.d.ts +0 -27
- package/Organizations/Organizations.js +0 -45
- package/Organizations/Types.d.ts +0 -104
- package/Organizations/Types.js +0 -1
- package/Organizations/Webhooks.d.ts +0 -34
- package/Organizations/Webhooks.js +0 -10
- package/Organizations/Whitelabel.d.ts +0 -31
- package/Organizations/Whitelabel.js +0 -38
- package/Organizations/index.d.ts +0 -16
- package/Organizations/index.js +0 -16
- package/Sessions/Types.d.ts +0 -54
- package/Sessions/Types.js +0 -1
- package/Sessions/index.d.ts +0 -6
- package/Sessions/index.js +0 -7
- package/Templates/Actions.d.ts +0 -26
- package/Templates/Actions.js +0 -104
- package/Templates/Fields.d.ts +0 -14
- package/Templates/Fields.js +0 -24
- package/Templates/Pages.d.ts +0 -30
- package/Templates/Pages.js +0 -41
- package/Templates/Permissions.d.ts +0 -73
- package/Templates/Permissions.js +0 -124
- package/Templates/Reminders.d.ts +0 -23
- package/Templates/Reminders.js +0 -33
- package/Templates/Roles.d.ts +0 -16
- package/Templates/Roles.js +0 -42
- package/Templates/Stars.d.ts +0 -10
- package/Templates/Stars.js +0 -16
- package/Templates/Tags.d.ts +0 -33
- package/Templates/Tags.js +0 -55
- package/Templates/TemplateDocuments.d.ts +0 -66
- package/Templates/TemplateDocuments.js +0 -139
- package/Templates/Templates.d.ts +0 -284
- package/Templates/Templates.js +0 -309
- package/Templates/Types.d.ts +0 -346
- package/Templates/Types.js +0 -29
- package/Templates/Validators.d.ts +0 -21
- package/Templates/Validators.js +0 -27
- package/Templates/index.d.ts +0 -11
- package/Templates/index.js +0 -11
- package/Users/Auth.d.ts +0 -123
- package/Users/Auth.js +0 -142
- package/Users/Billing.d.ts +0 -1
- package/Users/Billing.js +0 -2
- package/Users/Notifications.d.ts +0 -2
- package/Users/Notifications.js +0 -43
- package/Users/Profiles.d.ts +0 -151
- package/Users/Profiles.js +0 -179
- package/Users/Types.d.ts +0 -146
- package/Users/Types.js +0 -47
- package/Users/index.d.ts +0 -5
- package/Users/index.js +0 -5
- package/Utils/Colors.d.ts +0 -18
- package/Utils/Colors.js +0 -102
- package/Utils/DateTime.d.ts +0 -6
- package/Utils/DateTime.js +0 -79
- package/Utils/Fields.d.ts +0 -5
- package/Utils/Fields.js +0 -24
- package/Utils/Files.d.ts +0 -16
- package/Utils/Files.js +0 -42
- package/Utils/Locales.d.ts +0 -17
- package/Utils/Locales.js +0 -1358
- package/Utils/Primitives.d.ts +0 -18
- package/Utils/Primitives.js +0 -31
- package/Utils/Strings.d.ts +0 -9
- package/Utils/Strings.js +0 -28
- package/Utils/Token.d.ts +0 -19
- package/Utils/Token.js +0 -67
- package/Utils/globalThis.d.ts +0 -2
- package/Utils/globalThis.js +0 -52
- package/Utils/index.d.ts +0 -8
- package/Utils/index.js +0 -8
- package/VerdocsEndpoint.d.ts +0 -199
- package/VerdocsEndpoint.js +0 -319
- package/index.d.ts +0 -18
- package/index.js +0 -18
- package/tsconfig-typedoc.json +0 -26
package/Envelopes/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * as Envelopes from './Envelopes';
|
|
2
|
-
export * as Permissions from './Permissions';
|
|
3
|
-
export * as Recipients from './Recipients';
|
|
4
|
-
export * as Reminders from './Reminders';
|
|
5
|
-
export * as Signatures from './Signatures';
|
|
6
|
-
export * as Initials from './Initials';
|
|
7
|
-
export * as Types from './Types';
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API keys are used to authenticate server-to-server calls. (API keys should **never** be used for client-to-server operations!)
|
|
3
|
-
* To generate a key, either use the Verdocs admin interface and make note of the client_id and client_secret generated, or call
|
|
4
|
-
* createKey as shown below. Then call {@link Users.Auth.authenticateApp} to obtain an access token using the provided ID and
|
|
5
|
-
* secret. Note that server-to-server authentication requests return shorter-lived tokens, so it is important to check the `exp`
|
|
6
|
-
* field and re-authenticate as needed for subsequent calls.
|
|
7
|
-
*
|
|
8
|
-
* API keys may be updated or rotated at any time. Regular rotation is recommended. Rotation will not expire or invalidate
|
|
9
|
-
* existing server-to-server sessions, so it may be done at any time without disrupting your application.
|
|
10
|
-
*
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
|
-
import { IApiKey, IApiKeyWithSecret, ICreateApiKeyRequest, IUpdateApiKeyRequest } from './Types';
|
|
14
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
15
|
-
/**
|
|
16
|
-
* Get a list of keys for a given organization. The caller must have admin access to the organization.
|
|
17
|
-
*
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
20
|
-
*
|
|
21
|
-
* const keys = await ApiKeys.getKeys(ORGID);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare const getKeys: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IApiKey[]>;
|
|
25
|
-
/**
|
|
26
|
-
* Create an API key.
|
|
27
|
-
*
|
|
28
|
-
* ```typescript
|
|
29
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
30
|
-
*
|
|
31
|
-
* await ApiKeys.createKey(ORGID, {name: NEWNAME});
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare const createKey: (endpoint: VerdocsEndpoint, organizationId: string, params: ICreateApiKeyRequest) => Promise<IApiKeyWithSecret>;
|
|
35
|
-
/**
|
|
36
|
-
* Rotate the secret for an API key. The caller must have admin access to the organization.
|
|
37
|
-
*
|
|
38
|
-
* ```typescript
|
|
39
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
40
|
-
*
|
|
41
|
-
* const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare const rotateKey: (endpoint: VerdocsEndpoint, organizationId: string, clientId: string) => Promise<IApiKeyWithSecret>;
|
|
45
|
-
/**
|
|
46
|
-
* Update an API key to change its assigned Profile ID or Name.
|
|
47
|
-
*
|
|
48
|
-
* ```typescript
|
|
49
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
50
|
-
*
|
|
51
|
-
* await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export declare const updateKey: (endpoint: VerdocsEndpoint, organizationId: string, clientId: string, params: IUpdateApiKeyRequest) => Promise<IApiKey>;
|
|
55
|
-
/**
|
|
56
|
-
* Delete an API key.
|
|
57
|
-
*
|
|
58
|
-
* ```typescript
|
|
59
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
60
|
-
*
|
|
61
|
-
* await ApiKeys.deleteKey(ORGID, CLIENTID);
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export declare const deleteKey: (endpoint: VerdocsEndpoint, organizationId: string, clientId: string) => Promise<any>;
|
package/Organizations/ApiKeys.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API keys are used to authenticate server-to-server calls. (API keys should **never** be used for client-to-server operations!)
|
|
3
|
-
* To generate a key, either use the Verdocs admin interface and make note of the client_id and client_secret generated, or call
|
|
4
|
-
* createKey as shown below. Then call {@link Users.Auth.authenticateApp} to obtain an access token using the provided ID and
|
|
5
|
-
* secret. Note that server-to-server authentication requests return shorter-lived tokens, so it is important to check the `exp`
|
|
6
|
-
* field and re-authenticate as needed for subsequent calls.
|
|
7
|
-
*
|
|
8
|
-
* API keys may be updated or rotated at any time. Regular rotation is recommended. Rotation will not expire or invalidate
|
|
9
|
-
* existing server-to-server sessions, so it may be done at any time without disrupting your application.
|
|
10
|
-
*
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Get a list of keys for a given organization. The caller must have admin access to the organization.
|
|
15
|
-
*
|
|
16
|
-
* ```typescript
|
|
17
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
18
|
-
*
|
|
19
|
-
* const keys = await ApiKeys.getKeys(ORGID);
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export var getKeys = function (endpoint, organizationId) {
|
|
23
|
-
return endpoint.api //
|
|
24
|
-
.get("/organizations/".concat(organizationId, "/api_key"))
|
|
25
|
-
.then(function (r) { return r.data; });
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Create an API key.
|
|
29
|
-
*
|
|
30
|
-
* ```typescript
|
|
31
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
32
|
-
*
|
|
33
|
-
* await ApiKeys.createKey(ORGID, {name: NEWNAME});
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export var createKey = function (endpoint, organizationId, params) {
|
|
37
|
-
return endpoint.api //
|
|
38
|
-
.post("/organizations/".concat(organizationId, "/api_key"), params)
|
|
39
|
-
.then(function (r) { return r.data; });
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Rotate the secret for an API key. The caller must have admin access to the organization.
|
|
43
|
-
*
|
|
44
|
-
* ```typescript
|
|
45
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
46
|
-
*
|
|
47
|
-
* const {client_secret: newSecret} = await ApiKeys.rotateKey(ORGID, CLIENTID);
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
export var rotateKey = function (endpoint, organizationId, clientId) {
|
|
51
|
-
return endpoint.api //
|
|
52
|
-
.put("/organizations/".concat(organizationId, "/api_key/").concat(clientId, "/rotate"))
|
|
53
|
-
.then(function (r) { return r.data; });
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Update an API key to change its assigned Profile ID or Name.
|
|
57
|
-
*
|
|
58
|
-
* ```typescript
|
|
59
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
60
|
-
*
|
|
61
|
-
* await ApiKeys.updateKey(ORGID, CLIENTID, {name: NEWNAME});
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export var updateKey = function (endpoint, organizationId, clientId, params) {
|
|
65
|
-
return endpoint.api //
|
|
66
|
-
.patch("/organizations/".concat(organizationId, "/api_key/").concat(clientId), params)
|
|
67
|
-
.then(function (r) { return r.data; });
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Delete an API key.
|
|
71
|
-
*
|
|
72
|
-
* ```typescript
|
|
73
|
-
* import {ApiKeys} from '@verdocs/js-sdk/Organizations';
|
|
74
|
-
*
|
|
75
|
-
* await ApiKeys.deleteKey(ORGID, CLIENTID);
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export var deleteKey = function (endpoint, organizationId, clientId) {
|
|
79
|
-
return endpoint.api //
|
|
80
|
-
.delete("/organizations/".concat(organizationId, "/api_key/").concat(clientId))
|
|
81
|
-
.then(function (r) { return r.data; });
|
|
82
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Organizations may contain "Groups" of user profiles, called Members. Groups may have permissions assigned that
|
|
3
|
-
* apply to all Members, making it easy to configure role-based access control (RBAC) within an Organization. Note
|
|
4
|
-
* that permissions are **additive**. A user may be a member of more than one group, and may also have permissions
|
|
5
|
-
* assigned directly. In that case, the user will have the combined set of all permissions inherited from all
|
|
6
|
-
* sources.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import { IGroup, IGroupDetail } from './Types';
|
|
11
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
12
|
-
import { IPermission } from '../Users/Types';
|
|
13
|
-
/**
|
|
14
|
-
* Get a list of groups for a given organization. The caller must have admin access to the organization.
|
|
15
|
-
*
|
|
16
|
-
* ```typescript
|
|
17
|
-
* import {Groups} from '@verdocs/js-sdk/Organizations';
|
|
18
|
-
*
|
|
19
|
-
* const groups = await Groups.getGroups(ORGID);
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare const getGroups: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IGroup[]>;
|
|
23
|
-
/**
|
|
24
|
-
* Get a single group by name. Returns a detail record.
|
|
25
|
-
*
|
|
26
|
-
* ```typescript
|
|
27
|
-
* import {Groups} from '@verdocs/js-sdk/Organizations';
|
|
28
|
-
*
|
|
29
|
-
* const groups = await Groups.getGroups(ORGID);
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare const getGroupByName: (endpoint: VerdocsEndpoint, organizationId: string, name?: string) => Promise<IGroupDetail>;
|
|
33
|
-
/**
|
|
34
|
-
* Get the details for a group.
|
|
35
|
-
*
|
|
36
|
-
* ```typescript
|
|
37
|
-
* import {Groups} from '@verdocs/js-sdk/Organizations';
|
|
38
|
-
*
|
|
39
|
-
* const groups = await Groups.getGroups(ORGID);
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export declare const getGroup: (endpoint: VerdocsEndpoint, organizationId: string, groupId: string) => Promise<IGroupDetail>;
|
|
43
|
-
export declare const getMembers: (endpoint: VerdocsEndpoint, organizationId: string, groupId: string) => Promise<any>;
|
|
44
|
-
export declare const addMembers: (endpoint: VerdocsEndpoint, organizationId: string, groupId: string, params: any) => Promise<any>;
|
|
45
|
-
export declare const deleteMembers: (endpoint: VerdocsEndpoint, organizationId: string, groupId: string, params: any) => Promise<any>;
|
|
46
|
-
export declare const addPermission: (endpoint: VerdocsEndpoint, organizationId: string, groupId: string, permissionId: string) => Promise<IPermission>;
|
|
47
|
-
export declare const deletePermission: (endpoint: VerdocsEndpoint, organizationId: string, groupId: string, permissionId: string) => Promise<any>;
|
package/Organizations/Groups.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Organizations may contain "Groups" of user profiles, called Members. Groups may have permissions assigned that
|
|
3
|
-
* apply to all Members, making it easy to configure role-based access control (RBAC) within an Organization. Note
|
|
4
|
-
* that permissions are **additive**. A user may be a member of more than one group, and may also have permissions
|
|
5
|
-
* assigned directly. In that case, the user will have the combined set of all permissions inherited from all
|
|
6
|
-
* sources.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Get a list of groups for a given organization. The caller must have admin access to the organization.
|
|
12
|
-
*
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import {Groups} from '@verdocs/js-sdk/Organizations';
|
|
15
|
-
*
|
|
16
|
-
* const groups = await Groups.getGroups(ORGID);
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export var getGroups = function (endpoint, organizationId) {
|
|
20
|
-
return endpoint.api //
|
|
21
|
-
.get("/organizations/".concat(organizationId, "/groups"))
|
|
22
|
-
.then(function (r) { return r.data; });
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Get a single group by name. Returns a detail record.
|
|
26
|
-
*
|
|
27
|
-
* ```typescript
|
|
28
|
-
* import {Groups} from '@verdocs/js-sdk/Organizations';
|
|
29
|
-
*
|
|
30
|
-
* const groups = await Groups.getGroups(ORGID);
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export var getGroupByName = function (endpoint, organizationId, name) {
|
|
34
|
-
return endpoint.api //
|
|
35
|
-
.get("/organizations/".concat(organizationId, "/groups"), { params: { name: name } })
|
|
36
|
-
.then(function (r) { return r.data; });
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Get the details for a group.
|
|
40
|
-
*
|
|
41
|
-
* ```typescript
|
|
42
|
-
* import {Groups} from '@verdocs/js-sdk/Organizations';
|
|
43
|
-
*
|
|
44
|
-
* const groups = await Groups.getGroups(ORGID);
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export var getGroup = function (endpoint, organizationId, groupId) {
|
|
48
|
-
return endpoint.api //
|
|
49
|
-
.get("/organizations/".concat(organizationId, "/groups/").concat(groupId))
|
|
50
|
-
.then(function (r) { return r.data; });
|
|
51
|
-
};
|
|
52
|
-
export var getMembers = function (endpoint, organizationId, groupId) {
|
|
53
|
-
return endpoint.api //
|
|
54
|
-
.get("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/members"))
|
|
55
|
-
.then(function (r) { return r.data; });
|
|
56
|
-
};
|
|
57
|
-
export var addMembers = function (endpoint, organizationId, groupId, params) {
|
|
58
|
-
return endpoint.api //
|
|
59
|
-
.post("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/members"), params)
|
|
60
|
-
.then(function (r) { return r.data; });
|
|
61
|
-
};
|
|
62
|
-
export var deleteMembers = function (endpoint, organizationId, groupId, params) {
|
|
63
|
-
return endpoint.api //
|
|
64
|
-
.put("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/delete_members"), params)
|
|
65
|
-
.then(function (r) { return r.data; });
|
|
66
|
-
};
|
|
67
|
-
export var addPermission = function (endpoint, organizationId, groupId, permissionId) {
|
|
68
|
-
return endpoint.api //
|
|
69
|
-
.post("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId), {})
|
|
70
|
-
.then(function (r) { return r.data; });
|
|
71
|
-
};
|
|
72
|
-
export var deletePermission = function (endpoint, organizationId, groupId, permissionId) {
|
|
73
|
-
return endpoint.api //
|
|
74
|
-
.delete("/organizations/".concat(organizationId, "/groups/").concat(groupId, "/permissions/").concat(permissionId))
|
|
75
|
-
.then(function (r) { return r.data; });
|
|
76
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
2
|
-
import { IInvitation } from './Types';
|
|
3
|
-
import { IProfile } from '../Users/Types';
|
|
4
|
-
/**
|
|
5
|
-
* An invitation represents an opportunity for a Member to join an Organization.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
export interface ICreateInvitationRequest {
|
|
10
|
-
email: string;
|
|
11
|
-
role_id: string;
|
|
12
|
-
organization_id: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const getInvitations: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IInvitation[]>;
|
|
15
|
-
export declare const createInvitation: (endpoint: VerdocsEndpoint, organizationId: string, params: ICreateInvitationRequest) => Promise<IInvitation>;
|
|
16
|
-
export declare const deleteInvitation: (endpoint: VerdocsEndpoint, organizationId: string, email: string) => Promise<any>;
|
|
17
|
-
export declare const updateInvitation: (endpoint: VerdocsEndpoint, organizationId: string, email: string, params: Partial<ICreateInvitationRequest>) => Promise<IInvitation>;
|
|
18
|
-
export declare const resendInvitation: (endpoint: VerdocsEndpoint, organizationId: string, email: string) => Promise<any>;
|
|
19
|
-
export declare const getInvitation: (endpoint: VerdocsEndpoint, organizationId: string, email: string, token: string) => Promise<IInvitation>;
|
|
20
|
-
export declare const acceptInvitation: (endpoint: VerdocsEndpoint, organizationId: string, email: string, token: string) => Promise<IProfile>;
|
|
21
|
-
export declare const declineInvitation: (endpoint: VerdocsEndpoint, organizationId: string, email: string, token: string) => Promise<{
|
|
22
|
-
status: 'OK';
|
|
23
|
-
}>;
|
|
24
|
-
export declare const claimNewUser: (endpoint: VerdocsEndpoint, organizationId: string, email: string, token: string) => Promise<any>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export var getInvitations = function (endpoint, organizationId) {
|
|
2
|
-
return endpoint.api //
|
|
3
|
-
.get("/organizations/".concat(organizationId, "/invitation"))
|
|
4
|
-
.then(function (r) { return r.data; });
|
|
5
|
-
};
|
|
6
|
-
export var createInvitation = function (endpoint, organizationId, params) {
|
|
7
|
-
return endpoint.api //
|
|
8
|
-
.post("/organizations/".concat(organizationId, "/invitation"), params)
|
|
9
|
-
.then(function (r) { return r.data; });
|
|
10
|
-
};
|
|
11
|
-
export var deleteInvitation = function (endpoint, organizationId, email) {
|
|
12
|
-
return endpoint.api //
|
|
13
|
-
.delete("/organizations/".concat(organizationId, "/invitation/").concat(email))
|
|
14
|
-
.then(function (r) { return r.data; });
|
|
15
|
-
};
|
|
16
|
-
export var updateInvitation = function (endpoint, organizationId, email, params) {
|
|
17
|
-
return endpoint.api //
|
|
18
|
-
.patch("/organizations/".concat(organizationId, "/invitation/").concat(email), params)
|
|
19
|
-
.then(function (r) { return r.data; });
|
|
20
|
-
};
|
|
21
|
-
export var resendInvitation = function (endpoint, organizationId, email) {
|
|
22
|
-
return endpoint.api //
|
|
23
|
-
.post("/organizations/".concat(organizationId, "/invitation/").concat(email, "/resend"))
|
|
24
|
-
.then(function (r) { return r.data; });
|
|
25
|
-
};
|
|
26
|
-
export var getInvitation = function (endpoint, organizationId, email, token) {
|
|
27
|
-
return endpoint.api //
|
|
28
|
-
.get("/organizations/".concat(organizationId, "/invitation/").concat(email, "/accept/").concat(token))
|
|
29
|
-
.then(function (r) { return r.data; });
|
|
30
|
-
};
|
|
31
|
-
export var acceptInvitation = function (endpoint, organizationId, email, token) {
|
|
32
|
-
return endpoint.api //
|
|
33
|
-
.post("/organizations/".concat(organizationId, "/invitation/").concat(email, "/accept/").concat(token))
|
|
34
|
-
.then(function (r) { return r.data; });
|
|
35
|
-
};
|
|
36
|
-
export var declineInvitation = function (endpoint, organizationId, email, token) {
|
|
37
|
-
return endpoint.api //
|
|
38
|
-
.post("/organizations/".concat(organizationId, "/invitation/").concat(email, "/decline/").concat(token))
|
|
39
|
-
.then(function (r) { return r.data; });
|
|
40
|
-
};
|
|
41
|
-
export var claimNewUser = function (endpoint, organizationId, email, token) {
|
|
42
|
-
return endpoint.api //
|
|
43
|
-
.put("/organizations/".concat(organizationId, "/invitation/").concat(email, "/token/").concat(token, "/new_user"))
|
|
44
|
-
.then(function (r) { return r.data; });
|
|
45
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
2
|
-
import { IProfile, IRole } from '../Users/Types';
|
|
3
|
-
/**
|
|
4
|
-
* An Organization Member (aka Profile) is an individual user with access to an organization.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
export declare const getMembers: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IProfile[]>;
|
|
9
|
-
export declare const deleteMember: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string) => Promise<any>;
|
|
10
|
-
export declare const addMemberRole: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string, roleId: string) => Promise<IRole>;
|
|
11
|
-
export declare const deleteMemberRole: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string, roleId: string) => Promise<any>;
|
|
12
|
-
export declare const getMemberPlans: (endpoint: VerdocsEndpoint, organizationId: string, profileId: string) => Promise<any>;
|
package/Organizations/Members.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An Organization Member (aka Profile) is an individual user with access to an organization.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
export var getMembers = function (endpoint, organizationId) {
|
|
7
|
-
return endpoint.api //
|
|
8
|
-
.get("/organizations/".concat(organizationId, "/profiles"))
|
|
9
|
-
.then(function (r) { return r.data; });
|
|
10
|
-
};
|
|
11
|
-
export var deleteMember = function (endpoint, organizationId, profileId) {
|
|
12
|
-
return endpoint.api //
|
|
13
|
-
.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId))
|
|
14
|
-
.then(function (r) { return r.data; });
|
|
15
|
-
};
|
|
16
|
-
export var addMemberRole = function (endpoint, organizationId, profileId, roleId) {
|
|
17
|
-
return endpoint.api //
|
|
18
|
-
.post("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/role/").concat(roleId))
|
|
19
|
-
.then(function (r) { return r.data; });
|
|
20
|
-
};
|
|
21
|
-
export var deleteMemberRole = function (endpoint, organizationId, profileId, roleId) {
|
|
22
|
-
return endpoint.api //
|
|
23
|
-
.delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/role/").concat(roleId))
|
|
24
|
-
.then(function (r) { return r.data; });
|
|
25
|
-
};
|
|
26
|
-
export var getMemberPlans = function (endpoint, organizationId, profileId) {
|
|
27
|
-
return endpoint.api //
|
|
28
|
-
.get("/organizations/".concat(organizationId, "/profiles/").concat(profileId, "/plans"))
|
|
29
|
-
.then(function (r) { return r.data; });
|
|
30
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An Organization is the top level object for ownership for Members, Documents, and Templates.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { IOrganization } from './Types';
|
|
7
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
8
|
-
/**
|
|
9
|
-
* Get a list of organizations the user has access to.
|
|
10
|
-
*/
|
|
11
|
-
export declare const getOrganizations: (endpoint: VerdocsEndpoint) => Promise<IOrganization[]>;
|
|
12
|
-
/**
|
|
13
|
-
* Create an organization.
|
|
14
|
-
*/
|
|
15
|
-
export declare const createOrganization: (endpoint: VerdocsEndpoint) => Promise<IOrganization>;
|
|
16
|
-
/**
|
|
17
|
-
* Delete an organization.
|
|
18
|
-
*/
|
|
19
|
-
export declare const deleteOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<any>;
|
|
20
|
-
/**
|
|
21
|
-
* Get an organization by ID.
|
|
22
|
-
*/
|
|
23
|
-
export declare const getOrganization: (endpoint: VerdocsEndpoint, organizationId: string) => Promise<IOrganization>;
|
|
24
|
-
/**
|
|
25
|
-
* Update an organization.
|
|
26
|
-
*/
|
|
27
|
-
export declare const updateOrganization: (endpoint: VerdocsEndpoint, organizationId: string, params: any) => Promise<IOrganization>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An Organization is the top level object for ownership for Members, Documents, and Templates.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Get a list of organizations the user has access to.
|
|
8
|
-
*/
|
|
9
|
-
export var getOrganizations = function (endpoint) {
|
|
10
|
-
return endpoint.api //
|
|
11
|
-
.get('/organizations')
|
|
12
|
-
.then(function (r) { return r.data; });
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Create an organization.
|
|
16
|
-
*/
|
|
17
|
-
export var createOrganization = function (endpoint) {
|
|
18
|
-
return endpoint.api //
|
|
19
|
-
.post('/organizations')
|
|
20
|
-
.then(function (r) { return r.data; });
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Delete an organization.
|
|
24
|
-
*/
|
|
25
|
-
export var deleteOrganization = function (endpoint, organizationId) {
|
|
26
|
-
return endpoint.api //
|
|
27
|
-
.delete("/organizations/".concat(organizationId))
|
|
28
|
-
.then(function (r) { return r.data; });
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Get an organization by ID.
|
|
32
|
-
*/
|
|
33
|
-
export var getOrganization = function (endpoint, organizationId) {
|
|
34
|
-
return endpoint.api //
|
|
35
|
-
.get("/organizations/".concat(organizationId))
|
|
36
|
-
.then(function (r) { return r.data; });
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Update an organization.
|
|
40
|
-
*/
|
|
41
|
-
export var updateOrganization = function (endpoint, organizationId, params) {
|
|
42
|
-
return endpoint.api //
|
|
43
|
-
.patch("/organizations/".concat(organizationId), params)
|
|
44
|
-
.then(function (r) { return r.data; });
|
|
45
|
-
};
|
package/Organizations/Types.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { IProfile, TPermission, TRole } from '../Users/Types';
|
|
2
|
-
export interface IOrganization {
|
|
3
|
-
/** The unique ID of the organization */
|
|
4
|
-
id: string;
|
|
5
|
-
/** The organization's name. */
|
|
6
|
-
name: string;
|
|
7
|
-
address: string | null;
|
|
8
|
-
address2: string | null;
|
|
9
|
-
phone: string | null;
|
|
10
|
-
/** If true, the organization is a business */
|
|
11
|
-
is_business: boolean;
|
|
12
|
-
/** If the organization is a business, its name. Note that a business name can be different from an organization name. */
|
|
13
|
-
business_name: string | null;
|
|
14
|
-
/** @deprecated. The organization primary contact email address. */
|
|
15
|
-
contact_email: string | null;
|
|
16
|
-
/** @deprecated. The organization's primary time zone. */
|
|
17
|
-
timezone: string | null;
|
|
18
|
-
/**
|
|
19
|
-
* If a Template published by the Organization is configured to be usable to create new Envelopes by users outside that
|
|
20
|
-
* Organization (`sender: 'everyone_as_creator'`), and that action would trigger a billing event, this field controls
|
|
21
|
-
* who is reponsible for that cost. If set to TRUE, the Organization that owns the template will be billed for its use.
|
|
22
|
-
* If set to FALSE, the requestor pays.
|
|
23
|
-
*
|
|
24
|
-
* This is deprecated in favor of a future per-template approach. Please contact support@verdocs.com to discuss your
|
|
25
|
-
* application requirements if you plan to use this functionality for an immediate integration.
|
|
26
|
-
*
|
|
27
|
-
* @deprecated
|
|
28
|
-
*/
|
|
29
|
-
envelope_responsible: boolean;
|
|
30
|
-
/** Web site URL */
|
|
31
|
-
url: string | null;
|
|
32
|
-
/** Creation date/time. */
|
|
33
|
-
created_at: string;
|
|
34
|
-
/** Last-update date/time. */
|
|
35
|
-
updated_at: string;
|
|
36
|
-
}
|
|
37
|
-
export interface ICreateApiKeyRequest {
|
|
38
|
-
name: string;
|
|
39
|
-
profile_id: string;
|
|
40
|
-
}
|
|
41
|
-
export interface IUpdateApiKeyRequest {
|
|
42
|
-
name?: string;
|
|
43
|
-
profile_id?: string;
|
|
44
|
-
}
|
|
45
|
-
export interface IApiKey {
|
|
46
|
-
client_id: string;
|
|
47
|
-
name: string;
|
|
48
|
-
profile_id: string;
|
|
49
|
-
organization_id: string;
|
|
50
|
-
profile?: IProfile;
|
|
51
|
-
}
|
|
52
|
-
export interface IApiKeyWithSecret extends IApiKey {
|
|
53
|
-
client_id: string;
|
|
54
|
-
client_secret: string;
|
|
55
|
-
name: string;
|
|
56
|
-
profile_id: string;
|
|
57
|
-
organization_id: string;
|
|
58
|
-
}
|
|
59
|
-
export interface IGroup {
|
|
60
|
-
id: string;
|
|
61
|
-
name: string;
|
|
62
|
-
organization_id: string;
|
|
63
|
-
/** For future expansion. In the future, Verdocs may support group hierarchies. Until then this field is always null. */
|
|
64
|
-
parent: IGroup | null;
|
|
65
|
-
/** For future expansion. In the future, Verdocs may support group hierarchies. Until then this field is always null. */
|
|
66
|
-
parent_id: string | null;
|
|
67
|
-
/** Some operations will additionally return a list of permissions. */
|
|
68
|
-
permissions?: TPermission[];
|
|
69
|
-
/** Some operations will additionally return a list of roles. */
|
|
70
|
-
roles?: TRole[];
|
|
71
|
-
/** Some operations will additionally return a list of profiles. */
|
|
72
|
-
profiles?: IProfile[];
|
|
73
|
-
}
|
|
74
|
-
export interface IPermissionDetail {
|
|
75
|
-
id: string;
|
|
76
|
-
name: string;
|
|
77
|
-
client_id: string;
|
|
78
|
-
}
|
|
79
|
-
export interface IRoleDetail {
|
|
80
|
-
id: string;
|
|
81
|
-
name: string;
|
|
82
|
-
client_id: string;
|
|
83
|
-
}
|
|
84
|
-
export interface IGroupDetail {
|
|
85
|
-
id: string;
|
|
86
|
-
name: string;
|
|
87
|
-
organization_id: string;
|
|
88
|
-
permissions: IPermissionDetail[];
|
|
89
|
-
roles: IRoleDetail[];
|
|
90
|
-
profiles: IProfile[];
|
|
91
|
-
/** For future expansion. In the future, Verdocs may support group hierarchies. Until then this field is always null. */
|
|
92
|
-
parent: IGroup | null;
|
|
93
|
-
/** For future expansion. In the future, Verdocs may support group hierarchies. Until then this field is always null. */
|
|
94
|
-
parent_id: string | null;
|
|
95
|
-
}
|
|
96
|
-
export interface IInvitation {
|
|
97
|
-
organization_id: string;
|
|
98
|
-
email: string;
|
|
99
|
-
token: string;
|
|
100
|
-
generated_at: string;
|
|
101
|
-
role_id: string;
|
|
102
|
-
status: 'pending';
|
|
103
|
-
organization?: IOrganization;
|
|
104
|
-
}
|
package/Organizations/Types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
2
|
-
export interface ISetWebhookRequest {
|
|
3
|
-
url: string;
|
|
4
|
-
active: boolean;
|
|
5
|
-
events: {
|
|
6
|
-
envelope_created: boolean;
|
|
7
|
-
envelope_completed: boolean;
|
|
8
|
-
envelope_canceled: boolean;
|
|
9
|
-
template_created: boolean;
|
|
10
|
-
template_updated: boolean;
|
|
11
|
-
template_deleted: boolean;
|
|
12
|
-
template_used: boolean;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface IWebhook {
|
|
16
|
-
id: string;
|
|
17
|
-
organization_id: string;
|
|
18
|
-
url: string;
|
|
19
|
-
active: boolean;
|
|
20
|
-
events: {
|
|
21
|
-
envelope_created: boolean;
|
|
22
|
-
envelope_completed: boolean;
|
|
23
|
-
envelope_canceled: boolean;
|
|
24
|
-
template_created: boolean;
|
|
25
|
-
template_updated: boolean;
|
|
26
|
-
template_deleted: boolean;
|
|
27
|
-
template_used: boolean;
|
|
28
|
-
};
|
|
29
|
-
status: string;
|
|
30
|
-
last_success: string;
|
|
31
|
-
last_failure: string;
|
|
32
|
-
}
|
|
33
|
-
export declare const getWebhooks: (endpoint: VerdocsEndpoint) => Promise<IWebhook>;
|
|
34
|
-
export declare const setWebhooks: (endpoint: VerdocsEndpoint, params: ISetWebhookRequest) => Promise<IWebhook>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export var getWebhooks = function (endpoint) {
|
|
2
|
-
return endpoint.api //
|
|
3
|
-
.get("/v2/webhooks/organization")
|
|
4
|
-
.then(function (r) { return r.data; });
|
|
5
|
-
};
|
|
6
|
-
export var setWebhooks = function (endpoint, params) {
|
|
7
|
-
return endpoint.api //
|
|
8
|
-
.post("/v2/webhooks/organization", params)
|
|
9
|
-
.then(function (r) { return r.data; });
|
|
10
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* White-labeling allows applications to store visual-styling configuration data on the Verdocs servers. This data is not used by
|
|
3
|
-
* Verdocs itself, but may be retrieved later by the application to support changing styles in user interfaces.
|
|
4
|
-
*
|
|
5
|
-
* The advantage to this approach is white-label data is stored at an organization-wide level. If you are building just one
|
|
6
|
-
* application, you may not need this feature. But if you are building an application that may have many different "looks"
|
|
7
|
-
* depending on who the user is (what organization the user is in) this endpoint can be very helpful.
|
|
8
|
-
*
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
import { VerdocsEndpoint } from '../VerdocsEndpoint';
|
|
12
|
-
/**
|
|
13
|
-
* Create or update white-label data. The caller's organization ID will be used as the key for the operation.
|
|
14
|
-
*
|
|
15
|
-
* ```typescript
|
|
16
|
-
* import {Whitelabel} from '@verdocs/js-sdk/Organizations';
|
|
17
|
-
*
|
|
18
|
-
* await Whitelabel.setWhitelabel({ logo: '/path/to/logo.png' });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare const setWhitelabel: (endpoint: VerdocsEndpoint) => Promise<any>;
|
|
22
|
-
/**
|
|
23
|
-
* Retrieve white-label data.
|
|
24
|
-
*
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import {Whitelabel} from '@verdocs/js-sdk/Organizations';
|
|
27
|
-
*
|
|
28
|
-
* const {logo} = await Whitelabel.getWhitelabel();
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare const getWhitelabel: (endpoint: VerdocsEndpoint) => Promise<any>;
|