@taqueria/protocol 0.0.0-pr-776-4dc2afe7 → 0.0.0-pr-786-96ecf5c9
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/Base.ts +2 -2
- package/Config.ts +8 -3
- package/Environment.ts +6 -3
- package/EphemeralState.ts +8 -2
- package/Faucet.ts +8 -3
- package/InstalledPlugin.ts +8 -3
- package/NetworkConfig.ts +8 -3
- package/Operation.ts +8 -3
- package/Option.ts +8 -3
- package/ParsedOperation.ts +8 -3
- package/ParsedPluginInfo.ts +8 -3
- package/PersistentState.ts +8 -3
- package/PluginInfo.ts +8 -3
- package/PositionalArg.ts +8 -3
- package/Provisioner.ts +8 -3
- package/ProvisionerID.ts +8 -3
- package/Provisions.ts +8 -3
- package/README.md +1 -1
- package/RequestArgs.ts +8 -3
- package/SandboxAccountConfig.ts +8 -3
- package/SandboxConfig.ts +8 -3
- package/SanitizedArgs.ts +8 -2
- package/Tz.ts +8 -3
- package/Verb.ts +0 -1
- package/i18n.ts +1 -1
- package/package.json +1 -1
package/Base.ts
CHANGED
|
@@ -28,11 +28,11 @@ export const createSchema = <I>(params: CreateSchemaParams) => {
|
|
|
28
28
|
const schema = isStringLike
|
|
29
29
|
? internalSchema
|
|
30
30
|
.transform((val: unknown) => transformer(val) as I & {
|
|
31
|
-
readonly __kind: "generated" & typeof internalSchema
|
|
31
|
+
readonly __kind: "generated" & z.infer<typeof internalSchema>
|
|
32
32
|
})
|
|
33
33
|
: internalSchema
|
|
34
34
|
.transform((val: unknown) => transformer(val) as Flatten<I & {
|
|
35
|
-
readonly __kind: "generated" & typeof internalSchema
|
|
35
|
+
readonly __kind: "generated" & z.infer<typeof internalSchema>
|
|
36
36
|
}>)
|
|
37
37
|
|
|
38
38
|
type GeneratedSchema = typeof schema
|
package/Config.ts
CHANGED
|
@@ -135,7 +135,7 @@ export const rawSchema = commonSchema.extend({
|
|
|
135
135
|
type RawInput = z.infer<typeof rawSchema>
|
|
136
136
|
type Input = z.infer<typeof internalSchema>
|
|
137
137
|
|
|
138
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
138
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
139
139
|
rawSchema,
|
|
140
140
|
internalSchema,
|
|
141
141
|
parseErrMsg: (value: unknown) => `${value} is not a configuration`,
|
|
@@ -143,5 +143,10 @@ export const {schemas, factory} = createType<RawInput, Input>({
|
|
|
143
143
|
})
|
|
144
144
|
|
|
145
145
|
export const {create, of, make} = factory
|
|
146
|
-
export type Config = z.infer<typeof
|
|
147
|
-
export type t = Config
|
|
146
|
+
export type Config = z.infer<typeof generatedSchemas.schema>
|
|
147
|
+
export type t = Config
|
|
148
|
+
|
|
149
|
+
export const schemas = {
|
|
150
|
+
...generatedSchemas,
|
|
151
|
+
schema: generatedSchemas.schema.transform(val => val as Config)
|
|
152
|
+
}
|
package/Environment.ts
CHANGED
|
@@ -19,15 +19,18 @@ export const rawSchema = z.object({
|
|
|
19
19
|
|
|
20
20
|
type RawInput = z.infer<typeof rawSchema>
|
|
21
21
|
|
|
22
|
-
export const {schemas, factory} = createType<RawInput, RawInput>({
|
|
22
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, RawInput>({
|
|
23
23
|
rawSchema,
|
|
24
24
|
parseErrMsg: (value: unknown) => `${value} is not an valid environment configuration`,
|
|
25
25
|
unknownErrMsg: "Something went wrong trying to parse the environment configuration"
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
export type Environment = Flatten<z.infer<typeof
|
|
28
|
+
export type Environment = Flatten<z.infer<typeof generatedSchemas.schema>>
|
|
29
29
|
export type t = Environment
|
|
30
30
|
|
|
31
31
|
export const {create, make, of, from} = factory
|
|
32
32
|
|
|
33
|
-
export const
|
|
33
|
+
export const schemas = {
|
|
34
|
+
...generatedSchemas,
|
|
35
|
+
schema: generatedSchemas.schema.transform(val => val as Environment)
|
|
36
|
+
}
|
package/EphemeralState.ts
CHANGED
|
@@ -41,19 +41,25 @@ const rawSchema = z.object({
|
|
|
41
41
|
|
|
42
42
|
type RawInput = z.infer<typeof rawSchema>
|
|
43
43
|
|
|
44
|
-
export const {schemas, factory} = createType<RawInput, RawInput>({
|
|
44
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, RawInput>({
|
|
45
45
|
rawSchema,
|
|
46
46
|
parseErrMsg: (value: unknown) => `${value} is not a valid representation of ephemeral state`,
|
|
47
47
|
unknownErrMsg: "Something went wrong when parsing the ephemeral state"
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
-
export type EphemeralState = z.infer<typeof
|
|
50
|
+
export type EphemeralState = z.infer<typeof generatedSchemas.schema>
|
|
51
51
|
export type t = EphemeralState
|
|
52
52
|
export type TaskToPluginMap = z.infer<typeof taskToPluginMap>
|
|
53
53
|
export type OpToPluginMap = z.infer<typeof operationToPluginMap>
|
|
54
54
|
|
|
55
55
|
export const {create, of, make} = factory
|
|
56
56
|
|
|
57
|
+
|
|
58
|
+
export const schemas = {
|
|
59
|
+
...generatedSchemas,
|
|
60
|
+
schema: generatedSchemas.schema.transform(val => val as EphemeralState)
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
/**
|
|
58
64
|
* Private functions
|
|
59
65
|
*/
|
package/Faucet.ts
CHANGED
|
@@ -29,13 +29,18 @@ const internalSchema = z.object({
|
|
|
29
29
|
type RawInput = z.infer<typeof rawSchema>
|
|
30
30
|
type Input = z.infer<typeof internalSchema>
|
|
31
31
|
|
|
32
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
32
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
33
33
|
rawSchema,
|
|
34
34
|
internalSchema,
|
|
35
35
|
parseErrMsg: (value:unknown) => `${value} is not a valid faucet configuration`,
|
|
36
36
|
unknownErrMsg: "Something went wrong trying to parse the faucet"
|
|
37
37
|
})
|
|
38
38
|
|
|
39
|
-
export type Faucet = Flatten<z.infer<typeof
|
|
39
|
+
export type Faucet = Flatten<z.infer<typeof generatedSchemas.schema>>
|
|
40
40
|
export type t = Faucet
|
|
41
|
-
export const {create, of, make} = factory
|
|
41
|
+
export const {create, of, make} = factory
|
|
42
|
+
|
|
43
|
+
export const schemas = {
|
|
44
|
+
...generatedSchemas,
|
|
45
|
+
schema: generatedSchemas.schema.transform(val => val as Faucet)
|
|
46
|
+
}
|
package/InstalledPlugin.ts
CHANGED
|
@@ -11,13 +11,18 @@ export const rawSchema = z.object({
|
|
|
11
11
|
|
|
12
12
|
type RawInput = z.infer<typeof rawSchema>
|
|
13
13
|
|
|
14
|
-
export const {schemas, factory} = createType<RawInput, RawInput>({
|
|
14
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, RawInput>({
|
|
15
15
|
rawSchema,
|
|
16
16
|
parseErrMsg: (value: unknown) => `${value} is not a valid installed plugin`,
|
|
17
17
|
unknownErrMsg: "Something went wrong when parsing the installed plugin"
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
-
export type InstalledPlugin = z.infer<typeof
|
|
20
|
+
export type InstalledPlugin = z.infer<typeof generatedSchemas.schema>
|
|
21
21
|
export type t = InstalledPlugin
|
|
22
22
|
|
|
23
|
-
export const {create, of, make} = factory
|
|
23
|
+
export const {create, of, make} = factory
|
|
24
|
+
|
|
25
|
+
export const schemas = {
|
|
26
|
+
...generatedSchemas,
|
|
27
|
+
schema: generatedSchemas.schema.transform(val => val as InstalledPlugin)
|
|
28
|
+
}
|
package/NetworkConfig.ts
CHANGED
|
@@ -22,13 +22,18 @@ const internalSchema = z.object({
|
|
|
22
22
|
type RawInput = z.infer<typeof rawSchema>
|
|
23
23
|
type Input = z.infer<typeof internalSchema>
|
|
24
24
|
|
|
25
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
25
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
26
26
|
rawSchema,
|
|
27
27
|
internalSchema,
|
|
28
28
|
parseErrMsg: (value: unknown) => `${value} is not a valid network configuration`,
|
|
29
29
|
unknownErrMsg: "Something went wrong trying to parse the network configuration"
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
export type NetworkConfig = Flatten<z.infer<typeof
|
|
32
|
+
export type NetworkConfig = Flatten<z.infer<typeof generatedSchemas.schema>>
|
|
33
33
|
export type t = NetworkConfig
|
|
34
|
-
export const {create, of, make} = factory
|
|
34
|
+
export const {create, of, make} = factory
|
|
35
|
+
|
|
36
|
+
export const schemas = {
|
|
37
|
+
...generatedSchemas,
|
|
38
|
+
schema: generatedSchemas.schema.transform(val => val as NetworkConfig)
|
|
39
|
+
}
|
package/Operation.ts
CHANGED
|
@@ -54,13 +54,18 @@ export const internalSchema = z.object({
|
|
|
54
54
|
type Input = Flatten<z.infer<typeof internalSchema>>
|
|
55
55
|
type RawInput = z.infer<typeof rawSchema>
|
|
56
56
|
|
|
57
|
-
export const {schemas, factory} = createType<RawInput,Input>({
|
|
57
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput,Input>({
|
|
58
58
|
rawSchema,
|
|
59
59
|
internalSchema,
|
|
60
60
|
parseErrMsg: (value: unknown) => `The following operation is invalid: ${value}`,
|
|
61
61
|
unknownErrMsg: "Something went wrong trying to parse the operation"
|
|
62
62
|
})
|
|
63
63
|
|
|
64
|
-
export type Operation = Flatten<z.infer<typeof
|
|
64
|
+
export type Operation = Flatten<z.infer<typeof generatedSchemas.schema>>
|
|
65
65
|
export type t = Operation
|
|
66
|
-
export const {make, of, create} = factory
|
|
66
|
+
export const {make, of, create} = factory
|
|
67
|
+
|
|
68
|
+
export const schemas = {
|
|
69
|
+
...generatedSchemas,
|
|
70
|
+
schema: generatedSchemas.schema.transform(val => val as Operation)
|
|
71
|
+
}
|
package/Option.ts
CHANGED
|
@@ -38,14 +38,19 @@ export const rawSchema = z.object({
|
|
|
38
38
|
type RawInput = z.infer<typeof rawSchema>
|
|
39
39
|
type Input = z.infer<typeof internalSchema>
|
|
40
40
|
|
|
41
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
41
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
42
42
|
rawSchema,
|
|
43
43
|
internalSchema,
|
|
44
44
|
parseErrMsg: (value: unknown) => `The following option is invalid: ${value}`,
|
|
45
45
|
unknownErrMsg: "Something went wrong trying to parse the option"
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
export type Option = Flatten<z.infer<typeof
|
|
48
|
+
export type Option = Flatten<z.infer<typeof generatedSchemas.schema>>
|
|
49
49
|
export type t = Option
|
|
50
50
|
|
|
51
|
-
export const {make, create, of} = factory
|
|
51
|
+
export const {make, create, of} = factory
|
|
52
|
+
|
|
53
|
+
export const schemas = {
|
|
54
|
+
...generatedSchemas,
|
|
55
|
+
schema: generatedSchemas.schema.transform(val => val as Option)
|
|
56
|
+
}
|
package/ParsedOperation.ts
CHANGED
|
@@ -15,14 +15,19 @@ export const rawSchema = Operation
|
|
|
15
15
|
type RawInput = z.infer<typeof rawSchema>
|
|
16
16
|
type Input = z.infer<typeof internalSchema>
|
|
17
17
|
|
|
18
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
18
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
19
19
|
rawSchema,
|
|
20
20
|
internalSchema,
|
|
21
21
|
parseErrMsg: (value: unknown) => `Could not parse the following operation: ${value}`,
|
|
22
22
|
unknownErrMsg: "Something went wrong trying to parse an operation"
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
export type ParsedOperation = z.infer<typeof
|
|
25
|
+
export type ParsedOperation = z.infer<typeof generatedSchemas.schema>
|
|
26
26
|
export type t = ParsedOperation
|
|
27
27
|
|
|
28
|
-
export const {create, make, of} = factory
|
|
28
|
+
export const {create, make, of} = factory
|
|
29
|
+
|
|
30
|
+
export const schemas = {
|
|
31
|
+
...generatedSchemas,
|
|
32
|
+
schema: generatedSchemas.schema.transform(val => val as ParsedOperation)
|
|
33
|
+
}
|
package/ParsedPluginInfo.ts
CHANGED
|
@@ -30,13 +30,18 @@ type Input = z.infer<typeof internalSchema>
|
|
|
30
30
|
|
|
31
31
|
type RawInput = z.infer<typeof rawSchema>
|
|
32
32
|
|
|
33
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
33
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
34
34
|
rawSchema,
|
|
35
35
|
internalSchema,
|
|
36
36
|
parseErrMsg: (value: unknown) => `The following plugin info gave us trouble when parsing the following plugin information: ${value}`,
|
|
37
37
|
unknownErrMsg: "Something went wrong trying to parse the plugin information"
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
-
export type ParsedPluginInfo = z.infer<typeof
|
|
40
|
+
export type ParsedPluginInfo = z.infer<typeof generatedSchemas.schema>
|
|
41
41
|
export type t = ParsedPluginInfo
|
|
42
|
-
export const {create, of, make} = factory
|
|
42
|
+
export const {create, of, make} = factory
|
|
43
|
+
|
|
44
|
+
export const schemas = {
|
|
45
|
+
...generatedSchemas,
|
|
46
|
+
schema: generatedSchemas.schema.transform(val => val as ParsedPluginInfo)
|
|
47
|
+
}
|
package/PersistentState.ts
CHANGED
|
@@ -50,14 +50,19 @@ type RawInput = z.infer<typeof rawSchema>
|
|
|
50
50
|
|
|
51
51
|
type Input = z.infer<typeof internalSchema>
|
|
52
52
|
|
|
53
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
53
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
54
54
|
rawSchema,
|
|
55
55
|
parseErrMsg: `The persistent state is invalid`,
|
|
56
56
|
unknownErrMsg: `Something went wrong trying to parse the persistent state`
|
|
57
57
|
})
|
|
58
58
|
|
|
59
|
-
export type PersistentState = z.infer<typeof
|
|
59
|
+
export type PersistentState = z.infer<typeof generatedSchemas.schema>
|
|
60
60
|
export type t = PersistentState
|
|
61
61
|
export type State = PersistentState
|
|
62
62
|
|
|
63
|
-
export const {create, of, make} = factory
|
|
63
|
+
export const {create, of, make} = factory
|
|
64
|
+
|
|
65
|
+
export const schemas = {
|
|
66
|
+
...generatedSchemas,
|
|
67
|
+
schema: generatedSchemas.schema.transform(val => val as unknown as PersistentState)
|
|
68
|
+
}
|
package/PluginInfo.ts
CHANGED
|
@@ -51,13 +51,18 @@ export const rawSchema = z.object({
|
|
|
51
51
|
type RawInput = z.infer<typeof rawSchema>
|
|
52
52
|
type Input = Flatten<z.infer<typeof internalSchema>>
|
|
53
53
|
|
|
54
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
54
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
55
55
|
rawSchema,
|
|
56
56
|
internalSchema,
|
|
57
57
|
parseErrMsg: "The schema returned from the plugin is invalid",
|
|
58
58
|
unknownErrMsg: "Something went wrong parsing the schema from a plugin"
|
|
59
59
|
})
|
|
60
60
|
|
|
61
|
-
export type PluginInfo = Flatten<z.infer<typeof
|
|
61
|
+
export type PluginInfo = Flatten<z.infer<typeof generatedSchemas.schema>>
|
|
62
62
|
export type t = PluginInfo
|
|
63
|
-
export const {create, of, make} = factory
|
|
63
|
+
export const {create, of, make} = factory
|
|
64
|
+
|
|
65
|
+
export const schemas = {
|
|
66
|
+
...generatedSchemas,
|
|
67
|
+
schema: generatedSchemas.schema.transform(val => val as unknown as PluginInfo)
|
|
68
|
+
}
|
package/PositionalArg.ts
CHANGED
|
@@ -31,14 +31,19 @@ const internalSchema = z.object({
|
|
|
31
31
|
type RawInput = z.infer<typeof rawSchema>
|
|
32
32
|
type Input = z.infer<typeof internalSchema>
|
|
33
33
|
|
|
34
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
34
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
35
35
|
rawSchema,
|
|
36
36
|
internalSchema,
|
|
37
37
|
parseErrMsg: (value: unknown) => `The following positional argument is invalid: ${value}`,
|
|
38
38
|
unknownErrMsg: "Something went wrong parsing the positional argument"
|
|
39
39
|
})
|
|
40
40
|
|
|
41
|
-
export type PositionalArg = z.infer<typeof
|
|
41
|
+
export type PositionalArg = z.infer<typeof generatedSchemas.schema>
|
|
42
42
|
export type t = PositionalArg
|
|
43
43
|
|
|
44
|
-
export const {create, of, make} = factory
|
|
44
|
+
export const {create, of, make} = factory
|
|
45
|
+
|
|
46
|
+
export const schemas = {
|
|
47
|
+
...generatedSchemas,
|
|
48
|
+
schema: generatedSchemas.schema.transform(val => val as unknown as PositionalArg)
|
|
49
|
+
}
|
package/Provisioner.ts
CHANGED
|
@@ -44,13 +44,18 @@ export const internalSchema = rawSchema.extend({
|
|
|
44
44
|
type RawInput = z.infer<typeof rawSchema>
|
|
45
45
|
type Input = z.infer<typeof internalSchema>
|
|
46
46
|
|
|
47
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
47
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
48
48
|
rawSchema,
|
|
49
49
|
internalSchema,
|
|
50
50
|
parseErrMsg: "There was a problem trying to parse the provisioner",
|
|
51
51
|
unknownErrMsg: "Something went wrong trying to parse the provisioner"
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
export type Provisioner = z.infer<typeof
|
|
54
|
+
export type Provisioner = z.infer<typeof generatedSchemas.schema>
|
|
55
55
|
export type t = Provisioner
|
|
56
|
-
export const {create, of, make} = factory
|
|
56
|
+
export const {create, of, make} = factory
|
|
57
|
+
|
|
58
|
+
export const schemas = {
|
|
59
|
+
...generatedSchemas,
|
|
60
|
+
schema: generatedSchemas.schema.transform(val => val as unknown as Provisioner)
|
|
61
|
+
}
|
package/ProvisionerID.ts
CHANGED
|
@@ -9,12 +9,17 @@ export const rawSchema = z
|
|
|
9
9
|
|
|
10
10
|
type RawInput = z.infer<typeof rawSchema>
|
|
11
11
|
|
|
12
|
-
export const {schemas, factory} = createType<RawInput, RawInput>({
|
|
12
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, RawInput>({
|
|
13
13
|
rawSchema,
|
|
14
14
|
parseErrMsg: (value: unknown) => `${value} is not a valid provisioner ID`,
|
|
15
15
|
unknownErrMsg: "Something went wrong trying to parse the provision ID"
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
-
export type ProvisionerID = z.infer<typeof
|
|
18
|
+
export type ProvisionerID = z.infer<typeof generatedSchemas.schema>
|
|
19
19
|
export type t = ProvisionerID
|
|
20
|
-
export const {create, of, make} = factory
|
|
20
|
+
export const {create, of, make} = factory
|
|
21
|
+
|
|
22
|
+
export const schemas = {
|
|
23
|
+
...generatedSchemas,
|
|
24
|
+
schema: generatedSchemas.schema.transform(val => val as ProvisionerID)
|
|
25
|
+
}
|
package/Provisions.ts
CHANGED
|
@@ -44,13 +44,18 @@ const internalSchema = z
|
|
|
44
44
|
|
|
45
45
|
type Input = z.infer<typeof internalSchema>
|
|
46
46
|
|
|
47
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
47
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
48
48
|
rawSchema,
|
|
49
49
|
internalSchema,
|
|
50
50
|
parseErrMsg: (value: unknown) => `The following provision is invalid: ${value}`,
|
|
51
51
|
unknownErrMsg: "Something went wrong parsing the list of provisioners"
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
export type Provisions = Flatten<z.infer<typeof
|
|
54
|
+
export type Provisions = Flatten<z.infer<typeof generatedSchemas.schema>>
|
|
55
55
|
export type t = Provisions
|
|
56
|
-
export const {create, of, make} = factory
|
|
56
|
+
export const {create, of, make} = factory
|
|
57
|
+
|
|
58
|
+
export const schemas = {
|
|
59
|
+
...generatedSchemas,
|
|
60
|
+
schema: generatedSchemas.schema.transform(val => val as Provisions)
|
|
61
|
+
}
|
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ Person: {
|
|
|
36
36
|
Both fields are of type Name.t.
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
Name.t would have a rawSchema that parses input as a string, with a minimum length of 2, and match against a regex to ensure that the string begins with an uppercase letter, and that only alphabetical characters,
|
|
39
|
+
Name.t would have a rawSchema that parses input as a string, with a minimum length of 2, and match against a regex to ensure that the string begins with an uppercase letter, and that only alphabetical characters, hyphens, and spaces are allowed. The rawSchema is essentially parsing the input into a built-in type, a string in this case, and validating that the string represents the data expected.
|
|
40
40
|
|
|
41
41
|
The internalSchema of the Name.t type would be the same as the rawSchema in this place, as the rawSchema is parsing the input into a scalar value and simple type, rather than a complex type, such as an object.
|
|
42
42
|
|
package/RequestArgs.ts
CHANGED
|
@@ -32,16 +32,21 @@ const internalSchema = sanitizedArgsSchema.extend({
|
|
|
32
32
|
type RawInput = z.infer<typeof rawSchema>
|
|
33
33
|
type Input = z.infer<typeof internalSchema>
|
|
34
34
|
|
|
35
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
35
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
36
36
|
rawSchema,
|
|
37
37
|
internalSchema,
|
|
38
38
|
parseErrMsg: "The request is invalid",
|
|
39
39
|
unknownErrMsg: "Something went wrong trying to parse the request"
|
|
40
40
|
})
|
|
41
41
|
|
|
42
|
-
export type RequestArgs = z.infer<typeof
|
|
42
|
+
export type RequestArgs = z.infer<typeof generatedSchemas.schema>
|
|
43
43
|
export type t = RequestArgs
|
|
44
44
|
|
|
45
|
+
export const schemas = {
|
|
46
|
+
...generatedSchemas,
|
|
47
|
+
schema: generatedSchemas.schema.transform(val => val as RequestArgs)
|
|
48
|
+
}
|
|
49
|
+
|
|
45
50
|
const rawProxySchema = rawSchema.extend({
|
|
46
51
|
task: z.string().min(1)
|
|
47
52
|
}).describe("ProxyRequestArgs").passthrough()
|
|
@@ -53,7 +58,7 @@ const internalProxySchema = internalSchema.extend({
|
|
|
53
58
|
type RawProxyInput = z.infer<typeof rawProxySchema>
|
|
54
59
|
type ProxyInput = z.infer<typeof internalProxySchema>
|
|
55
60
|
|
|
56
|
-
const proxy = createType<RawProxyInput, ProxyInput>({
|
|
61
|
+
export const proxy = createType<RawProxyInput, ProxyInput>({
|
|
57
62
|
rawSchema: rawProxySchema,
|
|
58
63
|
internalSchema: internalProxySchema,
|
|
59
64
|
parseErrMsg: "The request is invalid",
|
package/SandboxAccountConfig.ts
CHANGED
|
@@ -18,13 +18,18 @@ type Input = z.infer<typeof internalSchema>
|
|
|
18
18
|
|
|
19
19
|
type RawInput = z.infer<typeof rawSchema>
|
|
20
20
|
|
|
21
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
21
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
22
22
|
rawSchema,
|
|
23
23
|
internalSchema,
|
|
24
24
|
parseErrMsg: "The sandbox account configuration is invalid",
|
|
25
25
|
unknownErrMsg: "Something went wrong trying to parse the sandbox account configuration"
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
export type SandboxAccountConfig = z.infer<typeof
|
|
28
|
+
export type SandboxAccountConfig = z.infer<typeof generatedSchemas.schema>
|
|
29
29
|
export type t = SandboxAccountConfig
|
|
30
|
-
export const {create, of, make} = factory
|
|
30
|
+
export const {create, of, make} = factory
|
|
31
|
+
|
|
32
|
+
export const schemas = {
|
|
33
|
+
...generatedSchemas,
|
|
34
|
+
schema: generatedSchemas.schema.transform(val => val as SandboxAccountConfig)
|
|
35
|
+
}
|
package/SandboxConfig.ts
CHANGED
|
@@ -46,13 +46,18 @@ const internalSchema = z.object({
|
|
|
46
46
|
type RawInput = z.infer<typeof rawSchema>
|
|
47
47
|
type Input = z.infer<typeof internalSchema>
|
|
48
48
|
|
|
49
|
-
export const {schemas, factory} = createType<RawInput, Input>({
|
|
49
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, Input>({
|
|
50
50
|
rawSchema,
|
|
51
51
|
internalSchema,
|
|
52
52
|
parseErrMsg: (value: unknown) => `${value} is not a valid sandbox configuration `,
|
|
53
53
|
unknownErrMsg: "Something went wrong trying to parse the sandbox configuration"
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
export type SandboxConfig = z.infer<typeof
|
|
56
|
+
export type SandboxConfig = z.infer<typeof generatedSchemas.schema>
|
|
57
57
|
export type t = SandboxConfig
|
|
58
|
-
export const {create, of, make} = factory
|
|
58
|
+
export const {create, of, make} = factory
|
|
59
|
+
|
|
60
|
+
export const schemas = {
|
|
61
|
+
...generatedSchemas,
|
|
62
|
+
schema: generatedSchemas.schema.transform(val => val as SandboxConfig)
|
|
63
|
+
}
|
package/SanitizedArgs.ts
CHANGED
|
@@ -88,7 +88,7 @@ type RawProvisionInput = z.infer<typeof provisionRawSchema>
|
|
|
88
88
|
type RawManagePluginInput = z.infer<typeof managePluginRawSchema>
|
|
89
89
|
type RawVersionInput = z.infer<typeof versionRawSchema>
|
|
90
90
|
|
|
91
|
-
export const {schemas, factory} = createType<RawInput, RawInput>({
|
|
91
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, RawInput>({
|
|
92
92
|
rawSchema,
|
|
93
93
|
parseErrMsg: "The arguments provided are invalid",
|
|
94
94
|
unknownErrMsg: "Something went wrong parsing the command-line arguments"
|
|
@@ -96,9 +96,15 @@ export const {schemas, factory} = createType<RawInput, RawInput>({
|
|
|
96
96
|
|
|
97
97
|
export const {create, of, make} = factory
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
|
|
100
|
+
export type SanitizedArgs = z.infer<typeof generatedSchemas.schema>
|
|
100
101
|
export type t = SanitizedArgs
|
|
101
102
|
|
|
103
|
+
export const schemas = {
|
|
104
|
+
...generatedSchemas,
|
|
105
|
+
schema: generatedSchemas.schema.transform(val => val as SanitizedArgs)
|
|
106
|
+
}
|
|
107
|
+
|
|
102
108
|
export const scaffoldTaskArgs = createType<RawScaffoldInput, RawScaffoldInput>({
|
|
103
109
|
rawSchema: scaffoldRawSchema,
|
|
104
110
|
parseErrMsg: "The arguments provided are invalid for the scaffold task",
|
package/Tz.ts
CHANGED
|
@@ -5,13 +5,18 @@ export const rawSchema = z.string({description: "Tz"}).min(1).regex(/^\d([\d_]+\
|
|
|
5
5
|
|
|
6
6
|
type RawInput = z.infer<typeof rawSchema>
|
|
7
7
|
|
|
8
|
-
export const {schemas, factory} = createType<RawInput, RawInput>({
|
|
8
|
+
export const {schemas: generatedSchemas, factory} = createType<RawInput, RawInput>({
|
|
9
9
|
isStringLike: true,
|
|
10
10
|
rawSchema,
|
|
11
11
|
parseErrMsg: (value: unknown) => `${value} is an invalid Tz amount`,
|
|
12
12
|
unknownErrMsg: "Something went wrong when parsing the Tz amount"
|
|
13
13
|
})
|
|
14
14
|
|
|
15
|
-
export type Tz = z.infer<typeof
|
|
15
|
+
export type Tz = z.infer<typeof generatedSchemas.schema>
|
|
16
16
|
|
|
17
|
-
export const {create, of, make} = factory
|
|
17
|
+
export const {create, of, make} = factory
|
|
18
|
+
|
|
19
|
+
export const schemas = {
|
|
20
|
+
...generatedSchemas,
|
|
21
|
+
schema: generatedSchemas.schema.transform(val => val as Tz)
|
|
22
|
+
}
|
package/Verb.ts
CHANGED
|
@@ -14,7 +14,6 @@ export const {factory, schemas: generatedSchemas} = createType<Input, Input>({
|
|
|
14
14
|
parseErrMsg: (value: unknown) => `${value} is not an invalid verb`,
|
|
15
15
|
unknownErrMsg: `Something went wrong trying to parse a verb`
|
|
16
16
|
})
|
|
17
|
-
|
|
18
17
|
export type Verb = z.infer<typeof generatedSchemas.schema>
|
|
19
18
|
export type t = Verb
|
|
20
19
|
export const {create, make, of} = factory
|
package/i18n.ts
CHANGED
|
@@ -18,7 +18,7 @@ export default async (): Promise<i18n> => {
|
|
|
18
18
|
translation: {
|
|
19
19
|
"appName": "Taqueria",
|
|
20
20
|
"appDesc": "Taqueria is an integrated environment for compiling, testing, and deploying Tezos software.",
|
|
21
|
-
"versionDesc": "Display the
|
|
21
|
+
"versionDesc": "Display the version number of the Taqueria program",
|
|
22
22
|
"betaWarning": "Taqueria is currently in BETA. You've been warned. :)",
|
|
23
23
|
"configDirDesc": "Config directory (default ./.taq)",
|
|
24
24
|
"initDesc": "Initialize a new project",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taqueria/protocol",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-786-96ecf5c9",
|
|
4
4
|
"description": "A TypeScript package which contains types that are to be shared between @taqueria/node-sdk and @taqueria/taqueria.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|