@opencxh/domain 1.137.0 → 1.142.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/communication/message-template.d.ts +17 -2
- package/dist/entities/kb/help-center.d.ts +106 -0
- package/dist/entities/kb/index.d.ts +1 -0
- package/dist/entities/kb/types.d.ts +66 -3
- package/dist/entities/kb/types.test.d.ts +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.js +400 -304
- package/dist/platform/manifest.d.ts +8 -0
- package/dist/platform/routing.d.ts +69 -0
- package/dist/platform/routing.test.d.ts +1 -0
- package/dist/platform/sdk.d.ts +9 -0
- package/package.json +1 -1
|
@@ -138,6 +138,14 @@ export interface AppManifest<TSDK = any> {
|
|
|
138
138
|
* Paths will be automatically prefixed with `/apps/{appName}`.
|
|
139
139
|
*/
|
|
140
140
|
routes?: RouteDefinition[];
|
|
141
|
+
/**
|
|
142
|
+
* Root path the app's `public: true` routes are mounted under, e.g. `/help`.
|
|
143
|
+
*
|
|
144
|
+
* Only cosmetic: without it a public route keeps the `/apps/{appName}`
|
|
145
|
+
* prefix and works exactly the same. It exists because a help centre or a
|
|
146
|
+
* status page is a URL customers see and link to.
|
|
147
|
+
*/
|
|
148
|
+
publicBasePath?: string;
|
|
141
149
|
/** An array of menu items provided by this application. */
|
|
142
150
|
menu?: MenuItem[];
|
|
143
151
|
/** An array of translations provided by this application. */
|
|
@@ -8,9 +8,78 @@ export interface RouteDefinition {
|
|
|
8
8
|
resource: string;
|
|
9
9
|
/** If true, the path must match exactly. */
|
|
10
10
|
exact?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Readable without a session. The shell skips its bounce to the login screen
|
|
13
|
+
* for these paths and renders them without any chrome.
|
|
14
|
+
*
|
|
15
|
+
* This says nothing about the data behind the page: every server route is
|
|
16
|
+
* still authenticated unless it opts out with `{ authenticated: false }`.
|
|
17
|
+
*/
|
|
18
|
+
public?: boolean;
|
|
11
19
|
}
|
|
12
20
|
export interface NamespacedRouteDefinition extends RouteDefinition {
|
|
13
21
|
appName: string;
|
|
14
22
|
/** The full, namespaced path, e.g., /apps/my-app/settings */
|
|
15
23
|
absolutePath: string;
|
|
16
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* The app that owns the login screen. Landing there is never a destination —
|
|
27
|
+
* it is where you get sent when you have no session yet.
|
|
28
|
+
*/
|
|
29
|
+
export declare const AUTH_APP_NAME = "auth";
|
|
30
|
+
/**
|
|
31
|
+
* The app that owns this path, or null when the path names no app.
|
|
32
|
+
*
|
|
33
|
+
* Tolerates a missing path on purpose: one caller is a router bridge that has
|
|
34
|
+
* not been bound yet, and it asks from inside an RxJS subscriber — where a
|
|
35
|
+
* thrown TypeError takes the subscription down without a word.
|
|
36
|
+
*/
|
|
37
|
+
export declare function appNameFromPath(path: string | null | undefined): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Does this landing path say where the user wanted to go?
|
|
40
|
+
*
|
|
41
|
+
* Asked at startup by everything that would otherwise send the user somewhere
|
|
42
|
+
* of its own choosing. It has to be one shared answer: the shell and the module
|
|
43
|
+
* loader both used to decide this, and the loader's "go to the default app"
|
|
44
|
+
* simply ran last and overwrote whatever URL you had opened.
|
|
45
|
+
*
|
|
46
|
+
* `/wake` counts — the service worker lands there with a provider in the query
|
|
47
|
+
* and `WakeRoute` routes onward itself.
|
|
48
|
+
*/
|
|
49
|
+
export declare function isDeepLink(path: string | null | undefined): boolean;
|
|
50
|
+
/** Turn a route pattern with `:param` segments into an exact-match regex. */
|
|
51
|
+
export declare function pathToRegex(path: string): RegExp;
|
|
52
|
+
/** Read the `:param` values out of a concrete path, given the pattern it matched. */
|
|
53
|
+
export declare function extractParams(pattern: string, actualPath: string): Record<string, string>;
|
|
54
|
+
/** The shape of a manifest this module needs; keeps it free of the manifest module. */
|
|
55
|
+
export interface PublicRouteSource {
|
|
56
|
+
name: string;
|
|
57
|
+
/**
|
|
58
|
+
* Root path the app's public routes hang under, e.g. `/help`. Absent means
|
|
59
|
+
* they keep the normal `/apps/{name}` prefix — public, just not pretty.
|
|
60
|
+
*/
|
|
61
|
+
publicBasePath?: string;
|
|
62
|
+
routes?: RouteDefinition[];
|
|
63
|
+
}
|
|
64
|
+
export interface PublicRoutePattern {
|
|
65
|
+
appName: string;
|
|
66
|
+
resource: string;
|
|
67
|
+
/** Absolute pattern, e.g. `/help/:hcSlug/:locale`. */
|
|
68
|
+
pattern: string;
|
|
69
|
+
}
|
|
70
|
+
export interface PublicRouteMatch extends PublicRoutePattern {
|
|
71
|
+
params: Record<string, string>;
|
|
72
|
+
}
|
|
73
|
+
/** Where an app's public routes are mounted. */
|
|
74
|
+
export declare function publicBasePathFor(app: PublicRouteSource): string;
|
|
75
|
+
/** Every public route across the installed apps, as absolute patterns. */
|
|
76
|
+
export declare function publicRoutePatterns(apps: Iterable<PublicRouteSource>): PublicRoutePattern[];
|
|
77
|
+
/**
|
|
78
|
+
* The public route this path lands on, or null.
|
|
79
|
+
*
|
|
80
|
+
* Most specific pattern wins, so registration order never decides which page a
|
|
81
|
+
* URL opens.
|
|
82
|
+
*/
|
|
83
|
+
export declare function matchPublicRoute(path: string | null | undefined, patterns: readonly PublicRoutePattern[]): PublicRouteMatch | null;
|
|
84
|
+
/** Does this path resolve to a page that may be read without a session? */
|
|
85
|
+
export declare function isPublicPath(path: string | null | undefined, patterns: readonly PublicRoutePattern[]): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/platform/sdk.d.ts
CHANGED
|
@@ -22,7 +22,16 @@ export interface InternalSDK<LocalServices extends ServiceMap = {}, TranslationK
|
|
|
22
22
|
invoke<R = any>(options: InvokeOptions): Promise<R>;
|
|
23
23
|
};
|
|
24
24
|
readonly router: {
|
|
25
|
+
/** Relative to the app's own `/apps/{appName}` prefix. */
|
|
25
26
|
navigate(path: string, options?: any): void;
|
|
27
|
+
/**
|
|
28
|
+
* Straight to a shell path, no prefix.
|
|
29
|
+
*
|
|
30
|
+
* For the app's `public: true` routes: those hang off the manifest's
|
|
31
|
+
* `publicBasePath` (`/help/…`), so the app prefix would point at a page
|
|
32
|
+
* that does not exist.
|
|
33
|
+
*/
|
|
34
|
+
navigateAbsolute(path: string, options?: any): void;
|
|
26
35
|
currentPath(): string;
|
|
27
36
|
path$: Observable<string>;
|
|
28
37
|
};
|