box-node-sdk 2.5.0 → 2.7.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/CHANGELOG.md +16 -0
- package/README.md +5 -4
- package/lib/box-client.d.ts +4 -2
- package/lib/managers/collaborations.d.ts +31 -24
- package/lib/managers/collaborations.js +51 -41
- package/lib/managers/collaborations.js.map +1 -1
- package/lib/managers/files.d.ts +4 -2
- package/lib/managers/files.js +1 -1
- package/lib/managers/files.js.map +1 -1
- package/lib/managers/folders.d.ts +3 -2
- package/lib/managers/folders.js +1 -1
- package/lib/managers/folders.js.map +1 -1
- package/lib/managers/retention-policies.d.ts +37 -0
- package/lib/managers/retention-policies.js +38 -0
- package/lib/managers/retention-policies.js.map +1 -1
- package/lib/managers/sign-requests.generated.d.ts +2 -1
- package/lib/managers/sign-requests.generated.js +2 -1
- package/lib/managers/sign-requests.generated.js.map +1 -1
- package/lib/managers/webhooks.d.ts +5 -2
- package/lib/managers/webhooks.js +8 -0
- package/lib/managers/webhooks.js.map +1 -1
- package/lib/schemas/collaboration-create.d.ts +5 -0
- package/lib/schemas/collaboration-create.js +3 -0
- package/lib/schemas/collaboration-create.js.map +1 -0
- package/lib/schemas/collaboration-update.d.ts +7 -0
- package/lib/schemas/collaboration-update.js +3 -0
- package/lib/schemas/collaboration-update.js.map +1 -0
- package/lib/schemas/collaboration.d.ts +108 -0
- package/lib/schemas/collaboration.js +3 -0
- package/lib/schemas/collaboration.js.map +1 -0
- package/lib/schemas/collaborations.d.ts +13 -0
- package/lib/schemas/collaborations.js +3 -0
- package/lib/schemas/collaborations.js.map +1 -0
- package/lib/schemas/file-mini.generated.d.ts +2 -2
- package/lib/schemas/file-version-base.generated.d.ts +2 -2
- package/lib/schemas/index.d.ts +4 -0
- package/lib/schemas/index.js +4 -0
- package/lib/schemas/index.js.map +1 -1
- package/lib/schemas/sign-request-create-request.generated.d.ts +27 -4
- package/lib/schemas/sign-request-create-signer.generated.d.ts +31 -1
- package/lib/schemas/sign-request-prefill-tag.generated.d.ts +1 -1
- package/lib/schemas/sign-request-signer-input.generated.d.ts +5 -0
- package/lib/schemas/sign-request.generated.d.ts +3 -3
- package/lib/schemas/sign-requests.generated.d.ts +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { UserMini } from "./user-mini";
|
|
2
|
+
export declare type CollaborationRole = "editor" | "viewer" | "previewer" | "uploader" | "previewer uploader" | "viewer uploader" | "co-owner" | "owner";
|
|
3
|
+
export declare type CollaborationStatus = "accepted" | "pending" | "rejected";
|
|
4
|
+
declare type StrongPasswordRequirement = {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the enterprise that owns the content requires a strong password to collaborate on the content.
|
|
7
|
+
*/
|
|
8
|
+
enterprise_has_strong_password_required_for_external_users?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether or not the user has a strong password set for their account. The field is null when a strong password is not required.
|
|
11
|
+
*/
|
|
12
|
+
user_has_strong_password?: boolean | null;
|
|
13
|
+
};
|
|
14
|
+
declare type TermsOfServiceRequirement = {
|
|
15
|
+
/**
|
|
16
|
+
* Whether or not the terms of service have been accepted. The field is null when there is no terms of service required.
|
|
17
|
+
*/
|
|
18
|
+
is_accepted: boolean | null;
|
|
19
|
+
/**
|
|
20
|
+
* The terms of service that must be accepted before the collaboration can be accepted. The field is null when there is no terms of service required.
|
|
21
|
+
*/
|
|
22
|
+
terms_of_service: {
|
|
23
|
+
/**
|
|
24
|
+
* The unique identifier for this terms of service.
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
type: 'terms_of_service';
|
|
28
|
+
} | null;
|
|
29
|
+
};
|
|
30
|
+
declare type TwoFactorAuthenticationRequirement = {
|
|
31
|
+
/**
|
|
32
|
+
* Whether or not the enterprise that owns the content requires two-factor authentication to be enabled in order to collaborate on the content.
|
|
33
|
+
*/
|
|
34
|
+
enterprise_has_two_factor_auth_enabled: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether or not the user has two-factor authentication enabled. The field is null when two-factor authentication is not required.
|
|
37
|
+
*/
|
|
38
|
+
user_has_two_factor_authentication_enabled: boolean | null;
|
|
39
|
+
};
|
|
40
|
+
declare type AcceptanceRequirementsStatus = {
|
|
41
|
+
strong_password_requirement?: StrongPasswordRequirement;
|
|
42
|
+
terms_of_service_requirement?: TermsOfServiceRequirement;
|
|
43
|
+
two_factor_authentication_requirement?: TwoFactorAuthenticationRequirement;
|
|
44
|
+
};
|
|
45
|
+
export interface Collaboration {
|
|
46
|
+
/**
|
|
47
|
+
* The unique identifier for this collaboration.
|
|
48
|
+
*/
|
|
49
|
+
id: string;
|
|
50
|
+
/**
|
|
51
|
+
* Value is always collaboration
|
|
52
|
+
*/
|
|
53
|
+
type: 'collaboration';
|
|
54
|
+
/**
|
|
55
|
+
* Describes acceptance criteria for password, terms of service and two-factor authentication
|
|
56
|
+
*/
|
|
57
|
+
acceptance_requirements_status?: AcceptanceRequirementsStatus;
|
|
58
|
+
/**
|
|
59
|
+
* The user or group that is granted access
|
|
60
|
+
*/
|
|
61
|
+
accessible_by?: UserMini;
|
|
62
|
+
/**
|
|
63
|
+
* When the status of the collaboration object changed to accepted or rejected
|
|
64
|
+
*/
|
|
65
|
+
acknowledged_at?: string;
|
|
66
|
+
/**
|
|
67
|
+
* When the collaboration object was created
|
|
68
|
+
*/
|
|
69
|
+
created_at?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The user who created the collaboration object
|
|
72
|
+
*/
|
|
73
|
+
created_by?: UserMini;
|
|
74
|
+
/**
|
|
75
|
+
* When the collaboration will expire, or null if no expiration date is set.
|
|
76
|
+
*/
|
|
77
|
+
expires_at?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The email address used to invite an unregistered collaborator, if they are not a registered user.
|
|
80
|
+
*/
|
|
81
|
+
invite_email?: string;
|
|
82
|
+
/**
|
|
83
|
+
* The file or folder to which access is granted. The field is null when the collaboration status is pending.
|
|
84
|
+
*/
|
|
85
|
+
item?: any;
|
|
86
|
+
/**
|
|
87
|
+
* When the collaboration object was last modified
|
|
88
|
+
*/
|
|
89
|
+
modified_at?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The level of access granted.
|
|
92
|
+
*/
|
|
93
|
+
role?: CollaborationRole;
|
|
94
|
+
/**
|
|
95
|
+
* The status of the collaboration invitation.
|
|
96
|
+
*/
|
|
97
|
+
status?: CollaborationStatus;
|
|
98
|
+
/**
|
|
99
|
+
* WARN: Feature not yet available.
|
|
100
|
+
* Do not display collaborated items on collaborator's All Files Pages and suppress notifications
|
|
101
|
+
* sent to collaborators regarding access-only content.
|
|
102
|
+
* This feature is going to be released in Q4. Watch our [announcements](https://developer.box.com/changelog/)
|
|
103
|
+
* to learn about its availability.
|
|
104
|
+
*/
|
|
105
|
+
is_access_only?: boolean;
|
|
106
|
+
[key: string]: any;
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collaboration.js","sourceRoot":"","sources":["../../src/schemas/collaboration.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Collaboration } from "./collaboration";
|
|
2
|
+
declare type CollaborationsOrder = {
|
|
3
|
+
by: string;
|
|
4
|
+
direction: 'ASC' | 'DESC';
|
|
5
|
+
};
|
|
6
|
+
export interface Collaborations {
|
|
7
|
+
entries: Collaboration[];
|
|
8
|
+
limit: number;
|
|
9
|
+
offset: number;
|
|
10
|
+
order: CollaborationsOrder;
|
|
11
|
+
total_count: number;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collaborations.js","sourceRoot":"","sources":["../../src/schemas/collaborations.ts"],"names":[],"mappings":""}
|
|
@@ -22,7 +22,7 @@ export interface FileMini extends schemas.FileBase {
|
|
|
22
22
|
* fetched resource.
|
|
23
23
|
* Example: 3
|
|
24
24
|
*/
|
|
25
|
-
sequence_id
|
|
25
|
+
sequence_id: string;
|
|
26
26
|
/**
|
|
27
27
|
* The name of the file
|
|
28
28
|
* Example: Contract.pdf
|
|
@@ -33,7 +33,7 @@ export interface FileMini extends schemas.FileBase {
|
|
|
33
33
|
* of a file on Box with a local file.
|
|
34
34
|
* Example: 85136C79CBF9FE36BB9D05D0639C70C265C18D37
|
|
35
35
|
*/
|
|
36
|
-
sha1
|
|
36
|
+
sha1: string;
|
|
37
37
|
/**
|
|
38
38
|
* The information about the current version of the file.
|
|
39
39
|
*/
|
|
@@ -10,10 +10,10 @@ export interface FileVersionBase {
|
|
|
10
10
|
* The unique identifier that represent a file version.
|
|
11
11
|
* Example: 12345
|
|
12
12
|
*/
|
|
13
|
-
id
|
|
13
|
+
id: string;
|
|
14
14
|
/**
|
|
15
15
|
* `file_version`
|
|
16
16
|
* Example: file_version
|
|
17
17
|
*/
|
|
18
|
-
type
|
|
18
|
+
type: 'file_version';
|
|
19
19
|
}
|
package/lib/schemas/index.d.ts
CHANGED
|
@@ -13,3 +13,7 @@ export * from './sign-request.generated';
|
|
|
13
13
|
export * from './sign-requests.generated';
|
|
14
14
|
export * from './file-request';
|
|
15
15
|
export * from './user-mini';
|
|
16
|
+
export * from './collaboration';
|
|
17
|
+
export * from './collaborations';
|
|
18
|
+
export * from './collaboration-create';
|
|
19
|
+
export * from './collaboration-update';
|
package/lib/schemas/index.js
CHANGED
|
@@ -25,4 +25,8 @@ __exportStar(require("./sign-request.generated"), exports);
|
|
|
25
25
|
__exportStar(require("./sign-requests.generated"), exports);
|
|
26
26
|
__exportStar(require("./file-request"), exports);
|
|
27
27
|
__exportStar(require("./user-mini"), exports);
|
|
28
|
+
__exportStar(require("./collaboration"), exports);
|
|
29
|
+
__exportStar(require("./collaborations"), exports);
|
|
30
|
+
__exportStar(require("./collaboration-create"), exports);
|
|
31
|
+
__exportStar(require("./collaboration-update"), exports);
|
|
28
32
|
//# sourceMappingURL=index.js.map
|
package/lib/schemas/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,gEAA8C;AAC9C,gEAA8C;AAC9C,0DAAwC;AACxC,0DAAwC;AACxC,0EAAwD;AACxD,yEAAuD;AACvD,uEAAqD;AACrD,wEAAsD;AACtD,kEAAgD;AAChD,2DAAyC;AACzC,4DAA0C;AAC1C,iDAA+B;AAC/B,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAsC;AACtC,wDAAsC;AACtC,gEAA8C;AAC9C,gEAA8C;AAC9C,0DAAwC;AACxC,0DAAwC;AACxC,0EAAwD;AACxD,yEAAuD;AACvD,uEAAqD;AACrD,wEAAsD;AACtD,kEAAgD;AAChD,2DAAyC;AACzC,4DAA0C;AAC1C,iDAA+B;AAC/B,8CAA4B;AAC5B,kDAAgC;AAChC,mDAAiC;AACjC,yDAAuC;AACvC,yDAAuC"}
|
|
@@ -6,12 +6,30 @@ import * as schemas from '.';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface SignRequestCreateRequest {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* If set, the sender receives a `prepare_url` in the response for completed document preparation via UI.
|
|
10
10
|
* Example: true
|
|
11
11
|
*/
|
|
12
12
|
is_document_preparation_needed?: boolean;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* The URL that a signer will be redirected to
|
|
15
|
+
* after signing a document. Defining this URL
|
|
16
|
+
* overrides the default redirect URL for all
|
|
17
|
+
* signers.
|
|
18
|
+
* If no declined redirect URL is specified,
|
|
19
|
+
* this URL will be used for decline actions as well.
|
|
20
|
+
* Example: https://example.com
|
|
21
|
+
*/
|
|
22
|
+
redirect_url?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The URL that a signer will be redirected to
|
|
25
|
+
* after declining to sign a document.
|
|
26
|
+
* Defining this URL overrides the default
|
|
27
|
+
* redirect URL for all signers.
|
|
28
|
+
* Example: https://declined-example.com
|
|
29
|
+
*/
|
|
30
|
+
declined_redirect_url?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Disables the usage of signatures generated by typing (text).
|
|
15
33
|
* Example: true
|
|
16
34
|
* @default true
|
|
17
35
|
*/
|
|
@@ -27,7 +45,7 @@ export interface SignRequestCreateRequest {
|
|
|
27
45
|
*/
|
|
28
46
|
email_message?: string;
|
|
29
47
|
/**
|
|
30
|
-
*
|
|
48
|
+
* If set, signers receive reminders to sign a document on day 3, 8, 13 and 18. Reminders are only sent to any outstanding signers.
|
|
31
49
|
* Example: true
|
|
32
50
|
*/
|
|
33
51
|
are_reminders_enabled?: boolean;
|
|
@@ -36,7 +54,7 @@ export interface SignRequestCreateRequest {
|
|
|
36
54
|
*/
|
|
37
55
|
signers: schemas.SignRequestCreateSigner[];
|
|
38
56
|
/**
|
|
39
|
-
* List of files to create a signing document from. This is currently limited to one file. Only the ID and type fields are required for each file.
|
|
57
|
+
* List of files to create a signing document from. This is currently limited to one file. Only the ID and type fields are required for each file. The array will be empty if the `source_files` are deleted.
|
|
40
58
|
*/
|
|
41
59
|
source_files: schemas.FileMini[];
|
|
42
60
|
/**
|
|
@@ -59,4 +77,9 @@ export interface SignRequestCreateRequest {
|
|
|
59
77
|
* Example: 123
|
|
60
78
|
*/
|
|
61
79
|
external_id?: string;
|
|
80
|
+
/**
|
|
81
|
+
* If set, signers must complete a two factor authentication text message prior to viewing the document. A `verification_phone_number` must be specified for a signer for this setting to apply.
|
|
82
|
+
* Example: true
|
|
83
|
+
*/
|
|
84
|
+
is_phone_verification_required_to_view?: boolean;
|
|
62
85
|
}
|
|
@@ -20,7 +20,7 @@ export interface SignRequestCreateSigner {
|
|
|
20
20
|
role?: 'signer' | 'approver' | 'final_copy_reader';
|
|
21
21
|
/**
|
|
22
22
|
* Used in combination with an embed URL for a sender. After the
|
|
23
|
-
* sender signs, they
|
|
23
|
+
* sender signs, they are redirected to the next `in_person` signer.
|
|
24
24
|
* Example: true
|
|
25
25
|
*/
|
|
26
26
|
is_in_person?: boolean;
|
|
@@ -35,4 +35,34 @@ export interface SignRequestCreateSigner {
|
|
|
35
35
|
* Example: 1234
|
|
36
36
|
*/
|
|
37
37
|
embed_url_external_user_id?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The URL that a signer will be redirected
|
|
40
|
+
* to after signing a document. Defining this URL
|
|
41
|
+
* overrides default or global redirect URL
|
|
42
|
+
* settings for a specific signer.
|
|
43
|
+
* If no declined redirect URL is specified,
|
|
44
|
+
* this URL will be used for decline actions as well.
|
|
45
|
+
* Example: https://example.com
|
|
46
|
+
*/
|
|
47
|
+
redirect_url?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The URL that a signer will be redirect
|
|
50
|
+
* to after declining to sign a document.
|
|
51
|
+
* Defining this URL overrides default or global
|
|
52
|
+
* declined redirect URL settings for a specific signer.
|
|
53
|
+
* Example: https://declined-example.com
|
|
54
|
+
*/
|
|
55
|
+
declined_redirect_url?: string;
|
|
56
|
+
/**
|
|
57
|
+
* If set, this phone number is be used to verify the signer
|
|
58
|
+
* via two factor authentication before they are able to sign the document.
|
|
59
|
+
* Example: 6314578901
|
|
60
|
+
*/
|
|
61
|
+
verification_phone_number?: string;
|
|
62
|
+
/**
|
|
63
|
+
* If set, the signer is required to enter the password before they are able
|
|
64
|
+
* to sign a document. This field is write only.
|
|
65
|
+
* Example: SecretPassword123
|
|
66
|
+
*/
|
|
67
|
+
password?: string;
|
|
38
68
|
}
|
|
@@ -10,6 +10,11 @@ export interface SignRequestSignerInput extends schemas.SignRequestPrefillTag {
|
|
|
10
10
|
* Example: text
|
|
11
11
|
*/
|
|
12
12
|
type?: 'signature' | 'date' | 'text' | 'checkbox';
|
|
13
|
+
/**
|
|
14
|
+
* Content type of input
|
|
15
|
+
* Example: signature
|
|
16
|
+
*/
|
|
17
|
+
content_type?: 'initial' | 'stamp' | 'signature' | 'company' | 'title' | 'email' | 'full_name' | 'first_name' | 'last_name' | 'text' | 'date' | 'checkbox';
|
|
13
18
|
/**
|
|
14
19
|
* Index of page that the input is on
|
|
15
20
|
* Example: 4
|
|
@@ -18,7 +18,7 @@ export interface SignRequest extends schemas.SignRequestCreateRequest {
|
|
|
18
18
|
* Sign request ID
|
|
19
19
|
* Example: 12345
|
|
20
20
|
*/
|
|
21
|
-
id
|
|
21
|
+
id?: string;
|
|
22
22
|
/**
|
|
23
23
|
* This URL is returned if `is_document_preparation_needed` is
|
|
24
24
|
* set to `true` in the request. It is used to prepare the sign request
|
|
@@ -28,14 +28,14 @@ export interface SignRequest extends schemas.SignRequestCreateRequest {
|
|
|
28
28
|
prepare_url?: string;
|
|
29
29
|
/**
|
|
30
30
|
* Reference to a file that holds a log of all signer activity for
|
|
31
|
-
* the request
|
|
31
|
+
* the request. `Null` if the signing log is deleted.
|
|
32
32
|
*/
|
|
33
33
|
signing_log?: schemas.FileMini;
|
|
34
34
|
/**
|
|
35
35
|
* Describes the status of the sign request
|
|
36
36
|
* Example: converting
|
|
37
37
|
*/
|
|
38
|
-
status?: 'converting' | 'created' | 'sent' | 'viewed' | 'signed' | 'cancelled' | 'declined' | 'error_converting' | 'error_sending' | 'expired';
|
|
38
|
+
status?: 'converting' | 'created' | 'sent' | 'viewed' | 'signed' | 'cancelled' | 'declined' | 'error_converting' | 'error_sending' | 'expired' | 'downloaded' | 'signed and downloaded';
|
|
39
39
|
/**
|
|
40
40
|
* List of files that will be signed, which are copies of the original
|
|
41
41
|
* source files. A new version of these files are created as signers sign
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "box-node-sdk",
|
|
3
3
|
"author": "Box <oss@box.com>",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.7.0",
|
|
5
5
|
"description": "Official SDK for Box Plaform APIs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"main": "./lib/box-node-sdk.js",
|
|
24
24
|
"scripts": {
|
|
25
25
|
"test": "node Makefile.js",
|
|
26
|
-
"jest": "jest",
|
|
26
|
+
"jest": "npm run build && jest",
|
|
27
27
|
"build": "node Makefile.js build",
|
|
28
28
|
"codegen": "ts-node codegen/codegen.tsx",
|
|
29
29
|
"lint": "node Makefile.js lint",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"uuid": "^3.3.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/jest": "^
|
|
51
|
+
"@types/jest": "^28.1.6",
|
|
52
52
|
"@types/jsonwebtoken": "^8.5.1",
|
|
53
53
|
"@types/lodash": "^4.14.172",
|
|
54
54
|
"@types/prettier": "^2.3.2",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"chai": "^4.2.0",
|
|
62
62
|
"doctoc": "^2.0.1",
|
|
63
63
|
"eslint": "^4.19.1",
|
|
64
|
+
"eslint-plugin-jest": "^23.20.0",
|
|
64
65
|
"eslint-plugin-node": "^6.0.1",
|
|
65
66
|
"eslint-plugin-promise": "^3.8.0",
|
|
66
67
|
"eslint-plugin-unicorn": "^4.0.3",
|