@cookbook/urlkit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +707 -0
- package/dist/compile-path-wQfWAzOh.js +1318 -0
- package/dist/compile-path-wQfWAzOh.js.map +1 -0
- package/dist/compile-static-search-Cq3uaLe8.js +238 -0
- package/dist/compile-static-search-Cq3uaLe8.js.map +1 -0
- package/dist/contracts.d.ts +107 -0
- package/dist/create-url-contract-BYKPM9bn.js +1751 -0
- package/dist/create-url-contract-BYKPM9bn.js.map +1 -0
- package/dist/date/contracts.d.ts +5 -0
- package/dist/date/parse-custom-date.d.ts +7 -0
- package/dist/date/parse-date-time.d.ts +6 -0
- package/dist/date/parse-date.d.ts +6 -0
- package/dist/date/parse-unix-ms.d.ts +6 -0
- package/dist/date/parse-unix-seconds.d.ts +6 -0
- package/dist/date/serialize-custom-date.d.ts +7 -0
- package/dist/date/serialize-date-time.d.ts +6 -0
- package/dist/date/serialize-date.d.ts +6 -0
- package/dist/date/serialize-unix-ms.d.ts +6 -0
- package/dist/date/serialize-unix-seconds.d.ts +6 -0
- package/dist/errors/contracts.d.ts +5 -0
- package/dist/errors/url-kit-error.d.ts +8 -0
- package/dist/hash/build-hash.d.ts +4 -0
- package/dist/hash/compile-hash-descriptor.d.ts +2 -0
- package/dist/hash/compile-normalized-hash-descriptor.d.ts +2 -0
- package/dist/hash/compile-runtime-hash-descriptor.d.ts +3 -0
- package/dist/hash/compile-static-hash-descriptor.d.ts +3 -0
- package/dist/hash/contracts.d.ts +21 -0
- package/dist/hash/copy-normalized-hash-descriptor.d.ts +2 -0
- package/dist/hash/create-hash.d.ts +5 -0
- package/dist/hash/hash-fragment.d.ts +2 -0
- package/dist/hash/is-normalized-hash-descriptor.d.ts +2 -0
- package/dist/hash/normalize-hash.d.ts +3 -0
- package/dist/hash/parse-hash.d.ts +3 -0
- package/dist/hash/validate-normalized-hash-value.d.ts +5 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/router-runtime.d.ts +12 -0
- package/dist/router-runtime.js +214 -0
- package/dist/router-runtime.js.map +1 -0
- package/dist/runtime/build-route-search.d.ts +22 -0
- package/dist/runtime/compile-cached-static-search.d.ts +3 -0
- package/dist/runtime/contracts.d.ts +7 -0
- package/dist/runtime/create-route-url-contract.d.ts +15 -0
- package/dist/runtime/parse-route-search.d.ts +12 -0
- package/dist/schema/array.d.ts +9 -0
- package/dist/schema/boolean.d.ts +4 -0
- package/dist/schema/compile-runtime-schema-value.d.ts +6 -0
- package/dist/schema/compile-runtime-schema.d.ts +2 -0
- package/dist/schema/contracts.d.ts +87 -0
- package/dist/schema/create-schema-builder.d.ts +2 -0
- package/dist/schema/create-schema-value-error.d.ts +3 -0
- package/dist/schema/date-time.d.ts +4 -0
- package/dist/schema/date.d.ts +14 -0
- package/dist/schema/enum-of.d.ts +7 -0
- package/dist/schema/get-runtime-schema-internals.d.ts +2 -0
- package/dist/schema/handle-runtime-schema-absence.d.ts +6 -0
- package/dist/schema/int.d.ts +4 -0
- package/dist/schema/is-runtime-schema-kind.d.ts +2 -0
- package/dist/schema/normalize-compiled-runtime-schema-value.d.ts +3 -0
- package/dist/schema/normalize-runtime-schema-value.d.ts +2 -0
- package/dist/schema/number.d.ts +4 -0
- package/dist/schema/object.d.ts +20 -0
- package/dist/schema/parse-compiled-runtime-schema-value.d.ts +3 -0
- package/dist/schema/parse-runtime-schema-value.d.ts +2 -0
- package/dist/schema/runtime-schema-symbol.d.ts +5 -0
- package/dist/schema/runtime-schema-value-context.d.ts +2 -0
- package/dist/schema/safe-runtime-schema-value.d.ts +4 -0
- package/dist/schema/serialize-compiled-runtime-schema-value.d.ts +3 -0
- package/dist/schema/serialize-runtime-schema-value.d.ts +2 -0
- package/dist/schema/string.d.ts +4 -0
- package/dist/search/append-object-search-entries.d.ts +4 -0
- package/dist/search/append-raw-search-value.d.ts +2 -0
- package/dist/search/append-search-entry.d.ts +3 -0
- package/dist/search/are-search-values-equal.d.ts +1 -0
- package/dist/search/assert-object-search-collisions.d.ts +2 -0
- package/dist/search/build-compiled-search.d.ts +3 -0
- package/dist/search/build-raw-search.d.ts +2 -0
- package/dist/search/build-schema-search.d.ts +3 -0
- package/dist/search/build-search.d.ts +6 -0
- package/dist/search/collect-object-search-paths.d.ts +2 -0
- package/dist/search/compile-search-schema.d.ts +2 -0
- package/dist/search/contracts.d.ts +73 -0
- package/dist/search/copy-raw-search-params.d.ts +2 -0
- package/dist/search/copy-unknown-structured-search.d.ts +2 -0
- package/dist/search/create-search-params.d.ts +1 -0
- package/dist/search/create-search.d.ts +4 -0
- package/dist/search/delete-search-field-raw-keys.d.ts +2 -0
- package/dist/search/filter-raw-search.d.ts +3 -0
- package/dist/search/find-object-search-raw-value.d.ts +2 -0
- package/dist/search/has-search-field-raw-value.d.ts +2 -0
- package/dist/search/is-runtime-search-field.d.ts +2 -0
- package/dist/search/join-search-strings.d.ts +1 -0
- package/dist/search/normalize-compiled-search.d.ts +3 -0
- package/dist/search/normalize-search-build-value.d.ts +2 -0
- package/dist/search/normalize-search-field-default.d.ts +2 -0
- package/dist/search/normalize-search-field-type.d.ts +2 -0
- package/dist/search/object-search-key.d.ts +4 -0
- package/dist/search/object-search-path-key.d.ts +2 -0
- package/dist/search/object-search-raw-key-path.d.ts +1 -0
- package/dist/search/omit-search.d.ts +1 -0
- package/dist/search/parse-array-search-value.d.ts +4 -0
- package/dist/search/parse-compiled-search.d.ts +2 -0
- package/dist/search/parse-object-search-value.d.ts +4 -0
- package/dist/search/parse-partial-compiled-search.d.ts +6 -0
- package/dist/search/parse-partial-schema-search.d.ts +6 -0
- package/dist/search/parse-raw-search.d.ts +2 -0
- package/dist/search/parse-search-field-value.d.ts +2 -0
- package/dist/search/parse-search.d.ts +5 -0
- package/dist/search/patch-search.d.ts +6 -0
- package/dist/search/pick-search.d.ts +1 -0
- package/dist/search/replace-search.d.ts +5 -0
- package/dist/search/search-array-format.d.ts +3 -0
- package/dist/search/search-entries.d.ts +4 -0
- package/dist/search/serialize-search-build-value.d.ts +2 -0
- package/dist/search/serialize-search-entries.d.ts +3 -0
- package/dist/static/compile-static-hash.d.ts +3 -0
- package/dist/static/compile-static-search.d.ts +3 -0
- package/dist/static/compile-static-url.d.ts +3 -0
- package/dist/static/contracts.d.ts +81 -0
- package/dist/static/create-static-search-schema.d.ts +3 -0
- package/dist/static/normalize-static-search-default.d.ts +2 -0
- package/dist/static/static-search-field-kind.d.ts +4 -0
- package/dist/static.d.ts +7 -0
- package/dist/static.js +55 -0
- package/dist/static.js.map +1 -0
- package/dist/url/assert-path-match-failure.d.ts +2 -0
- package/dist/url/build-compiled-url.d.ts +3 -0
- package/dist/url/build-url.d.ts +3 -0
- package/dist/url/coerce-path-param.d.ts +2 -0
- package/dist/url/compile-path.d.ts +2 -0
- package/dist/url/compile-runtime-url-descriptor.d.ts +2 -0
- package/dist/url/compile-url-descriptor.d.ts +13 -0
- package/dist/url/contracts.d.ts +91 -0
- package/dist/url/create-unsupported-url-method.d.ts +1 -0
- package/dist/url/create-url-contract.d.ts +3 -0
- package/dist/url/create-url.d.ts +2 -0
- package/dist/url/filter-compiled-url-search.d.ts +4 -0
- package/dist/url/format-parsed-url.d.ts +2 -0
- package/dist/url/match-url.d.ts +3 -0
- package/dist/url/normalize-compiled-url.d.ts +3 -0
- package/dist/url/normalize-path-build-params.d.ts +1 -0
- package/dist/url/normalize-url.d.ts +3 -0
- package/dist/url/parse-compiled-url.d.ts +3 -0
- package/dist/url/parse-path-pattern.d.ts +2 -0
- package/dist/url/parse-request.d.ts +2 -0
- package/dist/url/parse-url.d.ts +6 -0
- package/dist/url/patch-compiled-url-search.d.ts +3 -0
- package/dist/url/path-constraints.d.ts +5 -0
- package/dist/url/path-param-kind.d.ts +3 -0
- package/dist/url/path-segment.d.ts +11 -0
- package/dist/url/register-urlkit-path-constraints.d.ts +1 -0
- package/dist/url/replace-compiled-url-search.d.ts +3 -0
- package/dist/url/resolve-url-unknown-search.d.ts +3 -0
- package/dist/url/url-state-brand.d.ts +7 -0
- package/package.json +73 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NormalizedHashDescriptor } from './contracts.js';
|
|
2
|
+
export interface ValidateNormalizedHashValueOptions {
|
|
3
|
+
readonly serialized: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function validateNormalizedHashValue(descriptor: NormalizedHashDescriptor<string | undefined>, input: unknown, options: ValidateNormalizedHashValueOptions): string | undefined;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './url/path-constraints.js';
|
|
2
|
+
export { createConstraint } from '@cookbook/pathkit/constraints';
|
|
3
|
+
export type { ConstraintValidation } from '@cookbook/pathkit';
|
|
4
|
+
export * from './contracts.js';
|
|
5
|
+
export * from './date/contracts.js';
|
|
6
|
+
export * from './errors/contracts.js';
|
|
7
|
+
export * from './errors/url-kit-error.js';
|
|
8
|
+
export * from './schema/array.js';
|
|
9
|
+
export * from './schema/boolean.js';
|
|
10
|
+
export * from './schema/contracts.js';
|
|
11
|
+
export * from './schema/date-time.js';
|
|
12
|
+
export * from './schema/date.js';
|
|
13
|
+
export * from './schema/enum-of.js';
|
|
14
|
+
export * from './schema/int.js';
|
|
15
|
+
export * from './schema/number.js';
|
|
16
|
+
export * from './schema/object.js';
|
|
17
|
+
export * from './schema/string.js';
|
|
18
|
+
export * from './url/contracts.js';
|
|
19
|
+
export * from './url/create-url.js';
|
|
20
|
+
export * from './search/create-search.js';
|
|
21
|
+
export * from './hash/create-hash.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { d as date, c as compileSearchSchema, a as compilePath, U as UrlKitError } from './compile-path-wQfWAzOh.js';
|
|
2
|
+
export { b as boolean, e as enumOf, h as hasPathConstraint, i as int, n as number, r as registerPathConstraint, f as registerPathConstraints, s as string } from './compile-path-wQfWAzOh.js';
|
|
3
|
+
export { createConstraint } from '@cookbook/pathkit/constraints';
|
|
4
|
+
import { c as compileHashDescriptor, a as createUrlContract } from './create-url-contract-BYKPM9bn.js';
|
|
5
|
+
export { b as array, g as getObjectSchemaShape, o as object, p as parseArrayRuntimeSchemaValue, s as serializeArrayRuntimeSchemaValue } from './create-url-contract-BYKPM9bn.js';
|
|
6
|
+
import '@cookbook/pathkit/compile';
|
|
7
|
+
import '@cookbook/pathkit/match';
|
|
8
|
+
|
|
9
|
+
function dateTime() {
|
|
10
|
+
return date({ format: 'date-time' });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function compileRuntimeUrlDescriptor(descriptor, options = {}) {
|
|
14
|
+
assertRuntimeUrlDescriptor(descriptor);
|
|
15
|
+
const mode = Object.prototype.hasOwnProperty.call(descriptor, 'path') ? 'path' : 'pathless';
|
|
16
|
+
if (descriptor.search) {
|
|
17
|
+
compileSearchSchema(descriptor.search);
|
|
18
|
+
}
|
|
19
|
+
const normalized = {
|
|
20
|
+
mode,
|
|
21
|
+
pattern: mode === 'path' ? descriptor.path : undefined,
|
|
22
|
+
...(mode === 'path' && descriptor.path !== undefined
|
|
23
|
+
? {
|
|
24
|
+
path: compilePath(descriptor.path, {
|
|
25
|
+
params: 'parsed',
|
|
26
|
+
...(options.pathConstraints ? { pathConstraints: options.pathConstraints } : {}),
|
|
27
|
+
}),
|
|
28
|
+
}
|
|
29
|
+
: {}),
|
|
30
|
+
...(descriptor.search ? { search: descriptor.search } : {}),
|
|
31
|
+
...(descriptor.hash ? { hash: compileHashDescriptor(descriptor.hash).descriptor } : {}),
|
|
32
|
+
};
|
|
33
|
+
return Object.freeze(normalized);
|
|
34
|
+
}
|
|
35
|
+
function assertRuntimeUrlDescriptor(input) {
|
|
36
|
+
if (!isRecord(input)) {
|
|
37
|
+
throw new UrlKitError('invalid-descriptor', 'Runtime URL descriptor must be an object.', {
|
|
38
|
+
path: [],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(input, 'path') && typeof input.path !== 'string') {
|
|
42
|
+
throw new UrlKitError('invalid-descriptor', 'Runtime URL descriptor path must be a string.', {
|
|
43
|
+
path: ['path'],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (Object.prototype.hasOwnProperty.call(input, 'search') &&
|
|
47
|
+
input.search !== undefined &&
|
|
48
|
+
!isRecord(input.search)) {
|
|
49
|
+
throw new UrlKitError('invalid-descriptor', 'Runtime URL descriptor search must be an object.', { path: ['search'] });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function isRecord(input) {
|
|
53
|
+
return typeof input === 'object' && input !== null && !Array.isArray(input);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function url(descriptor, options = {}) {
|
|
57
|
+
return createUrlContract(compileRuntimeUrlDescriptor(descriptor, options), options);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function search(schema, options) {
|
|
61
|
+
return url({
|
|
62
|
+
search: schema,
|
|
63
|
+
}, options);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function hash(schema, options) {
|
|
67
|
+
return url({
|
|
68
|
+
hash: schema,
|
|
69
|
+
}, options);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { UrlKitError, date, dateTime, hash, search, url };
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/schema/date-time.ts","../src/url/compile-runtime-url-descriptor.ts","../src/url/create-url.ts","../src/search/create-search.ts","../src/hash/create-hash.ts"],"sourcesContent":["import type { DateSchema } from './date.js';\nimport { date } from './date.js';\n\nexport interface DateTimeSchema extends DateSchema<'date-time'> {}\n\nexport function dateTime(): DateTimeSchema {\n return date({ format: 'date-time' });\n}\n","import { UrlKitError } from '../errors/url-kit-error.js';\nimport { compileHashDescriptor } from '../hash/compile-hash-descriptor.js';\nimport { compileSearchSchema } from '../search/compile-search-schema.js';\nimport { compilePath } from './compile-path.js';\nimport type {\n CreateUrlOptions,\n NormalizedUrlDescriptor,\n RuntimeUrlDescriptor,\n UrlModeFromRuntimeDescriptor,\n} from './contracts.js';\n\nexport function compileRuntimeUrlDescriptor<Descriptor extends RuntimeUrlDescriptor>(\n descriptor: Descriptor,\n options: CreateUrlOptions = {},\n): NormalizedUrlDescriptor<UrlModeFromRuntimeDescriptor<Descriptor>> {\n assertRuntimeUrlDescriptor(descriptor);\n\n const mode = Object.prototype.hasOwnProperty.call(descriptor, 'path') ? 'path' : 'pathless';\n\n if (descriptor.search) {\n compileSearchSchema(descriptor.search);\n }\n\n const normalized = {\n mode,\n pattern: mode === 'path' ? descriptor.path : undefined,\n ...(mode === 'path' && descriptor.path !== undefined\n ? {\n path: compilePath(descriptor.path, {\n params: 'parsed',\n ...(options.pathConstraints ? { pathConstraints: options.pathConstraints } : {}),\n }),\n }\n : {}),\n ...(descriptor.search ? { search: descriptor.search } : {}),\n ...(descriptor.hash ? { hash: compileHashDescriptor(descriptor.hash).descriptor } : {}),\n } as NormalizedUrlDescriptor<UrlModeFromRuntimeDescriptor<Descriptor>>;\n\n return Object.freeze(normalized);\n}\n\nfunction assertRuntimeUrlDescriptor(input: unknown): asserts input is RuntimeUrlDescriptor {\n if (!isRecord(input)) {\n throw new UrlKitError('invalid-descriptor', 'Runtime URL descriptor must be an object.', {\n path: [],\n });\n }\n\n if (Object.prototype.hasOwnProperty.call(input, 'path') && typeof input.path !== 'string') {\n throw new UrlKitError('invalid-descriptor', 'Runtime URL descriptor path must be a string.', {\n path: ['path'],\n });\n }\n\n if (\n Object.prototype.hasOwnProperty.call(input, 'search') &&\n input.search !== undefined &&\n !isRecord(input.search)\n ) {\n throw new UrlKitError(\n 'invalid-descriptor',\n 'Runtime URL descriptor search must be an object.',\n { path: ['search'] },\n );\n }\n}\n\nfunction isRecord(input: unknown): input is Record<string, unknown> {\n return typeof input === 'object' && input !== null && !Array.isArray(input);\n}\n","import { createUrlContract } from './create-url-contract.js';\nimport { compileRuntimeUrlDescriptor } from './compile-runtime-url-descriptor.js';\nimport type {\n CreateUrlOptions,\n HashBuildInputFromRuntimeDescriptor,\n HashFromRuntimeDescriptor,\n ParamsFromRuntimeDescriptor,\n PathnameFromRuntimeDescriptor,\n RuntimeUrlDescriptor,\n SearchBuildInputFromRuntimeDescriptor,\n SearchFromRuntimeDescriptor,\n UrlContract,\n UrlModeFromRuntimeDescriptor,\n} from './contracts.js';\n\nexport function url<const Descriptor extends RuntimeUrlDescriptor>(\n descriptor: Descriptor,\n options: CreateUrlOptions = {},\n): UrlContract<\n UrlModeFromRuntimeDescriptor<Descriptor>,\n PathnameFromRuntimeDescriptor<Descriptor>,\n ParamsFromRuntimeDescriptor<Descriptor>,\n SearchFromRuntimeDescriptor<Descriptor>,\n HashFromRuntimeDescriptor<Descriptor>,\n SearchBuildInputFromRuntimeDescriptor<Descriptor>,\n HashBuildInputFromRuntimeDescriptor<Descriptor>\n> {\n return createUrlContract<\n UrlModeFromRuntimeDescriptor<Descriptor>,\n PathnameFromRuntimeDescriptor<Descriptor>,\n ParamsFromRuntimeDescriptor<Descriptor>,\n SearchFromRuntimeDescriptor<Descriptor>,\n HashFromRuntimeDescriptor<Descriptor>,\n SearchBuildInputFromRuntimeDescriptor<Descriptor>,\n HashBuildInputFromRuntimeDescriptor<Descriptor>\n >(compileRuntimeUrlDescriptor(descriptor, options), options);\n}\n","import type { EmptyParams } from '../contracts.js';\nimport { url } from '../url/create-url.js';\nimport type { CreateUrlOptions, UrlContract } from '../url/contracts.js';\nimport type {\n InferRuntimeSearch,\n InferRuntimeSearchBuildInput,\n RuntimeSearchSchema,\n} from './contracts.js';\n\nexport function search<const Schema extends RuntimeSearchSchema>(\n schema: Schema,\n options?: CreateUrlOptions,\n): UrlContract<\n 'pathless',\n string,\n EmptyParams,\n InferRuntimeSearch<Schema>,\n undefined,\n InferRuntimeSearchBuildInput<Schema>\n> {\n return url(\n {\n search: schema,\n },\n options,\n );\n}\n","import type { EmptyParams } from '../contracts.js';\nimport type { InferRuntimeSchemaValue } from '../schema/contracts.js';\nimport { url } from '../url/create-url.js';\nimport type {\n CreateUrlOptions,\n HashBuildInputFromRuntimeSchema,\n UrlContract,\n} from '../url/contracts.js';\nimport type { HashSchema } from './contracts.js';\n\nexport function hash<const Schema extends HashSchema>(\n schema: Schema,\n options?: CreateUrlOptions,\n): UrlContract<\n 'pathless',\n string,\n EmptyParams,\n EmptyParams,\n InferRuntimeSchemaValue<Schema>,\n EmptyParams,\n HashBuildInputFromRuntimeSchema<Schema>\n> {\n return url(\n {\n hash: schema,\n },\n options,\n ) as UrlContract<\n 'pathless',\n string,\n EmptyParams,\n EmptyParams,\n InferRuntimeSchemaValue<Schema>,\n EmptyParams,\n HashBuildInputFromRuntimeSchema<Schema>\n >;\n}\n"],"names":[],"mappings":";;;;;;;;SAKgB,QAAQ,GAAA;IACtB,OAAO,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACtC;;SCIgB,2BAA2B,CACzC,UAAsB,EACtB,UAA4B,EAAE,EAAA;IAE9B,0BAA0B,CAAC,UAAU,CAAC;IAEtC,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,UAAU;AAE3F,IAAA,IAAI,UAAU,CAAC,MAAM,EAAE;AACrB,QAAA,mBAAmB,CAAC,UAAU,CAAC,MAAM,CAAC;IACxC;AAEA,IAAA,MAAM,UAAU,GAAG;QACjB,IAAI;AACJ,QAAA,OAAO,EAAE,IAAI,KAAK,MAAM,GAAG,UAAU,CAAC,IAAI,GAAG,SAAS;QACtD,IAAI,IAAI,KAAK,MAAM,IAAI,UAAU,CAAC,IAAI,KAAK;AACzC,cAAE;AACE,gBAAA,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE;AACjC,oBAAA,MAAM,EAAE,QAAQ;AAChB,oBAAA,IAAI,OAAO,C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AAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7E;;SCtDgB,GAAG,CACjB,UAAsB,EACtB,UAA4B,EAAE,EAAA;IAU9B,OAAO,iBAAiB,CAQtB,2BAA2B,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC;AAC9D;;AC3BM,SAAU,MAAM,CACpB,MAAc,EACd,OAA0B,EAAA;AAS1B,IAAA,OAAO,GAAG,CACR;AACE,QAAA,MAAM,EAAE,MAAM;KACf,EACD,OAAO,CACR;AACH;;AChBM,SAAU,IAAI,CAClB,MAAc,EACd,OAA0B,EAAA;AAU1B,IAAA,OAAO,GAAG,CACR;AACE,QAAA,IAAI,EAAE,MAAM;KACb,EACD,OAAO,CASR;AACH;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './url/path-constraints.js';
|
|
2
|
+
export { createConstraint } from '@cookbook/pathkit/constraints';
|
|
3
|
+
export type { ConstraintValidation } from '@cookbook/pathkit';
|
|
4
|
+
export { createRouteUrlContract } from './runtime/create-route-url-contract.js';
|
|
5
|
+
export type { CreateRouteUrlContractOptions } from './runtime/contracts.js';
|
|
6
|
+
export { buildSearch, omitSearch, patchSearch, pickSearch, replaceSearch, } from './runtime/build-route-search.js';
|
|
7
|
+
export type { BuildRouteSearchOptions, PatchRouteSearchOptions, } from './runtime/build-route-search.js';
|
|
8
|
+
export { parseSearch } from './runtime/parse-route-search.js';
|
|
9
|
+
export type { ParseSearchOptions } from './runtime/parse-route-search.js';
|
|
10
|
+
export { buildHash } from './hash/build-hash.js';
|
|
11
|
+
export { normalizeHash } from './hash/normalize-hash.js';
|
|
12
|
+
export { parseHash } from './hash/parse-hash.js';
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { a as compilePath, c as compileSearchSchema } from './compile-path-wQfWAzOh.js';
|
|
2
|
+
export { h as hasPathConstraint, r as registerPathConstraint, f as registerPathConstraints } from './compile-path-wQfWAzOh.js';
|
|
3
|
+
export { createConstraint } from '@cookbook/pathkit/constraints';
|
|
4
|
+
import { c as compileStaticHash, a as compileStaticSearch } from './compile-static-search-Cq3uaLe8.js';
|
|
5
|
+
import { a as createUrlContract, d as buildCompiledSearch, e as buildRawSearch, f as omitRawSearch, h as parseRawSearch, i as hasSearchFieldRawValue, j as parseSearchFieldValue, k as deleteSearchFieldRawKeys, l as copyRawSearchParams, m as joinSearchStrings, n as pickRawSearch, q as parseCompiledSearch, r as readHashFragment, c as compileHashDescriptor } from './create-url-contract-BYKPM9bn.js';
|
|
6
|
+
export { t as buildHash, u as parseHash } from './create-url-contract-BYKPM9bn.js';
|
|
7
|
+
import '@cookbook/pathkit/compile';
|
|
8
|
+
import '@cookbook/pathkit/match';
|
|
9
|
+
|
|
10
|
+
function createRouteUrlContract(descriptor, options) {
|
|
11
|
+
return createUrlContract(compileRouteUrlDescriptor(descriptor, options), options);
|
|
12
|
+
}
|
|
13
|
+
function compileRouteUrlDescriptor(descriptor, options) {
|
|
14
|
+
const mode = Object.prototype.hasOwnProperty.call(descriptor, 'path') ? 'path' : 'pathless';
|
|
15
|
+
const paramsMode = options?.params ?? 'raw';
|
|
16
|
+
const normalized = {
|
|
17
|
+
mode,
|
|
18
|
+
pattern: mode === 'path' ? descriptor.path : undefined,
|
|
19
|
+
...(mode === 'path' && descriptor.path !== undefined
|
|
20
|
+
? {
|
|
21
|
+
path: compilePath(descriptor.path, {
|
|
22
|
+
params: paramsMode,
|
|
23
|
+
...(options?.pathConstraints ? { pathConstraints: options.pathConstraints } : {}),
|
|
24
|
+
}),
|
|
25
|
+
}
|
|
26
|
+
: {}),
|
|
27
|
+
...(Object.prototype.hasOwnProperty.call(descriptor, 'search')
|
|
28
|
+
? { search: compileStaticSearch(descriptor.search ?? {}) }
|
|
29
|
+
: {}),
|
|
30
|
+
...(Object.prototype.hasOwnProperty.call(descriptor, 'hash') && descriptor.hash !== undefined
|
|
31
|
+
? { hash: compileStaticHash(descriptor.hash) }
|
|
32
|
+
: {}),
|
|
33
|
+
};
|
|
34
|
+
return Object.freeze(normalized);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function buildSchemaSearch(input = {}, schema, options = {}) {
|
|
38
|
+
return buildCompiledSearch(input, compileSearchSchema(schema), options);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function buildSearch$1(input = {}, options = {}) {
|
|
42
|
+
if (options.schema) {
|
|
43
|
+
return buildSchemaSearch(input, options.schema, options);
|
|
44
|
+
}
|
|
45
|
+
return buildRawSearch(input, options);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function omitSearch$1(current, keys) {
|
|
49
|
+
return buildRawSearch(omitRawSearch(parseRawSearch(current), keys));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function parsePartialSchemaSearch(rawSearch, schema, options = {}) {
|
|
53
|
+
const compiled = compileSearchSchema(schema);
|
|
54
|
+
const remainingUnknown = { ...rawSearch };
|
|
55
|
+
const search = {};
|
|
56
|
+
for (const field of compiled.fields) {
|
|
57
|
+
if (!hasSearchFieldRawValue(field, rawSearch)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const value = parseSearchFieldValue(field, rawSearch, options);
|
|
61
|
+
deleteSearchFieldRawKeys(field, remainingUnknown);
|
|
62
|
+
if (value !== undefined) {
|
|
63
|
+
search[field.key] = value;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return Object.freeze({
|
|
67
|
+
search: Object.freeze(search),
|
|
68
|
+
unknownSearch: copyRawSearchParams(remainingUnknown),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function patchSearch$1(current, patch, options = {}) {
|
|
73
|
+
if (options.schema) {
|
|
74
|
+
return patchSchemaSearch(current, patch, options.schema, options);
|
|
75
|
+
}
|
|
76
|
+
return patchRawSearch(current, patch, options);
|
|
77
|
+
}
|
|
78
|
+
function patchRawSearch(current, patch, options) {
|
|
79
|
+
const merged = { ...parseRawSearch(current) };
|
|
80
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
81
|
+
if (shouldRemoveUndefined(value, options) || shouldRemoveNull(value, options)) {
|
|
82
|
+
delete merged[key];
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (value === undefined || value === null) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
merged[key] = toRawSearchValue(value);
|
|
89
|
+
}
|
|
90
|
+
return buildRawSearch(merged, options);
|
|
91
|
+
}
|
|
92
|
+
function patchSchemaSearch(current, patch, schema, options) {
|
|
93
|
+
const compiled = compileSearchSchema(schema);
|
|
94
|
+
const schemaKeys = compiled.keys;
|
|
95
|
+
const currentParsed = parsePartialSchemaSearch(parseRawSearch(current), schema, options);
|
|
96
|
+
const mergedSearch = { ...currentParsed.search };
|
|
97
|
+
const unknownSearch = {
|
|
98
|
+
...copyRawSearchParams(currentParsed.unknownSearch),
|
|
99
|
+
};
|
|
100
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
101
|
+
if (shouldRemoveUndefined(value, options) || shouldRemoveNull(value, options)) {
|
|
102
|
+
delete mergedSearch[key];
|
|
103
|
+
delete unknownSearch[key];
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (value === undefined || value === null) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (schemaKeys.has(key)) {
|
|
110
|
+
mergedSearch[key] = value;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return joinSearchStrings(buildSchemaSearch(mergedSearch, schema, options), buildRawSearch(unknownSearch, options));
|
|
114
|
+
}
|
|
115
|
+
function shouldRemoveUndefined(value, options) {
|
|
116
|
+
return value === undefined && options.removeUndefined === true;
|
|
117
|
+
}
|
|
118
|
+
function shouldRemoveNull(value, options) {
|
|
119
|
+
return value === null && options.removeNull === true;
|
|
120
|
+
}
|
|
121
|
+
function toRawSearchValue(value) {
|
|
122
|
+
if (Array.isArray(value)) {
|
|
123
|
+
return Object.freeze(value.filter(isPresent).map(String));
|
|
124
|
+
}
|
|
125
|
+
return String(value);
|
|
126
|
+
}
|
|
127
|
+
function isPresent(value) {
|
|
128
|
+
return value !== undefined && value !== null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function pickSearch$1(current, keys) {
|
|
132
|
+
return buildRawSearch(pickRawSearch(parseRawSearch(current), keys));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function replaceSearch$1(_current, next, options = {}) {
|
|
136
|
+
return buildSearch$1(next, options);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const staticSearchCache = new WeakMap();
|
|
140
|
+
function compileCachedStaticSearch(schema) {
|
|
141
|
+
const cached = staticSearchCache.get(schema);
|
|
142
|
+
if (cached) {
|
|
143
|
+
return cached;
|
|
144
|
+
}
|
|
145
|
+
const compiled = compileStaticSearch(schema);
|
|
146
|
+
staticSearchCache.set(schema, compiled);
|
|
147
|
+
return compiled;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function buildSearch(input = {}, options = {}) {
|
|
151
|
+
if (!options.schema) {
|
|
152
|
+
return buildSearch$1(input, options);
|
|
153
|
+
}
|
|
154
|
+
return buildSearch$1(input, {
|
|
155
|
+
...options,
|
|
156
|
+
schema: compileCachedStaticSearch(options.schema),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function patchSearch(current, patch, options = {}) {
|
|
160
|
+
if (!options.schema) {
|
|
161
|
+
return patchSearch$1(current, patch, options);
|
|
162
|
+
}
|
|
163
|
+
return patchSearch$1(current, patch, {
|
|
164
|
+
...options,
|
|
165
|
+
schema: compileCachedStaticSearch(options.schema),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function replaceSearch(current, next, options = {}) {
|
|
169
|
+
if (!options.schema) {
|
|
170
|
+
return replaceSearch$1(current, next, options);
|
|
171
|
+
}
|
|
172
|
+
return replaceSearch$1(current, next, {
|
|
173
|
+
...options,
|
|
174
|
+
schema: compileCachedStaticSearch(options.schema),
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function omitSearch(current, keys) {
|
|
178
|
+
return omitSearch$1(current, keys);
|
|
179
|
+
}
|
|
180
|
+
function pickSearch(current, keys) {
|
|
181
|
+
return pickSearch$1(current, keys);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function parseSearch$1(input, options) {
|
|
185
|
+
const rawSearch = parseRawSearch(input);
|
|
186
|
+
if (!options?.schema) {
|
|
187
|
+
return rawSearch;
|
|
188
|
+
}
|
|
189
|
+
return parseSchemaSearch(rawSearch, options.schema, options);
|
|
190
|
+
}
|
|
191
|
+
function parseSchemaSearch(rawSearch, schema, options) {
|
|
192
|
+
return parseCompiledSearch(rawSearch, compileSearchSchema(schema), options.unknownSearch ?? 'strip', options.arrayFormat ? { arrayFormat: options.arrayFormat } : {});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function parseSearch(input, options = {}) {
|
|
196
|
+
if (!options.schema) {
|
|
197
|
+
return parseSearch$1(input);
|
|
198
|
+
}
|
|
199
|
+
return parseSearch$1(input, {
|
|
200
|
+
schema: compileCachedStaticSearch(options.schema),
|
|
201
|
+
...(options.unknownSearch ? { unknownSearch: options.unknownSearch } : {}),
|
|
202
|
+
...(options.arrayFormat ? { arrayFormat: options.arrayFormat } : {}),
|
|
203
|
+
}).search;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function normalizeHash(input, descriptor) {
|
|
207
|
+
if (descriptor === undefined) {
|
|
208
|
+
return readHashFragment(input);
|
|
209
|
+
}
|
|
210
|
+
return compileHashDescriptor(descriptor).normalize(input);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export { buildSearch, createRouteUrlContract, normalizeHash, omitSearch, parseSearch, patchSearch, pickSearch, replaceSearch };
|
|
214
|
+
//# sourceMappingURL=router-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-runtime.js","sources":["../src/runtime/create-route-url-contract.ts","../src/search/build-schema-search.ts","../src/search/build-search.ts","../src/search/omit-search.ts","../src/search/parse-partial-schema-search.ts","../src/search/patch-search.ts","../src/search/pick-search.ts","../src/search/replace-search.ts","../src/runtime/compile-cached-static-search.ts","../src/runtime/build-route-search.ts","../src/search/parse-search.ts","../src/runtime/parse-route-search.ts","../src/hash/normalize-hash.ts"],"sourcesContent":["import { compileStaticHash } from '../static/compile-static-hash.js';\nimport { compileStaticSearch } from '../static/compile-static-search.js';\nimport type {\n InferStaticUrlHash,\n InferStaticUrlHashBuildInput,\n InferStaticUrlSearch,\n InferStaticUrlSearchBuildInput,\n StaticUrlDescriptor,\n StaticUrlModeFromDescriptor,\n} from '../static/contracts.js';\nimport { compilePath } from '../url/compile-path.js';\nimport { createUrlContract } from '../url/create-url-contract.js';\nimport type {\n NormalizedUrlDescriptor,\n ParamsFromPattern,\n PathnameFromPattern,\n RawParamsFromPattern,\n UrlContract,\n} from '../url/contracts.js';\nimport type { EmptyParams } from '../contracts.js';\nimport type { CreateRouteUrlContractOptions } from './contracts.js';\n\nexport function createRouteUrlContract<\n const Descriptor extends StaticUrlDescriptor,\n const Options extends CreateRouteUrlContractOptions | undefined = undefined,\n>(\n descriptor: Descriptor,\n options?: Options,\n): UrlContract<\n StaticUrlModeFromDescriptor<Descriptor>,\n RoutePathnameFromDescriptor<Descriptor>,\n RouteParamsFromDescriptor<Descriptor, Options>,\n InferStaticUrlSearch<Descriptor>,\n InferStaticUrlHash<Descriptor>,\n InferStaticUrlSearchBuildInput<Descriptor>,\n InferStaticUrlHashBuildInput<Descriptor>\n> {\n return createUrlContract<\n StaticUrlModeFromDescriptor<Descriptor>,\n RoutePathnameFromDescriptor<Descriptor>,\n RouteParamsFromDescriptor<Descriptor, Options>,\n InferStaticUrlSearch<Descriptor>,\n InferStaticUrlHash<Descriptor>,\n InferStaticUrlSearchBuildInput<Descriptor>,\n InferStaticUrlHashBuildInput<Descriptor>\n >(compileRouteUrlDescriptor(descriptor, options), options);\n}\n\nexport type RoutePathnameFromDescriptor<Descriptor extends StaticUrlDescriptor> =\n Descriptor extends {\n readonly path: infer Pattern extends string;\n }\n ? PathnameFromPattern<Pattern>\n : string;\n\nexport type RouteParamsFromDescriptor<\n Descriptor extends StaticUrlDescriptor,\n Options extends CreateRouteUrlContractOptions | undefined,\n> = Descriptor extends { readonly path: infer Pattern extends string }\n ? RouteParamsMode<Options> extends 'parsed'\n ? ParamsFromPattern<Pattern>\n : RawParamsFromPattern<Pattern>\n : EmptyParams;\n\ntype RouteParamsMode<Options extends CreateRouteUrlContractOptions | undefined> = Options extends {\n readonly params: 'parsed';\n}\n ? 'parsed'\n : 'raw';\n\nfunction compileRouteUrlDescriptor<\n Descriptor extends StaticUrlDescriptor,\n Options extends CreateRouteUrlContractOptions | undefined,\n>(\n descriptor: Descriptor,\n options: Options,\n): NormalizedUrlDescriptor<StaticUrlModeFromDescriptor<Descriptor>> {\n const mode = Object.prototype.hasOwnProperty.call(descriptor, 'path') ? 'path' : 'pathless';\n const paramsMode = options?.params ?? 'raw';\n\n const normalized = {\n mode,\n pattern: mode === 'path' ? descriptor.path : undefined,\n ...(mode === 'path' && descriptor.path !== undefined\n ? {\n path: compilePath(descriptor.path, {\n params: paramsMode,\n ...(options?.pathConstraints ? { pathConstraints: options.pathConstraints } : {}),\n }),\n }\n : {}),\n ...(Object.prototype.hasOwnProperty.call(descriptor, 'search')\n ? { search: compileStaticSearch(descriptor.search ?? {}) }\n : {}),\n ...(Object.prototype.hasOwnProperty.call(descriptor, 'hash') && descriptor.hash !== undefined\n ? { hash: compileStaticHash(descriptor.hash) }\n : {}),\n } as NormalizedUrlDescriptor<StaticUrlModeFromDescriptor<Descriptor>>;\n\n return Object.freeze(normalized);\n}\n","import type { BuildSearchOptions } from '../contracts.js';\nimport { compileSearchSchema } from './compile-search-schema.js';\nimport type { RuntimeSearchSchema } from './contracts.js';\nimport { buildCompiledSearch } from './build-compiled-search.js';\n\nexport function buildSchemaSearch(\n input: Record<string, unknown> = {},\n schema: RuntimeSearchSchema,\n options: BuildSearchOptions = {},\n): string {\n return buildCompiledSearch(input, compileSearchSchema(schema), options);\n}\n","import type { BuildSearchOptions, SearchInputArgument } from '../contracts.js';\nimport type {\n InferRuntimeSearchBuildInput,\n RuntimeSearchSchema,\n SearchBuildOptions,\n} from './contracts.js';\nimport { buildRawSearch } from './build-raw-search.js';\nimport { buildSchemaSearch } from './build-schema-search.js';\n\nexport function buildSearch<const Schema extends RuntimeSearchSchema>(\n input: SearchInputArgument<InferRuntimeSearchBuildInput<Schema>>,\n options: SearchBuildOptions<Schema> & { readonly schema: Schema },\n): string;\nexport function buildSearch(input?: Record<string, unknown>, options?: BuildSearchOptions): string;\nexport function buildSearch(\n input: Record<string, unknown> | undefined = {},\n options: SearchBuildOptions<RuntimeSearchSchema> = {},\n): string {\n if (options.schema) {\n return buildSchemaSearch(input, options.schema, options);\n }\n\n return buildRawSearch(input, options);\n}\n","import { buildRawSearch } from './build-raw-search.js';\nimport { omitRawSearch } from './filter-raw-search.js';\nimport { parseRawSearch } from './parse-raw-search.js';\n\nexport function omitSearch(current: string | URLSearchParams, keys: readonly string[]): string {\n return buildRawSearch(omitRawSearch(parseRawSearch(current), keys));\n}\n","import type {\n RawSearchParams,\n RawSearchValue,\n RuntimeSearchSchema,\n SearchParseOptions,\n} from './contracts.js';\nimport { compileSearchSchema } from './compile-search-schema.js';\nimport { copyRawSearchParams } from './copy-raw-search-params.js';\nimport { parseSearchFieldValue } from './parse-search-field-value.js';\nimport { deleteSearchFieldRawKeys } from './delete-search-field-raw-keys.js';\nimport { hasSearchFieldRawValue } from './has-search-field-raw-value.js';\n\nexport interface PartialSchemaSearchParseResult {\n readonly search: Record<string, unknown>;\n readonly unknownSearch: RawSearchParams;\n}\n\nexport function parsePartialSchemaSearch(\n rawSearch: RawSearchParams,\n schema: RuntimeSearchSchema,\n options: SearchParseOptions = {},\n): PartialSchemaSearchParseResult {\n const compiled = compileSearchSchema(schema);\n const remainingUnknown = { ...rawSearch } satisfies Record<string, RawSearchValue>;\n const search: Record<string, unknown> = {};\n\n for (const field of compiled.fields) {\n if (!hasSearchFieldRawValue(field, rawSearch)) {\n continue;\n }\n\n const value = parseSearchFieldValue(field, rawSearch, options);\n deleteSearchFieldRawKeys(field, remainingUnknown);\n\n if (value !== undefined) {\n search[field.key] = value;\n }\n }\n\n return Object.freeze({\n search: Object.freeze(search),\n unknownSearch: copyRawSearchParams(remainingUnknown),\n });\n}\n","import type { BuildSearchOptions, PatchSearchOptions } from '../contracts.js';\nimport type {\n InferRuntimeSearch,\n RawSearchValue,\n RuntimeSearchSchema,\n SearchPatchOptions,\n} from './contracts.js';\nimport { buildRawSearch } from './build-raw-search.js';\nimport { buildSchemaSearch } from './build-schema-search.js';\nimport { compileSearchSchema } from './compile-search-schema.js';\nimport { copyRawSearchParams } from './copy-raw-search-params.js';\nimport { joinSearchStrings } from './join-search-strings.js';\nimport { parsePartialSchemaSearch } from './parse-partial-schema-search.js';\nimport { parseRawSearch } from './parse-raw-search.js';\n\nexport function patchSearch<const Schema extends RuntimeSearchSchema>(\n current: string | URLSearchParams,\n patch: Partial<InferRuntimeSearch<Schema>>,\n options: SearchPatchOptions<Schema> & { readonly schema: Schema },\n): string;\nexport function patchSearch(\n current: string | URLSearchParams,\n patch: Record<string, unknown>,\n options?: PatchSearchOptions,\n): string;\nexport function patchSearch(\n current: string | URLSearchParams,\n patch: Record<string, unknown>,\n options: SearchPatchOptions<RuntimeSearchSchema> = {},\n): string {\n if (options.schema) {\n return patchSchemaSearch(current, patch, options.schema, options);\n }\n\n return patchRawSearch(current, patch, options);\n}\n\nfunction patchRawSearch(\n current: string | URLSearchParams,\n patch: Record<string, unknown>,\n options: PatchSearchOptions,\n): string {\n const merged: Record<string, RawSearchValue> = { ...parseRawSearch(current) };\n\n for (const [key, value] of Object.entries(patch)) {\n if (shouldRemoveUndefined(value, options) || shouldRemoveNull(value, options)) {\n delete merged[key];\n continue;\n }\n\n if (value === undefined || value === null) {\n continue;\n }\n\n merged[key] = toRawSearchValue(value);\n }\n\n return buildRawSearch(merged, options);\n}\n\nfunction patchSchemaSearch(\n current: string | URLSearchParams,\n patch: Record<string, unknown>,\n schema: RuntimeSearchSchema,\n options: SearchPatchOptions<RuntimeSearchSchema>,\n): string {\n const compiled = compileSearchSchema(schema);\n const schemaKeys = compiled.keys;\n const currentParsed = parsePartialSchemaSearch(parseRawSearch(current), schema, options);\n const mergedSearch: Record<string, unknown> = { ...currentParsed.search };\n const unknownSearch: Record<string, RawSearchValue> = {\n ...copyRawSearchParams(currentParsed.unknownSearch),\n };\n\n for (const [key, value] of Object.entries(patch)) {\n if (shouldRemoveUndefined(value, options) || shouldRemoveNull(value, options)) {\n delete mergedSearch[key];\n delete unknownSearch[key];\n continue;\n }\n\n if (value === undefined || value === null) {\n continue;\n }\n\n if (schemaKeys.has(key)) {\n mergedSearch[key] = value;\n }\n }\n\n return joinSearchStrings(\n buildSchemaSearch(mergedSearch, schema, options as BuildSearchOptions),\n buildRawSearch(unknownSearch, options),\n );\n}\n\nfunction shouldRemoveUndefined(value: unknown, options: PatchSearchOptions): boolean {\n return value === undefined && options.removeUndefined === true;\n}\n\nfunction shouldRemoveNull(value: unknown, options: PatchSearchOptions): boolean {\n return value === null && options.removeNull === true;\n}\n\nfunction toRawSearchValue(value: unknown): RawSearchValue {\n if (Array.isArray(value)) {\n return Object.freeze(value.filter(isPresent).map(String));\n }\n\n return String(value);\n}\n\nfunction isPresent(value: unknown): boolean {\n return value !== undefined && value !== null;\n}\n","import { buildRawSearch } from './build-raw-search.js';\nimport { pickRawSearch } from './filter-raw-search.js';\nimport { parseRawSearch } from './parse-raw-search.js';\n\nexport function pickSearch(current: string | URLSearchParams, keys: readonly string[]): string {\n return buildRawSearch(pickRawSearch(parseRawSearch(current), keys));\n}\n","import type {\n InferRuntimeSearchBuildInput,\n RuntimeSearchSchema,\n SearchBuildOptions,\n} from './contracts.js';\nimport { buildSearch } from './build-search.js';\n\nexport function replaceSearch<const Schema extends RuntimeSearchSchema>(\n current: string | URLSearchParams,\n next: InferRuntimeSearchBuildInput<Schema>,\n options: SearchBuildOptions<Schema> & { readonly schema: Schema },\n): string;\nexport function replaceSearch(\n current: string | URLSearchParams,\n next: Record<string, unknown>,\n options?: SearchBuildOptions,\n): string;\nexport function replaceSearch(\n _current: string | URLSearchParams,\n next: object,\n options: SearchBuildOptions = {},\n): string {\n return buildSearch(next as Record<string, unknown>, options);\n}\n","import type { RuntimeSearchSchema } from '../search/contracts.js';\nimport { compileStaticSearch } from '../static/compile-static-search.js';\nimport type { StaticSearchDescriptor } from '../static/contracts.js';\n\nconst staticSearchCache = new WeakMap<StaticSearchDescriptor, RuntimeSearchSchema>();\n\nexport function compileCachedStaticSearch(schema: StaticSearchDescriptor): RuntimeSearchSchema {\n const cached = staticSearchCache.get(schema);\n\n if (cached) {\n return cached;\n }\n\n const compiled = compileStaticSearch(schema);\n staticSearchCache.set(schema, compiled);\n\n return compiled;\n}\n","import type { BuildSearchOptions, PatchSearchOptions, SearchInputArgument } from '../contracts.js';\nimport { buildSearch as buildRuntimeSearch } from '../search/build-search.js';\nimport { omitSearch as omitRuntimeSearch } from '../search/omit-search.js';\nimport { patchSearch as patchRuntimeSearch } from '../search/patch-search.js';\nimport { pickSearch as pickRuntimeSearch } from '../search/pick-search.js';\nimport { replaceSearch as replaceRuntimeSearch } from '../search/replace-search.js';\nimport { compileCachedStaticSearch } from './compile-cached-static-search.js';\nimport type {\n InferStaticSearch,\n InferStaticSearchBuildInput,\n StaticSearchDescriptor,\n} from '../static/contracts.js';\n\nexport interface BuildRouteSearchOptions<\n SearchDescriptor = StaticSearchDescriptor,\n> extends BuildSearchOptions {\n readonly schema?: SearchDescriptor;\n}\n\nexport interface PatchRouteSearchOptions<\n SearchDescriptor = StaticSearchDescriptor,\n> extends PatchSearchOptions {\n readonly schema?: SearchDescriptor;\n}\n\nexport function buildSearch<const SearchDescriptor extends StaticSearchDescriptor>(\n input: SearchInputArgument<InferStaticSearchBuildInput<SearchDescriptor>>,\n options: BuildRouteSearchOptions<SearchDescriptor> & { readonly schema: SearchDescriptor },\n): string;\nexport function buildSearch(input?: Record<string, unknown>, options?: BuildSearchOptions): string;\nexport function buildSearch(\n input: Record<string, unknown> | undefined = {},\n options: BuildRouteSearchOptions = {},\n): string {\n if (!options.schema) {\n return buildRuntimeSearch(input, options);\n }\n\n return buildRuntimeSearch(input, {\n ...options,\n schema: compileCachedStaticSearch(options.schema),\n });\n}\n\nexport function patchSearch<const SearchDescriptor extends StaticSearchDescriptor>(\n current: string | URLSearchParams,\n patch: Partial<InferStaticSearch<SearchDescriptor>>,\n options: PatchRouteSearchOptions<SearchDescriptor> & { readonly schema: SearchDescriptor },\n): string;\nexport function patchSearch(\n current: string | URLSearchParams,\n patch: Record<string, unknown>,\n options?: PatchSearchOptions,\n): string;\nexport function patchSearch(\n current: string | URLSearchParams,\n patch: Record<string, unknown>,\n options: PatchRouteSearchOptions = {},\n): string {\n if (!options.schema) {\n return patchRuntimeSearch(current, patch, options);\n }\n\n return patchRuntimeSearch(current, patch, {\n ...options,\n schema: compileCachedStaticSearch(options.schema),\n });\n}\n\nexport function replaceSearch<const SearchDescriptor extends StaticSearchDescriptor>(\n current: string | URLSearchParams,\n next: InferStaticSearchBuildInput<SearchDescriptor>,\n options: BuildRouteSearchOptions<SearchDescriptor> & { readonly schema: SearchDescriptor },\n): string;\nexport function replaceSearch(\n current: string | URLSearchParams,\n next: Record<string, unknown>,\n options?: BuildSearchOptions,\n): string;\nexport function replaceSearch(\n current: string | URLSearchParams,\n next: Record<string, unknown>,\n options: BuildRouteSearchOptions = {},\n): string {\n if (!options.schema) {\n return replaceRuntimeSearch(current, next, options);\n }\n\n return replaceRuntimeSearch(current, next, {\n ...options,\n schema: compileCachedStaticSearch(options.schema),\n });\n}\n\nexport function omitSearch(current: string | URLSearchParams, keys: readonly string[]): string {\n return omitRuntimeSearch(current, keys);\n}\n\nexport function pickSearch(current: string | URLSearchParams, keys: readonly string[]): string {\n return pickRuntimeSearch(current, keys);\n}\n","import type {\n InferRuntimeSearch,\n ParseSearchOptions,\n RawSearchParams,\n RuntimeSearchSchema,\n SearchParseResult,\n} from './contracts.js';\nimport { compileSearchSchema } from './compile-search-schema.js';\nimport { parseRawSearch } from './parse-raw-search.js';\nimport { parseCompiledSearch } from './parse-compiled-search.js';\n\nexport function parseSearch(input: string | URLSearchParams): RawSearchParams;\nexport function parseSearch<const Schema extends RuntimeSearchSchema>(\n input: string | URLSearchParams,\n options: ParseSearchOptions<Schema> & { readonly schema: Schema },\n): SearchParseResult<InferRuntimeSearch<Schema>>;\nexport function parseSearch(\n input: string | URLSearchParams,\n options?: ParseSearchOptions<RuntimeSearchSchema>,\n): RawSearchParams | SearchParseResult<Record<string, unknown>> {\n const rawSearch = parseRawSearch(input);\n\n if (!options?.schema) {\n return rawSearch;\n }\n\n return parseSchemaSearch(rawSearch, options.schema, options);\n}\n\nfunction parseSchemaSearch(\n rawSearch: RawSearchParams,\n schema: RuntimeSearchSchema,\n options: ParseSearchOptions,\n): SearchParseResult<Record<string, unknown>> {\n return parseCompiledSearch(\n rawSearch,\n compileSearchSchema(schema),\n options.unknownSearch ?? 'strip',\n options.arrayFormat ? { arrayFormat: options.arrayFormat } : {},\n );\n}\n","import type { SearchArrayFormat, UnknownSearchBehavior } from '../contracts.js';\nimport { parseSearch as parseRuntimeSearch } from '../search/parse-search.js';\nimport type { RawSearchParams } from '../search/contracts.js';\nimport { compileCachedStaticSearch } from './compile-cached-static-search.js';\nimport type { InferStaticSearch, StaticSearchDescriptor } from '../static/contracts.js';\n\nexport interface ParseSearchOptions<SearchDescriptor = StaticSearchDescriptor> {\n readonly schema?: SearchDescriptor;\n readonly unknownSearch?: UnknownSearchBehavior;\n readonly arrayFormat?: SearchArrayFormat;\n}\n\nexport function parseSearch<const SearchDescriptor extends StaticSearchDescriptor>(\n input: string | URLSearchParams,\n options: ParseSearchOptions<SearchDescriptor> & { readonly schema: SearchDescriptor },\n): InferStaticSearch<SearchDescriptor>;\nexport function parseSearch(\n input: string | URLSearchParams,\n options?: ParseSearchOptions,\n): RawSearchParams;\nexport function parseSearch(\n input: string | URLSearchParams,\n options: ParseSearchOptions = {},\n): RawSearchParams | Record<string, unknown> {\n if (!options.schema) {\n return parseRuntimeSearch(input);\n }\n\n return parseRuntimeSearch(input, {\n schema: compileCachedStaticSearch(options.schema),\n ...(options.unknownSearch ? { unknownSearch: options.unknownSearch } : {}),\n ...(options.arrayFormat ? { arrayFormat: options.arrayFormat } : {}),\n }).search;\n}\n","import type { HashDescriptorInput } from './contracts.js';\nimport { compileHashDescriptor } from './compile-hash-descriptor.js';\nimport { readHashFragment } from './hash-fragment.js';\n\nexport function normalizeHash(input: unknown): string | undefined;\nexport function normalizeHash(input: unknown, descriptor: HashDescriptorInput): unknown;\nexport function normalizeHash(input: unknown, descriptor?: HashDescriptorInput): unknown {\n if (descriptor === undefined) {\n return readHashFragment(input);\n }\n\n return compileHashDescriptor(descriptor).normalize(input);\n}\n"],"names":["buildSearch","omitSearch","patchSearch","pickSearch","replaceSearch","buildRuntimeSearch","patchRuntimeSearch","replaceRuntimeSearch","omitRuntimeSearch","pickRuntimeSearch","parseSearch","parseRuntimeSearch"],"mappings":";;;;;;;;;AAsBM,SAAU,sBAAsB,CAIpC,UAAsB,EACtB,OAAiB,EAAA;IAUjB,OAAO,iBAAiB,CAQtB,yBAAyB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC;AAC5D;AAwBA,SAAS,yBAAyB,CAIhC,UAAsB,EACtB,OAAgB,EAAA;IAEhB,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,UAAU;AAC3F,IAAA,MAAM,UAAU,GAAG,OAAO,EAAE,MAAM,IAAI,KAAK;AAE3C,IAAA,MAAM,UAAU,GAAG;QACjB,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,aAAkB,CAAC,KAAK,EAAE;AAC/B,QAAA,MAAM,EAAE,yBAAyB,CAAC,OAAO,CAAC,MAAM,CAAC;AACjD,QAAA,IAAI,OAAO,CAAC,aAAa,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC;AAC1E,QAAA,IAAI,OAAO,CAAC,WAAW,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC;KACrE,CAAC,CAAC,MAAM;AACX;;AC3BM,SAAU,aAAa,CAAC,KAAc,EAAE,UAAgC,EAAA;AAC5E,IAAA,IAAI,UAAU,KAAK,SAAS,EAAE;AAC5B,QAAA,OAAO,gBAAgB,CAAC,KAAK,CAAC;IAChC;IAEA,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;AAC3D;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BuildSearchOptions, PatchSearchOptions, SearchInputArgument } from '../contracts.js';
|
|
2
|
+
import type { InferStaticSearch, InferStaticSearchBuildInput, StaticSearchDescriptor } from '../static/contracts.js';
|
|
3
|
+
export interface BuildRouteSearchOptions<SearchDescriptor = StaticSearchDescriptor> extends BuildSearchOptions {
|
|
4
|
+
readonly schema?: SearchDescriptor;
|
|
5
|
+
}
|
|
6
|
+
export interface PatchRouteSearchOptions<SearchDescriptor = StaticSearchDescriptor> extends PatchSearchOptions {
|
|
7
|
+
readonly schema?: SearchDescriptor;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildSearch<const SearchDescriptor extends StaticSearchDescriptor>(input: SearchInputArgument<InferStaticSearchBuildInput<SearchDescriptor>>, options: BuildRouteSearchOptions<SearchDescriptor> & {
|
|
10
|
+
readonly schema: SearchDescriptor;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function buildSearch(input?: Record<string, unknown>, options?: BuildSearchOptions): string;
|
|
13
|
+
export declare function patchSearch<const SearchDescriptor extends StaticSearchDescriptor>(current: string | URLSearchParams, patch: Partial<InferStaticSearch<SearchDescriptor>>, options: PatchRouteSearchOptions<SearchDescriptor> & {
|
|
14
|
+
readonly schema: SearchDescriptor;
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function patchSearch(current: string | URLSearchParams, patch: Record<string, unknown>, options?: PatchSearchOptions): string;
|
|
17
|
+
export declare function replaceSearch<const SearchDescriptor extends StaticSearchDescriptor>(current: string | URLSearchParams, next: InferStaticSearchBuildInput<SearchDescriptor>, options: BuildRouteSearchOptions<SearchDescriptor> & {
|
|
18
|
+
readonly schema: SearchDescriptor;
|
|
19
|
+
}): string;
|
|
20
|
+
export declare function replaceSearch(current: string | URLSearchParams, next: Record<string, unknown>, options?: BuildSearchOptions): string;
|
|
21
|
+
export declare function omitSearch(current: string | URLSearchParams, keys: readonly string[]): string;
|
|
22
|
+
export declare function pickSearch(current: string | URLSearchParams, keys: readonly string[]): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PathConstraintMap, SearchArrayFormat, UnknownSearchBehavior } from '../contracts.js';
|
|
2
|
+
export interface CreateRouteUrlContractOptions {
|
|
3
|
+
readonly params?: 'raw' | 'parsed';
|
|
4
|
+
readonly unknownSearch?: UnknownSearchBehavior;
|
|
5
|
+
readonly arrayFormat?: SearchArrayFormat;
|
|
6
|
+
readonly pathConstraints?: PathConstraintMap;
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InferStaticUrlHash, InferStaticUrlHashBuildInput, InferStaticUrlSearch, InferStaticUrlSearchBuildInput, StaticUrlDescriptor, StaticUrlModeFromDescriptor } from '../static/contracts.js';
|
|
2
|
+
import type { ParamsFromPattern, PathnameFromPattern, RawParamsFromPattern, UrlContract } from '../url/contracts.js';
|
|
3
|
+
import type { EmptyParams } from '../contracts.js';
|
|
4
|
+
import type { CreateRouteUrlContractOptions } from './contracts.js';
|
|
5
|
+
export declare function createRouteUrlContract<const Descriptor extends StaticUrlDescriptor, const Options extends CreateRouteUrlContractOptions | undefined = undefined>(descriptor: Descriptor, options?: Options): UrlContract<StaticUrlModeFromDescriptor<Descriptor>, RoutePathnameFromDescriptor<Descriptor>, RouteParamsFromDescriptor<Descriptor, Options>, InferStaticUrlSearch<Descriptor>, InferStaticUrlHash<Descriptor>, InferStaticUrlSearchBuildInput<Descriptor>, InferStaticUrlHashBuildInput<Descriptor>>;
|
|
6
|
+
export type RoutePathnameFromDescriptor<Descriptor extends StaticUrlDescriptor> = Descriptor extends {
|
|
7
|
+
readonly path: infer Pattern extends string;
|
|
8
|
+
} ? PathnameFromPattern<Pattern> : string;
|
|
9
|
+
export type RouteParamsFromDescriptor<Descriptor extends StaticUrlDescriptor, Options extends CreateRouteUrlContractOptions | undefined> = Descriptor extends {
|
|
10
|
+
readonly path: infer Pattern extends string;
|
|
11
|
+
} ? RouteParamsMode<Options> extends 'parsed' ? ParamsFromPattern<Pattern> : RawParamsFromPattern<Pattern> : EmptyParams;
|
|
12
|
+
type RouteParamsMode<Options extends CreateRouteUrlContractOptions | undefined> = Options extends {
|
|
13
|
+
readonly params: 'parsed';
|
|
14
|
+
} ? 'parsed' : 'raw';
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SearchArrayFormat, UnknownSearchBehavior } from '../contracts.js';
|
|
2
|
+
import type { RawSearchParams } from '../search/contracts.js';
|
|
3
|
+
import type { InferStaticSearch, StaticSearchDescriptor } from '../static/contracts.js';
|
|
4
|
+
export interface ParseSearchOptions<SearchDescriptor = StaticSearchDescriptor> {
|
|
5
|
+
readonly schema?: SearchDescriptor;
|
|
6
|
+
readonly unknownSearch?: UnknownSearchBehavior;
|
|
7
|
+
readonly arrayFormat?: SearchArrayFormat;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseSearch<const SearchDescriptor extends StaticSearchDescriptor>(input: string | URLSearchParams, options: ParseSearchOptions<SearchDescriptor> & {
|
|
10
|
+
readonly schema: SearchDescriptor;
|
|
11
|
+
}): InferStaticSearch<SearchDescriptor>;
|
|
12
|
+
export declare function parseSearch(input: string | URLSearchParams, options?: ParseSearchOptions): RawSearchParams;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AnyRuntimeSchemaBuilder, InferRuntimeSchemaValue, NormalizedRuntimeSchemaDescriptor, RequiredRuntimeSchemaDescriptor, RuntimeSchemaOptions, RuntimeSchemaBuilder, RuntimeSchemaValueContext } from './contracts.js';
|
|
2
|
+
export interface ArraySchemaOptions<ElementDescriptor extends NormalizedRuntimeSchemaDescriptor = NormalizedRuntimeSchemaDescriptor> extends RuntimeSchemaOptions {
|
|
3
|
+
readonly element: ElementDescriptor;
|
|
4
|
+
}
|
|
5
|
+
export interface ArraySchema<Schema extends AnyRuntimeSchemaBuilder> extends RuntimeSchemaBuilder<readonly Exclude<InferRuntimeSchemaValue<Schema>, undefined>[], 'array', ArraySchemaOptions, RequiredRuntimeSchemaDescriptor<'array', ArraySchemaOptions>> {
|
|
6
|
+
}
|
|
7
|
+
export declare function array<Schema extends AnyRuntimeSchemaBuilder>(element: Schema): ArraySchema<Schema>;
|
|
8
|
+
export declare function parseArrayRuntimeSchemaValue<Schema extends AnyRuntimeSchemaBuilder>(schema: ArraySchema<Schema>, input: string | readonly string[], context: RuntimeSchemaValueContext): readonly Exclude<InferRuntimeSchemaValue<Schema>, undefined>[];
|
|
9
|
+
export declare function serializeArrayRuntimeSchemaValue<Schema extends AnyRuntimeSchemaBuilder>(schema: ArraySchema<Schema>, input: unknown, context: RuntimeSchemaValueContext): readonly string[] | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EmptyRuntimeSchemaOptions, RequiredRuntimeSchemaDescriptor, RuntimeSchemaBuilder } from './contracts.js';
|
|
2
|
+
export interface BooleanSchema extends RuntimeSchemaBuilder<boolean, 'boolean', EmptyRuntimeSchemaOptions, RequiredRuntimeSchemaDescriptor<'boolean', EmptyRuntimeSchemaOptions>> {
|
|
3
|
+
}
|
|
4
|
+
export declare function boolean(): BooleanSchema;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CompileRuntimeSchemaOptions, NormalizedRuntimeSchemaDescriptor, RuntimeSchemaBuilder, RuntimeSchemaCodec, RuntimeSchemaOptions } from './contracts.js';
|
|
2
|
+
export interface CompiledRuntimeSchema<Value = unknown> {
|
|
3
|
+
readonly descriptor: NormalizedRuntimeSchemaDescriptor;
|
|
4
|
+
readonly codec?: RuntimeSchemaCodec<Value>;
|
|
5
|
+
}
|
|
6
|
+
export declare function compileRuntimeSchemaValue<Value, Kind extends string, Options extends RuntimeSchemaOptions, Descriptor extends NormalizedRuntimeSchemaDescriptor<Kind, Options>>(schema: RuntimeSchemaBuilder<Value, Kind, Options, Descriptor>, options?: CompileRuntimeSchemaOptions): CompiledRuntimeSchema<Value>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { CompileRuntimeSchemaOptions, NormalizedRuntimeSchemaDescriptor, RuntimeSchemaBuilder, RuntimeSchemaOptions } from './contracts.js';
|
|
2
|
+
export declare function compileRuntimeSchema<Value, Kind extends string, Options extends RuntimeSchemaOptions, Descriptor extends NormalizedRuntimeSchemaDescriptor<Kind, Options>>(schema: RuntimeSchemaBuilder<Value, Kind, Options, Descriptor>, options?: CompileRuntimeSchemaOptions): Descriptor;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { UrlKitErrorCode } from '../errors/contracts.js';
|
|
2
|
+
import type { UrlKitError } from '../errors/url-kit-error.js';
|
|
3
|
+
export type RuntimeSchemaPresence = 'required' | 'optional' | 'defaulted';
|
|
4
|
+
export type RuntimeSchemaOptions = Readonly<Record<string, unknown>>;
|
|
5
|
+
export type EmptyRuntimeSchemaOptions = Readonly<Record<never, never>>;
|
|
6
|
+
export interface RuntimeDefaultValidationContext {
|
|
7
|
+
readonly kind: string;
|
|
8
|
+
readonly path: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export interface RuntimeSchemaValueContext {
|
|
11
|
+
readonly kind: string;
|
|
12
|
+
readonly path: readonly string[];
|
|
13
|
+
readonly errorCode: UrlKitErrorCode;
|
|
14
|
+
}
|
|
15
|
+
export interface RuntimeSchemaValueOptions {
|
|
16
|
+
readonly path?: readonly string[];
|
|
17
|
+
readonly errorCode?: UrlKitErrorCode;
|
|
18
|
+
readonly missingCode?: UrlKitErrorCode;
|
|
19
|
+
}
|
|
20
|
+
export type RuntimeDefaultValidator<Value = unknown> = (value: Value, context: RuntimeDefaultValidationContext) => void;
|
|
21
|
+
export type RuntimeDescriptorValidator = (context: RuntimeDefaultValidationContext) => void;
|
|
22
|
+
export interface RuntimeSchemaCodec<Value> {
|
|
23
|
+
readonly parse: (input: string, context: RuntimeSchemaValueContext) => Value;
|
|
24
|
+
readonly normalize: (input: unknown, context: RuntimeSchemaValueContext) => Value;
|
|
25
|
+
readonly serialize: (input: Value, context: RuntimeSchemaValueContext) => string;
|
|
26
|
+
}
|
|
27
|
+
export interface RuntimeSchemaDefinition<Kind extends string, Options extends RuntimeSchemaOptions, Value> {
|
|
28
|
+
readonly kind: Kind;
|
|
29
|
+
readonly options?: Options;
|
|
30
|
+
readonly codec?: RuntimeSchemaCodec<Value>;
|
|
31
|
+
readonly validateDefault?: RuntimeDefaultValidator<Value>;
|
|
32
|
+
readonly validateDescriptor?: RuntimeDescriptorValidator;
|
|
33
|
+
}
|
|
34
|
+
export interface BaseRuntimeSchemaDescriptor<Kind extends string, Options extends RuntimeSchemaOptions> {
|
|
35
|
+
readonly kind: Kind;
|
|
36
|
+
readonly presence: RuntimeSchemaPresence;
|
|
37
|
+
readonly options: Options;
|
|
38
|
+
}
|
|
39
|
+
export interface RequiredRuntimeSchemaDescriptor<Kind extends string = string, Options extends RuntimeSchemaOptions = RuntimeSchemaOptions> extends BaseRuntimeSchemaDescriptor<Kind, Options> {
|
|
40
|
+
readonly presence: 'required';
|
|
41
|
+
}
|
|
42
|
+
export interface OptionalRuntimeSchemaDescriptor<Kind extends string = string, Options extends RuntimeSchemaOptions = RuntimeSchemaOptions> extends BaseRuntimeSchemaDescriptor<Kind, Options> {
|
|
43
|
+
readonly presence: 'optional';
|
|
44
|
+
}
|
|
45
|
+
export interface DefaultedRuntimeSchemaDescriptor<Kind extends string = string, Options extends RuntimeSchemaOptions = RuntimeSchemaOptions, DefaultValue = unknown> extends BaseRuntimeSchemaDescriptor<Kind, Options> {
|
|
46
|
+
readonly presence: 'defaulted';
|
|
47
|
+
readonly defaultValue: DefaultValue;
|
|
48
|
+
}
|
|
49
|
+
export type NormalizedRuntimeSchemaDescriptor<Kind extends string = string, Options extends RuntimeSchemaOptions = RuntimeSchemaOptions, DefaultValue = unknown> = RequiredRuntimeSchemaDescriptor<Kind, Options> | OptionalRuntimeSchemaDescriptor<Kind, Options> | DefaultedRuntimeSchemaDescriptor<Kind, Options, DefaultValue>;
|
|
50
|
+
export interface RuntimeSchemaInternals<Value, Kind extends string, Options extends RuntimeSchemaOptions, Descriptor extends NormalizedRuntimeSchemaDescriptor<Kind, Options>> {
|
|
51
|
+
readonly kind: Kind;
|
|
52
|
+
readonly presence: Descriptor['presence'];
|
|
53
|
+
readonly options: Options;
|
|
54
|
+
readonly defaultValue?: unknown;
|
|
55
|
+
readonly codec?: RuntimeSchemaCodec<Value>;
|
|
56
|
+
readonly validateDefault?: RuntimeDefaultValidator<Value>;
|
|
57
|
+
readonly validateDescriptor?: RuntimeDescriptorValidator;
|
|
58
|
+
readonly toDescriptor: () => Descriptor;
|
|
59
|
+
}
|
|
60
|
+
declare const runtimeSchemaTypeSymbol: unique symbol;
|
|
61
|
+
export interface RuntimeSchemaBuilder<Value, Kind extends string = string, Options extends RuntimeSchemaOptions = RuntimeSchemaOptions, Descriptor extends NormalizedRuntimeSchemaDescriptor<Kind, Options> = NormalizedRuntimeSchemaDescriptor<Kind, Options>> {
|
|
62
|
+
readonly [runtimeSchemaTypeSymbol]?: {
|
|
63
|
+
readonly value: Value;
|
|
64
|
+
readonly kind: Kind;
|
|
65
|
+
readonly options: Options;
|
|
66
|
+
readonly descriptor: Descriptor;
|
|
67
|
+
};
|
|
68
|
+
readonly optional: () => RuntimeSchemaBuilder<Value | undefined, Kind, Options, OptionalRuntimeSchemaDescriptor<Kind, Options>>;
|
|
69
|
+
readonly required: () => RuntimeSchemaBuilder<NonNullable<Value>, Kind, Options, RequiredRuntimeSchemaDescriptor<Kind, Options>>;
|
|
70
|
+
readonly default: (value: NonNullable<Value>) => RuntimeSchemaBuilder<NonNullable<Value>, Kind, Options, DefaultedRuntimeSchemaDescriptor<Kind, Options, NonNullable<Value>>>;
|
|
71
|
+
}
|
|
72
|
+
export interface CompileRuntimeSchemaOptions {
|
|
73
|
+
readonly path?: readonly string[];
|
|
74
|
+
}
|
|
75
|
+
export type AnyRuntimeSchemaBuilder = RuntimeSchemaBuilder<any, any, any, any>;
|
|
76
|
+
export type InferRuntimeSchemaValue<Schema> = Schema extends RuntimeSchemaBuilder<infer Value> ? Value : never;
|
|
77
|
+
export type InferRuntimeSchemaDescriptor<Schema> = Schema extends RuntimeSchemaBuilder<any, any, any, infer Descriptor> ? Descriptor : never;
|
|
78
|
+
export interface RuntimeSchemaSafeSuccess<Value> {
|
|
79
|
+
readonly success: true;
|
|
80
|
+
readonly data: Value;
|
|
81
|
+
}
|
|
82
|
+
export interface RuntimeSchemaSafeFailure {
|
|
83
|
+
readonly success: false;
|
|
84
|
+
readonly error: UrlKitError;
|
|
85
|
+
}
|
|
86
|
+
export type RuntimeSchemaSafeResult<Value> = RuntimeSchemaSafeSuccess<Value> | RuntimeSchemaSafeFailure;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { EmptyRuntimeSchemaOptions, RequiredRuntimeSchemaDescriptor, RuntimeSchemaBuilder, RuntimeSchemaDefinition, RuntimeSchemaOptions } from './contracts.js';
|
|
2
|
+
export declare function createRuntimeSchemaBuilder<Value, const Kind extends string, Options extends RuntimeSchemaOptions = EmptyRuntimeSchemaOptions>(definition: RuntimeSchemaDefinition<Kind, Options, Value>): RuntimeSchemaBuilder<Value, Kind, Options, RequiredRuntimeSchemaDescriptor<Kind, Options>>;
|