@etsoo/appscript 1.6.0 → 1.6.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.
@@ -22,10 +22,10 @@ const app = new appClass();
22
22
  await app.changeCulture(app.settings.cultures[0]);
23
23
 
24
24
  test("Test for domain substitution", () => {
25
- expect(app.settings.endpoint).toBe("http://localhost:9000/api/");
25
+ expect(app.settings.endpoint).toBe("http://admin.etsoo.com:9000/api/");
26
26
 
27
27
  expect(app.settings.endpoints?.core.endpoint).toBe(
28
- "https://localhost:9001/api/"
28
+ "https://core.etsoo.com:9001/api/"
29
29
  );
30
30
  });
31
31
 
@@ -11,7 +11,6 @@ import {
11
11
  CoreApp,
12
12
  createClient,
13
13
  Culture,
14
- ExternalSettings,
15
14
  IAppSettings,
16
15
  InitCallResultData,
17
16
  IUser
@@ -87,6 +86,8 @@ export class TestApp extends CoreApp<
87
86
  }
88
87
  },
89
88
 
89
+ hostname: "admin.etsoo.com",
90
+
90
91
  /**
91
92
  * App root url
92
93
  */
@@ -126,19 +127,6 @@ export class TestApp extends CoreApp<
126
127
  );
127
128
  }
128
129
 
129
- // Example of local format settings
130
- protected override formatSettings(settings: IAppSettings): IAppSettings {
131
- const { endpoint, endpoints, ...rest } = settings;
132
- return {
133
- ...rest,
134
- endpoint: ExternalSettings.formatHost(endpoint, "localhost"),
135
- endpoints:
136
- endpoints == null
137
- ? undefined
138
- : ExternalSettings.formatHost(endpoints, "localhost")
139
- };
140
- }
141
-
142
130
  freshCountdownUI(callback?: () => PromiseLike<unknown>): void {
143
131
  throw new Error("Method not implemented.");
144
132
  }
@@ -189,17 +189,19 @@ class CoreApp {
189
189
  }
190
190
  return undefined;
191
191
  };
192
+ // Destruct the settings
193
+ const { currentCulture, currentRegion, endpoint, webUrl } = this.settings;
192
194
  if (api) {
193
195
  // Base URL of the API
194
- api.baseUrl = this.settings.endpoint;
196
+ api.baseUrl = endpoint;
195
197
  api.name = systemApi;
196
198
  this.setApi(api, refresh);
197
199
  this.api = api;
198
200
  }
199
201
  else {
200
202
  this.api = this.createApi(systemApi, {
201
- endpoint: settings.endpoint,
202
- webUrl: settings.webUrl
203
+ endpoint,
204
+ webUrl
203
205
  }, refresh);
204
206
  }
205
207
  this.notifier = notifier;
@@ -220,7 +222,6 @@ class CoreApp {
220
222
  // Embedded
221
223
  this._embedded =
222
224
  this.storage.getData(this.fields.embedded) ?? false;
223
- const { currentCulture, currentRegion } = settings;
224
225
  // Load resources
225
226
  Promise.all([loadCrypto(), this.changeCulture(currentCulture)]).then(([cj, _resources]) => {
226
227
  CJ = cj.default;
@@ -186,17 +186,19 @@ export class CoreApp {
186
186
  }
187
187
  return undefined;
188
188
  };
189
+ // Destruct the settings
190
+ const { currentCulture, currentRegion, endpoint, webUrl } = this.settings;
189
191
  if (api) {
190
192
  // Base URL of the API
191
- api.baseUrl = this.settings.endpoint;
193
+ api.baseUrl = endpoint;
192
194
  api.name = systemApi;
193
195
  this.setApi(api, refresh);
194
196
  this.api = api;
195
197
  }
196
198
  else {
197
199
  this.api = this.createApi(systemApi, {
198
- endpoint: settings.endpoint,
199
- webUrl: settings.webUrl
200
+ endpoint,
201
+ webUrl
200
202
  }, refresh);
201
203
  }
202
204
  this.notifier = notifier;
@@ -217,7 +219,6 @@ export class CoreApp {
217
219
  // Embedded
218
220
  this._embedded =
219
221
  this.storage.getData(this.fields.embedded) ?? false;
220
- const { currentCulture, currentRegion } = settings;
221
222
  // Load resources
222
223
  Promise.all([loadCrypto(), this.changeCulture(currentCulture)]).then(([cj, _resources]) => {
223
224
  CJ = cj.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -365,9 +365,12 @@ export abstract class CoreApp<
365
365
  return undefined;
366
366
  };
367
367
 
368
+ // Destruct the settings
369
+ const { currentCulture, currentRegion, endpoint, webUrl } = this.settings;
370
+
368
371
  if (api) {
369
372
  // Base URL of the API
370
- api.baseUrl = this.settings.endpoint;
373
+ api.baseUrl = endpoint;
371
374
  api.name = systemApi;
372
375
  this.setApi(api, refresh);
373
376
  this.api = api;
@@ -375,8 +378,8 @@ export abstract class CoreApp<
375
378
  this.api = this.createApi(
376
379
  systemApi,
377
380
  {
378
- endpoint: settings.endpoint,
379
- webUrl: settings.webUrl
381
+ endpoint,
382
+ webUrl
380
383
  },
381
384
  refresh
382
385
  );
@@ -408,8 +411,6 @@ export abstract class CoreApp<
408
411
  this._embedded =
409
412
  this.storage.getData<boolean>(this.fields.embedded) ?? false;
410
413
 
411
- const { currentCulture, currentRegion } = settings;
412
-
413
414
  // Load resources
414
415
  Promise.all([loadCrypto(), this.changeCulture(currentCulture)]).then(
415
416
  ([cj, _resources]) => {