@pageproof/sdk-pr 724.0.1789035190285 → 725.0.1789459539227

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.
@@ -64,10 +64,12 @@ declare class Integrations extends API {
64
64
  */
65
65
  updateConfiguration(integrationKey: string, key: string, value: string): Promise<any>;
66
66
  /**
67
- * Lists the folders inside the connected OneDrive, for picking the folder
68
- * approved proofs are delivered to.
67
+ * Lists the folders inside the configured OneDrive delivery destination, for
68
+ * picking the folder approved proofs are delivered to. The destination itself
69
+ * is whatever the team has configured — the connected user's own OneDrive, or
70
+ * a SharePoint document library — so this always browses the right drive.
69
71
  *
70
- * @example <caption>Listing the folders in the drive root</caption>
72
+ * @example <caption>Listing the folders in the destination root</caption>
71
73
  * const admin = await client.admin();
72
74
  * const folders = await admin.team.integrations.getOneDriveFolders();
73
75
  *
@@ -75,7 +77,7 @@ declare class Integrations extends API {
75
77
  * const folders = await admin.team.integrations.getOneDriveFolders(folderId);
76
78
  *
77
79
  * @since 2.24.0
78
- * @param {string} [itemId] The id of the folder to list; omit for the drive root
80
+ * @param {string} [itemId] The id of the folder to list; omit for the destination root
79
81
  * @returns {Promise<Array<{ id: string, name: string }>>}
80
82
  */
81
83
  getOneDriveFolders(itemId?: string): Promise<Array<{
@@ -83,49 +85,47 @@ declare class Integrations extends API {
83
85
  name: string;
84
86
  }>>;
85
87
  /**
86
- * Lists the folders inside the connected Dropbox, for picking the folder
87
- * approved proofs are delivered to.
88
+ * Lists the SharePoint sites the connected Microsoft account can deliver to,
89
+ * for picking the site whose document library approved proofs are delivered
90
+ * into.
88
91
  *
89
- * @example <caption>Listing the folders in the Dropbox root</caption>
92
+ * Microsoft offers no delegated way to enumerate every site an account can
93
+ * reach, so an unsearched call returns the sites the account follows, and any
94
+ * other site has to be found by name.
95
+ *
96
+ * @example <caption>Listing the followed sites</caption>
90
97
  * const admin = await client.admin();
91
- * const folders = await admin.team.integrations.getDropboxFolders();
98
+ * const sites = await admin.team.integrations.getOneDriveSites();
92
99
  *
93
- * @example <caption>Listing the subfolders of a folder</caption>
94
- * const folders = await admin.team.integrations.getDropboxFolders(folderId);
100
+ * @example <caption>Searching for a site by name</caption>
101
+ * const sites = await admin.team.integrations.getOneDriveSites('marketing');
95
102
  *
96
- * @since 2.26.0
97
- * @param {string} [itemId] The id of the folder to list; omit for the Dropbox root
98
- * @returns {Promise<Array<{ id: string, name: string }>>}
103
+ * @since 2.27.0
104
+ * @param {string} [query] Search sites by name; omit for the followed sites
105
+ * @returns {Promise<Array<{ id: string, name: string, webUrl: string }>>}
99
106
  */
100
- getDropboxFolders(itemId?: string): Promise<Array<{
107
+ getOneDriveSites(query?: string): Promise<Array<{
101
108
  id: string;
102
109
  name: string;
110
+ webUrl: string;
103
111
  }>>;
104
112
  /**
105
- * Gets everything needed to open the Google Picker so the user can choose the
106
- * folder approved proofs are delivered to.
107
- *
108
- * Google Drive has no folder-listing equivalent of `getOneDriveFolders` and
109
- * `getDropboxFolders`: PageProof holds only the non-sensitive `drive.file`
110
- * scope, which cannot enumerate a user's existing folders. The folder is
111
- * chosen in the Google Picker instead, which grants PageProof access to just
112
- * that folder.
113
- *
114
- * The access token is short-lived and scoped to the team's connected Google
115
- * account, so fetch it when the picker is about to open rather than caching it.
113
+ * Lists the document libraries in a SharePoint site, for picking the one
114
+ * approved proofs are delivered into.
116
115
  *
117
- * @example <caption>Opening the Google Picker</caption>
116
+ * @example <caption>Listing a site's libraries</caption>
118
117
  * const admin = await client.admin();
119
- * const { accessToken, appId, developerKey } = await admin.team.integrations.getGoogleDrivePickerToken();
118
+ * const libraries = await admin.team.integrations.getOneDriveSiteLibraries(siteId);
120
119
  *
121
- * @since 2.26.0
122
- * @returns {Promise<{ accessToken: string, appId: string, developerKey: string }>}
120
+ * @since 2.27.0
121
+ * @param {string} siteId The id of the site to list the libraries of
122
+ * @returns {Promise<Array<{ id: string, name: string, webUrl: string }>>}
123
123
  */
124
- getGoogleDrivePickerToken(): Promise<{
125
- accessToken: string;
126
- appId: string;
127
- developerKey: string;
128
- }>;
124
+ getOneDriveSiteLibraries(siteId: string): Promise<Array<{
125
+ id: string;
126
+ name: string;
127
+ webUrl: string;
128
+ }>>;
129
129
  /**
130
130
  * Gets the list of Jira sites associated with a pending connection so the user
131
131
  * can pick which one to finalise the integration against.
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);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}var Integrations=function(_API){_inherits(Integrations,_API);function Integrations(client,level){_classCallCheck(this,Integrations);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.level=level;return _this}Integrations.prototype.configurations=function configurations(){var integrationKeys=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return this.client.request("integrations.get-configurations",{level:this.level,integration_keys:integrationKeys.join(",")}).then(function(response){if(response.data){return response.data.integrations}return null})};Integrations.prototype.getSetupUrl=function getSetupUrl(integrationKey,params){return this.client.request("integrations.get-setup-url",{params:_extends({},params,{integration_key:integrationKey,level:this.level})}).then(function(response){return{url:response.data.url,windowFeatures:response.data.windowFeatures}})};Integrations.prototype.disable=function disable(integrationKey){return this.client.request("integrations.disable",{level:this.level,integration_key:integrationKey})};Integrations.prototype.updateConfiguration=function updateConfiguration(integrationKey,key,value){return this.client.request("integrations.update-configuration",{level:this.level,integrationKey:integrationKey,key:key,value:value})};Integrations.prototype.getOneDriveFolders=function getOneDriveFolders(itemId){return this.client.request("integrations.one-drive.get-folders",{level:this.level,itemId:itemId||""}).then(function(response){return response.data.folders})};Integrations.prototype.getDropboxFolders=function getDropboxFolders(itemId){return this.client.request("integrations.dropbox.get-folders",{level:this.level,itemId:itemId||""}).then(function(response){return response.data.folders})};Integrations.prototype.getGoogleDrivePickerToken=function getGoogleDrivePickerToken(){return this.client.request("integrations.google-drive.get-picker-token",{level:this.level}).then(function(response){return response.data.picker})};Integrations.prototype.getJiraPendingConnection=function getJiraPendingConnection(pendingId){return this.client.request("integrations.jira.get-pending-connection",{pendingId:pendingId}).then(function(response){return response.data.sites})};Integrations.prototype.completeJiraPendingConnection=function completeJiraPendingConnection(pendingId,cloudId){return this.client.request("integrations.jira.complete-pending-connection",{pendingId:pendingId,cloudId:cloudId})};return Integrations}(_API3.default);exports.default=Integrations;
1
+ "use strict";exports.__esModule=true;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _API2=require("./API");var _API3=_interopRequireDefault(_API2);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}var Integrations=function(_API){_inherits(Integrations,_API);function Integrations(client,level){_classCallCheck(this,Integrations);var _this=_possibleConstructorReturn(this,_API.call(this,client));_this.level=level;return _this}Integrations.prototype.configurations=function configurations(){var integrationKeys=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return this.client.request("integrations.get-configurations",{level:this.level,integration_keys:integrationKeys.join(",")}).then(function(response){if(response.data){return response.data.integrations}return null})};Integrations.prototype.getSetupUrl=function getSetupUrl(integrationKey,params){return this.client.request("integrations.get-setup-url",{params:_extends({},params,{integration_key:integrationKey,level:this.level})}).then(function(response){return{url:response.data.url,windowFeatures:response.data.windowFeatures}})};Integrations.prototype.disable=function disable(integrationKey){return this.client.request("integrations.disable",{level:this.level,integration_key:integrationKey})};Integrations.prototype.updateConfiguration=function updateConfiguration(integrationKey,key,value){return this.client.request("integrations.update-configuration",{level:this.level,integrationKey:integrationKey,key:key,value:value})};Integrations.prototype.getOneDriveFolders=function getOneDriveFolders(itemId){return this.client.request("integrations.one-drive.get-folders",{level:this.level,itemId:itemId||""}).then(function(response){return response.data.folders})};Integrations.prototype.getOneDriveSites=function getOneDriveSites(query){return this.client.request("integrations.one-drive.get-sites",{level:this.level,query:query||""}).then(function(response){return response.data.sites})};Integrations.prototype.getOneDriveSiteLibraries=function getOneDriveSiteLibraries(siteId){return this.client.request("integrations.one-drive.get-site-libraries",{level:this.level,siteId:siteId}).then(function(response){return response.data.libraries})};Integrations.prototype.getJiraPendingConnection=function getJiraPendingConnection(pendingId){return this.client.request("integrations.jira.get-pending-connection",{pendingId:pendingId}).then(function(response){return response.data.sites})};Integrations.prototype.completeJiraPendingConnection=function completeJiraPendingConnection(pendingId,cloudId){return this.client.request("integrations.jira.complete-pending-connection",{pendingId:pendingId,cloudId:cloudId})};return Integrations}(_API3.default);exports.default=Integrations;
@@ -9,10 +9,23 @@ declare class ProofsAudit extends API {
9
9
  /**
10
10
  * Generates a summary/timeline of the important proof events.
11
11
  *
12
+ * Every proof version is a separate proof ID with its own audit, so passing the
13
+ * ID of an older version returns that version's audit. Pass `allVersions` to get
14
+ * a block per version across the whole version chain instead.
15
+ *
16
+ * The result always holds a `summaries` array, with one block per version, so
17
+ * callers never have to branch on whether `allVersions` was requested. Versions
18
+ * the user has no access to are listed in `versions` with `canAccess: false` and
19
+ * are left out of `summaries`.
20
+ *
12
21
  * @param {string} proofId The proof ID
22
+ * @param {Object} [options]
23
+ * @param {boolean} [options.allVersions=false] Whether to include every accessible version of the proof
13
24
  * @returns {Promise<ProofAuditSummary>}
14
25
  */
15
- summary(proofId: string): Promise<any>;
26
+ summary(proofId: string, { allVersions }?: {
27
+ allVersions: boolean;
28
+ }): Promise<ProofAuditSummary>;
16
29
  /**
17
30
  * Generates a chronological audit of every comment, reply, label and status
18
31
  * change on the proof.
@@ -1 +1 @@
1
- "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);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}var ProofsAudit=function(_API){_inherits(ProofsAudit,_API);function ProofsAudit(){_classCallCheck(this,ProofsAudit);return _possibleConstructorReturn(this,_API.apply(this,arguments))}ProofsAudit.prototype.summary=function summary(proofId){return this.client.request("proofs.audit.summary",{proofId:proofId}).then(function(response){return response.data.summary})};ProofsAudit.prototype.comments=function comments(proofId){return this.client.request("proofs.audit.comments",{proofId:proofId}).then(function(response){return response.data})};return ProofsAudit}(_API3.default);exports.default=ProofsAudit;
1
+ "use strict";exports.__esModule=true;var _API2=require("./API");var _API3=_interopRequireDefault(_API2);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}var ProofsAudit=function(_API){_inherits(ProofsAudit,_API);function ProofsAudit(){_classCallCheck(this,ProofsAudit);return _possibleConstructorReturn(this,_API.apply(this,arguments))}ProofsAudit.prototype.summary=function summary(proofId){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},allVersions=_ref.allVersions;return this.client.request("proofs.audit.summary",{proofId:proofId,allVersions:allVersions}).then(function(response){return response.data})};ProofsAudit.prototype.comments=function comments(proofId){return this.client.request("proofs.audit.comments",{proofId:proofId}).then(function(response){return response.data})};return ProofsAudit}(_API3.default);exports.default=ProofsAudit;
@@ -960,15 +960,15 @@
960
960
  "path": "/api/integrations/onedrive/folders",
961
961
  "query": ["level", "itemId"]
962
962
  },
963
- "integrations.dropbox.get-folders": {
963
+ "integrations.one-drive.get-sites": {
964
964
  "method": "GET",
965
- "path": "/api/integrations/dropbox/folders",
966
- "query": ["level", "itemId"]
965
+ "path": "/api/integrations/onedrive/sites",
966
+ "query": ["level", "query"]
967
967
  },
968
- "integrations.google-drive.get-picker-token": {
968
+ "integrations.one-drive.get-site-libraries": {
969
969
  "method": "GET",
970
- "path": "/api/integrations/googledrive/picker_token",
971
- "query": ["level"]
970
+ "path": "/api/integrations/onedrive/sites/libraries",
971
+ "query": ["level", "siteId"]
972
972
  },
973
973
  "integrations.jira.get-pending-connection": {
974
974
  "method": "GET",
@@ -1133,7 +1133,8 @@
1133
1133
  "version": 2,
1134
1134
  "method": "GET",
1135
1135
  "path": "/api/proofs/audit/summary",
1136
- "chain": ["proofId"]
1136
+ "chain": ["proofId"],
1137
+ "query": ["allVersions"]
1137
1138
  },
1138
1139
  "proofs.audit.comments": {
1139
1140
  "version": 2,