@zeniai/client-epic-state 4.19.31-betaAK1 → 4.19.31

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/lib/esm/init.js CHANGED
@@ -105,29 +105,16 @@ export function zeniAPIClientConfig() {
105
105
  /**
106
106
  * Initialize client-epic-state with new store.
107
107
  * Should be used in the node server.
108
- *
109
- * Loads the full epic tree (~526 epics) so that server-side handlers
110
- * (report generation, data fetching, etc.) have all feature epics
111
- * available. The browser app uses `initialize()` + `injectFeatureModules()`
112
- * instead to enable lazy loading.
113
- *
114
108
  * @param restEndPoints rest endpoints for the micro services
115
109
  * @param userId user id
116
110
  * @param sessionId session id
117
111
  * @param tenantId tenant id
118
112
  */
119
- export async function initializeWithNewStore(restEndPoints, userId, sessionId, tenantId) {
113
+ export function initializeWithNewStore(restEndPoints, userId, sessionId, tenantId) {
120
114
  console.info(`initializeWithNewStore with ${JSON.stringify(restEndPoints)}`);
121
115
  initialize3rdPartyExtensions();
122
116
  const zeniHttpClient = new ZeniAPIClient(restEndPoints, userId, sessionId, tenantId);
123
- const store = configureNewStore(zeniHttpClient, false);
124
- // Server-side stores need the full epic tree, not just the 24 core epics.
125
- // Feature epics handle report generation, data fetching, etc. that the
126
- // download server relies on. We use the store's own epicManager (not the
127
- // module-level variable) so each store gets its own full epic subscription.
128
- const epicModule = await import('./epic');
129
- store.epicManager.setEpic(epicModule.default);
130
- return store;
117
+ return configureNewStore(zeniHttpClient, false);
131
118
  }
132
119
  /**
133
120
  * Exported for testing purpose. Not intended to be used in any other place!
package/lib/init.d.ts CHANGED
@@ -49,16 +49,10 @@ export declare function zeniAPIClientConfig(): {
49
49
  /**
50
50
  * Initialize client-epic-state with new store.
51
51
  * Should be used in the node server.
52
- *
53
- * Loads the full epic tree (~526 epics) so that server-side handlers
54
- * (report generation, data fetching, etc.) have all feature epics
55
- * available. The browser app uses `initialize()` + `injectFeatureModules()`
56
- * instead to enable lazy loading.
57
- *
58
52
  * @param restEndPoints rest endpoints for the micro services
59
53
  * @param userId user id
60
54
  * @param sessionId session id
61
55
  * @param tenantId tenant id
62
56
  */
63
- export declare function initializeWithNewStore(restEndPoints: RESTAPIEndpoints, userId: string, sessionId: string, tenantId: string): Promise<ZeniStore>;
57
+ export declare function initializeWithNewStore(restEndPoints: RESTAPIEndpoints, userId: string, sessionId: string, tenantId: string): ZeniStore;
64
58
  export declare function initialize3rdPartyExtensions(): void;
package/lib/init.js CHANGED
@@ -1,37 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
@@ -150,29 +117,16 @@ function zeniAPIClientConfig() {
150
117
  /**
151
118
  * Initialize client-epic-state with new store.
152
119
  * Should be used in the node server.
153
- *
154
- * Loads the full epic tree (~526 epics) so that server-side handlers
155
- * (report generation, data fetching, etc.) have all feature epics
156
- * available. The browser app uses `initialize()` + `injectFeatureModules()`
157
- * instead to enable lazy loading.
158
- *
159
120
  * @param restEndPoints rest endpoints for the micro services
160
121
  * @param userId user id
161
122
  * @param sessionId session id
162
123
  * @param tenantId tenant id
163
124
  */
164
- async function initializeWithNewStore(restEndPoints, userId, sessionId, tenantId) {
125
+ function initializeWithNewStore(restEndPoints, userId, sessionId, tenantId) {
165
126
  console.info(`initializeWithNewStore with ${JSON.stringify(restEndPoints)}`);
166
127
  initialize3rdPartyExtensions();
167
128
  const zeniHttpClient = new zeniAPI_1.ZeniAPIClient(restEndPoints, userId, sessionId, tenantId);
168
- const store = (0, configureStore_1.default)(zeniHttpClient, false);
169
- // Server-side stores need the full epic tree, not just the 24 core epics.
170
- // Feature epics handle report generation, data fetching, etc. that the
171
- // download server relies on. We use the store's own epicManager (not the
172
- // module-level variable) so each store gets its own full epic subscription.
173
- const epicModule = await Promise.resolve().then(() => __importStar(require('./epic')));
174
- store.epicManager.setEpic(epicModule.default);
175
- return store;
129
+ return (0, configureStore_1.default)(zeniHttpClient, false);
176
130
  }
177
131
  /**
178
132
  * Exported for testing purpose. Not intended to be used in any other place!