core-3nweb-client-lib 0.35.1 → 0.35.2

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.
@@ -9,7 +9,8 @@ export interface ParamOnServer<P extends keyof ASMailConfigParams> {
9
9
  getFromServer: () => Promise<ASMailConfigParams[P] | null>;
10
10
  }
11
11
  export declare class MailConfigurator extends ServiceUser {
12
- constructor(userId: string, getSigner: IGetMailerIdSigner, mainUrlGetter: () => Promise<string>, net: NetClient);
12
+ private readonly sleepMillisAfterParamSetting;
13
+ constructor(userId: string, getSigner: IGetMailerIdSigner, mainUrlGetter: () => Promise<string>, net: NetClient, sleepMillisAfterParamSetting?: number);
13
14
  getParam<P extends keyof ASMailConfigParams>(param: P): Promise<ASMailConfigParams[P] | null>;
14
15
  setParam<P extends keyof ASMailConfigParams>(param: P, value: ASMailConfigParams[P] | null): Promise<void>;
15
16
  makeParamSetterAndGetter<P extends keyof ASMailConfigParams>(param: P): ParamOnServer<P>;
@@ -23,14 +23,16 @@ const request_utils_1 = require("../request-utils");
23
23
  const api = require("../../lib-common/service-api/asmail/config");
24
24
  const user_with_mid_session_1 = require("../user-with-mid-session");
25
25
  const service_locator_1 = require("../service-locator");
26
+ const sleep_1 = require("../../lib-common/processes/sleep");
26
27
  const configAccessParams = {
27
28
  login: api.midLogin.MID_URL_PART,
28
29
  logout: api.closeSession.URL_END,
29
30
  canBeRedirected: true
30
31
  };
31
32
  class MailConfigurator extends user_with_mid_session_1.ServiceUser {
32
- constructor(userId, getSigner, mainUrlGetter, net) {
33
+ constructor(userId, getSigner, mainUrlGetter, net, sleepMillisAfterParamSetting = 50) {
33
34
  super(userId, configAccessParams, getSigner, serviceUriGetter(net, mainUrlGetter), net);
35
+ this.sleepMillisAfterParamSetting = sleepMillisAfterParamSetting;
34
36
  Object.seal(this);
35
37
  }
36
38
  async getParam(param) {
@@ -54,6 +56,8 @@ class MailConfigurator extends user_with_mid_session_1.ServiceUser {
54
56
  if (rep.status !== api.PARAM_SC.ok) {
55
57
  throw (0, request_utils_1.makeException)(rep, 'Unexpected status');
56
58
  }
59
+ // wait to let possibly distributed system to propagate updates internally
60
+ await (0, sleep_1.sleep)(this.sleepMillisAfterParamSetting);
57
61
  }
58
62
  makeParamSetterAndGetter(param) {
59
63
  return {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- Copyright (C) 2015 - 2017 3NSoft Inc.
3
+ Copyright (C) 2015 - 2017, 2025 3NSoft Inc.
4
4
 
5
5
  This program is free software: you can redistribute it and/or modify it under
6
6
  the terms of the GNU General Public License as published by the Free Software
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-3nweb-client-lib",
3
- "version": "0.35.1",
3
+ "version": "0.35.2",
4
4
  "description": "3NWeb client core library, embeddable into different environments",
5
5
  "main": "build/lib-index.js",
6
6
  "types": "build/lib-index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "@types/ws": "^7.4.7",
42
42
  "jasmine": "^3.9.0",
43
43
  "protobufjs-cli": "^1.0.2",
44
- "spec-3nweb-server": "^1.7.8",
44
+ "spec-3nweb-server": "^1.7.9",
45
45
  "tsuml2": "^0.17.1",
46
46
  "typescript": "^5.5.3"
47
47
  }