@telia-ace/alliance-utilities 1.0.10 → 1.0.11-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 +18 -0
- package/dist/current-user.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +979 -0
- package/dist/index.js.map +1 -0
- package/package.json +11 -21
- package/backend/index.d.ts +0 -1
- package/backend/index.js +0 -31
- package/backend/index.js.map +0 -1
- package/backend/vite-plugin-css-import.d.ts +0 -2
- package/frontend/index.d.ts +0 -5
- package/frontend/index.js +0 -271
- package/frontend/index.js.map +0 -1
- package/frontend/routing.d.ts +0 -9
- package/frontend/texts.d.ts +0 -8
- package/frontend/translations.d.ts +0 -41
- package/frontend/types.d.ts +0 -6
- package/frontend/ui.d.ts +0 -31
- package/prettier-config.json +0 -10
- package/typescript-config.json +0 -23
package/frontend/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/frontend/routing.ts","../src/frontend/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\nfunction getCurrentPath() {\n const runtimeRootUrl = getRuntimeRootUrl();\n const { href, search } = window.location;\n\n return href.replace(runtimeRootUrl, '').replace(search, '');\n}\n\nfunction escapeRegex(str: string) {\n return str.replaceAll(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n\nexport function createCapabilityPath(\n app: string = '',\n capability: string = '',\n args: SerializeableObject = {}\n) {\n const rootPath = getRuntimeRootUrl().replace(location.origin, '');\n const queryString = createQueryString(args);\n\n if (!app) {\n return `${rootPath}${queryString}`;\n }\n\n if (!capability) {\n return `${rootPath}/${app}${queryString}`;\n }\n\n return `${rootPath}/${app}/${capability}${queryString}`;\n}\n\nexport function getCurrentLocationInfo() {\n const currentPath = getCurrentPath();\n const [app = '', capability = ''] = currentPath.split('/').filter((part) => !!part);\n\n return {\n app,\n capability,\n };\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\nexport function setRuntimeRootUrl() {\n const { origin, pathname } = window.location;\n\n // If on Alliance cloud environment - the first part of path is workspace\n if (matchRegExpLike('https://alliance*.ace.teliacompany.net', origin)) {\n const [workspace] = pathname.split('/').filter((part) => !!part);\n\n return (globalThis.__ALLIANCE_RUNTIME_ROOT_URL = `${origin}/${workspace}`);\n }\n\n return (globalThis.__ALLIANCE_RUNTIME_ROOT_URL = origin);\n}\n\nexport function getRuntimeRootUrl() {\n if (!globalThis.__ALLIANCE_RUNTIME_ROOT_URL) {\n setRuntimeRootUrl();\n }\n\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;\n}\n","export type Translations = {\n [key in TranslationsKey]: string;\n};\n\nexport enum TranslationsKey {\n AlreadyExists,\n ApiGatewayPortDescription,\n ApiServerModeDescription,\n AppConfigurationPath,\n AppCreated,\n AppEntryBuildOptionDescription,\n AppNameInquiry,\n BuildDescription,\n BuildModeOptionDescription,\n BuildWatchDescription,\n CreateAppDescription,\n CreateWorkspaceDescription,\n DevServerOpenDescription,\n DevServerPortDescription,\n Done,\n FetchPackageVersionError,\n ManifestEntryBuildOptionDescription,\n MissingTranslationKey,\n NoAppName,\n NoAppNameFound,\n NoAppOrWorkspaceInCurrentDirectory,\n NoWorkspaceName,\n OperationCancelled,\n ServeDescription,\n ServedStopped,\n ServerGatewayMode,\n ServerMode,\n ServerModeInquiry,\n ServerProxyMode,\n StopServerInstructions,\n TemplateFrameworkInquiry,\n TemplateLanguageInquiry,\n UnrecognizedCommand,\n WorkspaceCreated,\n WorkspaceNameInquiry,\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}'!\",\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.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]: 'Which mode to use when building the app.',\n [TranslationsKey.FetchPackageVersionError]:\n \"Failed to fetch package info from the NPM registry for package '${0}'!\",\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};\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","getCurrentPath","runtimeRootUrl","getRuntimeRootUrl","href","search","escapeRegex","str","createCapabilityPath","app","capability","rootPath","queryString","getCurrentLocationInfo","currentPath","part","matchRegExpLike","regExpLikeStr","testStr","escaped","setRuntimeRootUrl","origin","pathname","workspace","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;AAEA,SAASK,IAAiB;AACtB,QAAMC,IAAiBC,KACjB,EAAE,MAAAC,GAAM,QAAAC,MAAW,OAAO;AAEhC,SAAOD,EAAK,QAAQF,GAAgB,EAAE,EAAE,QAAQG,GAAQ,EAAE;AAC9D;AAEA,SAASC,EAAYC,GAAa;AACvB,SAAAA,EAAI,WAAW,0BAA0B,MAAM;AAC1D;AAEO,SAASC,EACZC,IAAc,IACdC,IAAqB,IACrBf,IAA4B,IAC9B;AACE,QAAMgB,IAAWR,IAAoB,QAAQ,SAAS,QAAQ,EAAE,GAC1DS,IAAclB,EAAkBC,CAAI;AAE1C,SAAKc,IAIAC,IAIE,GAAGC,KAAYF,KAAOC,IAAaE,MAH/B,GAAGD,KAAYF,IAAMG,MAJrB,GAAGD,IAAWC;AAQ7B;AAEO,SAASC,IAAyB;AACrC,QAAMC,IAAcb,KACd,CAACQ,IAAM,IAAIC,IAAa,EAAE,IAAII,EAAY,MAAM,GAAG,EAAE,OAAO,CAACC,MAAS,CAAC,CAACA,CAAI;AAE3E,SAAA;AAAA,IACH,KAAAN;AAAA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AAER;AAEO,SAAS+C,EAAQC,GAAc;AAClC,SAAO,CAACC,MAAqB;AACrB,IAAAA,EAAE,QAAQ,WACVD,EAAGC,CAAC;AAAA,EACR;AAER;AAEgB,SAAAC,EACZC,GACAC,IAA2B,OAC7B;AACQ,QAAA,EAAE,OAAAC,GAAO,aAAAC,EAAgB,IAAAH,GAEzBI,IAAiBD,KAAeA,MAAgB,WAChDE,IAAW,CAAC,CAACH;AAEnB,UAAQD,GAAQ;AAAA,IACZ,KAAK,OAAO;AACR,UAAIG,KAAkBC;AAClB,eAAO,GAAGF,MAAgBD;UACnBE;AACA,eAAAD;UACAE;AACA,eAAAH;AAAA,IAEf;AAAA,IACA,KAAK,UAAU;AACX,UAAIE;AACO,eAAAD;UACAE;AACA,eAAAH;AAAA,IAEf;AAAA,EACJ;AAEO,SAAA;AACX;AAEO,SAASI,KAAcC,GAAmB;AACtC,SAAAA,EAAQ,OAAO,CAACC,MAAM,CAAC,CAACA,CAAC,EAAE,KAAK,GAAG;AAC9C;"}
|
package/frontend/routing.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SerializeableObject } from './types';
|
|
2
|
-
export declare function createCapabilityPath(app?: string, capability?: string, args?: SerializeableObject): string;
|
|
3
|
-
export declare function getCurrentLocationInfo(): {
|
|
4
|
-
app: string;
|
|
5
|
-
capability: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function matchRegExpLike(regExpLikeStr: string, testStr: string): boolean;
|
|
8
|
-
export declare function setRuntimeRootUrl(): string;
|
|
9
|
-
export declare function getRuntimeRootUrl(): string;
|
package/frontend/texts.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TranslationsKey, type Translations } from './translations';
|
|
2
|
-
export type TextArgs = (string | number)[];
|
|
3
|
-
export declare class Texts {
|
|
4
|
-
protected static getTranslations: () => Translations;
|
|
5
|
-
protected static getTranslation: (key: TranslationsKey, ...args: TextArgs) => string;
|
|
6
|
-
static get: (key?: TranslationsKey, ...args: TextArgs) => string;
|
|
7
|
-
}
|
|
8
|
-
export default Texts;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export type Translations = {
|
|
2
|
-
[key in TranslationsKey]: string;
|
|
3
|
-
};
|
|
4
|
-
export declare enum TranslationsKey {
|
|
5
|
-
AlreadyExists = 0,
|
|
6
|
-
ApiGatewayPortDescription = 1,
|
|
7
|
-
ApiServerModeDescription = 2,
|
|
8
|
-
AppConfigurationPath = 3,
|
|
9
|
-
AppCreated = 4,
|
|
10
|
-
AppEntryBuildOptionDescription = 5,
|
|
11
|
-
AppNameInquiry = 6,
|
|
12
|
-
BuildDescription = 7,
|
|
13
|
-
BuildModeOptionDescription = 8,
|
|
14
|
-
BuildWatchDescription = 9,
|
|
15
|
-
CreateAppDescription = 10,
|
|
16
|
-
CreateWorkspaceDescription = 11,
|
|
17
|
-
DevServerOpenDescription = 12,
|
|
18
|
-
DevServerPortDescription = 13,
|
|
19
|
-
Done = 14,
|
|
20
|
-
FetchPackageVersionError = 15,
|
|
21
|
-
ManifestEntryBuildOptionDescription = 16,
|
|
22
|
-
MissingTranslationKey = 17,
|
|
23
|
-
NoAppName = 18,
|
|
24
|
-
NoAppNameFound = 19,
|
|
25
|
-
NoAppOrWorkspaceInCurrentDirectory = 20,
|
|
26
|
-
NoWorkspaceName = 21,
|
|
27
|
-
OperationCancelled = 22,
|
|
28
|
-
ServeDescription = 23,
|
|
29
|
-
ServedStopped = 24,
|
|
30
|
-
ServerGatewayMode = 25,
|
|
31
|
-
ServerMode = 26,
|
|
32
|
-
ServerModeInquiry = 27,
|
|
33
|
-
ServerProxyMode = 28,
|
|
34
|
-
StopServerInstructions = 29,
|
|
35
|
-
TemplateFrameworkInquiry = 30,
|
|
36
|
-
TemplateLanguageInquiry = 31,
|
|
37
|
-
UnrecognizedCommand = 32,
|
|
38
|
-
WorkspaceCreated = 33,
|
|
39
|
-
WorkspaceNameInquiry = 34
|
|
40
|
-
}
|
|
41
|
-
export declare const en: Translations;
|
package/frontend/types.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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/frontend/ui.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare function vocaIconsToOptions(vocaIcons: any, selected: string): VocaOption[];
|
|
2
|
-
export type VocaIcon = {
|
|
3
|
-
name: string;
|
|
4
|
-
svg: string;
|
|
5
|
-
};
|
|
6
|
-
export declare enum VocaButtonVariant {
|
|
7
|
-
Primary = "primary",
|
|
8
|
-
Secondary = "secondary",
|
|
9
|
-
Expressive = "expressive",
|
|
10
|
-
Destructive = "destructive",
|
|
11
|
-
Text = "text",
|
|
12
|
-
PrimaryWhite = "primary-white",
|
|
13
|
-
SecondaryWhite = "secondary-white",
|
|
14
|
-
ExpressiveWhite = "expressive-white",
|
|
15
|
-
TertiaryPurple = "tertiary-purple"
|
|
16
|
-
}
|
|
17
|
-
export type VocaOption = {
|
|
18
|
-
label: string;
|
|
19
|
-
value: string;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
selected?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare function getVocaIcon(vocaIcons: any, name: string): VocaIcon;
|
|
24
|
-
export type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
25
|
-
export declare function mapToVocaOptions<T>(items: T, mapper: (item: Unpacked<T>) => VocaOption): VocaOption[];
|
|
26
|
-
export declare function onEnter(fn: Function): (e: KeyboardEvent) => void;
|
|
27
|
-
export declare function friendlyUserName(user: {
|
|
28
|
-
email: string;
|
|
29
|
-
displayName: string;
|
|
30
|
-
}, format?: 'single' | 'all'): string;
|
|
31
|
-
export declare function classNames(...classes: string[]): string;
|
package/prettier-config.json
DELETED
package/typescript-config.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"allowJs": true,
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"downlevelIteration": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"lib": ["esnext", "dom"],
|
|
9
|
-
"moduleResolution": "node",
|
|
10
|
-
"emitDeclarationOnly": true,
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"strict": true,
|
|
14
|
-
"module": "ESNext",
|
|
15
|
-
"target": "ESNext",
|
|
16
|
-
"jsx": "preserve",
|
|
17
|
-
"isolatedModules": false,
|
|
18
|
-
"noUnusedLocals": true,
|
|
19
|
-
"noUnusedParameters": true,
|
|
20
|
-
"experimentalDecorators": true,
|
|
21
|
-
"emitDecoratorMetadata": true
|
|
22
|
-
}
|
|
23
|
-
}
|