@xylabs/creatable 5.0.64 → 5.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/AbstractCreatable.d.ts +3 -1
- package/dist/neutral/AbstractCreatable.d.ts.map +1 -1
- package/dist/neutral/AbstractCreatableV2.d.ts +62 -0
- package/dist/neutral/AbstractCreatableV2.d.ts.map +1 -0
- package/dist/neutral/Creatable.d.ts +5 -0
- package/dist/neutral/Creatable.d.ts.map +1 -1
- package/dist/neutral/CreatableV2.d.ts +31 -0
- package/dist/neutral/CreatableV2.d.ts.map +1 -0
- package/dist/neutral/FactoryV2.d.ts +11 -0
- package/dist/neutral/FactoryV2.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +1 -0
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +67 -0
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/CreatableInstance.d.ts +2 -1
- package/dist/neutral/model/CreatableInstance.d.ts.map +1 -1
- package/dist/neutral/model/CreatableInstanceV2.d.ts +14 -0
- package/dist/neutral/model/CreatableInstanceV2.d.ts.map +1 -0
- package/dist/neutral/model/CreatableName.d.ts +5 -0
- package/dist/neutral/model/CreatableName.d.ts.map +1 -0
- package/dist/neutral/model/CreatableParams.d.ts +1 -2
- package/dist/neutral/model/CreatableParams.d.ts.map +1 -1
- package/dist/neutral/model/CreatableParamsV2.d.ts +68 -0
- package/dist/neutral/model/CreatableParamsV2.d.ts.map +1 -0
- package/dist/neutral/model/CreatableStatusReporter.d.ts +7 -4
- package/dist/neutral/model/CreatableStatusReporter.d.ts.map +1 -1
- package/dist/neutral/model/CreatableStatusReporter.zod.d.ts +44 -0
- package/dist/neutral/model/CreatableStatusReporter.zod.d.ts.map +1 -0
- package/dist/neutral/model/CreatableStatusReporterV2.d.ts +7 -0
- package/dist/neutral/model/CreatableStatusReporterV2.d.ts.map +1 -0
- package/dist/neutral/model/index.d.ts +5 -0
- package/dist/neutral/model/index.d.ts.map +1 -1
- package/package.json +17 -11
- package/src/AbstractCreatable.ts +3 -1
- package/src/AbstractCreatableV2.ts +270 -0
- package/src/Creatable.ts +5 -0
- package/src/CreatableV2.ts +67 -0
- package/src/FactoryV2.ts +38 -0
- package/src/index.ts +1 -0
- package/src/model/CreatableInstance.ts +2 -1
- package/src/model/CreatableInstanceV2.ts +16 -0
- package/src/model/CreatableName.ts +3 -0
- package/src/model/CreatableParams.ts +1 -3
- package/src/model/CreatableParamsV2.ts +11 -0
- package/src/model/CreatableStatusReporter.ts +8 -4
- package/src/model/CreatableStatusReporter.zod.ts +31 -0
- package/src/model/CreatableStatusReporterV2.ts +11 -0
- package/src/model/index.ts +5 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const CreatableStatusSuccessZod = z.enum(['creating', 'created', 'starting', 'started', 'stopping', 'stopped'])
|
|
4
|
+
|
|
5
|
+
export const CreatableStatusErrorZod = z.enum(['error'])
|
|
6
|
+
|
|
7
|
+
export const CreatableStatusZod = z.union([CreatableStatusSuccessZod, CreatableStatusErrorZod])
|
|
8
|
+
|
|
9
|
+
export const CreatableStatusReporterV2Zod = z.object({
|
|
10
|
+
report: z.union([
|
|
11
|
+
z.function({
|
|
12
|
+
input: z.union([
|
|
13
|
+
z.tuple([
|
|
14
|
+
z.string(),
|
|
15
|
+
CreatableStatusSuccessZod,
|
|
16
|
+
z.number().optional(),
|
|
17
|
+
]),
|
|
18
|
+
z.tuple([
|
|
19
|
+
z.string(),
|
|
20
|
+
CreatableStatusErrorZod,
|
|
21
|
+
z.instanceof(Error),
|
|
22
|
+
]),
|
|
23
|
+
z.tuple([
|
|
24
|
+
z.string(),
|
|
25
|
+
CreatableStatusZod,
|
|
26
|
+
]),
|
|
27
|
+
]),
|
|
28
|
+
output: z.void(),
|
|
29
|
+
}),
|
|
30
|
+
]),
|
|
31
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type z from 'zod'
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
CreatableStatusReporterV2Zod, CreatableStatusSuccessZod, CreatableStatusZod,
|
|
5
|
+
} from './CreatableStatusReporter.zod.ts'
|
|
6
|
+
|
|
7
|
+
export type CreatableStatusSuccessV2 = z.infer<typeof CreatableStatusSuccessZod>
|
|
8
|
+
export type CreatableStatusErrorV2 = Extract<CreatableStatusV2, 'error'>
|
|
9
|
+
export type CreatableStatusV2 = z.infer<typeof CreatableStatusZod>
|
|
10
|
+
|
|
11
|
+
export type CreatableStatusReporterV2 = z.infer<typeof CreatableStatusReporterV2Zod>
|
package/src/model/index.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export * from './CreatableInstance.ts'
|
|
2
|
+
export * from './CreatableInstanceV2.ts'
|
|
3
|
+
export * from './CreatableName.ts'
|
|
2
4
|
export * from './CreatableParams.ts'
|
|
5
|
+
export * from './CreatableParamsV2.ts'
|
|
3
6
|
export * from './CreatableStatusReporter.ts'
|
|
7
|
+
export * from './CreatableStatusReporter.zod.ts'
|
|
8
|
+
export * from './CreatableStatusReporterV2.ts'
|
|
4
9
|
export * from './Labels.ts'
|