@pageproof/sdk-pr 239.0.1606183932903 → 240.0.1591236439167
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 +1 -184
- package/README.md +0 -13
- package/lib/adapters/AngularEnhancementAdapter.d.ts +0 -2
- package/lib/adapters/IEnhancementAdapter.d.ts +30 -129
- package/lib/adapters/IEnhancementAdapter.js +1 -1
- package/lib/angular-enhancement-adapter.js +1 -1
- package/lib/api/Comments.d.ts +8 -42
- package/lib/api/Comments.js +1 -1
- package/lib/api/Files.d.ts +0 -20
- package/lib/api/Files.js +1 -1
- package/lib/api/GroupsWorkflows.d.ts +0 -15
- package/lib/api/GroupsWorkflows.js +1 -1
- package/lib/api/Preferences.d.ts +1 -2
- package/lib/api/Profile.d.ts +0 -8
- package/lib/api/Profile.js +1 -1
- package/lib/api/Proofs.d.ts +1 -80
- package/lib/api/Proofs.js +1 -1
- package/lib/api/ProofsAssetsExtractedText.js +1 -1
- package/lib/api/ProofsCustomTools.d.ts +5 -6
- package/lib/api/ProofsGroups.d.ts +2 -4
- package/lib/api/ProofsGroups.js +1 -1
- package/lib/api/Reminders.d.ts +0 -8
- package/lib/api/Reminders.js +1 -1
- package/lib/api/Workflows.d.ts +9 -82
- package/lib/api/Workflows.js +1 -1
- package/lib/api/admin/Team.d.ts +0 -29
- package/lib/api/admin/Team.js +4 -53
- package/lib/api/admin/TeamFeatures.d.ts +0 -7
- package/lib/api/admin/TeamFeatures.js +0 -5
- package/lib/api/admin/TeamUsers.d.ts +0 -20
- package/lib/api/admin/TeamUsers.js +0 -27
- package/lib/enum/CommentState.d.ts +2 -1
- package/lib/enum/CommentState.js +1 -1
- package/lib/enum/FileStatus.d.ts +0 -1
- package/lib/enum/FileStatus.js +1 -1
- package/lib/enum/ImportProvider.d.ts +0 -1
- package/lib/enum/ImportProvider.js +1 -1
- package/lib/enum/Preference.d.ts +0 -1
- package/lib/enum/Preference.js +1 -1
- package/lib/enum/PrintingCommentsType.d.ts +6 -0
- package/lib/enum/PrintingCommentsType.js +1 -0
- package/lib/models/File.js +1 -1
- package/lib/models/Proof.d.ts +0 -44
- package/lib/models/Proof.js +1 -1
- package/lib/models/ProofGroup.d.ts +1 -23
- package/lib/models/ProofGroup.js +1 -1
- package/lib/models/TeamEmailFeatures.d.ts +1 -8
- package/lib/models/TeamEmailFeatures.js +1 -1
- package/lib/models/TeamFeatures.d.ts +0 -8
- package/lib/models/TeamFeatures.js +1 -1
- package/lib/models/User.d.ts +0 -7
- package/lib/models/User.js +1 -1
- package/lib/models/Workflow.d.ts +0 -21
- package/lib/models/Workflow.js +1 -1
- package/lib/network/Request.js +1 -1
- package/lib/network/endpoints.json +13 -166
- package/lib/pageproof.js +1 -1
- package/lib/types/PrintingJobOptions.d.ts +2 -6
- package/lib/types/PrintingOption.d.ts +6 -6
- package/lib/util/comments/getCommentState.js +1 -1
- package/package.json +2 -3
- package/lib/api/Integrations.d.ts +0 -67
- package/lib/api/Integrations.js +0 -1
- package/lib/api/ProofsIntegrationReferences.d.ts +0 -42
- package/lib/api/ProofsIntegrationReferences.js +0 -1
- package/lib/api/ProofsLinkCheck.d.ts +0 -33
- package/lib/api/ProofsLinkCheck.js +0 -1
- package/lib/api/admin/TeamCustomTools.d.ts +0 -22
- package/lib/api/admin/TeamCustomTools.js +0 -63
- package/lib/api/admin/TeamNotifications.d.ts +0 -31
- package/lib/api/admin/TeamNotifications.js +0 -79
- package/lib/api/admin/TeamPreferences.d.ts +0 -10
- package/lib/api/admin/TeamPreferences.js +0 -47
- package/lib/api/admin/TeamWorkflows.d.ts +0 -19
- package/lib/api/admin/TeamWorkflows.js +0 -63
- package/lib/enum/PrintingContentType.d.ts +0 -7
- package/lib/enum/PrintingContentType.js +0 -1
- package/lib/models/DecisionSummary.d.ts +0 -24
- package/lib/models/DecisionSummary.js +0 -1
- package/lib/models/ProofIntegrationReference.d.ts +0 -33
- package/lib/models/ProofIntegrationReference.js +0 -1
- package/lib/models/TeamAccountFeatures.d.ts +0 -26
- package/lib/models/TeamAccountFeatures.js +0 -1
- package/lib/models/TeamNotifications.d.ts +0 -19
- package/lib/models/TeamNotifications.js +0 -1
- package/lib/types/GeneratedEmailDefinition.d.ts +0 -9
- package/lib/types/GeneratedEmailDefinition.js +0 -1
- package/lib/types/GeneratedEmailOptions.d.ts +0 -6
- package/lib/types/GeneratedEmailOptions.js +0 -1
- package/lib/types/GenericUserDefinition.d.ts +0 -13
- package/lib/types/GenericUserDefinition.js +0 -1
- package/lib/types/LinkCheckLinkResult.d.ts +0 -22
- package/lib/types/LinkCheckLinkResult.js +0 -1
- package/lib/types/LinkCheckPageResult.d.ts +0 -18
- package/lib/types/LinkCheckPageResult.js +0 -1
- package/lib/types/LinkCheckPageSummary.d.ts +0 -18
- package/lib/types/LinkCheckPageSummary.js +0 -1
- package/lib/types/LinkCheckResults.d.ts +0 -15
- package/lib/types/LinkCheckResults.js +0 -1
- package/lib/types/PrintingCounts.d.ts +0 -10
- package/lib/types/PrintingCounts.js +0 -1
- package/lib/types/ProofForUpdateDefinition.d.ts +0 -13
- package/lib/types/ProofForUpdateDefinition.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,188 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2.0.0-beta.149
|
|
4
|
-
|
|
5
|
-
Released on the 24th of November 2020.
|
|
6
|
-
|
|
7
|
-
- [[#239](https://github.com/PageProofCom/sdk/pull/239)] Adds support for a `onFileDetails` callback option when uploading files. See [Files.upload](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Files.js~Files.html#instance-method-upload).
|
|
8
|
-
|
|
9
|
-
## 2.0.0-beta.148
|
|
10
|
-
|
|
11
|
-
Released on the 24th of November 2020.
|
|
12
|
-
|
|
13
|
-
- [[#289](https://github.com/PageProofCom/sdk/pull/289)] Adds support for default reminder user preferences. See [Preferences](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Preferences.js~Preferences.html).
|
|
14
|
-
- Adds support for updating the configuration of integrations.
|
|
15
|
-
|
|
16
|
-
## 2.0.0-beta.147
|
|
17
|
-
|
|
18
|
-
Released on the 23rd of November 2020.
|
|
19
|
-
|
|
20
|
-
- Allowed including parameters when retrieving options for proof integration references.
|
|
21
|
-
|
|
22
|
-
## 2.0.0-beta.146
|
|
23
|
-
|
|
24
|
-
Released on the 20th of November 2020.
|
|
25
|
-
|
|
26
|
-
- Improved support for the enhancement adapter interface.
|
|
27
|
-
|
|
28
|
-
## 2.0.0-beta.145
|
|
29
|
-
|
|
30
|
-
Released on the 2nd of November 2020.
|
|
31
|
-
|
|
32
|
-
- [[#279](https://github.com/PageProofCom/sdk/pull/279)] Added Support for sharing a workflow template with team. See [Workflows.create](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Workflows.js~Workflows.html#instance-method-create) and [Workflows.update](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Workflows.js~Workflows.html#instance-method-update).
|
|
33
|
-
- Added support for team admin to get team owned workflow templates [TeamWorkflows.owned](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/admin/TeamWorkflows.js~TeamWorkflows.html#instance-method-owned).
|
|
34
|
-
|
|
35
|
-
## 2.0.0-beta.144
|
|
36
|
-
|
|
37
|
-
Released on the 30th of October 2020.
|
|
38
|
-
|
|
39
|
-
- Support for integration references.
|
|
40
|
-
|
|
41
|
-
## 2.0.0-beta.143
|
|
42
|
-
|
|
43
|
-
Released on the 27th of October 2020.
|
|
44
|
-
|
|
45
|
-
- [[#283](https://github.com/PageProofCom/sdk/pull/283)]
|
|
46
|
-
- Support for updating whether using the team name should be used, instead of "PageProof Team" as the from name in emails. See [TeamEmailFeatures](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/TeamEmailFeatures.js~TeamEmailFeatures.html).
|
|
47
|
-
- Support for team account information in team admin API. see [TeamAccountFeatures](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/TeamAccountFeatures.js~TeamAccountFeatures.html).
|
|
48
|
-
|
|
49
|
-
## 2.0.0-beta.142
|
|
50
|
-
|
|
51
|
-
Released on the 22nd of October 2020.
|
|
52
|
-
|
|
53
|
-
- Support for team-level custom tools.
|
|
54
|
-
|
|
55
|
-
## 2.0.0-beta.141
|
|
56
|
-
|
|
57
|
-
Released on the 19th of October 2020.
|
|
58
|
-
|
|
59
|
-
- [[#270](https://github.com/PageProofCom/sdk/pull/270)] Support for retrieving configurations for services integrated with PageProof.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## 2.0.0-beta.140
|
|
63
|
-
|
|
64
|
-
Released on the 9th of October 2020.
|
|
65
|
-
|
|
66
|
-
- Minor bug fixes related to extracted text.
|
|
67
|
-
|
|
68
|
-
## 2.0.0-beta.139
|
|
69
|
-
|
|
70
|
-
Released on the 30th of September 2020.
|
|
71
|
-
|
|
72
|
-
- [[#251](https://github.com/PageProofCom/sdk/pull/251)] Support for fetching results of link checking on email proofs and re-checking links. See [Proofs.linkCheck](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsLinkCheck.js~ProofsLinkCheck.html).
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
## 2.0.0-beta.138
|
|
76
|
-
|
|
77
|
-
Released on the 18th of September 2020.
|
|
78
|
-
|
|
79
|
-
- [[#274](https://github.com/PageProofCom/sdk/pull/274)] Support for sharing a group with team. See [ProofGroup.isOwnedByTeam](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/ProofGroup.js~ProofGroup.html#instance-member-isOwnedByTeam) [ProofsGroups.create](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsGroups.js~ProofsGroups.html#instance-method-create) [ProofsGroups.update](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/ProofsGroups.js~ProofsGroups.html#instance-method-update)
|
|
80
|
-
|
|
81
|
-
## 2.0.0-beta.137
|
|
82
|
-
|
|
83
|
-
Released on the 10th of September 2020.
|
|
84
|
-
|
|
85
|
-
- [[#257](https://github.com/PageProofCom/sdk/pull/257)] Support for replacing approver on a workflow or workflows. See [Workflows.replaceApprover](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Workflows.js~Workflows.html#instance-method-replaceApprover). Support for replacing approver on all owned proofs of a group. See [GroupsWorkflows.replaceApprover](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/GroupsWorkflows.js~GroupsWorkflows.html#instance-method-replaceApprover).
|
|
86
|
-
|
|
87
|
-
## 2.0.0-beta.136
|
|
88
|
-
|
|
89
|
-
Released on the 9th of September 2020.
|
|
90
|
-
|
|
91
|
-
- [[#263](https://github.com/PageProofCom/sdk/pull/263)] Support for loading the next logical proof the user should review after pressing their green button. See [Proofs.next](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Proofs.html#instance-method-next)
|
|
92
|
-
|
|
93
|
-
## 2.0.0-beta.135
|
|
94
|
-
|
|
95
|
-
Released on the 8th of September 2020.
|
|
96
|
-
|
|
97
|
-
- Support for creating an email file without needing a proof.
|
|
98
|
-
- Speed up & proof creation.
|
|
99
|
-
- Added support for providing a workflow template, previous proof, owners and whether the proof can be downloaded, when creating a proof.
|
|
100
|
-
- Support for updating proofs.
|
|
101
|
-
- Support for setting/replacing a proofs reminders.
|
|
102
|
-
- Added the ability to create a workflow template with proof owners.
|
|
103
|
-
- Support for setting the start step when creating a workflow.
|
|
104
|
-
- Added the option to duplicate a workflow template, without copying the proof owner permissions.
|
|
105
|
-
- Added `sourceMetadata` (used to store metadata for email proofs) to the `File` model.
|
|
106
|
-
- Added `fileSize`, `recipientEmail`, and `owners` to the `Proof` model.
|
|
107
|
-
|
|
108
|
-
## 2.0.0-beta.134
|
|
109
|
-
|
|
110
|
-
Released on the 31st of August 2020.
|
|
111
|
-
|
|
112
|
-
- Support for monday.com.
|
|
113
|
-
|
|
114
|
-
## 2.0.0-beta.133
|
|
115
|
-
|
|
116
|
-
Released on the 18th of August 2020.
|
|
117
|
-
|
|
118
|
-
- Added support for team email notification settings. See [TeamNotifications](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/admin/TeamNotifications.js~TeamNotifications.html)
|
|
119
|
-
|
|
120
|
-
## 2.0.0-beta.132
|
|
121
|
-
|
|
122
|
-
Released on the 3rd of August 2020.
|
|
123
|
-
|
|
124
|
-
- Improved the validation of the mark & markAll for supporting IE11.
|
|
125
|
-
|
|
126
|
-
## 2.0.0-beta.131
|
|
127
|
-
|
|
128
|
-
Released on the 3rd of August 2020.
|
|
129
|
-
|
|
130
|
-
- [[#252](https://github.com/PageProofCom/sdk/issues/252)] Support for updating multiple comment status changes. See [Comments](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Comments.js~Comments.html).
|
|
131
|
-
- "unmarked done" state of the comments is removed. It will be displayed as "marked done". See [CommentState](https://docs.pageproof.tech/@pageproof/sdk/beta/variable/index.html#static-variable-CommentState)
|
|
132
|
-
|
|
133
|
-
## 2.0.0-beta.130
|
|
134
|
-
|
|
135
|
-
Released on the 29th of July 2020.
|
|
136
|
-
|
|
137
|
-
- [[#250](https://github.com/PageProofCom/sdk/pull/250)] Support for updating decision by reviewer/mandatory reviewer. See [Proofs.updateDecision](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Proofs.html#instance-method-updateDecision).
|
|
138
|
-
|
|
139
|
-
## 2.0.0-beta.129
|
|
140
|
-
|
|
141
|
-
Released on the 29th of July 2020.
|
|
142
|
-
|
|
143
|
-
- [[#255](https://github.com/PageProofCom/sdk/pull/255)] Support for proof's tags. See [Proofs.tags](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/Proof.js~Proof.html#instance-member-tags).
|
|
144
|
-
|
|
145
|
-
## 2.0.0-beta.128
|
|
146
|
-
|
|
147
|
-
Released on the 28th of July 2020.
|
|
148
|
-
|
|
149
|
-
- Minor bug fixes.
|
|
150
|
-
|
|
151
|
-
## 2.0.0-beta.127
|
|
152
|
-
|
|
153
|
-
Released on the 20th of July 2020.
|
|
154
|
-
|
|
155
|
-
- [[#245](https://github.com/PageProofCom/sdk/pull/245)] Support for updating bulk due date. See [Proofs.update](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Proofs.html#instance-method-update).
|
|
156
|
-
|
|
157
|
-
## 2.0.0-beta.126
|
|
158
|
-
|
|
159
|
-
Released on the 16th of July 2020.
|
|
160
|
-
|
|
161
|
-
- Support for Proof Decision Summary information in when loading proofs via the Dashboard API. See [Proof.decisionSummary](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/models/Proof.js~Proof.html#instance-member-decisionSummary).
|
|
162
|
-
|
|
163
|
-
## 2.0.0-beta.125
|
|
164
|
-
|
|
165
|
-
Released on 30th of June 2020.
|
|
166
|
-
|
|
167
|
-
- The [Printing](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Printing.js~Printing.html) API's `options` method now also returns `content`, which is a list of acceptable [PrintingContentType](https://docs.pageproof.tech/@pageproof/sdk/beta/variable/index.html#static-variable-PrintingContentType) for printing a given proof. This should be used with when calling `create` in order to form a successful request.
|
|
168
|
-
- [PrintingOption](https://docs.pageproof.tech/@pageproof/sdk/beta/typedef/index.html#static-typedef-PrintingOption) now includes the quantity of comments marked as to do and all comments in a new `counts` field.
|
|
169
|
-
- [PrintingJobOptions](https://docs.pageproof.tech/@pageproof/sdk/beta/typedef/index.html#static-typedef-PrintingJobOptions) now includes a boolean, `includeAllPages` which, when true, also includes pages on static that do not have comments. This is only applicable when using the hero layout.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
## 2.0.0-beta.124
|
|
173
|
-
|
|
174
|
-
Released on the 25th of June 2020.
|
|
175
|
-
|
|
176
|
-
- Support for removing user/users from a team by Administrators. See [TeamUsers.remove](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/admin/TeamUsers.js~TeamUsers.html#instance-method-remove).
|
|
177
|
-
|
|
178
|
-
## 2.0.0-beta.123
|
|
179
|
-
|
|
180
|
-
Released on the 19th of June 2020.
|
|
181
|
-
|
|
182
|
-
- Support for creating email proofs. See [Proofs.generateEmail](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Proofs.html#instance-method-generateEmail).
|
|
183
|
-
- Added [Proof.source](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Proofs.html#instance-member-source) to the Proof model for externally sourced proofs (such as email).
|
|
184
|
-
- Added [Proof.isAwaitingFile](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Proofs.js~Proofs.html#instance-method-isAwaitingFile) for proofs that are waiting on a file to arrive from an external source.
|
|
185
|
-
|
|
186
3
|
## 2.0.0-beta.122
|
|
187
4
|
|
|
188
5
|
Released on the 25th of May 2020.
|
|
@@ -206,7 +23,7 @@ Released on the 16th of March 2020.
|
|
|
206
23
|
|
|
207
24
|
Released on the 13th of March 2020.
|
|
208
25
|
|
|
209
|
-
- [[#226](https://github.com/PageProofCom/sdk/pull/226)] Support for printing of proofs and the options available to do so. See [Printing](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Printing.js
|
|
26
|
+
- [[#226](https://github.com/PageProofCom/sdk/pull/226)] Support for printing of proofs and the options available to do so. See [Printing](https://docs.pageproof.tech/@pageproof/sdk/beta/class/src/api/Printing.js)
|
|
210
27
|
|
|
211
28
|
## 2.0.0-beta.118
|
|
212
29
|
|
package/README.md
CHANGED
|
@@ -376,16 +376,3 @@ refreshes, we need to remind the client what the current session is.
|
|
|
376
376
|
[Session](./class/src/models/Session.js~Session.html) object contains the user's private keys.
|
|
377
377
|
Sharing the private keys with anybody, directly or even indirectly (over unencrypted traffic, for example), gives
|
|
378
378
|
anybody the ability to access & decrypt all proofs you have access to, including those you have been invited to.
|
|
379
|
-
|
|
380
|
-
### SDK development
|
|
381
|
-
Local development:
|
|
382
|
-
1. Node version <= 6
|
|
383
|
-
```sh
|
|
384
|
-
$ npm install
|
|
385
|
-
$ npm run dev
|
|
386
|
-
```
|
|
387
|
-
2. To test the SDK locally: switch to node version >=12, then
|
|
388
|
-
```sh
|
|
389
|
-
$ cd examples
|
|
390
|
-
$ node ./basic-node/index.js
|
|
391
|
-
```
|
|
@@ -3,133 +3,34 @@ declare class IEnhancementAdapter {
|
|
|
3
3
|
static __adapter__: string;
|
|
4
4
|
/** @private */
|
|
5
5
|
onClientReady(client: any): void;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
onMethodAfter(ctx: {
|
|
37
|
-
api: any;
|
|
38
|
-
namespace: string;
|
|
39
|
-
name: string;
|
|
40
|
-
displayName: string;
|
|
41
|
-
}): void;
|
|
42
|
-
/**
|
|
43
|
-
* Called if the method returns a rejected promise.
|
|
44
|
-
*
|
|
45
|
-
* @abstract
|
|
46
|
-
* @param {{ api: API, namespace: string, name: string, displayName: string }} ctx
|
|
47
|
-
*/
|
|
48
|
-
onMethodReject(ctx: {
|
|
49
|
-
api: any;
|
|
50
|
-
namespace: string;
|
|
51
|
-
name: string;
|
|
52
|
-
displayName: string;
|
|
53
|
-
}): void;
|
|
54
|
-
/**
|
|
55
|
-
* Called if the method returns a resolved promise.
|
|
56
|
-
*
|
|
57
|
-
* @abstract
|
|
58
|
-
* @param {{ api: API, namespace: string, name: string, displayName: string }} ctx
|
|
59
|
-
*/
|
|
60
|
-
onMethodResolve(ctx: {
|
|
61
|
-
api: any;
|
|
62
|
-
namespace: string;
|
|
63
|
-
name: string;
|
|
64
|
-
displayName: string;
|
|
65
|
-
}): void;
|
|
66
|
-
/**
|
|
67
|
-
* Called after the method's promise has either resolved or rejected.
|
|
68
|
-
*
|
|
69
|
-
* @abstract
|
|
70
|
-
* @param {{ api: API, namespace: string, name: string, displayName: string }} ctx
|
|
71
|
-
*/
|
|
72
|
-
onMethodFinally(ctx: {
|
|
73
|
-
api: any;
|
|
74
|
-
namespace: string;
|
|
75
|
-
name: string;
|
|
76
|
-
displayName: string;
|
|
77
|
-
}): void;
|
|
78
|
-
/**
|
|
79
|
-
* Called if the method throws an error synchronously.
|
|
80
|
-
*
|
|
81
|
-
* @abstract
|
|
82
|
-
* @param {{ api: API, namespace: string, name: string, displayName: string }} ctx
|
|
83
|
-
*/
|
|
84
|
-
onMethodThrown(ctx: {
|
|
85
|
-
api: any;
|
|
86
|
-
namespace: string;
|
|
87
|
-
name: string;
|
|
88
|
-
displayName: string;
|
|
89
|
-
}): void;
|
|
90
|
-
/**
|
|
91
|
-
* @abstract
|
|
92
|
-
* @param {any} event
|
|
93
|
-
*/
|
|
94
|
-
onRequestBefore(event: any): void;
|
|
95
|
-
/**
|
|
96
|
-
* @abstract
|
|
97
|
-
* @param {any} event
|
|
98
|
-
*/
|
|
99
|
-
onRequestAfter(event: any): void;
|
|
100
|
-
/**
|
|
101
|
-
* @abstract
|
|
102
|
-
* @param {any} event
|
|
103
|
-
*/
|
|
104
|
-
onRequestReject(event: any): void;
|
|
105
|
-
/**
|
|
106
|
-
* @abstract
|
|
107
|
-
* @param {any} event
|
|
108
|
-
*/
|
|
109
|
-
onRequestThrottled(event: any): void;
|
|
110
|
-
/**
|
|
111
|
-
* @abstract
|
|
112
|
-
* @param {any} event
|
|
113
|
-
*/
|
|
114
|
-
onRequestRetry(event: any): void;
|
|
115
|
-
/**
|
|
116
|
-
* @abstract
|
|
117
|
-
* @param {any} event
|
|
118
|
-
*/
|
|
119
|
-
onRequestUnauthorized(event: any): void;
|
|
120
|
-
/**
|
|
121
|
-
* @abstract
|
|
122
|
-
* @param {any} event
|
|
123
|
-
*/
|
|
124
|
-
onRequestDeprecated(event: any): void;
|
|
125
|
-
/**
|
|
126
|
-
* @abstract
|
|
127
|
-
* @param {any} event
|
|
128
|
-
*/
|
|
129
|
-
onRequestResolve(event: any): void;
|
|
130
|
-
/**
|
|
131
|
-
* @abstract
|
|
132
|
-
* @param {any} event
|
|
133
|
-
*/
|
|
134
|
-
onRequestFinally(event: any): void;
|
|
6
|
+
/** @abstract */
|
|
7
|
+
onMethodBefore(): void;
|
|
8
|
+
/** @abstract */
|
|
9
|
+
onMethodAfter(): void;
|
|
10
|
+
/** @abstract */
|
|
11
|
+
onMethodReject(): void;
|
|
12
|
+
/** @abstract */
|
|
13
|
+
onMethodResolve(): void;
|
|
14
|
+
/** @abstract */
|
|
15
|
+
onMethodFinally(): void;
|
|
16
|
+
/** @abstract */
|
|
17
|
+
onMethodThrown(): void;
|
|
18
|
+
/** @abstract */
|
|
19
|
+
onRequestBefore(): void;
|
|
20
|
+
/** @abstract */
|
|
21
|
+
onRequestAfter(): void;
|
|
22
|
+
/** @abstract */
|
|
23
|
+
onRequestReject(): void;
|
|
24
|
+
/** @abstract */
|
|
25
|
+
onRequestThrottled(): void;
|
|
26
|
+
/** @abstract */
|
|
27
|
+
onRequestRetry(): void;
|
|
28
|
+
/** @abstract */
|
|
29
|
+
onRequestUnauthorized(): void;
|
|
30
|
+
/** @private */
|
|
31
|
+
onRequestDeprecated(): void;
|
|
32
|
+
/** @abstract */
|
|
33
|
+
onRequestResolve(): void;
|
|
34
|
+
/** @abstract */
|
|
35
|
+
onRequestFinally(): void;
|
|
135
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _class,_temp;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var IEnhancementAdapter=(_temp=_class=function(){function IEnhancementAdapter(){_classCallCheck(this,IEnhancementAdapter)}IEnhancementAdapter.prototype.onClientReady=function onClientReady(client){var _this=this;var methods=getNestedMethods(client);methods.forEach(function(definition){var ctx={api:definition.api,namespace:definition.namespace,name:definition.name,displayName:definition.namespace+"."+definition.name};_this.
|
|
1
|
+
"use strict";exports.__esModule=true;var _class,_temp;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var IEnhancementAdapter=(_temp=_class=function(){function IEnhancementAdapter(){_classCallCheck(this,IEnhancementAdapter)}IEnhancementAdapter.prototype.onClientReady=function onClientReady(client){var _this=this;var methods=getNestedMethods(client);methods.forEach(function(definition){enhance(definition.api,definition.name,function(callback){var ctx={api:definition.api,namespace:definition.namespace,name:definition.name,displayName:definition.namespace+"."+definition.name};_this.onMethodBefore(ctx);return function(){var value=void 0;try{value=callback()}catch(err){ctx.error=err;_this.onMethodThrown(ctx);throw err}finally{ctx.value=value;_this.onMethodAfter(ctx);if(value&&typeof value.then==="function"){value.then(function(resolved){ctx.resolved=resolved;_this.onMethodResolve(ctx)},function(rejected){ctx.rejected=rejected;_this.onMethodReject(ctx)}).then(function(){_this.onMethodFinally(ctx)})}}return value}})});client.on("experimental.request.before",function(event){return _this.onRequestBefore(event.data)});client.on("experimental.request.after",function(event){return _this.onRequestAfter(event.data)});client.on("error.response",function(event){return _this.onRequestReject(event.data)});client.on("error.throttled",function(event){return _this.onRequestThrottled(event.data)});client.on("experimental.request.retry",function(event){return _this.onRequestRetry(event.data)});client.on("error.unauthorized",function(event){return _this.onRequestUnauthorized(event.data)});client.on("error.deprecated",function(event){return _this.onRequestDeprecated(event.data)});client.on("experimental.request.resolve",function(event){return _this.onRequestResolve(event.data)});client.on("experimental.request.finally",function(event){return _this.onRequestFinally(event.data)})};IEnhancementAdapter.prototype.onMethodBefore=function onMethodBefore(){};IEnhancementAdapter.prototype.onMethodAfter=function onMethodAfter(){};IEnhancementAdapter.prototype.onMethodReject=function onMethodReject(){};IEnhancementAdapter.prototype.onMethodResolve=function onMethodResolve(){};IEnhancementAdapter.prototype.onMethodFinally=function onMethodFinally(){};IEnhancementAdapter.prototype.onMethodThrown=function onMethodThrown(){};IEnhancementAdapter.prototype.onRequestBefore=function onRequestBefore(){};IEnhancementAdapter.prototype.onRequestAfter=function onRequestAfter(){};IEnhancementAdapter.prototype.onRequestReject=function onRequestReject(){};IEnhancementAdapter.prototype.onRequestThrottled=function onRequestThrottled(){};IEnhancementAdapter.prototype.onRequestRetry=function onRequestRetry(){};IEnhancementAdapter.prototype.onRequestUnauthorized=function onRequestUnauthorized(){};IEnhancementAdapter.prototype.onRequestDeprecated=function onRequestDeprecated(){};IEnhancementAdapter.prototype.onRequestResolve=function onRequestResolve(){};IEnhancementAdapter.prototype.onRequestFinally=function onRequestFinally(){};return IEnhancementAdapter}(),_class.__adapter__="IEnhancementAdapter",_temp);function enhance(obj,name,factory){var original=obj[name];obj[name]=function enhanced(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var bound=original.bind.apply(original,[this].concat(args));var replacement=factory(bound,this,args);var value=replacement.apply(this,args);return value}}function getNestedMethods(client){var includeTop=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var definitions=[];function scan(api){var prefix=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var children=Object.getOwnPropertyNames(api).filter(function(name){return api[name].client===client});var proto=Object.getPrototypeOf(api);var methods=Object.keys(proto).filter(function(name){return typeof proto[name]==="function"&&name.indexOf("_")!==0});if(prefix.length||includeTop){methods.forEach(function(name){definitions.push({namespace:prefix.join("."),name:name,api:api})})}children.forEach(function(name){scan(api[name],prefix.concat(name))})}scan(client);return definitions}exports.default=IEnhancementAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PageProofAngularEnhancementAdapter=t():e.PageProofAngularEnhancementAdapter=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(c),p=n(2)("AngularEnhancementAdapter"),f={$scope:null,$exceptionHandler:null,module:null},s=function(e){function t(n){o(this,t);var i=r(this,e.call(this));return i.options=u({},f,n),i.$scope=i.options.$scope,i.$exceptionHandler=i.options.$exceptionHandler,i.options.module&&i.options.module.run(["$rootScope","$exceptionHandler",function(e,t){p("Extracting the $rootScope and $exceptionHandler from Angular module"),i.$scope=i.$scope||e,i.$exceptionHandler=i.$exceptionHandler||t}]),i}return i(t,e),t.prototype.onMethodFinally=function(){this.$scope&&!this.$scope.$$phase&&this.$scope.$apply(),this.$scope||p("Unable to tell $scope to re-digest, either module hasn't booted, or no $scope was provided")},t.prototype.onMethodReject=function(e){var t=e.rejected;this.$exceptionHandler?this.$exceptionHandler(t):p("Unable to invoke $exceptionHandler of rejected Promise, check configuration")},t.prototype.onMethodThrown=function(e){var t=e.error;this.$exceptionHandler?this.$exceptionHandler(t):p("Unable to invoke $exceptionHandler of uncaught error, check configuration")},t}(a.default);t.default=s},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){var o=e[t];e[t]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=o.bind.apply(o,[this].concat(t));return n(i,this,t).apply(this,t)}}function i(e){function t(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=Object.getOwnPropertyNames(r).filter(function(t){return r[t].client===e}),c=Object.getPrototypeOf(r),a=Object.keys(c).filter(function(e){return"function"==typeof c[e]&&0!==e.indexOf("_")});(i.length||n)&&a.forEach(function(e){o.push({namespace:i.join("."),name:e,api:r})}),u.forEach(function(e){t(r[e],i.concat(e))})}var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=[];return t(e),o}t.__esModule=!0;var u,c,a=(c=u=function(){function e(){o(this,e)}return e.prototype.onClientReady=function(e){var t=this;i(e).forEach(function(e){var
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PageProofAngularEnhancementAdapter=t():e.PageProofAngularEnhancementAdapter=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(c),p=n(2)("AngularEnhancementAdapter"),f={$scope:null,$exceptionHandler:null,module:null},s=function(e){function t(n){o(this,t);var i=r(this,e.call(this));return i.options=u({},f,n),i.$scope=i.options.$scope,i.$exceptionHandler=i.options.$exceptionHandler,i.options.module&&i.options.module.run(["$rootScope","$exceptionHandler",function(e,t){p("Extracting the $rootScope and $exceptionHandler from Angular module"),i.$scope=i.$scope||e,i.$exceptionHandler=i.$exceptionHandler||t}]),i}return i(t,e),t.prototype.onMethodFinally=function(){this.$scope&&!this.$scope.$$phase&&this.$scope.$apply(),this.$scope||p("Unable to tell $scope to re-digest, either module hasn't booted, or no $scope was provided")},t.prototype.onMethodReject=function(e){var t=e.rejected;this.$exceptionHandler?this.$exceptionHandler(t):p("Unable to invoke $exceptionHandler of rejected Promise, check configuration")},t.prototype.onMethodThrown=function(e){var t=e.error;this.$exceptionHandler?this.$exceptionHandler(t):p("Unable to invoke $exceptionHandler of uncaught error, check configuration")},t}(a.default);t.default=s},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){var o=e[t];e[t]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=o.bind.apply(o,[this].concat(t));return n(i,this,t).apply(this,t)}}function i(e){function t(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=Object.getOwnPropertyNames(r).filter(function(t){return r[t].client===e}),c=Object.getPrototypeOf(r),a=Object.keys(c).filter(function(e){return"function"==typeof c[e]&&0!==e.indexOf("_")});(i.length||n)&&a.forEach(function(e){o.push({namespace:i.join("."),name:e,api:r})}),u.forEach(function(e){t(r[e],i.concat(e))})}var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=[];return t(e),o}t.__esModule=!0;var u,c,a=(c=u=function(){function e(){o(this,e)}return e.prototype.onClientReady=function(e){var t=this;i(e).forEach(function(e){r(e.api,e.name,function(n){var o={api:e.api,namespace:e.namespace,name:e.name,displayName:e.namespace+"."+e.name};return t.onMethodBefore(o),function(){var e=void 0;try{e=n()}catch(e){throw o.error=e,t.onMethodThrown(o),e}finally{o.value=e,t.onMethodAfter(o),e&&"function"==typeof e.then&&e.then(function(e){o.resolved=e,t.onMethodResolve(o)},function(e){o.rejected=e,t.onMethodReject(o)}).then(function(){t.onMethodFinally(o)})}return e}})}),e.on("experimental.request.before",function(e){return t.onRequestBefore(e.data)}),e.on("experimental.request.after",function(e){return t.onRequestAfter(e.data)}),e.on("error.response",function(e){return t.onRequestReject(e.data)}),e.on("error.throttled",function(e){return t.onRequestThrottled(e.data)}),e.on("experimental.request.retry",function(e){return t.onRequestRetry(e.data)}),e.on("error.unauthorized",function(e){return t.onRequestUnauthorized(e.data)}),e.on("error.deprecated",function(e){return t.onRequestDeprecated(e.data)}),e.on("experimental.request.resolve",function(e){return t.onRequestResolve(e.data)}),e.on("experimental.request.finally",function(e){return t.onRequestFinally(e.data)})},e.prototype.onMethodBefore=function(){},e.prototype.onMethodAfter=function(){},e.prototype.onMethodReject=function(){},e.prototype.onMethodResolve=function(){},e.prototype.onMethodFinally=function(){},e.prototype.onMethodThrown=function(){},e.prototype.onRequestBefore=function(){},e.prototype.onRequestAfter=function(){},e.prototype.onRequestReject=function(){},e.prototype.onRequestThrottled=function(){},e.prototype.onRequestRetry=function(){},e.prototype.onRequestUnauthorized=function(){},e.prototype.onRequestDeprecated=function(){},e.prototype.onRequestResolve=function(){},e.prototype.onRequestFinally=function(){},e}(),u.__adapter__="IEnhancementAdapter",c);t.default=a},function(e,t,n){"use strict";e.exports=function e(){return e}}])});
|
|
2
2
|
//# sourceMappingURL=angular-enhancement-adapter.js.map
|
package/lib/api/Comments.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ declare class Comments extends API {
|
|
|
3
3
|
constructor(client: any);
|
|
4
4
|
/** @private */
|
|
5
5
|
_mark(commentId: any, state: any, value: any): any;
|
|
6
|
-
/** @private */
|
|
7
|
-
_markAll(proofId: any, commentIds: any, state: any, value: any): any;
|
|
8
6
|
/**
|
|
9
7
|
* Marks a comment as to-do or done.
|
|
10
8
|
*
|
|
@@ -15,13 +13,15 @@ declare class Comments extends API {
|
|
|
15
13
|
* @returns {Promise<CommentState>}
|
|
16
14
|
*/
|
|
17
15
|
mark(commentId: string, state: {
|
|
16
|
+
COMMENT: string;
|
|
18
17
|
TODO: string;
|
|
19
18
|
DONE: string;
|
|
20
|
-
|
|
19
|
+
UNMARKED_DONE: string;
|
|
21
20
|
}): Promise<{
|
|
21
|
+
COMMENT: string;
|
|
22
22
|
TODO: string;
|
|
23
23
|
DONE: string;
|
|
24
|
-
|
|
24
|
+
UNMARKED_DONE: string;
|
|
25
25
|
}>;
|
|
26
26
|
/**
|
|
27
27
|
* Unmarks a comment as to-do or done.
|
|
@@ -33,50 +33,16 @@ declare class Comments extends API {
|
|
|
33
33
|
* @returns {Promise<CommentState>}
|
|
34
34
|
*/
|
|
35
35
|
unmark(commentId: string, state: {
|
|
36
|
+
COMMENT: string;
|
|
36
37
|
TODO: string;
|
|
37
38
|
DONE: string;
|
|
38
|
-
|
|
39
|
+
UNMARKED_DONE: string;
|
|
39
40
|
}): Promise<{
|
|
41
|
+
COMMENT: string;
|
|
40
42
|
TODO: string;
|
|
41
43
|
DONE: string;
|
|
42
|
-
|
|
44
|
+
UNMARKED_DONE: string;
|
|
43
45
|
}>;
|
|
44
|
-
/**
|
|
45
|
-
* Mark comments as to-do or done.
|
|
46
|
-
*
|
|
47
|
-
* @since v2.0.0-beta.131
|
|
48
|
-
* @see {@link Comment.state}
|
|
49
|
-
* @param {string} proofId The proof id
|
|
50
|
-
* @param {Array<string>} commentIds The comment ids
|
|
51
|
-
* @param {CommentState} state The comment mark type (otherwise known as the "state")
|
|
52
|
-
* @returns {Promise<Array<{CommentId, CommentState}>>}
|
|
53
|
-
*/
|
|
54
|
-
markAll(proofId: string, commentIds: string[], state: {
|
|
55
|
-
TODO: string;
|
|
56
|
-
DONE: string;
|
|
57
|
-
UNMARKED: string;
|
|
58
|
-
}): Promise<{
|
|
59
|
-
CommentId: any;
|
|
60
|
-
CommentState: any;
|
|
61
|
-
}[]>;
|
|
62
|
-
/**
|
|
63
|
-
* Unmark comments as to-do or done.
|
|
64
|
-
*
|
|
65
|
-
* @since v2.0.0-beta.131
|
|
66
|
-
* @see {@link Comment.state}
|
|
67
|
-
* @param {string} proofId The proof id
|
|
68
|
-
* @param {Array<string>} commentIds The comment ids
|
|
69
|
-
* @param {CommentState} state The comment mark type (otherwise known as the "state")
|
|
70
|
-
* @returns {Promise<Array<{CommentId, CommentState}>>}
|
|
71
|
-
*/
|
|
72
|
-
unmarkAll(proofId: string, commentIds: string[], state: {
|
|
73
|
-
TODO: string;
|
|
74
|
-
DONE: string;
|
|
75
|
-
UNMARKED: string;
|
|
76
|
-
}): Promise<{
|
|
77
|
-
CommentId: any;
|
|
78
|
-
CommentState: any;
|
|
79
|
-
}[]>;
|
|
80
46
|
/**
|
|
81
47
|
* Deletes a comment.
|
|
82
48
|
*
|
package/lib/api/Comments.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Comment=require("../models/Comment");var _Comment2=_interopRequireDefault(_Comment);var _CommentState=require("../enum/CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _constants=require("../util/constants");var _sort=require("../util/sort");var _v=require("../util/comments/v2");var _extractMentions=require("../util/comments/extractMentions");var _extractMentions2=_interopRequireDefault(_extractMentions);var _parseComment=require("../util/comments/parseComment");var _parseComment2=_interopRequireDefault(_parseComment);var _creationToken=require("../util/creationToken");var _throttle=require("../util/throttle");var _throttle2=_interopRequireDefault(_throttle);var _getCommentState=require("../../lib/util/comments/getCommentState");var _getCommentState2=_interopRequireDefault(_getCommentState);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}function getCommentDataFromPages(pages){var comments=[];Object.keys(pages).forEach(function(pageNumber){pages[pageNumber].Comments.forEach(function(commentData){comments.push(commentData)})});return comments}var _sortPages=(0,_sort.sortObjectsByKey)("pageNumber");var _sortCreatedDateDESC=(0,_sort.sortObjectsByKey)("createdDate",true);var _sortCreatedDateASC=(0,_sort.sortObjectsByKey)("createdDate",false);var sortComments=(0,_sort.combineSort)(_sortPages,_sortCreatedDateDESC);var sortReplies=(0,_sort.combineSort)(_sortPages,_sortCreatedDateASC);function mapComments(commentsData){var comments=[];var replies=[];commentsData.forEach(function(commentData){var entity=(new _Comment2.default).fromComment(commentData);if(entity.parentCommentId){replies.push(entity)}else{comments.push(entity)}});comments.sort(sortComments);var commentIds=comments.map(function(c){return c.id});var sortByParentCommentIndex=(0,_sort.sortObjectsBy)(function(r){return commentIds.indexOf(r.parentCommentId)},true);replies.sort((0,_sort.combineSort)(sortReplies,sortByParentCommentIndex));return comments.concat(replies)}var Comments=function(_API){_inherits(Comments,_API);function Comments(){_classCallCheck(this,Comments);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Comments.prototype._mark=function _mark(commentId,state,value){
|
|
1
|
+
"use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);var _Comment=require("../models/Comment");var _Comment2=_interopRequireDefault(_Comment);var _CommentState=require("../enum/CommentState");var _CommentState2=_interopRequireDefault(_CommentState);var _constants=require("../util/constants");var _sort=require("../util/sort");var _v=require("../util/comments/v2");var _extractMentions=require("../util/comments/extractMentions");var _extractMentions2=_interopRequireDefault(_extractMentions);var _parseComment=require("../util/comments/parseComment");var _parseComment2=_interopRequireDefault(_parseComment);var _creationToken=require("../util/creationToken");var _throttle=require("../util/throttle");var _throttle2=_interopRequireDefault(_throttle);var _getCommentState=require("../../lib/util/comments/getCommentState");var _getCommentState2=_interopRequireDefault(_getCommentState);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&(typeof call==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}function getCommentDataFromPages(pages){var comments=[];Object.keys(pages).forEach(function(pageNumber){pages[pageNumber].Comments.forEach(function(commentData){comments.push(commentData)})});return comments}var _sortPages=(0,_sort.sortObjectsByKey)("pageNumber");var _sortCreatedDateDESC=(0,_sort.sortObjectsByKey)("createdDate",true);var _sortCreatedDateASC=(0,_sort.sortObjectsByKey)("createdDate",false);var sortComments=(0,_sort.combineSort)(_sortPages,_sortCreatedDateDESC);var sortReplies=(0,_sort.combineSort)(_sortPages,_sortCreatedDateASC);function mapComments(commentsData){var comments=[];var replies=[];commentsData.forEach(function(commentData){var entity=(new _Comment2.default).fromComment(commentData);if(entity.parentCommentId){replies.push(entity)}else{comments.push(entity)}});comments.sort(sortComments);var commentIds=comments.map(function(c){return c.id});var sortByParentCommentIndex=(0,_sort.sortObjectsBy)(function(r){return commentIds.indexOf(r.parentCommentId)},true);replies.sort((0,_sort.combineSort)(sortReplies,sortByParentCommentIndex));return comments.concat(replies)}var Comments=function(_API){_inherits(Comments,_API);function Comments(){_classCallCheck(this,Comments);return _possibleConstructorReturn(this,_API.apply(this,arguments))}Comments.prototype._mark=function _mark(commentId,state,value){var _data;var field=void 0;switch(state){case _CommentState2.default.TODO:{field="change";break}case _CommentState2.default.DONE:{field="done";break}default:{throw new Error('Cannot mark comment state "'+state+'".')}}var data=(_data={commentId:commentId},_data[field]=value?1:0,_data);return this.client.request("comments.state.update",data).then(function(response){return(0,_getCommentState2.default)(response.data)})};Comments.prototype.mark=function mark(commentId,state){return this._mark(commentId,state,true)};Comments.prototype.unmark=function unmark(commentId,state){return this._mark(commentId,state,false)};Comments.prototype.delete=function _delete(commentId){return this.client.request("comments.delete",{commentId:commentId})};Comments.prototype.load=function load(_options){var _this2=this;var options=typeof _options==="string"?{proofId:_options}:_options;var proofId=options.proofId,_options$pageNumber=options.pageNumber,pageNumber=_options$pageNumber===undefined?null:_options$pageNumber,_options$sinceDate=options.sinceDate,sinceDate=_options$sinceDate===undefined?null:_options$sinceDate,_options$async=options.async,async=_options$async===undefined?false:_options$async,_options$decrypt=options.decrypt,decrypt=_options$decrypt===undefined?true:_options$decrypt,onDecryptComment=options.onDecryptComment,onDecryptComments=options.onDecryptComments,_options$onDecryptCom=options.onDecryptCommentsThrottleMs,onDecryptCommentsThrottleMs=_options$onDecryptCom===undefined?1e3:_options$onDecryptCom,onDecryptError=options.onDecryptError;var sinceDateISO=sinceDate?sinceDate.toISOString().match(_constants.ISO_REGEX)[0]:_constants.DEFAULT_ISO_DATE;var payload={proofId:proofId,page:pageNumber,timestamp:sinceDateISO};return this.client.request(pageNumber!==null?"comments.load-page":"comments.load-all",payload).then(function(response){var comments=mapComments(response.data.Pages?getCommentDataFromPages(response.data.Pages):response.data);var wait=Promise.resolve();if(decrypt){var scheduled=[];var pendingBatch=[];var scheduleOnDecryptComments=onDecryptComments?(0,_throttle2.default)(function(){if(pendingBatch.length){onDecryptComments(pendingBatch);pendingBatch=[]}},onDecryptCommentsThrottleMs):function(){};var cached=Promise.all(comments.map(function(comment){return _this2.client.cache.auto(_constants.COMMENT_CACHE_PREFIX+comment.comment$,function(resolve){scheduled.push({comment:comment,resolve:resolve})}).then(function(rawComment){if(rawComment){comment.fromRawComment(rawComment)}return comment})}));wait=wait.then(function(){return cached});wait=wait.then(function(){var decrypted=scheduled.map(function(_ref){var comment=_ref.comment,resolve=_ref.resolve;return _this2.client.crypto().decryptComment(comment.comment$,comment.envelope,_this2.client.session.privateKeyPEM).then(function(rawComment){comment.fromRawComment(rawComment);resolve(rawComment);if(onDecryptComment){onDecryptComment(comment)}pendingBatch.push(comment);scheduleOnDecryptComments()}).catch(function(err){if(onDecryptError){onDecryptError(err,comment)}if(!async){return Promise.reject(err)}return undefined})});if(!async){return Promise.all(decrypted)}return null})}return wait.then(function(){return comments})})};Comments.prototype.create=function create(_ref2){var _this3=this;var raw=_ref2.raw,tokens=_ref2.tokens,proofId=_ref2.proofId,_ref2$pageNumber=_ref2.pageNumber,pageNumber=_ref2$pageNumber===undefined?1:_ref2$pageNumber,pin=_ref2.pin,mediaTime=_ref2.mediaTime,mediaDuration=_ref2.mediaDuration,parentCommentId=_ref2.parentCommentId,metadata=_ref2.metadata,state=_ref2.state,retryCreationToken=_ref2.creationToken;var mentions=[];var serialized=raw||(0,_v.serialize)(tokens);{var parsed=tokens||(0,_parseComment2.default)(raw);mentions.push.apply(mentions,(0,_extractMentions2.default)(parsed))}var creationToken=retryCreationToken||(0,_creationToken.generateCreationToken)();return this.client.crypto().encryptComment(serialized,[this.client.session.serverPublicKeyPEM,this.client.session.publicKeyPEM]).then(function(_ref3){var envelope=_ref3.envelope,comment$=_ref3.comment$;return{proofId:proofId,page:parentCommentId?undefined:pageNumber,envelope:envelope,encryptedComment:comment$,xy:JSON.stringify({x:pin&&typeof pin.x==="number"?pin.x:null,y:pin&&typeof pin.y==="number"?pin.y:null,x2:pin&&typeof pin.x2==="number"?pin.x2:null,y2:pin&&typeof pin.y2==="number"?pin.y2:null,time:typeof mediaTime==="number"?mediaTime:null,duration:typeof mediaDuration==="number"?mediaDuration:null}),boxFillImage:pin.fill?pin.fill.image:null,boxFillType:pin.fill?pin.fill.type:null,parent:parentCommentId||undefined,mentions:mentions,metadata:metadata?JSON.stringify(metadata):"{}",creationToken:creationToken,change:state===_CommentState2.default.TODO?"1":undefined,done:state===_CommentState2.default.DONE?"1":undefined}}).then(function(requestData){return _this3.client.request("comments.create",requestData).then(function(response){return(new _Comment2.default).fromComment(response.data).fromRawComment(serialized)})}).catch(function(err){if(err){err.creationToken=creationToken}return Promise.reject(err)})};return Comments}(_API3.default);exports.default=Comments;
|
package/lib/api/Files.d.ts
CHANGED
|
@@ -80,25 +80,6 @@ declare class Files extends API {
|
|
|
80
80
|
download?: boolean;
|
|
81
81
|
process?: boolean;
|
|
82
82
|
}): Promise<File>;
|
|
83
|
-
/**
|
|
84
|
-
* Creates a file and generates an email address (for email proofing).
|
|
85
|
-
*
|
|
86
|
-
* @example <caption>Create a proof with an email proof</caption>
|
|
87
|
-
* const file = await client.files.email();
|
|
88
|
-
* console.log('Email address: ' + file.emailAddress);
|
|
89
|
-
*
|
|
90
|
-
* const proof = await client.proofs.create({
|
|
91
|
-
* messageToReviewers: 'Check out this email template from SendGrid!',
|
|
92
|
-
* file,
|
|
93
|
-
* start: false,
|
|
94
|
-
* });
|
|
95
|
-
*
|
|
96
|
-
* @returns {Promise<{ id: string, emailAddress: string }>}
|
|
97
|
-
*/
|
|
98
|
-
email(): Promise<{
|
|
99
|
-
id: string;
|
|
100
|
-
emailAddress: string;
|
|
101
|
-
}>;
|
|
102
83
|
/** @private */
|
|
103
84
|
_generateKeyIVEnvelope(): any;
|
|
104
85
|
/**
|
|
@@ -195,7 +176,6 @@ declare class Files extends API {
|
|
|
195
176
|
* @param {boolean} [file.download=false] Whether the file should be available for download
|
|
196
177
|
* @param {boolean} [file.async=true] Whether to upload the file independently of the Promise
|
|
197
178
|
* @param {function} [file.onProgress] A callback for tracking the upload percentage
|
|
198
|
-
* @param {function} [file.onFileDetails] A callback option which provides you with the {@link File} object - before it starts uploading. The File object currently only includes the `id` field.
|
|
199
179
|
* @param {object} [options]
|
|
200
180
|
* @param {number} [options.progressDecimalPlaces] Sets the number of decimal places in the progress events. This can dramatically reduce the frequency the `file.onProgress` callback is invoked.
|
|
201
181
|
* @param {number} [options.concurrent=6] The number of concurrent chunks to encrypt & upload at once.
|