@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;;AAqDH,wCA4BC;AA/ED,iCAAkE;AA4BlE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,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,QAAQ,CAAC,CAAC;QACnE,CAAC;QAED,SAAS,CAAC,Q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C/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,IAAA,4BAAoB,EAAC,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":"AAWA,OAAO,KAAK,CAAC,MAAM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;YAiB9F,2FAA2F;;;;;;;;;;;;;QA4CrF;;;WAGG;;;;;;;;;;;kBAoFP,CAAC;AAEL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAkCtD,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,CAAC;AAElF;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,qBAAqB,GAAG,eAAe,CAAC,GACrE,iBAAiB,GAAG,IAAI,CAM1B;AACD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS5D;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAA;CAAE,GACrC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAEpE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAQnE"}
|
|
@@ -43,14 +43,16 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
43
43
|
};
|
|
44
44
|
})();
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.appManifestSchema = exports.appCspSchema = exports.appConstantsSchema = exports.appViewSchema = exports.cspSourceSchema = exports.httpsUrlSchema = exports.APP_WEBHOOK_EVENTS = exports.PLATFORM_PERMISSIONS = exports.PERMISSION_PATTERN = exports.SAFE_INTEGER_STRING_PATTERN = exports.COMPONENT_NAME_PATTERN = exports.SEMVER_PATTERN = exports.SRI_PATTERN = exports.isParsableHttpsUrl = exports.isHttpsUrl = exports.HTTPS_URL_PATTERN = exports.cspSourcesTotalChars = exports.CSP_SOURCES_MAX_TOTAL_CHARS = exports.CSP_SOURCES_MAX_PER_DIRECTIVE = exports.CSP_SOURCE_PATTERN = exports.CSP_SOURCE_MAX_CHARS = exports.CSP_PATH_CHAR = exports.PORT_PATTERN = exports.IPV4_OCTET_PATTERN = void 0;
|
|
46
|
+
exports.appManifestSchema = exports.appCspSchema = exports.appConstantsSchema = exports.appRouteSchema = exports.NON_BLANK_PATTERN = exports.appViewSchema = exports.cspSourceSchema = exports.httpsUrlSchema = exports.APP_WEBHOOK_EVENTS = exports.PLATFORM_PERMISSIONS = exports.PERMISSION_PATTERN = exports.SAFE_INTEGER_STRING_PATTERN = exports.COMPONENT_NAME_PATTERN = exports.SEMVER_PATTERN = exports.SRI_PATTERN = exports.routeSetIssues = exports.ROUTE_PATH_PATTERN = exports.ROUTE_PATH_MAX_SEGMENTS = exports.ROUTE_PATH_MAX_CHARS = exports.normalizeRoutePath = exports.matchAppRoute = exports.isRoutePath = exports.isConcreteRoutePath = exports.CONCRETE_ROUTE_PATH_PATTERN = exports.APP_ROUTES_MAX = exports.isParsableHttpsUrl = exports.isHttpsUrl = exports.HTTPS_URL_PATTERN = exports.cspSourcesTotalChars = exports.CSP_SOURCES_MAX_TOTAL_CHARS = exports.CSP_SOURCES_MAX_PER_DIRECTIVE = exports.CSP_SOURCE_PATTERN = exports.CSP_SOURCE_MAX_CHARS = exports.CSP_PATH_CHAR = exports.PORT_PATTERN = exports.IPV4_OCTET_PATTERN = void 0;
|
|
47
47
|
exports.isPlatformPermission = isPlatformPermission;
|
|
48
48
|
exports.addCspBudgetIssue = addCspBudgetIssue;
|
|
49
49
|
exports.addDuplicateViewportIssues = addDuplicateViewportIssues;
|
|
50
|
+
exports.addRouteIssues = addRouteIssues;
|
|
50
51
|
exports.effectivePostInstallAction = effectivePostInstallAction;
|
|
51
52
|
exports.manifestJsonSchema = manifestJsonSchema;
|
|
52
53
|
exports.validateManifest = validateManifest;
|
|
53
54
|
const z = __importStar(require("zod/v4"));
|
|
55
|
+
const routes_js_1 = require("./routes.js");
|
|
54
56
|
const surfaces_js_1 = require("./surfaces.js");
|
|
55
57
|
const url_js_1 = require("./url.js");
|
|
56
58
|
// The URL and CSP-source rules live in the zod-free `url.ts` so the host renderer can use them
|
|
@@ -67,6 +69,18 @@ Object.defineProperty(exports, "cspSourcesTotalChars", { enumerable: true, get:
|
|
|
67
69
|
Object.defineProperty(exports, "HTTPS_URL_PATTERN", { enumerable: true, get: function () { return url_js_2.HTTPS_URL_PATTERN; } });
|
|
68
70
|
Object.defineProperty(exports, "isHttpsUrl", { enumerable: true, get: function () { return url_js_2.isHttpsUrl; } });
|
|
69
71
|
Object.defineProperty(exports, "isParsableHttpsUrl", { enumerable: true, get: function () { return url_js_2.isParsableHttpsUrl; } });
|
|
72
|
+
// The route grammar and matcher live in the zod-free `routes.ts` for the same reason.
|
|
73
|
+
var routes_js_2 = require("./routes.js");
|
|
74
|
+
Object.defineProperty(exports, "APP_ROUTES_MAX", { enumerable: true, get: function () { return routes_js_2.APP_ROUTES_MAX; } });
|
|
75
|
+
Object.defineProperty(exports, "CONCRETE_ROUTE_PATH_PATTERN", { enumerable: true, get: function () { return routes_js_2.CONCRETE_ROUTE_PATH_PATTERN; } });
|
|
76
|
+
Object.defineProperty(exports, "isConcreteRoutePath", { enumerable: true, get: function () { return routes_js_2.isConcreteRoutePath; } });
|
|
77
|
+
Object.defineProperty(exports, "isRoutePath", { enumerable: true, get: function () { return routes_js_2.isRoutePath; } });
|
|
78
|
+
Object.defineProperty(exports, "matchAppRoute", { enumerable: true, get: function () { return routes_js_2.matchAppRoute; } });
|
|
79
|
+
Object.defineProperty(exports, "normalizeRoutePath", { enumerable: true, get: function () { return routes_js_2.normalizeRoutePath; } });
|
|
80
|
+
Object.defineProperty(exports, "ROUTE_PATH_MAX_CHARS", { enumerable: true, get: function () { return routes_js_2.ROUTE_PATH_MAX_CHARS; } });
|
|
81
|
+
Object.defineProperty(exports, "ROUTE_PATH_MAX_SEGMENTS", { enumerable: true, get: function () { return routes_js_2.ROUTE_PATH_MAX_SEGMENTS; } });
|
|
82
|
+
Object.defineProperty(exports, "ROUTE_PATH_PATTERN", { enumerable: true, get: function () { return routes_js_2.ROUTE_PATH_PATTERN; } });
|
|
83
|
+
Object.defineProperty(exports, "routeSetIssues", { enumerable: true, get: function () { return routes_js_2.routeSetIssues; } });
|
|
70
84
|
/** A single SRI hash with the digest length its algorithm produces (32, 48 or 64 bytes, base64). */
|
|
71
85
|
exports.SRI_PATTERN = "^(sha256-[A-Za-z0-9+/]{43}=|sha384-[A-Za-z0-9+/]{64}|sha512-[A-Za-z0-9+/]{86}==)$";
|
|
72
86
|
/** SemVer 2.0.0 (semver.org's reference pattern): no empty or leading-zero numeric identifiers. */
|
|
@@ -100,7 +114,10 @@ const PLATFORM_PERMISSION_NAMES = new Set(exports.PLATFORM_PERMISSIONS.map((p) =
|
|
|
100
114
|
function isPlatformPermission(value) {
|
|
101
115
|
return typeof value === "string" && PLATFORM_PERMISSION_NAMES.has(value);
|
|
102
116
|
}
|
|
103
|
-
|
|
117
|
+
// A view's viewport. `page` is not one: an app declares its pages in `routes`, not in `views`.
|
|
118
|
+
const SURFACE_IDS = surfaces_js_1.SURFACES.filter((s) => s.kind !== "page").map((s) => s.id);
|
|
119
|
+
/** Portals an app page may be offered in (`routes[].portals`). */
|
|
120
|
+
const ROUTE_PORTALS = ["company", "vendor", "facility", "system"];
|
|
104
121
|
/** Lifecycle events an app's own webhook endpoint can receive (see C19). */
|
|
105
122
|
exports.APP_WEBHOOK_EVENTS = [
|
|
106
123
|
"MarketplaceAppActivation.created",
|
|
@@ -153,6 +170,42 @@ exports.appViewSchema = z.strictObject({
|
|
|
153
170
|
viewport: z.enum(SURFACE_IDS),
|
|
154
171
|
component: z.string().max(100).regex(new RegExp(exports.COMPONENT_NAME_PATTERN)),
|
|
155
172
|
});
|
|
173
|
+
/** Reports {@link routeSetIssues} (segment cap, repeated params, duplicate paths, repeated portals). */
|
|
174
|
+
function addRouteIssues(routes, ctx, path) {
|
|
175
|
+
for (const issue of (0, routes_js_1.routeSetIssues)(routes ?? [])) {
|
|
176
|
+
ctx.addIssue({ code: "custom", path: [...path, issue.index, issue.field], message: issue.message });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* One app page. The host renders `component` at `/{portal}/apps/{appId}/pages{path}`.
|
|
181
|
+
*
|
|
182
|
+
* `title` is required here, for new manifests. The server keeps accepting title-less entries in a
|
|
183
|
+
* bundle-less v1 manifest, which stored `routes[{ path, component }]` before pages were rendered;
|
|
184
|
+
* such a manifest has nothing to render them with, and the host never shows them.
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* Text a person reads (a page title, a sidebar label): at least one character that isn't
|
|
188
|
+
* whitespace. The host never shows a blank one, so the manifest can't publish one.
|
|
189
|
+
*
|
|
190
|
+
* This is JavaScript's `\S` spelled out (ASCII whitespace, the Unicode space separators,
|
|
191
|
+
* U+2028/U+2029 and U+FEFF), because the generated schema's patterns also run as Ruby regexps, and
|
|
192
|
+
* Ruby's `\S` is ASCII-only: there, a title of no-break spaces would pass.
|
|
193
|
+
*/
|
|
194
|
+
exports.NON_BLANK_PATTERN = "[^\\t\\n\\v\\f\\r \\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]";
|
|
195
|
+
exports.appRouteSchema = z.strictObject({
|
|
196
|
+
path: z.string().max(routes_js_1.ROUTE_PATH_MAX_CHARS).regex(new RegExp(routes_js_1.ROUTE_PATH_PATTERN)),
|
|
197
|
+
component: z.string().max(100).regex(new RegExp(exports.COMPONENT_NAME_PATTERN)),
|
|
198
|
+
/** Page header title. */
|
|
199
|
+
title: z.string().min(1).max(100).regex(new RegExp(exports.NON_BLANK_PATTERN), { message: "must not be blank" }),
|
|
200
|
+
/** Portals the page is offered in. Absent = every portal the host renders. */
|
|
201
|
+
portals: z.array(z.enum(ROUTE_PORTALS)).min(1).max(ROUTE_PORTALS.length).optional(),
|
|
202
|
+
/** Offer the page in the sidebar / mobile drawer menu under this label (default: `title`). */
|
|
203
|
+
navigation: z
|
|
204
|
+
.strictObject({
|
|
205
|
+
label: z.string().min(1).max(40).regex(new RegExp(exports.NON_BLANK_PATTERN), { message: "must not be blank" }).optional(),
|
|
206
|
+
})
|
|
207
|
+
.optional(),
|
|
208
|
+
});
|
|
156
209
|
/** Constants are delivered to every view as `environment.constants`. */
|
|
157
210
|
exports.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()]));
|
|
158
211
|
exports.appCspSchema = z.strictObject({
|
|
@@ -192,21 +245,20 @@ exports.appManifestSchema = z
|
|
|
192
245
|
integrity: z.string().max(200).regex(new RegExp(exports.SRI_PATTERN)),
|
|
193
246
|
}).optional(),
|
|
194
247
|
views: z.array(exports.appViewSchema).max(200).optional(),
|
|
195
|
-
/**
|
|
196
|
-
routes: z
|
|
197
|
-
.array(z.strictObject({
|
|
198
|
-
path: z.string().max(200).regex(/^\/[a-z0-9\-/:]*$/),
|
|
199
|
-
component: z.string().max(100).regex(new RegExp(exports.COMPONENT_NAME_PATTERN)),
|
|
200
|
-
}))
|
|
201
|
-
.max(50)
|
|
202
|
-
.optional(),
|
|
248
|
+
/** App pages, each a full screen under `/{portal}/apps/{appId}/pages`. */
|
|
249
|
+
routes: z.array(exports.appRouteSchema).max(routes_js_1.APP_ROUTES_MAX).optional(),
|
|
203
250
|
csp: exports.appCspSchema.optional(),
|
|
204
251
|
})
|
|
205
252
|
.optional(),
|
|
206
253
|
post_install_action: z
|
|
207
254
|
.strictObject({
|
|
208
|
-
type: z.enum(["url", "app_settings_view", "app_main_view"]),
|
|
255
|
+
type: z.enum(["url", "app_settings_view", "app_main_view", "app_page"]),
|
|
209
256
|
url: exports.httpsUrlSchema.optional(),
|
|
257
|
+
/**
|
|
258
|
+
* For `app_page` only: the page to open, a concrete path (no `:params`) that one of
|
|
259
|
+
* `ui_extensions.routes` matches, such as `/welcome` or `/reports/7`.
|
|
260
|
+
*/
|
|
261
|
+
path: z.string().max(routes_js_1.ROUTE_PATH_MAX_CHARS).regex(new RegExp(routes_js_1.CONCRETE_ROUTE_PATH_PATTERN)).optional(),
|
|
210
262
|
})
|
|
211
263
|
.optional(),
|
|
212
264
|
// The app's own webhook endpoint: registered by the catalog when the manifest is published, not
|
|
@@ -220,31 +272,50 @@ exports.appManifestSchema = z
|
|
|
220
272
|
.optional(),
|
|
221
273
|
})
|
|
222
274
|
.superRefine((manifest, ctx) => {
|
|
223
|
-
addDuplicateViewportIssues(manifest.ui_extensions?.views, ctx, ["ui_extensions", "views"]);
|
|
224
|
-
addCspBudgetIssue(manifest.ui_extensions?.csp, ctx, ["ui_extensions", "csp"]);
|
|
225
275
|
const events = manifest.webhooks?.events ?? [];
|
|
226
276
|
if (new Set(events).size !== events.length) {
|
|
227
277
|
ctx.addIssue({ code: "custom", path: ["webhooks", "events"], message: "events must not repeat" });
|
|
228
278
|
}
|
|
229
|
-
if (manifest.
|
|
279
|
+
if (manifest.post_install_action?.type === "url" && !manifest.post_install_action.url) {
|
|
280
|
+
ctx.addIssue({ code: "custom", path: ["post_install_action", "url"], message: "url is required for type=url" });
|
|
281
|
+
}
|
|
282
|
+
if (manifest.post_install_action?.type !== "app_page" && manifest.post_install_action?.path !== undefined) {
|
|
283
|
+
ctx.addIssue({ code: "custom", path: ["post_install_action", "path"], message: "path is only allowed for type=app_page" });
|
|
284
|
+
}
|
|
285
|
+
// When a field under `ui_extensions` fails its own schema, zod hands this refinement the
|
|
286
|
+
// manifest without `ui_extensions`, so every rule below would report a problem that isn't
|
|
287
|
+
// there (a missing settings view, an unmatched post-install page). Report the real one only.
|
|
288
|
+
if (ctx.issues.some((issue) => issue.path?.[0] === "ui_extensions"))
|
|
289
|
+
return;
|
|
290
|
+
addDuplicateViewportIssues(manifest.ui_extensions?.views, ctx, ["ui_extensions", "views"]);
|
|
291
|
+
addRouteIssues(manifest.ui_extensions?.routes, ctx, ["ui_extensions", "routes"]);
|
|
292
|
+
addCspBudgetIssue(manifest.ui_extensions?.csp, ctx, ["ui_extensions", "csp"]);
|
|
293
|
+
const hasViews = Boolean(manifest.ui_extensions?.views?.length);
|
|
294
|
+
const hasRoutes = Boolean(manifest.ui_extensions?.routes?.length);
|
|
295
|
+
if (hasViews && !manifest.ui_extensions?.bundle) {
|
|
230
296
|
ctx.addIssue({
|
|
231
297
|
code: "custom",
|
|
232
298
|
path: ["ui_extensions", "bundle"],
|
|
233
299
|
message: "bundle is required when views are declared",
|
|
234
300
|
});
|
|
235
301
|
}
|
|
302
|
+
if (hasRoutes && !manifest.ui_extensions?.bundle) {
|
|
303
|
+
ctx.addIssue({
|
|
304
|
+
code: "custom",
|
|
305
|
+
path: ["ui_extensions", "bundle"],
|
|
306
|
+
message: "bundle is required when routes are declared",
|
|
307
|
+
});
|
|
308
|
+
}
|
|
236
309
|
// `version` stays optional only for legacy (v1) manifests. Anything the host renders needs one:
|
|
237
310
|
// it names the runtime URL and reaches views as `ExtensionContext.app.version`.
|
|
238
|
-
if ((manifest.ui_extensions?.bundle ||
|
|
311
|
+
if ((manifest.ui_extensions?.bundle || hasViews || hasRoutes) && !manifest.version) {
|
|
239
312
|
ctx.addIssue({
|
|
240
313
|
code: "custom",
|
|
241
314
|
path: ["version"],
|
|
242
|
-
message: "version is required when ui_extensions declares a bundle or
|
|
315
|
+
message: "version is required when ui_extensions declares a bundle, views or routes",
|
|
243
316
|
});
|
|
244
317
|
}
|
|
245
|
-
|
|
246
|
-
ctx.addIssue({ code: "custom", path: ["post_install_action", "url"], message: "url is required for type=url" });
|
|
247
|
-
}
|
|
318
|
+
addAppPageActionIssues(manifest, ctx);
|
|
248
319
|
// A back-end-only app has no views, so it cannot land installers on one. Checked only for
|
|
249
320
|
// versioned (v2) manifests: v1 apps may carry a post-install view type from before views existed.
|
|
250
321
|
const viewports = new Set((manifest.ui_extensions?.views ?? []).map((v) => v.viewport));
|
|
@@ -257,28 +328,58 @@ exports.appManifestSchema = z
|
|
|
257
328
|
});
|
|
258
329
|
}
|
|
259
330
|
// The settings page is not a main view: a settings-only app should land on app_settings_view.
|
|
260
|
-
|
|
261
|
-
if (versioned && manifest.post_install_action?.type === "app_main_view" &&
|
|
331
|
+
// A root page (route `/`) is one: installing opens `/{portal}/apps/{id}/pages`.
|
|
332
|
+
if (versioned && manifest.post_install_action?.type === "app_main_view" && !hasMainView(manifest)) {
|
|
262
333
|
ctx.addIssue({
|
|
263
334
|
code: "custom",
|
|
264
335
|
path: ["post_install_action", "type"],
|
|
265
|
-
message: "app_main_view requires a view other than settings",
|
|
336
|
+
message: "app_main_view requires a view other than settings, or a root route",
|
|
266
337
|
});
|
|
267
338
|
}
|
|
268
339
|
});
|
|
340
|
+
/**
|
|
341
|
+
* The rules for `post_install_action.path`: required for `app_page` and allowed nowhere else, a
|
|
342
|
+
* concrete path within the route limits, and one that a declared route matches (`/reports/7` for a
|
|
343
|
+
* `/reports/:id` route), so installing never opens a page the app does not have.
|
|
344
|
+
*/
|
|
345
|
+
function addAppPageActionIssues(manifest, ctx) {
|
|
346
|
+
const action = manifest.post_install_action;
|
|
347
|
+
if (action === undefined)
|
|
348
|
+
return;
|
|
349
|
+
const path = ["post_install_action", "path"];
|
|
350
|
+
// `path` on another type is reported by the manifest refinement, before the rules that need
|
|
351
|
+
// `ui_extensions`.
|
|
352
|
+
if (action.type !== "app_page")
|
|
353
|
+
return;
|
|
354
|
+
if (action.path === undefined) {
|
|
355
|
+
ctx.addIssue({ code: "custom", path, message: "path is required for type=app_page" });
|
|
356
|
+
}
|
|
357
|
+
else if (!(0, routes_js_1.isConcreteRoutePath)(action.path)) {
|
|
358
|
+
ctx.addIssue({ code: "custom", path, message: "path must be a page path without :params, such as /reports/7" });
|
|
359
|
+
}
|
|
360
|
+
else if ((0, routes_js_1.matchAppRoute)(manifest.ui_extensions?.routes ?? [], action.path) === null) {
|
|
361
|
+
ctx.addIssue({ code: "custom", path, message: "path must match one of ui_extensions.routes" });
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
/** Whether a manifest has a main view to land on: a view other than settings, or a root page `/`. */
|
|
365
|
+
function hasMainView(manifest) {
|
|
366
|
+
const views = manifest.ui_extensions?.views ?? [];
|
|
367
|
+
const routes = manifest.ui_extensions?.routes ?? [];
|
|
368
|
+
return views.some((v) => v.viewport !== "settings") || routes.some((r) => r.path === "/");
|
|
369
|
+
}
|
|
269
370
|
/**
|
|
270
371
|
* What installing the app does when `post_install_action` is left out, so the server and the host
|
|
271
372
|
* never land an installer on a view the app does not have: nothing for a back-end-only app, the
|
|
272
|
-
* settings page for a settings-only app, and the app's main view otherwise.
|
|
273
|
-
* "no post-install step". An explicit action
|
|
373
|
+
* settings page for a settings-only app, and the app's main view otherwise. A root page (route
|
|
374
|
+
* `/`) counts as a main view. `null` means "no post-install step". An explicit action, including
|
|
375
|
+
* `app_page`, is returned unchanged.
|
|
274
376
|
*/
|
|
275
377
|
function effectivePostInstallAction(manifest) {
|
|
276
378
|
if (manifest.post_install_action)
|
|
277
379
|
return manifest.post_install_action;
|
|
278
|
-
|
|
279
|
-
if (viewports.some((v) => v !== "settings"))
|
|
380
|
+
if (hasMainView(manifest))
|
|
280
381
|
return { type: "app_main_view" };
|
|
281
|
-
if (
|
|
382
|
+
if ((manifest.ui_extensions?.views ?? []).some((v) => v.viewport === "settings"))
|
|
282
383
|
return { type: "app_settings_view" };
|
|
283
384
|
return null;
|
|
284
385
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manif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;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,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AAK,CAAA;CAAE,CAAC,CAAC;AAEtE,MAAM,MAAM,eAAe,GACvB,aAAa,GACb;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1B,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE;AACnC,+EAA+E;GAC7E;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACrC,+FAA+F;GAC7F;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;AAC9E,yDAAyD;GACvD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC;QAAE,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"}
|
|
@@ -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"}
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Hand-written (not generated by Speakeasy). Part of the third-party app platform contract;
|
|
4
4
|
* see docs/third-party-apps/plan.md.
|
|
5
5
|
*
|
|
6
|
-
* Apps never navigate by path. They name a destination and the host maps it to its own
|
|
7
|
-
* which keeps host URLs free to change and stops an app from steering users to arbitrary
|
|
6
|
+
* Apps never navigate by host path. They name a destination and the host maps it to its own
|
|
7
|
+
* routes, which keeps host URLs free to change and stops an app from steering users to arbitrary
|
|
8
|
+
* pages. The one path an app writes, `appPage`, is a path inside its own pages space.
|
|
8
9
|
*/
|
|
9
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
11
|
exports.isRouteDescriptor = isRouteDescriptor;
|
|
12
|
+
const routes_js_1 = require("./routes.js");
|
|
11
13
|
const surfaces_js_1 = require("./surfaces.js");
|
|
12
14
|
function isRouteDescriptor(value) {
|
|
13
15
|
if (typeof value !== "object" || value === null || !("type" in value))
|
|
@@ -17,14 +19,18 @@ function isRouteDescriptor(value) {
|
|
|
17
19
|
return false;
|
|
18
20
|
switch (v["type"]) {
|
|
19
21
|
case "surface":
|
|
20
|
-
// Only catalog surfaces: the host has no route for anything else. Safe integers
|
|
21
|
-
// record id is never silently rounded on its way through JSON.
|
|
22
|
-
//
|
|
23
|
-
// would name another
|
|
24
|
-
|
|
22
|
+
// Only catalog surfaces of a portal: the host has no route for anything else. Safe integers
|
|
23
|
+
// only, so a record id is never silently rounded on its way through JSON. The portal-less
|
|
24
|
+
// surfaces belong to an app and are reachable only through descriptors that always mean the
|
|
25
|
+
// calling app (`appSettings`, `appPage`): as a plain surface, `objectId` would name another
|
|
26
|
+
// app's settings page or pages.
|
|
27
|
+
return typeof v["surfaceId"] === "string" && ((0, surfaces_js_1.getSurface)(v["surfaceId"])?.portal ?? null) !== null &&
|
|
25
28
|
(v["objectId"] === undefined || (Number.isSafeInteger(v["objectId"]) && v["objectId"] > 0));
|
|
26
29
|
case "appSettings":
|
|
27
30
|
return true;
|
|
31
|
+
case "appPage":
|
|
32
|
+
// Concrete paths only, in the route grammar: no params, dots, escapes or empty segments.
|
|
33
|
+
return (0, routes_js_1.isConcreteRoutePath)(v["path"]);
|
|
28
34
|
default:
|
|
29
35
|
return false;
|
|
30
36
|
}
|
|
@@ -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;;AAoBH,8CAuBC;AAzCD,2CAAkD;AAClD,+CAA2D;AAiB3D,SAAgB,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,IAAA,wBAAU,EAAC,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,IAAA,+BAAmB,EAAC,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.d.ts","sourceRoot":"","sources":["../../../src/apps/routes.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,2HAC2F,CAAC;AAE3H,oGAAoG;AACpG,eAAO,MAAM,2BAA2B,iFAAqD,CAAC;AAE9F,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,0CAA0C;AAC1C,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,8BAA8B;AAC9B,eAAO,MAAM,cAAc,KAAK,CAAC;AAkBjC,wGAAwG;AACxG,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE3D;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,KAAK,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