@greensecurity/javascript-sdk 0.46.0-beta.10 → 0.46.0-beta.12
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/commonjs/__tests__/apps/contract.test.js +288 -4
- package/dist/commonjs/__tests__/apps/contract.test.js.map +1 -1
- package/dist/commonjs/__tests__/apps/devpreview-routes.test.d.ts +2 -0
- package/dist/commonjs/__tests__/apps/devpreview-routes.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/apps/devpreview-routes.test.js +86 -0
- package/dist/commonjs/__tests__/apps/devpreview-routes.test.js.map +1 -0
- package/dist/commonjs/__tests__/apps/kit/example.test.js +84 -4
- package/dist/commonjs/__tests__/apps/kit/example.test.js.map +1 -1
- package/dist/commonjs/__tests__/apps/kit/pages.test.d.ts +2 -0
- package/dist/commonjs/__tests__/apps/kit/pages.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/apps/kit/pages.test.js +119 -0
- package/dist/commonjs/__tests__/apps/kit/pages.test.js.map +1 -0
- package/dist/commonjs/__tests__/apps/kit/render.test.js +24 -0
- package/dist/commonjs/__tests__/apps/kit/render.test.js.map +1 -1
- package/dist/commonjs/__tests__/apps/kit/store.test.d.ts +2 -0
- package/dist/commonjs/__tests__/apps/kit/store.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/apps/kit/store.test.js +123 -0
- package/dist/commonjs/__tests__/apps/kit/store.test.js.map +1 -0
- package/dist/commonjs/__tests__/apps/post-install-page.test.d.ts +2 -0
- package/dist/commonjs/__tests__/apps/post-install-page.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/apps/post-install-page.test.js +110 -0
- package/dist/commonjs/__tests__/apps/post-install-page.test.js.map +1 -0
- package/dist/commonjs/__tests__/apps/routes.test.d.ts +2 -0
- package/dist/commonjs/__tests__/apps/routes.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/apps/routes.test.js +238 -0
- package/dist/commonjs/__tests__/apps/routes.test.js.map +1 -0
- package/dist/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +22 -4
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/apps/components.d.ts +321 -0
- package/dist/commonjs/apps/components.d.ts.map +1 -1
- package/dist/commonjs/apps/components.js +168 -2
- package/dist/commonjs/apps/components.js.map +1 -1
- package/dist/commonjs/apps/context.d.ts +24 -0
- package/dist/commonjs/apps/context.d.ts.map +1 -1
- package/dist/commonjs/apps/context.js.map +1 -1
- package/dist/commonjs/apps/devpreview.d.ts +20 -3
- package/dist/commonjs/apps/devpreview.d.ts.map +1 -1
- package/dist/commonjs/apps/devpreview.js +18 -7
- package/dist/commonjs/apps/devpreview.js.map +1 -1
- package/dist/commonjs/apps/hooks/index.d.ts +33 -2
- package/dist/commonjs/apps/hooks/index.d.ts.map +1 -1
- package/dist/commonjs/apps/hooks/index.js +41 -1
- package/dist/commonjs/apps/hooks/index.js.map +1 -1
- package/dist/commonjs/apps/hooks/store.d.ts +48 -0
- package/dist/commonjs/apps/hooks/store.d.ts.map +1 -0
- package/dist/commonjs/apps/hooks/store.js +87 -0
- package/dist/commonjs/apps/hooks/store.js.map +1 -0
- package/dist/commonjs/apps/manifest.d.ts +64 -3
- package/dist/commonjs/apps/manifest.d.ts.map +1 -1
- package/dist/commonjs/apps/manifest.js +128 -27
- package/dist/commonjs/apps/manifest.js.map +1 -1
- package/dist/commonjs/apps/protocol.d.ts +1 -1
- package/dist/commonjs/apps/protocol.d.ts.map +1 -1
- package/dist/commonjs/apps/route.d.ts +11 -1
- package/dist/commonjs/apps/route.d.ts.map +1 -1
- package/dist/commonjs/apps/route.js +13 -7
- package/dist/commonjs/apps/route.js.map +1 -1
- package/dist/commonjs/apps/routes.d.ts +65 -0
- package/dist/commonjs/apps/routes.d.ts.map +1 -0
- package/dist/commonjs/apps/routes.js +202 -0
- package/dist/commonjs/apps/routes.js.map +1 -0
- package/dist/commonjs/apps/surfaces.d.ts +20 -2
- package/dist/commonjs/apps/surfaces.d.ts.map +1 -1
- package/dist/commonjs/apps/surfaces.js +45 -7
- package/dist/commonjs/apps/surfaces.js.map +1 -1
- package/dist/commonjs/apps/testing/index.d.ts +17 -1
- package/dist/commonjs/apps/testing/index.d.ts.map +1 -1
- package/dist/commonjs/apps/testing/index.js +50 -1
- package/dist/commonjs/apps/testing/index.js.map +1 -1
- package/dist/commonjs/apps/ui/index.d.ts +13 -0
- package/dist/commonjs/apps/ui/index.d.ts.map +1 -1
- package/dist/commonjs/apps/ui/index.js +19 -2
- package/dist/commonjs/apps/ui/index.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/esm/__tests__/apps/contract.test.js +289 -5
- package/dist/esm/__tests__/apps/contract.test.js.map +1 -1
- package/dist/esm/__tests__/apps/devpreview-routes.test.d.ts +2 -0
- package/dist/esm/__tests__/apps/devpreview-routes.test.d.ts.map +1 -0
- package/dist/esm/__tests__/apps/devpreview-routes.test.js +84 -0
- package/dist/esm/__tests__/apps/devpreview-routes.test.js.map +1 -0
- package/dist/esm/__tests__/apps/kit/example.test.js +85 -5
- package/dist/esm/__tests__/apps/kit/example.test.js.map +1 -1
- package/dist/esm/__tests__/apps/kit/pages.test.d.ts +2 -0
- package/dist/esm/__tests__/apps/kit/pages.test.d.ts.map +1 -0
- package/dist/esm/__tests__/apps/kit/pages.test.js +117 -0
- package/dist/esm/__tests__/apps/kit/pages.test.js.map +1 -0
- package/dist/esm/__tests__/apps/kit/render.test.js +25 -1
- package/dist/esm/__tests__/apps/kit/render.test.js.map +1 -1
- package/dist/esm/__tests__/apps/kit/store.test.d.ts +2 -0
- package/dist/esm/__tests__/apps/kit/store.test.d.ts.map +1 -0
- package/dist/esm/__tests__/apps/kit/store.test.js +121 -0
- package/dist/esm/__tests__/apps/kit/store.test.js.map +1 -0
- package/dist/esm/__tests__/apps/post-install-page.test.d.ts +2 -0
- package/dist/esm/__tests__/apps/post-install-page.test.d.ts.map +1 -0
- package/dist/esm/__tests__/apps/post-install-page.test.js +108 -0
- package/dist/esm/__tests__/apps/post-install-page.test.js.map +1 -0
- package/dist/esm/__tests__/apps/routes.test.d.ts +2 -0
- package/dist/esm/__tests__/apps/routes.test.d.ts.map +1 -0
- package/dist/esm/__tests__/apps/routes.test.js +236 -0
- package/dist/esm/__tests__/apps/routes.test.js.map +1 -0
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js +1 -1
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +22 -4
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/apps/components.d.ts +321 -0
- package/dist/esm/apps/components.d.ts.map +1 -1
- package/dist/esm/apps/components.js +163 -1
- package/dist/esm/apps/components.js.map +1 -1
- package/dist/esm/apps/context.d.ts +24 -0
- package/dist/esm/apps/context.d.ts.map +1 -1
- package/dist/esm/apps/context.js.map +1 -1
- package/dist/esm/apps/devpreview.d.ts +20 -3
- package/dist/esm/apps/devpreview.d.ts.map +1 -1
- package/dist/esm/apps/devpreview.js +19 -8
- package/dist/esm/apps/devpreview.js.map +1 -1
- package/dist/esm/apps/hooks/index.d.ts +33 -2
- package/dist/esm/apps/hooks/index.d.ts.map +1 -1
- package/dist/esm/apps/hooks/index.js +37 -1
- package/dist/esm/apps/hooks/index.js.map +1 -1
- package/dist/esm/apps/hooks/store.d.ts +48 -0
- package/dist/esm/apps/hooks/store.d.ts.map +1 -0
- package/dist/esm/apps/hooks/store.js +84 -0
- package/dist/esm/apps/hooks/store.js.map +1 -0
- package/dist/esm/apps/manifest.d.ts +64 -3
- package/dist/esm/apps/manifest.d.ts.map +1 -1
- package/dist/esm/apps/manifest.js +116 -26
- package/dist/esm/apps/manifest.js.map +1 -1
- package/dist/esm/apps/protocol.d.ts +1 -1
- package/dist/esm/apps/protocol.d.ts.map +1 -1
- package/dist/esm/apps/route.d.ts +11 -1
- package/dist/esm/apps/route.d.ts.map +1 -1
- package/dist/esm/apps/route.js +14 -8
- package/dist/esm/apps/route.js.map +1 -1
- package/dist/esm/apps/routes.d.ts +65 -0
- package/dist/esm/apps/routes.d.ts.map +1 -0
- package/dist/esm/apps/routes.js +194 -0
- package/dist/esm/apps/routes.js.map +1 -0
- package/dist/esm/apps/surfaces.d.ts +20 -2
- package/dist/esm/apps/surfaces.d.ts.map +1 -1
- package/dist/esm/apps/surfaces.js +39 -2
- package/dist/esm/apps/surfaces.js.map +1 -1
- package/dist/esm/apps/testing/index.d.ts +17 -1
- package/dist/esm/apps/testing/index.d.ts.map +1 -1
- package/dist/esm/apps/testing/index.js +49 -1
- package/dist/esm/apps/testing/index.js.map +1 -1
- package/dist/esm/apps/ui/index.d.ts +13 -0
- package/dist/esm/apps/ui/index.d.ts.map +1 -1
- package/dist/esm/apps/ui/index.js +17 -1
- package/dist/esm/apps/ui/index.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/examples/apps/hello-green/src/store.ts +15 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/apps/contract.test.ts +305 -4
- package/src/__tests__/apps/devpreview-routes.test.ts +103 -0
- package/src/__tests__/apps/kit/example.test.ts +94 -5
- package/src/__tests__/apps/kit/pages.test.ts +137 -0
- package/src/__tests__/apps/kit/render.test.ts +35 -1
- package/src/__tests__/apps/kit/store.test.ts +149 -0
- package/src/__tests__/apps/post-install-page.test.ts +126 -0
- package/src/__tests__/apps/routes.test.ts +318 -0
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/__tests__/zones.test.ts +22 -4
- package/src/apps/components.ts +183 -1
- package/src/apps/context.ts +25 -0
- package/src/apps/devpreview.ts +20 -7
- package/src/apps/hooks/index.ts +42 -2
- package/src/apps/hooks/store.ts +115 -0
- package/src/apps/manifest.ts +151 -27
- package/src/apps/protocol.ts +1 -1
- package/src/apps/route.ts +22 -10
- package/src/apps/routes.ts +230 -0
- package/src/apps/surfaces.ts +45 -12
- package/src/apps/testing/index.ts +48 -2
- package/src/apps/ui/index.ts +18 -1
- package/src/lib/config.ts +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../../src/apps/hooks/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AA4BlE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,cAAc,CAAmB,OAAU;IACzD,IAAI,KAAK,GAAG,OAAO,CAAC;IACpB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEjD,MAAM,KAAK,GAAgB;QACzB,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;QAErB,QAAQ,CAAC,MAAM;YACb,MAAM,KAAK,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YACpE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAmB,CAAC;YAClD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;gBAAE,OAAO;YACpE,MAAM,QAAQ,GAAG,KAAK,CAAC;YACvB,KAAK,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;YAC/B,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,SAAS,CAAC;gBAAE,QAAQ,CAAC,KAAK,EAAE,QA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,CAAC,CAAC,CAAC,KAAK,CAAC;QAC/E,KAAK,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAC5D,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,oBAAoB,CAAC,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
export { IPV4_OCTET_PATTERN, PORT_PATTERN, CSP_PATH_CHAR, CSP_SOURCE_MAX_CHARS, CSP_SOURCE_PATTERN, CSP_SOURCES_MAX_PER_DIRECTIVE, CSP_SOURCES_MAX_TOTAL_CHARS, cspSourcesTotalChars, HTTPS_URL_PATTERN, isHttpsUrl, isParsableHttpsUrl, } from "./url.js";
|
|
3
|
+
export { APP_ROUTES_MAX, CONCRETE_ROUTE_PATH_PATTERN, isConcreteRoutePath, isRoutePath, matchAppRoute, normalizeRoutePath, ROUTE_PATH_MAX_CHARS, ROUTE_PATH_MAX_SEGMENTS, ROUTE_PATH_PATTERN, routeSetIssues, type AppRouteMatch, type RouteSetIssue, } from "./routes.js";
|
|
3
4
|
/** A single SRI hash with the digest length its algorithm produces (32, 48 or 64 bytes, base64). */
|
|
4
5
|
export declare const SRI_PATTERN = "^(sha256-[A-Za-z0-9+/]{43}=|sha384-[A-Za-z0-9+/]{64}|sha512-[A-Za-z0-9+/]{86}==)$";
|
|
5
6
|
/** SemVer 2.0.0 (semver.org's reference pattern): no empty or leading-zero numeric identifiers. */
|
|
@@ -45,6 +46,45 @@ export declare const appViewSchema: z.ZodObject<{
|
|
|
45
46
|
}>;
|
|
46
47
|
component: z.ZodString;
|
|
47
48
|
}, z.core.$strict>;
|
|
49
|
+
/** Reports {@link routeSetIssues} (segment cap, repeated params, duplicate paths, repeated portals). */
|
|
50
|
+
export declare function addRouteIssues(routes: ReadonlyArray<{
|
|
51
|
+
path: string;
|
|
52
|
+
portals?: readonly string[] | undefined;
|
|
53
|
+
navigation?: unknown;
|
|
54
|
+
}> | undefined, ctx: z.RefinementCtx, path: ReadonlyArray<string | number>): void;
|
|
55
|
+
/**
|
|
56
|
+
* One app page. The host renders `component` at `/{portal}/apps/{appId}/pages{path}`.
|
|
57
|
+
*
|
|
58
|
+
* `title` is required here, for new manifests. The server keeps accepting title-less entries in a
|
|
59
|
+
* bundle-less v1 manifest, which stored `routes[{ path, component }]` before pages were rendered;
|
|
60
|
+
* such a manifest has nothing to render them with, and the host never shows them.
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* Text a person reads (a page title, a sidebar label): at least one character that isn't
|
|
64
|
+
* whitespace. The host never shows a blank one, so the manifest can't publish one.
|
|
65
|
+
*
|
|
66
|
+
* This is JavaScript's `\S` spelled out (ASCII whitespace, the Unicode space separators,
|
|
67
|
+
* U+2028/U+2029 and U+FEFF), because the generated schema's patterns also run as Ruby regexps, and
|
|
68
|
+
* Ruby's `\S` is ASCII-only: there, a title of no-break spaces would pass.
|
|
69
|
+
*/
|
|
70
|
+
export declare const NON_BLANK_PATTERN = "[^\\t\\n\\v\\f\\r \\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]";
|
|
71
|
+
export declare const appRouteSchema: z.ZodObject<{
|
|
72
|
+
path: z.ZodString;
|
|
73
|
+
component: z.ZodString;
|
|
74
|
+
/** Page header title. */
|
|
75
|
+
title: z.ZodString;
|
|
76
|
+
/** Portals the page is offered in. Absent = every portal the host renders. */
|
|
77
|
+
portals: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
78
|
+
facility: "facility";
|
|
79
|
+
system: "system";
|
|
80
|
+
company: "company";
|
|
81
|
+
vendor: "vendor";
|
|
82
|
+
}>>>;
|
|
83
|
+
/** Offer the page in the sidebar / mobile drawer menu under this label (default: `title`). */
|
|
84
|
+
navigation: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
label: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
}, z.core.$strict>;
|
|
48
88
|
/** Constants are delivered to every view as `environment.constants`. */
|
|
49
89
|
export declare const appConstantsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
50
90
|
export declare const appCspSchema: z.ZodObject<{
|
|
@@ -84,10 +124,23 @@ export declare const appManifestSchema: z.ZodObject<{
|
|
|
84
124
|
}>;
|
|
85
125
|
component: z.ZodString;
|
|
86
126
|
}, z.core.$strict>>>;
|
|
87
|
-
/**
|
|
127
|
+
/** App pages, each a full screen under `/{portal}/apps/{appId}/pages`. */
|
|
88
128
|
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
89
129
|
path: z.ZodString;
|
|
90
130
|
component: z.ZodString;
|
|
131
|
+
/** Page header title. */
|
|
132
|
+
title: z.ZodString;
|
|
133
|
+
/** Portals the page is offered in. Absent = every portal the host renders. */
|
|
134
|
+
portals: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
135
|
+
facility: "facility";
|
|
136
|
+
system: "system";
|
|
137
|
+
company: "company";
|
|
138
|
+
vendor: "vendor";
|
|
139
|
+
}>>>;
|
|
140
|
+
/** Offer the page in the sidebar / mobile drawer menu under this label (default: `title`). */
|
|
141
|
+
navigation: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
label: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, z.core.$strict>>;
|
|
91
144
|
}, z.core.$strict>>>;
|
|
92
145
|
csp: z.ZodOptional<z.ZodObject<{
|
|
93
146
|
connect_src: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -102,8 +155,14 @@ export declare const appManifestSchema: z.ZodObject<{
|
|
|
102
155
|
url: "url";
|
|
103
156
|
app_settings_view: "app_settings_view";
|
|
104
157
|
app_main_view: "app_main_view";
|
|
158
|
+
app_page: "app_page";
|
|
105
159
|
}>;
|
|
106
160
|
url: z.ZodOptional<z.ZodString>;
|
|
161
|
+
/**
|
|
162
|
+
* For `app_page` only: the page to open, a concrete path (no `:params`) that one of
|
|
163
|
+
* `ui_extensions.routes` matches, such as `/welcome` or `/reports/7`.
|
|
164
|
+
*/
|
|
165
|
+
path: z.ZodOptional<z.ZodString>;
|
|
107
166
|
}, z.core.$strict>>;
|
|
108
167
|
webhooks: z.ZodOptional<z.ZodObject<{
|
|
109
168
|
url: z.ZodString;
|
|
@@ -115,12 +174,14 @@ export declare const appManifestSchema: z.ZodObject<{
|
|
|
115
174
|
}, z.core.$strict>>;
|
|
116
175
|
}, z.core.$strict>;
|
|
117
176
|
export type AppManifestV2 = z.infer<typeof appManifestSchema>;
|
|
177
|
+
export type AppRoute = z.infer<typeof appRouteSchema>;
|
|
118
178
|
export type PostInstallAction = NonNullable<AppManifestV2["post_install_action"]>;
|
|
119
179
|
/**
|
|
120
180
|
* What installing the app does when `post_install_action` is left out, so the server and the host
|
|
121
181
|
* never land an installer on a view the app does not have: nothing for a back-end-only app, the
|
|
122
|
-
* settings page for a settings-only app, and the app's main view otherwise.
|
|
123
|
-
* "no post-install step". An explicit action
|
|
182
|
+
* settings page for a settings-only app, and the app's main view otherwise. A root page (route
|
|
183
|
+
* `/`) counts as a main view. `null` means "no post-install step". An explicit action, including
|
|
184
|
+
* `app_page`, is returned unchanged.
|
|
124
185
|
*/
|
|
125
186
|
export declare function effectivePostInstallAction(manifest: Pick<AppManifestV2, "post_install_action" | "ui_extensions">): PostInstallAction | null;
|
|
126
187
|
export type AppView = z.infer<typeof appViewSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/apps/manifest.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/apps/manifest.ts"],"names":[],"mappings":"A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ppRoute, ROUTE_PATH_MAX_CHARS, ROUTE_PATH_PATTERN, routeSetIssues, } from "./routes.js";
|
|
12
13
|
import { SURFACES } from "./surfaces.js";
|
|
13
14
|
import { CSP_SOURCE_MAX_CHARS, CSP_SOURCE_PATTERN, CSP_SOURCES_MAX_PER_DIRECTIVE, CSP_SOURCES_MAX_TOTAL_CHARS, cspSourcesTotalChars, HTTPS_URL_PATTERN, isParsableHttpsUrl, } from "./url.js";
|
|
14
15
|
// The URL and CSP-source rules live in the zod-free `url.ts` so the host renderer can use them
|
|
15
16
|
// without bundling zod; re-exported here because they are part of the manifest contract.
|
|
16
17
|
export { IPV4_OCTET_PATTERN, PORT_PATTERN, CSP_PATH_CHAR, CSP_SOURCE_MAX_CHARS, CSP_SOURCE_PATTERN, CSP_SOURCES_MAX_PER_DIRECTIVE, CSP_SOURCES_MAX_TOTAL_CHARS, cspSourcesTotalChars, HTTPS_URL_PATTERN, isHttpsUrl, isParsableHttpsUrl, } from "./url.js";
|
|
18
|
+
// The route grammar and matcher live in the zod-free `routes.ts` for the same reason.
|
|
19
|
+
export { APP_ROUTES_MAX, CONCRETE_ROUTE_PATH_PATTERN, isConcreteRoutePath, isRoutePath, matchAppRoute, normalizeRoutePath, ROUTE_PATH_MAX_CHARS, ROUTE_PATH_MAX_SEGMENTS, ROUTE_PATH_PATTERN, routeSetIssues, } from "./routes.js";
|
|
17
20
|
/** A single SRI hash with the digest length its algorithm produces (32, 48 or 64 bytes, base64). */
|
|
18
21
|
export const SRI_PATTERN = "^(sha256-[A-Za-z0-9+/]{43}=|sha384-[A-Za-z0-9+/]{64}|sha512-[A-Za-z0-9+/]{86}==)$";
|
|
19
22
|
/** SemVer 2.0.0 (semver.org's reference pattern): no empty or leading-zero numeric identifiers. */
|
|
@@ -47,7 +50,10 @@ const PLATFORM_PERMISSION_NAMES = new Set(PLATFORM_PERMISSIONS.map((p) => p.perm
|
|
|
47
50
|
export function isPlatformPermission(value) {
|
|
48
51
|
return typeof value === "string" && PLATFORM_PERMISSION_NAMES.has(value);
|
|
49
52
|
}
|
|
50
|
-
|
|
53
|
+
// A view's viewport. `page` is not one: an app declares its pages in `routes`, not in `views`.
|
|
54
|
+
const SURFACE_IDS = SURFACES.filter((s) => s.kind !== "page").map((s) => s.id);
|
|
55
|
+
/** Portals an app page may be offered in (`routes[].portals`). */
|
|
56
|
+
const ROUTE_PORTALS = ["company", "vendor", "facility", "system"];
|
|
51
57
|
/** Lifecycle events an app's own webhook endpoint can receive (see C19). */
|
|
52
58
|
export const APP_WEBHOOK_EVENTS = [
|
|
53
59
|
"MarketplaceAppActivation.created",
|
|
@@ -100,6 +106,42 @@ export const appViewSchema = z.strictObject({
|
|
|
100
106
|
viewport: z.enum(SURFACE_IDS),
|
|
101
107
|
component: z.string().max(100).regex(new RegExp(COMPONENT_NAME_PATTERN)),
|
|
102
108
|
});
|
|
109
|
+
/** Reports {@link routeSetIssues} (segment cap, repeated params, duplicate paths, repeated portals). */
|
|
110
|
+
export function addRouteIssues(routes, ctx, path) {
|
|
111
|
+
for (const issue of routeSetIssues(routes ?? [])) {
|
|
112
|
+
ctx.addIssue({ code: "custom", path: [...path, issue.index, issue.field], message: issue.message });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* One app page. The host renders `component` at `/{portal}/apps/{appId}/pages{path}`.
|
|
117
|
+
*
|
|
118
|
+
* `title` is required here, for new manifests. The server keeps accepting title-less entries in a
|
|
119
|
+
* bundle-less v1 manifest, which stored `routes[{ path, component }]` before pages were rendered;
|
|
120
|
+
* such a manifest has nothing to render them with, and the host never shows them.
|
|
121
|
+
*/
|
|
122
|
+
/**
|
|
123
|
+
* Text a person reads (a page title, a sidebar label): at least one character that isn't
|
|
124
|
+
* whitespace. The host never shows a blank one, so the manifest can't publish one.
|
|
125
|
+
*
|
|
126
|
+
* This is JavaScript's `\S` spelled out (ASCII whitespace, the Unicode space separators,
|
|
127
|
+
* U+2028/U+2029 and U+FEFF), because the generated schema's patterns also run as Ruby regexps, and
|
|
128
|
+
* Ruby's `\S` is ASCII-only: there, a title of no-break spaces would pass.
|
|
129
|
+
*/
|
|
130
|
+
export const NON_BLANK_PATTERN = "[^\\t\\n\\v\\f\\r \\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]";
|
|
131
|
+
export const appRouteSchema = z.strictObject({
|
|
132
|
+
path: z.string().max(ROUTE_PATH_MAX_CHARS).regex(new RegExp(ROUTE_PATH_PATTERN)),
|
|
133
|
+
component: z.string().max(100).regex(new RegExp(COMPONENT_NAME_PATTERN)),
|
|
134
|
+
/** Page header title. */
|
|
135
|
+
title: z.string().min(1).max(100).regex(new RegExp(NON_BLANK_PATTERN), { message: "must not be blank" }),
|
|
136
|
+
/** Portals the page is offered in. Absent = every portal the host renders. */
|
|
137
|
+
portals: z.array(z.enum(ROUTE_PORTALS)).min(1).max(ROUTE_PORTALS.length).optional(),
|
|
138
|
+
/** Offer the page in the sidebar / mobile drawer menu under this label (default: `title`). */
|
|
139
|
+
navigation: z
|
|
140
|
+
.strictObject({
|
|
141
|
+
label: z.string().min(1).max(40).regex(new RegExp(NON_BLANK_PATTERN), { message: "must not be blank" }).optional(),
|
|
142
|
+
})
|
|
143
|
+
.optional(),
|
|
144
|
+
});
|
|
103
145
|
/** Constants are delivered to every view as `environment.constants`. */
|
|
104
146
|
export const appConstantsSchema = z.record(z.string().max(100).regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.union([z.string().max(2048), z.number(), z.boolean()]));
|
|
105
147
|
export const appCspSchema = z.strictObject({
|
|
@@ -139,21 +181,20 @@ export const appManifestSchema = z
|
|
|
139
181
|
integrity: z.string().max(200).regex(new RegExp(SRI_PATTERN)),
|
|
140
182
|
}).optional(),
|
|
141
183
|
views: z.array(appViewSchema).max(200).optional(),
|
|
142
|
-
/**
|
|
143
|
-
routes: z
|
|
144
|
-
.array(z.strictObject({
|
|
145
|
-
path: z.string().max(200).regex(/^\/[a-z0-9\-/:]*$/),
|
|
146
|
-
component: z.string().max(100).regex(new RegExp(COMPONENT_NAME_PATTERN)),
|
|
147
|
-
}))
|
|
148
|
-
.max(50)
|
|
149
|
-
.optional(),
|
|
184
|
+
/** App pages, each a full screen under `/{portal}/apps/{appId}/pages`. */
|
|
185
|
+
routes: z.array(appRouteSchema).max(APP_ROUTES_MAX).optional(),
|
|
150
186
|
csp: appCspSchema.optional(),
|
|
151
187
|
})
|
|
152
188
|
.optional(),
|
|
153
189
|
post_install_action: z
|
|
154
190
|
.strictObject({
|
|
155
|
-
type: z.enum(["url", "app_settings_view", "app_main_view"]),
|
|
191
|
+
type: z.enum(["url", "app_settings_view", "app_main_view", "app_page"]),
|
|
156
192
|
url: httpsUrlSchema.optional(),
|
|
193
|
+
/**
|
|
194
|
+
* For `app_page` only: the page to open, a concrete path (no `:params`) that one of
|
|
195
|
+
* `ui_extensions.routes` matches, such as `/welcome` or `/reports/7`.
|
|
196
|
+
*/
|
|
197
|
+
path: z.string().max(ROUTE_PATH_MAX_CHARS).regex(new RegExp(CONCRETE_ROUTE_PATH_PATTERN)).optional(),
|
|
157
198
|
})
|
|
158
199
|
.optional(),
|
|
159
200
|
// The app's own webhook endpoint: registered by the catalog when the manifest is published, not
|
|
@@ -167,31 +208,50 @@ export const appManifestSchema = z
|
|
|
167
208
|
.optional(),
|
|
168
209
|
})
|
|
169
210
|
.superRefine((manifest, ctx) => {
|
|
170
|
-
addDuplicateViewportIssues(manifest.ui_extensions?.views, ctx, ["ui_extensions", "views"]);
|
|
171
|
-
addCspBudgetIssue(manifest.ui_extensions?.csp, ctx, ["ui_extensions", "csp"]);
|
|
172
211
|
const events = manifest.webhooks?.events ?? [];
|
|
173
212
|
if (new Set(events).size !== events.length) {
|
|
174
213
|
ctx.addIssue({ code: "custom", path: ["webhooks", "events"], message: "events must not repeat" });
|
|
175
214
|
}
|
|
176
|
-
if (manifest.
|
|
215
|
+
if (manifest.post_install_action?.type === "url" && !manifest.post_install_action.url) {
|
|
216
|
+
ctx.addIssue({ code: "custom", path: ["post_install_action", "url"], message: "url is required for type=url" });
|
|
217
|
+
}
|
|
218
|
+
if (manifest.post_install_action?.type !== "app_page" && manifest.post_install_action?.path !== undefined) {
|
|
219
|
+
ctx.addIssue({ code: "custom", path: ["post_install_action", "path"], message: "path is only allowed for type=app_page" });
|
|
220
|
+
}
|
|
221
|
+
// When a field under `ui_extensions` fails its own schema, zod hands this refinement the
|
|
222
|
+
// manifest without `ui_extensions`, so every rule below would report a problem that isn't
|
|
223
|
+
// there (a missing settings view, an unmatched post-install page). Report the real one only.
|
|
224
|
+
if (ctx.issues.some((issue) => issue.path?.[0] === "ui_extensions"))
|
|
225
|
+
return;
|
|
226
|
+
addDuplicateViewportIssues(manifest.ui_extensions?.views, ctx, ["ui_extensions", "views"]);
|
|
227
|
+
addRouteIssues(manifest.ui_extensions?.routes, ctx, ["ui_extensions", "routes"]);
|
|
228
|
+
addCspBudgetIssue(manifest.ui_extensions?.csp, ctx, ["ui_extensions", "csp"]);
|
|
229
|
+
const hasViews = Boolean(manifest.ui_extensions?.views?.length);
|
|
230
|
+
const hasRoutes = Boolean(manifest.ui_extensions?.routes?.length);
|
|
231
|
+
if (hasViews && !manifest.ui_extensions?.bundle) {
|
|
177
232
|
ctx.addIssue({
|
|
178
233
|
code: "custom",
|
|
179
234
|
path: ["ui_extensions", "bundle"],
|
|
180
235
|
message: "bundle is required when views are declared",
|
|
181
236
|
});
|
|
182
237
|
}
|
|
238
|
+
if (hasRoutes && !manifest.ui_extensions?.bundle) {
|
|
239
|
+
ctx.addIssue({
|
|
240
|
+
code: "custom",
|
|
241
|
+
path: ["ui_extensions", "bundle"],
|
|
242
|
+
message: "bundle is required when routes are declared",
|
|
243
|
+
});
|
|
244
|
+
}
|
|
183
245
|
// `version` stays optional only for legacy (v1) manifests. Anything the host renders needs one:
|
|
184
246
|
// it names the runtime URL and reaches views as `ExtensionContext.app.version`.
|
|
185
|
-
if ((manifest.ui_extensions?.bundle ||
|
|
247
|
+
if ((manifest.ui_extensions?.bundle || hasViews || hasRoutes) && !manifest.version) {
|
|
186
248
|
ctx.addIssue({
|
|
187
249
|
code: "custom",
|
|
188
250
|
path: ["version"],
|
|
189
|
-
message: "version is required when ui_extensions declares a bundle or
|
|
251
|
+
message: "version is required when ui_extensions declares a bundle, views or routes",
|
|
190
252
|
});
|
|
191
253
|
}
|
|
192
|
-
|
|
193
|
-
ctx.addIssue({ code: "custom", path: ["post_install_action", "url"], message: "url is required for type=url" });
|
|
194
|
-
}
|
|
254
|
+
addAppPageActionIssues(manifest, ctx);
|
|
195
255
|
// A back-end-only app has no views, so it cannot land installers on one. Checked only for
|
|
196
256
|
// versioned (v2) manifests: v1 apps may carry a post-install view type from before views existed.
|
|
197
257
|
const viewports = new Set((manifest.ui_extensions?.views ?? []).map((v) => v.viewport));
|
|
@@ -204,28 +264,58 @@ export const appManifestSchema = z
|
|
|
204
264
|
});
|
|
205
265
|
}
|
|
206
266
|
// The settings page is not a main view: a settings-only app should land on app_settings_view.
|
|
207
|
-
|
|
208
|
-
if (versioned && manifest.post_install_action?.type === "app_main_view" &&
|
|
267
|
+
// A root page (route `/`) is one: installing opens `/{portal}/apps/{id}/pages`.
|
|
268
|
+
if (versioned && manifest.post_install_action?.type === "app_main_view" && !hasMainView(manifest)) {
|
|
209
269
|
ctx.addIssue({
|
|
210
270
|
code: "custom",
|
|
211
271
|
path: ["post_install_action", "type"],
|
|
212
|
-
message: "app_main_view requires a view other than settings",
|
|
272
|
+
message: "app_main_view requires a view other than settings, or a root route",
|
|
213
273
|
});
|
|
214
274
|
}
|
|
215
275
|
});
|
|
276
|
+
/**
|
|
277
|
+
* The rules for `post_install_action.path`: required for `app_page` and allowed nowhere else, a
|
|
278
|
+
* concrete path within the route limits, and one that a declared route matches (`/reports/7` for a
|
|
279
|
+
* `/reports/:id` route), so installing never opens a page the app does not have.
|
|
280
|
+
*/
|
|
281
|
+
function addAppPageActionIssues(manifest, ctx) {
|
|
282
|
+
const action = manifest.post_install_action;
|
|
283
|
+
if (action === undefined)
|
|
284
|
+
return;
|
|
285
|
+
const path = ["post_install_action", "path"];
|
|
286
|
+
// `path` on another type is reported by the manifest refinement, before the rules that need
|
|
287
|
+
// `ui_extensions`.
|
|
288
|
+
if (action.type !== "app_page")
|
|
289
|
+
return;
|
|
290
|
+
if (action.path === undefined) {
|
|
291
|
+
ctx.addIssue({ code: "custom", path, message: "path is required for type=app_page" });
|
|
292
|
+
}
|
|
293
|
+
else if (!isConcreteRoutePath(action.path)) {
|
|
294
|
+
ctx.addIssue({ code: "custom", path, message: "path must be a page path without :params, such as /reports/7" });
|
|
295
|
+
}
|
|
296
|
+
else if (matchAppRoute(manifest.ui_extensions?.routes ?? [], action.path) === null) {
|
|
297
|
+
ctx.addIssue({ code: "custom", path, message: "path must match one of ui_extensions.routes" });
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/** Whether a manifest has a main view to land on: a view other than settings, or a root page `/`. */
|
|
301
|
+
function hasMainView(manifest) {
|
|
302
|
+
const views = manifest.ui_extensions?.views ?? [];
|
|
303
|
+
const routes = manifest.ui_extensions?.routes ?? [];
|
|
304
|
+
return views.some((v) => v.viewport !== "settings") || routes.some((r) => r.path === "/");
|
|
305
|
+
}
|
|
216
306
|
/**
|
|
217
307
|
* What installing the app does when `post_install_action` is left out, so the server and the host
|
|
218
308
|
* never land an installer on a view the app does not have: nothing for a back-end-only app, the
|
|
219
|
-
* settings page for a settings-only app, and the app's main view otherwise.
|
|
220
|
-
* "no post-install step". An explicit action
|
|
309
|
+
* settings page for a settings-only app, and the app's main view otherwise. A root page (route
|
|
310
|
+
* `/`) counts as a main view. `null` means "no post-install step". An explicit action, including
|
|
311
|
+
* `app_page`, is returned unchanged.
|
|
221
312
|
*/
|
|
222
313
|
export function effectivePostInstallAction(manifest) {
|
|
223
314
|
if (manifest.post_install_action)
|
|
224
315
|
return manifest.post_install_action;
|
|
225
|
-
|
|
226
|
-
if (viewports.some((v) => v !== "settings"))
|
|
316
|
+
if (hasMainView(manifest))
|
|
227
317
|
return { type: "app_main_view" };
|
|
228
|
-
if (
|
|
318
|
+
if ((manifest.ui_extensions?.views ?? []).some((v) => v.viewport === "settings"))
|
|
229
319
|
return { type: "app_settings_view" };
|
|
230
320
|
return null;
|
|
231
321
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/apps/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAElB,+FAA+F;AAC/F,yFAAyF;AACzF,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAGlB,oGAAoG;AACpG,MAAM,CAAC,MAAM,WAAW,GAAG,mFAAmF,CAAC;AAC/G,mGAAmG;AACnG,MAAM,CAAC,MAAM,cAAc,GACzB,gDAAgD;IAChD,sGAAsG;IACtG,+CAA+C,CAAC;AAClD,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,0FAA0F;IAC1F,wFAAwF;IACxF,8EAA8E;IAC9E,+DAA+D,CAAC;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD;QACE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,CAAC,YAAY,CAAC,iBAAiB,EAAE;QACvC,MAAM,EAAE,eAAe;QACvB,+FAA+F;QAC/F,4FAA4F;QAC5F,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE;YAChB,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,OAAO;gBAAE,OAAO,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC5E,CAAC;KACF,CAA4B,CAAC;AAChC,CAAC;AAMD,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAE/D,OAAO;QACL,EAAE,EAAE,KAAK;QACT,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;KACrG,CAAC;AACJ,CAAC"}
|
|
@@ -12,7 +12,7 @@ export interface RemoteConnection {
|
|
|
12
12
|
}
|
|
13
13
|
/** `@remote-dom/core` mutation records: insert child, remove child, update text, update property. */
|
|
14
14
|
export type RemoteMutationRecord = readonly [type: 0, parentId: string, child: unknown, index: number] | readonly [type: 1, parentId: string, index: number] | readonly [type: 2, textId: string, text: string] | readonly [type: 3, id: string, name: string, value: unknown, updateType?: 1 | 2 | 3];
|
|
15
|
-
export type ViewType = "context" | "focus" | "settings";
|
|
15
|
+
export type ViewType = "context" | "focus" | "settings" | "page";
|
|
16
16
|
/** Implemented inside the worker by the SDK runtime (`defineApp`). */
|
|
17
17
|
export interface SandboxExports {
|
|
18
18
|
mount(args: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/apps/protocol.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GAAG,IAAI,CAAC;IACvD,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAAC;CACxE;AAED,qGAAqG;AACrG,MAAM,MAAM,oBAAoB,GAC5B,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,GACnE,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,GACnD,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,GAChD,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAEzF,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/apps/protocol.ts"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AE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAcnG;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAoB1E"}
|
package/dist/esm/apps/route.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SurfaceId } from "./surfaces.js";
|
|
2
|
-
/** Values the destination view receives as `environment.queryParams`. Strings only. */
|
|
2
|
+
/** Values the destination view receives as `environment.navParams`, never as `queryParams`. Strings only. */
|
|
3
3
|
export type EnvParams = Record<string, string>;
|
|
4
4
|
export type RouteDescriptor =
|
|
5
5
|
/** The screen a surface lives on, optionally for one record (detail surfaces). */
|
|
@@ -13,6 +13,16 @@ export type RouteDescriptor =
|
|
|
13
13
|
| {
|
|
14
14
|
type: "appSettings";
|
|
15
15
|
envParams?: EnvParams;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One of the calling app's own pages, by concrete path in the app's space (`/reports/7`, not
|
|
19
|
+
* `/reports/:id`). The host checks that it matches one of the app's routes offered in the
|
|
20
|
+
* current portal. There is no `appId`: an app can only open its own pages.
|
|
21
|
+
*/
|
|
22
|
+
| {
|
|
23
|
+
type: "appPage";
|
|
24
|
+
path: string;
|
|
25
|
+
envParams?: EnvParams;
|
|
16
26
|
};
|
|
17
27
|
export declare function isRouteDescriptor(value: unknown): value is RouteDescriptor;
|
|
18
28
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/apps/route.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/apps/route.ts"],"names":[],"mappings":"AAUA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE3D,6GAA6G;AAC7G,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,MAAM,MAAM,eAAe;AACzB,kFAAkF;AAChF;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE;AACrF,oEAAoE;GAClE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE;AAChD;;;;GAIG;GACD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE7D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAuB1E"}
|
package/dist/esm/apps/route.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Hand-written (not generated by Speakeasy). Part of the third-party app platform contract;
|
|
3
3
|
* see docs/third-party-apps/plan.md.
|
|
4
4
|
*
|
|
5
|
-
* Apps never navigate by path. They name a destination and the host maps it to its own
|
|
6
|
-
* which keeps host URLs free to change and stops an app from steering users to arbitrary
|
|
5
|
+
* Apps never navigate by host path. They name a destination and the host maps it to its own
|
|
6
|
+
* routes, which keeps host URLs free to change and stops an app from steering users to arbitrary
|
|
7
|
+
* pages. The one path an app writes, `appPage`, is a path inside its own pages space.
|
|
7
8
|
*/
|
|
8
|
-
import {
|
|
9
|
+
import { isConcreteRoutePath } from "./routes.js";
|
|
10
|
+
import { getSurface } from "./surfaces.js";
|
|
9
11
|
export function isRouteDescriptor(value) {
|
|
10
12
|
if (typeof value !== "object" || value === null || !("type" in value))
|
|
11
13
|
return false;
|
|
@@ -14,14 +16,18 @@ export function isRouteDescriptor(value) {
|
|
|
14
16
|
return false;
|
|
15
17
|
switch (v["type"]) {
|
|
16
18
|
case "surface":
|
|
17
|
-
// Only catalog surfaces: the host has no route for anything else. Safe integers
|
|
18
|
-
// record id is never silently rounded on its way through JSON.
|
|
19
|
-
//
|
|
20
|
-
// would name another
|
|
21
|
-
|
|
19
|
+
// Only catalog surfaces of a portal: the host has no route for anything else. Safe integers
|
|
20
|
+
// only, so a record id is never silently rounded on its way through JSON. The portal-less
|
|
21
|
+
// surfaces belong to an app and are reachable only through descriptors that always mean the
|
|
22
|
+
// calling app (`appSettings`, `appPage`): as a plain surface, `objectId` would name another
|
|
23
|
+
// app's settings page or pages.
|
|
24
|
+
return typeof v["surfaceId"] === "string" && (getSurface(v["surfaceId"])?.portal ?? null) !== null &&
|
|
22
25
|
(v["objectId"] === undefined || (Number.isSafeInteger(v["objectId"]) && v["objectId"] > 0));
|
|
23
26
|
case "appSettings":
|
|
24
27
|
return true;
|
|
28
|
+
case "appPage":
|
|
29
|
+
// Concrete paths only, in the route grammar: no params, dots, escapes or empty segments.
|
|
30
|
+
return isConcreteRoutePath(v["path"]);
|
|
25
31
|
default:
|
|
26
32
|
return false;
|
|
27
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../src/apps/route.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../src/apps/route.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAkB,MAAM,eAAe,CAAC;AAiB3D,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEpF,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,IAAI,CAAC,CAAC,WAAW,CAAC,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAE/E,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QAClB,KAAK,SAAS;YACZ,4FAA4F;YAC5F,0FAA0F;YAC1F,4FAA4F;YAC5F,4FAA4F;YAC5F,gCAAgC;YAChC,OAAO,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,IAAI,IAAI,CAAC,KAAK,IAAI;gBAChG,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,IAAK,CAAC,CAAC,UAAU,CAAY,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5G,KAAK,aAAa;YAChB,OAAO,IAAI,CAAC;QACd,KAAK,SAAS;YACZ,yFAAyF;YACzF,OAAO,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACxC;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A declared route path: `/`, or `/seg(/seg)*` where each segment is static or a `:param`. No dots,
|
|
3
|
+
* percent-escapes, upper case, empty segments or trailing slash, so no path can climb out of the
|
|
4
|
+
* app's own space. `pages` is not reserved inside that space: `/pages/foo` is an ordinary path.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ROUTE_PATH_PATTERN = "^/(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|:[a-z][a-z0-9_]*)(?:/(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|:[a-z][a-z0-9_]*))*)?$";
|
|
7
|
+
/** A concrete path an app navigates to (`{ type: "appPage" }`): the same grammar without params. */
|
|
8
|
+
export declare const CONCRETE_ROUTE_PATH_PATTERN = "^/(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*)?$";
|
|
9
|
+
export declare const ROUTE_PATH_MAX_CHARS = 200;
|
|
10
|
+
/** Segments in one path; `/` has none. */
|
|
11
|
+
export declare const ROUTE_PATH_MAX_SEGMENTS = 8;
|
|
12
|
+
/** Routes in one manifest. */
|
|
13
|
+
export declare const APP_ROUTES_MAX = 50;
|
|
14
|
+
/** A declared route path: the {@link ROUTE_PATH_PATTERN} grammar, ≤ 200 characters and ≤ 8 segments. */
|
|
15
|
+
export declare function isRoutePath(value: unknown): value is string;
|
|
16
|
+
/** A concrete route path (no `:param` segments) within the same limits as a declared one. */
|
|
17
|
+
export declare function isConcreteRoutePath(value: unknown): value is string;
|
|
18
|
+
/**
|
|
19
|
+
* Renames every param segment to `:_`. Two paths that normalize to the same string claim the same
|
|
20
|
+
* URLs (`/vendors/:id` and `/vendors/:vendor_id`), so a manifest may declare only one of them.
|
|
21
|
+
*/
|
|
22
|
+
export declare function normalizeRoutePath(path: string): string;
|
|
23
|
+
export interface RouteSetIssue {
|
|
24
|
+
/** Index of the offending entry in `routes`. */
|
|
25
|
+
index: number;
|
|
26
|
+
field: "path" | "portals" | "navigation";
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The rules over a set of routes that a pattern alone cannot express: the segment cap, a param
|
|
31
|
+
* name used twice in one path, two paths claiming the same URLs, and a repeated portal. Grammar,
|
|
32
|
+
* length and the per-field limits are the schema's job; a path that fails the grammar is skipped
|
|
33
|
+
* here. The zod schema and `apps-cli validate` both report these, and the server repeats them.
|
|
34
|
+
*/
|
|
35
|
+
export declare function routeSetIssues(routes: ReadonlyArray<{
|
|
36
|
+
path: string;
|
|
37
|
+
portals?: readonly string[] | undefined;
|
|
38
|
+
navigation?: unknown;
|
|
39
|
+
}>): RouteSetIssue[];
|
|
40
|
+
export interface AppRouteMatch<R> {
|
|
41
|
+
route: R;
|
|
42
|
+
/** Param values by name, percent-decoded. Always strings: the app parses ids itself. */
|
|
43
|
+
params: Record<string, string>;
|
|
44
|
+
/** Index of `route` in the list passed to {@link matchAppRoute}. */
|
|
45
|
+
index: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Finds the route a pathname in the app's own space renders (`/reports/7` for
|
|
49
|
+
* `/{portal}/apps/{appId}/pages/reports/7`), or `null` when none does.
|
|
50
|
+
*
|
|
51
|
+
* `pathname` is URL-encoded, as it appears in a URL: `/` or `/seg(/seg)*` with no empty segment,
|
|
52
|
+
* trailing slash, query or fragment (anything else matches nothing). A host that receives decoded
|
|
53
|
+
* segments encodes each with `encodeURIComponent` before joining them.
|
|
54
|
+
*
|
|
55
|
+
* A static route segment matches only the identical pathname segment. A param segment matches any
|
|
56
|
+
* other segment that decodes to a plain value (see `paramValue`); a segment containing `:` never
|
|
57
|
+
* matches a param. When several routes match, the one with a static segment at the first position
|
|
58
|
+
* where they differ wins (static before param, left to right); among equals, the first declared.
|
|
59
|
+
* Routes whose path is not in the grammar are ignored, so a stale or hand-edited feed entry can
|
|
60
|
+
* never match.
|
|
61
|
+
*/
|
|
62
|
+
export declare function matchAppRoute<R extends {
|
|
63
|
+
path: string;
|
|
64
|
+
}>(routes: readonly R[], pathname: string): AppRouteMatch<R> | null;
|
|
65
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.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