@taqueria/protocol 0.14.4 → 0.18.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/Alias.d.ts +48 -0
- package/Alias.js +70 -0
- package/Alias.js.map +1 -0
- package/Alias.mjs +34 -0
- package/Alias.mjs.map +1 -0
- package/Base.d.ts +50 -0
- package/Base.js +83 -0
- package/Base.js.map +1 -0
- package/Base.mjs +57 -0
- package/Base.mjs.map +1 -0
- package/Command.d.ts +30 -0
- package/Command.js +61 -0
- package/Command.js.map +1 -0
- package/Command.mjs +25 -0
- package/Command.mjs.map +1 -0
- package/Config.d.ts +2062 -0
- package/Config.js +175 -0
- package/Config.js.map +1 -0
- package/Config.mjs +135 -0
- package/Config.mjs.map +1 -0
- package/Contract.d.ts +88 -0
- package/Contract.js +68 -0
- package/Contract.js.map +1 -0
- package/Contract.mjs +32 -0
- package/Contract.mjs.map +1 -0
- package/Crypto.d.ts +5 -0
- package/Crypto.js +35 -0
- package/Crypto.js.map +1 -0
- package/Crypto.mjs +10 -0
- package/Crypto.mjs.map +1 -0
- package/EconomicalProtocolHash.d.ts +48 -0
- package/EconomicalProtocolHash.js +64 -0
- package/EconomicalProtocolHash.js.map +1 -0
- package/EconomicalProtocolHash.mjs +27 -0
- package/EconomicalProtocolHash.mjs.map +1 -0
- package/Environment.d.ts +142 -0
- package/Environment.js +78 -0
- package/Environment.js.map +1 -0
- package/Environment.mjs +40 -0
- package/Environment.mjs.map +1 -0
- package/EphemeralState.d.ts +4561 -0
- package/EphemeralState.js +268 -0
- package/EphemeralState.js.map +1 -0
- package/EphemeralState.mjs +228 -0
- package/EphemeralState.mjs.map +1 -0
- package/Faucet.d.ts +210 -0
- package/Faucet.js +84 -0
- package/Faucet.js.map +1 -0
- package/Faucet.mjs +47 -0
- package/Faucet.mjs.map +1 -0
- package/HumanReadableIdentifier.d.ts +30 -0
- package/HumanReadableIdentifier.js +61 -0
- package/HumanReadableIdentifier.js.map +1 -0
- package/HumanReadableIdentifier.mjs +25 -0
- package/HumanReadableIdentifier.mjs.map +1 -0
- package/InstalledPlugin.d.ts +99 -0
- package/InstalledPlugin.js +67 -0
- package/InstalledPlugin.js.map +1 -0
- package/InstalledPlugin.mjs +30 -0
- package/InstalledPlugin.mjs.map +1 -0
- package/LoadedConfig.d.ts +2325 -0
- package/LoadedConfig.js +80 -0
- package/LoadedConfig.js.map +1 -0
- package/LoadedConfig.mjs +41 -0
- package/LoadedConfig.mjs.map +1 -0
- package/MetadataConfig.d.ts +162 -0
- package/MetadataConfig.js +75 -0
- package/MetadataConfig.js.map +1 -0
- package/MetadataConfig.mjs +38 -0
- package/MetadataConfig.mjs.map +1 -0
- package/NetworkConfig.d.ts +431 -0
- package/NetworkConfig.js +77 -0
- package/NetworkConfig.js.map +1 -0
- package/NetworkConfig.mjs +40 -0
- package/NetworkConfig.mjs.map +1 -0
- package/Operation.d.ts +1476 -0
- package/Operation.js +98 -0
- package/Operation.js.map +1 -0
- package/Operation.mjs +60 -0
- package/Operation.mjs.map +1 -0
- package/Option.d.ts +316 -0
- package/Option.js +103 -0
- package/Option.js.map +1 -0
- package/Option.mjs +65 -0
- package/Option.mjs.map +1 -0
- package/ParsedOperation.d.ts +888 -0
- package/ParsedOperation.js +63 -0
- package/ParsedOperation.js.map +1 -0
- package/ParsedOperation.mjs +26 -0
- package/ParsedOperation.mjs.map +1 -0
- package/ParsedTemplate.d.ts +1032 -0
- package/ParsedTemplate.js +71 -0
- package/ParsedTemplate.js.map +1 -0
- package/ParsedTemplate.mjs +34 -0
- package/ParsedTemplate.mjs.map +1 -0
- package/PersistentState.d.ts +581 -0
- package/PersistentState.js +98 -0
- package/PersistentState.js.map +1 -0
- package/PersistentState.mjs +60 -0
- package/PersistentState.mjs.map +1 -0
- package/PluginActionName.d.ts +23 -0
- package/PluginActionName.js +48 -0
- package/PluginActionName.js.map +1 -0
- package/PluginActionName.mjs +23 -0
- package/PluginActionName.mjs.map +1 -0
- package/PluginDependenciesResponse.d.ts +158 -0
- package/PluginDependenciesResponse.js +63 -0
- package/PluginDependenciesResponse.js.map +1 -0
- package/PluginDependenciesResponse.mjs +28 -0
- package/PluginDependenciesResponse.mjs.map +1 -0
- package/PluginInfo.d.ts +3425 -0
- package/PluginInfo.js +113 -0
- package/PluginInfo.js.map +1 -0
- package/PluginInfo.mjs +76 -0
- package/PluginInfo.mjs.map +1 -0
- package/PluginJsonResponse.d.ts +104 -0
- package/PluginJsonResponse.js +59 -0
- package/PluginJsonResponse.js.map +1 -0
- package/PluginJsonResponse.mjs +25 -0
- package/PluginJsonResponse.mjs.map +1 -0
- package/PluginProxyResponse.d.ts +23 -0
- package/PluginProxyResponse.js +61 -0
- package/PluginProxyResponse.js.map +1 -0
- package/PluginProxyResponse.mjs +25 -0
- package/PluginProxyResponse.mjs.map +1 -0
- package/PluginResponseEncoding.d.ts +39 -0
- package/PluginResponseEncoding.js +63 -0
- package/PluginResponseEncoding.js.map +1 -0
- package/PluginResponseEncoding.mjs +27 -0
- package/PluginResponseEncoding.mjs.map +1 -0
- package/PluginSchema.d.ts +7332 -0
- package/PluginSchema.js +107 -0
- package/PluginSchema.js.map +1 -0
- package/PluginSchema.mjs +70 -0
- package/PluginSchema.mjs.map +1 -0
- package/PositionalArg.d.ts +190 -0
- package/PositionalArg.js +78 -0
- package/PositionalArg.js.map +1 -0
- package/PositionalArg.mjs +41 -0
- package/PositionalArg.mjs.map +1 -0
- package/Provisioner.d.ts +276 -0
- package/Provisioner.js +86 -0
- package/Provisioner.js.map +1 -0
- package/Provisioner.mjs +48 -0
- package/Provisioner.mjs.map +1 -0
- package/ProvisionerID.d.ts +48 -0
- package/ProvisionerID.js +61 -0
- package/ProvisionerID.js.map +1 -0
- package/ProvisionerID.mjs +24 -0
- package/ProvisionerID.mjs.map +1 -0
- package/Provisions.d.ts +244 -0
- package/Provisions.js +93 -0
- package/Provisions.js.map +1 -0
- package/Provisions.mjs +57 -0
- package/Provisions.mjs.map +1 -0
- package/PublicKeyHash.d.ts +49 -0
- package/PublicKeyHash.js +65 -0
- package/PublicKeyHash.js.map +1 -0
- package/PublicKeyHash.mjs +28 -0
- package/PublicKeyHash.mjs.map +1 -0
- package/RequestArgs.d.ts +5557 -0
- package/RequestArgs.js +136 -0
- package/RequestArgs.js.map +1 -0
- package/RequestArgs.mjs +89 -0
- package/RequestArgs.mjs.map +1 -0
- package/SHA256.d.ts +33 -0
- package/SHA256.js +79 -0
- package/SHA256.js.map +1 -0
- package/SHA256.mjs +42 -0
- package/SHA256.mjs.map +1 -0
- package/SandboxAccountConfig.d.ts +152 -0
- package/SandboxAccountConfig.js +72 -0
- package/SandboxAccountConfig.js.map +1 -0
- package/SandboxAccountConfig.mjs +35 -0
- package/SandboxAccountConfig.mjs.map +1 -0
- package/SandboxConfig.d.ts +550 -0
- package/SandboxConfig.js +103 -0
- package/SandboxConfig.js.map +1 -0
- package/SandboxConfig.mjs +66 -0
- package/SandboxConfig.mjs.map +1 -0
- package/SanitizedAbsPath.d.ts +48 -0
- package/SanitizedAbsPath.js +64 -0
- package/SanitizedAbsPath.js.map +1 -0
- package/SanitizedAbsPath.mjs +27 -0
- package/SanitizedAbsPath.mjs.map +1 -0
- package/SanitizedArgs.d.ts +2907 -0
- package/SanitizedArgs.js +269 -0
- package/SanitizedArgs.js.map +1 -0
- package/SanitizedArgs.mjs +197 -0
- package/SanitizedArgs.mjs.map +1 -0
- package/SanitizedPath.d.ts +30 -0
- package/SanitizedPath.js +64 -0
- package/SanitizedPath.js.map +1 -0
- package/SanitizedPath.mjs +28 -0
- package/SanitizedPath.mjs.map +1 -0
- package/ScaffoldConfig.d.ts +6 -0
- package/ScaffoldConfig.js +19 -0
- package/ScaffoldConfig.js.map +1 -0
- package/ScaffoldConfig.mjs +1 -0
- package/ScaffoldConfig.mjs.map +1 -0
- package/Settings.d.ts +82 -0
- package/Settings.js +66 -0
- package/Settings.js.map +1 -0
- package/Settings.mjs +29 -0
- package/Settings.mjs.map +1 -0
- package/SingleChar.d.ts +48 -0
- package/SingleChar.js +62 -0
- package/SingleChar.js.map +1 -0
- package/SingleChar.mjs +25 -0
- package/SingleChar.mjs.map +1 -0
- package/TaqError.d.ts +24 -0
- package/TaqError.js +65 -0
- package/TaqError.js.map +1 -0
- package/TaqError.mjs +35 -0
- package/TaqError.mjs.map +1 -0
- package/Task.d.ts +825 -0
- package/Task.js +95 -0
- package/Task.js.map +1 -0
- package/Task.mjs +58 -0
- package/Task.mjs.map +1 -0
- package/Template.d.ts +1746 -0
- package/Template.js +117 -0
- package/Template.js.map +1 -0
- package/Template.mjs +79 -0
- package/Template.mjs.map +1 -0
- package/Timestamp.d.ts +51 -0
- package/Timestamp.js +65 -0
- package/Timestamp.js.map +1 -0
- package/Timestamp.mjs +27 -0
- package/Timestamp.mjs.map +1 -0
- package/Tz.d.ts +47 -0
- package/Tz.js +62 -0
- package/Tz.js.map +1 -0
- package/Tz.mjs +25 -0
- package/Tz.mjs.map +1 -0
- package/Url.d.ts +49 -0
- package/Url.js +68 -0
- package/Url.js.map +1 -0
- package/Url.mjs +30 -0
- package/Url.mjs.map +1 -0
- package/Verb.d.ts +48 -0
- package/Verb.js +62 -0
- package/Verb.js.map +1 -0
- package/Verb.mjs +25 -0
- package/Verb.mjs.map +1 -0
- package/VersionNumber.d.ts +30 -0
- package/VersionNumber.js +61 -0
- package/VersionNumber.js.map +1 -0
- package/VersionNumber.mjs +25 -0
- package/VersionNumber.mjs.map +1 -0
- package/i18n.d.ts +7 -0
- package/i18n.js +96 -0
- package/i18n.js.map +1 -0
- package/i18n.mjs +67 -0
- package/i18n.mjs.map +1 -0
- package/package.json +31 -3
- package/taqueria-protocol-types.d.ts +72 -0
- package/taqueria-protocol-types.js +142 -0
- package/taqueria-protocol-types.js.map +1 -0
- package/taqueria-protocol-types.mjs +76 -0
- package/taqueria-protocol-types.mjs.map +1 -0
- package/tzkt-config.d.ts +116 -0
- package/tzkt-config.js +65 -0
- package/tzkt-config.js.map +1 -0
- package/tzkt-config.mjs +28 -0
- package/tzkt-config.mjs.map +1 -0
- package/Alias.ts +0 -38
- package/Base.ts +0 -105
- package/Command.ts +0 -26
- package/Config.ts +0 -163
- package/Contract.ts +0 -35
- package/Crypto.ts +0 -3
- package/EconomicalProtocolHash.ts +0 -26
- package/Environment.ts +0 -40
- package/EphemeralState.ts +0 -282
- package/Faucet.ts +0 -46
- package/HumanReadableIdentifier.ts +0 -26
- package/InstalledPlugin.ts +0 -28
- package/LoadedConfig.ts +0 -45
- package/MetadataConfig.ts +0 -37
- package/NetworkConfig.ts +0 -39
- package/Operation.ts +0 -70
- package/Option.ts +0 -64
- package/ParsedOperation.ts +0 -33
- package/ParsedTemplate.ts +0 -40
- package/PersistentState.ts +0 -69
- package/PluginActionName.ts +0 -28
- package/PluginDependenciesResponse.ts +0 -33
- package/PluginInfo.ts +0 -76
- package/PluginJsonResponse.ts +0 -26
- package/PluginProxyResponse.ts +0 -24
- package/PluginResponseEncoding.ts +0 -27
- package/PluginSchema.ts +0 -81
- package/PositionalArg.ts +0 -41
- package/Provisioner.ts +0 -61
- package/ProvisionerID.ts +0 -25
- package/Provisions.ts +0 -70
- package/PublicKeyHash.ts +0 -28
- package/RequestArgs.ts +0 -97
- package/SHA256.ts +0 -42
- package/SandboxAccountConfig.ts +0 -35
- package/SandboxConfig.ts +0 -63
- package/SanitizedAbsPath.ts +0 -23
- package/SanitizedArgs.ts +0 -213
- package/SanitizedPath.ts +0 -28
- package/ScaffoldConfig.ts +0 -6
- package/Settings.ts +0 -27
- package/SingleChar.ts +0 -23
- package/TaqError.ts +0 -78
- package/Task.ts +0 -57
- package/Template.ts +0 -77
- package/Timestamp.ts +0 -25
- package/Tz.ts +0 -22
- package/Url.ts +0 -28
- package/Verb.ts +0 -23
- package/VersionNumber.ts +0 -25
- package/i18n.ts +0 -74
- package/taqueria-protocol-types.ts +0 -36
package/SanitizedArgs.ts
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import * as PluginResponseEncoding from '@taqueria/protocol/PluginResponseEncoding';
|
|
3
|
-
import * as SanitizedAbsPath from '@taqueria/protocol/SanitizedAbsPath';
|
|
4
|
-
import * as Url from '@taqueria/protocol/Url';
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
export const rawSchema = z.object({
|
|
8
|
-
_: z.array(z.union([z.string().min(1), z.number()])),
|
|
9
|
-
projectDir: SanitizedAbsPath.schemas.schema,
|
|
10
|
-
maxConcurrency: z.preprocess(
|
|
11
|
-
val => typeof val === 'string' ? parseInt(val) : Number(val),
|
|
12
|
-
z.number().int().min(1).default(10),
|
|
13
|
-
),
|
|
14
|
-
debug: z.preprocess(
|
|
15
|
-
val => Boolean(val),
|
|
16
|
-
z.boolean().default(false),
|
|
17
|
-
),
|
|
18
|
-
disableState: z.preprocess(
|
|
19
|
-
val => Boolean(val),
|
|
20
|
-
z.boolean().default(false),
|
|
21
|
-
),
|
|
22
|
-
logPluginRequests: z.preprocess(
|
|
23
|
-
val => Boolean(val),
|
|
24
|
-
z.boolean().default(false),
|
|
25
|
-
),
|
|
26
|
-
fromVsCode: z.preprocess(
|
|
27
|
-
val => Boolean(val),
|
|
28
|
-
z.boolean().default(false),
|
|
29
|
-
),
|
|
30
|
-
version: z.preprocess(
|
|
31
|
-
val => Boolean(val),
|
|
32
|
-
z.boolean().optional(),
|
|
33
|
-
),
|
|
34
|
-
build: z.preprocess(
|
|
35
|
-
val => Boolean(val),
|
|
36
|
-
z.boolean().optional(),
|
|
37
|
-
),
|
|
38
|
-
help: z.preprocess(
|
|
39
|
-
val => Boolean(val),
|
|
40
|
-
z.boolean().optional(),
|
|
41
|
-
),
|
|
42
|
-
yes: z.preprocess(
|
|
43
|
-
val => Boolean(val),
|
|
44
|
-
z.boolean().optional(),
|
|
45
|
-
),
|
|
46
|
-
plugin: z.string().min(1).optional(),
|
|
47
|
-
env: z.union([z.literal('production'), z.literal('testing'), z.literal('development'), z.string().nonempty()])
|
|
48
|
-
.default('development'),
|
|
49
|
-
quickstart: z.string().min(1).optional(),
|
|
50
|
-
setBuild: z.preprocess(
|
|
51
|
-
val => String(val),
|
|
52
|
-
z.string().min(3),
|
|
53
|
-
),
|
|
54
|
-
setVersion: z.string().min(3),
|
|
55
|
-
pluginName: z.string().min(1).optional(),
|
|
56
|
-
}, { description: 'Sanitizied Args' }).passthrough();
|
|
57
|
-
|
|
58
|
-
export const scaffoldRawSchema = rawSchema.extend({
|
|
59
|
-
scaffoldProjectDir: z.string().min(1).transform((val: unknown) => val as SanitizedAbsPath.t),
|
|
60
|
-
scaffoldUrl: z.string().min(1).url().transform((val: unknown) => val as Url.t),
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
export const provisionRawSchema = rawSchema
|
|
64
|
-
.extend({
|
|
65
|
-
operation: z
|
|
66
|
-
.string()
|
|
67
|
-
.min(1)
|
|
68
|
-
.describe('Operation name'),
|
|
69
|
-
name: z
|
|
70
|
-
.string()
|
|
71
|
-
.min(1)
|
|
72
|
-
.regex(
|
|
73
|
-
/^[a-z0-9]+[a-z0-9-_]$/,
|
|
74
|
-
'Provisioner name must consist of one or more letters/numbers and may not start with an underscore or dash.',
|
|
75
|
-
)
|
|
76
|
-
.describe('Provisioner name')
|
|
77
|
-
.optional(),
|
|
78
|
-
})
|
|
79
|
-
.passthrough();
|
|
80
|
-
|
|
81
|
-
export const templateRawSchema = rawSchema.extend({
|
|
82
|
-
template: z.string().min(1),
|
|
83
|
-
}).passthrough();
|
|
84
|
-
|
|
85
|
-
export const managePluginRawSchema = rawSchema.omit({ pluginName: true }).extend({
|
|
86
|
-
pluginName: z.string().min(1),
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
export const versionRawSchema = rawSchema.extend({
|
|
90
|
-
version: z.boolean().default(true),
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
export const addContractsRawSchema = z.preprocess(
|
|
94
|
-
val => {
|
|
95
|
-
const obj: {
|
|
96
|
-
contractName?: string;
|
|
97
|
-
sourceFile?: string;
|
|
98
|
-
} = typeof val === 'object' ? Object(val) : ({ contractName: '', sourceFile: '' });
|
|
99
|
-
return !obj.contractName && obj.sourceFile
|
|
100
|
-
? { ...obj, contractName: obj['sourceFile'] }
|
|
101
|
-
: obj;
|
|
102
|
-
},
|
|
103
|
-
rawSchema.extend({
|
|
104
|
-
sourceFile: z.string().min(1),
|
|
105
|
-
contractName: z.string().min(1),
|
|
106
|
-
}),
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
export const removeContractsRawSchema = rawSchema.extend({
|
|
110
|
-
contractName: z.string().min(1),
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
114
|
-
type RawScaffoldInput = z.infer<typeof scaffoldRawSchema>;
|
|
115
|
-
type RawProvisionInput = z.infer<typeof provisionRawSchema>;
|
|
116
|
-
type RawManagePluginInput = z.infer<typeof managePluginRawSchema>;
|
|
117
|
-
type RawVersionInput = z.infer<typeof versionRawSchema>;
|
|
118
|
-
type RawTemplateInput = z.infer<typeof templateRawSchema>;
|
|
119
|
-
type RawAddContractsInput = z.infer<typeof addContractsRawSchema>;
|
|
120
|
-
type RawRemoveContractsInput = z.infer<typeof removeContractsRawSchema>;
|
|
121
|
-
|
|
122
|
-
export const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
|
|
123
|
-
rawSchema,
|
|
124
|
-
parseErrMsg: 'The arguments provided are invalid',
|
|
125
|
-
unknownErrMsg: 'Something went wrong parsing the command-line arguments',
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
export const { create, of, make } = factory;
|
|
129
|
-
|
|
130
|
-
export type SanitizedArgs = z.infer<typeof generatedSchemas.schema>;
|
|
131
|
-
export type t = SanitizedArgs;
|
|
132
|
-
|
|
133
|
-
export const schemas = {
|
|
134
|
-
...generatedSchemas,
|
|
135
|
-
schema: generatedSchemas.schema.transform(val => val as SanitizedArgs),
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
export const scaffoldTaskArgs = createType<RawScaffoldInput, RawScaffoldInput>({
|
|
139
|
-
rawSchema: scaffoldRawSchema,
|
|
140
|
-
parseErrMsg: 'The arguments provided are invalid for the scaffold task',
|
|
141
|
-
unknownErrMsg: 'Something went wrong parsing the arguments for the scaffold task',
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
export const provisionTaskArgs = createType<RawProvisionInput, RawProvisionInput>({
|
|
145
|
-
rawSchema: provisionRawSchema,
|
|
146
|
-
parseErrMsg: 'The arguments provided are invalid for the provision task',
|
|
147
|
-
unknownErrMsg: 'Something went wrong parsing the arguments for the provision task',
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
export const installTaskArgs = createType<RawManagePluginInput, RawManagePluginInput>({
|
|
151
|
-
rawSchema: managePluginRawSchema,
|
|
152
|
-
parseErrMsg: 'The arguments provided are invalid for the install task',
|
|
153
|
-
unknownErrMsg: 'Something went wrong parsing the arguments for the install task',
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
export const uninstallTaskArgs = createType<RawManagePluginInput, RawManagePluginInput>({
|
|
157
|
-
rawSchema: managePluginRawSchema,
|
|
158
|
-
parseErrMsg: 'The arguments provided are invalid for the uninstall task',
|
|
159
|
-
unknownErrMsg: 'Something went wrong parsing the arguments for the uninstall task',
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
export const createTaskArgs = createType<RawTemplateInput, RawTemplateInput>({
|
|
163
|
-
rawSchema: templateRawSchema,
|
|
164
|
-
parseErrMsg: 'The arguments provided are invalid for the create task',
|
|
165
|
-
unknownErrMsg: 'Something went wrong parsing the arguments for the create task',
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
export const addContractArgs = createType<RawAddContractsInput, RawAddContractsInput>({
|
|
169
|
-
rawSchema: addContractsRawSchema,
|
|
170
|
-
parseErrMsg: 'Please specify the source file to register.',
|
|
171
|
-
unknownErrMsg: 'Something went wrong parsing the arguments for registering a contract.',
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
export const removeContractsArgs = createType<RawRemoveContractsInput, RawRemoveContractsInput>({
|
|
175
|
-
rawSchema: removeContractsRawSchema,
|
|
176
|
-
parseErrMsg: 'Please specify the contract name to unregister.',
|
|
177
|
-
unknownErrMsg: 'Something went wrong parsing the arguments to unregister a contract.',
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
export type ScaffoldTaskArgs = z.infer<typeof scaffoldTaskArgs.schemas.schema>;
|
|
181
|
-
export type ProvisionTaskArgs = z.infer<typeof provisionTaskArgs.schemas.schema>;
|
|
182
|
-
export type InstallTaskArgs = z.infer<typeof installTaskArgs.schemas.schema>;
|
|
183
|
-
export type UninstallTaskArgs = z.infer<typeof uninstallTaskArgs.schemas.schema>;
|
|
184
|
-
export type CreateTaskArgs = z.infer<typeof createTaskArgs.schemas.schema>;
|
|
185
|
-
export type AddContractArgs = z.infer<typeof addContractArgs.schemas.schema>;
|
|
186
|
-
export type RemoveContractArgs = z.infer<typeof removeContractsArgs.schemas.schema>;
|
|
187
|
-
|
|
188
|
-
export const createScaffoldTaskArgs = scaffoldTaskArgs.factory.from;
|
|
189
|
-
export const makeScaffoldTaskArgs = scaffoldTaskArgs.factory.make;
|
|
190
|
-
export const ofScaffoldTaskArgs = scaffoldTaskArgs.factory.of;
|
|
191
|
-
|
|
192
|
-
export const createProvisionTaskArgs = provisionTaskArgs.factory.create;
|
|
193
|
-
export const makeProvisionTaskArgs = provisionTaskArgs.factory.make;
|
|
194
|
-
export const ofProvisionTaskArgs = provisionTaskArgs.factory.of;
|
|
195
|
-
|
|
196
|
-
export const createInstallTaskArgs = installTaskArgs.factory.create;
|
|
197
|
-
export const makeInstallTaskArgs = installTaskArgs.factory.make;
|
|
198
|
-
export const ofInstallTaskArgs = installTaskArgs.factory.of;
|
|
199
|
-
|
|
200
|
-
export const createUninstallTaskArgs = uninstallTaskArgs.factory.create;
|
|
201
|
-
export const makeUninstallTaskArgs = uninstallTaskArgs.factory.make;
|
|
202
|
-
export const ofUninstallTaskArgs = uninstallTaskArgs.factory.of;
|
|
203
|
-
|
|
204
|
-
export const createCreateTaskArgs = createTaskArgs.factory.create;
|
|
205
|
-
export const makeCreateTaskArgs = createTaskArgs.factory.make;
|
|
206
|
-
export const ofCreateTaskArgs = createTaskArgs.factory.of;
|
|
207
|
-
export const createAddContractArgs = addContractArgs.factory.create;
|
|
208
|
-
export const makeAddContractArgs = addContractArgs.factory.make;
|
|
209
|
-
export const ofAddContractArgs = addContractArgs.factory.of;
|
|
210
|
-
|
|
211
|
-
export const createRemoveContractsArgs = removeContractsArgs.factory.create;
|
|
212
|
-
export const makeRemoveContractsArgs = removeContractsArgs.factory.make;
|
|
213
|
-
export const ofRemoveContractsArgs = removeContractsArgs.factory.of;
|
package/SanitizedPath.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const rawSchema = z
|
|
5
|
-
.string({ description: 'Sanitized Path' })
|
|
6
|
-
.transform(value => {
|
|
7
|
-
const result = value.match(/^(\.\.|\.\/|\/)/);
|
|
8
|
-
return result ? value : `./${value}`;
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
12
|
-
|
|
13
|
-
const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
|
|
14
|
-
isStringLike: true,
|
|
15
|
-
rawSchema,
|
|
16
|
-
parseErrMsg: (value: unknown) => `${value} is an invalid filesystem path`,
|
|
17
|
-
unknownErrMsg: (value: unknown) => `Something went wrong trying to parse the filesystem path, ${value}`,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export const internalSchema = generatedSchemas.schema;
|
|
21
|
-
|
|
22
|
-
export type SanitizedPath = z.infer<typeof internalSchema>;
|
|
23
|
-
export type t = SanitizedPath;
|
|
24
|
-
export const { create, of, make } = factory;
|
|
25
|
-
export const schemas = {
|
|
26
|
-
...generatedSchemas,
|
|
27
|
-
schema: generatedSchemas.schema.transform(val => val as SanitizedPath),
|
|
28
|
-
};
|
package/ScaffoldConfig.ts
DELETED
package/Settings.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const rawSchema = z.object({
|
|
5
|
-
consent: z.union(
|
|
6
|
-
[z.literal('opt_in'), z.literal('opt_out')],
|
|
7
|
-
{ description: 'Consent' },
|
|
8
|
-
),
|
|
9
|
-
}).describe('Setting');
|
|
10
|
-
|
|
11
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
12
|
-
|
|
13
|
-
export const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
|
|
14
|
-
rawSchema,
|
|
15
|
-
parseErrMsg: (value: unknown) => `${value} is not a valid settings type`,
|
|
16
|
-
unknownErrMsg: 'Something went wrong when parsing the settings file',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export type Settings = z.infer<typeof generatedSchemas.schema>;
|
|
20
|
-
export type t = Settings;
|
|
21
|
-
|
|
22
|
-
export const { create, of, make } = factory;
|
|
23
|
-
|
|
24
|
-
export const schemas = {
|
|
25
|
-
...generatedSchemas,
|
|
26
|
-
schema: generatedSchemas.schema.transform(val => val as Settings),
|
|
27
|
-
};
|
package/SingleChar.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const rawSchema = z
|
|
5
|
-
.string({ description: 'Single character' })
|
|
6
|
-
.regex(/^[A-Za-z]$/, 'Must be a single character');
|
|
7
|
-
|
|
8
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
9
|
-
|
|
10
|
-
export const { factory, schemas: generatedSchemas } = createType<RawInput, RawInput>({
|
|
11
|
-
isStringLike: true,
|
|
12
|
-
rawSchema,
|
|
13
|
-
parseErrMsg: (value: unknown) => `${value} is not a single character`,
|
|
14
|
-
unknownErrMsg: `Something went wrong trying to parse a single character`,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export type SingleChar = z.infer<typeof generatedSchemas.schema>;
|
|
18
|
-
export type t = SingleChar;
|
|
19
|
-
export const { create, of, make } = factory;
|
|
20
|
-
export const schemas = {
|
|
21
|
-
...generatedSchemas,
|
|
22
|
-
schema: generatedSchemas.schema.transform(val => val as SingleChar),
|
|
23
|
-
};
|
package/TaqError.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { map, reject } from 'fluture';
|
|
2
|
-
import { ZodError } from 'zod';
|
|
3
|
-
|
|
4
|
-
export type ErrorType =
|
|
5
|
-
| 'E_INVALID_PATH_DOES_NOT_EXIST'
|
|
6
|
-
| 'E_INVALID_PATH_EXISTS_AND_NOT_AN_EMPTY_DIR'
|
|
7
|
-
| 'E_INVALID_PATH_ALREADY_EXISTS'
|
|
8
|
-
| 'E_INVALID_CONFIG'
|
|
9
|
-
| 'E_INVALID_JSON'
|
|
10
|
-
| 'E_FORK'
|
|
11
|
-
| 'E_INVALID_TASK'
|
|
12
|
-
| 'E_READFILE'
|
|
13
|
-
| 'E_NPM_INIT'
|
|
14
|
-
| 'E_INVALID_PLUGIN_RESPONSE'
|
|
15
|
-
| 'E_INVALID_ARGS'
|
|
16
|
-
| 'E_MKDIR_FAILED'
|
|
17
|
-
| 'E_GIT_CLONE_FAILED'
|
|
18
|
-
| 'E_PROVISION'
|
|
19
|
-
| 'E_PARSE'
|
|
20
|
-
| 'E_PARSE_UNKNOWN'
|
|
21
|
-
| 'E_INVALID_ARCH'
|
|
22
|
-
| 'E_CONTRACT_REGISTERED'
|
|
23
|
-
| 'E_CONTRACT_NOT_REGISTERED'
|
|
24
|
-
| 'E_NO_PROVISIONS'
|
|
25
|
-
| 'E_INTERNAL_LOGICAL_VALIDATION_FAILURE'
|
|
26
|
-
| 'E_EXEC';
|
|
27
|
-
|
|
28
|
-
export interface TaqError {
|
|
29
|
-
readonly kind: ErrorType;
|
|
30
|
-
msg: string;
|
|
31
|
-
previous?: TaqError | Error | unknown;
|
|
32
|
-
context?: unknown;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type t = TaqError;
|
|
36
|
-
|
|
37
|
-
export class E_TaqError extends Error {
|
|
38
|
-
readonly context;
|
|
39
|
-
readonly kind;
|
|
40
|
-
readonly previous;
|
|
41
|
-
constructor(taqErr: TaqError) {
|
|
42
|
-
super(taqErr.msg);
|
|
43
|
-
this.context = taqErr.context;
|
|
44
|
-
this.kind = taqErr.kind;
|
|
45
|
-
this.name = this.kind;
|
|
46
|
-
this.previous = taqErr.previous;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const toFutureParseErr = <T>(previous: ZodError, msg: string, context?: unknown) =>
|
|
51
|
-
reject(toParseErr(previous, msg, context))
|
|
52
|
-
.pipe(map((val: unknown) => val as T));
|
|
53
|
-
|
|
54
|
-
export const toParseErr = (previous: ZodError, msg: string, context?: unknown) =>
|
|
55
|
-
create({
|
|
56
|
-
kind: 'E_PARSE',
|
|
57
|
-
msg: msg,
|
|
58
|
-
context,
|
|
59
|
-
previous,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
export const toParseUnknownErr = (previous: Error | TaqError | E_TaqError | unknown, msg: string, context?: unknown) =>
|
|
63
|
-
create({
|
|
64
|
-
kind: 'E_PARSE_UNKNOWN',
|
|
65
|
-
msg: msg,
|
|
66
|
-
context,
|
|
67
|
-
previous,
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
export const toFutureParseUnknownErr = <T>(
|
|
71
|
-
previous: Error | TaqError | E_TaqError | unknown,
|
|
72
|
-
msg: string,
|
|
73
|
-
context?: unknown,
|
|
74
|
-
) =>
|
|
75
|
-
reject(toParseUnknownErr(previous, msg, context))
|
|
76
|
-
.pipe(map((val: unknown) => val as T));
|
|
77
|
-
|
|
78
|
-
export const create = (err: TaqError) => err;
|
package/Task.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as Alias from '@taqueria/protocol/Alias';
|
|
2
|
-
import createType, { Flatten } from '@taqueria/protocol/Base';
|
|
3
|
-
import * as Command from '@taqueria/protocol/Command';
|
|
4
|
-
import * as Option from '@taqueria/protocol/Option';
|
|
5
|
-
import * as PluginResponseEncoding from '@taqueria/protocol/PluginResponseEncoding';
|
|
6
|
-
import * as PositionalArg from '@taqueria/protocol/PositionalArg';
|
|
7
|
-
import * as Verb from '@taqueria/protocol/Verb';
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
|
|
10
|
-
const taskHandlerSchema = z.union([
|
|
11
|
-
z.literal('proxy'),
|
|
12
|
-
z.string().min(1),
|
|
13
|
-
]);
|
|
14
|
-
|
|
15
|
-
export const rawSchema = z.object({
|
|
16
|
-
task: Verb.rawSchema.describe('Task Name'),
|
|
17
|
-
command: Command.rawSchema.describe('Task Command'),
|
|
18
|
-
aliases: z.array(Alias.rawSchema).default([]).describe('Task Aliases').optional(),
|
|
19
|
-
description: z.string({ description: 'Task Description' }).min(3),
|
|
20
|
-
example: z.string({ description: 'Task Example' }).optional(),
|
|
21
|
-
hidden: z.boolean({ description: 'Task Is Hidden' }).default(false).optional(),
|
|
22
|
-
encoding: PluginResponseEncoding.rawSchema.optional(),
|
|
23
|
-
handler: taskHandlerSchema.describe('Task Handler'),
|
|
24
|
-
options: z.array(Option.rawSchema).default([]).describe('Task Options').optional(),
|
|
25
|
-
positionals: z.array(PositionalArg.rawSchema).default([]).describe('Task Positional Args').optional(),
|
|
26
|
-
}).describe('Task');
|
|
27
|
-
|
|
28
|
-
const internalSchema = rawSchema.extend({
|
|
29
|
-
task: Verb.schemas.schema.describe('Task Name'),
|
|
30
|
-
command: Command.schemas.schema.describe('Task Command'),
|
|
31
|
-
aliases: z.array(Alias.schemas.schema).default([]).describe('Task Aliases').optional(),
|
|
32
|
-
encoding: PluginResponseEncoding.schemas.schema.optional(),
|
|
33
|
-
handler: taskHandlerSchema.describe('Task Handler'),
|
|
34
|
-
options: z.preprocess(
|
|
35
|
-
val => val ?? [],
|
|
36
|
-
z.array(Option.schemas.schema).describe('Task Options').optional(),
|
|
37
|
-
),
|
|
38
|
-
positionals: z.array(PositionalArg.schemas.schema).default([]).describe('Task Positional Args').optional(),
|
|
39
|
-
}).describe('Task');
|
|
40
|
-
|
|
41
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
42
|
-
type Input = z.infer<typeof internalSchema>;
|
|
43
|
-
|
|
44
|
-
export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
|
|
45
|
-
rawSchema,
|
|
46
|
-
internalSchema,
|
|
47
|
-
parseErrMsg: (value: unknown) => `The following task is invalid: ${value}`,
|
|
48
|
-
unknownErrMsg: 'Something went wrong trying to parse the task',
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export type Task = z.infer<typeof generatedSchemas.schema>;
|
|
52
|
-
export type t = Task;
|
|
53
|
-
export const { create, make, of } = factory;
|
|
54
|
-
export const schemas = {
|
|
55
|
-
...generatedSchemas,
|
|
56
|
-
schema: generatedSchemas.schema.transform(val => val as unknown as Task),
|
|
57
|
-
};
|
package/Template.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import * as Command from '@taqueria/protocol/Command';
|
|
3
|
-
import * as Option from '@taqueria/protocol/Option';
|
|
4
|
-
import * as PluginJsonResponse from '@taqueria/protocol/PluginJsonResponse';
|
|
5
|
-
import * as PluginResponseEncoding from '@taqueria/protocol/PluginResponseEncoding';
|
|
6
|
-
import * as PositionalArg from '@taqueria/protocol/PositionalArg';
|
|
7
|
-
import * as RequestArgs from '@taqueria/protocol/RequestArgs';
|
|
8
|
-
import * as Verb from '@taqueria/protocol/Verb';
|
|
9
|
-
import { z } from 'zod';
|
|
10
|
-
|
|
11
|
-
const handlerSchema = z.union([
|
|
12
|
-
z.string().min(1),
|
|
13
|
-
z.function().args(RequestArgs.schemas.schema).returns(z.union([
|
|
14
|
-
z.void(),
|
|
15
|
-
PluginJsonResponse.schemas.schema,
|
|
16
|
-
PluginJsonResponse.schemas.internalSchema,
|
|
17
|
-
z.promise(
|
|
18
|
-
z.union([
|
|
19
|
-
z.promise(z.void()),
|
|
20
|
-
z.void(),
|
|
21
|
-
PluginJsonResponse.schemas.schema,
|
|
22
|
-
PluginJsonResponse.schemas.internalSchema,
|
|
23
|
-
]),
|
|
24
|
-
),
|
|
25
|
-
])),
|
|
26
|
-
]);
|
|
27
|
-
|
|
28
|
-
export const rawSchema = z.object({
|
|
29
|
-
template: Verb.rawSchema,
|
|
30
|
-
command: Command.rawSchema,
|
|
31
|
-
description: z.string().min(4),
|
|
32
|
-
hidden: z.preprocess(
|
|
33
|
-
val => val ?? false,
|
|
34
|
-
z.boolean(),
|
|
35
|
-
).optional(),
|
|
36
|
-
options: z.preprocess(
|
|
37
|
-
val => val ?? [],
|
|
38
|
-
z.array(Option.rawSchema),
|
|
39
|
-
).optional(),
|
|
40
|
-
positionals: z.preprocess(
|
|
41
|
-
val => val ?? [],
|
|
42
|
-
z.array(PositionalArg.rawSchema),
|
|
43
|
-
).optional(),
|
|
44
|
-
handler: handlerSchema.describe('Template Handler'),
|
|
45
|
-
encoding: PluginResponseEncoding.schemas.schema.optional(),
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export const internalSchema = rawSchema.extend({
|
|
49
|
-
template: Verb.schemas.schema,
|
|
50
|
-
command: Command.schemas.schema,
|
|
51
|
-
options: z.preprocess(
|
|
52
|
-
val => val ?? [],
|
|
53
|
-
z.array(Option.schemas.schema),
|
|
54
|
-
).optional(),
|
|
55
|
-
positionals: z.preprocess(
|
|
56
|
-
val => val ?? [],
|
|
57
|
-
z.array(PositionalArg.schemas.schema),
|
|
58
|
-
).optional(),
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
62
|
-
type Input = z.infer<typeof internalSchema>;
|
|
63
|
-
|
|
64
|
-
export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
|
|
65
|
-
rawSchema,
|
|
66
|
-
internalSchema,
|
|
67
|
-
parseErrMsg: (value: unknown) => `The following template is invalid: ${value}`,
|
|
68
|
-
unknownErrMsg: 'Something went wrong trying to parse the template',
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
export type Template = z.infer<typeof generatedSchemas.schema>;
|
|
72
|
-
export type t = Template;
|
|
73
|
-
export const { create, make, of } = factory;
|
|
74
|
-
export const schemas = {
|
|
75
|
-
...generatedSchemas,
|
|
76
|
-
schema: generatedSchemas.schema.transform(val => val as unknown as Template),
|
|
77
|
-
};
|
package/Timestamp.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const rawSchema = z
|
|
5
|
-
.number({ description: 'Timestamp' })
|
|
6
|
-
.min(1651846877);
|
|
7
|
-
|
|
8
|
-
type Input = z.infer<typeof rawSchema>;
|
|
9
|
-
|
|
10
|
-
export const { factory, schemas: generatedSchemas } = createType<Input, Input>({
|
|
11
|
-
isStringLike: true,
|
|
12
|
-
rawSchema,
|
|
13
|
-
parseErrMsg: (value: unknown) => `${value} is an invalid timestamp`,
|
|
14
|
-
unknownErrMsg: `Something went wrong trying to parse a timestamp`,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export type Timestamp = z.infer<typeof generatedSchemas.schema>;
|
|
18
|
-
export type t = Timestamp;
|
|
19
|
-
export const { create, make, of } = factory;
|
|
20
|
-
export const schemas = {
|
|
21
|
-
...generatedSchemas,
|
|
22
|
-
schema: generatedSchemas.schema.transform(val => val as Timestamp),
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const now = () => Date.now() as Timestamp;
|
package/Tz.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const rawSchema = z.string({ description: 'Tz' }).min(1).regex(/^\d([\d_]+\d)?$/);
|
|
5
|
-
|
|
6
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
7
|
-
|
|
8
|
-
export const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
|
|
9
|
-
isStringLike: true,
|
|
10
|
-
rawSchema,
|
|
11
|
-
parseErrMsg: (value: unknown) => `${value} is an invalid Tz amount`,
|
|
12
|
-
unknownErrMsg: 'Something went wrong when parsing the Tz amount',
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export type Tz = z.infer<typeof generatedSchemas.schema>;
|
|
16
|
-
|
|
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/Url.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const rawSchema = z
|
|
5
|
-
.string({ description: 'Url' })
|
|
6
|
-
.url();
|
|
7
|
-
|
|
8
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
9
|
-
|
|
10
|
-
export const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
|
|
11
|
-
rawSchema,
|
|
12
|
-
isStringLike: true,
|
|
13
|
-
parseErrMsg: (value: unknown) => `${value} is an invalid url`,
|
|
14
|
-
unknownErrMsg: 'Something went wrong trying to parse the url',
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const toComponents = (url: Url) => {
|
|
18
|
-
const parts = new URL(url.toString());
|
|
19
|
-
return parts;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type Url = z.infer<typeof generatedSchemas.schema>;
|
|
23
|
-
export type t = Url;
|
|
24
|
-
export const { create, of, make } = factory;
|
|
25
|
-
export const schemas = {
|
|
26
|
-
...generatedSchemas,
|
|
27
|
-
schema: generatedSchemas.schema.transform(val => val as Url),
|
|
28
|
-
};
|
package/Verb.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const rawSchema = z
|
|
5
|
-
.string({ description: 'Verb' })
|
|
6
|
-
.min(1, 'Must be a valid verb')
|
|
7
|
-
.regex(/^[A-Za-z\-\ ]+/, 'Must be a valid verb');
|
|
8
|
-
|
|
9
|
-
type Input = z.infer<typeof rawSchema>;
|
|
10
|
-
|
|
11
|
-
export const { factory, schemas: generatedSchemas } = createType<Input, Input>({
|
|
12
|
-
isStringLike: true,
|
|
13
|
-
rawSchema,
|
|
14
|
-
parseErrMsg: (value: unknown) => `${value} is not an invalid verb`,
|
|
15
|
-
unknownErrMsg: `Something went wrong trying to parse a verb`,
|
|
16
|
-
});
|
|
17
|
-
export type Verb = z.infer<typeof generatedSchemas.schema>;
|
|
18
|
-
export type t = Verb;
|
|
19
|
-
export const { create, make, of } = factory;
|
|
20
|
-
export const schemas = {
|
|
21
|
-
...generatedSchemas,
|
|
22
|
-
schema: generatedSchemas.schema.transform(val => val as Verb),
|
|
23
|
-
};
|
package/VersionNumber.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import createType from '@taqueria/protocol/Base';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const rawSchema = z.string({ description: 'Version Number' })
|
|
5
|
-
.min(1)
|
|
6
|
-
.regex(/^\d+\.\d+(\.\d+)*$/);
|
|
7
|
-
|
|
8
|
-
type RawInput = z.infer<typeof rawSchema>;
|
|
9
|
-
|
|
10
|
-
const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
|
|
11
|
-
isStringLike: true,
|
|
12
|
-
rawSchema,
|
|
13
|
-
parseErrMsg: (value: unknown) => `${value} is an invalid version number`,
|
|
14
|
-
unknownErrMsg: 'Something went wrong trying to parse the version number',
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const internalSchema = generatedSchemas.schema;
|
|
18
|
-
|
|
19
|
-
export type VersionNumber = z.infer<typeof internalSchema>;
|
|
20
|
-
export type t = VersionNumber;
|
|
21
|
-
export const { create, of, make } = factory;
|
|
22
|
-
export const schemas = {
|
|
23
|
-
...generatedSchemas,
|
|
24
|
-
schema: generatedSchemas.schema.transform(val => val as VersionNumber),
|
|
25
|
-
};
|