@telia-ace/alliance-utilities 1.0.11-next.1 → 1.0.12-next.0

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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! js-cookie v3.0.5 | MIT */
2
- function A(e) {
2
+ function k(e) {
3
3
  for (var t = 1; t < arguments.length; t++) {
4
4
  var r = arguments[t];
5
5
  for (var a in r)
@@ -18,10 +18,10 @@ var H = {
18
18
  );
19
19
  }
20
20
  };
21
- function P(e, t) {
21
+ function j(e, t) {
22
22
  function r(i, d, p) {
23
23
  if (!(typeof document > "u")) {
24
- p = A({}, t, p), typeof p.expires == "number" && (p.expires = new Date(Date.now() + p.expires * 864e5)), p.expires && (p.expires = p.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
24
+ p = k({}, t, p), typeof p.expires == "number" && (p.expires = new Date(Date.now() + p.expires * 864e5)), p.expires && (p.expires = p.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
25
25
  var l = "";
26
26
  for (var c in p)
27
27
  p[c] && (l += "; " + c, p[c] !== !0 && (l += "=" + p[c].split(";")[0]));
@@ -50,16 +50,16 @@ function P(e, t) {
50
50
  r(
51
51
  i,
52
52
  "",
53
- A({}, d, {
53
+ k({}, d, {
54
54
  expires: -1
55
55
  })
56
56
  );
57
57
  },
58
58
  withAttributes: function(i) {
59
- return P(this.converter, A({}, this.attributes, i));
59
+ return j(this.converter, k({}, this.attributes, i));
60
60
  },
61
61
  withConverter: function(i) {
62
- return P(A({}, this.converter, i), this.attributes);
62
+ return j(k({}, this.converter, i), this.attributes);
63
63
  }
64
64
  },
65
65
  {
@@ -68,254 +68,98 @@ function P(e, t) {
68
68
  }
69
69
  );
70
70
  }
71
- var ee = P(H, { path: "/" }), re = Object.defineProperty, te = (e, t, r) => t in e ? re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, F = (e, t, r) => (te(e, typeof t != "symbol" ? t + "" : t, r), r), R = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = "AlreadyInitialized", e[e.NoAppNameOrKey = 1001] = "NoAppNameOrKey", e[e.MissingAppController = 1002] = "MissingAppController", e[e.MissingCapabilityOnApp = 1003] = "MissingCapabilityOnApp", e[e.MissingManagedObjectProvider = 1004] = "MissingManagedObjectProvider", e[e.NoManifest = 1005] = "NoManifest", e[e.NoRootElement = 1006] = "NoRootElement", e[e.NoView = 1007] = "NoView", e[e.CookieKeyNotDefined = 1008] = "CookieKeyNotDefined", e[e.CookieCategoryNotAllowed = 1009] = "CookieCategoryNotAllowed", e[e.StorageKeyNotDefined = 1010] = "StorageKeyNotDefined", e[e.StorageCategoryNotAllowed = 1011] = "StorageCategoryNotAllowed", e))(R || {});
72
- function oe(e, t) {
71
+ var X = j(H, { path: "/" }), Y = Object.defineProperty, ee = (e, t, r) => t in e ? Y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, I = (e, t, r) => (ee(e, typeof t != "symbol" ? t + "" : t, r), r), q = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = "AlreadyInitialized", e[e.NoAppNameOrKey = 1001] = "NoAppNameOrKey", e[e.MissingAppController = 1002] = "MissingAppController", e[e.MissingCapabilityOnApp = 1003] = "MissingCapabilityOnApp", e[e.MissingManagedObjectProvider = 1004] = "MissingManagedObjectProvider", e[e.NoManifest = 1005] = "NoManifest", e[e.NoRootElement = 1006] = "NoRootElement", e[e.NoView = 1007] = "NoView", e[e.CookieKeyNotDefined = 1008] = "CookieKeyNotDefined", e[e.CookieCategoryNotAllowed = 1009] = "CookieCategoryNotAllowed", e[e.StorageKeyNotDefined = 1010] = "StorageKeyNotDefined", e[e.StorageCategoryNotAllowed = 1011] = "StorageCategoryNotAllowed", e[e.LocalizationTemplateNotDefined = 1012] = "LocalizationTemplateNotDefined", e))(q || {});
72
+ function re(e, t) {
73
73
  return Object.entries(t).reduce((r, [a, i]) => r.replaceAll(`{{${a}}}`, i), e);
74
74
  }
75
- const ne = {
75
+ const te = {
76
76
  // framework
77
- [
78
- 1e3
79
- /* AlreadyInitialized */
80
- ]: "The runtime has already been initialized",
81
- [
82
- 1001
83
- /* NoAppNameOrKey */
84
- ]: "App name and/or app key is not defined on global scope",
85
- [
86
- 1002
87
- /* MissingAppController */
88
- ]: "No app controller registered for app '{{app}}'",
89
- [
90
- 1003
91
- /* MissingCapabilityOnApp */
92
- ]: "No capability '{{capability}}' enabled for app '{{app}}'",
93
- [
94
- 1004
95
- /* MissingManagedObjectProvider */
96
- ]: "No managed object provider registered for object '{{object}}'",
97
- [
98
- 1005
99
- /* NoManifest */
100
- ]: "The current apps manifest is not defined on global scope",
101
- [
102
- 1006
103
- /* NoRootElement */
104
- ]: "Could not find the root element in the DOM",
105
- [
106
- 1007
107
- /* NoView */
108
- ]: "Could not find view with id '{{id}}' on view controller for app '{{app}}'",
109
- [
110
- 1008
111
- /* CookieKeyNotDefined */
112
- ]: "Cookie key '{{key}}' not present in manifest, cookie has not been set",
113
- [
114
- 1009
115
- /* CookieCategoryNotAllowed */
116
- ]: "Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set",
117
- [
118
- 1010
119
- /* StorageKeyNotDefined */
120
- ]: "Storage key '{{key}}' not present in manifest, item has not been stored",
121
- [
122
- 1011
123
- /* StorageCategoryNotAllowed */
124
- ]: "Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored",
77
+ 1e3: "The runtime has already been initialized",
78
+ 1001: "App name and/or app key is not defined on global scope",
79
+ 1002: "No app controller registered for app '{{app}}'",
80
+ 1003: "No capability '{{capability}}' enabled for app '{{app}}'",
81
+ 1004: "No managed object provider registered for object '{{object}}'",
82
+ 1005: "The current apps manifest is not defined on global scope",
83
+ 1006: "Could not find the root element in the DOM",
84
+ 1007: "Could not find view with id '{{id}}' on view controller for app '{{app}}'",
85
+ 1008: "Cookie key '{{key}}' not present in manifest, cookie has not been set",
86
+ 1009: "Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set",
87
+ 1010: "Storage key '{{key}}' not present in manifest, item has not been stored",
88
+ 1011: "Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored",
89
+ 1012: "The translation template, referred by the key '{{key}}' is being used in app, but is not defined in the manifest.",
125
90
  // utilities
126
- [
127
- 2e3
128
- /* CurrentUserMissingProvider */
129
- ]: "No managed object provider registered for object 'currentUser'",
130
- [
131
- 2001
132
- /* CurrentUserGatewayNotStarted */
133
- ]: "Could not access the gateway when querying 'currentUser'",
134
- [
135
- 2002
136
- /* CurrentUserMissingBackend */
137
- ]: "Could not access the required backend when querying 'currentUser'",
138
- [
139
- 2003
140
- /* CurrentUserMissingInDatabase */
141
- ]: "Could not locate the authenticated user in the Alliance database"
142
- }, ae = "AllianceError";
143
- class ie extends Error {
91
+ 2e3: "No managed object provider registered for object 'currentUser'",
92
+ 2001: "Could not access the gateway when querying 'currentUser'",
93
+ 2002: "Could not access the required backend when querying 'currentUser'",
94
+ 2003: "Could not locate the authenticated user in the Alliance database"
95
+ }, oe = "AllianceError";
96
+ class ne extends Error {
144
97
  constructor(t, r = {}) {
145
- const a = oe(ne[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
146
- super(a), this.code = t, this.name = ae, this.stack = `[${t}] - ${a}
98
+ const a = re(te[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
99
+ super(a), this.code = t, this.name = oe, this.stack = `[${t}] - ${a}
147
100
  ` + i;
148
101
  }
149
102
  }
150
- var z = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))(z || {});
151
- const se = {
152
- [
153
- 15
154
- /* Done */
155
- ]: "Done",
156
- [
157
- 22
158
- /* NoWorkspaceName */
159
- ]: "No workspace name provided!",
160
- [
161
- 19
162
- /* NoAppName */
163
- ]: "No app name provided!",
164
- [
165
- 0
166
- /* AlreadyExists */
167
- ]: "File or directory '{0}' already exists!",
168
- [
169
- 21
170
- /* NoAppOrWorkspaceInCurrentDirectory */
171
- ]: "Could not find any app entry file at '{0}'!",
172
- [
173
- 33
174
- /* UnrecognizedCommand */
175
- ]: "Unrecognized command(s) {0}!",
176
- [
177
- 34
178
- /* WorkspaceCreated */
179
- ]: "Workspace was created at path '{0}'!",
180
- [
181
- 4
182
- /* AppCreated */
183
- ]: "App was created at path '{0}'!",
184
- [
185
- 25
186
- /* ServedStopped */
187
- ]: "Server stopped.",
188
- [
189
- 11
190
- /* CreateWorkspaceDescription */
191
- ]: "Creates an Alliance Workspace in the current directory.",
192
- [
193
- 10
194
- /* CreateAppDescription */
195
- ]: "Creates an Alliance Application in the current directory or Alliance Workspace.",
196
- [
197
- 24
198
- /* ServeDescription */
199
- ]: "Starts a Alliance development server using the current directory package.json.",
200
- [
201
- 7
202
- /* BuildDescription */
203
- ]: "Builds an Alliance Application using Vite.",
204
- [
205
- 35
206
- /* WorkspaceNameInquiry */
207
- ]: "Enter the name of your workspace",
208
- [
209
- 28
210
- /* ServerModeInquiry */
211
- ]: "Which server mode do you want to use?",
212
- [
213
- 6
214
- /* AppNameInquiry */
215
- ]: "Enter the name of your app",
216
- [
217
- 18
218
- /* MissingTranslationKey */
219
- ]: "No translation key provided!",
220
- [
221
- 23
222
- /* OperationCancelled */
223
- ]: "Operation cancelled.",
224
- [
225
- 30
226
- /* StopServerInstructions */
227
- ]: `Press CTRL + C to stop the server.
103
+ var $ = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))($ || {});
104
+ const ae = {
105
+ 15: "Done",
106
+ 22: "No workspace name provided!",
107
+ 19: "No app name provided!",
108
+ 0: "File or directory '{0}' already exists!",
109
+ 21: "Could not find any app entry file at '{0}'!",
110
+ 33: "Unrecognized command(s) {0}!",
111
+ 34: "Workspace was created at path '{0}'!",
112
+ 4: "App was created at path '{0}'!",
113
+ 25: "Server stopped.",
114
+ 11: "Creates an Alliance Workspace in the current directory.",
115
+ 10: "Creates an Alliance Application in the current directory or Alliance Workspace.",
116
+ 24: "Starts a Alliance development server using the current directory package.json.",
117
+ 7: "Builds an Alliance Application using Vite.",
118
+ 35: "Enter the name of your workspace",
119
+ 28: "Which server mode do you want to use?",
120
+ 6: "Enter the name of your app",
121
+ 18: "No translation key provided!",
122
+ 23: "Operation cancelled.",
123
+ 30: `Press CTRL + C to stop the server.
228
124
  `,
229
- [
230
- 32
231
- /* TemplateLanguageInquiry */
232
- ]: "Select preferred language",
233
- [
234
- 31
235
- /* TemplateFrameworkInquiry */
236
- ]: "Select preferred framework template",
237
- [
238
- 13
239
- /* DevServerPortDescription */
240
- ]: "The port that the dev server should use.",
241
- [
242
- 14
243
- /* DevServerLoggingDescription */
244
- ]: "Whether the dev server and browser console should output more log information or not (false).",
245
- [
246
- 1
247
- /* ApiGatewayPortDescription */
248
- ]: "The port that the api gateway should use.",
249
- [
250
- 2
251
- /* ApiServerModeDescription */
252
- ]: "Which components to start. [server|server-proxy|server-gateway].",
253
- [
254
- 12
255
- /* DevServerOpenDescription */
256
- ]: "Whether the dev server should automatically open in your browser or not.",
257
- [
258
- 9
259
- /* BuildWatchDescription */
260
- ]: "Whether the build should start watching and rebuild when files change or not.",
261
- [
262
- 5
263
- /* AppEntryBuildOptionDescription */
264
- ]: "The entry file for the app (./src/app).",
265
- [
266
- 17
267
- /* ManifestEntryBuildOptionDescription */
268
- ]: "The entry file for the app manifest (./src/manifest).",
269
- [
270
- 8
271
- /* BuildModeOptionDescription */
272
- ]: "Which mode to use when building the app.",
273
- [
274
- 16
275
- /* FetchPackageVersionError */
276
- ]: "Failed to fetch package info from the NPM registry for package '${0}'!",
277
- [
278
- 20
279
- /* NoAppNameFound */
280
- ]: "Could not find app name in manifest.",
281
- [
282
- 3
283
- /* AppConfigurationPath */
284
- ]: "The path to the app configuration file.",
285
- [
286
- 27
287
- /* ServerMode */
288
- ]: "Server",
289
- [
290
- 29
291
- /* ServerProxyMode */
292
- ]: "Server with proxy",
293
- [
294
- 26
295
- /* ServerGatewayMode */
296
- ]: "Server with gateway"
297
- }, j = class {
125
+ 32: "Select preferred language",
126
+ 31: "Select preferred framework template",
127
+ 13: "The port that the dev server should use.",
128
+ 14: "Whether the dev server and browser console should output more log information or not (false).",
129
+ 1: "The port that the api gateway should use.",
130
+ 2: "Which components to start. [server|server-proxy|server-gateway].",
131
+ 12: "Whether the dev server should automatically open in your browser or not.",
132
+ 9: "Whether the build should start watching and rebuild when files change or not.",
133
+ 5: "The entry file for the app (./src/app).",
134
+ 17: "The entry file for the app manifest (./src/manifest).",
135
+ 8: "Which mode to use when building the app.",
136
+ 16: "Failed to fetch package info from the NPM registry for package '${0}'!",
137
+ 20: "Could not find app name in manifest.",
138
+ 3: "The path to the app configuration file.",
139
+ 27: "Server",
140
+ 29: "Server with proxy",
141
+ 26: "Server with gateway"
142
+ }, m = class {
298
143
  };
299
- let M = j;
300
- F(M, "getTranslations", () => se), F(M, "getTranslation", (e, ...t) => {
301
- const r = j.getTranslations()[e];
144
+ I(m, "getTranslations", () => ae), I(m, "getTranslation", (e, ...t) => {
145
+ const r = m.getTranslations()[e];
302
146
  if (!r)
303
147
  throw new Error(`Could not find text with given key '${e}'.`);
304
148
  return t.reduce(
305
149
  (a, i, d) => a.toString().replace(`{${d}}`, i.toString()),
306
150
  r
307
151
  ).toString();
308
- }), F(M, "get", (e = z.MissingTranslationKey, ...t) => j.getTranslation(e, ...t));
309
- function ce(e) {
152
+ }), I(m, "get", (e = $.MissingTranslationKey, ...t) => m.getTranslation(e, ...t));
153
+ function ie(e) {
310
154
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
311
155
  }
312
- var x = { exports: {} }, I, B;
313
- function pe() {
314
- if (B)
315
- return I;
316
- B = 1;
156
+ var P = { exports: {} }, O, W;
157
+ function se() {
158
+ if (W)
159
+ return O;
160
+ W = 1;
317
161
  var e = 1e3, t = e * 60, r = t * 60, a = r * 24, i = a * 7, d = a * 365.25;
318
- I = function(o, n) {
162
+ O = function(o, n) {
319
163
  n = n || {};
320
164
  var s = typeof o;
321
165
  if (s === "string" && o.length > 0)
@@ -332,8 +176,8 @@ function pe() {
332
176
  o
333
177
  );
334
178
  if (n) {
335
- var s = parseFloat(n[1]), C = (n[2] || "ms").toLowerCase();
336
- switch (C) {
179
+ var s = parseFloat(n[1]), y = (n[2] || "ms").toLowerCase();
180
+ switch (y) {
337
181
  case "years":
338
182
  case "year":
339
183
  case "yrs":
@@ -386,14 +230,14 @@ function pe() {
386
230
  var n = Math.abs(o);
387
231
  return n >= a ? u(o, n, a, "day") : n >= r ? u(o, n, r, "hour") : n >= t ? u(o, n, t, "minute") : n >= e ? u(o, n, e, "second") : o + " ms";
388
232
  }
389
- function u(o, n, s, C) {
390
- var v = n >= s * 1.5;
391
- return Math.round(o / s) + " " + C + (v ? "s" : "");
233
+ function u(o, n, s, y) {
234
+ var b = n >= s * 1.5;
235
+ return Math.round(o / s) + " " + y + (b ? "s" : "");
392
236
  }
393
- return I;
237
+ return O;
394
238
  }
395
- function de(e) {
396
- r.debug = r, r.default = r, r.coerce = c, r.disable = d, r.enable = i, r.enabled = p, r.humanize = pe(), r.destroy = u, Object.keys(e).forEach((o) => {
239
+ function ce(e) {
240
+ r.debug = r, r.default = r, r.coerce = c, r.disable = d, r.enable = i, r.enabled = p, r.humanize = se(), r.destroy = u, Object.keys(e).forEach((o) => {
397
241
  r[o] = e[o];
398
242
  }), r.names = [], r.skips = [], r.formatters = {};
399
243
  function t(o) {
@@ -404,29 +248,29 @@ function de(e) {
404
248
  }
405
249
  r.selectColor = t;
406
250
  function r(o) {
407
- let n, s = null, C, v;
251
+ let n, s = null, y, b;
408
252
  function h(...g) {
409
253
  if (!h.enabled)
410
254
  return;
411
- const y = h, w = Number(/* @__PURE__ */ new Date()), Q = w - (n || w);
412
- y.diff = Q, y.prev = n, y.curr = w, n = w, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
413
- let b = 0;
414
- g[0] = g[0].replace(/%([a-zA-Z%])/g, (D, Y) => {
415
- if (D === "%%")
255
+ const f = h, A = Number(/* @__PURE__ */ new Date()), Z = A - (n || A);
256
+ f.diff = Z, f.prev = n, f.curr = A, n = A, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
257
+ let N = 0;
258
+ g[0] = g[0].replace(/%([a-zA-Z%])/g, (M, J) => {
259
+ if (M === "%%")
416
260
  return "%";
417
- b++;
418
- const U = r.formatters[Y];
419
- if (typeof U == "function") {
420
- const X = g[b];
421
- D = U.call(y, X), g.splice(b, 1), b--;
261
+ N++;
262
+ const x = r.formatters[J];
263
+ if (typeof x == "function") {
264
+ const Q = g[N];
265
+ M = x.call(f, Q), g.splice(N, 1), N--;
422
266
  }
423
- return D;
424
- }), r.formatArgs.call(y, g), (y.log || r.log).apply(y, g);
267
+ return M;
268
+ }), r.formatArgs.call(f, g), (f.log || r.log).apply(f, g);
425
269
  }
426
270
  return h.namespace = o, h.useColors = r.useColors(), h.color = r.selectColor(o), h.extend = a, h.destroy = r.destroy, Object.defineProperty(h, "enabled", {
427
271
  enumerable: !0,
428
272
  configurable: !1,
429
- get: () => s !== null ? s : (C !== r.namespaces && (C = r.namespaces, v = r.enabled(o)), v),
273
+ get: () => s !== null ? s : (y !== r.namespaces && (y = r.namespaces, b = r.enabled(o)), b),
430
274
  set: (g) => {
431
275
  s = g;
432
276
  }
@@ -439,8 +283,8 @@ function de(e) {
439
283
  function i(o) {
440
284
  r.save(o), r.namespaces = o, r.names = [], r.skips = [];
441
285
  let n;
442
- const s = (typeof o == "string" ? o : "").split(/[\s,]+/), C = s.length;
443
- for (n = 0; n < C; n++)
286
+ const s = (typeof o == "string" ? o : "").split(/[\s,]+/), y = s.length;
287
+ for (n = 0; n < y; n++)
444
288
  s[n] && (o = s[n].replace(/\*/g, ".*?"), o[0] === "-" ? r.skips.push(new RegExp("^" + o.slice(1) + "$")) : r.names.push(new RegExp("^" + o + "$")));
445
289
  }
446
290
  function d() {
@@ -473,7 +317,7 @@ function de(e) {
473
317
  }
474
318
  return r.enable(r.load()), r;
475
319
  }
476
- var le = de;
320
+ var pe = ce;
477
321
  (function(e, t) {
478
322
  t.formatArgs = a, t.save = i, t.load = d, t.useColors = r, t.storage = p(), t.destroy = (() => {
479
323
  let c = !1;
@@ -597,7 +441,7 @@ var le = de;
597
441
  } catch {
598
442
  }
599
443
  }
600
- e.exports = le(t);
444
+ e.exports = pe(t);
601
445
  const { formatters: l } = e.exports;
602
446
  l.j = function(c) {
603
447
  try {
@@ -606,16 +450,16 @@ var le = de;
606
450
  return "[UnexpectedJSONParseError]: " + u.message;
607
451
  }
608
452
  };
609
- })(x, x.exports);
610
- var ue = x.exports;
611
- const ge = /* @__PURE__ */ ce(ue);
612
- function he() {
453
+ })(P, P.exports);
454
+ var de = P.exports;
455
+ const le = /* @__PURE__ */ ie(de);
456
+ function ue() {
613
457
  try {
614
458
  return ALLIANCE_APP_NAME;
615
459
  } catch {
616
460
  }
617
461
  }
618
- function Ce() {
462
+ function ge() {
619
463
  const e = {
620
464
  environment: "production",
621
465
  logging: !1
@@ -626,8 +470,8 @@ function Ce() {
626
470
  return e;
627
471
  }
628
472
  }
629
- function K() {
630
- if ($())
473
+ function z() {
474
+ if (U())
631
475
  return Promise.resolve();
632
476
  const e = 2e4, t = 5;
633
477
  return new Promise((r, a) => {
@@ -636,26 +480,26 @@ function K() {
636
480
  }, d = setTimeout(() => {
637
481
  i(), a(new Error(`Runtime not initialized after ${e}ms`));
638
482
  }, e), p = setInterval(() => {
639
- $() && (i(), r());
483
+ U() && (i(), r());
640
484
  }, t);
641
485
  });
642
486
  }
643
- function $() {
644
- return S(
487
+ function U() {
488
+ return F(
645
489
  "RUNTIME_INITIALIZED"
646
490
  /* RuntimeInitialized */
647
491
  );
648
492
  }
649
- function S(e = "") {
650
- return globalThis[ye(e)];
493
+ function F(e = "") {
494
+ return globalThis[he(e)];
651
495
  }
652
- function ye(e) {
496
+ function he(e) {
653
497
  return `__ALLIANCE_${e}`;
654
498
  }
655
- function me(e) {
499
+ function ye(e) {
656
500
  return `APP_CONTROLLER_KEY_${e}`;
657
501
  }
658
- var _ = /* @__PURE__ */ ((e) => (e.RuntimeInitialized = "RUNTIME_INITIALIZED", e.RuntimeApps = "RUNTIME_APPS", e.RuntimeManifests = "RUNTIME_MANIFESTS", e))(_ || {});
502
+ var R = /* @__PURE__ */ ((e) => (e.RuntimeInitialized = "RUNTIME_INITIALIZED", e.RuntimeApps = "RUNTIME_APPS", e.RuntimeManifests = "RUNTIME_MANIFESTS", e))(R || {});
659
503
  function fe(e) {
660
504
  return {
661
505
  capabilities: "#25BCDD",
@@ -666,313 +510,158 @@ function fe(e) {
666
510
  system: "#D52C2E"
667
511
  }[e];
668
512
  }
669
- const q = /* @__PURE__ */ new Map();
670
- function m(e) {
671
- let t = q.get(e);
672
- return t || (t = ge(e === "system" ? "[system]" : `[${he()}] ${e}`), t.color = fe(e), t.enabled = ve(), q.set(e, t), t);
513
+ const B = /* @__PURE__ */ new Map();
514
+ function C(e) {
515
+ let t = B.get(e);
516
+ return t || (t = le(e === "system" ? "[system]" : `[${ue()}] ${e}`), t.color = fe(e), t.enabled = Ce(), B.set(e, t), t);
673
517
  }
674
- function ve() {
675
- const e = Ce(), t = ee.get("logging");
518
+ function Ce() {
519
+ const e = ge(), t = X.get("logging");
676
520
  return e.environment === "development" && !!e.logging || t === "true";
677
521
  }
678
- m("system");
679
- m("views");
680
- m("controller");
681
- async function we(e) {
682
- await K();
683
- const t = me(e), r = S(t);
522
+ C("controller");
523
+ async function me(e) {
524
+ await z();
525
+ const t = ye(e), r = F(t);
684
526
  if (!r)
685
527
  return;
686
- const a = S(r);
528
+ const a = F(r);
687
529
  if (a)
688
530
  return a;
689
531
  }
690
- async function be() {
691
- return await K(), (await Promise.all(
692
- S(_.RuntimeApps).map((e) => we(e))
532
+ async function ve() {
533
+ return await z(), (await Promise.all(
534
+ F(R.RuntimeApps).map((e) => me(e))
693
535
  )).filter((e) => !!e);
694
536
  }
695
- m("capabilities");
696
- const O = m("managed-objects");
697
- function Ae(e, t) {
698
- return O("querying objects - object: %o, args: %O", e, t), {
537
+ C("views");
538
+ C("system");
539
+ C("capabilities");
540
+ const E = C("managed-objects");
541
+ function we(e, t) {
542
+ return E("querying objects - object: %o, args: %O", e, t), {
699
543
  async resolve() {
700
- return O("resolving query - object: %o, args: %O", e, t), await (await L(e)).managedObjects.providers.get(e)(t);
544
+ return E("resolving query - object: %o, args: %O", e, t), await (await L(e)).managedObjects.providers.get(e)(t);
701
545
  },
702
546
  async watch(r) {
703
- O("adding watcher - object: %o, args: %O", e, t), (await L(e)).managedObjects.watchers.get(e).push(r);
547
+ E("adding watcher - object: %o, args: %O", e, t), (await L(e)).managedObjects.watchers.get(e).push(r);
704
548
  }
705
549
  };
706
550
  }
707
551
  async function L(e) {
708
- const t = (await be()).find(
552
+ const t = (await ve()).find(
709
553
  (r) => r.managedObjects.providers.has(e) && r.managedObjects.watchers.has(e)
710
554
  );
711
555
  if (!t)
712
- throw new ie(R.MissingManagedObjectProvider, { object: e });
556
+ throw new ne(q.MissingManagedObjectProvider, { object: e });
713
557
  return t;
714
558
  }
715
- m("proxy");
716
- var Ne = Object.defineProperty, ke = (e, t, r) => t in e ? Ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, E = (e, t, r) => (ke(e, typeof t != "symbol" ? t + "" : t, r), r), G = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = "AlreadyInitialized", e[e.NoAppNameOrKey = 1001] = "NoAppNameOrKey", e[e.MissingAppController = 1002] = "MissingAppController", e[e.MissingCapabilityOnApp = 1003] = "MissingCapabilityOnApp", e[e.MissingManagedObjectProvider = 1004] = "MissingManagedObjectProvider", e[e.NoManifest = 1005] = "NoManifest", e[e.NoRootElement = 1006] = "NoRootElement", e[e.NoView = 1007] = "NoView", e[e.CookieKeyNotDefined = 1008] = "CookieKeyNotDefined", e[e.CookieCategoryNotAllowed = 1009] = "CookieCategoryNotAllowed", e[e.StorageKeyNotDefined = 1010] = "StorageKeyNotDefined", e[e.StorageCategoryNotAllowed = 1011] = "StorageCategoryNotAllowed", e))(G || {}), f = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = "CurrentUserMissingProvider", e[e.CurrentUserGatewayNotStarted = 2001] = "CurrentUserGatewayNotStarted", e[e.CurrentUserMissingBackend = 2002] = "CurrentUserMissingBackend", e[e.CurrentUserMissingInDatabase = 2003] = "CurrentUserMissingInDatabase", e))(f || {});
717
- function Se(e, t) {
559
+ C("proxy");
560
+ var be = Object.defineProperty, Ae = (e, t, r) => t in e ? be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, T = (e, t, r) => (Ae(e, typeof t != "symbol" ? t + "" : t, r), r), K = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = "AlreadyInitialized", e[e.NoAppNameOrKey = 1001] = "NoAppNameOrKey", e[e.MissingAppController = 1002] = "MissingAppController", e[e.MissingCapabilityOnApp = 1003] = "MissingCapabilityOnApp", e[e.MissingManagedObjectProvider = 1004] = "MissingManagedObjectProvider", e[e.NoManifest = 1005] = "NoManifest", e[e.NoRootElement = 1006] = "NoRootElement", e[e.NoView = 1007] = "NoView", e[e.CookieKeyNotDefined = 1008] = "CookieKeyNotDefined", e[e.CookieCategoryNotAllowed = 1009] = "CookieCategoryNotAllowed", e[e.StorageKeyNotDefined = 1010] = "StorageKeyNotDefined", e[e.StorageCategoryNotAllowed = 1011] = "StorageCategoryNotAllowed", e[e.LocalizationTemplateNotDefined = 1012] = "LocalizationTemplateNotDefined", e))(K || {}), w = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = "CurrentUserMissingProvider", e[e.CurrentUserGatewayNotStarted = 2001] = "CurrentUserGatewayNotStarted", e[e.CurrentUserMissingBackend = 2002] = "CurrentUserMissingBackend", e[e.CurrentUserMissingInDatabase = 2003] = "CurrentUserMissingInDatabase", e))(w || {});
561
+ function Ne(e, t) {
718
562
  return Object.entries(t).reduce((r, [a, i]) => r.replaceAll(`{{${a}}}`, i), e);
719
563
  }
720
- const De = {
564
+ const ke = {
721
565
  // framework
722
- [
723
- 1e3
724
- /* AlreadyInitialized */
725
- ]: "The runtime has already been initialized",
726
- [
727
- 1001
728
- /* NoAppNameOrKey */
729
- ]: "App name and/or app key is not defined on global scope",
730
- [
731
- 1002
732
- /* MissingAppController */
733
- ]: "No app controller registered for app '{{app}}'",
734
- [
735
- 1003
736
- /* MissingCapabilityOnApp */
737
- ]: "No capability '{{capability}}' enabled for app '{{app}}'",
738
- [
739
- 1004
740
- /* MissingManagedObjectProvider */
741
- ]: "No managed object provider registered for object '{{object}}'",
742
- [
743
- 1005
744
- /* NoManifest */
745
- ]: "The current apps manifest is not defined on global scope",
746
- [
747
- 1006
748
- /* NoRootElement */
749
- ]: "Could not find the root element in the DOM",
750
- [
751
- 1007
752
- /* NoView */
753
- ]: "Could not find view with id '{{id}}' on view controller for app '{{app}}'",
754
- [
755
- 1008
756
- /* CookieKeyNotDefined */
757
- ]: "Cookie key '{{key}}' not present in manifest, cookie has not been set",
758
- [
759
- 1009
760
- /* CookieCategoryNotAllowed */
761
- ]: "Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set",
762
- [
763
- 1010
764
- /* StorageKeyNotDefined */
765
- ]: "Storage key '{{key}}' not present in manifest, item has not been stored",
766
- [
767
- 1011
768
- /* StorageCategoryNotAllowed */
769
- ]: "Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored",
566
+ 1e3: "The runtime has already been initialized",
567
+ 1001: "App name and/or app key is not defined on global scope",
568
+ 1002: "No app controller registered for app '{{app}}'",
569
+ 1003: "No capability '{{capability}}' enabled for app '{{app}}'",
570
+ 1004: "No managed object provider registered for object '{{object}}'",
571
+ 1005: "The current apps manifest is not defined on global scope",
572
+ 1006: "Could not find the root element in the DOM",
573
+ 1007: "Could not find view with id '{{id}}' on view controller for app '{{app}}'",
574
+ 1008: "Cookie key '{{key}}' not present in manifest, cookie has not been set",
575
+ 1009: "Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set",
576
+ 1010: "Storage key '{{key}}' not present in manifest, item has not been stored",
577
+ 1011: "Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored",
578
+ 1012: "The translation template, referred by the key '{{key}}' is being used in app, but is not defined in the manifest.",
770
579
  // utilities
771
- [
772
- 2e3
773
- /* CurrentUserMissingProvider */
774
- ]: "No managed object provider registered for object 'currentUser'",
775
- [
776
- 2001
777
- /* CurrentUserGatewayNotStarted */
778
- ]: "Could not access the gateway when querying 'currentUser'",
779
- [
780
- 2002
781
- /* CurrentUserMissingBackend */
782
- ]: "Could not access the required backend when querying 'currentUser'",
783
- [
784
- 2003
785
- /* CurrentUserMissingInDatabase */
786
- ]: "Could not locate the authenticated user in the Alliance database"
787
- }, V = "AllianceError";
788
- class N extends Error {
580
+ 2e3: "No managed object provider registered for object 'currentUser'",
581
+ 2001: "Could not access the gateway when querying 'currentUser'",
582
+ 2002: "Could not access the required backend when querying 'currentUser'",
583
+ 2003: "Could not locate the authenticated user in the Alliance database"
584
+ }, _ = "AllianceError";
585
+ class D extends Error {
789
586
  constructor(t, r = {}) {
790
- const a = Se(De[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
791
- super(a), this.code = t, this.name = V, this.stack = `[${t}] - ${a}
587
+ const a = Ne(ke[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
588
+ super(a), this.code = t, this.name = _, this.stack = `[${t}] - ${a}
792
589
  ` + i;
793
590
  }
794
591
  }
795
- function Fe(e) {
796
- return !!e.code && e.name === V;
592
+ function De(e) {
593
+ return !!e.code && e.name === _;
797
594
  }
798
- var Z = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))(Z || {});
799
- const Me = {
800
- [
801
- 15
802
- /* Done */
803
- ]: "Done",
804
- [
805
- 22
806
- /* NoWorkspaceName */
807
- ]: "No workspace name provided!",
808
- [
809
- 19
810
- /* NoAppName */
811
- ]: "No app name provided!",
812
- [
813
- 0
814
- /* AlreadyExists */
815
- ]: "File or directory '{0}' already exists!",
816
- [
817
- 21
818
- /* NoAppOrWorkspaceInCurrentDirectory */
819
- ]: "Could not find any app entry file at '{0}'!",
820
- [
821
- 33
822
- /* UnrecognizedCommand */
823
- ]: "Unrecognized command(s) {0}!",
824
- [
825
- 34
826
- /* WorkspaceCreated */
827
- ]: "Workspace was created at path '{0}'!",
828
- [
829
- 4
830
- /* AppCreated */
831
- ]: "App was created at path '{0}'!",
832
- [
833
- 25
834
- /* ServedStopped */
835
- ]: "Server stopped.",
836
- [
837
- 11
838
- /* CreateWorkspaceDescription */
839
- ]: "Creates an Alliance Workspace in the current directory.",
840
- [
841
- 10
842
- /* CreateAppDescription */
843
- ]: "Creates an Alliance Application in the current directory or Alliance Workspace.",
844
- [
845
- 24
846
- /* ServeDescription */
847
- ]: "Starts a Alliance development server using the current directory package.json.",
848
- [
849
- 7
850
- /* BuildDescription */
851
- ]: "Builds an Alliance Application using Vite.",
852
- [
853
- 35
854
- /* WorkspaceNameInquiry */
855
- ]: "Enter the name of your workspace",
856
- [
857
- 28
858
- /* ServerModeInquiry */
859
- ]: "Which server mode do you want to use?",
860
- [
861
- 6
862
- /* AppNameInquiry */
863
- ]: "Enter the name of your app",
864
- [
865
- 18
866
- /* MissingTranslationKey */
867
- ]: "No translation key provided!",
868
- [
869
- 23
870
- /* OperationCancelled */
871
- ]: "Operation cancelled.",
872
- [
873
- 30
874
- /* StopServerInstructions */
875
- ]: `Press CTRL + C to stop the server.
595
+ var G = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))(G || {});
596
+ const Se = {
597
+ 15: "Done",
598
+ 22: "No workspace name provided!",
599
+ 19: "No app name provided!",
600
+ 0: "File or directory '{0}' already exists!",
601
+ 21: "Could not find any app entry file at '{0}'!",
602
+ 33: "Unrecognized command(s) {0}!",
603
+ 34: "Workspace was created at path '{0}'!",
604
+ 4: "App was created at path '{0}'!",
605
+ 25: "Server stopped.",
606
+ 11: "Creates an Alliance Workspace in the current directory.",
607
+ 10: "Creates an Alliance Application in the current directory or Alliance Workspace.",
608
+ 24: "Starts a Alliance development server using the current directory package.json.",
609
+ 7: "Builds an Alliance Application using Vite.",
610
+ 35: "Enter the name of your workspace",
611
+ 28: "Which server mode do you want to use?",
612
+ 6: "Enter the name of your app",
613
+ 18: "No translation key provided!",
614
+ 23: "Operation cancelled.",
615
+ 30: `Press CTRL + C to stop the server.
876
616
  `,
877
- [
878
- 32
879
- /* TemplateLanguageInquiry */
880
- ]: "Select preferred language",
881
- [
882
- 31
883
- /* TemplateFrameworkInquiry */
884
- ]: "Select preferred framework template",
885
- [
886
- 13
887
- /* DevServerPortDescription */
888
- ]: "The port that the dev server should use.",
889
- [
890
- 14
891
- /* DevServerLoggingDescription */
892
- ]: "Whether the dev server and browser console should output more log information or not (false).",
893
- [
894
- 1
895
- /* ApiGatewayPortDescription */
896
- ]: "The port that the api gateway should use.",
897
- [
898
- 2
899
- /* ApiServerModeDescription */
900
- ]: "Which components to start. [server|server-proxy|server-gateway].",
901
- [
902
- 12
903
- /* DevServerOpenDescription */
904
- ]: "Whether the dev server should automatically open in your browser or not.",
905
- [
906
- 9
907
- /* BuildWatchDescription */
908
- ]: "Whether the build should start watching and rebuild when files change or not.",
909
- [
910
- 5
911
- /* AppEntryBuildOptionDescription */
912
- ]: "The entry file for the app (./src/app).",
913
- [
914
- 17
915
- /* ManifestEntryBuildOptionDescription */
916
- ]: "The entry file for the app manifest (./src/manifest).",
917
- [
918
- 8
919
- /* BuildModeOptionDescription */
920
- ]: "Which mode to use when building the app.",
921
- [
922
- 16
923
- /* FetchPackageVersionError */
924
- ]: "Failed to fetch package info from the NPM registry for package '${0}'!",
925
- [
926
- 20
927
- /* NoAppNameFound */
928
- ]: "Could not find app name in manifest.",
929
- [
930
- 3
931
- /* AppConfigurationPath */
932
- ]: "The path to the app configuration file.",
933
- [
934
- 27
935
- /* ServerMode */
936
- ]: "Server",
937
- [
938
- 29
939
- /* ServerProxyMode */
940
- ]: "Server with proxy",
941
- [
942
- 26
943
- /* ServerGatewayMode */
944
- ]: "Server with gateway"
945
- }, W = class {
617
+ 32: "Select preferred language",
618
+ 31: "Select preferred framework template",
619
+ 13: "The port that the dev server should use.",
620
+ 14: "Whether the dev server and browser console should output more log information or not (false).",
621
+ 1: "The port that the api gateway should use.",
622
+ 2: "Which components to start. [server|server-proxy|server-gateway].",
623
+ 12: "Whether the dev server should automatically open in your browser or not.",
624
+ 9: "Whether the build should start watching and rebuild when files change or not.",
625
+ 5: "The entry file for the app (./src/app).",
626
+ 17: "The entry file for the app manifest (./src/manifest).",
627
+ 8: "Which mode to use when building the app.",
628
+ 16: "Failed to fetch package info from the NPM registry for package '${0}'!",
629
+ 20: "Could not find app name in manifest.",
630
+ 3: "The path to the app configuration file.",
631
+ 27: "Server",
632
+ 29: "Server with proxy",
633
+ 26: "Server with gateway"
634
+ }, v = class {
946
635
  };
947
- let T = W;
948
- E(T, "getTranslations", () => Me), E(T, "getTranslation", (e, ...t) => {
949
- const r = W.getTranslations()[e];
636
+ T(v, "getTranslations", () => Se), T(v, "getTranslation", (e, ...t) => {
637
+ const r = v.getTranslations()[e];
950
638
  if (!r)
951
639
  throw new Error(`Could not find text with given key '${e}'.`);
952
640
  return t.reduce(
953
641
  (a, i, d) => a.toString().replace(`{${d}}`, i.toString()),
954
642
  r
955
643
  ).toString();
956
- }), E(T, "get", (e = Z.MissingTranslationKey, ...t) => W.getTranslation(e, ...t));
957
- let k;
958
- async function J() {
644
+ }), T(v, "get", (e = G.MissingTranslationKey, ...t) => v.getTranslation(e, ...t));
645
+ let S;
646
+ async function V() {
959
647
  try {
960
- return k || (k = await Ae("currentUser").resolve(), k);
648
+ return S || (S = await we("currentUser").resolve(), S);
961
649
  } catch (e) {
962
- throw Fe(e) && e.code === G.MissingManagedObjectProvider ? new N(f.CurrentUserMissingProvider) : e.message.includes("GraphQL Error (Code: 404)") ? new N(f.CurrentUserGatewayNotStarted) : e.message.includes("GraphQL Error (Code: 500)") ? new N(f.CurrentUserMissingBackend) : e.message.includes("GraphQL Error (Code: 200)") && e.message.includes("Cannot return null for non-nullable field") ? new N(f.CurrentUserMissingInDatabase) : e;
650
+ throw De(e) && e.code === K.MissingManagedObjectProvider ? new D(w.CurrentUserMissingProvider) : e.message.includes("GraphQL Error (Code: 404)") ? new D(w.CurrentUserGatewayNotStarted) : e.message.includes("GraphQL Error (Code: 500)") ? new D(w.CurrentUserMissingBackend) : e.message.includes("GraphQL Error (Code: 200)") && e.message.includes("Cannot return null for non-nullable field") ? new D(w.CurrentUserMissingInDatabase) : e;
963
651
  }
964
652
  }
965
653
  async function Ie() {
966
- const e = await J();
967
- return !!e && e.type === "super-admin";
654
+ const e = await V();
655
+ return !!e && e.type === "system-admin";
968
656
  }
969
657
  async function Oe(e, t) {
970
- const r = await J();
658
+ const r = await V();
971
659
  return !!(r != null && r.permissions.find(
972
660
  ({ permission: a }) => a.app.name === e && a.name === t
973
661
  ));
974
662
  }
975
663
  export {
664
+ V as getCurrentUser,
976
665
  Oe as hasPermission,
977
666
  Ie as isSystemAdmin
978
667
  };