@telia-ace/alliance-utilities 1.0.9 → 1.0.10-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 +12 -0
- package/frontend/index.d.ts +2 -0
- package/frontend/index.js +71 -41
- package/frontend/index.js.map +1 -1
- package/frontend/routing.d.ts +8 -0
- package/frontend/types.d.ts +6 -0
- package/package.json +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @telia-ace/alliance-utilities
|
|
2
2
|
|
|
3
|
+
## 1.0.10-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c04ce55: Add `getCurrentLocationInfo()` and `matchRegExpLike()` utility functions.
|
|
8
|
+
|
|
9
|
+
## 1.0.10-next.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- cd495d7: Add utility types and routing utilities.
|
|
14
|
+
|
|
3
15
|
## 1.0.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/frontend/index.d.ts
CHANGED
package/frontend/index.js
CHANGED
|
@@ -1,8 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (e, r, t) => (
|
|
4
|
-
|
|
5
|
-
const
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var g = (e, r, t) => r in e ? f(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var d = (e, r, t) => (g(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
+
function v(e) {
|
|
5
|
+
const t = Object.entries(e).reduce((i, o) => {
|
|
6
|
+
const [p, c] = o;
|
|
7
|
+
return typeof c > "u" || (typeof c == "object" && c !== null ? i[p] = JSON.stringify(c) : i[p] = c), i;
|
|
8
|
+
}, {});
|
|
9
|
+
return Object.keys(t).length ? `?${new URLSearchParams(t)}` : "";
|
|
10
|
+
}
|
|
11
|
+
function N(e = "", r = "", t = {}) {
|
|
12
|
+
const { workspace: i } = m(), o = v(t), p = i ? `/${i}` : "";
|
|
13
|
+
return e ? r ? `${p}/${e}/${r}${o}` : `${p}/${e}${o}` : `${p}${o}`;
|
|
14
|
+
}
|
|
15
|
+
function m() {
|
|
16
|
+
const { origin: e, pathname: r } = window.location;
|
|
17
|
+
let t = "", i = "", o = "";
|
|
18
|
+
return D("https://alliance*.ace.teliacompany.net", e) ? [t, i, o] = r.split("/").filter((p) => !!p) : [i, o] = r.split("/").filter((p) => !!p), {
|
|
19
|
+
workspace: t,
|
|
20
|
+
app: i,
|
|
21
|
+
capability: o
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function s(e) {
|
|
25
|
+
return e.replaceAll(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
26
|
+
}
|
|
27
|
+
function D(e, r) {
|
|
28
|
+
const t = s(e);
|
|
29
|
+
return new RegExp(`^${t.replaceAll("\\?", ".?").replaceAll("\\*", ".*")}`, "i").test(r);
|
|
30
|
+
}
|
|
31
|
+
var a = /* @__PURE__ */ ((e) => (e[e.Done = 0] = "Done", e[e.NoWorkspaceName = 1] = "NoWorkspaceName", e[e.NoAppName = 2] = "NoAppName", e[e.AlreadyExists = 3] = "AlreadyExists", e[e.NoAppOrWorkspaceInCurrentDirectory = 4] = "NoAppOrWorkspaceInCurrentDirectory", e[e.UnrecognizedCommand = 5] = "UnrecognizedCommand", e[e.WorkspaceCreated = 6] = "WorkspaceCreated", e[e.AppCreated = 7] = "AppCreated", e[e.ServedStopped = 8] = "ServedStopped", e[e.WorkspaceNameInquiry = 9] = "WorkspaceNameInquiry", e[e.AppNameInquiry = 10] = "AppNameInquiry", e[e.ServerModeInquiry = 11] = "ServerModeInquiry", e[e.CreateWorkspaceDescription = 12] = "CreateWorkspaceDescription", e[e.CreateAppDescription = 13] = "CreateAppDescription", e[e.ServeDescription = 14] = "ServeDescription", e[e.BuildDescription = 15] = "BuildDescription", e[e.MissingTranslationKey = 16] = "MissingTranslationKey", e[e.OperationCancelled = 17] = "OperationCancelled", e[e.StopServerInstructions = 18] = "StopServerInstructions", e[e.TemplateLanguageInquiry = 19] = "TemplateLanguageInquiry", e[e.TemplateFrameworkInquiry = 20] = "TemplateFrameworkInquiry", e[e.DevServerPortDescription = 21] = "DevServerPortDescription", e[e.ApiGatewayPortDescription = 22] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 23] = "ApiServerModeDescription", e[e.DevServerOpenDescription = 24] = "DevServerOpenDescription", e[e.BuildWatchDescription = 25] = "BuildWatchDescription", e[e.CouldNotStartGatewayInDocker = 26] = "CouldNotStartGatewayInDocker", e[e.PullingLatestImage = 27] = "PullingLatestImage", e[e.AppEntryBuildOptionDescription = 28] = "AppEntryBuildOptionDescription", e[e.ManifestEntryBuildOptionDescription = 29] = "ManifestEntryBuildOptionDescription", e[e.BuildModeOptionDescription = 30] = "BuildModeOptionDescription", e[e.FetchPackageVersionError = 31] = "FetchPackageVersionError", e[e.DockerNotStartedOrInstalled = 32] = "DockerNotStartedOrInstalled", e[e.EnableDevAuthentication = 33] = "EnableDevAuthentication", e[e.NoAppNameFound = 34] = "NoAppNameFound", e[e.AppConfigurationPath = 35] = "AppConfigurationPath", e[e.ServerGatewayMode = 36] = "ServerGatewayMode", e[e.ServerProxyMode = 37] = "ServerProxyMode", e[e.ServerMode = 38] = "ServerMode", e[e.DevLoginUrl = 39] = "DevLoginUrl", e))(a || {});
|
|
32
|
+
const S = {
|
|
6
33
|
[
|
|
7
34
|
0
|
|
8
35
|
/* Done */
|
|
@@ -166,33 +193,33 @@ const g = {
|
|
|
166
193
|
]: "Log in using http://localhost:{0}/-/dev/login"
|
|
167
194
|
}, u = class {
|
|
168
195
|
};
|
|
169
|
-
let
|
|
170
|
-
d(
|
|
171
|
-
const
|
|
172
|
-
if (!
|
|
196
|
+
let n = u;
|
|
197
|
+
d(n, "getTranslations", () => S), d(n, "getTranslation", (r, ...t) => {
|
|
198
|
+
const o = u.getTranslations()[r];
|
|
199
|
+
if (!o)
|
|
173
200
|
throw new Error(`Could not find text with given key '${r}'.`);
|
|
174
201
|
return t.reduce(
|
|
175
|
-
(
|
|
176
|
-
|
|
202
|
+
(c, l, h) => c.toString().replace(`{${h}}`, l.toString()),
|
|
203
|
+
o
|
|
177
204
|
).toString();
|
|
178
|
-
}), d(
|
|
179
|
-
function
|
|
180
|
-
return
|
|
205
|
+
}), d(n, "get", (r = a.MissingTranslationKey, ...t) => u.getTranslation(r, ...t));
|
|
206
|
+
function C(e, r) {
|
|
207
|
+
return k(Object.values(e), ({ name: t }) => ({
|
|
181
208
|
label: t,
|
|
182
209
|
value: t,
|
|
183
210
|
selected: r === t
|
|
184
211
|
}));
|
|
185
212
|
}
|
|
186
|
-
var
|
|
187
|
-
function
|
|
188
|
-
return Object.values(e).find((
|
|
213
|
+
var w = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Expressive = "expressive", e.Destructive = "destructive", e.Text = "text", e.PrimaryWhite = "primary-white", e.SecondaryWhite = "secondary-white", e.ExpressiveWhite = "expressive-white", e.TertiaryPurple = "tertiary-purple", e))(w || {});
|
|
214
|
+
function W(e, r) {
|
|
215
|
+
return Object.values(e).find((i) => i.name === r);
|
|
189
216
|
}
|
|
190
|
-
function
|
|
217
|
+
function k(e, r) {
|
|
191
218
|
return e.reduce(
|
|
192
|
-
(t,
|
|
219
|
+
(t, i) => (t.push({
|
|
193
220
|
disabled: !1,
|
|
194
221
|
selected: !1,
|
|
195
|
-
...r(
|
|
222
|
+
...r(i)
|
|
196
223
|
}), t),
|
|
197
224
|
[
|
|
198
225
|
{
|
|
@@ -204,43 +231,46 @@ function D(e, r) {
|
|
|
204
231
|
]
|
|
205
232
|
);
|
|
206
233
|
}
|
|
207
|
-
function
|
|
234
|
+
function E(e) {
|
|
208
235
|
return (r) => {
|
|
209
236
|
r.key === "Enter" && e(r);
|
|
210
237
|
};
|
|
211
238
|
}
|
|
212
|
-
function
|
|
213
|
-
const { email: t, displayName:
|
|
239
|
+
function I(e, r = "all") {
|
|
240
|
+
const { email: t, displayName: i } = e, o = i && i !== "unknown", p = !!t;
|
|
214
241
|
switch (r) {
|
|
215
242
|
case "all": {
|
|
216
|
-
if (
|
|
217
|
-
return `${
|
|
218
|
-
if (
|
|
219
|
-
return
|
|
220
|
-
if (
|
|
243
|
+
if (o && p)
|
|
244
|
+
return `${i} (${t})`;
|
|
245
|
+
if (o)
|
|
246
|
+
return i;
|
|
247
|
+
if (p)
|
|
221
248
|
return t;
|
|
222
249
|
}
|
|
223
250
|
case "single": {
|
|
224
|
-
if (
|
|
225
|
-
return
|
|
226
|
-
if (
|
|
251
|
+
if (o)
|
|
252
|
+
return i;
|
|
253
|
+
if (p)
|
|
227
254
|
return t;
|
|
228
255
|
}
|
|
229
256
|
}
|
|
230
257
|
return "<UNKNOWN USER>";
|
|
231
258
|
}
|
|
232
|
-
function
|
|
259
|
+
function O(...e) {
|
|
233
260
|
return e.filter((r) => !!r).join(" ");
|
|
234
261
|
}
|
|
235
262
|
export {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
263
|
+
n as Texts,
|
|
264
|
+
a as TranslationsKey,
|
|
265
|
+
w as VocaButtonVariant,
|
|
266
|
+
O as classNames,
|
|
267
|
+
N as createCapabilityPath,
|
|
268
|
+
I as friendlyUserName,
|
|
269
|
+
m as getCurrentLocationInfo,
|
|
270
|
+
W as getVocaIcon,
|
|
271
|
+
k as mapToVocaOptions,
|
|
272
|
+
D as matchRegExpLike,
|
|
273
|
+
E as onEnter,
|
|
274
|
+
C as vocaIconsToOptions
|
|
245
275
|
};
|
|
246
276
|
//# sourceMappingURL=index.js.map
|
package/frontend/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/frontend/translations.ts","../src/frontend/texts.ts","../src/frontend/ui.ts"],"sourcesContent":["export type Translations = {\n [key in TranslationsKey]: string;\n};\n\nexport enum TranslationsKey {\n Done,\n NoWorkspaceName,\n NoAppName,\n AlreadyExists,\n NoAppOrWorkspaceInCurrentDirectory,\n UnrecognizedCommand,\n WorkspaceCreated,\n AppCreated,\n ServedStopped,\n WorkspaceNameInquiry,\n AppNameInquiry,\n ServerModeInquiry,\n CreateWorkspaceDescription,\n CreateAppDescription,\n ServeDescription,\n BuildDescription,\n MissingTranslationKey,\n OperationCancelled,\n StopServerInstructions,\n TemplateLanguageInquiry,\n TemplateFrameworkInquiry,\n DevServerPortDescription,\n ApiGatewayPortDescription,\n ApiServerModeDescription,\n DevServerOpenDescription,\n BuildWatchDescription,\n CouldNotStartGatewayInDocker,\n PullingLatestImage,\n AppEntryBuildOptionDescription,\n ManifestEntryBuildOptionDescription,\n BuildModeOptionDescription,\n FetchPackageVersionError,\n DockerNotStartedOrInstalled,\n EnableDevAuthentication,\n NoAppNameFound,\n AppConfigurationPath,\n ServerGatewayMode,\n ServerProxyMode,\n ServerMode,\n DevLoginUrl,\n}\n\nexport const en: Translations = {\n [TranslationsKey.Done]: 'Done',\n [TranslationsKey.NoWorkspaceName]: 'No workspace name provided!',\n [TranslationsKey.NoAppName]: 'No app name provided!',\n [TranslationsKey.AlreadyExists]: \"File or directory '{0}' already exists!\",\n [TranslationsKey.NoAppOrWorkspaceInCurrentDirectory]:\n \"Could not find any app entry file at '{0}' or any apps under the alliance.apps property in '{1}'!\",\n [TranslationsKey.UnrecognizedCommand]: 'Unrecognized command(s) {0}!',\n [TranslationsKey.WorkspaceCreated]: \"Workspace was created at path '{0}'!\",\n [TranslationsKey.AppCreated]: \"App was created at path '{0}'!\",\n [TranslationsKey.ServedStopped]: 'Server stopped.',\n [TranslationsKey.CreateWorkspaceDescription]:\n 'Creates an Alliance Workspace in the current directory.',\n [TranslationsKey.CreateAppDescription]:\n 'Creates an Alliance Application in the current directory or Alliance Workspace.',\n [TranslationsKey.ServeDescription]:\n 'Starts a Alliance development server using the current directory package.json.',\n [TranslationsKey.BuildDescription]: 'Builds an Alliance Application using Vite.',\n [TranslationsKey.WorkspaceNameInquiry]: 'Enter the name of your workspace',\n [TranslationsKey.ServerModeInquiry]: 'Which server mode do you want to use?',\n [TranslationsKey.AppNameInquiry]: 'Enter the name of your app',\n [TranslationsKey.MissingTranslationKey]: 'No translation key provided!',\n [TranslationsKey.OperationCancelled]: 'Operation cancelled.',\n [TranslationsKey.StopServerInstructions]: 'Press CTRL + C to stop the server.\\n',\n [TranslationsKey.TemplateLanguageInquiry]: 'Select preferred language',\n [TranslationsKey.TemplateFrameworkInquiry]: 'Select preferred framework template',\n [TranslationsKey.DevServerPortDescription]: 'The port that the dev server should use.',\n [TranslationsKey.ApiGatewayPortDescription]: 'The port that the api gateway should use.',\n [TranslationsKey.ApiServerModeDescription]:\n 'Which components to start. [server|server-proxy|server-gateway].',\n [TranslationsKey.DevServerOpenDescription]:\n 'Whether the dev server should automatically open in your browser or not.',\n [TranslationsKey.BuildWatchDescription]:\n 'Whether the build should start watching and rebuild when files change or not.',\n [TranslationsKey.CouldNotStartGatewayInDocker]:\n 'Could not start Docker container with Alliance gateway.',\n [TranslationsKey.PullingLatestImage]: 'Pulling latest image...',\n [TranslationsKey.AppEntryBuildOptionDescription]: 'The entry file for the app (./src/app).',\n [TranslationsKey.ManifestEntryBuildOptionDescription]:\n 'The entry file for the app manifest (./src/manifest).',\n [TranslationsKey.BuildModeOptionDescription]:\n 'Which mode to use when building the app. [production|development]',\n [TranslationsKey.FetchPackageVersionError]:\n \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n [TranslationsKey.DockerNotStartedOrInstalled]: 'Docker not started or not installed.',\n [TranslationsKey.EnableDevAuthentication]:\n 'Whether user authentication should be enabled or not.',\n [TranslationsKey.NoAppNameFound]: 'Could not find app name in manifest.',\n [TranslationsKey.AppConfigurationPath]: 'The path to the app configuration file.',\n [TranslationsKey.ServerMode]: 'Server',\n [TranslationsKey.ServerProxyMode]: 'Server with proxy',\n [TranslationsKey.ServerGatewayMode]: 'Server with gateway',\n [TranslationsKey.DevLoginUrl]: 'Log in using http://localhost:{0}/-/dev/login',\n};\n","import { en, TranslationsKey, type Translations } from './translations';\n\nexport type TextArgs = (string | number)[];\n\nexport class Texts {\n protected static getTranslations = (): Translations => {\n return en;\n };\n\n protected static getTranslation = (key: TranslationsKey, ...args: TextArgs): string => {\n const translations = Texts.getTranslations();\n const translation = translations[key];\n\n if (!translation) throw new Error(`Could not find text with given key '${key}'.`);\n\n const formattedTranslation = args.reduce(\n (acc, curr, index) => acc.toString().replace(`{${index}}`, curr.toString()),\n translation\n );\n\n return formattedTranslation.toString();\n };\n\n public static get = (\n key: TranslationsKey = TranslationsKey.MissingTranslationKey,\n ...args: TextArgs\n ) => this.getTranslation(key, ...args);\n}\n\nexport default Texts;\n","export function vocaIconsToOptions(vocaIcons: any, selected: string) {\n return mapToVocaOptions(Object.values(vocaIcons), ({ name }: any) => ({\n label: name,\n value: name,\n selected: selected === name,\n }));\n}\n\nexport type VocaIcon = { name: string; svg: string };\n\nexport enum VocaButtonVariant {\n Primary = 'primary',\n Secondary = 'secondary',\n Expressive = 'expressive',\n Destructive = 'destructive',\n Text = 'text',\n PrimaryWhite = 'primary-white',\n SecondaryWhite = 'secondary-white',\n ExpressiveWhite = 'expressive-white',\n TertiaryPurple = 'tertiary-purple',\n}\n\nexport type VocaOption = { label: string; value: string; disabled?: boolean; selected?: boolean };\n\nexport function getVocaIcon(vocaIcons: any, name: string) {\n const icon = Object.values(vocaIcons).find((icon: any) => icon.name === name);\n return icon as VocaIcon;\n}\n\nexport type Unpacked<T> = T extends (infer U)[] ? U : T;\n\nexport function mapToVocaOptions<T>(\n items: T,\n mapper: (item: Unpacked<T>) => VocaOption\n): VocaOption[] {\n return (items as []).reduce<VocaOption[]>(\n (acc, item) => {\n acc.push({\n disabled: false,\n selected: false,\n ...mapper(item),\n });\n\n return acc;\n },\n [\n {\n label: 'Choose...',\n value: '',\n disabled: true,\n selected: true,\n },\n ]\n );\n}\n\nexport function onEnter(fn: Function) {\n return (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n fn(e);\n }\n };\n}\n\nexport function friendlyUserName(\n user: { email: string; displayName: string },\n format: 'single' | 'all' = 'all'\n) {\n const { email, displayName } = user;\n\n const hasDisplayName = displayName && displayName !== 'unknown';\n const hasEmail = !!email;\n\n switch (format) {\n case 'all': {\n if (hasDisplayName && hasEmail) {\n return `${displayName} (${email})`;\n } else if (hasDisplayName) {\n return displayName;\n } else if (hasEmail) {\n return email;\n }\n }\n case 'single': {\n if (hasDisplayName) {\n return displayName;\n } else if (hasEmail) {\n return email;\n }\n }\n }\n\n return '<UNKNOWN USER>';\n}\n\nexport function classNames(...classes: string[]) {\n return classes.filter((c) => !!c).join(' ');\n}\n"],"names":["TranslationsKey","TranslationsKey2","en","_Texts","Texts","__publicField","key","args","translation","acc","curr","index","vocaIconsToOptions","vocaIcons","selected","mapToVocaOptions","name","VocaButtonVariant","getVocaIcon","icon","items","mapper","item","onEnter","fn","e","friendlyUserName","user","format","email","displayName","hasDisplayName","hasEmail","classNames","classes","c"],"mappings":";;;AAIY,IAAAA,sBAAAA,OACRA,EAAAC,EAAA,OAAA,CAAA,IAAA,QACAD,EAAAC,EAAA,kBAAA,CAAA,IAAA,mBACAD,EAAAC,EAAA,YAAA,CAAA,IAAA,aACAD,EAAAC,EAAA,gBAAA,CAAA,IAAA,iBACAD,EAAAC,EAAA,qCAAA,CAAA,IAAA,sCACAD,EAAAC,EAAA,sBAAA,CAAA,IAAA,uBACAD,EAAAC,EAAA,mBAAA,CAAA,IAAA,oBACAD,EAAAC,EAAA,aAAA,CAAA,IAAA,cACAD,EAAAC,EAAA,gBAAA,CAAA,IAAA,iBACAD,EAAAC,EAAA,uBAAA,CAAA,IAAA,wBACAD,EAAAC,EAAA,iBAAA,EAAA,IAAA,kBACAD,EAAAC,EAAA,oBAAA,EAAA,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/translations.ts","../src/frontend/texts.ts","../src/frontend/ui.ts"],"sourcesContent":["import { SerializeableObject } from './types';\n\nfunction createQueryString(args: SerializeableObject) {\n const entries = Object.entries(args);\n\n const filteredArgs = entries.reduce<SerializeableObject>((acc, entry) => {\n const [key, value] = entry;\n\n if (typeof value === 'undefined') {\n return acc;\n } else if (typeof value === 'object' && value !== null) {\n acc[key] = JSON.stringify(value);\n } else {\n acc[key] = value;\n }\n\n return acc;\n }, {});\n\n if (!Object.keys(filteredArgs).length) {\n return '';\n }\n\n return `?${new URLSearchParams(filteredArgs as Record<string, any>)}`;\n}\n\nexport function createCapabilityPath(\n app: string = '',\n capability: string = '',\n args: SerializeableObject = {}\n) {\n const { workspace } = getCurrentLocationInfo();\n const queryString = createQueryString(args);\n const base = workspace ? `/${workspace}` : '';\n\n if (!app) {\n return `${base}${queryString}`;\n }\n\n if (!capability) {\n return `${base}/${app}${queryString}`;\n }\n\n return `${base}/${app}/${capability}${queryString}`;\n}\n\nexport function getCurrentLocationInfo() {\n const { origin, pathname } = window.location;\n\n // @ts-ignore\n let workspace = '';\n let app = '';\n let capability = '';\n\n // If on Alliance cloud environment - the first part of path is workspace\n if (matchRegExpLike('https://alliance*.ace.teliacompany.net', origin)) {\n [workspace, app, capability] = pathname.split('/').filter((part) => !!part);\n } else {\n [app, capability] = pathname.split('/').filter((part) => !!part);\n }\n\n return {\n workspace,\n app,\n capability,\n };\n}\n\nfunction escapeRegex(str: string) {\n return str.replaceAll(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n\nexport function matchRegExpLike(regExpLikeStr: string, testStr: string): boolean {\n const escaped = escapeRegex(regExpLikeStr);\n const regExp = new RegExp(`^${escaped.replaceAll('\\\\?', '.?').replaceAll('\\\\*', '.*')}`, 'i');\n return regExp.test(testStr);\n}\n","export type Translations = {\n [key in TranslationsKey]: string;\n};\n\nexport enum TranslationsKey {\n Done,\n NoWorkspaceName,\n NoAppName,\n AlreadyExists,\n NoAppOrWorkspaceInCurrentDirectory,\n UnrecognizedCommand,\n WorkspaceCreated,\n AppCreated,\n ServedStopped,\n WorkspaceNameInquiry,\n AppNameInquiry,\n ServerModeInquiry,\n CreateWorkspaceDescription,\n CreateAppDescription,\n ServeDescription,\n BuildDescription,\n MissingTranslationKey,\n OperationCancelled,\n StopServerInstructions,\n TemplateLanguageInquiry,\n TemplateFrameworkInquiry,\n DevServerPortDescription,\n ApiGatewayPortDescription,\n ApiServerModeDescription,\n DevServerOpenDescription,\n BuildWatchDescription,\n CouldNotStartGatewayInDocker,\n PullingLatestImage,\n AppEntryBuildOptionDescription,\n ManifestEntryBuildOptionDescription,\n BuildModeOptionDescription,\n FetchPackageVersionError,\n DockerNotStartedOrInstalled,\n EnableDevAuthentication,\n NoAppNameFound,\n AppConfigurationPath,\n ServerGatewayMode,\n ServerProxyMode,\n ServerMode,\n DevLoginUrl,\n}\n\nexport const en: Translations = {\n [TranslationsKey.Done]: 'Done',\n [TranslationsKey.NoWorkspaceName]: 'No workspace name provided!',\n [TranslationsKey.NoAppName]: 'No app name provided!',\n [TranslationsKey.AlreadyExists]: \"File or directory '{0}' already exists!\",\n [TranslationsKey.NoAppOrWorkspaceInCurrentDirectory]:\n \"Could not find any app entry file at '{0}' or any apps under the alliance.apps property in '{1}'!\",\n [TranslationsKey.UnrecognizedCommand]: 'Unrecognized command(s) {0}!',\n [TranslationsKey.WorkspaceCreated]: \"Workspace was created at path '{0}'!\",\n [TranslationsKey.AppCreated]: \"App was created at path '{0}'!\",\n [TranslationsKey.ServedStopped]: 'Server stopped.',\n [TranslationsKey.CreateWorkspaceDescription]:\n 'Creates an Alliance Workspace in the current directory.',\n [TranslationsKey.CreateAppDescription]:\n 'Creates an Alliance Application in the current directory or Alliance Workspace.',\n [TranslationsKey.ServeDescription]:\n 'Starts a Alliance development server using the current directory package.json.',\n [TranslationsKey.BuildDescription]: 'Builds an Alliance Application using Vite.',\n [TranslationsKey.WorkspaceNameInquiry]: 'Enter the name of your workspace',\n [TranslationsKey.ServerModeInquiry]: 'Which server mode do you want to use?',\n [TranslationsKey.AppNameInquiry]: 'Enter the name of your app',\n [TranslationsKey.MissingTranslationKey]: 'No translation key provided!',\n [TranslationsKey.OperationCancelled]: 'Operation cancelled.',\n [TranslationsKey.StopServerInstructions]: 'Press CTRL + C to stop the server.\\n',\n [TranslationsKey.TemplateLanguageInquiry]: 'Select preferred language',\n [TranslationsKey.TemplateFrameworkInquiry]: 'Select preferred framework template',\n [TranslationsKey.DevServerPortDescription]: 'The port that the dev server should use.',\n [TranslationsKey.ApiGatewayPortDescription]: 'The port that the api gateway should use.',\n [TranslationsKey.ApiServerModeDescription]:\n 'Which components to start. [server|server-proxy|server-gateway].',\n [TranslationsKey.DevServerOpenDescription]:\n 'Whether the dev server should automatically open in your browser or not.',\n [TranslationsKey.BuildWatchDescription]:\n 'Whether the build should start watching and rebuild when files change or not.',\n [TranslationsKey.CouldNotStartGatewayInDocker]:\n 'Could not start Docker container with Alliance gateway.',\n [TranslationsKey.PullingLatestImage]: 'Pulling latest image...',\n [TranslationsKey.AppEntryBuildOptionDescription]: 'The entry file for the app (./src/app).',\n [TranslationsKey.ManifestEntryBuildOptionDescription]:\n 'The entry file for the app manifest (./src/manifest).',\n [TranslationsKey.BuildModeOptionDescription]:\n 'Which mode to use when building the app. [production|development]',\n [TranslationsKey.FetchPackageVersionError]:\n \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n [TranslationsKey.DockerNotStartedOrInstalled]: 'Docker not started or not installed.',\n [TranslationsKey.EnableDevAuthentication]:\n 'Whether user authentication should be enabled or not.',\n [TranslationsKey.NoAppNameFound]: 'Could not find app name in manifest.',\n [TranslationsKey.AppConfigurationPath]: 'The path to the app configuration file.',\n [TranslationsKey.ServerMode]: 'Server',\n [TranslationsKey.ServerProxyMode]: 'Server with proxy',\n [TranslationsKey.ServerGatewayMode]: 'Server with gateway',\n [TranslationsKey.DevLoginUrl]: 'Log in using http://localhost:{0}/-/dev/login',\n};\n","import { en, TranslationsKey, type Translations } from './translations';\n\nexport type TextArgs = (string | number)[];\n\nexport class Texts {\n protected static getTranslations = (): Translations => {\n return en;\n };\n\n protected static getTranslation = (key: TranslationsKey, ...args: TextArgs): string => {\n const translations = Texts.getTranslations();\n const translation = translations[key];\n\n if (!translation) throw new Error(`Could not find text with given key '${key}'.`);\n\n const formattedTranslation = args.reduce(\n (acc, curr, index) => acc.toString().replace(`{${index}}`, curr.toString()),\n translation\n );\n\n return formattedTranslation.toString();\n };\n\n public static get = (\n key: TranslationsKey = TranslationsKey.MissingTranslationKey,\n ...args: TextArgs\n ) => this.getTranslation(key, ...args);\n}\n\nexport default Texts;\n","export function vocaIconsToOptions(vocaIcons: any, selected: string) {\n return mapToVocaOptions(Object.values(vocaIcons), ({ name }: any) => ({\n label: name,\n value: name,\n selected: selected === name,\n }));\n}\n\nexport type VocaIcon = { name: string; svg: string };\n\nexport enum VocaButtonVariant {\n Primary = 'primary',\n Secondary = 'secondary',\n Expressive = 'expressive',\n Destructive = 'destructive',\n Text = 'text',\n PrimaryWhite = 'primary-white',\n SecondaryWhite = 'secondary-white',\n ExpressiveWhite = 'expressive-white',\n TertiaryPurple = 'tertiary-purple',\n}\n\nexport type VocaOption = { label: string; value: string; disabled?: boolean; selected?: boolean };\n\nexport function getVocaIcon(vocaIcons: any, name: string) {\n const icon = Object.values(vocaIcons).find((icon: any) => icon.name === name);\n return icon as VocaIcon;\n}\n\nexport type Unpacked<T> = T extends (infer U)[] ? U : T;\n\nexport function mapToVocaOptions<T>(\n items: T,\n mapper: (item: Unpacked<T>) => VocaOption\n): VocaOption[] {\n return (items as []).reduce<VocaOption[]>(\n (acc, item) => {\n acc.push({\n disabled: false,\n selected: false,\n ...mapper(item),\n });\n\n return acc;\n },\n [\n {\n label: 'Choose...',\n value: '',\n disabled: true,\n selected: true,\n },\n ]\n );\n}\n\nexport function onEnter(fn: Function) {\n return (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n fn(e);\n }\n };\n}\n\nexport function friendlyUserName(\n user: { email: string; displayName: string },\n format: 'single' | 'all' = 'all'\n) {\n const { email, displayName } = user;\n\n const hasDisplayName = displayName && displayName !== 'unknown';\n const hasEmail = !!email;\n\n switch (format) {\n case 'all': {\n if (hasDisplayName && hasEmail) {\n return `${displayName} (${email})`;\n } else if (hasDisplayName) {\n return displayName;\n } else if (hasEmail) {\n return email;\n }\n }\n case 'single': {\n if (hasDisplayName) {\n return displayName;\n } else if (hasEmail) {\n return email;\n }\n }\n }\n\n return '<UNKNOWN USER>';\n}\n\nexport function classNames(...classes: string[]) {\n return classes.filter((c) => !!c).join(' ');\n}\n"],"names":["createQueryString","args","filteredArgs","acc","entry","key","value","createCapabilityPath","app","capability","workspace","getCurrentLocationInfo","queryString","base","origin","pathname","matchRegExpLike","part","escapeRegex","str","regExpLikeStr","testStr","escaped","TranslationsKey","TranslationsKey2","en","_Texts","Texts","__publicField","translation","curr","index","vocaIconsToOptions","vocaIcons","selected","mapToVocaOptions","name","VocaButtonVariant","getVocaIcon","icon","items","mapper","item","onEnter","fn","e","friendlyUserName","user","format","email","displayName","hasDisplayName","hasEmail","classNames","classes","c"],"mappings":";;;AAEA,SAASA,EAAkBC,GAA2B;AAGlD,QAAMC,IAFU,OAAO,QAAQD,CAAI,EAEN,OAA4B,CAACE,GAAKC,MAAU;AAC/D,UAAA,CAACC,GAAKC,CAAK,IAAIF;AAEjB,WAAA,OAAOE,IAAU,QAEV,OAAOA,KAAU,YAAYA,MAAU,OAC9CH,EAAIE,CAAG,IAAI,KAAK,UAAUC,CAAK,IAE/BH,EAAIE,CAAG,IAAIC,IAGRH;AAAA,EACX,GAAG,CAAE,CAAA;AAEL,SAAK,OAAO,KAAKD,CAAY,EAAE,SAIxB,IAAI,IAAI,gBAAgBA,CAAmC,MAHvD;AAIf;AAEO,SAASK,EACZC,IAAc,IACdC,IAAqB,IACrBR,IAA4B,IAC9B;AACQ,QAAA,EAAE,WAAAS,MAAcC,KAChBC,IAAcZ,EAAkBC,CAAI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O,CAACC,MAAM,CAAC,CAACA,CAAC,EAAE,KAAK,GAAG;AAC9C;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SerializeableObject } from './types';
|
|
2
|
+
export declare function createCapabilityPath(app?: string, capability?: string, args?: SerializeableObject): string;
|
|
3
|
+
export declare function getCurrentLocationInfo(): {
|
|
4
|
+
workspace: string;
|
|
5
|
+
app: string;
|
|
6
|
+
capability: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function matchRegExpLike(regExpLikeStr: string, testStr: string): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type Promisable<T> = Promise<T> | T;
|
|
2
|
+
export type ValueTypes = string | number | boolean | undefined | null;
|
|
3
|
+
export type Serializeable = ValueTypes | SerializeableObject | ValueTypes[] | SerializeableObject[];
|
|
4
|
+
export interface SerializeableObject {
|
|
5
|
+
[key: string]: Serializeable;
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/alliance-utilities",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10-next.1",
|
|
4
4
|
"description": "Utilities used internally by ACE Alliance packages.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
7
|
"exports": {
|
|
9
8
|
"./backend": {
|
|
10
9
|
"types": "./backend/index.d.ts",
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
"./prettier-config": "./prettier-config.json",
|
|
18
17
|
"./typescript-config": "./typescript-config.json"
|
|
19
18
|
},
|
|
20
|
-
"types": "dist/index.d.ts",
|
|
21
19
|
"type": "module",
|
|
22
20
|
"files": [
|
|
23
21
|
"typescript-config.json",
|