@magda/registry-client 2.0.0-alpha.7 → 2.0.1

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -7
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -11298,11 +11298,13 @@ const urijs_1 = __importDefault(__webpack_require__(213));
11298
11298
  const retry_1 = __importDefault(__webpack_require__(88));
11299
11299
  const formatServiceError_1 = __importDefault(__webpack_require__(89));
11300
11300
  const ServerError_1 = __importDefault(__webpack_require__(90));
11301
- exports.toServerError = (apiName) => (error) => {
11301
+ const toServerError = (apiName) => (error) => {
11302
11302
  var _a, _b;
11303
11303
  if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.statusCode) {
11304
- const detailedErrorMsg = (error === null || error === void 0 ? void 0 : error.body) ? JSON.stringify(error.body)
11305
- : ((_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.responseText) ? error.response.responseText
11304
+ const detailedErrorMsg = (error === null || error === void 0 ? void 0 : error.body)
11305
+ ? JSON.stringify(error.body)
11306
+ : ((_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.responseText)
11307
+ ? error.response.responseText
11306
11308
  : "";
11307
11309
  return new ServerError_1.default(`Failed to ${apiName}${detailedErrorMsg ? `: ${detailedErrorMsg}` : ""}`, error.response.statusCode);
11308
11310
  }
@@ -11310,6 +11312,7 @@ exports.toServerError = (apiName) => (error) => {
11310
11312
  return new ServerError_1.default(`Failed to ${apiName}: ${error}`, 500);
11311
11313
  }
11312
11314
  };
11315
+ exports.toServerError = toServerError;
11313
11316
  class RegistryClient {
11314
11317
  constructor({ baseUrl, maxRetries = 10, secondsBetweenRetries = 10, tenantId }) {
11315
11318
  if (tenantId === undefined) {
@@ -19514,12 +19517,15 @@ module.exports = semver.satisfies(process.version, '^6.12.0 || >=8.0.0');
19514
19517
 
19515
19518
  "use strict";
19516
19519
 
19520
+ var __importDefault = (this && this.__importDefault) || function (mod) {
19521
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19522
+ };
19517
19523
  Object.defineProperty(exports, "__esModule", { value: true });
19518
- exports.TenantConsts = void 0;
19524
+ exports.WebHook = exports.RegistryEvent = exports.AspectDefinition = exports.Record = exports.TenantConsts = exports.AuthorizedRegistryClient = exports.RegistryClient = void 0;
19519
19525
  var RegistryClient_1 = __webpack_require__(48);
19520
- Object.defineProperty(exports, "RegistryClient", { enumerable: true, get: function () { return RegistryClient_1.default; } });
19526
+ Object.defineProperty(exports, "RegistryClient", { enumerable: true, get: function () { return __importDefault(RegistryClient_1).default; } });
19521
19527
  var AuthorizedRegistryClient_1 = __webpack_require__(216);
19522
- Object.defineProperty(exports, "AuthorizedRegistryClient", { enumerable: true, get: function () { return AuthorizedRegistryClient_1.default; } });
19528
+ Object.defineProperty(exports, "AuthorizedRegistryClient", { enumerable: true, get: function () { return __importDefault(AuthorizedRegistryClient_1).default; } });
19523
19529
  exports.TenantConsts = __webpack_require__(236);
19524
19530
  var api_1 = __webpack_require__(49);
19525
19531
  Object.defineProperty(exports, "Record", { enumerable: true, get: function () { return api_1.Record; } });
@@ -39430,7 +39436,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
39430
39436
  var __importStar = (this && this.__importStar) || function (mod) {
39431
39437
  if (mod && mod.__esModule) return mod;
39432
39438
  var result = {};
39433
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
39439
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
39434
39440
  __setModuleDefault(result, mod);
39435
39441
  return result;
39436
39442
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@magda/registry-client",
3
3
  "description": "MAGDA Registry Client",
4
- "version": "2.0.0-alpha.7",
4
+ "version": "2.0.1",
5
5
  "scripts": {
6
6
  "prebuild": "rimraf dist tsconfig.tsbuildinfo",
7
7
  "build": "webpack && api-extractor run -l",
@@ -12,10 +12,10 @@
12
12
  "main": "dist/index.js",
13
13
  "types": "dist/index.d.ts",
14
14
  "devDependencies": {
15
- "@magda/typescript-common": "^2.0.0-alpha.7",
16
- "@microsoft/api-extractor": "^7.7.8",
15
+ "@magda/typescript-common": "^2.0.1",
16
+ "@microsoft/api-extractor": "~7.15.2",
17
17
  "ts-loader": "^6.2.1",
18
- "typescript": "^3.7.2",
18
+ "typescript": "~4.2.4",
19
19
  "webpack": "^4.41.2",
20
20
  "webpack-cli": "^3.3.10"
21
21
  },