@telia-ace/alliance-utilities 1.0.11 → 1.0.12-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/get-current-user.d.ts +18 -0
- package/dist/get-translator.d.ts +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +273 -555
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/dist/current-user.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! js-cookie v3.0.5 | MIT */
|
|
2
|
-
function
|
|
2
|
+
function F(e) {
|
|
3
3
|
for (var t = 1; t < arguments.length; t++) {
|
|
4
4
|
var r = arguments[t];
|
|
5
5
|
for (var a in r)
|
|
@@ -7,7 +7,7 @@ function A(e) {
|
|
|
7
7
|
}
|
|
8
8
|
return e;
|
|
9
9
|
}
|
|
10
|
-
var
|
|
10
|
+
var X = {
|
|
11
11
|
read: function(e) {
|
|
12
12
|
return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
13
13
|
},
|
|
@@ -19,47 +19,47 @@ var H = {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
function P(e, t) {
|
|
22
|
-
function r(i,
|
|
22
|
+
function r(i, p, l) {
|
|
23
23
|
if (!(typeof document > "u")) {
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
for (var c in
|
|
27
|
-
|
|
28
|
-
return document.cookie = i + "=" + e.write(
|
|
24
|
+
l = F({}, t, l), typeof l.expires == "number" && (l.expires = new Date(Date.now() + l.expires * 864e5)), l.expires && (l.expires = l.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
25
|
+
var d = "";
|
|
26
|
+
for (var c in l)
|
|
27
|
+
l[c] && (d += "; " + c, l[c] !== !0 && (d += "=" + l[c].split(";")[0]));
|
|
28
|
+
return document.cookie = i + "=" + e.write(p, i) + d;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
function a(i) {
|
|
32
32
|
if (!(typeof document > "u" || arguments.length && !i)) {
|
|
33
|
-
for (var
|
|
34
|
-
var c = d
|
|
33
|
+
for (var p = document.cookie ? document.cookie.split("; ") : [], l = {}, d = 0; d < p.length; d++) {
|
|
34
|
+
var c = p[d].split("="), u = c.slice(1).join("=");
|
|
35
35
|
try {
|
|
36
36
|
var o = decodeURIComponent(c[0]);
|
|
37
|
-
if (
|
|
37
|
+
if (l[o] = e.read(u, o), i === o)
|
|
38
38
|
break;
|
|
39
39
|
} catch {
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
return i ?
|
|
42
|
+
return i ? l[i] : l;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return Object.create(
|
|
46
46
|
{
|
|
47
47
|
set: r,
|
|
48
48
|
get: a,
|
|
49
|
-
remove: function(i,
|
|
49
|
+
remove: function(i, p) {
|
|
50
50
|
r(
|
|
51
51
|
i,
|
|
52
52
|
"",
|
|
53
|
-
|
|
53
|
+
F({}, p, {
|
|
54
54
|
expires: -1
|
|
55
55
|
})
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
withAttributes: function(i) {
|
|
59
|
-
return P(this.converter,
|
|
59
|
+
return P(this.converter, F({}, this.attributes, i));
|
|
60
60
|
},
|
|
61
61
|
withConverter: function(i) {
|
|
62
|
-
return P(
|
|
62
|
+
return P(F({}, this.converter, i), this.attributes);
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
{
|
|
@@ -68,278 +68,122 @@ function P(e, t) {
|
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
var
|
|
72
|
-
function
|
|
71
|
+
var Y = P(X, { path: "/" }), ee = Object.defineProperty, re = (e, t, r) => t in e ? ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, I = (e, t, r) => (re(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[e.LocalizationTemplateNotDefined = 1012] = "LocalizationTemplateNotDefined", e))(R || {});
|
|
72
|
+
function te(e, t) {
|
|
73
73
|
return Object.entries(t).reduce((r, [a, i]) => r.replaceAll(`{{${a}}}`, i), e);
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const oe = {
|
|
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
|
-
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";
|
|
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
|
+
}, ne = "AllianceError";
|
|
143
96
|
class ie extends Error {
|
|
144
97
|
constructor(t, r = {}) {
|
|
145
|
-
const a = oe
|
|
146
|
-
super(a), this.code = t, this.name =
|
|
98
|
+
const a = te(oe[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
|
|
99
|
+
super(a), this.code = t, this.name = ne, 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 K = /* @__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))(K || {});
|
|
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
|
+
}, v = class {
|
|
298
143
|
};
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const r = j.getTranslations()[e];
|
|
144
|
+
I(v, "getTranslations", () => ae), I(v, "getTranslation", (e, ...t) => {
|
|
145
|
+
const r = v.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
|
-
(a, i,
|
|
149
|
+
(a, i, p) => a.toString().replace(`{${p}}`, i.toString()),
|
|
306
150
|
r
|
|
307
151
|
).toString();
|
|
308
|
-
}),
|
|
309
|
-
function
|
|
152
|
+
}), I(v, "get", (e = K.MissingTranslationKey, ...t) => v.getTranslation(e, ...t));
|
|
153
|
+
function se(e) {
|
|
310
154
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
311
155
|
}
|
|
312
|
-
var x = { exports: {} },
|
|
313
|
-
function
|
|
314
|
-
if (
|
|
315
|
-
return
|
|
316
|
-
|
|
317
|
-
var e = 1e3, t = e * 60, r = t * 60, a = r * 24, i = a * 7,
|
|
318
|
-
|
|
156
|
+
var x = { exports: {} }, O, L;
|
|
157
|
+
function ce() {
|
|
158
|
+
if (L)
|
|
159
|
+
return O;
|
|
160
|
+
L = 1;
|
|
161
|
+
var e = 1e3, t = e * 60, r = t * 60, a = r * 24, i = a * 7, p = a * 365.25;
|
|
162
|
+
O = function(o, n) {
|
|
319
163
|
n = n || {};
|
|
320
164
|
var s = typeof o;
|
|
321
165
|
if (s === "string" && o.length > 0)
|
|
322
|
-
return
|
|
166
|
+
return l(o);
|
|
323
167
|
if (s === "number" && isFinite(o))
|
|
324
|
-
return n.long ? c(o) :
|
|
168
|
+
return n.long ? c(o) : d(o);
|
|
325
169
|
throw new Error(
|
|
326
170
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(o)
|
|
327
171
|
);
|
|
328
172
|
};
|
|
329
|
-
function
|
|
173
|
+
function l(o) {
|
|
330
174
|
if (o = String(o), !(o.length > 100)) {
|
|
331
175
|
var n = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
332
176
|
o
|
|
333
177
|
);
|
|
334
178
|
if (n) {
|
|
335
|
-
var s = parseFloat(n[1]),
|
|
336
|
-
switch (
|
|
179
|
+
var s = parseFloat(n[1]), f = (n[2] || "ms").toLowerCase();
|
|
180
|
+
switch (f) {
|
|
337
181
|
case "years":
|
|
338
182
|
case "year":
|
|
339
183
|
case "yrs":
|
|
340
184
|
case "yr":
|
|
341
185
|
case "y":
|
|
342
|
-
return s *
|
|
186
|
+
return s * p;
|
|
343
187
|
case "weeks":
|
|
344
188
|
case "week":
|
|
345
189
|
case "w":
|
|
@@ -378,7 +222,7 @@ function pe() {
|
|
|
378
222
|
}
|
|
379
223
|
}
|
|
380
224
|
}
|
|
381
|
-
function
|
|
225
|
+
function d(o) {
|
|
382
226
|
var n = Math.abs(o);
|
|
383
227
|
return n >= a ? Math.round(o / a) + "d" : n >= r ? Math.round(o / r) + "h" : n >= t ? Math.round(o / t) + "m" : n >= e ? Math.round(o / e) + "s" : o + "ms";
|
|
384
228
|
}
|
|
@@ -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, f) {
|
|
234
|
+
var k = n >= s * 1.5;
|
|
235
|
+
return Math.round(o / s) + " " + f + (k ? "s" : "");
|
|
392
236
|
}
|
|
393
|
-
return
|
|
237
|
+
return O;
|
|
394
238
|
}
|
|
395
|
-
function
|
|
396
|
-
r.debug = r, r.default = r, r.coerce = c, r.disable =
|
|
239
|
+
function pe(e) {
|
|
240
|
+
r.debug = r, r.default = r, r.coerce = c, r.disable = p, r.enable = i, r.enabled = l, r.humanize = ce(), 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, f, k;
|
|
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 C = h, D = Number(/* @__PURE__ */ new Date()), J = D - (n || D);
|
|
256
|
+
C.diff = J, C.prev = n, C.curr = D, n = D, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
|
|
257
|
+
let S = 0;
|
|
258
|
+
g[0] = g[0].replace(/%([a-zA-Z%])/g, (M, Z) => {
|
|
259
|
+
if (M === "%%")
|
|
416
260
|
return "%";
|
|
417
|
-
|
|
418
|
-
const U = r.formatters[
|
|
261
|
+
S++;
|
|
262
|
+
const U = r.formatters[Z];
|
|
419
263
|
if (typeof U == "function") {
|
|
420
|
-
const
|
|
421
|
-
|
|
264
|
+
const H = g[S];
|
|
265
|
+
M = U.call(C, H), g.splice(S, 1), S--;
|
|
422
266
|
}
|
|
423
|
-
return
|
|
424
|
-
}), r.formatArgs.call(
|
|
267
|
+
return M;
|
|
268
|
+
}), r.formatArgs.call(C, g), (C.log || r.log).apply(C, 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 : (f !== r.namespaces && (f = r.namespaces, k = r.enabled(o)), k),
|
|
430
274
|
set: (g) => {
|
|
431
275
|
s = g;
|
|
432
276
|
}
|
|
@@ -439,18 +283,18 @@ 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,]+/), f = s.length;
|
|
287
|
+
for (n = 0; n < f; 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
|
-
function
|
|
290
|
+
function p() {
|
|
447
291
|
const o = [
|
|
448
|
-
...r.names.map(
|
|
449
|
-
...r.skips.map(
|
|
292
|
+
...r.names.map(d),
|
|
293
|
+
...r.skips.map(d).map((n) => "-" + n)
|
|
450
294
|
].join(",");
|
|
451
295
|
return r.enable(""), o;
|
|
452
296
|
}
|
|
453
|
-
function
|
|
297
|
+
function l(o) {
|
|
454
298
|
if (o[o.length - 1] === "*")
|
|
455
299
|
return !0;
|
|
456
300
|
let n, s;
|
|
@@ -462,7 +306,7 @@ function de(e) {
|
|
|
462
306
|
return !0;
|
|
463
307
|
return !1;
|
|
464
308
|
}
|
|
465
|
-
function
|
|
309
|
+
function d(o) {
|
|
466
310
|
return o.toString().substring(2, o.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
467
311
|
}
|
|
468
312
|
function c(o) {
|
|
@@ -473,9 +317,9 @@ function de(e) {
|
|
|
473
317
|
}
|
|
474
318
|
return r.enable(r.load()), r;
|
|
475
319
|
}
|
|
476
|
-
var le =
|
|
320
|
+
var le = pe;
|
|
477
321
|
(function(e, t) {
|
|
478
|
-
t.formatArgs = a, t.save = i, t.load =
|
|
322
|
+
t.formatArgs = a, t.save = i, t.load = p, t.useColors = r, t.storage = l(), t.destroy = (() => {
|
|
479
323
|
let c = !1;
|
|
480
324
|
return () => {
|
|
481
325
|
c || (c = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
|
|
@@ -583,7 +427,7 @@ var le = de;
|
|
|
583
427
|
} catch {
|
|
584
428
|
}
|
|
585
429
|
}
|
|
586
|
-
function
|
|
430
|
+
function p() {
|
|
587
431
|
let c;
|
|
588
432
|
try {
|
|
589
433
|
c = t.storage.getItem("debug");
|
|
@@ -591,15 +435,15 @@ var le = de;
|
|
|
591
435
|
}
|
|
592
436
|
return !c && typeof process < "u" && "env" in process && (c = process.env.DEBUG), c;
|
|
593
437
|
}
|
|
594
|
-
function
|
|
438
|
+
function l() {
|
|
595
439
|
try {
|
|
596
440
|
return localStorage;
|
|
597
441
|
} catch {
|
|
598
442
|
}
|
|
599
443
|
}
|
|
600
444
|
e.exports = le(t);
|
|
601
|
-
const { formatters:
|
|
602
|
-
|
|
445
|
+
const { formatters: d } = e.exports;
|
|
446
|
+
d.j = function(c) {
|
|
603
447
|
try {
|
|
604
448
|
return JSON.stringify(c);
|
|
605
449
|
} catch (u) {
|
|
@@ -607,15 +451,15 @@ var le = de;
|
|
|
607
451
|
}
|
|
608
452
|
};
|
|
609
453
|
})(x, x.exports);
|
|
610
|
-
var
|
|
611
|
-
const
|
|
612
|
-
function
|
|
454
|
+
var de = x.exports;
|
|
455
|
+
const ue = /* @__PURE__ */ se(de);
|
|
456
|
+
function ge() {
|
|
613
457
|
try {
|
|
614
458
|
return ALLIANCE_APP_NAME;
|
|
615
459
|
} catch {
|
|
616
460
|
}
|
|
617
461
|
}
|
|
618
|
-
function
|
|
462
|
+
function he() {
|
|
619
463
|
const e = {
|
|
620
464
|
environment: "production",
|
|
621
465
|
logging: !1
|
|
@@ -626,37 +470,37 @@ function Ce() {
|
|
|
626
470
|
return e;
|
|
627
471
|
}
|
|
628
472
|
}
|
|
629
|
-
function
|
|
473
|
+
function _() {
|
|
630
474
|
if ($())
|
|
631
475
|
return Promise.resolve();
|
|
632
476
|
const e = 2e4, t = 5;
|
|
633
477
|
return new Promise((r, a) => {
|
|
634
478
|
const i = () => {
|
|
635
|
-
clearInterval(
|
|
636
|
-
},
|
|
479
|
+
clearInterval(l), clearTimeout(p);
|
|
480
|
+
}, p = setTimeout(() => {
|
|
637
481
|
i(), a(new Error(`Runtime not initialized after ${e}ms`));
|
|
638
|
-
}, e),
|
|
482
|
+
}, e), l = setInterval(() => {
|
|
639
483
|
$() && (i(), r());
|
|
640
484
|
}, t);
|
|
641
485
|
});
|
|
642
486
|
}
|
|
643
487
|
function $() {
|
|
644
|
-
return
|
|
488
|
+
return N(
|
|
645
489
|
"RUNTIME_INITIALIZED"
|
|
646
490
|
/* RuntimeInitialized */
|
|
647
491
|
);
|
|
648
492
|
}
|
|
649
|
-
function
|
|
650
|
-
return globalThis[
|
|
493
|
+
function N(e = "") {
|
|
494
|
+
return globalThis[fe(e)];
|
|
651
495
|
}
|
|
652
|
-
function
|
|
496
|
+
function fe(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
|
|
659
|
-
function
|
|
502
|
+
var W = /* @__PURE__ */ ((e) => (e.RuntimeInitialized = "RUNTIME_INITIALIZED", e.RuntimeApps = "RUNTIME_APPS", e.RuntimeManifests = "RUNTIME_MANIFESTS", e))(W || {});
|
|
503
|
+
function Ce(e) {
|
|
660
504
|
return {
|
|
661
505
|
capabilities: "#25BCDD",
|
|
662
506
|
"managed-objects": "#FC7A12",
|
|
@@ -666,46 +510,55 @@ function fe(e) {
|
|
|
666
510
|
system: "#D52C2E"
|
|
667
511
|
}[e];
|
|
668
512
|
}
|
|
669
|
-
const
|
|
513
|
+
const B = /* @__PURE__ */ new Map();
|
|
670
514
|
function m(e) {
|
|
671
|
-
let t =
|
|
672
|
-
return t || (t =
|
|
515
|
+
let t = B.get(e);
|
|
516
|
+
return t || (t = ue(e === "system" ? "[system]" : `[${ge()}] ${e}`), t.color = Ce(e), t.enabled = me(), B.set(e, t), t);
|
|
673
517
|
}
|
|
674
|
-
function
|
|
675
|
-
const e =
|
|
518
|
+
function me() {
|
|
519
|
+
const e = he(), t = Y.get("logging");
|
|
676
520
|
return e.environment === "development" && !!e.logging || t === "true";
|
|
677
521
|
}
|
|
678
|
-
m("system");
|
|
679
|
-
m("views");
|
|
680
522
|
m("controller");
|
|
681
|
-
async function
|
|
682
|
-
await
|
|
683
|
-
const t =
|
|
523
|
+
async function ve(e) {
|
|
524
|
+
await _();
|
|
525
|
+
const t = ye(e), r = N(t);
|
|
684
526
|
if (!r)
|
|
685
527
|
return;
|
|
686
|
-
const a =
|
|
528
|
+
const a = N(r);
|
|
687
529
|
if (a)
|
|
688
530
|
return a;
|
|
689
531
|
}
|
|
690
|
-
async function
|
|
691
|
-
return await
|
|
692
|
-
|
|
532
|
+
async function we() {
|
|
533
|
+
return await _(), (await Promise.all(
|
|
534
|
+
N(W.RuntimeApps).map((e) => ve(e))
|
|
693
535
|
)).filter((e) => !!e);
|
|
694
536
|
}
|
|
537
|
+
m("views");
|
|
538
|
+
function be() {
|
|
539
|
+
return structuredClone(N(W.RuntimeManifests));
|
|
540
|
+
}
|
|
541
|
+
function Ae() {
|
|
542
|
+
try {
|
|
543
|
+
return ALLIANCE_APP_MANIFEST;
|
|
544
|
+
} catch {
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
m("system");
|
|
695
548
|
m("capabilities");
|
|
696
|
-
const
|
|
697
|
-
function
|
|
698
|
-
return
|
|
549
|
+
const E = m("managed-objects");
|
|
550
|
+
function G(e, t) {
|
|
551
|
+
return E("querying objects - object: %o, args: %O", e, t), {
|
|
699
552
|
async resolve() {
|
|
700
|
-
return
|
|
553
|
+
return E("resolving query - object: %o, args: %O", e, t), await (await q(e)).managedObjects.providers.get(e)(t);
|
|
701
554
|
},
|
|
702
555
|
async watch(r) {
|
|
703
|
-
|
|
556
|
+
E("adding watcher - object: %o, args: %O", e, t), (await q(e)).managedObjects.watchers.get(e).push(r);
|
|
704
557
|
}
|
|
705
558
|
};
|
|
706
559
|
}
|
|
707
|
-
async function
|
|
708
|
-
const t = (await
|
|
560
|
+
async function q(e) {
|
|
561
|
+
const t = (await we()).find(
|
|
709
562
|
(r) => r.managedObjects.providers.has(e) && r.managedObjects.watchers.has(e)
|
|
710
563
|
);
|
|
711
564
|
if (!t)
|
|
@@ -713,81 +566,34 @@ async function L(e) {
|
|
|
713
566
|
return t;
|
|
714
567
|
}
|
|
715
568
|
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,
|
|
717
|
-
function
|
|
569
|
+
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, T = (e, t, r) => (ke(e, typeof t != "symbol" ? t + "" : t, r), r), z = /* @__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))(z || {}), b = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = "CurrentUserMissingProvider", e[e.CurrentUserGatewayNotStarted = 2001] = "CurrentUserGatewayNotStarted", e[e.CurrentUserMissingBackend = 2002] = "CurrentUserMissingBackend", e[e.CurrentUserMissingInDatabase = 2003] = "CurrentUserMissingInDatabase", e))(b || {});
|
|
570
|
+
function De(e, t) {
|
|
718
571
|
return Object.entries(t).reduce((r, [a, i]) => r.replaceAll(`{{${a}}}`, i), e);
|
|
719
572
|
}
|
|
720
|
-
const
|
|
573
|
+
const Se = {
|
|
721
574
|
// 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",
|
|
575
|
+
1e3: "The runtime has already been initialized",
|
|
576
|
+
1001: "App name and/or app key is not defined on global scope",
|
|
577
|
+
1002: "No app controller registered for app '{{app}}'",
|
|
578
|
+
1003: "No capability '{{capability}}' enabled for app '{{app}}'",
|
|
579
|
+
1004: "No managed object provider registered for object '{{object}}'",
|
|
580
|
+
1005: "The current apps manifest is not defined on global scope",
|
|
581
|
+
1006: "Could not find the root element in the DOM",
|
|
582
|
+
1007: "Could not find view with id '{{id}}' on view controller for app '{{app}}'",
|
|
583
|
+
1008: "Cookie key '{{key}}' not present in manifest, cookie has not been set",
|
|
584
|
+
1009: "Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set",
|
|
585
|
+
1010: "Storage key '{{key}}' not present in manifest, item has not been stored",
|
|
586
|
+
1011: "Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored",
|
|
587
|
+
1012: "The translation template, referred by the key '{{key}}' is being used in app, but is not defined in the manifest.",
|
|
770
588
|
// utilities
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
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"
|
|
589
|
+
2e3: "No managed object provider registered for object 'currentUser'",
|
|
590
|
+
2001: "Could not access the gateway when querying 'currentUser'",
|
|
591
|
+
2002: "Could not access the required backend when querying 'currentUser'",
|
|
592
|
+
2003: "Could not locate the authenticated user in the Alliance database"
|
|
787
593
|
}, V = "AllianceError";
|
|
788
|
-
class
|
|
594
|
+
class A extends Error {
|
|
789
595
|
constructor(t, r = {}) {
|
|
790
|
-
const a = Se
|
|
596
|
+
const a = De(Se[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
|
|
791
597
|
super(a), this.code = t, this.name = V, this.stack = `[${t}] - ${a}
|
|
792
598
|
` + i;
|
|
793
599
|
}
|
|
@@ -795,185 +601,97 @@ class N extends Error {
|
|
|
795
601
|
function Fe(e) {
|
|
796
602
|
return !!e.code && e.name === V;
|
|
797
603
|
}
|
|
798
|
-
var
|
|
604
|
+
var Q = /* @__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))(Q || {});
|
|
799
605
|
const Me = {
|
|
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.
|
|
606
|
+
15: "Done",
|
|
607
|
+
22: "No workspace name provided!",
|
|
608
|
+
19: "No app name provided!",
|
|
609
|
+
0: "File or directory '{0}' already exists!",
|
|
610
|
+
21: "Could not find any app entry file at '{0}'!",
|
|
611
|
+
33: "Unrecognized command(s) {0}!",
|
|
612
|
+
34: "Workspace was created at path '{0}'!",
|
|
613
|
+
4: "App was created at path '{0}'!",
|
|
614
|
+
25: "Server stopped.",
|
|
615
|
+
11: "Creates an Alliance Workspace in the current directory.",
|
|
616
|
+
10: "Creates an Alliance Application in the current directory or Alliance Workspace.",
|
|
617
|
+
24: "Starts a Alliance development server using the current directory package.json.",
|
|
618
|
+
7: "Builds an Alliance Application using Vite.",
|
|
619
|
+
35: "Enter the name of your workspace",
|
|
620
|
+
28: "Which server mode do you want to use?",
|
|
621
|
+
6: "Enter the name of your app",
|
|
622
|
+
18: "No translation key provided!",
|
|
623
|
+
23: "Operation cancelled.",
|
|
624
|
+
30: `Press CTRL + C to stop the server.
|
|
876
625
|
`,
|
|
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 {
|
|
626
|
+
32: "Select preferred language",
|
|
627
|
+
31: "Select preferred framework template",
|
|
628
|
+
13: "The port that the dev server should use.",
|
|
629
|
+
14: "Whether the dev server and browser console should output more log information or not (false).",
|
|
630
|
+
1: "The port that the api gateway should use.",
|
|
631
|
+
2: "Which components to start. [server|server-proxy|server-gateway].",
|
|
632
|
+
12: "Whether the dev server should automatically open in your browser or not.",
|
|
633
|
+
9: "Whether the build should start watching and rebuild when files change or not.",
|
|
634
|
+
5: "The entry file for the app (./src/app).",
|
|
635
|
+
17: "The entry file for the app manifest (./src/manifest).",
|
|
636
|
+
8: "Which mode to use when building the app.",
|
|
637
|
+
16: "Failed to fetch package info from the NPM registry for package '${0}'!",
|
|
638
|
+
20: "Could not find app name in manifest.",
|
|
639
|
+
3: "The path to the app configuration file.",
|
|
640
|
+
27: "Server",
|
|
641
|
+
29: "Server with proxy",
|
|
642
|
+
26: "Server with gateway"
|
|
643
|
+
}, w = class {
|
|
946
644
|
};
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
const r = W.getTranslations()[e];
|
|
645
|
+
T(w, "getTranslations", () => Me), T(w, "getTranslation", (e, ...t) => {
|
|
646
|
+
const r = w.getTranslations()[e];
|
|
950
647
|
if (!r)
|
|
951
648
|
throw new Error(`Could not find text with given key '${e}'.`);
|
|
952
649
|
return t.reduce(
|
|
953
|
-
(a, i,
|
|
650
|
+
(a, i, p) => a.toString().replace(`{${p}}`, i.toString()),
|
|
954
651
|
r
|
|
955
652
|
).toString();
|
|
956
|
-
}),
|
|
957
|
-
let
|
|
958
|
-
async function
|
|
653
|
+
}), T(w, "get", (e = Q.MissingTranslationKey, ...t) => w.getTranslation(e, ...t));
|
|
654
|
+
let y;
|
|
655
|
+
async function Pe() {
|
|
959
656
|
try {
|
|
960
|
-
return
|
|
657
|
+
return y || (y = await G("currentUser").resolve()), {
|
|
658
|
+
...y,
|
|
659
|
+
hasPermission(e, t) {
|
|
660
|
+
return !!(y != null && y.permissions.find(
|
|
661
|
+
({ permission: r }) => r.app.name === e && r.name === t
|
|
662
|
+
));
|
|
663
|
+
},
|
|
664
|
+
isSystemAdmin() {
|
|
665
|
+
return !!y && y.type === "system-admin";
|
|
666
|
+
}
|
|
667
|
+
};
|
|
961
668
|
} catch (e) {
|
|
962
|
-
throw Fe(e) && e.code ===
|
|
669
|
+
throw Fe(e) && e.code === z.MissingManagedObjectProvider ? new A(b.CurrentUserMissingProvider) : e.message.includes("GraphQL Error (Code: 404)") ? new A(b.CurrentUserGatewayNotStarted) : e.message.includes("GraphQL Error (Code: 500)") ? new A(b.CurrentUserMissingBackend) : e.message.includes("GraphQL Error (Code: 200)") && e.message.includes("Cannot return null for non-nullable field") ? new A(b.CurrentUserMissingInDatabase) : e;
|
|
963
670
|
}
|
|
964
671
|
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
return
|
|
672
|
+
function Ie(e) {
|
|
673
|
+
var a;
|
|
674
|
+
return !e || !((a = e.resources) != null && a.localization) ? {} : Object.keys(e.resources.localization).reduce((i, p) => (i[p] = e.resources.localization[p].value, i), {});
|
|
968
675
|
}
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
));
|
|
676
|
+
function Oe(e = "", t) {
|
|
677
|
+
return Object.entries(t).reduce((r, [a, i]) => r.replaceAll(`{{${a}}}`, i), e);
|
|
678
|
+
}
|
|
679
|
+
async function Ee() {
|
|
680
|
+
const e = Ae(), t = be(), r = Ie(e);
|
|
681
|
+
let a = {};
|
|
682
|
+
return t != null && t.find(({ name: i }) => i === "resource-management") && (a = await G("resourceTexts", { app: e == null ? void 0 : e.name }).resolve()), Object.keys(r).reduce((i, p) => (a[p] && (i[p] = a[p]), i), r);
|
|
683
|
+
}
|
|
684
|
+
let j = {};
|
|
685
|
+
async function xe() {
|
|
686
|
+
return Object.keys(j).length === 0 && (j = await Ee()), (e, t) => {
|
|
687
|
+
const r = j[e];
|
|
688
|
+
if (r === void 0)
|
|
689
|
+
throw new A(z.LocalizationTemplateNotDefined, { key: e });
|
|
690
|
+
return !t || typeof t != "object" || Object.keys(t).length === 0 ? r : Oe(r, t);
|
|
691
|
+
};
|
|
974
692
|
}
|
|
975
693
|
export {
|
|
976
|
-
|
|
977
|
-
|
|
694
|
+
Pe as getCurrentUser,
|
|
695
|
+
xe as getTranslator
|
|
978
696
|
};
|
|
979
697
|
//# sourceMappingURL=index.js.map
|