@verdocs/js-sdk 3.9.0 → 3.9.1
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/Envelopes/Permissions.d.ts +10 -10
- package/Envelopes/Permissions.js +6 -3
- package/package.json +1 -1
|
@@ -3,32 +3,32 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { IEnvelope, IRecipient } from './Types';
|
|
6
|
+
import { IEnvelope, IEnvelopeSummary, IRecipient } from './Types';
|
|
7
7
|
import { TSession } from '../Sessions/Types';
|
|
8
8
|
/**
|
|
9
9
|
* Check to see if the user owns the envelope.
|
|
10
10
|
*/
|
|
11
|
-
export declare const userIsEnvelopeOwner: (session: TSession, envelope: IEnvelope) => boolean;
|
|
11
|
+
export declare const userIsEnvelopeOwner: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
|
|
12
12
|
/**
|
|
13
13
|
* Check to see if the user owns the envelope.
|
|
14
14
|
*/
|
|
15
|
-
export declare const userIsEnvelopeRecipient: (session: TSession, envelope: IEnvelope) => boolean;
|
|
15
|
+
export declare const userIsEnvelopeRecipient: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
|
|
16
16
|
/**
|
|
17
17
|
* Check to see if the envelope has pending actions.
|
|
18
18
|
*/
|
|
19
|
-
export declare const envelopeIsActive: (envelope: IEnvelope) => boolean;
|
|
19
|
+
export declare const envelopeIsActive: (envelope: IEnvelope | IEnvelopeSummary) => boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Check to see if the envelope has been completed.
|
|
22
22
|
*/
|
|
23
|
-
export declare const envelopeIsComplete: (envelope: IEnvelope) => boolean;
|
|
23
|
+
export declare const envelopeIsComplete: (envelope: IEnvelope | IEnvelopeSummary) => boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Check to see if the user owns the envelope.
|
|
26
26
|
*/
|
|
27
|
-
export declare const userCanCancelEnvelope: (session: TSession, envelope: IEnvelope) => boolean;
|
|
27
|
+
export declare const userCanCancelEnvelope: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Check to see if the user owns the envelope.
|
|
30
30
|
*/
|
|
31
|
-
export declare const userCanFinishEnvelope: (session: TSession, envelope: IEnvelope) => boolean;
|
|
31
|
+
export declare const userCanFinishEnvelope: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean;
|
|
32
32
|
/**
|
|
33
33
|
* Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).
|
|
34
34
|
*/
|
|
@@ -36,7 +36,7 @@ export declare const recipientHasAction: (recipient: IRecipient) => boolean;
|
|
|
36
36
|
/**
|
|
37
37
|
* Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).
|
|
38
38
|
*/
|
|
39
|
-
export declare const getRecipientsWithActions: (envelope: IEnvelope) => IRecipient[];
|
|
39
|
+
export declare const getRecipientsWithActions: (envelope: IEnvelope | IEnvelopeSummary) => IRecipient[];
|
|
40
40
|
/**
|
|
41
41
|
* Returns true if the recipient can act.
|
|
42
42
|
*/
|
|
@@ -48,5 +48,5 @@ export declare const userCanAct: (email: string, recipientsWithActions: IRecipie
|
|
|
48
48
|
/**
|
|
49
49
|
* Returns true if the user can act.
|
|
50
50
|
*/
|
|
51
|
-
export declare const userCanSignNow: (session: TSession, envelope: IEnvelope) => boolean | undefined;
|
|
52
|
-
export declare const getNextRecipient: (envelope: IEnvelope) => IRecipient;
|
|
51
|
+
export declare const userCanSignNow: (session: TSession, envelope: IEnvelope | IEnvelopeSummary) => boolean | undefined;
|
|
52
|
+
export declare const getNextRecipient: (envelope: IEnvelope | IEnvelopeSummary) => IRecipient;
|
package/Envelopes/Permissions.js
CHANGED
|
@@ -7,11 +7,15 @@ import { EnvelopeStates } from './Types';
|
|
|
7
7
|
/**
|
|
8
8
|
* Check to see if the user owns the envelope.
|
|
9
9
|
*/
|
|
10
|
-
export var userIsEnvelopeOwner = function (session, envelope) {
|
|
10
|
+
export var userIsEnvelopeOwner = function (session, envelope) {
|
|
11
|
+
return envelope.profile_id === (session === null || session === void 0 ? void 0 : session.profile_id);
|
|
12
|
+
};
|
|
11
13
|
/**
|
|
12
14
|
* Check to see if the user owns the envelope.
|
|
13
15
|
*/
|
|
14
|
-
export var userIsEnvelopeRecipient = function (session, envelope) {
|
|
16
|
+
export var userIsEnvelopeRecipient = function (session, envelope) {
|
|
17
|
+
return envelope.profile_id === (session === null || session === void 0 ? void 0 : session.profile_id);
|
|
18
|
+
};
|
|
15
19
|
/**
|
|
16
20
|
* Check to see if the envelope has pending actions.
|
|
17
21
|
*/
|
|
@@ -31,7 +35,6 @@ export var userCanCancelEnvelope = function (session, envelope) {
|
|
|
31
35
|
envelope.status !== EnvelopeStates.DECLINED &&
|
|
32
36
|
envelope.status !== EnvelopeStates.CANCELED;
|
|
33
37
|
};
|
|
34
|
-
// export type TEnvelopeStatus = 'complete' | 'pending' | 'in progress' | 'declined' | 'canceled';
|
|
35
38
|
/**
|
|
36
39
|
* Check to see if the user owns the envelope.
|
|
37
40
|
*/
|