@arkenv/standard 1.0.0-alpha.4 → 1.0.0-alpha.5
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 +3 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +439 -120
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +439 -120
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +9 -2
package/dist/index.d.cts
CHANGED
|
@@ -830,11 +830,11 @@ declare const ExactLength$1: {
|
|
|
830
830
|
//#region ../../node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/standardSchema.d.ts
|
|
831
831
|
/** From https://github.com/standard-schema/standard-schema */
|
|
832
832
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
833
|
-
interface StandardTypedV1$
|
|
833
|
+
interface StandardTypedV1$3<Input = unknown, Output = Input> {
|
|
834
834
|
/** The Standard properties. */
|
|
835
|
-
readonly "~standard": StandardTypedV1$
|
|
835
|
+
readonly "~standard": StandardTypedV1$3.Props<Input, Output>;
|
|
836
836
|
}
|
|
837
|
-
declare namespace StandardTypedV1$
|
|
837
|
+
declare namespace StandardTypedV1$3 {
|
|
838
838
|
/** The Standard Typed properties interface. */
|
|
839
839
|
interface Props<Input = unknown, Output = Input> {
|
|
840
840
|
/** The version number of the standard. */
|
|
@@ -852,20 +852,20 @@ declare namespace StandardTypedV1$2 {
|
|
|
852
852
|
readonly output: Output;
|
|
853
853
|
}
|
|
854
854
|
/** Infers the input type of a Standard Typed. */
|
|
855
|
-
type InferInput<Schema extends StandardTypedV1$
|
|
855
|
+
type InferInput<Schema extends StandardTypedV1$3> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
856
856
|
/** Infers the output type of a Standard Typed. */
|
|
857
|
-
type InferOutput<Schema extends StandardTypedV1$
|
|
857
|
+
type InferOutput<Schema extends StandardTypedV1$3> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
858
858
|
}
|
|
859
859
|
/** The Standard Schema interface. */
|
|
860
|
-
interface StandardSchemaV1$
|
|
860
|
+
interface StandardSchemaV1$3<Input = unknown, Output = Input> {
|
|
861
861
|
/** The Standard Schema properties. */
|
|
862
|
-
readonly "~standard": StandardSchemaV1$
|
|
862
|
+
readonly "~standard": StandardSchemaV1$3.Props<Input, Output>;
|
|
863
863
|
}
|
|
864
|
-
declare namespace StandardSchemaV1$
|
|
864
|
+
declare namespace StandardSchemaV1$3 {
|
|
865
865
|
/** The Standard Schema properties interface. */
|
|
866
|
-
interface Props<Input = unknown, Output = Input> extends StandardTypedV1$
|
|
866
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1$3.Props<Input, Output> {
|
|
867
867
|
/** Validates unknown input values. */
|
|
868
|
-
readonly validate: (value: unknown, options?: StandardSchemaV1$
|
|
868
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1$3.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
869
869
|
}
|
|
870
870
|
/** The result interface of the validate function. */
|
|
871
871
|
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
@@ -898,11 +898,11 @@ declare namespace StandardSchemaV1$2 {
|
|
|
898
898
|
readonly key: PropertyKey;
|
|
899
899
|
}
|
|
900
900
|
/** The Standard types interface. */
|
|
901
|
-
interface Types<Input = unknown, Output = Input> extends StandardTypedV1$
|
|
901
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1$3.Types<Input, Output> {}
|
|
902
902
|
/** Infers the input type of a Standard. */
|
|
903
|
-
type InferInput<Schema extends StandardTypedV1$
|
|
903
|
+
type InferInput<Schema extends StandardTypedV1$3> = StandardTypedV1$3.InferInput<Schema>;
|
|
904
904
|
/** Infers the output type of a Standard. */
|
|
905
|
-
type InferOutput<Schema extends StandardTypedV1$
|
|
905
|
+
type InferOutput<Schema extends StandardTypedV1$3> = StandardTypedV1$3.InferOutput<Schema>;
|
|
906
906
|
/** ArkType-specific properties that extend the standard schema with JSON Schema support. */
|
|
907
907
|
interface ArkTypeProps<Input = unknown, Output = Input> extends Props<Input, Output>, StandardJSONSchemaV1$1.Props<Input, Output> {
|
|
908
908
|
vendor: "arktype";
|
|
@@ -915,7 +915,7 @@ interface StandardJSONSchemaV1$1<Input = unknown, Output = Input> {
|
|
|
915
915
|
}
|
|
916
916
|
declare namespace StandardJSONSchemaV1$1 {
|
|
917
917
|
/** The Standard JSON Schema properties interface. */
|
|
918
|
-
interface Props<Input = unknown, Output = Input> extends StandardTypedV1$
|
|
918
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1$3.Props<Input, Output> {
|
|
919
919
|
/** Methods for generating the input/output JSON Schema. */
|
|
920
920
|
readonly jsonSchema: StandardJSONSchemaV1$1.Converter;
|
|
921
921
|
}
|
|
@@ -942,11 +942,11 @@ declare namespace StandardJSONSchemaV1$1 {
|
|
|
942
942
|
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
943
943
|
}
|
|
944
944
|
/** The Standard types interface. */
|
|
945
|
-
interface Types<Input = unknown, Output = Input> extends StandardTypedV1$
|
|
945
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1$3.Types<Input, Output> {}
|
|
946
946
|
/** Infers the input type of a Standard. */
|
|
947
|
-
type InferInput<Schema extends StandardTypedV1$
|
|
947
|
+
type InferInput<Schema extends StandardTypedV1$3> = StandardTypedV1$3.InferInput<Schema>;
|
|
948
948
|
/** Infers the output type of a Standard. */
|
|
949
|
-
type InferOutput<Schema extends StandardTypedV1$
|
|
949
|
+
type InferOutput<Schema extends StandardTypedV1$3> = StandardTypedV1$3.InferOutput<Schema>;
|
|
950
950
|
}
|
|
951
951
|
//#endregion
|
|
952
952
|
//#region ../../node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/toJsonSchema.d.ts
|
|
@@ -1164,7 +1164,7 @@ declare namespace ArkErrors$1 {
|
|
|
1164
1164
|
* Subsequent errors added at an existing path are merged into an
|
|
1165
1165
|
* ArkError intersection.
|
|
1166
1166
|
*/
|
|
1167
|
-
declare class ArkErrors$1 extends ReadonlyArray$2<ArkError$1> implements StandardSchemaV1$
|
|
1167
|
+
declare class ArkErrors$1 extends ReadonlyArray$2<ArkError$1> implements StandardSchemaV1$3.FailureResult {
|
|
1168
1168
|
readonly [arkKind$1] = "errors";
|
|
1169
1169
|
protected ctx: Traversal$1;
|
|
1170
1170
|
constructor(ctx: Traversal$1);
|
|
@@ -2002,14 +2002,14 @@ type DiscriminantKind$1 = show$1<keyof DiscriminantKinds$1>;
|
|
|
2002
2002
|
interface InternalRootDeclaration$1 extends BaseNodeDeclaration$1 {
|
|
2003
2003
|
kind: RootKind$1;
|
|
2004
2004
|
}
|
|
2005
|
-
declare abstract class BaseRoot$1< /** @ts-ignore cast variance */out d extends InternalRootDeclaration$1 = InternalRootDeclaration$1> extends BaseNode$1<d> implements StandardSchemaV1$
|
|
2005
|
+
declare abstract class BaseRoot$1< /** @ts-ignore cast variance */out d extends InternalRootDeclaration$1 = InternalRootDeclaration$1> extends BaseNode$1<d> implements StandardSchemaV1$3, StandardJSONSchemaV1$1 {
|
|
2006
2006
|
readonly [arkKind$1]: "root";
|
|
2007
2007
|
readonly [inferred$1]: unknown;
|
|
2008
2008
|
constructor(attachments: UnknownAttachments$1, $: BaseScope$1);
|
|
2009
2009
|
get rawIn(): BaseRoot$1;
|
|
2010
2010
|
get rawOut(): BaseRoot$1;
|
|
2011
2011
|
get internal(): this;
|
|
2012
|
-
get "~standard"(): StandardSchemaV1$
|
|
2012
|
+
get "~standard"(): StandardSchemaV1$3.ArkTypeProps;
|
|
2013
2013
|
as(): this;
|
|
2014
2014
|
brand(name: string): this;
|
|
2015
2015
|
readonly(): this;
|
|
@@ -4859,7 +4859,7 @@ interface Type$8<out t = unknown, $ = {}> extends Callable$1<(data: unknown) =>
|
|
|
4859
4859
|
*/
|
|
4860
4860
|
distribute<mapOut, reduceOut = mapOut[]>(mapBranch: (branch: Type$8, i: number, branches: array$1<Type$8>) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;
|
|
4861
4861
|
/** The Type's [StandardSchema](https://github.com/standard-schema/standard-schema) properties */
|
|
4862
|
-
"~standard": StandardSchemaV1$
|
|
4862
|
+
"~standard": StandardSchemaV1$3.ArkTypeProps<this["inferIn"] extends infer _ ? _ : never, this["inferOut"] extends infer _ ? _ : never>;
|
|
4863
4863
|
/** @deprecated */
|
|
4864
4864
|
apply: Function["apply"];
|
|
4865
4865
|
/** @deprecated */
|
|
@@ -5330,13 +5330,13 @@ type parseGenericScopeKey$1<name extends string, params extends string, def> = {
|
|
|
5330
5330
|
type InnerParseResult$1 = BaseRoot$1 | ParsedOptionalProperty$1 | ParsedDefaultableProperty$1;
|
|
5331
5331
|
//#endregion
|
|
5332
5332
|
//#region ../../node_modules/.pnpm/arktype@2.2.0/node_modules/arktype/out/parser/definition.d.ts
|
|
5333
|
-
type inferDefinition$1<def, $, args> = [def] extends [anyOrNever$1] ? def : def extends type$1.cast<infer t> ? ifEmptyObjectLiteral$1<def, object, t> : def extends ThunkCast$1<infer t> ? t : def extends string ? inferString$1<def, $, args> : def extends array$1 ? inferTuple$1<def, $, args> : def extends RegExp ? string : def extends StandardSchemaV1$
|
|
5334
|
-
type inferStandardSchema$1<schema extends StandardSchemaV1$
|
|
5333
|
+
type inferDefinition$1<def, $, args> = [def] extends [anyOrNever$1] ? def : def extends type$1.cast<infer t> ? ifEmptyObjectLiteral$1<def, object, t> : def extends ThunkCast$1<infer t> ? t : def extends string ? inferString$1<def, $, args> : def extends array$1 ? inferTuple$1<def, $, args> : def extends RegExp ? string : def extends StandardSchemaV1$3 ? inferStandardSchema$1<def> : def extends object ? inferObjectLiteral$1<def, $, args> : never;
|
|
5334
|
+
type inferStandardSchema$1<schema extends StandardSchemaV1$3, i = StandardSchemaV1$3.InferInput<schema>, o = StandardSchemaV1$3.InferOutput<schema>> = [i, o] extends [o, i] ? i : (In: i) => Out$1<o>;
|
|
5335
5335
|
type validateDefinition$1<def, $, args> = null extends undefined ? ErrorMessage$1<`'strict' or 'strictNullChecks' must be set to true in your tsconfig's 'compilerOptions'`> : [def] extends [anyOrNever$1] ? def : def extends OptionalPropertyDefinition$1 ? ErrorMessage$1<shallowOptionalMessage$1> : isDefaultable$1<def, $, args> extends true ? ErrorMessage$1<shallowDefaultableMessage$1> : validateInnerDefinition$1<def, $, args>;
|
|
5336
5336
|
type validateInnerDefinition$1<def, $, args> = [def] extends [TerminalObjectDefinition$1] ? def : def extends string ? validateString$1<def, $, args> : unknown extends def ? BaseCompletions$1<$, args> | {} : def extends readonly unknown[] ? validateTuple$1<def, $, args> : def extends BadDefinitionType$1 ? ErrorMessage$1<writeBadDefinitionTypeMessage$1<objectKindOrDomainOf$1<def>>> : validateObjectLiteral$1<def, $, args>;
|
|
5337
5337
|
type validateTuple$1<def extends array$1, $, args> = maybeValidateTupleExpression$1<def, $, args> extends infer result ? result extends null ? validateTupleLiteral$1<def, $, args> : result : never;
|
|
5338
5338
|
type inferTuple$1<def extends array$1, $, args> = def extends TupleExpression$1 ? inferTupleExpression$1<def, $, args> : inferTupleLiteral$1<def, $, args>;
|
|
5339
|
-
type TerminalObjectDefinition$1 = type$1.cast<unknown> | Fn$1 | RegExp | StandardSchemaV1$
|
|
5339
|
+
type TerminalObjectDefinition$1 = type$1.cast<unknown> | Fn$1 | RegExp | StandardSchemaV1$3;
|
|
5340
5340
|
type ThunkCast$1<t = unknown> = () => type$1.cast<t>;
|
|
5341
5341
|
type BadDefinitionType$1 = Exclude<Primitive$1, string>;
|
|
5342
5342
|
declare const writeBadDefinitionTypeMessage$1: <actual extends string>(actual: actual) => writeBadDefinitionTypeMessage$1<actual>;
|
|
@@ -6064,80 +6064,140 @@ l & r : r extends array$1 ? l & r : keyof l & keyof r extends never ? show$1<l &
|
|
|
6064
6064
|
* Copied from standard-schema (MIT License)
|
|
6065
6065
|
* Copyright (c) 2024 Colin McDannell
|
|
6066
6066
|
*/
|
|
6067
|
-
/**
|
|
6068
|
-
interface
|
|
6069
|
-
|
|
6070
|
-
|
|
6067
|
+
/**
|
|
6068
|
+
* The Standard Typed interface. This is a base type extended by other specs.
|
|
6069
|
+
*/
|
|
6070
|
+
interface StandardTypedV1$2<Input = unknown, Output = Input> {
|
|
6071
|
+
/**
|
|
6072
|
+
* The Standard properties.
|
|
6073
|
+
*/
|
|
6074
|
+
readonly "~standard": StandardTypedV1$2.Props<Input, Output>;
|
|
6071
6075
|
}
|
|
6072
|
-
declare namespace StandardTypedV1$
|
|
6073
|
-
/**
|
|
6076
|
+
declare namespace StandardTypedV1$2 {
|
|
6077
|
+
/**
|
|
6078
|
+
* The Standard Typed properties interface.
|
|
6079
|
+
*/
|
|
6074
6080
|
interface Props<Input = unknown, Output = Input> {
|
|
6075
|
-
/**
|
|
6081
|
+
/**
|
|
6082
|
+
* The version number of the standard.
|
|
6083
|
+
*/
|
|
6076
6084
|
readonly version: 1;
|
|
6077
|
-
/**
|
|
6085
|
+
/**
|
|
6086
|
+
* The vendor name of the schema library.
|
|
6087
|
+
*/
|
|
6078
6088
|
readonly vendor: string;
|
|
6079
|
-
/**
|
|
6089
|
+
/**
|
|
6090
|
+
* Inferred types associated with the schema.
|
|
6091
|
+
*/
|
|
6080
6092
|
readonly types?: Types<Input, Output> | undefined;
|
|
6081
6093
|
}
|
|
6082
|
-
/**
|
|
6094
|
+
/**
|
|
6095
|
+
* The Standard Typed types interface.
|
|
6096
|
+
*/
|
|
6083
6097
|
interface Types<Input = unknown, Output = Input> {
|
|
6084
|
-
/**
|
|
6098
|
+
/**
|
|
6099
|
+
* The input type of the schema.
|
|
6100
|
+
*/
|
|
6085
6101
|
readonly input: Input;
|
|
6086
|
-
/**
|
|
6102
|
+
/**
|
|
6103
|
+
* The output type of the schema.
|
|
6104
|
+
*/
|
|
6087
6105
|
readonly output: Output;
|
|
6088
6106
|
}
|
|
6089
|
-
/**
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
type
|
|
6107
|
+
/**
|
|
6108
|
+
* Infers the input type of a Standard Typed.
|
|
6109
|
+
*/
|
|
6110
|
+
type InferInput<Schema extends StandardTypedV1$2> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
6111
|
+
/**
|
|
6112
|
+
* Infers the output type of a Standard Typed.
|
|
6113
|
+
*/
|
|
6114
|
+
type InferOutput<Schema extends StandardTypedV1$2> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
6093
6115
|
}
|
|
6094
|
-
/**
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6116
|
+
/**
|
|
6117
|
+
* The Standard Schema interface.
|
|
6118
|
+
*/
|
|
6119
|
+
interface StandardSchemaV1$2<Input = unknown, Output = Input> {
|
|
6120
|
+
/**
|
|
6121
|
+
* The Standard Schema properties.
|
|
6122
|
+
*/
|
|
6123
|
+
readonly "~standard": StandardSchemaV1$2.Props<Input, Output>;
|
|
6098
6124
|
}
|
|
6099
|
-
declare namespace StandardSchemaV1$
|
|
6100
|
-
/**
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6125
|
+
declare namespace StandardSchemaV1$2 {
|
|
6126
|
+
/**
|
|
6127
|
+
* The Standard Schema properties interface.
|
|
6128
|
+
*/
|
|
6129
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1$2.Props<Input, Output> {
|
|
6130
|
+
/**
|
|
6131
|
+
* Validates unknown input values.
|
|
6132
|
+
*/
|
|
6133
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1$2.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
6104
6134
|
}
|
|
6105
|
-
/**
|
|
6135
|
+
/**
|
|
6136
|
+
* The result interface of the validate function.
|
|
6137
|
+
*/
|
|
6106
6138
|
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
6107
|
-
/**
|
|
6139
|
+
/**
|
|
6140
|
+
* The result interface if validation succeeds.
|
|
6141
|
+
*/
|
|
6108
6142
|
interface SuccessResult<Output> {
|
|
6109
|
-
/**
|
|
6143
|
+
/**
|
|
6144
|
+
* The typed output value.
|
|
6145
|
+
*/
|
|
6110
6146
|
readonly value: Output;
|
|
6111
|
-
/**
|
|
6147
|
+
/**
|
|
6148
|
+
* A falsy value for `issues` indicates success.
|
|
6149
|
+
*/
|
|
6112
6150
|
readonly issues?: undefined;
|
|
6113
6151
|
}
|
|
6114
6152
|
interface Options {
|
|
6115
|
-
/**
|
|
6153
|
+
/**
|
|
6154
|
+
* Explicit support for additional vendor-specific parameters, if needed.
|
|
6155
|
+
*/
|
|
6116
6156
|
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
6117
6157
|
}
|
|
6118
|
-
/**
|
|
6158
|
+
/**
|
|
6159
|
+
* The result interface if validation fails.
|
|
6160
|
+
*/
|
|
6119
6161
|
interface FailureResult {
|
|
6120
|
-
/**
|
|
6162
|
+
/**
|
|
6163
|
+
* The issues of failed validation.
|
|
6164
|
+
*/
|
|
6121
6165
|
readonly issues: ReadonlyArray<Issue>;
|
|
6122
6166
|
}
|
|
6123
|
-
/**
|
|
6167
|
+
/**
|
|
6168
|
+
* The issue interface of the failure output.
|
|
6169
|
+
*/
|
|
6124
6170
|
interface Issue {
|
|
6125
|
-
/**
|
|
6171
|
+
/**
|
|
6172
|
+
* The error message of the issue.
|
|
6173
|
+
*/
|
|
6126
6174
|
readonly message: string;
|
|
6127
|
-
/**
|
|
6175
|
+
/**
|
|
6176
|
+
* The path of the issue, if any.
|
|
6177
|
+
*/
|
|
6128
6178
|
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
6129
6179
|
}
|
|
6130
|
-
/**
|
|
6180
|
+
/**
|
|
6181
|
+
* The path segment interface of the issue.
|
|
6182
|
+
*/
|
|
6131
6183
|
interface PathSegment {
|
|
6132
|
-
/**
|
|
6184
|
+
/**
|
|
6185
|
+
* The key representing a path segment.
|
|
6186
|
+
*/
|
|
6133
6187
|
readonly key: PropertyKey;
|
|
6134
6188
|
}
|
|
6135
|
-
/**
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
/**
|
|
6140
|
-
|
|
6189
|
+
/**
|
|
6190
|
+
* The Standard types interface.
|
|
6191
|
+
*/
|
|
6192
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1$2.Types<Input, Output> {}
|
|
6193
|
+
/**
|
|
6194
|
+
* Infers the input type of a Standard.
|
|
6195
|
+
*/
|
|
6196
|
+
type InferInput<Schema extends StandardTypedV1$2> = StandardTypedV1$2.InferInput<Schema>;
|
|
6197
|
+
/**
|
|
6198
|
+
* Infers the output type of a Standard.
|
|
6199
|
+
*/
|
|
6200
|
+
type InferOutput<Schema extends StandardTypedV1$2> = StandardTypedV1$2.InferOutput<Schema>;
|
|
6141
6201
|
}
|
|
6142
6202
|
//#endregion
|
|
6143
6203
|
//#region ../internal/utils/dist/index.d.ts
|
|
@@ -6948,11 +7008,11 @@ declare const ExactLength: {
|
|
|
6948
7008
|
//#region ../../../node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/standardSchema.d.ts
|
|
6949
7009
|
/** From https://github.com/standard-schema/standard-schema */
|
|
6950
7010
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
6951
|
-
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
7011
|
+
interface StandardTypedV1$1<Input = unknown, Output = Input> {
|
|
6952
7012
|
/** The Standard properties. */
|
|
6953
|
-
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
7013
|
+
readonly "~standard": StandardTypedV1$1.Props<Input, Output>;
|
|
6954
7014
|
}
|
|
6955
|
-
declare namespace StandardTypedV1 {
|
|
7015
|
+
declare namespace StandardTypedV1$1 {
|
|
6956
7016
|
/** The Standard Typed properties interface. */
|
|
6957
7017
|
interface Props<Input = unknown, Output = Input> {
|
|
6958
7018
|
/** The version number of the standard. */
|
|
@@ -6970,20 +7030,20 @@ declare namespace StandardTypedV1 {
|
|
|
6970
7030
|
readonly output: Output;
|
|
6971
7031
|
}
|
|
6972
7032
|
/** Infers the input type of a Standard Typed. */
|
|
6973
|
-
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
7033
|
+
type InferInput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
6974
7034
|
/** Infers the output type of a Standard Typed. */
|
|
6975
|
-
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
7035
|
+
type InferOutput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
6976
7036
|
}
|
|
6977
7037
|
/** The Standard Schema interface. */
|
|
6978
|
-
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
7038
|
+
interface StandardSchemaV1$1<Input = unknown, Output = Input> {
|
|
6979
7039
|
/** The Standard Schema properties. */
|
|
6980
|
-
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
7040
|
+
readonly "~standard": StandardSchemaV1$1.Props<Input, Output>;
|
|
6981
7041
|
}
|
|
6982
|
-
declare namespace StandardSchemaV1 {
|
|
7042
|
+
declare namespace StandardSchemaV1$1 {
|
|
6983
7043
|
/** The Standard Schema properties interface. */
|
|
6984
|
-
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
7044
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1$1.Props<Input, Output> {
|
|
6985
7045
|
/** Validates unknown input values. */
|
|
6986
|
-
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
7046
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1$1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
6987
7047
|
}
|
|
6988
7048
|
/** The result interface of the validate function. */
|
|
6989
7049
|
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
@@ -7016,11 +7076,11 @@ declare namespace StandardSchemaV1 {
|
|
|
7016
7076
|
readonly key: PropertyKey;
|
|
7017
7077
|
}
|
|
7018
7078
|
/** The Standard types interface. */
|
|
7019
|
-
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
7079
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1$1.Types<Input, Output> {}
|
|
7020
7080
|
/** Infers the input type of a Standard. */
|
|
7021
|
-
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
7081
|
+
type InferInput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferInput<Schema>;
|
|
7022
7082
|
/** Infers the output type of a Standard. */
|
|
7023
|
-
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
7083
|
+
type InferOutput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferOutput<Schema>;
|
|
7024
7084
|
/** ArkType-specific properties that extend the standard schema with JSON Schema support. */
|
|
7025
7085
|
interface ArkTypeProps<Input = unknown, Output = Input> extends Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {
|
|
7026
7086
|
vendor: "arktype";
|
|
@@ -7033,7 +7093,7 @@ interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
|
7033
7093
|
}
|
|
7034
7094
|
declare namespace StandardJSONSchemaV1 {
|
|
7035
7095
|
/** The Standard JSON Schema properties interface. */
|
|
7036
|
-
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
7096
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1$1.Props<Input, Output> {
|
|
7037
7097
|
/** Methods for generating the input/output JSON Schema. */
|
|
7038
7098
|
readonly jsonSchema: StandardJSONSchemaV1.Converter;
|
|
7039
7099
|
}
|
|
@@ -7060,11 +7120,11 @@ declare namespace StandardJSONSchemaV1 {
|
|
|
7060
7120
|
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
7061
7121
|
}
|
|
7062
7122
|
/** The Standard types interface. */
|
|
7063
|
-
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
7123
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1$1.Types<Input, Output> {}
|
|
7064
7124
|
/** Infers the input type of a Standard. */
|
|
7065
|
-
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
7125
|
+
type InferInput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferInput<Schema>;
|
|
7066
7126
|
/** Infers the output type of a Standard. */
|
|
7067
|
-
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
7127
|
+
type InferOutput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferOutput<Schema>;
|
|
7068
7128
|
} //#endregion
|
|
7069
7129
|
//#region ../../../node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/toJsonSchema.d.ts
|
|
7070
7130
|
declare class ToJsonSchemaError<code extends ToJsonSchema.Code = ToJsonSchema.Code> extends Error {
|
|
@@ -7278,7 +7338,7 @@ declare namespace ArkErrors {
|
|
|
7278
7338
|
* Subsequent errors added at an existing path are merged into an
|
|
7279
7339
|
* ArkError intersection.
|
|
7280
7340
|
*/
|
|
7281
|
-
declare class ArkErrors extends ReadonlyArray$1<ArkError> implements StandardSchemaV1.FailureResult {
|
|
7341
|
+
declare class ArkErrors extends ReadonlyArray$1<ArkError> implements StandardSchemaV1$1.FailureResult {
|
|
7282
7342
|
readonly [arkKind] = "errors";
|
|
7283
7343
|
protected ctx: Traversal;
|
|
7284
7344
|
constructor(ctx: Traversal);
|
|
@@ -8098,14 +8158,14 @@ type DiscriminantKind = show<keyof DiscriminantKinds>; //#endregion
|
|
|
8098
8158
|
interface InternalRootDeclaration extends BaseNodeDeclaration {
|
|
8099
8159
|
kind: RootKind;
|
|
8100
8160
|
}
|
|
8101
|
-
declare abstract class BaseRoot< /** @ts-ignore cast variance */out d extends InternalRootDeclaration = InternalRootDeclaration> extends BaseNode<d> implements StandardSchemaV1, StandardJSONSchemaV1 {
|
|
8161
|
+
declare abstract class BaseRoot< /** @ts-ignore cast variance */out d extends InternalRootDeclaration = InternalRootDeclaration> extends BaseNode<d> implements StandardSchemaV1$1, StandardJSONSchemaV1 {
|
|
8102
8162
|
readonly [arkKind]: "root";
|
|
8103
8163
|
readonly [inferred]: unknown;
|
|
8104
8164
|
constructor(attachments: UnknownAttachments, $: BaseScope);
|
|
8105
8165
|
get rawIn(): BaseRoot;
|
|
8106
8166
|
get rawOut(): BaseRoot;
|
|
8107
8167
|
get internal(): this;
|
|
8108
|
-
get "~standard"(): StandardSchemaV1.ArkTypeProps;
|
|
8168
|
+
get "~standard"(): StandardSchemaV1$1.ArkTypeProps;
|
|
8109
8169
|
as(): this;
|
|
8110
8170
|
brand(name: string): this;
|
|
8111
8171
|
readonly(): this;
|
|
@@ -10894,7 +10954,7 @@ interface Type$1<out t = unknown, $ = {}> extends Callable<(data: unknown) => di
|
|
|
10894
10954
|
*/
|
|
10895
10955
|
distribute<mapOut, reduceOut = mapOut[]>(mapBranch: (branch: Type$1, i: number, branches: array<Type$1>) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;
|
|
10896
10956
|
/** The Type's [StandardSchema](https://github.com/standard-schema/standard-schema) properties */
|
|
10897
|
-
"~standard": StandardSchemaV1.ArkTypeProps<this["inferIn"] extends infer _ ? _ : never, this["inferOut"] extends infer _ ? _ : never>;
|
|
10957
|
+
"~standard": StandardSchemaV1$1.ArkTypeProps<this["inferIn"] extends infer _ ? _ : never, this["inferOut"] extends infer _ ? _ : never>;
|
|
10898
10958
|
/** @deprecated */
|
|
10899
10959
|
apply: Function["apply"];
|
|
10900
10960
|
/** @deprecated */
|
|
@@ -11359,13 +11419,13 @@ type parseGenericScopeKey<name extends string, params extends string, def> = {
|
|
|
11359
11419
|
};
|
|
11360
11420
|
type InnerParseResult = BaseRoot | ParsedOptionalProperty | ParsedDefaultableProperty; //#endregion
|
|
11361
11421
|
//#region ../../../node_modules/.pnpm/arktype@2.2.0/node_modules/arktype/out/parser/definition.d.ts
|
|
11362
|
-
type inferDefinition<def, $, args> = [def] extends [anyOrNever] ? def : def extends type.cast<infer t> ? ifEmptyObjectLiteral<def, object, t> : def extends ThunkCast<infer t> ? t : def extends string ? inferString<def, $, args> : def extends array ? inferTuple<def, $, args> : def extends RegExp ? string : def extends StandardSchemaV1 ? inferStandardSchema<def> : def extends object ? inferObjectLiteral<def, $, args> : never;
|
|
11363
|
-
type inferStandardSchema<schema extends StandardSchemaV1, i = StandardSchemaV1.InferInput<schema>, o = StandardSchemaV1.InferOutput<schema>> = [i, o] extends [o, i] ? i : (In: i) => Out<o>;
|
|
11422
|
+
type inferDefinition<def, $, args> = [def] extends [anyOrNever] ? def : def extends type.cast<infer t> ? ifEmptyObjectLiteral<def, object, t> : def extends ThunkCast<infer t> ? t : def extends string ? inferString<def, $, args> : def extends array ? inferTuple<def, $, args> : def extends RegExp ? string : def extends StandardSchemaV1$1 ? inferStandardSchema<def> : def extends object ? inferObjectLiteral<def, $, args> : never;
|
|
11423
|
+
type inferStandardSchema<schema extends StandardSchemaV1$1, i = StandardSchemaV1$1.InferInput<schema>, o = StandardSchemaV1$1.InferOutput<schema>> = [i, o] extends [o, i] ? i : (In: i) => Out<o>;
|
|
11364
11424
|
type validateDefinition<def, $, args> = null extends undefined ? ErrorMessage<`'strict' or 'strictNullChecks' must be set to true in your tsconfig's 'compilerOptions'`> : [def] extends [anyOrNever] ? def : def extends OptionalPropertyDefinition ? ErrorMessage<shallowOptionalMessage> : isDefaultable<def, $, args> extends true ? ErrorMessage<shallowDefaultableMessage> : validateInnerDefinition<def, $, args>;
|
|
11365
11425
|
type validateInnerDefinition<def, $, args> = [def] extends [TerminalObjectDefinition] ? def : def extends string ? validateString<def, $, args> : unknown extends def ? BaseCompletions<$, args> | {} : def extends readonly unknown[] ? validateTuple<def, $, args> : def extends BadDefinitionType ? ErrorMessage<writeBadDefinitionTypeMessage<objectKindOrDomainOf<def>>> : validateObjectLiteral<def, $, args>;
|
|
11366
11426
|
type validateTuple<def extends array, $, args> = maybeValidateTupleExpression<def, $, args> extends infer result ? result extends null ? validateTupleLiteral<def, $, args> : result : never;
|
|
11367
11427
|
type inferTuple<def extends array, $, args> = def extends TupleExpression ? inferTupleExpression<def, $, args> : inferTupleLiteral<def, $, args>;
|
|
11368
|
-
type TerminalObjectDefinition = type.cast<unknown> | Fn | RegExp | StandardSchemaV1;
|
|
11428
|
+
type TerminalObjectDefinition = type.cast<unknown> | Fn | RegExp | StandardSchemaV1$1;
|
|
11369
11429
|
type ThunkCast<t = unknown> = () => type.cast<t>;
|
|
11370
11430
|
type BadDefinitionType = Exclude<Primitive, string>;
|
|
11371
11431
|
declare const writeBadDefinitionTypeMessage: <actual extends string>(actual: actual) => writeBadDefinitionTypeMessage<actual>;
|
|
@@ -12072,6 +12132,148 @@ interface MorphableIntersection<piped extends boolean> extends Hkt<[unknown, unk
|
|
|
12072
12132
|
}
|
|
12073
12133
|
type intersectObjects<l, r, piped extends boolean> = l extends array ? r extends array ? intersectArrays<l, r, MorphableIntersection<piped>> : // for an intersection with exactly one array operand like { name: string } & string[],
|
|
12074
12134
|
l & r : r extends array ? l & r : keyof l & keyof r extends never ? show<l & r> : show<{ [k in keyof l]: k extends keyof r ? _inferIntersection<l[k], r[k], piped> : l[k] } & { [k in keyof r]: k extends keyof l ? _inferIntersection<l[k], r[k], piped> : r[k] }>; //#endregion
|
|
12135
|
+
//#region ../types/dist/standard-schema.d.ts
|
|
12136
|
+
/**
|
|
12137
|
+
* @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
|
|
12138
|
+
*
|
|
12139
|
+
* Copied from standard-schema (MIT License)
|
|
12140
|
+
* Copyright (c) 2024 Colin McDannell
|
|
12141
|
+
*/
|
|
12142
|
+
/**
|
|
12143
|
+
* The Standard Typed interface. This is a base type extended by other specs.
|
|
12144
|
+
*/
|
|
12145
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
12146
|
+
/**
|
|
12147
|
+
* The Standard properties.
|
|
12148
|
+
*/
|
|
12149
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
12150
|
+
}
|
|
12151
|
+
declare namespace StandardTypedV1 {
|
|
12152
|
+
/**
|
|
12153
|
+
* The Standard Typed properties interface.
|
|
12154
|
+
*/
|
|
12155
|
+
interface Props<Input = unknown, Output = Input> {
|
|
12156
|
+
/**
|
|
12157
|
+
* The version number of the standard.
|
|
12158
|
+
*/
|
|
12159
|
+
readonly version: 1;
|
|
12160
|
+
/**
|
|
12161
|
+
* The vendor name of the schema library.
|
|
12162
|
+
*/
|
|
12163
|
+
readonly vendor: string;
|
|
12164
|
+
/**
|
|
12165
|
+
* Inferred types associated with the schema.
|
|
12166
|
+
*/
|
|
12167
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
12168
|
+
}
|
|
12169
|
+
/**
|
|
12170
|
+
* The Standard Typed types interface.
|
|
12171
|
+
*/
|
|
12172
|
+
interface Types<Input = unknown, Output = Input> {
|
|
12173
|
+
/**
|
|
12174
|
+
* The input type of the schema.
|
|
12175
|
+
*/
|
|
12176
|
+
readonly input: Input;
|
|
12177
|
+
/**
|
|
12178
|
+
* The output type of the schema.
|
|
12179
|
+
*/
|
|
12180
|
+
readonly output: Output;
|
|
12181
|
+
}
|
|
12182
|
+
/**
|
|
12183
|
+
* Infers the input type of a Standard Typed.
|
|
12184
|
+
*/
|
|
12185
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
12186
|
+
/**
|
|
12187
|
+
* Infers the output type of a Standard Typed.
|
|
12188
|
+
*/
|
|
12189
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
12190
|
+
}
|
|
12191
|
+
/**
|
|
12192
|
+
* The Standard Schema interface.
|
|
12193
|
+
*/
|
|
12194
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
12195
|
+
/**
|
|
12196
|
+
* The Standard Schema properties.
|
|
12197
|
+
*/
|
|
12198
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
12199
|
+
}
|
|
12200
|
+
declare namespace StandardSchemaV1 {
|
|
12201
|
+
/**
|
|
12202
|
+
* The Standard Schema properties interface.
|
|
12203
|
+
*/
|
|
12204
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
12205
|
+
/**
|
|
12206
|
+
* Validates unknown input values.
|
|
12207
|
+
*/
|
|
12208
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
12209
|
+
}
|
|
12210
|
+
/**
|
|
12211
|
+
* The result interface of the validate function.
|
|
12212
|
+
*/
|
|
12213
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
12214
|
+
/**
|
|
12215
|
+
* The result interface if validation succeeds.
|
|
12216
|
+
*/
|
|
12217
|
+
interface SuccessResult<Output> {
|
|
12218
|
+
/**
|
|
12219
|
+
* The typed output value.
|
|
12220
|
+
*/
|
|
12221
|
+
readonly value: Output;
|
|
12222
|
+
/**
|
|
12223
|
+
* A falsy value for `issues` indicates success.
|
|
12224
|
+
*/
|
|
12225
|
+
readonly issues?: undefined;
|
|
12226
|
+
}
|
|
12227
|
+
interface Options {
|
|
12228
|
+
/**
|
|
12229
|
+
* Explicit support for additional vendor-specific parameters, if needed.
|
|
12230
|
+
*/
|
|
12231
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
12232
|
+
}
|
|
12233
|
+
/**
|
|
12234
|
+
* The result interface if validation fails.
|
|
12235
|
+
*/
|
|
12236
|
+
interface FailureResult {
|
|
12237
|
+
/**
|
|
12238
|
+
* The issues of failed validation.
|
|
12239
|
+
*/
|
|
12240
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
12241
|
+
}
|
|
12242
|
+
/**
|
|
12243
|
+
* The issue interface of the failure output.
|
|
12244
|
+
*/
|
|
12245
|
+
interface Issue {
|
|
12246
|
+
/**
|
|
12247
|
+
* The error message of the issue.
|
|
12248
|
+
*/
|
|
12249
|
+
readonly message: string;
|
|
12250
|
+
/**
|
|
12251
|
+
* The path of the issue, if any.
|
|
12252
|
+
*/
|
|
12253
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
12254
|
+
}
|
|
12255
|
+
/**
|
|
12256
|
+
* The path segment interface of the issue.
|
|
12257
|
+
*/
|
|
12258
|
+
interface PathSegment {
|
|
12259
|
+
/**
|
|
12260
|
+
* The key representing a path segment.
|
|
12261
|
+
*/
|
|
12262
|
+
readonly key: PropertyKey;
|
|
12263
|
+
}
|
|
12264
|
+
/**
|
|
12265
|
+
* The Standard types interface.
|
|
12266
|
+
*/
|
|
12267
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
12268
|
+
/**
|
|
12269
|
+
* Infers the input type of a Standard.
|
|
12270
|
+
*/
|
|
12271
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
12272
|
+
/**
|
|
12273
|
+
* Infers the output type of a Standard.
|
|
12274
|
+
*/
|
|
12275
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
12276
|
+
} //#endregion
|
|
12075
12277
|
//#region src/coercion/environment.d.ts
|
|
12076
12278
|
/**
|
|
12077
12279
|
* Prepare an environment record by optionally stripping empty strings and applying coercion.
|
|
@@ -12087,28 +12289,96 @@ l & r : r extends array ? l & r : keyof l & keyof r extends never ? show<l & r>
|
|
|
12087
12289
|
//#region src/core.d.ts
|
|
12088
12290
|
/**
|
|
12089
12291
|
* Machine-readable classification codes for environment validation issues.
|
|
12090
|
-
* Serves as the Source of Truth (SoT) for error categorization in ArkEnv.
|
|
12091
12292
|
*/
|
|
12092
|
-
type EnvIssueCode =
|
|
12293
|
+
type EnvIssueCode =
|
|
12294
|
+
/**
|
|
12295
|
+
* The environment variable is required but was not provided, and has no default value.
|
|
12296
|
+
*/
|
|
12297
|
+
"MISSING_VARIABLE"
|
|
12298
|
+
/**
|
|
12299
|
+
* The variable value failed a type assertion (e.g., expected a number or boolean but received a string).
|
|
12300
|
+
*/
|
|
12301
|
+
| "INVALID_TYPE"
|
|
12302
|
+
/**
|
|
12303
|
+
* The variable value falls below the minimum allowed numeric limit or string/array length constraint.
|
|
12304
|
+
*/
|
|
12305
|
+
| "VALUE_TOO_SMALL"
|
|
12306
|
+
/**
|
|
12307
|
+
* The variable value exceeds the maximum allowed numeric limit or string/array length constraint.
|
|
12308
|
+
*/
|
|
12309
|
+
| "VALUE_TOO_LARGE"
|
|
12310
|
+
/**
|
|
12311
|
+
* The variable value did not match the specified regular expression (regex) pattern constraint.
|
|
12312
|
+
*/
|
|
12313
|
+
| "PATTERN_MISMATCH"
|
|
12314
|
+
/**
|
|
12315
|
+
* The variable value is not in a valid format (e.g., failed email or UUID format validation).
|
|
12316
|
+
*/
|
|
12317
|
+
| "INVALID_FORMAT"
|
|
12318
|
+
/**
|
|
12319
|
+
* An undeclared key was found in the environment, and the schema config is set to reject undeclared keys.
|
|
12320
|
+
*/
|
|
12321
|
+
| "UNDECLARED_KEY"
|
|
12322
|
+
/**
|
|
12323
|
+
* The provided validation schema definition itself is malformed or invalid.
|
|
12324
|
+
*/
|
|
12325
|
+
| "INVALID_SCHEMA"
|
|
12326
|
+
/**
|
|
12327
|
+
* A validation error was triggered by a custom validator function or inline pipe logic.
|
|
12328
|
+
*/
|
|
12329
|
+
| "CUSTOM";
|
|
12093
12330
|
/**
|
|
12094
12331
|
* Metadata associated with an environment validation issue.
|
|
12095
12332
|
*/
|
|
12096
12333
|
type EnvIssueMeta = {
|
|
12097
|
-
/**
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12334
|
+
/**
|
|
12335
|
+
* The minimum expected boundary for numeric/string length constraints
|
|
12336
|
+
*/
|
|
12337
|
+
min?: number;
|
|
12338
|
+
/**
|
|
12339
|
+
* The maximum expected boundary for numeric/string length constraints
|
|
12340
|
+
*/
|
|
12341
|
+
max?: number;
|
|
12342
|
+
/**
|
|
12343
|
+
* Additional validation pattern/specifier details
|
|
12344
|
+
*/
|
|
12345
|
+
validation?: string;
|
|
12346
|
+
/**
|
|
12347
|
+
* Any custom constraint descriptions
|
|
12348
|
+
*/
|
|
12349
|
+
constraint?: string;
|
|
12350
|
+
/**
|
|
12351
|
+
* Traversal error occurred during JSON-parsing of the environment variable
|
|
12352
|
+
*/
|
|
12101
12353
|
traversalError?: string;
|
|
12102
12354
|
};
|
|
12103
12355
|
/**
|
|
12104
12356
|
* Normalized validation issue representing a failure on a specific environment variable.
|
|
12105
12357
|
*/
|
|
12106
12358
|
type EnvIssue = {
|
|
12107
|
-
/**
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12359
|
+
/**
|
|
12360
|
+
* The dot-separated property path/name of the environment variable
|
|
12361
|
+
*/
|
|
12362
|
+
path: string;
|
|
12363
|
+
/**
|
|
12364
|
+
* The descriptive, user-friendly error message
|
|
12365
|
+
*/
|
|
12366
|
+
message: string;
|
|
12367
|
+
/**
|
|
12368
|
+
* The normalized classification code for the issue
|
|
12369
|
+
*/
|
|
12370
|
+
code: EnvIssueCode;
|
|
12371
|
+
/**
|
|
12372
|
+
* The expected type or value shape description
|
|
12373
|
+
*/
|
|
12374
|
+
expected?: string;
|
|
12375
|
+
/**
|
|
12376
|
+
* The raw value received (redacted in string formatting if sensitive)
|
|
12377
|
+
*/
|
|
12378
|
+
received?: unknown;
|
|
12379
|
+
/**
|
|
12380
|
+
* Additional validation metadata
|
|
12381
|
+
*/
|
|
12112
12382
|
meta?: EnvIssueMeta;
|
|
12113
12383
|
};
|
|
12114
12384
|
/**
|
|
@@ -12126,9 +12396,6 @@ declare function formatIssues(issues: EnvIssue[]): string;
|
|
|
12126
12396
|
*
|
|
12127
12397
|
* @example
|
|
12128
12398
|
* ```ts
|
|
12129
|
-
* import arkenv from 'arkenv';
|
|
12130
|
-
* import { ArkEnvError } from 'arkenv/core';
|
|
12131
|
-
*
|
|
12132
12399
|
* try {
|
|
12133
12400
|
* const env = arkenv({
|
|
12134
12401
|
* PORT: 'number.port',
|
|
@@ -12142,7 +12409,9 @@ declare function formatIssues(issues: EnvIssue[]): string;
|
|
|
12142
12409
|
* ```
|
|
12143
12410
|
*/
|
|
12144
12411
|
declare class ArkEnvError extends Error {
|
|
12145
|
-
/**
|
|
12412
|
+
/**
|
|
12413
|
+
* The list of normalized issues that caused the validation failure
|
|
12414
|
+
*/
|
|
12146
12415
|
readonly issues: EnvIssue[];
|
|
12147
12416
|
constructor(issues: EnvIssue[], message?: string);
|
|
12148
12417
|
}
|
|
@@ -12176,10 +12445,9 @@ type ParseStandardConfig = {
|
|
|
12176
12445
|
/**
|
|
12177
12446
|
* Control how ArkEnv handles environment variables that are not defined in your schema.
|
|
12178
12447
|
*
|
|
12179
|
-
* Defaults to `'delete'`
|
|
12180
|
-
* keys you've explicitly declared.
|
|
12448
|
+
* Defaults to `'delete'` so the output object only contains keys you've declared.
|
|
12181
12449
|
*
|
|
12182
|
-
* - `delete` (
|
|
12450
|
+
* - `delete` (default): Undeclared keys are allowed on input but stripped from the output.
|
|
12183
12451
|
* - `ignore`: Undeclared keys are allowed and preserved in the output.
|
|
12184
12452
|
* - `reject`: Undeclared keys will cause validation to fail.
|
|
12185
12453
|
*
|
|
@@ -12193,13 +12461,67 @@ type ParseStandardConfig = {
|
|
|
12193
12461
|
debugSecrets?: boolean;
|
|
12194
12462
|
/**
|
|
12195
12463
|
* Whether to perform best-effort coercion on the environment variables.
|
|
12196
|
-
* Coercion
|
|
12197
|
-
* (e.g. Zod
|
|
12464
|
+
* Coercion prefers validators that expose Standard JSON Schema on the value
|
|
12465
|
+
* itself (e.g. Zod). For converters that live outside the schema (e.g. Valibot
|
|
12466
|
+
* via `@valibot/to-json-schema`, Zod Mini via `z.toJSONSchema`, or Zod v3 via
|
|
12467
|
+
* `zod-to-json-schema`), pass {@link toJsonSchema}.
|
|
12198
12468
|
*
|
|
12199
12469
|
* @see https://standard-schema.dev
|
|
12200
12470
|
* @default true
|
|
12201
12471
|
*/
|
|
12202
12472
|
coerce?: boolean;
|
|
12473
|
+
/**
|
|
12474
|
+
* Optional fallback that converts a Standard Schema validator to JSON Schema
|
|
12475
|
+
* for ArkEnv pre-coercion when a key has no Standard JSON Schema on the value.
|
|
12476
|
+
*
|
|
12477
|
+
* Called per key only in that case. Not called when omitted, when `coerce` is
|
|
12478
|
+
* `false`, or when JSON Schema was already read from the value.
|
|
12479
|
+
*
|
|
12480
|
+
* - Return a plain object to use as that key's JSON Schema.
|
|
12481
|
+
* - Return `undefined` to skip coercion for that key only.
|
|
12482
|
+
* - Throwing or returning a non-plain object fails the parse with
|
|
12483
|
+
* {@link ArkEnvError} for that key (`INVALID_SCHEMA`).
|
|
12484
|
+
*
|
|
12485
|
+
* Typed as {@link StandardSchemaV1}. Host converters (Valibot, Zod Mini,
|
|
12486
|
+
* Zod v3 via `zod-to-json-schema`) do not accept that type — assert at the
|
|
12487
|
+
* converter call (`as v.GenericSchema`, `as z.ZodMiniType`,
|
|
12488
|
+
* `as z.ZodTypeAny`). Same assertion for a single-library map and a hybrid
|
|
12489
|
+
* with classic Zod (Zod never reaches this callback at runtime).
|
|
12490
|
+
*
|
|
12491
|
+
* @example Valibot wiring
|
|
12492
|
+
* ```ts
|
|
12493
|
+
* import { toJsonSchema } from "@valibot/to-json-schema";
|
|
12494
|
+
* import * as v from "valibot";
|
|
12495
|
+
*
|
|
12496
|
+
* arkenv(
|
|
12497
|
+
* { PORT: v.number() },
|
|
12498
|
+
* {
|
|
12499
|
+
* toJsonSchema: (schema) =>
|
|
12500
|
+
* toJsonSchema(schema as v.GenericSchema, {
|
|
12501
|
+
* typeMode: "input",
|
|
12502
|
+
* target: "draft-07",
|
|
12503
|
+
* }),
|
|
12504
|
+
* },
|
|
12505
|
+
* );
|
|
12506
|
+
* ```
|
|
12507
|
+
*
|
|
12508
|
+
* @example Zod v3 wiring
|
|
12509
|
+
* ```ts
|
|
12510
|
+
* import { z } from "zod/v3";
|
|
12511
|
+
* import { zodToJsonSchema } from "zod-to-json-schema";
|
|
12512
|
+
*
|
|
12513
|
+
* arkenv(
|
|
12514
|
+
* { PORT: z.number() },
|
|
12515
|
+
* {
|
|
12516
|
+
* toJsonSchema: (schema) =>
|
|
12517
|
+
* zodToJsonSchema(schema as z.ZodTypeAny, {
|
|
12518
|
+
* $refStrategy: "none",
|
|
12519
|
+
* }),
|
|
12520
|
+
* },
|
|
12521
|
+
* );
|
|
12522
|
+
* ```
|
|
12523
|
+
*/
|
|
12524
|
+
toJsonSchema?: (schema: StandardSchemaV1) => object | undefined;
|
|
12203
12525
|
/**
|
|
12204
12526
|
* The format to use for array parsing when coercion is enabled.
|
|
12205
12527
|
*
|
|
@@ -12239,12 +12561,11 @@ type ParseStandardConfig = {
|
|
|
12239
12561
|
//#endregion
|
|
12240
12562
|
//#region src/schema.d.ts
|
|
12241
12563
|
/**
|
|
12242
|
-
* Extract the keys from a schema definition
|
|
12564
|
+
* Extract the keys from a schema definition.
|
|
12243
12565
|
* Supports plain objects, ArkType schemas, and Standard Schema validators.
|
|
12244
12566
|
*
|
|
12245
12567
|
* @param schema The schema definition to extract keys from
|
|
12246
12568
|
* @returns An array of extracted key names
|
|
12247
|
-
* @internal
|
|
12248
12569
|
*/
|
|
12249
12570
|
declare function getSchemaKeys(schema: any): string[]; //#endregion
|
|
12250
12571
|
//#region src/utils/errors.d.ts
|
|
@@ -12260,9 +12581,10 @@ declare function getSchemaKeys(schema: any): string[]; //#endregion
|
|
|
12260
12581
|
//#endregion
|
|
12261
12582
|
//#region src/index.d.ts
|
|
12262
12583
|
/**
|
|
12263
|
-
* Configuration options for
|
|
12584
|
+
* Configuration options for `arkenv` from `@arkenv/standard`.
|
|
12264
12585
|
*/
|
|
12265
12586
|
type StandardEnvConfig = ParseStandardConfig;
|
|
12587
|
+
type StandardEnvOutput<T extends Record<string, StandardSchemaV1$2>> = { [K in keyof T]: StandardSchemaV1$2.InferOutput<T[K]> };
|
|
12266
12588
|
/**
|
|
12267
12589
|
* Parse and validate environment variables using Standard Schema 1.0 validators (e.g. Zod, Valibot).
|
|
12268
12590
|
*
|
|
@@ -12285,12 +12607,9 @@ type StandardEnvConfig = ParseStandardConfig;
|
|
|
12285
12607
|
* });
|
|
12286
12608
|
* ```
|
|
12287
12609
|
*/
|
|
12288
|
-
declare function arkenv<const T extends Record<string, StandardSchemaV1$
|
|
12289
|
-
safe?:
|
|
12290
|
-
}):
|
|
12291
|
-
declare function arkenv<const T extends Record<string, StandardSchemaV1$1>>(def: T, config: StandardEnvConfig & {
|
|
12292
|
-
safe: true;
|
|
12293
|
-
}): SafeArkEnvResult<{ [K in keyof T]: StandardSchemaV1$1.InferOutput<T[K]> }>;
|
|
12610
|
+
declare function arkenv<const T extends Record<string, StandardSchemaV1$2>, const Safe extends boolean | undefined = undefined>(def: T, config?: Omit<StandardEnvConfig, "safe"> & {
|
|
12611
|
+
safe?: Safe;
|
|
12612
|
+
}): [Safe] extends [true] ? SafeArkEnvResult<StandardEnvOutput<T>> : StandardEnvOutput<T>;
|
|
12294
12613
|
//#endregion
|
|
12295
12614
|
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
|
12296
12615
|
//# sourceMappingURL=index.d.cts.map
|