synapse-react-client 3.0.33 → 3.0.34
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/dist/containers/UserCardSmall.js +18 -20
- package/dist/containers/UserCardSmall.js.map +1 -1
- package/dist/containers/download_list_v2/DownloadCartPage.js +10 -5
- package/dist/containers/download_list_v2/DownloadCartPage.js.map +1 -1
- package/dist/containers/entity_finder/EntityFinder.js.map +1 -1
- package/dist/containers/entity_finder/EntityFinderHeader.d.ts +21 -0
- package/dist/containers/entity_finder/EntityFinderHeader.js +3 -0
- package/dist/containers/entity_finder/EntityFinderHeader.js.map +1 -0
- package/dist/containers/entity_finder/details/EntityDetailsList.d.ts +5 -4
- package/dist/containers/entity_finder/details/EntityDetailsList.js.map +1 -1
- package/dist/containers/entity_finder/details/configurations/ProjectListDetails.d.ts +3 -0
- package/dist/containers/entity_finder/details/configurations/ProjectListDetails.js +6 -2
- package/dist/containers/entity_finder/details/configurations/ProjectListDetails.js.map +1 -1
- package/dist/containers/entity_finder/details/configurations/SearchDetails.js +13 -1
- package/dist/containers/entity_finder/details/configurations/SearchDetails.js.map +1 -1
- package/dist/containers/entity_finder/details/view/DetailsView.d.ts +4 -4
- package/dist/containers/entity_finder/details/view/DetailsView.js +1 -1
- package/dist/containers/entity_finder/details/view/DetailsView.js.map +1 -1
- package/dist/containers/entity_finder/tree/EntityTree.js +3 -3
- package/dist/containers/entity_finder/tree/EntityTree.js.map +1 -1
- package/dist/containers/entity_finder/tree/VirtualizedTree.d.ts +3 -3
- package/dist/containers/entity_finder/tree/VirtualizedTree.js +26 -3
- package/dist/containers/entity_finder/tree/VirtualizedTree.js.map +1 -1
- package/dist/containers/home_page/programs/Programs.js +8 -5
- package/dist/containers/home_page/programs/Programs.js.map +1 -1
- package/dist/containers/oauth/CreateOAuthClient.d.ts +12 -0
- package/dist/containers/oauth/CreateOAuthClient.js +204 -0
- package/dist/containers/oauth/CreateOAuthClient.js.map +1 -0
- package/dist/containers/oauth/OAuthManagement.d.ts +2 -0
- package/dist/containers/oauth/OAuthManagement.js +128 -0
- package/dist/containers/oauth/OAuthManagement.js.map +1 -0
- package/dist/containers/table/datasets/DatasetItemsEditor.js +1 -1
- package/dist/containers/table/datasets/DatasetItemsEditor.js.map +1 -1
- package/dist/style/base/_core.scss +0 -1
- package/dist/style/bootstrap4_backports/_base-import.scss +2 -0
- package/dist/style/bootstrap4_backports/_overrides.scss +7 -2
- package/dist/style/components/entity_finder/_tree-node-browse.scss +2 -1
- package/dist/style/components/entity_finder/_tree-view.scss +0 -3
- package/dist/style/main.css +7 -67
- package/dist/umd/synapse-react-client.development.css +7 -67
- package/dist/umd/synapse-react-client.development.css.map +2 -2
- package/dist/umd/synapse-react-client.development.js +1326 -782
- package/dist/umd/synapse-react-client.development.js.map +3 -3
- package/dist/umd/synapse-react-client.production.min.css +1 -1
- package/dist/umd/synapse-react-client.production.min.js +84 -84
- package/dist/umd.index.d.ts +1 -0
- package/dist/umd.index.js +2 -0
- package/dist/umd.index.js.map +1 -1
- package/dist/utils/SynapseClient.d.ts +12 -5
- package/dist/utils/SynapseClient.js +199 -210
- package/dist/utils/SynapseClient.js.map +1 -1
- package/dist/utils/functions/EntityTypeUtils.d.ts +1 -0
- package/dist/utils/functions/EntityTypeUtils.js +36 -7
- package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
- package/dist/utils/synapseTypes/Entity/Entity.d.ts +8 -5
- package/dist/utils/synapseTypes/Entity/Entity.js +5 -1
- package/dist/utils/synapseTypes/Entity/Entity.js.map +1 -1
- package/dist/utils/synapseTypes/OAuthClient.d.ts +8 -0
- package/dist/utils/synapseTypes/OAuthClient.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTeamList = exports.getUserTeamList = exports.getUserChallenges = exports.removeUserFavorite = exports.getUserFavorites = exports.getEntityWiki = exports.getEntityBundleV2 = exports.deleteEntity = exports.updateEntity = exports.getEntityHeader = exports.getEntityHeaders = exports.getEntityHeadersByIds = exports.getEntity = exports.getBulkFiles = exports.getFiles = exports.lookupChildEntity = exports.getEntityChildren = exports.getUserProfiles = exports.getGroupHeadersBatch = exports.getUserGroupHeaders = exports.updateMyUserProfile = exports.getMyUserBundle = exports.getUserBundle = exports.getUserProfileById = exports.getUserProfile = exports.createProject = exports.createEntity = exports.oAuthSessionRequest = exports.oAuthUrlRequest = exports.login = exports.getFullQueryTableResults = exports.getQueryTableResults = exports.getQueryTableAsyncJobResults = exports.getAsyncResultBodyFromJobId = exports.getAsyncResultFromJobId = exports.getFileHandleByIdURL = exports.getActualFileHandleByIdURL = exports.getFileHandleById = exports.getDownloadFromTableRequest = exports.getVersion = exports.doPut = exports.doDelete = exports.doGet = exports.doPost = exports.allowNotFoundError = exports.delay = exports.getRootURL = exports.SYNAPSE_STORAGE_LOCATION_ID = exports.ACCESS_TOKEN_COOKIE_KEY = exports.IS_OUTSIDE_SYNAPSE_ORG = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.purgeFromTrashCan = exports.restoreFromTrashCan = exports.getItemsInTrashCan = exports.getProfilePicPreviewPresignedUrl = exports.getActivityForEntity = exports.getApprovedSubmissionInfo = exports.searchAccessSubmission = exports.searchAccessApprovals = exports.forumSearch = exports.getThreadMessageUrl = exports.getThread = exports.getReplyMessageUrl = exports.getReply = exports.updateNotificationEmail = exports.deleteEmail = exports.addEmailAddressStep2 = exports.addEmailAddressStep1 = exports.resetPassword = exports.changePasswordWithToken = exports.changePasswordWithCurrentPassword = exports.createProfileVerificationSubmission = exports.signSynapseTermsOfUse = exports.unbindOAuthProviderToAccount = exports.bindOAuthProviderToAccount = exports.oAuthRegisterAccountStep2 = exports.registerAccountStep2 = exports.registerAccountStep1 = exports.isAliasAvailable = exports.getNotificationEmail = exports.updateEntityJson = void 0;
|
|
4
|
+
exports.createFormData = exports.updateFormACL = exports.getFormACL = exports.createFormGroup = exports.consentToOAuth2Request = exports.getAuthenticatedOn = exports.createOAuthClientSecret = exports.updateOAuthClient = exports.deleteOAuthClient = exports.createOAuthClient = exports.getOAuth2 = exports.getOAuth2Client = exports.hasUserAuthorizedOAuthClient = exports.getOAuth2RequestDescription = exports.getEvaluationSubmissions = exports.deleteEvaluationRound = exports.updateEvaluationRound = exports.createEvaluationRound = exports.getEvaluationRoundsList = exports.getEvaluationRound = exports.deleteEvaluation = exports.createEvaluation = exports.updateEvaluation = exports.getEvaluation = exports.getEvaluationPermissions = exports.submitToEvaluation = exports.createACL = exports.addFilesToDownloadListV2 = exports.createManifestFromDownloadListV2 = exports.createPackageFromDownloadListV2 = exports.addFileToDownloadListV2 = exports.getFileResult = exports.getFileHandleContent = exports.getFileHandleContentFromID = exports.startMultipartUpload = exports.checkUploadComplete = exports.uploadFile = exports.signOut = exports.detectSSOCode = exports.getPrincipalAliasRequest = exports.getUseUtcTimeFromCookie = exports.getAccessTokenFromCookie = exports.setAccessTokenCookie = exports.getStyleguideStack = exports.isInSynapseExperimentalMode = exports.getPresignedUrlForWikiAttachment = exports.getWikiAttachmentsFromEvaluation = exports.getWikiAttachmentsFromEntity = exports.getWikiPageKeyForAccessRequirement = exports.getWikiPageKeyForEntity = void 0;
|
|
5
|
+
exports.hasAccessToEntity = exports.getValidationSchema = exports.getSchema = exports.getSchemaValidationResults = exports.getSchemaBinding = exports.updateSubmissionStatus = exports.getSubmissionById = exports.cancelDataAccessRequest = exports.submitDataAccessRequest = exports.updateDataAccessRequest = exports.getDataAccessRequestForUpdate = exports.getResearchProject = exports.updateResearchProject = exports.removeItemFromDownloadListV2 = exports.getDownloadListActionsRequired = exports.getDownloadListStatistics = exports.getAvailableFilesToDownload = exports.clearDownloadListV2 = exports.searchEntities = exports.getEntityVersions = exports.getEntityPath = exports.getUserProjects = exports.getMyProjects = exports.deletePersonalAccessToken = exports.getPersonalAccessTokenRecords = exports.createPersonalAccessToken = exports.getTransformSqlWithFacetsRequest = exports.updateTable = exports.deleteDownloadList = exports.deleteDownloadListFiles = exports.getAllOfPaginatedService = exports.getDownloadOrder = exports.getDownloadList = exports.postAccessApproval = exports.getAccessApproval = exports.getAllAccessRequirements = exports.getAccessRequirementStatus = exports.searchAccessRequirements = exports.getAccessRequirementAcl = exports.getAccessRequirementById = exports.getAccessRequirement = exports.getRestrictionInformation = exports.getProjectStatistics = exports.rejectFormData = exports.acceptFormData = exports.listFormDataAsFormAdmin = exports.listFormData = exports.submitFormData = exports.deleteFormData = exports.updateFormData = void 0;
|
|
6
|
+
exports.purgeFromTrashCan = exports.restoreFromTrashCan = exports.getItemsInTrashCan = exports.getProfilePicPreviewPresignedUrl = exports.getActivityForEntity = exports.getApprovedSubmissionInfo = exports.searchAccessSubmission = exports.searchAccessApprovals = exports.forumSearch = exports.getThreadMessageUrl = exports.getThread = exports.getReplyMessageUrl = exports.getReply = exports.updateNotificationEmail = exports.deleteEmail = exports.addEmailAddressStep2 = exports.addEmailAddressStep1 = exports.resetPassword = exports.changePasswordWithToken = exports.changePasswordWithCurrentPassword = exports.createProfileVerificationSubmission = exports.signSynapseTermsOfUse = exports.unbindOAuthProviderToAccount = exports.bindOAuthProviderToAccount = exports.oAuthRegisterAccountStep2 = exports.registerAccountStep2 = exports.registerAccountStep1 = exports.isAliasAvailable = exports.getNotificationEmail = exports.updateEntityJson = exports.getEntityJson = void 0;
|
|
7
7
|
var tslib_1 = require("tslib");
|
|
8
8
|
var spark_md5_1 = tslib_1.__importDefault(require("spark-md5"));
|
|
9
9
|
var universal_cookie_1 = tslib_1.__importDefault(require("universal-cookie"));
|
|
@@ -146,85 +146,62 @@ var fetchWithExponentialTimeout = function (url, options, delayMs) {
|
|
|
146
146
|
});
|
|
147
147
|
});
|
|
148
148
|
};
|
|
149
|
-
var doPost = function (url, requestJsonObject, accessToken,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
headers: {
|
|
149
|
+
var doPost = function (url, requestJsonObject, accessToken, endpoint, additionalOptions) {
|
|
150
|
+
if (additionalOptions === void 0) { additionalOptions = {}; }
|
|
151
|
+
var options = tslib_1.__assign({ body: JSON.stringify(requestJsonObject), headers: {
|
|
153
152
|
Accept: '*/*',
|
|
154
153
|
'Access-Control-Request-Headers': 'authorization',
|
|
155
154
|
'Content-Type': 'application/json',
|
|
156
|
-
},
|
|
157
|
-
method: 'POST',
|
|
158
|
-
mode: 'cors',
|
|
159
|
-
credentials: initCredentials,
|
|
160
|
-
signal: signal,
|
|
161
|
-
};
|
|
155
|
+
}, method: 'POST', mode: 'cors' }, additionalOptions);
|
|
162
156
|
if (accessToken) {
|
|
163
|
-
|
|
164
|
-
options.headers.authorization = "Bearer ".concat(accessToken);
|
|
157
|
+
options.headers['authorization'] = "Bearer ".concat(accessToken);
|
|
165
158
|
}
|
|
166
159
|
var usedEndpoint = (0, getEndpoint_1.getEndpoint)(endpoint);
|
|
167
160
|
return fetchWithExponentialTimeout(usedEndpoint + url, options);
|
|
168
161
|
};
|
|
169
162
|
exports.doPost = doPost;
|
|
170
|
-
var doGet = function (url, accessToken,
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
var doGet = function (url, accessToken, endpoint, additionalOptions) {
|
|
164
|
+
if (additionalOptions === void 0) { additionalOptions = {}; }
|
|
165
|
+
var options = tslib_1.__assign({ headers: {
|
|
173
166
|
Accept: '*/*',
|
|
174
167
|
'Access-Control-Request-Headers': 'authorization',
|
|
175
|
-
},
|
|
176
|
-
method: 'GET',
|
|
177
|
-
mode: 'cors',
|
|
178
|
-
credentials: initCredentials,
|
|
179
|
-
};
|
|
168
|
+
}, method: 'GET', mode: 'cors' }, additionalOptions);
|
|
180
169
|
if (accessToken) {
|
|
181
|
-
|
|
182
|
-
options.headers.authorization = "Bearer ".concat(accessToken);
|
|
170
|
+
options.headers['authorization'] = "Bearer ".concat(accessToken);
|
|
183
171
|
}
|
|
184
172
|
var usedEndpoint = (0, getEndpoint_1.getEndpoint)(endpoint);
|
|
185
173
|
return fetchWithExponentialTimeout(usedEndpoint + url, options);
|
|
186
174
|
};
|
|
187
175
|
exports.doGet = doGet;
|
|
188
|
-
var doDelete = function (url, accessToken,
|
|
189
|
-
|
|
190
|
-
|
|
176
|
+
var doDelete = function (url, accessToken, endpoint, additionalOptions) {
|
|
177
|
+
if (additionalOptions === void 0) { additionalOptions = {}; }
|
|
178
|
+
var options = tslib_1.__assign({ headers: {
|
|
191
179
|
Accept: '*/*',
|
|
192
180
|
'Access-Control-Request-Headers': 'authorization',
|
|
193
|
-
},
|
|
194
|
-
method: 'DELETE',
|
|
195
|
-
mode: 'cors',
|
|
196
|
-
credentials: initCredentials,
|
|
197
|
-
};
|
|
181
|
+
}, method: 'DELETE', mode: 'cors' }, additionalOptions);
|
|
198
182
|
if (accessToken) {
|
|
199
|
-
|
|
200
|
-
options.headers.authorization = "Bearer ".concat(accessToken);
|
|
183
|
+
options.headers['authorization'] = "Bearer ".concat(accessToken);
|
|
201
184
|
}
|
|
202
185
|
var usedEndpoint = (0, getEndpoint_1.getEndpoint)(endpoint);
|
|
203
186
|
return fetchWithExponentialTimeout(usedEndpoint + url, options);
|
|
204
187
|
};
|
|
205
188
|
exports.doDelete = doDelete;
|
|
206
|
-
var doPut = function (url, requestJsonObject, accessToken,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
headers: {
|
|
189
|
+
var doPut = function (url, requestJsonObject, accessToken, endpoint, additionalOptions) {
|
|
190
|
+
if (additionalOptions === void 0) { additionalOptions = {}; }
|
|
191
|
+
var options = tslib_1.__assign({ body: JSON.stringify(requestJsonObject), headers: {
|
|
210
192
|
Accept: '*/*',
|
|
211
193
|
'Access-Control-Request-Headers': 'authorization',
|
|
212
194
|
'Content-Type': 'application/json',
|
|
213
|
-
},
|
|
214
|
-
method: 'PUT',
|
|
215
|
-
mode: 'cors',
|
|
216
|
-
credentials: initCredentials,
|
|
217
|
-
};
|
|
195
|
+
}, method: 'PUT', mode: 'cors' }, additionalOptions);
|
|
218
196
|
if (accessToken) {
|
|
219
|
-
|
|
220
|
-
options.headers.authorization = "Bearer ".concat(accessToken);
|
|
197
|
+
options.headers['authorization'] = "Bearer ".concat(accessToken);
|
|
221
198
|
}
|
|
222
199
|
var usedEndpoint = (0, getEndpoint_1.getEndpoint)(endpoint);
|
|
223
200
|
return fetchWithExponentialTimeout(usedEndpoint + url, options);
|
|
224
201
|
};
|
|
225
202
|
exports.doPut = doPut;
|
|
226
203
|
var getVersion = function () {
|
|
227
|
-
return (0, exports.doGet)('/repo/v1/version', undefined,
|
|
204
|
+
return (0, exports.doGet)('/repo/v1/version', undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
228
205
|
};
|
|
229
206
|
exports.getVersion = getVersion;
|
|
230
207
|
/**
|
|
@@ -236,7 +213,7 @@ var getDownloadFromTableRequest = function (request, accessToken) {
|
|
|
236
213
|
var asyncJobId;
|
|
237
214
|
return tslib_1.__generator(this, function (_a) {
|
|
238
215
|
switch (_a.label) {
|
|
239
|
-
case 0: return [4 /*yield*/, (0, exports.doPost)("/repo/v1/entity/".concat(request.entityId, "/table/download/csv/async/start"), request, accessToken,
|
|
216
|
+
case 0: return [4 /*yield*/, (0, exports.doPost)("/repo/v1/entity/".concat(request.entityId, "/table/download/csv/async/start"), request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
240
217
|
case 1:
|
|
241
218
|
asyncJobId = _a.sent();
|
|
242
219
|
return [2 /*return*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, "/repo/v1/entity/".concat(request.entityId, "/table/download/csv/async/get/").concat(asyncJobId.token), accessToken)];
|
|
@@ -253,7 +230,7 @@ exports.getDownloadFromTableRequest = getDownloadFromTableRequest;
|
|
|
253
230
|
**/
|
|
254
231
|
var getFileHandleById = function (handleId, accessToken) {
|
|
255
232
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
256
|
-
return (0, exports.doGet)("/file/v1/fileHandle/".concat(handleId), accessToken,
|
|
233
|
+
return (0, exports.doGet)("/file/v1/fileHandle/".concat(handleId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
257
234
|
};
|
|
258
235
|
exports.getFileHandleById = getFileHandleById;
|
|
259
236
|
/**
|
|
@@ -265,7 +242,7 @@ var getActualFileHandleByIdURL = function (handleId, accessToken, fileAssociateT
|
|
|
265
242
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
266
243
|
if (redirect === void 0) { redirect = true; }
|
|
267
244
|
// get the presigned URL for this file handle association.
|
|
268
|
-
return (0, exports.doGet)("/file/v1/file/".concat(handleId, "?fileAssociateType=").concat(fileAssociateType, "&fileAssociateId=").concat(fileAssociateId, "&redirect=").concat(redirect), accessToken,
|
|
245
|
+
return (0, exports.doGet)("/file/v1/file/".concat(handleId, "?fileAssociateType=").concat(fileAssociateType, "&fileAssociateId=").concat(fileAssociateId, "&redirect=").concat(redirect), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
269
246
|
};
|
|
270
247
|
exports.getActualFileHandleByIdURL = getActualFileHandleByIdURL;
|
|
271
248
|
/**
|
|
@@ -276,7 +253,7 @@ exports.getActualFileHandleByIdURL = getActualFileHandleByIdURL;
|
|
|
276
253
|
var getFileHandleByIdURL = function (handleId, accessToken) {
|
|
277
254
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
278
255
|
// get the presigned URL for this file handle
|
|
279
|
-
return (0, exports.doGet)("/file/v1/fileHandle/".concat(handleId, "/url?redirect=false"), accessToken,
|
|
256
|
+
return (0, exports.doGet)("/file/v1/fileHandle/".concat(handleId, "/url?redirect=false"), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
280
257
|
};
|
|
281
258
|
exports.getFileHandleByIdURL = getFileHandleByIdURL;
|
|
282
259
|
/**
|
|
@@ -291,7 +268,7 @@ var getAsyncResultFromJobId = function (asyncJobId, responseBodyEndpoint, access
|
|
|
291
268
|
var response, failureResponse;
|
|
292
269
|
return tslib_1.__generator(this, function (_a) {
|
|
293
270
|
switch (_a.label) {
|
|
294
|
-
case 0: return [4 /*yield*/, (0, exports.doGet)((0, APIConstants_1.ASYNCHRONOUS_JOB_TOKEN)(asyncJobId), accessToken,
|
|
271
|
+
case 0: return [4 /*yield*/, (0, exports.doGet)((0, APIConstants_1.ASYNCHRONOUS_JOB_TOKEN)(asyncJobId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
295
272
|
case 1:
|
|
296
273
|
response = _a.sent();
|
|
297
274
|
setCurrentAsyncStatus === null || setCurrentAsyncStatus === void 0 ? void 0 : setCurrentAsyncStatus(response);
|
|
@@ -301,14 +278,14 @@ var getAsyncResultFromJobId = function (asyncJobId, responseBodyEndpoint, access
|
|
|
301
278
|
return [4 /*yield*/, delay(500)];
|
|
302
279
|
case 3:
|
|
303
280
|
_a.sent();
|
|
304
|
-
return [4 /*yield*/, (0, exports.doGet)((0, APIConstants_1.ASYNCHRONOUS_JOB_TOKEN)(asyncJobId), accessToken,
|
|
281
|
+
return [4 /*yield*/, (0, exports.doGet)((0, APIConstants_1.ASYNCHRONOUS_JOB_TOKEN)(asyncJobId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
305
282
|
case 4:
|
|
306
283
|
response = _a.sent();
|
|
307
284
|
setCurrentAsyncStatus === null || setCurrentAsyncStatus === void 0 ? void 0 : setCurrentAsyncStatus(response);
|
|
308
285
|
return [3 /*break*/, 2];
|
|
309
286
|
case 5:
|
|
310
287
|
if (!(response.jobState === 'FAILED')) return [3 /*break*/, 7];
|
|
311
|
-
return [4 /*yield*/, (0, exports.doGet)(responseBodyEndpoint, accessToken,
|
|
288
|
+
return [4 /*yield*/, (0, exports.doGet)(responseBodyEndpoint, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
312
289
|
case 6:
|
|
313
290
|
failureResponse = _a.sent();
|
|
314
291
|
console.warn('SynapseClient.getAsyncResultFromJobId should have thrown an error, but instead retrieved the following response:', failureResponse);
|
|
@@ -346,7 +323,7 @@ var getQueryTableAsyncJobResults = function (queryBundleRequest, accessToken, se
|
|
|
346
323
|
var asyncJobId;
|
|
347
324
|
return tslib_1.__generator(this, function (_a) {
|
|
348
325
|
switch (_a.label) {
|
|
349
|
-
case 0: return [4 /*yield*/, (0, exports.doPost)((0, APIConstants_1.TABLE_QUERY_ASYNC_START)(queryBundleRequest.entityId), queryBundleRequest, accessToken,
|
|
326
|
+
case 0: return [4 /*yield*/, (0, exports.doPost)((0, APIConstants_1.TABLE_QUERY_ASYNC_START)(queryBundleRequest.entityId), queryBundleRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
350
327
|
case 1:
|
|
351
328
|
asyncJobId = _a.sent();
|
|
352
329
|
return [2 /*return*/, (0, exports.getAsyncResultFromJobId)(asyncJobId.token, (0, APIConstants_1.TABLE_QUERY_ASYNC_GET)(queryBundleRequest.entityId, asyncJobId.token), accessToken, setCurrentAsyncStatus)];
|
|
@@ -364,7 +341,7 @@ var getQueryTableResults = function (queryBundleRequest, accessToken) { return t
|
|
|
364
341
|
var asyncJobId;
|
|
365
342
|
return tslib_1.__generator(this, function (_a) {
|
|
366
343
|
switch (_a.label) {
|
|
367
|
-
case 0: return [4 /*yield*/, (0, exports.doPost)("/repo/v1/entity/".concat(queryBundleRequest.entityId, "/table/query/async/start"), queryBundleRequest, accessToken,
|
|
344
|
+
case 0: return [4 /*yield*/, (0, exports.doPost)("/repo/v1/entity/".concat(queryBundleRequest.entityId, "/table/query/async/start"), queryBundleRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
368
345
|
case 1:
|
|
369
346
|
asyncJobId = _a.sent();
|
|
370
347
|
return [2 /*return*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, "/repo/v1/entity/".concat(queryBundleRequest.entityId, "/table/query/async/get/").concat(asyncJobId.token), accessToken)];
|
|
@@ -432,7 +409,7 @@ exports.getFullQueryTableResults = getFullQueryTableResults;
|
|
|
432
409
|
*/
|
|
433
410
|
var login = function (username, password, authenticationReceipt, endpoint) {
|
|
434
411
|
if (endpoint === void 0) { endpoint = getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT; }
|
|
435
|
-
return (0, exports.doPost)('/auth/v1/login2', { username: username, password: password, authenticationReceipt: authenticationReceipt }, undefined,
|
|
412
|
+
return (0, exports.doPost)('/auth/v1/login2', { username: username, password: password, authenticationReceipt: authenticationReceipt }, undefined, endpoint);
|
|
436
413
|
};
|
|
437
414
|
exports.login = login;
|
|
438
415
|
/**
|
|
@@ -444,7 +421,7 @@ exports.login = login;
|
|
|
444
421
|
*/
|
|
445
422
|
var oAuthUrlRequest = function (provider, redirectUrl, state, endpoint) {
|
|
446
423
|
if (endpoint === void 0) { endpoint = getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT; }
|
|
447
|
-
return (0, exports.doPost)('/auth/v1/oauth2/authurl', { provider: provider, redirectUrl: redirectUrl, state: state }, undefined,
|
|
424
|
+
return (0, exports.doPost)('/auth/v1/oauth2/authurl', { provider: provider, redirectUrl: redirectUrl, state: state }, undefined, endpoint);
|
|
448
425
|
};
|
|
449
426
|
exports.oAuthUrlRequest = oAuthUrlRequest;
|
|
450
427
|
/**
|
|
@@ -457,7 +434,7 @@ exports.oAuthUrlRequest = oAuthUrlRequest;
|
|
|
457
434
|
*/
|
|
458
435
|
var oAuthSessionRequest = function (provider, authenticationCode, redirectUrl, endpoint) {
|
|
459
436
|
if (endpoint === void 0) { endpoint = getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT; }
|
|
460
|
-
return (0, exports.doPost)('/auth/v1/oauth2/session2', { provider: provider, authenticationCode: authenticationCode, redirectUrl: redirectUrl }, undefined,
|
|
437
|
+
return (0, exports.doPost)('/auth/v1/oauth2/session2', { provider: provider, authenticationCode: authenticationCode, redirectUrl: redirectUrl }, undefined, endpoint);
|
|
461
438
|
};
|
|
462
439
|
exports.oAuthSessionRequest = oAuthSessionRequest;
|
|
463
440
|
/**
|
|
@@ -465,7 +442,7 @@ exports.oAuthSessionRequest = oAuthSessionRequest;
|
|
|
465
442
|
* https://rest-docs.synapse.org/rest/POST/entity.html
|
|
466
443
|
*/
|
|
467
444
|
var createEntity = function (entity, accessToken) {
|
|
468
|
-
return (0, exports.doPost)(APIConstants_1.ENTITY, entity, accessToken,
|
|
445
|
+
return (0, exports.doPost)(APIConstants_1.ENTITY, entity, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
469
446
|
};
|
|
470
447
|
exports.createEntity = createEntity;
|
|
471
448
|
/**
|
|
@@ -484,7 +461,7 @@ exports.createProject = createProject;
|
|
|
484
461
|
* https://rest-docs.synapse.org/rest/GET/userProfile.html
|
|
485
462
|
*/
|
|
486
463
|
var getUserProfile = function (accessToken) {
|
|
487
|
-
return (0, exports.doGet)(APIConstants_1.USER_PROFILE, accessToken,
|
|
464
|
+
return (0, exports.doGet)(APIConstants_1.USER_PROFILE, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
488
465
|
};
|
|
489
466
|
exports.getUserProfile = getUserProfile;
|
|
490
467
|
/**
|
|
@@ -492,7 +469,7 @@ exports.getUserProfile = getUserProfile;
|
|
|
492
469
|
* https://rest-docs.synapse.org/rest/GET/userProfile.html
|
|
493
470
|
*/
|
|
494
471
|
var getUserProfileById = function (accessToken, ownerId) {
|
|
495
|
-
return (0, exports.doGet)((0, APIConstants_1.USER_PROFILE_ID)(ownerId), accessToken,
|
|
472
|
+
return (0, exports.doGet)((0, APIConstants_1.USER_PROFILE_ID)(ownerId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
496
473
|
};
|
|
497
474
|
exports.getUserProfileById = getUserProfileById;
|
|
498
475
|
/**
|
|
@@ -500,7 +477,7 @@ exports.getUserProfileById = getUserProfileById;
|
|
|
500
477
|
* https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/UserBundle.html
|
|
501
478
|
*/
|
|
502
479
|
var getUserBundle = function (id, mask, accessToken) {
|
|
503
|
-
return (0, exports.doGet)("".concat((0, APIConstants_1.USER_ID_BUNDLE)(id), "?mask=").concat(mask), accessToken,
|
|
480
|
+
return (0, exports.doGet)("".concat((0, APIConstants_1.USER_ID_BUNDLE)(id), "?mask=").concat(mask), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
504
481
|
};
|
|
505
482
|
exports.getUserBundle = getUserBundle;
|
|
506
483
|
/**
|
|
@@ -508,7 +485,7 @@ exports.getUserBundle = getUserBundle;
|
|
|
508
485
|
* http://rest-docs.synapse.org/rest/GET/user/bundle.html
|
|
509
486
|
*/
|
|
510
487
|
var getMyUserBundle = function (mask, accessToken) {
|
|
511
|
-
return (0, exports.doGet)("".concat(APIConstants_1.USER_BUNDLE, "?mask=").concat(mask), accessToken,
|
|
488
|
+
return (0, exports.doGet)("".concat(APIConstants_1.USER_BUNDLE, "?mask=").concat(mask), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
512
489
|
};
|
|
513
490
|
exports.getMyUserBundle = getMyUserBundle;
|
|
514
491
|
/**
|
|
@@ -520,7 +497,7 @@ exports.getMyUserBundle = getMyUserBundle;
|
|
|
520
497
|
var updateMyUserProfile = function (profile, accessToken) {
|
|
521
498
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
522
499
|
var url = '/repo/v1/userProfile';
|
|
523
|
-
return (0, exports.doPut)(url, profile, accessToken,
|
|
500
|
+
return (0, exports.doPut)(url, profile, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
524
501
|
};
|
|
525
502
|
exports.updateMyUserProfile = updateMyUserProfile;
|
|
526
503
|
/**
|
|
@@ -533,7 +510,7 @@ var getUserGroupHeaders = function (prefix, typeFilter, offset, limit) {
|
|
|
533
510
|
if (offset === void 0) { offset = 0; }
|
|
534
511
|
if (limit === void 0) { limit = 20; }
|
|
535
512
|
return (0, exports.doGet)(APIConstants_1.USER_GROUP_HEADERS +
|
|
536
|
-
"?prefix=".concat(prefix, "&typeFilter=").concat(typeFilter, "&offset=").concat(offset, "&limit=").concat(limit), undefined,
|
|
513
|
+
"?prefix=".concat(prefix, "&typeFilter=").concat(typeFilter, "&offset=").concat(offset, "&limit=").concat(limit), undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
537
514
|
};
|
|
538
515
|
exports.getUserGroupHeaders = getUserGroupHeaders;
|
|
539
516
|
/**
|
|
@@ -541,7 +518,7 @@ exports.getUserGroupHeaders = getUserGroupHeaders;
|
|
|
541
518
|
* https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/UserGroupHeaderResponsePage.html
|
|
542
519
|
*/
|
|
543
520
|
var getGroupHeadersBatch = function (ids, accessToken) {
|
|
544
|
-
return (0, exports.doGet)(APIConstants_1.USER_GROUP_HEADERS_BATCH + "?ids=".concat(ids.join(',')), accessToken,
|
|
521
|
+
return (0, exports.doGet)(APIConstants_1.USER_GROUP_HEADERS_BATCH + "?ids=".concat(ids.join(',')), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
545
522
|
};
|
|
546
523
|
exports.getGroupHeadersBatch = getGroupHeadersBatch;
|
|
547
524
|
/**
|
|
@@ -550,7 +527,7 @@ exports.getGroupHeadersBatch = getGroupHeadersBatch;
|
|
|
550
527
|
*/
|
|
551
528
|
var getUserProfiles = function (list, accessToken) {
|
|
552
529
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
553
|
-
return (0, exports.doPost)(APIConstants_1.USER_PROFILE, { list: list }, accessToken,
|
|
530
|
+
return (0, exports.doPost)(APIConstants_1.USER_PROFILE, { list: list }, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
554
531
|
};
|
|
555
532
|
exports.getUserProfiles = getUserProfiles;
|
|
556
533
|
/**
|
|
@@ -559,7 +536,7 @@ exports.getUserProfiles = getUserProfiles;
|
|
|
559
536
|
*/
|
|
560
537
|
var getEntityChildren = function (request, accessToken, signal) {
|
|
561
538
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
562
|
-
return (0, exports.doPost)('/repo/v1/entity/children', request, accessToken,
|
|
539
|
+
return (0, exports.doPost)('/repo/v1/entity/children', request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT, { signal: signal });
|
|
563
540
|
};
|
|
564
541
|
exports.getEntityChildren = getEntityChildren;
|
|
565
542
|
/**
|
|
@@ -568,7 +545,7 @@ exports.getEntityChildren = getEntityChildren;
|
|
|
568
545
|
*/
|
|
569
546
|
var lookupChildEntity = function (request, accessToken) {
|
|
570
547
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
571
|
-
return (0, exports.doPost)('/repo/v1/entity/child', request, accessToken,
|
|
548
|
+
return (0, exports.doPost)('/repo/v1/entity/child', request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
572
549
|
};
|
|
573
550
|
exports.lookupChildEntity = lookupChildEntity;
|
|
574
551
|
/**
|
|
@@ -577,7 +554,7 @@ exports.lookupChildEntity = lookupChildEntity;
|
|
|
577
554
|
*/
|
|
578
555
|
var getFiles = function (request, accessToken) {
|
|
579
556
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
580
|
-
return (0, exports.doPost)('/file/v1/fileHandle/batch', request, accessToken,
|
|
557
|
+
return (0, exports.doPost)('/file/v1/fileHandle/batch', request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
581
558
|
};
|
|
582
559
|
exports.getFiles = getFiles;
|
|
583
560
|
/**
|
|
@@ -590,7 +567,7 @@ var getBulkFiles = function (bulkFileDownloadRequest, accessToken) {
|
|
|
590
567
|
var asyncJobId;
|
|
591
568
|
return tslib_1.__generator(this, function (_a) {
|
|
592
569
|
switch (_a.label) {
|
|
593
|
-
case 0: return [4 /*yield*/, (0, exports.doPost)('/file/v1/file/bulk/async/start', bulkFileDownloadRequest, accessToken,
|
|
570
|
+
case 0: return [4 /*yield*/, (0, exports.doPost)('/file/v1/file/bulk/async/start', bulkFileDownloadRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
594
571
|
case 1:
|
|
595
572
|
asyncJobId = _a.sent();
|
|
596
573
|
return [2 /*return*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, "/file/v1/file/bulk/async/get/".concat(asyncJobId.token), accessToken)];
|
|
@@ -617,7 +594,7 @@ var getEntity = function (accessToken, entityId, versionNumber) {
|
|
|
617
594
|
var url = versionNumber
|
|
618
595
|
? "/repo/v1/entity/".concat(entityId, "/version/").concat(versionNumber)
|
|
619
596
|
: "/repo/v1/entity/".concat(entityId);
|
|
620
|
-
return (0, exports.doGet)(url, accessToken,
|
|
597
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
621
598
|
};
|
|
622
599
|
exports.getEntity = getEntity;
|
|
623
600
|
var getEntityHeadersByIds = function (entityIds, accessToken) {
|
|
@@ -642,7 +619,7 @@ var getEntityHeaders = function (references, accessToken) {
|
|
|
642
619
|
else
|
|
643
620
|
return reference;
|
|
644
621
|
});
|
|
645
|
-
return (0, exports.doPost)(APIConstants_1.ENTITY_HEADERS, { references: fixedReferences }, accessToken,
|
|
622
|
+
return (0, exports.doPost)(APIConstants_1.ENTITY_HEADERS, { references: fixedReferences }, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
646
623
|
};
|
|
647
624
|
exports.getEntityHeaders = getEntityHeaders;
|
|
648
625
|
/**
|
|
@@ -650,22 +627,22 @@ exports.getEntityHeaders = getEntityHeaders;
|
|
|
650
627
|
* https://rest-docs.synapse.org/rest/GET/entity/id/type.html
|
|
651
628
|
*/
|
|
652
629
|
var getEntityHeader = function (entityId, accessToken) {
|
|
653
|
-
return (0, exports.doGet)("/repo/v1/entity/".concat(entityId, "/type"), accessToken,
|
|
630
|
+
return (0, exports.doGet)("/repo/v1/entity/".concat(entityId, "/type"), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
654
631
|
};
|
|
655
632
|
exports.getEntityHeader = getEntityHeader;
|
|
656
633
|
var updateEntity = function (entity, accessToken) {
|
|
657
634
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
658
635
|
var url = "/repo/v1/entity/".concat(entity.id);
|
|
659
|
-
return (0, exports.doPut)(url, entity, accessToken,
|
|
636
|
+
return (0, exports.doPut)(url, entity, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
660
637
|
};
|
|
661
638
|
exports.updateEntity = updateEntity;
|
|
662
639
|
var deleteEntity = function (accessToken, entityId) {
|
|
663
640
|
if (accessToken === void 0) { accessToken = undefined; }
|
|
664
|
-
return (0, exports.doDelete)((0, APIConstants_1.ENTITY_ID)(entityId), accessToken,
|
|
641
|
+
return (0, exports.doDelete)((0, APIConstants_1.ENTITY_ID)(entityId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
665
642
|
};
|
|
666
643
|
exports.deleteEntity = deleteEntity;
|
|
667
644
|
var getEntityBundleV2 = function (entityId, requestObject, version, accessToken) {
|
|
668
|
-
return (0, exports.doPost)((0, APIConstants_1.ENTITY_BUNDLE_V2)(entityId, version), requestObject, accessToken,
|
|
645
|
+
return (0, exports.doPost)((0, APIConstants_1.ENTITY_BUNDLE_V2)(entityId, version), requestObject, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
669
646
|
};
|
|
670
647
|
exports.getEntityBundleV2 = getEntityBundleV2;
|
|
671
648
|
/**
|
|
@@ -683,7 +660,7 @@ var getEntityWiki = function (accessToken, ownerId, wikiId, objectType) {
|
|
|
683
660
|
if (objectType === void 0) { objectType = synapseTypes_1.ObjectType.ENTITY; }
|
|
684
661
|
var objectTypeString = getObjectTypeToString(objectType);
|
|
685
662
|
var url = "/repo/v1/".concat(objectTypeString === null || objectTypeString === void 0 ? void 0 : objectTypeString.toLocaleLowerCase(), "/").concat(ownerId, "/wiki/").concat(wikiId);
|
|
686
|
-
return (0, exports.doGet)(url, accessToken,
|
|
663
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
687
664
|
};
|
|
688
665
|
exports.getEntityWiki = getEntityWiki;
|
|
689
666
|
/**
|
|
@@ -695,7 +672,7 @@ var getUserFavorites = function (accessToken, offset, limit) {
|
|
|
695
672
|
if (limit === void 0) { limit = 200; }
|
|
696
673
|
// https://sagebionetworks.jira.com/browse/PLFM-6616
|
|
697
674
|
var url = "".concat(APIConstants_1.FAVORITES, "?offset=").concat(offset, "&limit=").concat(limit);
|
|
698
|
-
return (0, exports.doGet)(url, accessToken,
|
|
675
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
699
676
|
};
|
|
700
677
|
exports.getUserFavorites = getUserFavorites;
|
|
701
678
|
/**
|
|
@@ -703,7 +680,7 @@ exports.getUserFavorites = getUserFavorites;
|
|
|
703
680
|
* http://rest-docs.synapse.org/rest/DELETE/favorite/id.html
|
|
704
681
|
*/
|
|
705
682
|
var removeUserFavorite = function (entityId, accessToken) {
|
|
706
|
-
return (0, exports.doDelete)("/repo/v1/favorite/".concat(entityId), accessToken,
|
|
683
|
+
return (0, exports.doDelete)("/repo/v1/favorite/".concat(entityId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
707
684
|
};
|
|
708
685
|
exports.removeUserFavorite = removeUserFavorite;
|
|
709
686
|
/**
|
|
@@ -714,7 +691,7 @@ var getUserChallenges = function (accessToken, userId, offset, limit) {
|
|
|
714
691
|
if (offset === void 0) { offset = 0; }
|
|
715
692
|
if (limit === void 0) { limit = 200; }
|
|
716
693
|
var url = "/repo/v1/challenge?participantId=".concat(userId, "&offset=").concat(offset, "&limit=").concat(limit);
|
|
717
|
-
return (0, exports.doGet)(url, accessToken,
|
|
694
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
718
695
|
};
|
|
719
696
|
exports.getUserChallenges = getUserChallenges;
|
|
720
697
|
/**
|
|
@@ -726,7 +703,7 @@ var getUserTeamList = function (accessToken, userId, offset, limit) {
|
|
|
726
703
|
if (offset === void 0) { offset = 0; }
|
|
727
704
|
if (limit === void 0) { limit = 200; }
|
|
728
705
|
var url = "/repo/v1/user/".concat(userId, "/team?offset=").concat(offset, "&limit=").concat(limit);
|
|
729
|
-
return (0, exports.doGet)(url, accessToken,
|
|
706
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
730
707
|
};
|
|
731
708
|
exports.getUserTeamList = getUserTeamList;
|
|
732
709
|
/**
|
|
@@ -743,7 +720,7 @@ var getTeamList = function (accessToken, id, fragment, limit, offset) {
|
|
|
743
720
|
if (limit === void 0) { limit = 10; }
|
|
744
721
|
if (offset === void 0) { offset = 0; }
|
|
745
722
|
var url = "/repo/v1/teamMembers/".concat(id, "?limit=").concat(limit, "&offset=").concat(offset).concat(fragment ? "&fragment=".concat(fragment) : '');
|
|
746
|
-
return (0, exports.doGet)(url, accessToken,
|
|
723
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
747
724
|
};
|
|
748
725
|
exports.getTeamList = getTeamList;
|
|
749
726
|
/**
|
|
@@ -754,7 +731,7 @@ exports.getTeamList = getTeamList;
|
|
|
754
731
|
**/
|
|
755
732
|
var getWikiPageKeyForEntity = function (accessToken, ownerId) {
|
|
756
733
|
var url = "/repo/v1/entity/".concat(ownerId, "/wikikey");
|
|
757
|
-
return (0, exports.doGet)(url, accessToken,
|
|
734
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
758
735
|
};
|
|
759
736
|
exports.getWikiPageKeyForEntity = getWikiPageKeyForEntity;
|
|
760
737
|
/**
|
|
@@ -765,26 +742,26 @@ exports.getWikiPageKeyForEntity = getWikiPageKeyForEntity;
|
|
|
765
742
|
**/
|
|
766
743
|
var getWikiPageKeyForAccessRequirement = function (accessToken, ownerId) {
|
|
767
744
|
var url = (0, APIConstants_1.ACCESS_REQUIREMENT_WIKI_PAGE_KEY)(ownerId);
|
|
768
|
-
return (0, exports.doGet)(url, accessToken,
|
|
745
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
769
746
|
};
|
|
770
747
|
exports.getWikiPageKeyForAccessRequirement = getWikiPageKeyForAccessRequirement;
|
|
771
748
|
var getWikiAttachmentsFromEntity = function (accessToken, id, wikiId, objectType) {
|
|
772
749
|
if (objectType === void 0) { objectType = synapseTypes_1.ObjectType.ENTITY; }
|
|
773
750
|
var objectTypeString = getObjectTypeToString(objectType);
|
|
774
751
|
var url = "/repo/v1/".concat(objectTypeString.toLocaleLowerCase(), "/").concat(id, "/wiki2/").concat(wikiId, "/attachmenthandles");
|
|
775
|
-
return (0, exports.doGet)(url, accessToken,
|
|
752
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
776
753
|
};
|
|
777
754
|
exports.getWikiAttachmentsFromEntity = getWikiAttachmentsFromEntity;
|
|
778
755
|
var getWikiAttachmentsFromEvaluation = function (accessToken, id, wikiId) {
|
|
779
756
|
var url = "/repo/v1/evaluation/".concat(id, "/wiki/").concat(wikiId, "/attachmenthandles");
|
|
780
|
-
return (0, exports.doGet)(url, accessToken,
|
|
757
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
781
758
|
};
|
|
782
759
|
exports.getWikiAttachmentsFromEvaluation = getWikiAttachmentsFromEvaluation;
|
|
783
760
|
var getPresignedUrlForWikiAttachment = function (accessToken, id, wikiId, fileName, objectType) {
|
|
784
761
|
if (objectType === void 0) { objectType = synapseTypes_1.ObjectType.ENTITY; }
|
|
785
762
|
var objectTypeString = getObjectTypeToString(objectType);
|
|
786
763
|
var url = "/repo/v1/".concat(objectTypeString.toLocaleLowerCase(), "/").concat(id, "/wiki2/").concat(wikiId, "/attachment?fileName=").concat(fileName, "&redirect=false");
|
|
787
|
-
return (0, exports.doGet)(url, accessToken,
|
|
764
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
788
765
|
};
|
|
789
766
|
exports.getPresignedUrlForWikiAttachment = getPresignedUrlForWikiAttachment;
|
|
790
767
|
var isInSynapseExperimentalMode = function () {
|
|
@@ -827,16 +804,15 @@ var setAccessTokenCookie = function (token, sessionCallback) { return tslib_1.__
|
|
|
827
804
|
case 3:
|
|
828
805
|
sessionCallback();
|
|
829
806
|
return [3 /*break*/, 5];
|
|
830
|
-
case 4:
|
|
831
|
-
|
|
832
|
-
|
|
807
|
+
case 4:
|
|
808
|
+
// will set cookie in the http header
|
|
809
|
+
return [2 /*return*/, (0, exports.doPost)('Portal/sessioncookie', { sessionToken: token }, undefined, getEndpoint_1.BackendDestinationEnum.PORTAL_ENDPOINT, { credentials: 'include' })
|
|
833
810
|
.then(function (_) {
|
|
834
811
|
sessionCallback();
|
|
835
812
|
})
|
|
836
813
|
.catch(function (err) {
|
|
837
814
|
console.error('Error on setting access token ', err);
|
|
838
|
-
});
|
|
839
|
-
_a.label = 5;
|
|
815
|
+
})];
|
|
840
816
|
case 5: return [2 /*return*/];
|
|
841
817
|
}
|
|
842
818
|
});
|
|
@@ -851,7 +827,7 @@ var getAccessTokenFromCookie = function () { return tslib_1.__awaiter(void 0, vo
|
|
|
851
827
|
if (exports.IS_OUTSIDE_SYNAPSE_ORG) {
|
|
852
828
|
return [2 /*return*/, Promise.resolve(cookies.get(exports.ACCESS_TOKEN_COOKIE_KEY))];
|
|
853
829
|
}
|
|
854
|
-
return [2 /*return*/, (0, exports.doGet)('Portal/sessioncookie?validate=true', undefined,
|
|
830
|
+
return [2 /*return*/, (0, exports.doGet)('Portal/sessioncookie?validate=true', undefined, getEndpoint_1.BackendDestinationEnum.PORTAL_ENDPOINT, { credentials: 'include' })];
|
|
855
831
|
});
|
|
856
832
|
}); };
|
|
857
833
|
exports.getAccessTokenFromCookie = getAccessTokenFromCookie;
|
|
@@ -861,7 +837,7 @@ var getUseUtcTimeFromCookie = function () {
|
|
|
861
837
|
exports.getUseUtcTimeFromCookie = getUseUtcTimeFromCookie;
|
|
862
838
|
var getPrincipalAliasRequest = function (accessToken, alias, type) {
|
|
863
839
|
var url = '/repo/v1/principal/alias';
|
|
864
|
-
return (0, exports.doPost)(url, { alias: alias, type: type }, accessToken,
|
|
840
|
+
return (0, exports.doPost)(url, { alias: alias, type: type }, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
865
841
|
};
|
|
866
842
|
exports.getPrincipalAliasRequest = getPrincipalAliasRequest;
|
|
867
843
|
/*
|
|
@@ -1013,7 +989,7 @@ var processFilePart = function (partNumber, multipartUploadStatus, accessToken,
|
|
|
1013
989
|
partNumbers: [partNumber],
|
|
1014
990
|
};
|
|
1015
991
|
var presignedUrlUrl = "/file/v1/file/multipart/".concat(uploadId, "/presigned/url/batch");
|
|
1016
|
-
(0, exports.doPost)(presignedUrlUrl, presignedUploadUrlRequest, accessToken,
|
|
992
|
+
(0, exports.doPost)(presignedUrlUrl, presignedUploadUrlRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT).then(function (presignedUrlResponse) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
1017
993
|
var presignedUrl, startByte, endByte, fileSlice;
|
|
1018
994
|
return tslib_1.__generator(this, function (_a) {
|
|
1019
995
|
switch (_a.label) {
|
|
@@ -1033,7 +1009,7 @@ var processFilePart = function (partNumber, multipartUploadStatus, accessToken,
|
|
|
1033
1009
|
// uploaded the part. calculate md5 of the part and add the part to the upload
|
|
1034
1010
|
calculateMd5(fileSlice).then(function (md5) {
|
|
1035
1011
|
var addPartUrl = "/file/v1/file/multipart/".concat(uploadId, "/add/").concat(partNumber, "?partMD5Hex=").concat(md5);
|
|
1036
|
-
(0, exports.doPut)(addPartUrl, undefined, accessToken,
|
|
1012
|
+
(0, exports.doPut)(addPartUrl, undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT).then(function (addPartResponse) {
|
|
1037
1013
|
if (addPartResponse.addPartState === 'ADD_SUCCESS') {
|
|
1038
1014
|
// done with this part!
|
|
1039
1015
|
multipartUploadStatus.clientSidePartsState[partNumber - 1] = true;
|
|
@@ -1058,7 +1034,7 @@ var checkUploadComplete = function (status, fileHandleName, accessToken, fileUpl
|
|
|
1058
1034
|
return v;
|
|
1059
1035
|
})) {
|
|
1060
1036
|
var url = "/file/v1/file/multipart/".concat(status.uploadId, "/complete");
|
|
1061
|
-
(0, exports.doPut)(url, undefined, accessToken,
|
|
1037
|
+
(0, exports.doPut)(url, undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)
|
|
1062
1038
|
.then(function (newStatus) {
|
|
1063
1039
|
// success!
|
|
1064
1040
|
fileUploadResolve({
|
|
@@ -1097,7 +1073,7 @@ var uploadFilePart = function (presignedUrl, file, contentType) { return tslib_1
|
|
|
1097
1073
|
}); };
|
|
1098
1074
|
var startMultipartUpload = function (accessToken, fileName, file, request, fileUploadResolve, fileUploadReject) {
|
|
1099
1075
|
var url = '/file/v1/file/multipart';
|
|
1100
|
-
(0, exports.doPost)(url, request, accessToken,
|
|
1076
|
+
(0, exports.doPost)(url, request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)
|
|
1101
1077
|
.then(function (status) {
|
|
1102
1078
|
// started the upload
|
|
1103
1079
|
// keep track of the part state client-side
|
|
@@ -1211,7 +1187,7 @@ var addFileToDownloadListV2 = function (fileEntityId, versionNumber, accessToken
|
|
|
1211
1187
|
var request = {
|
|
1212
1188
|
batchToAdd: [{ fileEntityId: fileEntityId, versionNumber: versionNumber }],
|
|
1213
1189
|
};
|
|
1214
|
-
return (0, exports.doPost)('/repo/v1/download/list/add', request, accessToken,
|
|
1190
|
+
return (0, exports.doPost)('/repo/v1/download/list/add', request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1215
1191
|
};
|
|
1216
1192
|
exports.addFileToDownloadListV2 = addFileToDownloadListV2;
|
|
1217
1193
|
/**
|
|
@@ -1227,7 +1203,7 @@ var createPackageFromDownloadListV2 = function (zipFileName, accessToken) { retu
|
|
|
1227
1203
|
includeManifest: true,
|
|
1228
1204
|
concreteType: 'org.sagebionetworks.repo.model.download.DownloadListPackageRequest',
|
|
1229
1205
|
};
|
|
1230
|
-
return [4 /*yield*/, (0, exports.doPost)("/repo/v1/download/list/package/async/start", request, accessToken,
|
|
1206
|
+
return [4 /*yield*/, (0, exports.doPost)("/repo/v1/download/list/package/async/start", request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
1231
1207
|
case 1:
|
|
1232
1208
|
asyncJobId = _a.sent();
|
|
1233
1209
|
return [2 /*return*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, "/repo/v1/download/list/package/async/get/".concat(asyncJobId.token), accessToken)];
|
|
@@ -1249,7 +1225,7 @@ var createManifestFromDownloadListV2 = function (accessToken) {
|
|
|
1249
1225
|
csvTableDescriptor: {},
|
|
1250
1226
|
concreteType: 'org.sagebionetworks.repo.model.download.DownloadListManifestRequest',
|
|
1251
1227
|
};
|
|
1252
|
-
return [4 /*yield*/, (0, exports.doPost)("/repo/v1/download/list/manifest/async/start", request, accessToken,
|
|
1228
|
+
return [4 /*yield*/, (0, exports.doPost)("/repo/v1/download/list/manifest/async/start", request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
1253
1229
|
case 1:
|
|
1254
1230
|
asyncJobId = _a.sent();
|
|
1255
1231
|
return [2 /*return*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, "/repo/v1/download/list/manifest/async/get/".concat(asyncJobId.token), accessToken)];
|
|
@@ -1268,7 +1244,7 @@ var addFilesToDownloadListV2 = function (request, accessToken) {
|
|
|
1268
1244
|
var asyncJobId;
|
|
1269
1245
|
return tslib_1.__generator(this, function (_a) {
|
|
1270
1246
|
switch (_a.label) {
|
|
1271
|
-
case 0: return [4 /*yield*/, (0, exports.doPost)('/repo/v1/download/list/add/async/start', request, accessToken,
|
|
1247
|
+
case 0: return [4 /*yield*/, (0, exports.doPost)('/repo/v1/download/list/add/async/start', request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
1272
1248
|
case 1:
|
|
1273
1249
|
asyncJobId = _a.sent();
|
|
1274
1250
|
return [2 /*return*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, "/repo/v1/download/list/add/async/get/".concat(asyncJobId.token), accessToken)];
|
|
@@ -1282,7 +1258,7 @@ exports.addFilesToDownloadListV2 = addFilesToDownloadListV2;
|
|
|
1282
1258
|
* https://rest-docs.synapse.org/rest/POST/entity/id/acl.html
|
|
1283
1259
|
*/
|
|
1284
1260
|
var createACL = function (entityId, acl, accessToken) {
|
|
1285
|
-
return (0, exports.doPost)("/repo/v1/entity/".concat(entityId, "/acl"), acl, accessToken,
|
|
1261
|
+
return (0, exports.doPost)("/repo/v1/entity/".concat(entityId, "/acl"), acl, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1286
1262
|
};
|
|
1287
1263
|
exports.createACL = createACL;
|
|
1288
1264
|
/**
|
|
@@ -1290,11 +1266,11 @@ exports.createACL = createACL;
|
|
|
1290
1266
|
* https://rest-docs.synapse.org/rest/POST/evaluation/submission.html
|
|
1291
1267
|
*/
|
|
1292
1268
|
var submitToEvaluation = function (submission, etag, accessToken) {
|
|
1293
|
-
return (0, exports.doPost)("/repo/v1/evaluation/submission?etag=".concat(etag), submission, accessToken,
|
|
1269
|
+
return (0, exports.doPost)("/repo/v1/evaluation/submission?etag=".concat(etag), submission, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1294
1270
|
};
|
|
1295
1271
|
exports.submitToEvaluation = submitToEvaluation;
|
|
1296
1272
|
var getEvaluationPermissions = function (evalId, accessToken) {
|
|
1297
|
-
return (0, exports.doGet)("/repo/v1/evaluation/".concat(evalId, "/permissions"), accessToken,
|
|
1273
|
+
return (0, exports.doGet)("/repo/v1/evaluation/".concat(evalId, "/permissions"), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1298
1274
|
};
|
|
1299
1275
|
exports.getEvaluationPermissions = getEvaluationPermissions;
|
|
1300
1276
|
/**
|
|
@@ -1307,7 +1283,7 @@ var getEvaluation = function (evalId, accessToken) {
|
|
|
1307
1283
|
// without an evalId is a valid API that returns a different API response
|
|
1308
1284
|
return Promise.reject(new Error('evalId is empty'));
|
|
1309
1285
|
}
|
|
1310
|
-
return (0, exports.doGet)((0, APIConstants_1.EVALUATION_BY_ID)(evalId), accessToken,
|
|
1286
|
+
return (0, exports.doGet)((0, APIConstants_1.EVALUATION_BY_ID)(evalId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1311
1287
|
};
|
|
1312
1288
|
exports.getEvaluation = getEvaluation;
|
|
1313
1289
|
/**
|
|
@@ -1320,7 +1296,7 @@ var updateEvaluation = function (evaluation, accessToken) {
|
|
|
1320
1296
|
// without an evalId is a valid API that returns a different API response
|
|
1321
1297
|
return Promise.reject(new Error('evaluation does not have an ID'));
|
|
1322
1298
|
}
|
|
1323
|
-
return (0, exports.doPut)((0, APIConstants_1.EVALUATION_BY_ID)(evaluation.id), evaluation, accessToken,
|
|
1299
|
+
return (0, exports.doPut)((0, APIConstants_1.EVALUATION_BY_ID)(evaluation.id), evaluation, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1324
1300
|
};
|
|
1325
1301
|
exports.updateEvaluation = updateEvaluation;
|
|
1326
1302
|
/**
|
|
@@ -1328,7 +1304,7 @@ exports.updateEvaluation = updateEvaluation;
|
|
|
1328
1304
|
* https://rest-docs.synapse.org/rest/POST/evaluation.html
|
|
1329
1305
|
*/
|
|
1330
1306
|
var createEvaluation = function (evaluation, accessToken) {
|
|
1331
|
-
return (0, exports.doPost)(APIConstants_1.EVALUATION, evaluation, accessToken,
|
|
1307
|
+
return (0, exports.doPost)(APIConstants_1.EVALUATION, evaluation, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1332
1308
|
};
|
|
1333
1309
|
exports.createEvaluation = createEvaluation;
|
|
1334
1310
|
/**
|
|
@@ -1336,7 +1312,7 @@ exports.createEvaluation = createEvaluation;
|
|
|
1336
1312
|
* https://rest-docs.synapse.org/rest/PUT/evaluation/evalId.html
|
|
1337
1313
|
*/
|
|
1338
1314
|
var deleteEvaluation = function (evalId, accessToken) {
|
|
1339
|
-
return (0, exports.doDelete)("/repo/v1/evaluation/".concat(evalId), accessToken,
|
|
1315
|
+
return (0, exports.doDelete)("/repo/v1/evaluation/".concat(evalId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1340
1316
|
};
|
|
1341
1317
|
exports.deleteEvaluation = deleteEvaluation;
|
|
1342
1318
|
/**
|
|
@@ -1344,7 +1320,7 @@ exports.deleteEvaluation = deleteEvaluation;
|
|
|
1344
1320
|
* https://rest-docs.synapse.org/rest/GET/evaluation/evalId/round/evalRoundId.html
|
|
1345
1321
|
*/
|
|
1346
1322
|
var getEvaluationRound = function (evalId, evalRoundId, accessToken) {
|
|
1347
|
-
return (0, exports.doGet)("/repo/v1/evaluation/".concat(evalId, "/round/").concat(evalRoundId), accessToken,
|
|
1323
|
+
return (0, exports.doGet)("/repo/v1/evaluation/".concat(evalId, "/round/").concat(evalRoundId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1348
1324
|
};
|
|
1349
1325
|
exports.getEvaluationRound = getEvaluationRound;
|
|
1350
1326
|
/**
|
|
@@ -1352,7 +1328,7 @@ exports.getEvaluationRound = getEvaluationRound;
|
|
|
1352
1328
|
* https://rest-docs.synapse.org/rest/GET/evaluation/evalId/round/list.html
|
|
1353
1329
|
*/
|
|
1354
1330
|
var getEvaluationRoundsList = function (evalId, evaluationRoundListRequest, accessToken) {
|
|
1355
|
-
return (0, exports.doPost)("/repo/v1/evaluation/".concat(evalId, "/round/list"), evaluationRoundListRequest !== null && evaluationRoundListRequest !== void 0 ? evaluationRoundListRequest : {}, accessToken,
|
|
1331
|
+
return (0, exports.doPost)("/repo/v1/evaluation/".concat(evalId, "/round/list"), evaluationRoundListRequest !== null && evaluationRoundListRequest !== void 0 ? evaluationRoundListRequest : {}, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1356
1332
|
};
|
|
1357
1333
|
exports.getEvaluationRoundsList = getEvaluationRoundsList;
|
|
1358
1334
|
/**
|
|
@@ -1360,7 +1336,7 @@ exports.getEvaluationRoundsList = getEvaluationRoundsList;
|
|
|
1360
1336
|
* https://rest-docs.synapse.org/rest/POST/evaluation/evalId/round/evalRoundId.html
|
|
1361
1337
|
*/
|
|
1362
1338
|
var createEvaluationRound = function (evaluationRound, accessToken) {
|
|
1363
|
-
return (0, exports.doPost)("/repo/v1/evaluation/".concat(evaluationRound.evaluationId, "/round"), evaluationRound, accessToken,
|
|
1339
|
+
return (0, exports.doPost)("/repo/v1/evaluation/".concat(evaluationRound.evaluationId, "/round"), evaluationRound, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1364
1340
|
};
|
|
1365
1341
|
exports.createEvaluationRound = createEvaluationRound;
|
|
1366
1342
|
/**
|
|
@@ -1368,7 +1344,7 @@ exports.createEvaluationRound = createEvaluationRound;
|
|
|
1368
1344
|
* https://rest-docs.synapse.org/rest/PUT/evaluation/evalId/round/evalRoundId.html
|
|
1369
1345
|
*/
|
|
1370
1346
|
var updateEvaluationRound = function (evaluationRound, accessToken) {
|
|
1371
|
-
return (0, exports.doPut)("/repo/v1/evaluation/".concat(evaluationRound.evaluationId, "/round/").concat(evaluationRound.id), evaluationRound, accessToken,
|
|
1347
|
+
return (0, exports.doPut)("/repo/v1/evaluation/".concat(evaluationRound.evaluationId, "/round/").concat(evaluationRound.id), evaluationRound, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1372
1348
|
};
|
|
1373
1349
|
exports.updateEvaluationRound = updateEvaluationRound;
|
|
1374
1350
|
/**
|
|
@@ -1376,7 +1352,7 @@ exports.updateEvaluationRound = updateEvaluationRound;
|
|
|
1376
1352
|
* https://rest-docs.synapse.org/rest/DELETE/evaluation/evalId/round/evalRoundId.html
|
|
1377
1353
|
*/
|
|
1378
1354
|
var deleteEvaluationRound = function (evalId, evalRoundId, accessToken) {
|
|
1379
|
-
return (0, exports.doDelete)("/repo/v1/evaluation/".concat(evalId, "/round/").concat(evalRoundId), accessToken,
|
|
1355
|
+
return (0, exports.doDelete)("/repo/v1/evaluation/".concat(evalId, "/round/").concat(evalRoundId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1380
1356
|
};
|
|
1381
1357
|
exports.deleteEvaluationRound = deleteEvaluationRound;
|
|
1382
1358
|
/**
|
|
@@ -1384,7 +1360,7 @@ exports.deleteEvaluationRound = deleteEvaluationRound;
|
|
|
1384
1360
|
* https://rest-docs.synapse.org/rest/GET/evaluation/submission/query.html
|
|
1385
1361
|
*/
|
|
1386
1362
|
var getEvaluationSubmissions = function (query, accessToken) {
|
|
1387
|
-
return (0, exports.doGet)("/repo/v1/evaluation/submission/query?query=".concat(encodeURI(query)), accessToken,
|
|
1363
|
+
return (0, exports.doGet)("/repo/v1/evaluation/submission/query?query=".concat(encodeURI(query)), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1388
1364
|
};
|
|
1389
1365
|
exports.getEvaluationSubmissions = getEvaluationSubmissions;
|
|
1390
1366
|
/**
|
|
@@ -1392,8 +1368,7 @@ exports.getEvaluationSubmissions = getEvaluationSubmissions;
|
|
|
1392
1368
|
* http://rest-docs.synapse.org/rest/POST/oauth2/description.html
|
|
1393
1369
|
*/
|
|
1394
1370
|
var getOAuth2RequestDescription = function (oidcAuthRequest) {
|
|
1395
|
-
return (0, exports.doPost)('/auth/v1/oauth2/description', oidcAuthRequest, undefined,
|
|
1396
|
-
undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1371
|
+
return (0, exports.doPost)('/auth/v1/oauth2/description', oidcAuthRequest, undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1397
1372
|
};
|
|
1398
1373
|
exports.getOAuth2RequestDescription = getOAuth2RequestDescription;
|
|
1399
1374
|
/**
|
|
@@ -1401,21 +1376,21 @@ exports.getOAuth2RequestDescription = getOAuth2RequestDescription;
|
|
|
1401
1376
|
* Consent persists for one year.
|
|
1402
1377
|
*/
|
|
1403
1378
|
var hasUserAuthorizedOAuthClient = function (oidcAuthRequest, accessToken) {
|
|
1404
|
-
return (0, exports.doPost)('/auth/v1/oauth2/consentcheck', oidcAuthRequest, accessToken,
|
|
1379
|
+
return (0, exports.doPost)('/auth/v1/oauth2/consentcheck', oidcAuthRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1405
1380
|
};
|
|
1406
1381
|
exports.hasUserAuthorizedOAuthClient = hasUserAuthorizedOAuthClient;
|
|
1407
1382
|
/**
|
|
1408
1383
|
* Get OAuth2 Client information (available to the public)
|
|
1409
1384
|
*/
|
|
1410
1385
|
var getOAuth2Client = function (clientId) {
|
|
1411
|
-
return (0, exports.doGet)("/auth/v1/oauth2/client/".concat(clientId), undefined,
|
|
1386
|
+
return (0, exports.doGet)("/auth/v1/oauth2/client/".concat(clientId), undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1412
1387
|
};
|
|
1413
1388
|
exports.getOAuth2Client = getOAuth2Client;
|
|
1414
1389
|
/**
|
|
1415
1390
|
List the OAuth 2.0 clients created by the current user.
|
|
1416
1391
|
*/
|
|
1417
1392
|
var getOAuth2 = function (accessToken, nextPageToken) {
|
|
1418
|
-
return (0, exports.doGet)("/auth/v1/oauth2/client".concat(nextPageToken ? '?nextPageToken=' + nextPageToken : ''), accessToken,
|
|
1393
|
+
return (0, exports.doGet)("/auth/v1/oauth2/client".concat(nextPageToken ? '?nextPageToken=' + nextPageToken : ''), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1419
1394
|
};
|
|
1420
1395
|
exports.getOAuth2 = getOAuth2;
|
|
1421
1396
|
/**
|
|
@@ -1425,7 +1400,7 @@ Note: After creating the client one must also set the client secret and have the
|
|
|
1425
1400
|
https://rest-docs.synapse.org/rest/POST/oauth2/client.html
|
|
1426
1401
|
*/
|
|
1427
1402
|
var createOAuthClient = function (request, accessToken) {
|
|
1428
|
-
return (0, exports.doPost)('/auth/v1/oauth2/client', request, accessToken,
|
|
1403
|
+
return (0, exports.doPost)('/auth/v1/oauth2/client', request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1429
1404
|
};
|
|
1430
1405
|
exports.createOAuthClient = createOAuthClient;
|
|
1431
1406
|
/**
|
|
@@ -1433,7 +1408,7 @@ Delete OAuth 2.0 client
|
|
|
1433
1408
|
https://rest-docs.synapse.org/rest/DELETE/oauth2/client/id.html
|
|
1434
1409
|
*/
|
|
1435
1410
|
var deleteOAuthClient = function (id, accessToken) {
|
|
1436
|
-
return (0, exports.doDelete)("/auth/v1/oauth2/client/".concat(id), accessToken,
|
|
1411
|
+
return (0, exports.doDelete)("/auth/v1/oauth2/client/".concat(id), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1437
1412
|
};
|
|
1438
1413
|
exports.deleteOAuthClient = deleteOAuthClient;
|
|
1439
1414
|
/**
|
|
@@ -1443,15 +1418,25 @@ exports.deleteOAuthClient = deleteOAuthClient;
|
|
|
1443
1418
|
https://repo-prod.prod.sagebase.org/auth/v1/oauth2/client/{id}
|
|
1444
1419
|
*/
|
|
1445
1420
|
var updateOAuthClient = function (request, accessToken) {
|
|
1446
|
-
return (0, exports.doPut)("/auth/v1/oauth2/client/".concat(request.client_id), request, accessToken,
|
|
1421
|
+
return (0, exports.doPut)("/auth/v1/oauth2/client/".concat(request.client_id), request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1447
1422
|
};
|
|
1448
1423
|
exports.updateOAuthClient = updateOAuthClient;
|
|
1424
|
+
/**
|
|
1425
|
+
Get a secret credential to use when requesting an access token.
|
|
1426
|
+
Synapse supports 'client_secret_basic' and 'client_secret_post'.
|
|
1427
|
+
NOTE: This request will invalidate any previously issued secrets.
|
|
1428
|
+
https://docs.synapse.org/rest/POST/oauth2/client/secret/id.html
|
|
1429
|
+
*/
|
|
1430
|
+
var createOAuthClientSecret = function (accessToken, id) {
|
|
1431
|
+
return (0, exports.doPost)("/auth/v1/oauth2/client/secret/".concat(id), undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1432
|
+
};
|
|
1433
|
+
exports.createOAuthClientSecret = createOAuthClientSecret;
|
|
1449
1434
|
/**
|
|
1450
1435
|
* Get OAuth2 Client information (available to the public)
|
|
1451
1436
|
*/
|
|
1452
1437
|
var getAuthenticatedOn = function (accessToken) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
1453
1438
|
return tslib_1.__generator(this, function (_a) {
|
|
1454
|
-
return [2 /*return*/, (0, exports.doGet)("/auth/v1/authenticatedOn", accessToken,
|
|
1439
|
+
return [2 /*return*/, (0, exports.doGet)("/auth/v1/authenticatedOn", accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
1455
1440
|
});
|
|
1456
1441
|
}); };
|
|
1457
1442
|
exports.getAuthenticatedOn = getAuthenticatedOn;
|
|
@@ -1462,7 +1447,7 @@ exports.getAuthenticatedOn = getAuthenticatedOn;
|
|
|
1462
1447
|
* @param endpoint
|
|
1463
1448
|
*/
|
|
1464
1449
|
var consentToOAuth2Request = function (oidcAuthRequest, accessToken) {
|
|
1465
|
-
return (0, exports.doPost)('/auth/v1/oauth2/consent', oidcAuthRequest, accessToken,
|
|
1450
|
+
return (0, exports.doPost)('/auth/v1/oauth2/consent', oidcAuthRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1466
1451
|
};
|
|
1467
1452
|
exports.consentToOAuth2Request = consentToOAuth2Request;
|
|
1468
1453
|
/***********************
|
|
@@ -1477,7 +1462,7 @@ exports.consentToOAuth2Request = consentToOAuth2Request;
|
|
|
1477
1462
|
* @param endpoint
|
|
1478
1463
|
*/
|
|
1479
1464
|
var createFormGroup = function (name, accessToken) {
|
|
1480
|
-
return (0, exports.doPost)("/repo/v1/form/group?name=".concat(encodeURI(name)), undefined, accessToken,
|
|
1465
|
+
return (0, exports.doPost)("/repo/v1/form/group?name=".concat(encodeURI(name)), undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1481
1466
|
};
|
|
1482
1467
|
exports.createFormGroup = createFormGroup;
|
|
1483
1468
|
/**
|
|
@@ -1485,7 +1470,7 @@ exports.createFormGroup = createFormGroup;
|
|
|
1485
1470
|
* https://rest-docs.synapse.org/rest/GET/form/group/id/acl.html
|
|
1486
1471
|
*/
|
|
1487
1472
|
var getFormACL = function (formGroupId, accessToken) {
|
|
1488
|
-
return (0, exports.doGet)("/repo/v1/form/group/".concat(formGroupId, "/acl"), accessToken,
|
|
1473
|
+
return (0, exports.doGet)("/repo/v1/form/group/".concat(formGroupId, "/acl"), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1489
1474
|
};
|
|
1490
1475
|
exports.getFormACL = getFormACL;
|
|
1491
1476
|
/**
|
|
@@ -1493,7 +1478,7 @@ exports.getFormACL = getFormACL;
|
|
|
1493
1478
|
* https://rest-docs.synapse.org/rest/PUT/form/group/id/acl.html
|
|
1494
1479
|
*/
|
|
1495
1480
|
var updateFormACL = function (formGroupId, newAcl, accessToken) {
|
|
1496
|
-
return (0, exports.doPut)("/repo/v1/form/group/".concat(formGroupId, "/acl"), newAcl, accessToken,
|
|
1481
|
+
return (0, exports.doPut)("/repo/v1/form/group/".concat(formGroupId, "/acl"), newAcl, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1497
1482
|
};
|
|
1498
1483
|
exports.updateFormACL = updateFormACL;
|
|
1499
1484
|
/**
|
|
@@ -1509,7 +1494,7 @@ var createFormData = function (formGroupId, name, dataFileHandleId, accessToken)
|
|
|
1509
1494
|
name: name,
|
|
1510
1495
|
fileHandleId: dataFileHandleId,
|
|
1511
1496
|
};
|
|
1512
|
-
return (0, exports.doPost)("/repo/v1/form/data?groupId=".concat(formGroupId), newFormData, accessToken,
|
|
1497
|
+
return (0, exports.doPost)("/repo/v1/form/data?groupId=".concat(formGroupId), newFormData, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1513
1498
|
};
|
|
1514
1499
|
exports.createFormData = createFormData;
|
|
1515
1500
|
/**
|
|
@@ -1521,7 +1506,7 @@ var updateFormData = function (formDataId, name, dataFileHandleId, accessToken)
|
|
|
1521
1506
|
name: name,
|
|
1522
1507
|
fileHandleId: dataFileHandleId,
|
|
1523
1508
|
};
|
|
1524
|
-
return (0, exports.doPut)("/repo/v1/form/data/".concat(formDataId), updatedFormData, accessToken,
|
|
1509
|
+
return (0, exports.doPut)("/repo/v1/form/data/".concat(formDataId), updatedFormData, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1525
1510
|
};
|
|
1526
1511
|
exports.updateFormData = updateFormData;
|
|
1527
1512
|
/**
|
|
@@ -1529,7 +1514,7 @@ exports.updateFormData = updateFormData;
|
|
|
1529
1514
|
* https://rest-docs.synapse.org/rest/DELETE/form/data.html
|
|
1530
1515
|
*/
|
|
1531
1516
|
var deleteFormData = function (formDataId, accessToken) {
|
|
1532
|
-
return (0, exports.doDelete)("/repo/v1/form/data/".concat(formDataId), accessToken,
|
|
1517
|
+
return (0, exports.doDelete)("/repo/v1/form/data/".concat(formDataId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1533
1518
|
};
|
|
1534
1519
|
exports.deleteFormData = deleteFormData;
|
|
1535
1520
|
/**
|
|
@@ -1537,7 +1522,7 @@ exports.deleteFormData = deleteFormData;
|
|
|
1537
1522
|
* https://rest-docs.synapse.org/rest/POST/form/data/id/submit.html
|
|
1538
1523
|
*/
|
|
1539
1524
|
var submitFormData = function (formDataId, accessToken) {
|
|
1540
|
-
return (0, exports.doPost)("/repo/v1/form/data/".concat(formDataId, "/submit"), undefined, accessToken,
|
|
1525
|
+
return (0, exports.doPost)("/repo/v1/form/data/".concat(formDataId, "/submit"), undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1541
1526
|
};
|
|
1542
1527
|
exports.submitFormData = submitFormData;
|
|
1543
1528
|
/**
|
|
@@ -1546,7 +1531,7 @@ exports.submitFormData = submitFormData;
|
|
|
1546
1531
|
* https://rest-docs.synapse.org/rest/POST/form/data/list.html
|
|
1547
1532
|
*/
|
|
1548
1533
|
var listFormData = function (request, accessToken) {
|
|
1549
|
-
return (0, exports.doPost)("/repo/v1/form/data/list", request, accessToken,
|
|
1534
|
+
return (0, exports.doPost)("/repo/v1/form/data/list", request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1550
1535
|
};
|
|
1551
1536
|
exports.listFormData = listFormData;
|
|
1552
1537
|
/**
|
|
@@ -1555,7 +1540,7 @@ exports.listFormData = listFormData;
|
|
|
1555
1540
|
* https://rest-docs.synapse.org/rest/POST/form/data/list/reviewer.html
|
|
1556
1541
|
*/
|
|
1557
1542
|
var listFormDataAsFormAdmin = function (request, accessToken) {
|
|
1558
|
-
return (0, exports.doPost)("/repo/v1/form/data/list/reviewer", request, accessToken,
|
|
1543
|
+
return (0, exports.doPost)("/repo/v1/form/data/list/reviewer", request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1559
1544
|
};
|
|
1560
1545
|
exports.listFormDataAsFormAdmin = listFormDataAsFormAdmin;
|
|
1561
1546
|
/**
|
|
@@ -1563,7 +1548,7 @@ exports.listFormDataAsFormAdmin = listFormDataAsFormAdmin;
|
|
|
1563
1548
|
* https://rest-docs.synapse.org/rest/PUT/form/data/id/accept.html
|
|
1564
1549
|
*/
|
|
1565
1550
|
var acceptFormData = function (formDataId, accessToken) {
|
|
1566
|
-
return (0, exports.doPut)("/repo/v1/form/data/".concat(formDataId, "/accept"), undefined, accessToken,
|
|
1551
|
+
return (0, exports.doPut)("/repo/v1/form/data/".concat(formDataId, "/accept"), undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1567
1552
|
};
|
|
1568
1553
|
exports.acceptFormData = acceptFormData;
|
|
1569
1554
|
/**
|
|
@@ -1574,7 +1559,7 @@ var rejectFormData = function (formDataId, reason, accessToken) {
|
|
|
1574
1559
|
var formRejection = {
|
|
1575
1560
|
reason: reason,
|
|
1576
1561
|
};
|
|
1577
|
-
return (0, exports.doPut)("/repo/v1/form/data/".concat(formDataId, "/reject"), formRejection, accessToken,
|
|
1562
|
+
return (0, exports.doPut)("/repo/v1/form/data/".concat(formDataId, "/reject"), formRejection, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1578
1563
|
};
|
|
1579
1564
|
exports.rejectFormData = rejectFormData;
|
|
1580
1565
|
/**
|
|
@@ -1583,12 +1568,12 @@ exports.rejectFormData = rejectFormData;
|
|
|
1583
1568
|
* Generic endpoint to retrieve statistics about objects. The user should have VIEW_STATISTICS access on the object referenced by the objectId in the request.
|
|
1584
1569
|
*/
|
|
1585
1570
|
var getProjectStatistics = function (request, accessToken) {
|
|
1586
|
-
return (0, exports.doPost)("/repo/v1/statistics", request, accessToken,
|
|
1571
|
+
return (0, exports.doPost)("/repo/v1/statistics", request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1587
1572
|
};
|
|
1588
1573
|
exports.getProjectStatistics = getProjectStatistics;
|
|
1589
1574
|
// see https://rest-docs.synapse.org/rest/POST/restrictionInformation.html
|
|
1590
1575
|
var getRestrictionInformation = function (request, accessToken) {
|
|
1591
|
-
return (0, exports.doPost)("/repo/v1/restrictionInformation", request, accessToken,
|
|
1576
|
+
return (0, exports.doPost)("/repo/v1/restrictionInformation", request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1592
1577
|
};
|
|
1593
1578
|
exports.getRestrictionInformation = getRestrictionInformation;
|
|
1594
1579
|
/**
|
|
@@ -1606,7 +1591,7 @@ var getAccessRequirement = function (accessToken, id, limit, offset) {
|
|
|
1606
1591
|
if (limit === void 0) { limit = 50; }
|
|
1607
1592
|
if (offset === void 0) { offset = 0; }
|
|
1608
1593
|
var url = "/repo/v1/entity/".concat(id, "/accessRequirement?limit=").concat(limit, "&offset=").concat(offset);
|
|
1609
|
-
return (0, exports.doGet)(url, accessToken,
|
|
1594
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1610
1595
|
};
|
|
1611
1596
|
exports.getAccessRequirement = getAccessRequirement;
|
|
1612
1597
|
/**
|
|
@@ -1619,7 +1604,7 @@ exports.getAccessRequirement = getAccessRequirement;
|
|
|
1619
1604
|
* @returns {Promise<AccessRequirement>}
|
|
1620
1605
|
*/
|
|
1621
1606
|
var getAccessRequirementById = function (accessToken, id) {
|
|
1622
|
-
return (0, exports.doGet)((0, APIConstants_1.ACCESS_REQUIREMENT_BY_ID)(id), accessToken,
|
|
1607
|
+
return (0, exports.doGet)((0, APIConstants_1.ACCESS_REQUIREMENT_BY_ID)(id), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1623
1608
|
};
|
|
1624
1609
|
exports.getAccessRequirementById = getAccessRequirementById;
|
|
1625
1610
|
/**
|
|
@@ -1631,7 +1616,7 @@ exports.getAccessRequirementById = getAccessRequirementById;
|
|
|
1631
1616
|
var getAccessRequirementAcl = function (accessToken, id) {
|
|
1632
1617
|
// It's possible for an AR to not have an ACL, so pre-emptively handle 404
|
|
1633
1618
|
return allowNotFoundError(function () {
|
|
1634
|
-
return (0, exports.doGet)((0, APIConstants_1.ACCESS_REQUIREMENT_ACL)(id), accessToken,
|
|
1619
|
+
return (0, exports.doGet)((0, APIConstants_1.ACCESS_REQUIREMENT_ACL)(id), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1635
1620
|
});
|
|
1636
1621
|
};
|
|
1637
1622
|
exports.getAccessRequirementAcl = getAccessRequirementAcl;
|
|
@@ -1641,7 +1626,7 @@ exports.getAccessRequirementAcl = getAccessRequirementAcl;
|
|
|
1641
1626
|
* See http://rest-docs.synapse.org/rest/POST/accessRequirement/search.html
|
|
1642
1627
|
*/
|
|
1643
1628
|
var searchAccessRequirements = function (accessToken, request) {
|
|
1644
|
-
return (0, exports.doPost)(APIConstants_1.ACCESS_REQUIREMENT_SEARCH, request, accessToken,
|
|
1629
|
+
return (0, exports.doPost)(APIConstants_1.ACCESS_REQUIREMENT_SEARCH, request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1645
1630
|
};
|
|
1646
1631
|
exports.searchAccessRequirements = searchAccessRequirements;
|
|
1647
1632
|
/**
|
|
@@ -1651,7 +1636,7 @@ exports.searchAccessRequirements = searchAccessRequirements;
|
|
|
1651
1636
|
* @returns {AccessRequirementStatus}
|
|
1652
1637
|
*/
|
|
1653
1638
|
var getAccessRequirementStatus = function (accessToken, requirementId) {
|
|
1654
|
-
return (0, exports.doGet)((0, APIConstants_1.ACCESS_REQUIREMENT_STATUS)(requirementId), accessToken,
|
|
1639
|
+
return (0, exports.doGet)((0, APIConstants_1.ACCESS_REQUIREMENT_STATUS)(requirementId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1655
1640
|
};
|
|
1656
1641
|
exports.getAccessRequirementStatus = getAccessRequirementStatus;
|
|
1657
1642
|
/**
|
|
@@ -1666,7 +1651,7 @@ var getAllAccessRequirements = function (accessToken, id) {
|
|
|
1666
1651
|
// format function to be callable by getAllOfPaginatedService
|
|
1667
1652
|
var fn = function (limit, offset) {
|
|
1668
1653
|
var url = "/repo/v1/entity/".concat(id, "/accessRequirement?limit=").concat(limit, "&offset=").concat(offset);
|
|
1669
|
-
return (0, exports.doGet)(url, accessToken,
|
|
1654
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1670
1655
|
};
|
|
1671
1656
|
return (0, exports.getAllOfPaginatedService)(fn);
|
|
1672
1657
|
};
|
|
@@ -1682,7 +1667,7 @@ var getAccessApproval = function (accessToken, approvalId) { return tslib_1.__aw
|
|
|
1682
1667
|
var url;
|
|
1683
1668
|
return tslib_1.__generator(this, function (_a) {
|
|
1684
1669
|
url = "/repo/v1/accessApproval/".concat(approvalId);
|
|
1685
|
-
return [2 /*return*/, (0, exports.doGet)(url, accessToken,
|
|
1670
|
+
return [2 /*return*/, (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
1686
1671
|
});
|
|
1687
1672
|
}); };
|
|
1688
1673
|
exports.getAccessApproval = getAccessApproval;
|
|
@@ -1695,19 +1680,19 @@ exports.getAccessApproval = getAccessApproval;
|
|
|
1695
1680
|
*/
|
|
1696
1681
|
var postAccessApproval = function (accessToken, accessApproval) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
1697
1682
|
return tslib_1.__generator(this, function (_a) {
|
|
1698
|
-
return [2 /*return*/, (0, exports.doPost)('/repo/v1/accessApproval', accessApproval, accessToken,
|
|
1683
|
+
return [2 /*return*/, (0, exports.doPost)('/repo/v1/accessApproval', accessApproval, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
1699
1684
|
});
|
|
1700
1685
|
}); };
|
|
1701
1686
|
exports.postAccessApproval = postAccessApproval;
|
|
1702
1687
|
// https://rest-docs.synapse.org/rest/GET/download/list.html
|
|
1703
1688
|
var getDownloadList = function (accessToken) {
|
|
1704
|
-
return (0, exports.doGet)('/file/v1/download/list', accessToken,
|
|
1689
|
+
return (0, exports.doGet)('/file/v1/download/list', accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1705
1690
|
};
|
|
1706
1691
|
exports.getDownloadList = getDownloadList;
|
|
1707
1692
|
var getDownloadOrder = function (zipFileName, accessToken) {
|
|
1708
1693
|
var baseURL = '/file/v1/download/order';
|
|
1709
1694
|
var url = zipFileName ? "".concat(baseURL, "?zipFileName=").concat(zipFileName) : baseURL;
|
|
1710
|
-
return (0, exports.doPost)(url, undefined, accessToken,
|
|
1695
|
+
return (0, exports.doPost)(url, undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1711
1696
|
};
|
|
1712
1697
|
exports.getDownloadOrder = getDownloadOrder;
|
|
1713
1698
|
/**
|
|
@@ -1752,7 +1737,7 @@ var getAllOfPaginatedService = function (fn) { return tslib_1.__awaiter(void 0,
|
|
|
1752
1737
|
exports.getAllOfPaginatedService = getAllOfPaginatedService;
|
|
1753
1738
|
// https://rest-docs.synapse.org/rest/POST/download/list/remove.html
|
|
1754
1739
|
var deleteDownloadListFiles = function (list, accessToken) {
|
|
1755
|
-
return (0, exports.doPost)('/file/v1/download/list/remove', { list: list }, accessToken,
|
|
1740
|
+
return (0, exports.doPost)('/file/v1/download/list/remove', { list: list }, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT).then(function (data) {
|
|
1756
1741
|
(0, dispatchDownloadListChangeEvent_1.dispatchDownloadListChangeEvent)(data);
|
|
1757
1742
|
return data;
|
|
1758
1743
|
});
|
|
@@ -1760,7 +1745,7 @@ var deleteDownloadListFiles = function (list, accessToken) {
|
|
|
1760
1745
|
exports.deleteDownloadListFiles = deleteDownloadListFiles;
|
|
1761
1746
|
// https://rest-docs.synapse.org/rest/DELETE/download/list.html ?
|
|
1762
1747
|
var deleteDownloadList = function (accessToken) {
|
|
1763
|
-
return (0, exports.doDelete)('/file/v1/download/list', accessToken,
|
|
1748
|
+
return (0, exports.doDelete)('/file/v1/download/list', accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT).then(function (_) {
|
|
1764
1749
|
(0, dispatchDownloadListChangeEvent_1.dispatchDownloadListChangeEvent)(undefined);
|
|
1765
1750
|
});
|
|
1766
1751
|
};
|
|
@@ -1778,7 +1763,7 @@ var updateTable = function (tableUpdateRequest, accessToken) {
|
|
|
1778
1763
|
var asyncJobId;
|
|
1779
1764
|
return tslib_1.__generator(this, function (_a) {
|
|
1780
1765
|
switch (_a.label) {
|
|
1781
|
-
case 0: return [4 /*yield*/, (0, exports.doPost)("/repo/v1/entity/".concat(tableUpdateRequest.entityId, "/table/transaction/async/start"), tableUpdateRequest, accessToken,
|
|
1766
|
+
case 0: return [4 /*yield*/, (0, exports.doPost)("/repo/v1/entity/".concat(tableUpdateRequest.entityId, "/table/transaction/async/start"), tableUpdateRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
1782
1767
|
case 1:
|
|
1783
1768
|
asyncJobId = _a.sent();
|
|
1784
1769
|
return [2 /*return*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, "/repo/v1/entity/".concat(tableUpdateRequest.entityId, "/table/transaction/async/get/").concat(asyncJobId.token), accessToken)];
|
|
@@ -1788,51 +1773,50 @@ var updateTable = function (tableUpdateRequest, accessToken) {
|
|
|
1788
1773
|
};
|
|
1789
1774
|
exports.updateTable = updateTable;
|
|
1790
1775
|
var getTransformSqlWithFacetsRequest = function (transformSqlWithFacetsRequest) {
|
|
1791
|
-
return (0, exports.doPost)('/repo/v1/table/sql/transform', transformSqlWithFacetsRequest, undefined,
|
|
1792
|
-
undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1776
|
+
return (0, exports.doPost)('/repo/v1/table/sql/transform', transformSqlWithFacetsRequest, undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1793
1777
|
};
|
|
1794
1778
|
exports.getTransformSqlWithFacetsRequest = getTransformSqlWithFacetsRequest;
|
|
1795
1779
|
var createPersonalAccessToken = function (accessTokenGenerationRequest, accessToken) {
|
|
1796
|
-
return (0, exports.doPost)('/auth/v1/personalAccessToken', accessTokenGenerationRequest, accessToken,
|
|
1780
|
+
return (0, exports.doPost)('/auth/v1/personalAccessToken', accessTokenGenerationRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1797
1781
|
};
|
|
1798
1782
|
exports.createPersonalAccessToken = createPersonalAccessToken;
|
|
1799
1783
|
var getPersonalAccessTokenRecords = function (accessToken, nextPageToken) {
|
|
1800
|
-
return (0, exports.doGet)("/auth/v1/personalAccessToken".concat(nextPageToken ? '?nextPageToken=' + nextPageToken : ''), accessToken,
|
|
1784
|
+
return (0, exports.doGet)("/auth/v1/personalAccessToken".concat(nextPageToken ? '?nextPageToken=' + nextPageToken : ''), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1801
1785
|
};
|
|
1802
1786
|
exports.getPersonalAccessTokenRecords = getPersonalAccessTokenRecords;
|
|
1803
1787
|
var deletePersonalAccessToken = function (accessTokenId, accessToken) {
|
|
1804
|
-
return (0, exports.doDelete)("/auth/v1/personalAccessToken/".concat(accessTokenId), accessToken,
|
|
1788
|
+
return (0, exports.doDelete)("/auth/v1/personalAccessToken/".concat(accessTokenId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1805
1789
|
};
|
|
1806
1790
|
exports.deletePersonalAccessToken = deletePersonalAccessToken;
|
|
1807
1791
|
// https://rest-docs.synapse.org/rest/GET/projects.html
|
|
1808
1792
|
var getMyProjects = function (accessToken, params) {
|
|
1809
1793
|
if (params === void 0) { params = {}; }
|
|
1810
1794
|
var urlParams = new URLSearchParams((0, ObjectUtils_1.removeUndefined)(params));
|
|
1811
|
-
return (0, exports.doGet)("/repo/v1/projects?".concat(urlParams.toString()), accessToken,
|
|
1795
|
+
return (0, exports.doGet)("/repo/v1/projects?".concat(urlParams.toString()), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1812
1796
|
};
|
|
1813
1797
|
exports.getMyProjects = getMyProjects;
|
|
1814
1798
|
// http://rest-docs.synapse.org/rest/GET/projects/user/principalId.html
|
|
1815
1799
|
var getUserProjects = function (userId, params, accessToken) {
|
|
1816
1800
|
if (params === void 0) { params = {}; }
|
|
1817
1801
|
var urlParams = new URLSearchParams((0, ObjectUtils_1.removeUndefined)(params));
|
|
1818
|
-
return (0, exports.doGet)("/repo/v1/projects/user/".concat(userId, "?").concat(urlParams.toString()), accessToken,
|
|
1802
|
+
return (0, exports.doGet)("/repo/v1/projects/user/".concat(userId, "?").concat(urlParams.toString()), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1819
1803
|
};
|
|
1820
1804
|
exports.getUserProjects = getUserProjects;
|
|
1821
1805
|
// https://rest-docs.synapse.org/rest/GET/entity/id/path.html
|
|
1822
1806
|
var getEntityPath = function (entityId, accessToken) {
|
|
1823
|
-
return (0, exports.doGet)("/repo/v1/entity/".concat(entityId, "/path"), accessToken,
|
|
1807
|
+
return (0, exports.doGet)("/repo/v1/entity/".concat(entityId, "/path"), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1824
1808
|
};
|
|
1825
1809
|
exports.getEntityPath = getEntityPath;
|
|
1826
1810
|
// https://rest-docs.synapse.org/rest/GET/entity/id/version.html
|
|
1827
1811
|
var getEntityVersions = function (entityId, accessToken, offset, limit) {
|
|
1828
1812
|
if (offset === void 0) { offset = 0; }
|
|
1829
1813
|
if (limit === void 0) { limit = 200; }
|
|
1830
|
-
return (0, exports.doGet)("/repo/v1/entity/".concat(entityId, "/version?offset=").concat(offset, "&limit=").concat(limit), accessToken,
|
|
1814
|
+
return (0, exports.doGet)("/repo/v1/entity/".concat(entityId, "/version?offset=").concat(offset, "&limit=").concat(limit), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1831
1815
|
};
|
|
1832
1816
|
exports.getEntityVersions = getEntityVersions;
|
|
1833
1817
|
// https://rest-docs.synapse.org/rest/POST/search.html
|
|
1834
1818
|
var searchEntities = function (query, accessToken) {
|
|
1835
|
-
return (0, exports.doPost)('/repo/v1/search', query, accessToken,
|
|
1819
|
+
return (0, exports.doPost)('/repo/v1/search', query, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1836
1820
|
};
|
|
1837
1821
|
exports.searchEntities = searchEntities;
|
|
1838
1822
|
var getDownloadListJobResponse = function (accessToken, queryRequestDetails) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1844,7 +1828,7 @@ var getDownloadListJobResponse = function (accessToken, queryRequestDetails) { r
|
|
|
1844
1828
|
concreteType: 'org.sagebionetworks.repo.model.download.DownloadListQueryRequest',
|
|
1845
1829
|
requestDetails: queryRequestDetails,
|
|
1846
1830
|
};
|
|
1847
|
-
return [4 /*yield*/, (0, exports.doPost)('/repo/v1/download/list/query/async/start', downloadListQueryRequest, accessToken,
|
|
1831
|
+
return [4 /*yield*/, (0, exports.doPost)('/repo/v1/download/list/query/async/start', downloadListQueryRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
1848
1832
|
case 1:
|
|
1849
1833
|
asyncJobId = _a.sent();
|
|
1850
1834
|
return [4 /*yield*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, "/repo/v1/download/list/query/async/get/".concat(asyncJobId.token), accessToken)];
|
|
@@ -1859,7 +1843,7 @@ var getDownloadListJobResponse = function (accessToken, queryRequestDetails) { r
|
|
|
1859
1843
|
* http://rest-docs.synapse.org/rest/DELETE/download/list.html
|
|
1860
1844
|
*/
|
|
1861
1845
|
var clearDownloadListV2 = function (accessToken) {
|
|
1862
|
-
return (0, exports.doDelete)('/repo/v1/download/list', accessToken,
|
|
1846
|
+
return (0, exports.doDelete)('/repo/v1/download/list', accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1863
1847
|
};
|
|
1864
1848
|
exports.clearDownloadListV2 = clearDownloadListV2;
|
|
1865
1849
|
/**
|
|
@@ -1901,44 +1885,44 @@ var removeItemFromDownloadListV2 = function (item, accessToken) {
|
|
|
1901
1885
|
var request = {
|
|
1902
1886
|
batchToRemove: [item],
|
|
1903
1887
|
};
|
|
1904
|
-
return (0, exports.doPost)('/repo/v1/download/list/remove', request, accessToken,
|
|
1888
|
+
return (0, exports.doPost)('/repo/v1/download/list/remove', request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1905
1889
|
};
|
|
1906
1890
|
exports.removeItemFromDownloadListV2 = removeItemFromDownloadListV2;
|
|
1907
1891
|
// http://rest-docs.synapse.org/rest/POST/researchProject.html
|
|
1908
1892
|
var updateResearchProject = function (requestObj, accessToken) {
|
|
1909
|
-
return (0, exports.doPost)('/repo/v1/researchProject', requestObj, accessToken,
|
|
1893
|
+
return (0, exports.doPost)('/repo/v1/researchProject', requestObj, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1910
1894
|
};
|
|
1911
1895
|
exports.updateResearchProject = updateResearchProject;
|
|
1912
1896
|
// http://rest-docs.synapse.org/rest/GET/accessRequirement/requirementId/researchProjectForUpdate.html
|
|
1913
1897
|
var getResearchProject = function (requirementId, accessToken) {
|
|
1914
|
-
return (0, exports.doGet)("/repo/v1/accessRequirement/".concat(requirementId, "/researchProjectForUpdate"), accessToken,
|
|
1898
|
+
return (0, exports.doGet)("/repo/v1/accessRequirement/".concat(requirementId, "/researchProjectForUpdate"), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1915
1899
|
};
|
|
1916
1900
|
exports.getResearchProject = getResearchProject;
|
|
1917
1901
|
// http://rest-docs.synapse.org/rest/GET/accessRequirement/requirementId/dataAccessRequestForUpdate.html
|
|
1918
1902
|
var getDataAccessRequestForUpdate = function (requirementId, accessToken) {
|
|
1919
|
-
return (0, exports.doGet)("/repo/v1/accessRequirement/".concat(requirementId, "/dataAccessRequestForUpdate"), accessToken,
|
|
1903
|
+
return (0, exports.doGet)("/repo/v1/accessRequirement/".concat(requirementId, "/dataAccessRequestForUpdate"), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1920
1904
|
};
|
|
1921
1905
|
exports.getDataAccessRequestForUpdate = getDataAccessRequestForUpdate;
|
|
1922
1906
|
// http://rest-docs.synapse.org/rest/GET/accessRequirement/requirementId/dataAccessRequestForUpdate.html
|
|
1923
1907
|
var updateDataAccessRequest = function (requestObj, accessToken) {
|
|
1924
|
-
return (0, exports.doPost)("/repo/v1/dataAccessRequest", requestObj, accessToken,
|
|
1908
|
+
return (0, exports.doPost)("/repo/v1/dataAccessRequest", requestObj, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1925
1909
|
};
|
|
1926
1910
|
exports.updateDataAccessRequest = updateDataAccessRequest;
|
|
1927
1911
|
// http://rest-docs.synapse.org/rest/POST/dataAccessRequest/requestId/submission.html
|
|
1928
1912
|
var submitDataAccessRequest = function (requestObj, accessToken) {
|
|
1929
|
-
return (0, exports.doPost)("/repo/v1/dataAccessRequest/".concat(requestObj.requestId, "/submission"), requestObj, accessToken,
|
|
1913
|
+
return (0, exports.doPost)("/repo/v1/dataAccessRequest/".concat(requestObj.requestId, "/submission"), requestObj, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1930
1914
|
};
|
|
1931
1915
|
exports.submitDataAccessRequest = submitDataAccessRequest;
|
|
1932
1916
|
// http://rest-docs.synapse.org/rest/PUT/dataAccessSubmission/submissionId/cancellation.html
|
|
1933
1917
|
// Cancel a submission. Only the user who created this submission can cancel it.
|
|
1934
1918
|
var cancelDataAccessRequest = function (submissionId, accessToken) {
|
|
1935
|
-
return (0, exports.doPut)("/repo/v1/dataAccessSubmission/".concat(submissionId, "/cancellation"), undefined, accessToken,
|
|
1919
|
+
return (0, exports.doPut)("/repo/v1/dataAccessSubmission/".concat(submissionId, "/cancellation"), undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1936
1920
|
};
|
|
1937
1921
|
exports.cancelDataAccessRequest = cancelDataAccessRequest;
|
|
1938
1922
|
// http://rest-docs.synapse.org/rest/GET/dataAccessSubmission/submissionId.html
|
|
1939
1923
|
// Fetch a submission by its id. If the user is a not part of the ACT they must be validated and assigned as reviewers of the AR submissions in order to fetch the submission.
|
|
1940
1924
|
var getSubmissionById = function (submissionId, accessToken) {
|
|
1941
|
-
return (0, exports.doGet)((0, APIConstants_1.DATA_ACCESS_SUBMISSION_BY_ID)(submissionId), accessToken,
|
|
1925
|
+
return (0, exports.doGet)((0, APIConstants_1.DATA_ACCESS_SUBMISSION_BY_ID)(submissionId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1942
1926
|
};
|
|
1943
1927
|
exports.getSubmissionById = getSubmissionById;
|
|
1944
1928
|
/**
|
|
@@ -1951,7 +1935,7 @@ exports.getSubmissionById = getSubmissionById;
|
|
|
1951
1935
|
* @returns
|
|
1952
1936
|
*/
|
|
1953
1937
|
var updateSubmissionStatus = function (request, accessToken) {
|
|
1954
|
-
return (0, exports.doPut)((0, APIConstants_1.DATA_ACCESS_SUBMISSION_BY_ID)(request.submissionId), request, accessToken,
|
|
1938
|
+
return (0, exports.doPut)((0, APIConstants_1.DATA_ACCESS_SUBMISSION_BY_ID)(request.submissionId), request, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1955
1939
|
};
|
|
1956
1940
|
exports.updateSubmissionStatus = updateSubmissionStatus;
|
|
1957
1941
|
/**
|
|
@@ -1964,7 +1948,7 @@ exports.updateSubmissionStatus = updateSubmissionStatus;
|
|
|
1964
1948
|
//
|
|
1965
1949
|
var getSchemaBinding = function (entityId, accessToken) {
|
|
1966
1950
|
return allowNotFoundError(function () {
|
|
1967
|
-
return (0, exports.doGet)((0, APIConstants_1.ENTITY_SCHEMA_BINDING)(entityId), accessToken,
|
|
1951
|
+
return (0, exports.doGet)((0, APIConstants_1.ENTITY_SCHEMA_BINDING)(entityId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1968
1952
|
});
|
|
1969
1953
|
};
|
|
1970
1954
|
exports.getSchemaBinding = getSchemaBinding;
|
|
@@ -1976,7 +1960,7 @@ exports.getSchemaBinding = getSchemaBinding;
|
|
|
1976
1960
|
* @returns
|
|
1977
1961
|
*/
|
|
1978
1962
|
var getSchemaValidationResults = function (entityId, accessToken) {
|
|
1979
|
-
return (0, exports.doGet)((0, APIConstants_1.ENTITY_SCHEMA_VALIDATION)(entityId), accessToken,
|
|
1963
|
+
return (0, exports.doGet)((0, APIConstants_1.ENTITY_SCHEMA_VALIDATION)(entityId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1980
1964
|
};
|
|
1981
1965
|
exports.getSchemaValidationResults = getSchemaValidationResults;
|
|
1982
1966
|
/**
|
|
@@ -1985,7 +1969,7 @@ exports.getSchemaValidationResults = getSchemaValidationResults;
|
|
|
1985
1969
|
* @returns
|
|
1986
1970
|
*/
|
|
1987
1971
|
var getSchema = function (schema$id) {
|
|
1988
|
-
return (0, exports.doGet)("".concat((0, APIConstants_1.REGISTERED_SCHEMA_ID)(schema$id)), undefined,
|
|
1972
|
+
return (0, exports.doGet)("".concat((0, APIConstants_1.REGISTERED_SCHEMA_ID)(schema$id)), undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
1989
1973
|
};
|
|
1990
1974
|
exports.getSchema = getSchema;
|
|
1991
1975
|
/**
|
|
@@ -2000,7 +1984,7 @@ var getValidationSchema = function (schema$id, accessToken) { return tslib_1.__a
|
|
|
2000
1984
|
case 0: return [4 /*yield*/, (0, exports.doPost)(APIConstants_1.SCHEMA_VALIDATION_START, {
|
|
2001
1985
|
concreteType: 'org.sagebionetworks.repo.model.schema.GetValidationSchemaRequest',
|
|
2002
1986
|
$id: schema$id,
|
|
2003
|
-
}, accessToken,
|
|
1987
|
+
}, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
2004
1988
|
case 1:
|
|
2005
1989
|
asyncJobId = _a.sent();
|
|
2006
1990
|
return [2 /*return*/, (0, exports.getAsyncResultBodyFromJobId)(asyncJobId.token, (0, APIConstants_1.SCHEMA_VALIDATION_GET)(asyncJobId.token), accessToken)];
|
|
@@ -2016,7 +2000,7 @@ exports.getValidationSchema = getValidationSchema;
|
|
|
2016
2000
|
* @returns
|
|
2017
2001
|
*/
|
|
2018
2002
|
var hasAccessToEntity = function (entityId, accessType, accessToken) {
|
|
2019
|
-
return (0, exports.doGet)("".concat((0, APIConstants_1.ENTITY_ACCESS)(entityId), "?accessType=").concat(accessType), accessToken,
|
|
2003
|
+
return (0, exports.doGet)("".concat((0, APIConstants_1.ENTITY_ACCESS)(entityId), "?accessType=").concat(accessType), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2020
2004
|
};
|
|
2021
2005
|
exports.hasAccessToEntity = hasAccessToEntity;
|
|
2022
2006
|
/**
|
|
@@ -2027,7 +2011,7 @@ exports.hasAccessToEntity = hasAccessToEntity;
|
|
|
2027
2011
|
* @returns
|
|
2028
2012
|
*/
|
|
2029
2013
|
var getEntityJson = function (entityId, accessToken) {
|
|
2030
|
-
return (0, exports.doGet)((0, APIConstants_1.ENTITY_JSON)(entityId), accessToken,
|
|
2014
|
+
return (0, exports.doGet)((0, APIConstants_1.ENTITY_JSON)(entityId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2031
2015
|
};
|
|
2032
2016
|
exports.getEntityJson = getEntityJson;
|
|
2033
2017
|
/**
|
|
@@ -2038,7 +2022,7 @@ exports.getEntityJson = getEntityJson;
|
|
|
2038
2022
|
* @returns
|
|
2039
2023
|
*/
|
|
2040
2024
|
var updateEntityJson = function (entityId, json, accessToken) {
|
|
2041
|
-
return (0, exports.doPut)((0, APIConstants_1.ENTITY_JSON)(entityId), json, accessToken,
|
|
2025
|
+
return (0, exports.doPut)((0, APIConstants_1.ENTITY_JSON)(entityId), json, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2042
2026
|
};
|
|
2043
2027
|
exports.updateEntityJson = updateEntityJson;
|
|
2044
2028
|
/**
|
|
@@ -2048,22 +2032,22 @@ exports.updateEntityJson = updateEntityJson;
|
|
|
2048
2032
|
* https://docs.synapse.org/rest/GET/notificationEmail.html
|
|
2049
2033
|
*/
|
|
2050
2034
|
var getNotificationEmail = function (accessToken) {
|
|
2051
|
-
return (0, exports.doGet)(APIConstants_1.NOTIFICATION_EMAIL, accessToken,
|
|
2035
|
+
return (0, exports.doGet)(APIConstants_1.NOTIFICATION_EMAIL, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2052
2036
|
};
|
|
2053
2037
|
exports.getNotificationEmail = getNotificationEmail;
|
|
2054
2038
|
// http://rest-docs.synapse.org/rest/POST/principal/available.html
|
|
2055
2039
|
var isAliasAvailable = function (aliasCheckRequest, accessToken) {
|
|
2056
|
-
return (0, exports.doPost)(APIConstants_1.ALIAS_AVAILABLE, aliasCheckRequest, accessToken,
|
|
2040
|
+
return (0, exports.doPost)(APIConstants_1.ALIAS_AVAILABLE, aliasCheckRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2057
2041
|
};
|
|
2058
2042
|
exports.isAliasAvailable = isAliasAvailable;
|
|
2059
2043
|
// http://rest-docs.synapse.org/rest/POST/account/emailValidation.html
|
|
2060
2044
|
var registerAccountStep1 = function (newUser, portalEndpoint) {
|
|
2061
|
-
return (0, exports.doPost)((0, APIConstants_1.REGISTER_ACCOUNT_STEP_1)(portalEndpoint), newUser, undefined,
|
|
2045
|
+
return (0, exports.doPost)((0, APIConstants_1.REGISTER_ACCOUNT_STEP_1)(portalEndpoint), newUser, undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2062
2046
|
};
|
|
2063
2047
|
exports.registerAccountStep1 = registerAccountStep1;
|
|
2064
2048
|
// http://rest-docs.synapse.org/rest/POST/account2.html
|
|
2065
2049
|
var registerAccountStep2 = function (accountSetupInfo) {
|
|
2066
|
-
return (0, exports.doPost)(APIConstants_1.REGISTER_ACCOUNT_STEP_2, accountSetupInfo, undefined,
|
|
2050
|
+
return (0, exports.doPost)(APIConstants_1.REGISTER_ACCOUNT_STEP_2, accountSetupInfo, undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2067
2051
|
};
|
|
2068
2052
|
exports.registerAccountStep2 = registerAccountStep2;
|
|
2069
2053
|
/**
|
|
@@ -2076,7 +2060,12 @@ exports.registerAccountStep2 = registerAccountStep2;
|
|
|
2076
2060
|
*/
|
|
2077
2061
|
var oAuthRegisterAccountStep2 = function (userName, provider, authenticationCode, redirectUrl, endpoint) {
|
|
2078
2062
|
if (endpoint === void 0) { endpoint = getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT; }
|
|
2079
|
-
return (0, exports.doPost)('/auth/v1/oauth2/account2', {
|
|
2063
|
+
return (0, exports.doPost)('/auth/v1/oauth2/account2', {
|
|
2064
|
+
provider: provider,
|
|
2065
|
+
authenticationCode: authenticationCode,
|
|
2066
|
+
redirectUrl: redirectUrl,
|
|
2067
|
+
userName: userName,
|
|
2068
|
+
}, undefined, endpoint);
|
|
2080
2069
|
};
|
|
2081
2070
|
exports.oAuthRegisterAccountStep2 = oAuthRegisterAccountStep2;
|
|
2082
2071
|
/**
|
|
@@ -2096,7 +2085,7 @@ var bindOAuthProviderToAccount = function (provider, authenticationCode, redirec
|
|
|
2096
2085
|
case 0: return [4 /*yield*/, (0, exports.getAccessTokenFromCookie)()];
|
|
2097
2086
|
case 1:
|
|
2098
2087
|
accessToken = _a.sent();
|
|
2099
|
-
return [2 /*return*/, (0, exports.doPost)('/auth/v1/oauth2/alias', { provider: provider, authenticationCode: authenticationCode, redirectUrl: redirectUrl }, accessToken,
|
|
2088
|
+
return [2 /*return*/, (0, exports.doPost)('/auth/v1/oauth2/alias', { provider: provider, authenticationCode: authenticationCode, redirectUrl: redirectUrl }, accessToken, endpoint)];
|
|
2100
2089
|
}
|
|
2101
2090
|
});
|
|
2102
2091
|
});
|
|
@@ -2113,35 +2102,35 @@ var unbindOAuthProviderToAccount = function (provider, accessToken, alias) { ret
|
|
|
2113
2102
|
var url;
|
|
2114
2103
|
return tslib_1.__generator(this, function (_a) {
|
|
2115
2104
|
url = "/auth/v1/oauth2/alias?provider=".concat(provider, "&alias=").concat(encodeURIComponent(alias));
|
|
2116
|
-
return [2 /*return*/, (0, exports.doDelete)(url, accessToken,
|
|
2105
|
+
return [2 /*return*/, (0, exports.doDelete)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT)];
|
|
2117
2106
|
});
|
|
2118
2107
|
}); };
|
|
2119
2108
|
exports.unbindOAuthProviderToAccount = unbindOAuthProviderToAccount;
|
|
2120
2109
|
//http://rest-docs.synapse.org/rest/POST/termsOfUse2.html
|
|
2121
2110
|
var signSynapseTermsOfUse = function (accessToken) {
|
|
2122
|
-
return (0, exports.doPost)(APIConstants_1.SIGN_TERMS_OF_USE, { accessToken: accessToken }, undefined,
|
|
2111
|
+
return (0, exports.doPost)(APIConstants_1.SIGN_TERMS_OF_USE, { accessToken: accessToken }, undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2123
2112
|
};
|
|
2124
2113
|
exports.signSynapseTermsOfUse = signSynapseTermsOfUse;
|
|
2125
2114
|
//https://rest-docs.synapse.org/rest/POST/verificationSubmission.html
|
|
2126
2115
|
var createProfileVerificationSubmission = function (verificationSubmission, accessToken) {
|
|
2127
|
-
return (0, exports.doPost)(APIConstants_1.VERIFICATION_SUBMISSION, verificationSubmission, accessToken,
|
|
2116
|
+
return (0, exports.doPost)(APIConstants_1.VERIFICATION_SUBMISSION, verificationSubmission, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2128
2117
|
};
|
|
2129
2118
|
exports.createProfileVerificationSubmission = createProfileVerificationSubmission;
|
|
2130
2119
|
// https://rest-docs.synapse.org/rest/POST/user/changePassword.html
|
|
2131
2120
|
var changePasswordWithCurrentPassword = function (newPassword, accessToken) {
|
|
2132
|
-
return (0, exports.doPost)('/auth/v1/user/changePassword', newPassword, accessToken,
|
|
2121
|
+
return (0, exports.doPost)('/auth/v1/user/changePassword', newPassword, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2133
2122
|
};
|
|
2134
2123
|
exports.changePasswordWithCurrentPassword = changePasswordWithCurrentPassword;
|
|
2135
2124
|
// https://rest-docs.synapse.org/rest/POST/user/changePassword.html
|
|
2136
2125
|
var changePasswordWithToken = function (newPassword) {
|
|
2137
|
-
return (0, exports.doPost)('/auth/v1/user/changePassword', newPassword, undefined,
|
|
2126
|
+
return (0, exports.doPost)('/auth/v1/user/changePassword', newPassword, undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2138
2127
|
};
|
|
2139
2128
|
exports.changePasswordWithToken = changePasswordWithToken;
|
|
2140
2129
|
// http://rest-docs.synapse.org/rest/POST/user/password/reset.html
|
|
2141
2130
|
var resetPassword = function (email) {
|
|
2142
2131
|
var endpoint = window.location.href + '?passwordResetToken=';
|
|
2143
2132
|
var url = "/auth/v1/user/password/reset?passwordResetEndpoint=".concat(encodeURIComponent(endpoint));
|
|
2144
|
-
return (0, exports.doPost)(url, { email: email }, undefined,
|
|
2133
|
+
return (0, exports.doPost)(url, { email: email }, undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2145
2134
|
};
|
|
2146
2135
|
exports.resetPassword = resetPassword;
|
|
2147
2136
|
/**
|
|
@@ -2152,7 +2141,7 @@ exports.resetPassword = resetPassword;
|
|
|
2152
2141
|
* @param accessToken
|
|
2153
2142
|
*/
|
|
2154
2143
|
var addEmailAddressStep1 = function (email, userId, portalEndpoint, accessToken) {
|
|
2155
|
-
return (0, exports.doPost)("/repo/v1/account/".concat(userId, "/emailValidation?portalEndpoint=").concat(portalEndpoint), { email: email }, accessToken,
|
|
2144
|
+
return (0, exports.doPost)("/repo/v1/account/".concat(userId, "/emailValidation?portalEndpoint=").concat(portalEndpoint), { email: email }, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2156
2145
|
};
|
|
2157
2146
|
exports.addEmailAddressStep1 = addEmailAddressStep1;
|
|
2158
2147
|
/**
|
|
@@ -2161,7 +2150,7 @@ exports.addEmailAddressStep1 = addEmailAddressStep1;
|
|
|
2161
2150
|
* @param accessToken
|
|
2162
2151
|
*/
|
|
2163
2152
|
var addEmailAddressStep2 = function (emailValidationSignedToken, accessToken) {
|
|
2164
|
-
return (0, exports.doPost)("/repo/v1/email", emailValidationSignedToken, accessToken,
|
|
2153
|
+
return (0, exports.doPost)("/repo/v1/email", emailValidationSignedToken, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2165
2154
|
};
|
|
2166
2155
|
exports.addEmailAddressStep2 = addEmailAddressStep2;
|
|
2167
2156
|
/**
|
|
@@ -2170,7 +2159,7 @@ exports.addEmailAddressStep2 = addEmailAddressStep2;
|
|
|
2170
2159
|
* @param accessToken
|
|
2171
2160
|
*/
|
|
2172
2161
|
var deleteEmail = function (accessToken, email) {
|
|
2173
|
-
return (0, exports.doDelete)("/repo/v1/email?email=".concat(email), accessToken,
|
|
2162
|
+
return (0, exports.doDelete)("/repo/v1/email?email=".concat(email), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2174
2163
|
};
|
|
2175
2164
|
exports.deleteEmail = deleteEmail;
|
|
2176
2165
|
/**
|
|
@@ -2179,7 +2168,7 @@ exports.deleteEmail = deleteEmail;
|
|
|
2179
2168
|
* @param accessToken
|
|
2180
2169
|
*/
|
|
2181
2170
|
var updateNotificationEmail = function (email, accessToken) {
|
|
2182
|
-
return (0, exports.doPut)('/repo/v1/notificationEmail', { email: email }, accessToken,
|
|
2171
|
+
return (0, exports.doPut)('/repo/v1/notificationEmail', { email: email }, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2183
2172
|
};
|
|
2184
2173
|
exports.updateNotificationEmail = updateNotificationEmail;
|
|
2185
2174
|
/**
|
|
@@ -2190,7 +2179,7 @@ Target users: anyone who has READ permission to the project.
|
|
|
2190
2179
|
* @param accessToken
|
|
2191
2180
|
*/
|
|
2192
2181
|
var getReply = function (replyId, accessToken) {
|
|
2193
|
-
return (0, exports.doGet)("/repo/v1/reply/".concat(replyId), accessToken,
|
|
2182
|
+
return (0, exports.doGet)("/repo/v1/reply/".concat(replyId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2194
2183
|
};
|
|
2195
2184
|
exports.getReply = getReply;
|
|
2196
2185
|
/**
|
|
@@ -2202,7 +2191,7 @@ exports.getReply = getReply;
|
|
|
2202
2191
|
* @param accessToken
|
|
2203
2192
|
*/
|
|
2204
2193
|
var getReplyMessageUrl = function (messageKey, accessToken) {
|
|
2205
|
-
return (0, exports.doGet)("/repo/v1/reply/messageUrl?messageKey=".concat(messageKey), accessToken,
|
|
2194
|
+
return (0, exports.doGet)("/repo/v1/reply/messageUrl?messageKey=".concat(messageKey), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2206
2195
|
};
|
|
2207
2196
|
exports.getReplyMessageUrl = getReplyMessageUrl;
|
|
2208
2197
|
/**
|
|
@@ -2213,7 +2202,7 @@ exports.getReplyMessageUrl = getReplyMessageUrl;
|
|
|
2213
2202
|
* @param accessToken
|
|
2214
2203
|
*/
|
|
2215
2204
|
var getThread = function (threadId, accessToken) {
|
|
2216
|
-
return (0, exports.doGet)("/repo/v1/thread/".concat(threadId), accessToken,
|
|
2205
|
+
return (0, exports.doGet)("/repo/v1/thread/".concat(threadId), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2217
2206
|
};
|
|
2218
2207
|
exports.getThread = getThread;
|
|
2219
2208
|
/**
|
|
@@ -2225,7 +2214,7 @@ exports.getThread = getThread;
|
|
|
2225
2214
|
* @param accessToken
|
|
2226
2215
|
*/
|
|
2227
2216
|
var getThreadMessageUrl = function (messageKey, accessToken) {
|
|
2228
|
-
return (0, exports.doGet)("/repo/v1/thread/messageUrl?messageKey=".concat(messageKey), accessToken,
|
|
2217
|
+
return (0, exports.doGet)("/repo/v1/thread/messageUrl?messageKey=".concat(messageKey), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2229
2218
|
};
|
|
2230
2219
|
exports.getThreadMessageUrl = getThreadMessageUrl;
|
|
2231
2220
|
/**
|
|
@@ -2237,7 +2226,7 @@ exports.getThreadMessageUrl = getThreadMessageUrl;
|
|
|
2237
2226
|
* @param accessToken
|
|
2238
2227
|
*/
|
|
2239
2228
|
var forumSearch = function (discussionSearchRequest, forumId, accessToken) {
|
|
2240
|
-
return (0, exports.doPost)("/repo/v1/forum/".concat(forumId, "/search"), discussionSearchRequest, accessToken,
|
|
2229
|
+
return (0, exports.doPost)("/repo/v1/forum/".concat(forumId, "/search"), discussionSearchRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2241
2230
|
};
|
|
2242
2231
|
exports.forumSearch = forumSearch;
|
|
2243
2232
|
/**
|
|
@@ -2248,7 +2237,7 @@ exports.forumSearch = forumSearch;
|
|
|
2248
2237
|
* @param accessToken
|
|
2249
2238
|
*/
|
|
2250
2239
|
var searchAccessApprovals = function (accessApprovalSearchRequest, accessToken) {
|
|
2251
|
-
return (0, exports.doPost)('/repo/v1/accessApproval/search', accessApprovalSearchRequest, accessToken,
|
|
2240
|
+
return (0, exports.doPost)('/repo/v1/accessApproval/search', accessApprovalSearchRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2252
2241
|
};
|
|
2253
2242
|
exports.searchAccessApprovals = searchAccessApprovals;
|
|
2254
2243
|
/**
|
|
@@ -2259,14 +2248,14 @@ exports.searchAccessApprovals = searchAccessApprovals;
|
|
|
2259
2248
|
* https://rest-docs.synapse.org/rest/POST/dataAccessSubmission/search.html
|
|
2260
2249
|
*/
|
|
2261
2250
|
var searchAccessSubmission = function (submissionSearchRequest, accessToken) {
|
|
2262
|
-
return (0, exports.doPost)(APIConstants_1.ACCESS_REQUEST_SUBMISSION_SEARCH, submissionSearchRequest, accessToken,
|
|
2251
|
+
return (0, exports.doPost)(APIConstants_1.ACCESS_REQUEST_SUBMISSION_SEARCH, submissionSearchRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2263
2252
|
};
|
|
2264
2253
|
exports.searchAccessSubmission = searchAccessSubmission;
|
|
2265
2254
|
/**
|
|
2266
2255
|
* http://rest-docs.synapse.org/rest/POST/accessRequirement/requirementId/approvedSubmissionInfo.html
|
|
2267
2256
|
*/
|
|
2268
2257
|
var getApprovedSubmissionInfo = function (submissionInfoPageRequest, accessToken) {
|
|
2269
|
-
return (0, exports.doPost)((0, APIConstants_1.APPROVED_SUBMISSION_INFO)(submissionInfoPageRequest.accessRequirementId), submissionInfoPageRequest, accessToken,
|
|
2258
|
+
return (0, exports.doPost)((0, APIConstants_1.APPROVED_SUBMISSION_INFO)(submissionInfoPageRequest.accessRequirementId), submissionInfoPageRequest, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2270
2259
|
};
|
|
2271
2260
|
exports.getApprovedSubmissionInfo = getApprovedSubmissionInfo;
|
|
2272
2261
|
/**
|
|
@@ -2274,7 +2263,7 @@ exports.getApprovedSubmissionInfo = getApprovedSubmissionInfo;
|
|
|
2274
2263
|
*/
|
|
2275
2264
|
var getActivityForEntity = function (entityId, versionNumber, accessToken) {
|
|
2276
2265
|
var url = (0, APIConstants_1.ACTIVITY_FOR_ENTITY)(entityId, versionNumber ? "".concat(versionNumber) : undefined);
|
|
2277
|
-
return (0, exports.doGet)(url, accessToken,
|
|
2266
|
+
return (0, exports.doGet)(url, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2278
2267
|
};
|
|
2279
2268
|
exports.getActivityForEntity = getActivityForEntity;
|
|
2280
2269
|
/**
|
|
@@ -2286,22 +2275,22 @@ exports.getActivityForEntity = getActivityForEntity;
|
|
|
2286
2275
|
*/
|
|
2287
2276
|
function getProfilePicPreviewPresignedUrl(userId) {
|
|
2288
2277
|
return allowNotFoundError(function () {
|
|
2289
|
-
return (0, exports.doGet)((0, APIConstants_1.PROFILE_IMAGE_PREVIEW)(userId) + "?redirect=false", undefined,
|
|
2278
|
+
return (0, exports.doGet)((0, APIConstants_1.PROFILE_IMAGE_PREVIEW)(userId) + "?redirect=false", undefined, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2290
2279
|
});
|
|
2291
2280
|
}
|
|
2292
2281
|
exports.getProfilePicPreviewPresignedUrl = getProfilePicPreviewPresignedUrl;
|
|
2293
2282
|
function getItemsInTrashCan(accessToken, offset, limit) {
|
|
2294
2283
|
if (offset === void 0) { offset = 0; }
|
|
2295
2284
|
if (limit === void 0) { limit = 25; }
|
|
2296
|
-
return (0, exports.doGet)(APIConstants_1.TRASHCAN_VIEW + "?offset=".concat(offset, "&limit=").concat(limit), accessToken,
|
|
2285
|
+
return (0, exports.doGet)(APIConstants_1.TRASHCAN_VIEW + "?offset=".concat(offset, "&limit=").concat(limit), accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2297
2286
|
}
|
|
2298
2287
|
exports.getItemsInTrashCan = getItemsInTrashCan;
|
|
2299
2288
|
function restoreFromTrashCan(entityId, accessToken) {
|
|
2300
|
-
return (0, exports.doPut)((0, APIConstants_1.TRASHCAN_RESTORE)(entityId), undefined, accessToken,
|
|
2289
|
+
return (0, exports.doPut)((0, APIConstants_1.TRASHCAN_RESTORE)(entityId), undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2301
2290
|
}
|
|
2302
2291
|
exports.restoreFromTrashCan = restoreFromTrashCan;
|
|
2303
2292
|
function purgeFromTrashCan(entityId, accessToken) {
|
|
2304
|
-
return (0, exports.doPut)((0, APIConstants_1.TRASHCAN_PURGE)(entityId), undefined, accessToken,
|
|
2293
|
+
return (0, exports.doPut)((0, APIConstants_1.TRASHCAN_PURGE)(entityId), undefined, accessToken, getEndpoint_1.BackendDestinationEnum.REPO_ENDPOINT);
|
|
2305
2294
|
}
|
|
2306
2295
|
exports.purgeFromTrashCan = purgeFromTrashCan;
|
|
2307
2296
|
//# sourceMappingURL=SynapseClient.js.map
|