@nmshd/transport 2.3.1 → 2.3.3

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.
@@ -33391,10 +33391,10 @@ exports.buildInformation = void 0;
33391
33391
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
33392
33392
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
33393
33393
  exports.buildInformation = {
33394
- version: "2.3.1",
33395
- build: "23",
33396
- date: "2024-02-15T09:23:28+00:00",
33397
- commit: "e195157925f945216f3f697aa97b35e23977ae5f",
33394
+ version: "2.3.3",
33395
+ build: "34",
33396
+ date: "2024-02-28T15:34:29+00:00",
33397
+ commit: "0f1c06d1dd1c8f4f38ebd3e48b00cddd40311b66",
33398
33398
  dependencies: {"@js-soft/docdb-access-abstractions":"1.0.3","@js-soft/logging-abstractions":"^1.0.1","@js-soft/simple-logger":"1.0.4","@js-soft/ts-utils":"^2.3.3","axios":"^1.6.7","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.4.4","qs":"^6.11.2","reflect-metadata":"^0.2.1","ts-simple-nameof":"^1.3.1","uuid":"^9.0.1"},
33399
33399
  libraries: {
33400
33400
  crypto: crypto_1.buildInformation,
@@ -34599,12 +34599,12 @@ exports.AuthClient = AuthClient;
34599
34599
  "use strict";
34600
34600
 
34601
34601
  Object.defineProperty(exports, "__esModule", ({ value: true }));
34602
- exports.Authenticator = void 0;
34602
+ exports.Authenticator = exports.AbstractAuthenticator = void 0;
34603
34603
  const AuthClient_1 = __webpack_require__(/*! ./AuthClient */ "./dist/core/backbone/AuthClient.js");
34604
- class Authenticator {
34605
- constructor(accountController) {
34606
- this.accountController = accountController;
34607
- this.authClient = new AuthClient_1.AuthClient(accountController.config);
34604
+ class AbstractAuthenticator {
34605
+ constructor(config) {
34606
+ this.config = config;
34607
+ this.authClient = new AuthClient_1.AuthClient(config);
34608
34608
  }
34609
34609
  async getToken() {
34610
34610
  if (this.token && !this.isExpired()) {
@@ -34643,11 +34643,11 @@ class Authenticator {
34643
34643
  }
34644
34644
  }
34645
34645
  async authenticateInternal() {
34646
- const deviceCredentials = await this.accountController.activeDevice.getCredentials();
34646
+ const deviceCredentials = await this.getCredentials();
34647
34647
  const params = {
34648
34648
  grantType: "password",
34649
- clientId: this.accountController.config.platformClientId,
34650
- clientSecret: this.accountController.config.platformClientSecret,
34649
+ clientId: this.config.platformClientId,
34650
+ clientSecret: this.config.platformClientSecret,
34651
34651
  username: deviceCredentials.username,
34652
34652
  password: deviceCredentials.password
34653
34653
  };
@@ -34656,6 +34656,20 @@ class Authenticator {
34656
34656
  this.expiry = result.value.expiry;
34657
34657
  }
34658
34658
  }
34659
+ exports.AbstractAuthenticator = AbstractAuthenticator;
34660
+ class Authenticator extends AbstractAuthenticator {
34661
+ constructor(accountController) {
34662
+ super(accountController.config);
34663
+ this.accountController = accountController;
34664
+ }
34665
+ async getCredentials() {
34666
+ const activeDevice = await this.accountController.activeDevice.getCredentials();
34667
+ return {
34668
+ username: activeDevice.username,
34669
+ password: activeDevice.password
34670
+ };
34671
+ }
34672
+ }
34659
34673
  exports.Authenticator = Authenticator;
34660
34674
  //# sourceMappingURL=Authenticator.js.map
34661
34675
 
@@ -35245,8 +35259,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
35245
35259
  exports.RESTClientAuthenticate = void 0;
35246
35260
  const lodash_1 = __importDefault(__webpack_require__(/*! lodash */ "../../node_modules/lodash/lodash.js"));
35247
35261
  const ClientResult_1 = __webpack_require__(/*! ./ClientResult */ "./dist/core/backbone/ClientResult.js");
35248
- const RESTClient_1 = __webpack_require__(/*! ./RESTClient */ "./dist/core/backbone/RESTClient.js");
35249
35262
  const RequestError_1 = __webpack_require__(/*! ./RequestError */ "./dist/core/backbone/RequestError.js");
35263
+ const RESTClient_1 = __webpack_require__(/*! ./RESTClient */ "./dist/core/backbone/RESTClient.js");
35250
35264
  class RESTClientAuthenticate extends RESTClient_1.RESTClient {
35251
35265
  constructor(config, authenticator, requestConfig = {}) {
35252
35266
  super(config, requestConfig);
@@ -36185,37 +36199,37 @@ exports.AccountController = void 0;
36185
36199
  const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "../../node_modules/@js-soft/ts-utils/dist/index.js");
36186
36200
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
36187
36201
  const core_1 = __webpack_require__(/*! ../../core */ "./dist/core/index.js");
36202
+ const Authenticator_1 = __webpack_require__(/*! ../../core/backbone/Authenticator */ "./dist/core/backbone/Authenticator.js");
36188
36203
  const CoreCrypto_1 = __webpack_require__(/*! ../../core/CoreCrypto */ "./dist/core/CoreCrypto.js");
36189
36204
  const DbCollectionName_1 = __webpack_require__(/*! ../../core/DbCollectionName */ "./dist/core/DbCollectionName.js");
36190
36205
  const TransportLoggerFactory_1 = __webpack_require__(/*! ../../core/TransportLoggerFactory */ "./dist/core/TransportLoggerFactory.js");
36191
- const Authenticator_1 = __webpack_require__(/*! ../../core/backbone/Authenticator */ "./dist/core/backbone/Authenticator.js");
36192
36206
  const util_1 = __webpack_require__(/*! ../../util */ "./dist/util/index.js");
36193
36207
  const CertificateController_1 = __webpack_require__(/*! ../certificates/CertificateController */ "./dist/modules/certificates/CertificateController.js");
36194
36208
  const CertificateIssuer_1 = __webpack_require__(/*! ../certificates/CertificateIssuer */ "./dist/modules/certificates/CertificateIssuer.js");
36195
36209
  const CertificateValidator_1 = __webpack_require__(/*! ../certificates/CertificateValidator */ "./dist/modules/certificates/CertificateValidator.js");
36196
36210
  const ChallengeController_1 = __webpack_require__(/*! ../challenges/ChallengeController */ "./dist/modules/challenges/ChallengeController.js");
36197
- const DeviceController_1 = __webpack_require__(/*! ../devices/DeviceController */ "./dist/modules/devices/DeviceController.js");
36198
- const DeviceSecretController_1 = __webpack_require__(/*! ../devices/DeviceSecretController */ "./dist/modules/devices/DeviceSecretController.js");
36199
- const DevicesController_1 = __webpack_require__(/*! ../devices/DevicesController */ "./dist/modules/devices/DevicesController.js");
36200
36211
  const DeviceAuthClient_1 = __webpack_require__(/*! ../devices/backbone/DeviceAuthClient */ "./dist/modules/devices/backbone/DeviceAuthClient.js");
36201
36212
  const DeviceClient_1 = __webpack_require__(/*! ../devices/backbone/DeviceClient */ "./dist/modules/devices/backbone/DeviceClient.js");
36213
+ const DeviceController_1 = __webpack_require__(/*! ../devices/DeviceController */ "./dist/modules/devices/DeviceController.js");
36214
+ const DevicesController_1 = __webpack_require__(/*! ../devices/DevicesController */ "./dist/modules/devices/DevicesController.js");
36215
+ const DeviceSecretController_1 = __webpack_require__(/*! ../devices/DeviceSecretController */ "./dist/modules/devices/DeviceSecretController.js");
36202
36216
  const Device_1 = __webpack_require__(/*! ../devices/local/Device */ "./dist/modules/devices/local/Device.js");
36203
36217
  const DeviceSecretCredentials_1 = __webpack_require__(/*! ../devices/local/DeviceSecretCredentials */ "./dist/modules/devices/local/DeviceSecretCredentials.js");
36204
36218
  const DeviceSharedSecret_1 = __webpack_require__(/*! ../devices/transmission/DeviceSharedSecret */ "./dist/modules/devices/transmission/DeviceSharedSecret.js");
36205
36219
  const FileController_1 = __webpack_require__(/*! ../files/FileController */ "./dist/modules/files/FileController.js");
36206
36220
  const MessageController_1 = __webpack_require__(/*! ../messages/MessageController */ "./dist/modules/messages/MessageController.js");
36207
- const RelationshipTemplateController_1 = __webpack_require__(/*! ../relationshipTemplates/RelationshipTemplateController */ "./dist/modules/relationshipTemplates/RelationshipTemplateController.js");
36208
- const RelationshipSecretController_1 = __webpack_require__(/*! ../relationships/RelationshipSecretController */ "./dist/modules/relationships/RelationshipSecretController.js");
36209
36221
  const RelationshipsController_1 = __webpack_require__(/*! ../relationships/RelationshipsController */ "./dist/modules/relationships/RelationshipsController.js");
36222
+ const RelationshipSecretController_1 = __webpack_require__(/*! ../relationships/RelationshipSecretController */ "./dist/modules/relationships/RelationshipSecretController.js");
36223
+ const RelationshipTemplateController_1 = __webpack_require__(/*! ../relationshipTemplates/RelationshipTemplateController */ "./dist/modules/relationshipTemplates/RelationshipTemplateController.js");
36210
36224
  const SecretController_1 = __webpack_require__(/*! ../secrets/SecretController */ "./dist/modules/secrets/SecretController.js");
36211
36225
  const SyncCallback_1 = __webpack_require__(/*! ../sync/SyncCallback */ "./dist/modules/sync/SyncCallback.js");
36212
36226
  const SyncController_1 = __webpack_require__(/*! ../sync/SyncController */ "./dist/modules/sync/SyncController.js");
36213
36227
  const SynchronizedCollection_1 = __webpack_require__(/*! ../sync/SynchronizedCollection */ "./dist/modules/sync/SynchronizedCollection.js");
36214
36228
  const TokenController_1 = __webpack_require__(/*! ../tokens/TokenController */ "./dist/modules/tokens/TokenController.js");
36215
- const IdentityController_1 = __webpack_require__(/*! ./IdentityController */ "./dist/modules/accounts/IdentityController.js");
36216
- const IdentityUtil_1 = __webpack_require__(/*! ./IdentityUtil */ "./dist/modules/accounts/IdentityUtil.js");
36217
36229
  const IdentityClient_1 = __webpack_require__(/*! ./backbone/IdentityClient */ "./dist/modules/accounts/backbone/IdentityClient.js");
36218
36230
  const Identity_1 = __webpack_require__(/*! ./data/Identity */ "./dist/modules/accounts/data/Identity.js");
36231
+ const IdentityController_1 = __webpack_require__(/*! ./IdentityController */ "./dist/modules/accounts/IdentityController.js");
36232
+ const IdentityUtil_1 = __webpack_require__(/*! ./IdentityUtil */ "./dist/modules/accounts/IdentityUtil.js");
36219
36233
  class AccountController {
36220
36234
  get authenticator() {
36221
36235
  return this._authenticator;