@coscine/api-client 1.0.0 → 1.1.0

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/index.umd.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.index = {}));
5
- }(this, (function (exports) { 'use strict';
5
+ })(this, (function (exports) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -2407,7 +2407,7 @@
2407
2407
  *
2408
2408
  * @export
2409
2409
  */
2410
- const serializeDataIfNeeded$6 = function (value, requestOptions, configuration) {
2410
+ const serializeDataIfNeeded$7 = function (value, requestOptions, configuration) {
2411
2411
  const nonString = typeof value !== 'string';
2412
2412
  const needsSerialization = nonString && configuration && configuration.isJsonMime
2413
2413
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
@@ -2498,7 +2498,7 @@
2498
2498
  setSearchParams$a(localVarUrlObj, localVarQueryParameter, options.query);
2499
2499
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2500
2500
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2501
- localVarRequestOptions.data = serializeDataIfNeeded$6(updateQuotaParameterObject, localVarRequestOptions, configuration);
2501
+ localVarRequestOptions.data = serializeDataIfNeeded$7(updateQuotaParameterObject, localVarRequestOptions, configuration);
2502
2502
  return {
2503
2503
  url: toPathString$a(localVarUrlObj),
2504
2504
  options: localVarRequestOptions,
@@ -2642,7 +2642,7 @@
2642
2642
  *
2643
2643
  * @export
2644
2644
  */
2645
- const serializeDataIfNeeded$5 = function (value, requestOptions, configuration) {
2645
+ const serializeDataIfNeeded$6 = function (value, requestOptions, configuration) {
2646
2646
  const nonString = typeof value !== 'string';
2647
2647
  const needsSerialization = nonString && configuration && configuration.isJsonMime
2648
2648
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
@@ -2803,7 +2803,7 @@
2803
2803
  setSearchParams$9(localVarUrlObj, localVarQueryParameter, options.query);
2804
2804
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2805
2805
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2806
- localVarRequestOptions.data = serializeDataIfNeeded$5(body, localVarRequestOptions, configuration);
2806
+ localVarRequestOptions.data = serializeDataIfNeeded$6(body, localVarRequestOptions, configuration);
2807
2807
  return {
2808
2808
  url: toPathString$9(localVarUrlObj),
2809
2809
  options: localVarRequestOptions,
@@ -3064,6 +3064,19 @@
3064
3064
  }
3065
3065
  url.search = searchParams.toString();
3066
3066
  };
3067
+ /**
3068
+ *
3069
+ * @export
3070
+ */
3071
+ const serializeDataIfNeeded$5 = function (value, requestOptions, configuration) {
3072
+ const nonString = typeof value !== 'string';
3073
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
3074
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
3075
+ : nonString;
3076
+ return needsSerialization
3077
+ ? JSON.stringify(value !== undefined ? value : {})
3078
+ : (value || "");
3079
+ };
3067
3080
  /**
3068
3081
  *
3069
3082
  * @export
@@ -3275,6 +3288,38 @@
3275
3288
  options: localVarRequestOptions,
3276
3289
  };
3277
3290
  }),
3291
+ /**
3292
+ *
3293
+ * @summary Create a request for storing a given application profile.
3294
+ * @param {ApplicationProfile} applicationProfile Object describing the application profile
3295
+ * @param {*} [options] Override http request option.
3296
+ * @throws {RequiredError}
3297
+ */
3298
+ metadataSaveApplicationProfile: (applicationProfile, options = {}) => __awaiter(this, void 0, void 0, function* () {
3299
+ // verify required parameter 'applicationProfile' is not null or undefined
3300
+ assertParamExists$8('metadataSaveApplicationProfile', 'applicationProfile', applicationProfile);
3301
+ const localVarPath = `/Metadata/profiles`;
3302
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3303
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$8);
3304
+ let baseOptions;
3305
+ if (configuration) {
3306
+ baseOptions = configuration.baseOptions;
3307
+ }
3308
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
3309
+ const localVarHeaderParameter = {};
3310
+ const localVarQueryParameter = {};
3311
+ // authentication JWT token required
3312
+ yield setApiKeyToObject$8(localVarHeaderParameter, "Authorization", configuration);
3313
+ localVarHeaderParameter['Content-Type'] = 'application/json';
3314
+ setSearchParams$8(localVarUrlObj, localVarQueryParameter, options.query);
3315
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3316
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3317
+ localVarRequestOptions.data = serializeDataIfNeeded$5(applicationProfile, localVarRequestOptions, configuration);
3318
+ return {
3319
+ url: toPathString$8(localVarUrlObj),
3320
+ options: localVarRequestOptions,
3321
+ };
3322
+ }),
3278
3323
  };
3279
3324
  };
3280
3325
  /**
@@ -3362,6 +3407,19 @@
3362
3407
  return createRequestFunction$8(localVarAxiosArgs, axios, BASE_PATH$8, configuration);
3363
3408
  });
3364
3409
  },
3410
+ /**
3411
+ *
3412
+ * @summary Create a request for storing a given application profile.
3413
+ * @param {ApplicationProfile} applicationProfile Object describing the application profile
3414
+ * @param {*} [options] Override http request option.
3415
+ * @throws {RequiredError}
3416
+ */
3417
+ metadataSaveApplicationProfile(applicationProfile, options) {
3418
+ return __awaiter(this, void 0, void 0, function* () {
3419
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.metadataSaveApplicationProfile(applicationProfile, options);
3420
+ return createRequestFunction$8(localVarAxiosArgs, axios, BASE_PATH$8, configuration);
3421
+ });
3422
+ },
3365
3423
  };
3366
3424
  };
3367
3425
  /**
@@ -3431,6 +3489,16 @@
3431
3489
  metadataGetVocabulary(path, options) {
3432
3490
  return localVarFp.metadataGetVocabulary(path, options).then((request) => request(axios, basePath));
3433
3491
  },
3492
+ /**
3493
+ *
3494
+ * @summary Create a request for storing a given application profile.
3495
+ * @param {ApplicationProfile} applicationProfile Object describing the application profile
3496
+ * @param {*} [options] Override http request option.
3497
+ * @throws {RequiredError}
3498
+ */
3499
+ metadataSaveApplicationProfile(applicationProfile, options) {
3500
+ return localVarFp.metadataSaveApplicationProfile(applicationProfile, options).then((request) => request(axios, basePath));
3501
+ },
3434
3502
  };
3435
3503
  };
