@telia-ace/alliance-utilities 1.0.11 → 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/CHANGELOG.md +9 -0
- package/dist/current-user.d.ts +14 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +221 -532
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! js-cookie v3.0.5 | MIT */
|
|
2
|
-
function
|
|
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
|
|
21
|
+
function j(e, t) {
|
|
22
22
|
function r(i, d, p) {
|
|
23
23
|
if (!(typeof document > "u")) {
|
|
24
|
-
p =
|
|
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
|
-
|
|
53
|
+
k({}, d, {
|
|
54
54
|
expires: -1
|
|
55
55
|
})
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
withAttributes: function(i) {
|
|
59
|
-
return
|
|
59
|
+
return j(this.converter, k({}, this.attributes, i));
|
|
60
60
|
},
|
|
61
61
|
withConverter: function(i) {
|
|
62
|
-
return
|
|
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
|
|
72
|
-
function
|
|
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
|
|
75
|
+
const te = {
|
|
76
76
|
// framework
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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 =
|
|
146
|
-
super(a), this.code = t, this.name =
|
|
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
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
300
|
-
|
|
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
|
-
}),
|
|
309
|
-
function
|
|
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
|
|
313
|
-
function
|
|
314
|
-
if (
|
|
315
|
-
return
|
|
316
|
-
|
|
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
|
-
|
|
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]),
|
|
336
|
-
switch (
|
|
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,
|
|
390
|
-
var
|
|
391
|
-
return Math.round(o / 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
|
|
237
|
+
return O;
|
|
394
238
|
}
|
|
395
|
-
function
|
|
396
|
-
r.debug = r, r.default = r, r.coerce = c, r.disable = d, r.enable = i, r.enabled = p, r.humanize =
|
|
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,
|
|
251
|
+
let n, s = null, y, b;
|
|
408
252
|
function h(...g) {
|
|
409
253
|
if (!h.enabled)
|
|
410
254
|
return;
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
let
|
|
414
|
-
g[0] = g[0].replace(/%([a-zA-Z%])/g, (
|
|
415
|
-
if (
|
|
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
|
-
|
|
418
|
-
const
|
|
419
|
-
if (typeof
|
|
420
|
-
const
|
|
421
|
-
|
|
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
|
|
424
|
-
}), r.formatArgs.call(
|
|
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 : (
|
|
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,]+/),
|
|
443
|
-
for (n = 0; 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
|
|
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 =
|
|
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
|
-
})(
|
|
610
|
-
var
|
|
611
|
-
const
|
|
612
|
-
function
|
|
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
|
|
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
|
|
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
|
-
|
|
483
|
+
U() && (i(), r());
|
|
640
484
|
}, t);
|
|
641
485
|
});
|
|
642
486
|
}
|
|
643
|
-
function
|
|
644
|
-
return
|
|
487
|
+
function U() {
|
|
488
|
+
return F(
|
|
645
489
|
"RUNTIME_INITIALIZED"
|
|
646
490
|
/* RuntimeInitialized */
|
|
647
491
|
);
|
|
648
492
|
}
|
|
649
|
-
function
|
|
650
|
-
return globalThis[
|
|
493
|
+
function F(e = "") {
|
|
494
|
+
return globalThis[he(e)];
|
|
651
495
|
}
|
|
652
|
-
function
|
|
496
|
+
function he(e) {
|
|
653
497
|
return `__ALLIANCE_${e}`;
|
|
654
498
|
}
|
|
655
|
-
function
|
|
499
|
+
function ye(e) {
|
|
656
500
|
return `APP_CONTROLLER_KEY_${e}`;
|
|
657
501
|
}
|
|
658
|
-
var
|
|
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
|
|
670
|
-
function
|
|
671
|
-
let t =
|
|
672
|
-
return 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
|
|
675
|
-
const e =
|
|
518
|
+
function Ce() {
|
|
519
|
+
const e = ge(), t = X.get("logging");
|
|
676
520
|
return e.environment === "development" && !!e.logging || t === "true";
|
|
677
521
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
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 =
|
|
528
|
+
const a = F(r);
|
|
687
529
|
if (a)
|
|
688
530
|
return a;
|
|
689
531
|
}
|
|
690
|
-
async function
|
|
691
|
-
return await
|
|
692
|
-
|
|
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
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
556
|
+
throw new ne(q.MissingManagedObjectProvider, { object: e });
|
|
713
557
|
return t;
|
|
714
558
|
}
|
|
715
|
-
|
|
716
|
-
var
|
|
717
|
-
function
|
|
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
|
|
564
|
+
const ke = {
|
|
721
565
|
// framework
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
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
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
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 =
|
|
791
|
-
super(a), this.code = t, this.name =
|
|
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
|
|
796
|
-
return !!e.code && e.name ===
|
|
592
|
+
function De(e) {
|
|
593
|
+
return !!e.code && e.name === _;
|
|
797
594
|
}
|
|
798
|
-
var
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
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
|
-
|
|
948
|
-
|
|
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
|
-
}),
|
|
957
|
-
let
|
|
958
|
-
async function
|
|
644
|
+
}), T(v, "get", (e = G.MissingTranslationKey, ...t) => v.getTranslation(e, ...t));
|
|
645
|
+
let S;
|
|
646
|
+
async function V() {
|
|
959
647
|
try {
|
|
960
|
-
return
|
|
648
|
+
return S || (S = await we("currentUser").resolve(), S);
|
|
961
649
|
} catch (e) {
|
|
962
|
-
throw
|
|
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
|
|
967
|
-
return !!e && e.type === "
|
|
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
|
|
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
|
};
|