@kunk/api 3.0.0 → 3.0.2

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.
@@ -1,12 +1,17 @@
1
- $ tsdown
2
- ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
3
- ℹ config file: /home/runner/work/kunk/kunk/packages/api/tsdown.config.ts (unrun)
4
- ℹ entry: src/index.ts
5
- ℹ tsconfig: tsconfig.json
6
- ℹ Build start
7
- ℹ dist/index.mjs 0.65 kB │ gzip: 0.40 kB
8
- ℹ dist/index.d.mts 4.09 kB │ gzip: 1.28 kB
9
- ℹ 2 files, total: 4.74 kB
10
- [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
11
-
12
- ✔ Build complete in 4280ms
1
+
2
+ $ tsdown
3
+ ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
4
+ ℹ config file: /Users/ag/auxo/kunk/packages/api/tsdown.config.ts
5
+ ℹ entry: src/index.ts
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 2 files
9
+
10
+  WARN  Consider adding inlineOnly option to avoid unintended bundling of dependencies, or set inlineOnly: false to disable this warning.
11
+ Detected dependencies in bundle:
12
+ - @standard-schema/spec
13
+
14
+ ℹ dist/index.mjs 0.65 kB │ gzip: 0.40 kB
15
+ ℹ dist/index.d.mts 7.41 kB │ gzip: 2.03 kB
16
+ ℹ 2 files, total: 8.06 kB
17
+ ✔ Build complete in 1126ms
File without changes
@@ -0,0 +1,4 @@
1
+
2
+ $ bun pm version patch
3
+ [0.61ms] ".env"
4
+ v3.0.2
package/dist/index.d.mts CHANGED
@@ -1,5 +1,3 @@
1
- import { StandardSchemaV1, StandardSchemaV1 as StandardSchemaV1$1 } from "@standard-schema/spec";
2
-
3
1
  //#region src/contracts/ContextData.d.ts
4
2
  declare class ContextData {
5
3
  readonly tenantId?: string;
@@ -28,8 +26,86 @@ declare class Validator {
28
26
  validate(...asserts: Array<Promise<IError> | IError>): Promise<void>;
29
27
  }
30
28
  //#endregion
29
+ //#region ../../node_modules/@standard-schema/spec/dist/index.d.ts
30
+ /** The Standard Typed interface. This is a base type extended by other specs. */
31
+ interface StandardTypedV1<Input = unknown, Output = Input> {
32
+ /** The Standard properties. */
33
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
34
+ }
35
+ declare namespace StandardTypedV1 {
36
+ /** The Standard Typed properties interface. */
37
+ interface Props<Input = unknown, Output = Input> {
38
+ /** The version number of the standard. */
39
+ readonly version: 1;
40
+ /** The vendor name of the schema library. */
41
+ readonly vendor: string;
42
+ /** Inferred types associated with the schema. */
43
+ readonly types?: Types<Input, Output> | undefined;
44
+ }
45
+ /** The Standard Typed types interface. */
46
+ interface Types<Input = unknown, Output = Input> {
47
+ /** The input type of the schema. */
48
+ readonly input: Input;
49
+ /** The output type of the schema. */
50
+ readonly output: Output;
51
+ }
52
+ /** Infers the input type of a Standard Typed. */
53
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
54
+ /** Infers the output type of a Standard Typed. */
55
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
56
+ }
57
+ /** The Standard Schema interface. */
58
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
59
+ /** The Standard Schema properties. */
60
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
61
+ }
62
+ declare namespace StandardSchemaV1 {
63
+ /** The Standard Schema properties interface. */
64
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
65
+ /** Validates unknown input values. */
66
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
67
+ }
68
+ /** The result interface of the validate function. */
69
+ type Result<Output> = SuccessResult<Output> | FailureResult;
70
+ /** The result interface if validation succeeds. */
71
+ interface SuccessResult<Output> {
72
+ /** The typed output value. */
73
+ readonly value: Output;
74
+ /** A falsy value for `issues` indicates success. */
75
+ readonly issues?: undefined;
76
+ }
77
+ interface Options {
78
+ /** Explicit support for additional vendor-specific parameters, if needed. */
79
+ readonly libraryOptions?: Record<string, unknown> | undefined;
80
+ }
81
+ /** The result interface if validation fails. */
82
+ interface FailureResult {
83
+ /** The issues of failed validation. */
84
+ readonly issues: ReadonlyArray<Issue>;
85
+ }
86
+ /** The issue interface of the failure output. */
87
+ interface Issue {
88
+ /** The error message of the issue. */
89
+ readonly message: string;
90
+ /** The path of the issue, if any. */
91
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
92
+ }
93
+ /** The path segment interface of the issue. */
94
+ interface PathSegment {
95
+ /** The key representing a path segment. */
96
+ readonly key: PropertyKey;
97
+ }
98
+ /** The Standard types interface. */
99
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
100
+ /** Infers the input type of a Standard. */
101
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
102
+ /** Infers the output type of a Standard. */
103
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
104
+ }
105
+ /** The Standard JSON Schema interface. */
106
+ //#endregion
31
107
  //#region src/interfaces/ICommand.d.ts