3436
3504
 
@@ -8318,7 +8386,7 @@
8318
8386
  };
8319
8387
 
8320
8388
  let accessToken = '';
8321
- if (typeof coscine !== 'undefined') {
8389
+ if (typeof coscine !== 'undefined' && typeof coscine.authorization !== 'undefined') {
8322
8390
  accessToken = coscine.authorization.bearer;
8323
8391
  }
8324
8392
  const getHostName = () => {
@@ -8365,9 +8433,13 @@
8365
8433
  const clientCorrolationIdKey = 'X-Coscine-Logging-CorrelationId';
8366
8434
  function setHeader(request) {
8367
8435
  if (typeof coscine !== "undefined") {
8368
- request.headers.common[authHeaderKey] =
8369
- 'Bearer ' + coscine.authorization.bearer;
8370
- request.headers.common[clientCorrolationIdKey] = coscine.clientcorrolation.id;
8436
+ if (typeof coscine.authorization !== "undefined") {
8437
+ request.headers.common[authHeaderKey] =
8438
+ 'Bearer ' + coscine.authorization.bearer;
8439
+ }
8440
+ if (typeof coscine.clientcorrolation !== "undefined") {
8441
+ request.headers.common[clientCorrolationIdKey] = coscine.clientcorrolation.id;
8442
+ }
8371
8443
  }
8372
8444
  }
8373
8445
  instance.interceptors.request.use((request) => {
@@ -8441,9 +8513,9 @@
8441
8513
  exports.TreeApi = TreeApi;
8442
8514
  exports.UserApi = UserApi;
8443
8515
  exports.VisibilityApi = VisibilityApi;
8444
- exports['default'] = apis;
8516
+ exports["default"] = apis;
8445
8517
 
8446
8518
  Object.defineProperty(exports, '__esModule', { value: true });
8447
8519
 
8448
- })));
8520
+ }));
8449
8521
  //# sourceMappingURL=index.umd.js.map