@ti-engine/web-framework 1.19.1 → 1.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,194 @@
1
+ export = TiWebAppManager;
2
+ import type { TiSession } from "#definitions";
3
+ /**
4
+ * Gates the login-page authentication markup to the effective enabled methods. The login fragment delimits blocks
5
+ * with HTML-comment markers: `<!--ti-auth-method:METHOD-->…<!--/ti-auth-method-->` around each method's control
6
+ * (the `local` credentials form and each OpenID provider button), `<!--ti-auth-divider-->…<!--/ti-auth-divider-->`
7
+ * around the "or continue with" separator, `<!--ti-auth-social-->…<!--/ti-auth-social-->` around the SSO button
8
+ * group, and `<!--ti-auth-none-->…<!--/ti-auth-none-->` around a "no method configured" fallback. It removes the
9
+ * block for any method that is not enabled, drops the social group when no SSO provider is enabled, shows the
10
+ * divider only when a local form AND at least one SSO provider are both present, and shows the fallback only when
11
+ * nothing is enabled. Any remaining markers are stripped so clean HTML ships. Fragments without these markers
12
+ * (every non-login fragment) are returned unchanged.
13
+ *
14
+ * @param {string} html
15
+ * @param {string[]} [enabledMethods] The effective enabled authentication methods.
16
+ * @returns {string}
17
+ */
18
+ declare function applyAuthMethodVisibility(html: string, enabledMethods?: string[]): string;
19
+ /**
20
+ * A generic web application manager that handles the rendering and behavior of web application views. It is designed to be extended by specific web application
21
+ * managers for each web application you want to implement with the ti-engine web framework.
22
+ * <br/>
23
+ * NOTE: You should not instantiate this class directly. Instead, extend it and override the abstract methods as needed. Additionally, you should configure your
24
+ * ti-engine web server 'TiWebApplicationConfig' settings by specifying the 'classPath' that corresponds to your web application manager. The path should be
25
+ * relative to the intended process's working directory.
26
+ *
27
+ * @class TiWebAppManager
28
+ * @abstract
29
+ * @public
30
+ */
31
+ declare class TiWebAppManager {
32
+ #private;
33
+ /**
34
+ * @constructor
35
+ * @param {string} identifier The identifier for this web application. Should be unique and recognizable.
36
+ * @throws {TiException.E_GEN_ABSTRACT_CLASS_INIT} If this class is instantiated directly.
37
+ */
38
+ constructor(identifier: string);
39
+ /**
40
+ * Returns the identifier for this web application.
41
+ *
42
+ * @property
43
+ * @returns {string}
44
+ * @public
45
+ */
46
+ get webAppIdentifier(): string;
47
+ /**
48
+ * Adds a new HTML fragment to the web application.
49
+ * <br/>
50
+ * NOTE: This method should only be called during the initialization phase of your web application manager.
51
+ *
52
+ * @method
53
+ * @param {string} identifier
54
+ * @param {Object} fragment The fragment descriptor (`{ title, path, components }`). May also carry an optional
55
+ * `roles` array (`Array<string|number>`): when present, the default {@link TiWebAppManager#verifyAccess} serves
56
+ * the fragment only to sessions holding at least one of those roles; omit it (or leave empty) for a public screen.
57
+ * @throws {TiException.E_GEN_UNALLOWED_OVERRIDE} If a fragment with the same identifier already exists.
58
+ * @public
59
+ */
60
+ addFragment(identifier: string, fragment: Object): void;
61
+ /**
62
+ * Registers an editable configuration document with the framework config registry (JSON Schema + semantic
63
+ * validators + default value + editor metadata). Call during initialization. See {@link ConfigRegistry#register}.
64
+ *
65
+ * @method
66
+ * @param {string} configKey
67
+ * @param {Object} definition
68
+ * @returns {TiWebAppManager} this (chainable)
69
+ * @public
70
+ */
71
+ registerConfigDocument(configKey: string, definition: Object): TiWebAppManager;
72
+ /**
73
+ * Registers a JSON Schema that is referenced (via `$ref`) by config-document schemas but is not itself a document.
74
+ *
75
+ * @method
76
+ * @param {Object} schema
77
+ * @returns {TiWebAppManager} this (chainable)
78
+ * @public
79
+ */
80
+ registerConfigSchema(schema: Object): TiWebAppManager;
81
+ /**
82
+ * Registers a composite (entity) editor with the framework config service — a `compose(docs)`/`decompose(edited,docs)`
83
+ * pair over one or more documents. Call during initialization. See {@link ConfigService#registerEditor}.
84
+ *
85
+ * @method
86
+ * @param {string} editorKey
87
+ * @param {Object} definition
88
+ * @returns {TiWebAppManager} this (chainable)
89
+ * @public
90
+ */
91
+ registerConfigEditor(editorKey: string, definition: Object): TiWebAppManager;
92
+ /**
93
+ * Used to clear the static file cache. This is useful for testing purposes to ensure that the web server is always serving fresh content.
94
+ *
95
+ * @method
96
+ * @public
97
+ */
98
+ clearStaticFileCache(): void;
99
+ /**
100
+ * Sets the effective enabled authentication methods used to gate login-page provider buttons. The web server
101
+ * calls this at startup, after the auth manager has dropped any enabled-but-unconfigured OpenID providers.
102
+ *
103
+ * @method
104
+ * @param {string[]} methods
105
+ * @public
106
+ */
107
+ setEnabledAuthMethods(methods: string[]): void;
108
+ /**
109
+ * Optional HTML transformation hook.
110
+ * <br/>
111
+ * NOTE: Override in subclasses to add nonces or other dynamic data to outgoing HTML.
112
+ *
113
+ * @method
114
+ * @param {string} html
115
+ * @param {Object} [options]
116
+ * @param {string} [options.csrfToken] Optional CSRF token to inject into the HTML.
117
+ * @param {boolean} [options.isHome] Optional flag to indicate whether the requested route is the home page.
118
+ * @param {string} [options.nonce] Optional CSP nonce to inject into inline scripts/styles.
119
+ * @param {string} [options.title] Optional title to replace the placeholder in the HTML.
120
+ * @returns {Promise<string>}
121
+ * @virtual
122
+ * @public
123
+ */
124
+ transformHtml(html: string, options?: {
125
+ csrfToken?: string;
126
+ isHome?: boolean;
127
+ nonce?: string;
128
+ title?: string;
129
+ }): Promise<string>;
130
+ /**
131
+ * Used to assemble the complete HTML view for the requested route, including nested HTML fragments.
132
+ *
133
+ * @method
134
+ * @param {TiSession} session
135
+ * @param {string[]} staticContentPaths
136
+ * @param {string} route
137
+ * @param {Object} [options]
138
+ * @param {string} [options.csrfToken] Optional CSRF token to inject into the HTML.
139
+ * @param {boolean} [options.isPartial] Optional flag to indicate whether the requested route is a partial load of a fragment.
140
+ * @param {string} [options.view] Optional view name to load within this route.
141
+ * @param {string} [options.nonce] Optional CSP nonce to inject into inline scripts/styles.
142
+ * @returns {Promise<string>}
143
+ * @public
144
+ */
145
+ assembleHtmlView(session: TiSession, staticContentPaths: string[], route: string, options?: {
146
+ csrfToken?: string;
147
+ isPartial?: boolean;
148
+ view?: string;
149
+ nonce?: string;
150
+ }): Promise<string>;
151
+ /**
152
+ * Used to process a request for a data resource.
153
+ *
154
+ * @method
155
+ * @param {TiSession} session
156
+ * @param {string} view
157
+ * @param {Object} [options]
158
+ * @returns {Promise<Object>}
159
+ * @virtual
160
+ * @public
161
+ */
162
+ processDataRequest(session: TiSession, view: string, options?: Object): Promise<Object>;
163
+ /**
164
+ * Used to process an application service request.
165
+ *
166
+ * @method
167
+ * @param {TiSession} session
168
+ * @param {string} service
169
+ * @param {Object} params
170
+ * @returns {Promise<Object>}
171
+ * @virtual
172
+ * @public
173
+ */
174
+ processServiceRequest(session: TiSession, service: string, params: Object): Promise<Object>;
175
+ /**
176
+ * Used to verify whether the current user has access to the requested resource. The default implementation gates
177
+ * HTML fragments by their declared `roles`: a fragment registered via {@link TiWebAppManager#addFragment} with a
178
+ * `roles` array is served only to sessions holding at least one of those roles (see {@link addFragment}); a
179
+ * fragment with no `roles` is public to any authenticated user. This makes role-restricted screens unreachable by
180
+ * direct URL, not merely hidden in the UI. Override in subclasses only to implement additional/alternative checks.
181
+ *
182
+ * @method
183
+ * @virtual
184
+ * @param {TiSession} session
185
+ * @param {Object} resource The fragment descriptor; its optional `resource.roles` lists the roles permitted to load it.
186
+ * @returns {Promise}
187
+ * @exception {TiException.E_SEC_UNAUTHORIZED_ACCESS} (403) When the session holds none of the fragment's required roles.
188
+ * @public
189
+ */
190
+ verifyAccess(session: TiSession, resource: Object): Promise<any>;
191
+ }
192
+ declare namespace TiWebAppManager {
193
+ export { applyAuthMethodVisibility };
194
+ }
@@ -0,0 +1,374 @@
1
+ /// <reference types="node" />
2
+ export = TiWebServer;
3
+ import ServiceConsumer = require("@ti-engine/core/service-consumer");
4
+ export type NodeServer = import("node:http").Server;
5
+ export type TiWebServiceConfiguration = ServiceConfiguration;
6
+ export type TiWebApplicationConfig = {
7
+ classPath: string;
8
+ };
9
+ export type ApiConfig = {
10
+ endpointEnabled: boolean;
11
+ inventory: ApiInventory;
12
+ requestTimeout: number;
13
+ };
14
+ export type SettingsAuth = {
15
+ enabledMethods: string[];
16
+ local: Object;
17
+ oauth2: {
18
+ azure?: SettingsOAuth2Client;
19
+ google?: SettingsOAuth2Client;
20
+ };
21
+ };
22
+ export type SettingsOAuth2Client = {
23
+ clientID?: string;
24
+ clientSecret?: string;
25
+ callbackUrl?: string;
26
+ discoveryUrl?: string;
27
+ isPublic?: boolean;
28
+ tokenEndpointAuthMethod?: TiTokenEndpointAuthMethod;
29
+ };
30
+ export type SettingsStaticCache = {
31
+ /**
32
+ * The `max-age` for `/static` responses, in SECONDS (not a duration string). `0` means every use is revalidated.
33
+ */
34
+ maxAge: number;
35
+ /**
36
+ * Whether to add `immutable`. Only correct when the `/static` filenames are content-addressed.
37
+ */
38
+ immutable: boolean;
39
+ /**
40
+ * Path prefixes under `/static` that are served long-lived and `immutable` regardless of the two settings above.
41
+ */
42
+ immutablePaths: string[];
43
+ };
44
+ export type SettingsCookies = {
45
+ secret: string;
46
+ path: string;
47
+ httpOnly: boolean;
48
+ sameSite: "lax" | "strict" | "none";
49
+ maxAge: number;
50
+ };
51
+ export type ApiInventory = Record<string, Record<string, ServiceAddress>>;
52
+ import type { TiAuthMethod, TiTokenEndpointAuthMethod } from "#auth-manager";
53
+ import type { TiSession } from "#definitions";
54
+ import type User from "#user";
55
+ import type TiWebAppManager from "#web-app-manager";
56
+ import type { ServiceAddress, ServiceConfiguration } from "@ti-engine/core/definitions";
57
+ /** @import { TiAuthMethod, TiTokenEndpointAuthMethod } from "#auth-manager" */
58
+ /** @import { TiSession } from "#definitions" */
59
+ /** @import User from "#user" */
60
+ /** @import TiWebAppManager from "#web-app-manager" */
61
+ /** @import { ServiceAddress, ServiceConfiguration } from "@ti-engine/core/definitions" */
62
+ /**
63
+ * Default unprotected static-asset route matchers. The path segments are matched with `(?:[^/]+\/)*` rather than
64
+ * `(?:.+\/)*`: the inner `[^/]+` cannot also consume the "/" delimiter, so the pattern is unambiguous and matches
65
+ * in linear time. The previous `.+` form was ambiguous and backtracked exponentially on hostile request paths such
66
+ * as `/static/a/a/…/a/x` (no trailing extension) — and these matchers run against the raw request path in
67
+ * {@link TiWebServer#isUnprotectedRoute} BEFORE authentication, so that was a pre-auth denial-of-service vector
68
+ * (CodeQL js/redos). The matched language for realistic asset paths is unchanged.
69
+ *
70
+ * @type {RegExp}
71
+ */
72
+ declare const RE_STATIC_UNPROTECTED: RegExp;
73
+ /**
74
+ * Default unprotected `/.well-known/` route matcher. See {@link RE_STATIC_UNPROTECTED} for the ReDoS rationale.
75
+ *
76
+ * @type {RegExp}
77
+ */
78
+ declare const RE_WELL_KNOWN_UNPROTECTED: RegExp;
79
+ /**
80
+ * A web server microservice based on the ti-engine.
81
+ * <br/>
82
+ * Note: The web server is fully functional and already comes with all the necessary fundamentals and security features. However, it is designed to be extended
83
+ * with custom logic and functionality to fit your specific needs. Here is a list of methods that you can override to customize the web server behavior:
84
+ * - {@link TiWebServer#defineWebApplicationRoutes} Override this to define custom web application routes. Remember to call the base method if you want to preserve the default behavior as well (recommended).
85
+ * - {@link TiWebServer#defineUnprotectedRoutes} Override this to define unprotected routes. Remember to call the base method if you want to preserve the default behavior as well (recommended).
86
+ * - {@link TiWebServer#verifySession} Override this to implement custom session verification logic.
87
+ *
88
+ * @class TiWebServer
89
+ * @extends ServiceConsumer
90
+ * @public
91
+ */
92
+ declare class TiWebServer extends ServiceConsumer {
93
+ #private;
94
+ /**
95
+ * @constructor
96
+ * @param {string} serviceDomainName The service domain name for this service instance.
97
+ * @param {TiWebServiceConfiguration} serviceConfig The JSON configuration for this service. Note that the configuration provided will be merged with the default web server configuration, and it will override any conflicting properties.
98
+ * @throws {TiException.E_GEN_JS_INTERNAL_ERROR} If the web application manager cannot be loaded.
99
+ */
100
+ constructor(serviceDomainName: string, serviceConfig: TiWebServiceConfiguration);
101
+ /**
102
+ * Property returning the service configuration JSON.
103
+ *
104
+ * @property
105
+ * @returns {TiWebServiceConfiguration}
106
+ * @override
107
+ * @public
108
+ */
109
+ get serviceConfig(): TiWebServiceConfiguration;
110
+ /**
111
+ * Property returning if the web server is currently shutting down.
112
+ *
113
+ * @property
114
+ * @returns {boolean}
115
+ * @public
116
+ */
117
+ get isShuttingDown(): boolean;
118
+ /**
119
+ * Property returning the list of static content directories.
120
+ *
121
+ * @property
122
+ * @returns {string[]}
123
+ * @public
124
+ */
125
+ get staticContentPaths(): string[];
126
+ /**
127
+ * Property returning the server URL.
128
+ *
129
+ * @property
130
+ * @returns {string}
131
+ * @public
132
+ */
133
+ get serverUrl(): string;
134
+ /**
135
+ * Property returning the {@link TiWebAppManager} instance.
136
+ *
137
+ * @property
138
+ * @returns {TiWebAppManager}
139
+ * @public
140
+ */
141
+ get webAppManager(): TiWebAppManager;
142
+ /**
143
+ * Starts the web server.
144
+ *
145
+ * @method
146
+ * @returns {Promise}
147
+ * @override
148
+ * @public
149
+ */
150
+ onStart(): Promise<any>;
151
+ /**
152
+ * Shuts down the web server.
153
+ *
154
+ * @method
155
+ * @returns {Promise}
156
+ * @override
157
+ * @public
158
+ */
159
+ onStop(): Promise<any>;
160
+ /**
161
+ * Used to report health status of the service instance for external monitoring.
162
+ * This is a scheduled job that will be executed at SERVICE_HEALTH_CHECK_INTERVAL time.
163
+ *
164
+ * @method
165
+ * @override
166
+ * @public
167
+ */
168
+ reportHealthy(): void;
169
+ /**
170
+ * Used to verify the session of a request.
171
+ *
172
+ * @method
173
+ * @param {TiSession} session
174
+ * @returns {boolean}
175
+ * @public
176
+ */
177
+ verifySession(session: TiSession): boolean;
178
+ /**
179
+ * Hook for the application to augment the freshly-authenticated session (e.g. derive domain roles from an
180
+ * identity store or the org chart). Runs synchronously, once per login, before the framework's additive `admin`
181
+ * role is applied. The default is a no-op. Any test-user role injection is an override of whatever the app derives.
182
+ *
183
+ * @method
184
+ * @virtual
185
+ * @param {TiSession} session
186
+ * @param {Object} [request] Optional Express request object that can be used to read body/cookies/query data.
187
+ * @returns {TiSession}
188
+ * @public
189
+ */
190
+ augmentSession(session: TiSession, request?: Object): TiSession;
191
+ /**
192
+ * Used to authenticate a user via the specified auth method.
193
+ *
194
+ * @method
195
+ * @param {TiAuthMethod} authMethod
196
+ * @param {Object} [authDetails={}]
197
+ * @returns {Promise}
198
+ * @public
199
+ */
200
+ authenticate(authMethod: TiAuthMethod, authDetails?: Object): Promise<any>;
201
+ /**
202
+ * Used to set up user authorization according to the specified auth method.
203
+ *
204
+ * @method
205
+ * @param {TiAuthMethod} authMethod
206
+ * @param {URL} currentUrl
207
+ * @param {Object} oidc
208
+ * @returns {Promise<User>}
209
+ * @public
210
+ */
211
+ authorize(authMethod: TiAuthMethod, currentUrl: URL, oidc: Object): Promise<User>;
212
+ /**
213
+ * Used to get a service mapping if such exists.
214
+ *
215
+ * @method
216
+ * @param {string} serviceVersion
217
+ * @param {string} serviceName
218
+ * @returns {ServiceAddress}
219
+ * @public
220
+ */
221
+ getServiceAddress(serviceVersion: string, serviceName: string): ServiceAddress;
222
+ /**
223
+ * Used to check if the specified hostname is allowed to access the web server.
224
+ *
225
+ * @method
226
+ * @param {string} hostname
227
+ * @returns {boolean}
228
+ * @public
229
+ */
230
+ isAllowedHost(hostname: string): boolean;
231
+ /**
232
+ * Used to check if the specified route is unprotected (i.e., does not require authentication). The default unprotected routes are:
233
+ * - /
234
+ * - /static/...
235
+ * - /.well-known/...
236
+ * - /not-found
237
+ * - /app
238
+ * - /app/enter
239
+ * - /app/config
240
+ * - /logout
241
+ * - /login/:method
242
+ * <br/>
243
+ * NOTE: You can define custom unprotected routes by overriding the {@link TiWebServer#defineUnprotectedRoutes} method.
244
+ *
245
+ * @method
246
+ * @param {string} route
247
+ * @returns {boolean}
248
+ * @public
249
+ */
250
+ isUnprotectedRoute(route: string): boolean;
251
+ /**
252
+ * Used to define the web application routes.
253
+ * <br/>
254
+ * NOTE: Override this to define custom web application routes. Remember to call the base method if you want to preserve the default behavior as well.
255
+ *
256
+ * @method
257
+ * @virtual
258
+ * @public
259
+ */
260
+ defineWebApplicationRoutes(): void;
261
+ /**
262
+ * Used to define the unprotected routes (i.e., routes that do not require authentication).
263
+ * <br/>
264
+ * NOTE: Override this to define custom unprotected routes. Remember to call the base method if you want to preserve the default behavior as well.
265
+ *
266
+ * @method
267
+ * @virtual
268
+ * @public
269
+ */
270
+ defineUnprotectedRoutes(): void;
271
+ /**
272
+ * Registers a custom application route on the underlying Express app.
273
+ * <br/>
274
+ * NOTE: Call this from a {@link TiWebServer#defineWebApplicationRoutes} override AFTER invoking the base method,
275
+ * so the framework's own routes keep priority and any catch-all route you add resolves last (it will still be
276
+ * registered before the framework's own `*splat` 404 handler). It is only valid once the Express app exists —
277
+ * i.e., from within {@link TiWebServer#defineWebApplicationRoutes}, which {@link TiWebServer#onStart} invokes.
278
+ *
279
+ * @method
280
+ * @param {string} method One of the supported routing verbs: get, post, put, patch, delete, options, head, all.
281
+ * @param {string|RegExp} path The route path or pattern.
282
+ * @param {...Function} handlers One or more Express route handlers/middleware.
283
+ * @returns {TiWebServer} This instance, to allow chaining.
284
+ * @public
285
+ */
286
+ registerRoute(method: string, path: string | RegExp, ...handlers: Function[]): TiWebServer;
287
+ /**
288
+ * Adds a pattern to the unprotected-routes list — routes that bypass the authentication gate. A string is
289
+ * matched exactly against the request path; a RegExp is tested against it. Consulted at request time by
290
+ * {@link TiWebServer#isUnprotectedRoute}.
291
+ * <br/>
292
+ * NOTE: Call this from a {@link TiWebServer#defineUnprotectedRoutes} override AFTER invoking the base method, to
293
+ * extend (rather than replace) the defaults.
294
+ *
295
+ * @method
296
+ * @param {string|RegExp} pattern The exact path (string) or path matcher (RegExp) to treat as unprotected.
297
+ * @returns {TiWebServer} This instance, to allow chaining.
298
+ * @public
299
+ */
300
+ addUnprotectedRoute(pattern: string | RegExp): TiWebServer;
301
+ /**
302
+ * Resolves a `staticCache` configuration block into the policy the `/static` mounts apply, filling in
303
+ * {@link TiWebServer.#STATIC_CACHE_DEFAULTS} per key and rejecting values that cannot be honored. Pure: problems
304
+ * are returned as `warnings` rather than logged, so the caller decides how to surface them and a test can assert
305
+ * on them. Static and exposed for unit testing — not part of the customization surface.
306
+ * <br/>
307
+ * `maxAge` is a whole number of SECONDS, mapping 1:1 onto the `Cache-Control` directive — express's `"1y"`-style
308
+ * duration strings are NOT accepted, and are reported rather than silently reinterpreted as milliseconds.
309
+ * <br/>
310
+ * `immutable` is dropped (with a warning) when `maxAge` is 0, because a response that is stale on arrival yet
311
+ * promises never to change is a contradiction. Dropping it fails safe: the misconfiguration costs a revalidation,
312
+ * not a year of unreachable assets.
313
+ *
314
+ * @method
315
+ * @static
316
+ * @param {SettingsStaticCache} [staticCache] The configured block, if any.
317
+ * @returns {{maxAge: number, immutable: boolean, immutablePaths: string[], warnings: string[]}}
318
+ * @public
319
+ */
320
+ static resolveStaticCachePolicy(staticCache?: SettingsStaticCache): {
321
+ maxAge: number;
322
+ immutable: boolean;
323
+ immutablePaths: string[];
324
+ warnings: string[];
325
+ };
326
+ /**
327
+ * Builds the `Cache-Control` value for one static file: the long-lived immutable policy when its served path sits
328
+ * under a configured `immutablePaths` prefix (matched case-sensitively, so a case mismatch falls back to the safe
329
+ * side), otherwise the policy's own `maxAge`/`immutable`. A `maxAge` of 0 is emitted as an explicit
330
+ * `must-revalidate` rather than a bare `max-age=0`, matching what the sibling `web-content` package serves.
331
+ * Pure and static; exposed for unit testing — not part of the customization surface.
332
+ *
333
+ * @method
334
+ * @static
335
+ * @param {string} rootPath The directory this `/static` mount serves.
336
+ * @param {string} filePath The absolute path of the file being served.
337
+ * @param {Object} policy A policy as returned by {@link TiWebServer.resolveStaticCachePolicy}.
338
+ * @returns {string}
339
+ * @public
340
+ */
341
+ static staticCacheControlFor(rootPath: string, filePath: string, policy: Object): string;
342
+ /**
343
+ * Normalizes an HTTP method to a lower-case Express routing verb, or returns null if it is not a supported,
344
+ * registrable verb. Anything that is not a string is rejected outright rather than coerced — otherwise a value
345
+ * whose `toString()` happens to yield a verb (`[ "get" ]`, `new String( "get" )`) would register a route and
346
+ * bypass the `E_GEN_INVALID_ARGUMENT_TYPE` that {@link TiWebServer#registerRoute} raises for a bad method.
347
+ * Pure and static; exposed for unit testing — not part of the customization surface.
348
+ *
349
+ * @method
350
+ * @static
351
+ * @param {string} method
352
+ * @returns {string|null}
353
+ * @public
354
+ */
355
+ static normalizeRegistrableMethod(method: string): string | null;
356
+ /**
357
+ * Tests a request path against a list of unprotected-route patterns (string exact-match or RegExp test),
358
+ * returning true on the first match. A RegExp's `lastIndex` is reset defensively so a stateful 'g'/'y' flag
359
+ * cannot cause a match to be skipped. Pure and static; shared by {@link TiWebServer#isUnprotectedRoute} and
360
+ * exposed for unit testing — not part of the customization surface.
361
+ *
362
+ * @method
363
+ * @static
364
+ * @param {Array<string|RegExp>} patterns
365
+ * @param {string} pathOnly The request path with any query string already stripped.
366
+ * @returns {boolean}
367
+ * @public
368
+ */
369
+ static isRouteInList(patterns: Array<string | RegExp>, pathOnly: string): boolean;
370
+ }
371
+ declare namespace TiWebServer {
372
+ export { RE_STATIC_UNPROTECTED };
373
+ export { RE_WELL_KNOWN_UNPROTECTED };
374
+ }
@@ -0,0 +1,11 @@
1
+ export declare var listEditors: (service: ConfigService) => ExpressHandler;
2
+ export declare var composeView: (service: any) => (request: any, response: any, next: any) => void;
3
+ export declare var saveEditorEdit: (service: any) => (request: any, response: any, next: any) => void;
4
+ export declare var getCurrent: (service: any) => (request: any, response: any, next: any) => void;
5
+ export declare var getHistory: (service: any) => (request: any, response: any, next: any) => void;
6
+ export declare var listChanges: (service: any) => (request: any, response: any, next: any) => void;
7
+ export declare var getChange: (service: any) => (request: any, response: any, next: any) => void;
8
+ export declare var restoreChangeSet: (service: any) => (request: any, response: any, next: any) => void;
9
+ export declare var exportBundle: (service: any) => (request: any, response: any, next: any) => void;
10
+ import type ConfigService from "#config-service";
11
+ import type { ExpressHandler } from "#web-handlers";