32
- interface ICommand<IN extends StandardSchemaV1$1 = StandardSchemaV1$1, OUT extends StandardSchemaV1$1 = StandardSchemaV1$1> {
108
+ interface ICommand<IN extends StandardSchemaV1 = StandardSchemaV1, OUT extends StandardSchemaV1 = StandardSchemaV1> {
33
109
  "~type": "kunk:command";
34
110
  name: string;
35
111
  input: IN;
@@ -50,7 +126,7 @@ type BuiltIn = Primitive | Date | RegExp | Error | Map<any, any> | Set<any> | We
50
126
  * Remove undefined de um tipo union
51
127
  */
52
128
  type RemoveUndefined<T> = T extends undefined ? never : T;
53
- type DeepKey<T, D extends number = 10> = T extends StandardSchemaV1$1 ? DeepKey<StandardSchemaV1$1.InferOutput<T>, D> : [D] extends [never] ? never : T extends BuiltIn ? never : T extends object ? { [K in keyof T]-?: K extends string | number ? RemoveUndefined<T[K]> extends BuiltIn ? `${K}` : RemoveUndefined<T[K]> extends Array<infer U> ? `${K}` | (U extends BuiltIn ? never : `${K}.${number}` | `${K}.${DeepKey<U, Prev[D]>}`) : RemoveUndefined<T[K]> extends object ? `${K}` | `${K}.${DeepKey<RemoveUndefined<T[K]>, Prev[D]>}` : `${K}` : never }[keyof T] : any;
129
+ type DeepKey<T, D extends number = 10> = T extends StandardSchemaV1 ? DeepKey<StandardSchemaV1.InferOutput<T>, D> : [D] extends [never] ? never : T extends BuiltIn ? never : T extends object ? { [K in keyof T]-?: K extends string | number ? RemoveUndefined<T[K]> extends BuiltIn ? `${K}` : RemoveUndefined<T[K]> extends Array<infer U> ? `${K}` | (U extends BuiltIn ? never : `${K}.${number}` | `${K}.${DeepKey<U, Prev[D]>}`) : RemoveUndefined<T[K]> extends object ? `${K}` | `${K}.${DeepKey<RemoveUndefined<T[K]>, Prev[D]>}` : `${K}` : never }[keyof T] : any;
54
130
  type DeepValue<T, P extends string> = P extends keyof T ? T[P] : P extends `${infer First}.${infer Rest}` ? First extends keyof T ? Rest extends `${number}` ? RemoveUndefined<T[First]> extends Array<infer U> ? U : never : Rest extends `${number}.${infer After}` ? RemoveUndefined<T[First]> extends Array<infer U> ? DeepValue<U, After> : never : DeepValue<RemoveUndefined<T[First]>, Rest> : any : any;
55
131
  //#endregion
56
132
  //#region src/utils/error.d.ts
@@ -77,7 +153,7 @@ declare namespace I {
77
153
  } ? Input<INPUT> : T extends {
78
154
  "~type": "kunk:schema";
79
155
  input: infer INPUT;
80
- } ? Input<INPUT> : T extends StandardSchemaV1$1 ? StandardSchemaV1$1.InferInput<T> : T extends object ? { [K in keyof T]: I.Input<T[K]> } : never;
156
+ } ? Input<INPUT> : T extends StandardSchemaV1 ? StandardSchemaV1.InferInput<T> : T extends object ? { [K in keyof T]: I.Input<T[K]> } : never;
81
157
  type Output<T> = T extends {
82
158
  "~type": "kunk:aggregate";
83
159
  schema: infer SCHEMA;
@@ -87,7 +163,7 @@ declare namespace I {
87
163
  } ? Output<OUTPUT> : T extends {
88
164
  "~type": "kunk:schema";
89
165
  output: infer OUTPUT;
90
- } ? Output<OUTPUT> : T extends StandardSchemaV1$1 ? StandardSchemaV1$1.InferOutput<T> : T extends object ? { [K in keyof T]: I.Output<T[K]> } : never;
166
+ } ? Output<OUTPUT> : T extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<T> : T extends object ? { [K in keyof T]: I.Output<T[K]> } : never;
91
167
  }
92
168
  //#endregion
93
- export { ContextData, DeepKey, DeepValue, Generator, I, ICommand, IThrowable, Logger, type StandardSchemaV1, Throwable, Validator };
169
+ export { ContextData, DeepKey, DeepValue, Generator, I, ICommand, IThrowable, Logger, StandardSchemaV1, Throwable, Validator };
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@kunk/api",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
7
7
  "module": "./src/index.ts",
8
8
  "scripts": {
9
- "build": "tsdown"
9
+ "build": "tsdown",
10
+ "version:patch": "bun pm version patch",
11
+ "deploy": "bun publish"
10
12
  },
11
13
  "dependencies": {
12
14
  "@inversifyjs/common": "^1.5.2"