@pageproof/sdk-pr 722.0.1788950260817 → 724.0.1789035190285
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.
|
@@ -101,6 +101,31 @@ declare class Integrations extends API {
|
|
|
101
101
|
id: string;
|
|
102
102
|
name: string;
|
|
103
103
|
}>>;
|
|
104
|
+
/**
|
|
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.
|
|
116
|
+
*
|
|
117
|
+
* @example <caption>Opening the Google Picker</caption>
|
|
118
|
+
* const admin = await client.admin();
|
|
119
|
+
* const { accessToken, appId, developerKey } = await admin.team.integrations.getGoogleDrivePickerToken();
|
|
120
|
+
*
|
|
121
|
+
* @since 2.26.0
|
|
122
|
+
* @returns {Promise<{ accessToken: string, appId: string, developerKey: string }>}
|
|
123
|
+
*/
|
|
124
|
+
getGoogleDrivePickerToken(): Promise<{
|
|
125
|
+
accessToken: string;
|
|
126
|
+
appId: string;
|
|
127
|
+
developerKey: string;
|
|
128
|
+
}>;
|
|
104
129
|
/**
|
|
105
130
|
* Gets the list of Jira sites associated with a pending connection so the user
|
|
106
131
|
* can pick which one to finalise the integration against.
|
package/lib/api/Integrations.js
CHANGED
|
@@ -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.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.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;
|
|
@@ -965,6 +965,11 @@
|
|
|
965
965
|
"path": "/api/integrations/dropbox/folders",
|
|
966
966
|
"query": ["level", "itemId"]
|
|
967
967
|
},
|
|
968
|
+
"integrations.google-drive.get-picker-token": {
|
|
969
|
+
"method": "GET",
|
|
970
|
+
"path": "/api/integrations/googledrive/picker_token",
|
|
971
|
+
"query": ["level"]
|
|
972
|
+
},
|
|
968
973
|
"integrations.jira.get-pending-connection": {
|
|
969
974
|
"method": "GET",
|
|
970
975
|
"path": "/api/integrations/jira/pending-connection",
|