@taqueria/protocol 0.16.0 → 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 -66
- 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/tzkt-config.ts +0 -27
package/Template.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// Template.ts
|
|
27
|
+
var Template_exports = {};
|
|
28
|
+
__export(Template_exports, {
|
|
29
|
+
create: () => create,
|
|
30
|
+
factory: () => factory,
|
|
31
|
+
generatedSchemas: () => generatedSchemas,
|
|
32
|
+
internalSchema: () => internalSchema,
|
|
33
|
+
make: () => make,
|
|
34
|
+
of: () => of,
|
|
35
|
+
rawSchema: () => rawSchema5,
|
|
36
|
+
schemas: () => schemas8
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(Template_exports);
|
|
39
|
+
var import_Base = __toESM(require("@taqueria/protocol/Base"));
|
|
40
|
+
var Command = __toESM(require("@taqueria/protocol/Command"));
|
|
41
|
+
var Option = __toESM(require("@taqueria/protocol/Option"));
|
|
42
|
+
var PluginJsonResponse = __toESM(require("@taqueria/protocol/PluginJsonResponse"));
|
|
43
|
+
var PluginResponseEncoding = __toESM(require("@taqueria/protocol/PluginResponseEncoding"));
|
|
44
|
+
var PositionalArg = __toESM(require("@taqueria/protocol/PositionalArg"));
|
|
45
|
+
var RequestArgs = __toESM(require("@taqueria/protocol/RequestArgs"));
|
|
46
|
+
var Verb = __toESM(require("@taqueria/protocol/Verb"));
|
|
47
|
+
var import_zod = require("zod");
|
|
48
|
+
var handlerSchema = import_zod.z.union([
|
|
49
|
+
import_zod.z.string().min(1),
|
|
50
|
+
import_zod.z.function().args(RequestArgs.schemas.schema).returns(import_zod.z.union([
|
|
51
|
+
import_zod.z.void(),
|
|
52
|
+
PluginJsonResponse.schemas.schema,
|
|
53
|
+
PluginJsonResponse.schemas.internalSchema,
|
|
54
|
+
import_zod.z.promise(
|
|
55
|
+
import_zod.z.union([
|
|
56
|
+
import_zod.z.promise(import_zod.z.void()),
|
|
57
|
+
import_zod.z.void(),
|
|
58
|
+
PluginJsonResponse.schemas.schema,
|
|
59
|
+
PluginJsonResponse.schemas.internalSchema
|
|
60
|
+
])
|
|
61
|
+
)
|
|
62
|
+
]))
|
|
63
|
+
]);
|
|
64
|
+
var rawSchema5 = import_zod.z.object({
|
|
65
|
+
template: Verb.rawSchema,
|
|
66
|
+
command: Command.rawSchema,
|
|
67
|
+
description: import_zod.z.string().min(4),
|
|
68
|
+
hidden: import_zod.z.preprocess(
|
|
69
|
+
(val) => val ?? false,
|
|
70
|
+
import_zod.z.boolean()
|
|
71
|
+
).optional(),
|
|
72
|
+
options: import_zod.z.preprocess(
|
|
73
|
+
(val) => val ?? [],
|
|
74
|
+
import_zod.z.array(Option.rawSchema)
|
|
75
|
+
).optional(),
|
|
76
|
+
positionals: import_zod.z.preprocess(
|
|
77
|
+
(val) => val ?? [],
|
|
78
|
+
import_zod.z.array(PositionalArg.rawSchema)
|
|
79
|
+
).optional(),
|
|
80
|
+
handler: handlerSchema.describe("Template Handler"),
|
|
81
|
+
encoding: PluginResponseEncoding.schemas.schema.optional()
|
|
82
|
+
});
|
|
83
|
+
var internalSchema = rawSchema5.extend({
|
|
84
|
+
template: Verb.schemas.schema,
|
|
85
|
+
command: Command.schemas.schema,
|
|
86
|
+
options: import_zod.z.preprocess(
|
|
87
|
+
(val) => val ?? [],
|
|
88
|
+
import_zod.z.array(Option.schemas.schema)
|
|
89
|
+
).optional(),
|
|
90
|
+
positionals: import_zod.z.preprocess(
|
|
91
|
+
(val) => val ?? [],
|
|
92
|
+
import_zod.z.array(PositionalArg.schemas.schema)
|
|
93
|
+
).optional()
|
|
94
|
+
});
|
|
95
|
+
var { schemas: generatedSchemas, factory } = (0, import_Base.default)({
|
|
96
|
+
rawSchema: rawSchema5,
|
|
97
|
+
internalSchema,
|
|
98
|
+
parseErrMsg: (value) => `The following template is invalid: ${value}`,
|
|
99
|
+
unknownErrMsg: "Something went wrong trying to parse the template"
|
|
100
|
+
});
|
|
101
|
+
var { create, make, of } = factory;
|
|
102
|
+
var schemas8 = {
|
|
103
|
+
...generatedSchemas,
|
|
104
|
+
schema: generatedSchemas.schema.transform((val) => val)
|
|
105
|
+
};
|
|
106
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
107
|
+
0 && (module.exports = {
|
|
108
|
+
create,
|
|
109
|
+
factory,
|
|
110
|
+
generatedSchemas,
|
|
111
|
+
internalSchema,
|
|
112
|
+
make,
|
|
113
|
+
of,
|
|
114
|
+
rawSchema,
|
|
115
|
+
schemas
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=Template.js.map
|
package/Template.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Template.ts"],"sourcesContent":["import createType from '@taqueria/protocol/Base';\nimport * as Command from '@taqueria/protocol/Command';\nimport * as Option from '@taqueria/protocol/Option';\nimport * as PluginJsonResponse from '@taqueria/protocol/PluginJsonResponse';\nimport * as PluginResponseEncoding from '@taqueria/protocol/PluginResponseEncoding';\nimport * as PositionalArg from '@taqueria/protocol/PositionalArg';\nimport * as RequestArgs from '@taqueria/protocol/RequestArgs';\nimport * as Verb from '@taqueria/protocol/Verb';\nimport { z } from 'zod';\n\nconst handlerSchema = z.union([\n\tz.string().min(1),\n\tz.function().args(RequestArgs.schemas.schema).returns(z.union([\n\t\tz.void(),\n\t\tPluginJsonResponse.schemas.schema,\n\t\tPluginJsonResponse.schemas.internalSchema,\n\t\tz.promise(\n\t\t\tz.union([\n\t\t\t\tz.promise(z.void()),\n\t\t\t\tz.void(),\n\t\t\t\tPluginJsonResponse.schemas.schema,\n\t\t\t\tPluginJsonResponse.schemas.internalSchema,\n\t\t\t]),\n\t\t),\n\t])),\n]);\n\nexport const rawSchema = z.object({\n\ttemplate: Verb.rawSchema,\n\tcommand: Command.rawSchema,\n\tdescription: z.string().min(4),\n\thidden: z.preprocess(\n\t\tval => val ?? false,\n\t\tz.boolean(),\n\t).optional(),\n\toptions: z.preprocess(\n\t\tval => val ?? [],\n\t\tz.array(Option.rawSchema),\n\t).optional(),\n\tpositionals: z.preprocess(\n\t\tval => val ?? [],\n\t\tz.array(PositionalArg.rawSchema),\n\t).optional(),\n\thandler: handlerSchema.describe('Template Handler'),\n\tencoding: PluginResponseEncoding.schemas.schema.optional(),\n});\n\nexport const internalSchema = rawSchema.extend({\n\ttemplate: Verb.schemas.schema,\n\tcommand: Command.schemas.schema,\n\toptions: z.preprocess(\n\t\tval => val ?? [],\n\t\tz.array(Option.schemas.schema),\n\t).optional(),\n\tpositionals: z.preprocess(\n\t\tval => val ?? [],\n\t\tz.array(PositionalArg.schemas.schema),\n\t).optional(),\n});\n\ntype RawInput = z.infer<typeof rawSchema>;\ntype Input = z.infer<typeof internalSchema>;\n\nexport const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({\n\trawSchema,\n\tinternalSchema,\n\tparseErrMsg: (value: unknown) => `The following template is invalid: ${value}`,\n\tunknownErrMsg: 'Something went wrong trying to parse the template',\n});\n\nexport type Template = z.infer<typeof generatedSchemas.schema>;\nexport type t = Template;\nexport const { create, make, of } = factory;\nexport const schemas = {\n\t...generatedSchemas,\n\tschema: generatedSchemas.schema.transform(val => val as unknown as Template),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAAA;AAAA,EAAA,eAAAC;AAAA;AAAA;AAAA,kBAAuB;AACvB,cAAyB;AACzB,aAAwB;AACxB,yBAAoC;AACpC,6BAAwC;AACxC,oBAA+B;AAC/B,kBAA6B;AAC7B,WAAsB;AACtB,iBAAkB;AAElB,IAAM,gBAAgB,aAAE,MAAM;AAAA,EAC7B,aAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAChB,aAAE,SAAS,EAAE,KAAiB,oBAAQ,MAAM,EAAE,QAAQ,aAAE,MAAM;AAAA,IAC7D,aAAE,KAAK;AAAA,IACY,2BAAQ;AAAA,IACR,2BAAQ;AAAA,IAC3B,aAAE;AAAA,MACD,aAAE,MAAM;AAAA,QACP,aAAE,QAAQ,aAAE,KAAK,CAAC;AAAA,QAClB,aAAE,KAAK;AAAA,QACY,2BAAQ;AAAA,QACR,2BAAQ;AAAA,MAC5B,CAAC;AAAA,IACF;AAAA,EACD,CAAC,CAAC;AACH,CAAC;AAEM,IAAMD,aAAY,aAAE,OAAO;AAAA,EACjC,UAAe;AAAA,EACf,SAAiB;AAAA,EACjB,aAAa,aAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC7B,QAAQ,aAAE;AAAA,IACT,SAAO,OAAO;AAAA,IACd,aAAE,QAAQ;AAAA,EACX,EAAE,SAAS;AAAA,EACX,SAAS,aAAE;AAAA,IACV,SAAO,OAAO,CAAC;AAAA,IACf,aAAE,MAAa,gBAAS;AAAA,EACzB,EAAE,SAAS;AAAA,EACX,aAAa,aAAE;AAAA,IACd,SAAO,OAAO,CAAC;AAAA,IACf,aAAE,MAAoB,uBAAS;AAAA,EAChC,EAAE,SAAS;AAAA,EACX,SAAS,cAAc,SAAS,kBAAkB;AAAA,EAClD,UAAiC,+BAAQ,OAAO,SAAS;AAC1D,CAAC;AAEM,IAAM,iBAAiBA,WAAU,OAAO;AAAA,EAC9C,UAAe,aAAQ;AAAA,EACvB,SAAiB,gBAAQ;AAAA,EACzB,SAAS,aAAE;AAAA,IACV,SAAO,OAAO,CAAC;AAAA,IACf,aAAE,MAAa,eAAQ,MAAM;AAAA,EAC9B,EAAE,SAAS;AAAA,EACX,aAAa,aAAE;AAAA,IACd,SAAO,OAAO,CAAC;AAAA,IACf,aAAE,MAAoB,sBAAQ,MAAM;AAAA,EACrC,EAAE,SAAS;AACZ,CAAC;AAKM,IAAM,EAAE,SAAS,kBAAkB,QAAQ,QAAI,YAAAE,SAA4B;AAAA,EACjF,WAAAF;AAAA,EACA;AAAA,EACA,aAAa,CAAC,UAAmB,sCAAsC;AAAA,EACvE,eAAe;AAChB,CAAC;AAIM,IAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;AAC7B,IAAMC,WAAU;AAAA,EACtB,GAAG;AAAA,EACH,QAAQ,iBAAiB,OAAO,UAAU,SAAO,GAA0B;AAC5E;","names":["rawSchema","schemas","createType"]}
|
package/Template.mjs
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Template.ts
|
|
2
|
+
import createType from "@taqueria/protocol/Base";
|
|
3
|
+
import * as Command from "@taqueria/protocol/Command";
|
|
4
|
+
import * as Option from "@taqueria/protocol/Option";
|
|
5
|
+
import * as PluginJsonResponse from "@taqueria/protocol/PluginJsonResponse";
|
|
6
|
+
import * as PluginResponseEncoding from "@taqueria/protocol/PluginResponseEncoding";
|
|
7
|
+
import * as PositionalArg from "@taqueria/protocol/PositionalArg";
|
|
8
|
+
import * as RequestArgs from "@taqueria/protocol/RequestArgs";
|
|
9
|
+
import * as Verb from "@taqueria/protocol/Verb";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
var 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
|
+
var rawSchema5 = z.object({
|
|
28
|
+
template: Verb.rawSchema,
|
|
29
|
+
command: Command.rawSchema,
|
|
30
|
+
description: z.string().min(4),
|
|
31
|
+
hidden: z.preprocess(
|
|
32
|
+
(val) => val ?? false,
|
|
33
|
+
z.boolean()
|
|
34
|
+
).optional(),
|
|
35
|
+
options: z.preprocess(
|
|
36
|
+
(val) => val ?? [],
|
|
37
|
+
z.array(Option.rawSchema)
|
|
38
|
+
).optional(),
|
|
39
|
+
positionals: z.preprocess(
|
|
40
|
+
(val) => val ?? [],
|
|
41
|
+
z.array(PositionalArg.rawSchema)
|
|
42
|
+
).optional(),
|
|
43
|
+
handler: handlerSchema.describe("Template Handler"),
|
|
44
|
+
encoding: PluginResponseEncoding.schemas.schema.optional()
|
|
45
|
+
});
|
|
46
|
+
var internalSchema = rawSchema5.extend({
|
|
47
|
+
template: Verb.schemas.schema,
|
|
48
|
+
command: Command.schemas.schema,
|
|
49
|
+
options: z.preprocess(
|
|
50
|
+
(val) => val ?? [],
|
|
51
|
+
z.array(Option.schemas.schema)
|
|
52
|
+
).optional(),
|
|
53
|
+
positionals: z.preprocess(
|
|
54
|
+
(val) => val ?? [],
|
|
55
|
+
z.array(PositionalArg.schemas.schema)
|
|
56
|
+
).optional()
|
|
57
|
+
});
|
|
58
|
+
var { schemas: generatedSchemas, factory } = createType({
|
|
59
|
+
rawSchema: rawSchema5,
|
|
60
|
+
internalSchema,
|
|
61
|
+
parseErrMsg: (value) => `The following template is invalid: ${value}`,
|
|
62
|
+
unknownErrMsg: "Something went wrong trying to parse the template"
|
|
63
|
+
});
|
|
64
|
+
var { create, make, of } = factory;
|
|
65
|
+
var schemas8 = {
|
|
66
|
+
...generatedSchemas,
|
|
67
|
+
schema: generatedSchemas.schema.transform((val) => val)
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
create,
|
|
71
|
+
factory,
|
|
72
|
+
generatedSchemas,
|
|
73
|
+
internalSchema,
|
|
74
|
+
make,
|
|
75
|
+
of,
|
|
76
|
+
rawSchema5 as rawSchema,
|
|
77
|
+
schemas8 as schemas
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=Template.mjs.map
|
package/Template.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Template.ts"],"sourcesContent":["import createType from '@taqueria/protocol/Base';\nimport * as Command from '@taqueria/protocol/Command';\nimport * as Option from '@taqueria/protocol/Option';\nimport * as PluginJsonResponse from '@taqueria/protocol/PluginJsonResponse';\nimport * as PluginResponseEncoding from '@taqueria/protocol/PluginResponseEncoding';\nimport * as PositionalArg from '@taqueria/protocol/PositionalArg';\nimport * as RequestArgs from '@taqueria/protocol/RequestArgs';\nimport * as Verb from '@taqueria/protocol/Verb';\nimport { z } from 'zod';\n\nconst handlerSchema = z.union([\n\tz.string().min(1),\n\tz.function().args(RequestArgs.schemas.schema).returns(z.union([\n\t\tz.void(),\n\t\tPluginJsonResponse.schemas.schema,\n\t\tPluginJsonResponse.schemas.internalSchema,\n\t\tz.promise(\n\t\t\tz.union([\n\t\t\t\tz.promise(z.void()),\n\t\t\t\tz.void(),\n\t\t\t\tPluginJsonResponse.schemas.schema,\n\t\t\t\tPluginJsonResponse.schemas.internalSchema,\n\t\t\t]),\n\t\t),\n\t])),\n]);\n\nexport const rawSchema = z.object({\n\ttemplate: Verb.rawSchema,\n\tcommand: Command.rawSchema,\n\tdescription: z.string().min(4),\n\thidden: z.preprocess(\n\t\tval => val ?? false,\n\t\tz.boolean(),\n\t).optional(),\n\toptions: z.preprocess(\n\t\tval => val ?? [],\n\t\tz.array(Option.rawSchema),\n\t).optional(),\n\tpositionals: z.preprocess(\n\t\tval => val ?? [],\n\t\tz.array(PositionalArg.rawSchema),\n\t).optional(),\n\thandler: handlerSchema.describe('Template Handler'),\n\tencoding: PluginResponseEncoding.schemas.schema.optional(),\n});\n\nexport const internalSchema = rawSchema.extend({\n\ttemplate: Verb.schemas.schema,\n\tcommand: Command.schemas.schema,\n\toptions: z.preprocess(\n\t\tval => val ?? [],\n\t\tz.array(Option.schemas.schema),\n\t).optional(),\n\tpositionals: z.preprocess(\n\t\tval => val ?? [],\n\t\tz.array(PositionalArg.schemas.schema),\n\t).optional(),\n});\n\ntype RawInput = z.infer<typeof rawSchema>;\ntype Input = z.infer<typeof internalSchema>;\n\nexport const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({\n\trawSchema,\n\tinternalSchema,\n\tparseErrMsg: (value: unknown) => `The following template is invalid: ${value}`,\n\tunknownErrMsg: 'Something went wrong trying to parse the template',\n});\n\nexport type Template = z.infer<typeof generatedSchemas.schema>;\nexport type t = Template;\nexport const { create, make, of } = factory;\nexport const schemas = {\n\t...generatedSchemas,\n\tschema: generatedSchemas.schema.transform(val => val as unknown as Template),\n};\n"],"mappings":";AAAA,OAAO,gBAAgB;AACvB,YAAY,aAAa;AACzB,YAAY,YAAY;AACxB,YAAY,wBAAwB;AACpC,YAAY,4BAA4B;AACxC,YAAY,mBAAmB;AAC/B,YAAY,iBAAiB;AAC7B,YAAY,UAAU;AACtB,SAAS,SAAS;AAElB,IAAM,gBAAgB,EAAE,MAAM;AAAA,EAC7B,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAChB,EAAE,SAAS,EAAE,KAAiB,oBAAQ,MAAM,EAAE,QAAQ,EAAE,MAAM;AAAA,IAC7D,EAAE,KAAK;AAAA,IACY,2BAAQ;AAAA,IACR,2BAAQ;AAAA,IAC3B,EAAE;AAAA,MACD,EAAE,MAAM;AAAA,QACP,EAAE,QAAQ,EAAE,KAAK,CAAC;AAAA,QAClB,EAAE,KAAK;AAAA,QACY,2BAAQ;AAAA,QACR,2BAAQ;AAAA,MAC5B,CAAC;AAAA,IACF;AAAA,EACD,CAAC,CAAC;AACH,CAAC;AAEM,IAAMA,aAAY,EAAE,OAAO;AAAA,EACjC,UAAe;AAAA,EACf,SAAiB;AAAA,EACjB,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC7B,QAAQ,EAAE;AAAA,IACT,SAAO,OAAO;AAAA,IACd,EAAE,QAAQ;AAAA,EACX,EAAE,SAAS;AAAA,EACX,SAAS,EAAE;AAAA,IACV,SAAO,OAAO,CAAC;AAAA,IACf,EAAE,MAAa,gBAAS;AAAA,EACzB,EAAE,SAAS;AAAA,EACX,aAAa,EAAE;AAAA,IACd,SAAO,OAAO,CAAC;AAAA,IACf,EAAE,MAAoB,uBAAS;AAAA,EAChC,EAAE,SAAS;AAAA,EACX,SAAS,cAAc,SAAS,kBAAkB;AAAA,EAClD,UAAiC,+BAAQ,OAAO,SAAS;AAC1D,CAAC;AAEM,IAAM,iBAAiBA,WAAU,OAAO;AAAA,EAC9C,UAAe,aAAQ;AAAA,EACvB,SAAiB,gBAAQ;AAAA,EACzB,SAAS,EAAE;AAAA,IACV,SAAO,OAAO,CAAC;AAAA,IACf,EAAE,MAAa,eAAQ,MAAM;AAAA,EAC9B,EAAE,SAAS;AAAA,EACX,aAAa,EAAE;AAAA,IACd,SAAO,OAAO,CAAC;AAAA,IACf,EAAE,MAAoB,sBAAQ,MAAM;AAAA,EACrC,EAAE,SAAS;AACZ,CAAC;AAKM,IAAM,EAAE,SAAS,kBAAkB,QAAQ,IAAI,WAA4B;AAAA,EACjF,WAAAA;AAAA,EACA;AAAA,EACA,aAAa,CAAC,UAAmB,sCAAsC;AAAA,EACvE,eAAe;AAChB,CAAC;AAIM,IAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;AAC7B,IAAMC,WAAU;AAAA,EACtB,GAAG;AAAA,EACH,QAAQ,iBAAiB,OAAO,UAAU,SAAO,GAA0B;AAC5E;","names":["rawSchema","schemas"]}
|
package/Timestamp.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as fluture from 'fluture';
|
|
2
|
+
import { TaqError } from './TaqError.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const rawSchema: z.ZodNumber;
|
|
6
|
+
declare const factory: {
|
|
7
|
+
make: (input: number) => fluture.FutureInstance<TaqError, number & {
|
|
8
|
+
readonly __kind: any;
|
|
9
|
+
}>;
|
|
10
|
+
of: (input: unknown) => fluture.FutureInstance<TaqError, number & {
|
|
11
|
+
readonly __kind: any;
|
|
12
|
+
}>;
|
|
13
|
+
create: (input: number) => number & {
|
|
14
|
+
readonly __kind: any;
|
|
15
|
+
};
|
|
16
|
+
from: (input: unknown) => number & {
|
|
17
|
+
readonly __kind: any;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
declare const generatedSchemas: {
|
|
21
|
+
rawSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
22
|
+
internalSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
23
|
+
schema: z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, number & {
|
|
24
|
+
readonly __kind: any;
|
|
25
|
+
}, any>;
|
|
26
|
+
};
|
|
27
|
+
declare type Timestamp = z.infer<typeof generatedSchemas.schema>;
|
|
28
|
+
declare type t = Timestamp;
|
|
29
|
+
declare const create: (input: number) => number & {
|
|
30
|
+
readonly __kind: any;
|
|
31
|
+
};
|
|
32
|
+
declare const make: (input: number) => fluture.FutureInstance<TaqError, number & {
|
|
33
|
+
readonly __kind: any;
|
|
34
|
+
}>;
|
|
35
|
+
declare const of: (input: unknown) => fluture.FutureInstance<TaqError, number & {
|
|
36
|
+
readonly __kind: any;
|
|
37
|
+
}>;
|
|
38
|
+
declare const schemas: {
|
|
39
|
+
schema: z.ZodEffects<z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, number & {
|
|
40
|
+
readonly __kind: any;
|
|
41
|
+
}, any>, number & {
|
|
42
|
+
readonly __kind: any;
|
|
43
|
+
}, any>;
|
|
44
|
+
rawSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
45
|
+
internalSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
46
|
+
};
|
|
47
|
+
declare const now: () => number & {
|
|
48
|
+
readonly __kind: any;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { Timestamp, create, factory, generatedSchemas, make, now, of, rawSchema, schemas, t };
|
package/Timestamp.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// Timestamp.ts
|
|
27
|
+
var Timestamp_exports = {};
|
|
28
|
+
__export(Timestamp_exports, {
|
|
29
|
+
create: () => create,
|
|
30
|
+
factory: () => factory,
|
|
31
|
+
generatedSchemas: () => generatedSchemas,
|
|
32
|
+
make: () => make,
|
|
33
|
+
now: () => now,
|
|
34
|
+
of: () => of,
|
|
35
|
+
rawSchema: () => rawSchema,
|
|
36
|
+
schemas: () => schemas
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(Timestamp_exports);
|
|
39
|
+
var import_Base = __toESM(require("@taqueria/protocol/Base"));
|
|
40
|
+
var import_zod = require("zod");
|
|
41
|
+
var rawSchema = import_zod.z.number({ description: "Timestamp" }).min(1651846877);
|
|
42
|
+
var { factory, schemas: generatedSchemas } = (0, import_Base.default)({
|
|
43
|
+
isStringLike: true,
|
|
44
|
+
rawSchema,
|
|
45
|
+
parseErrMsg: (value) => `${value} is an invalid timestamp`,
|
|
46
|
+
unknownErrMsg: `Something went wrong trying to parse a timestamp`
|
|
47
|
+
});
|
|
48
|
+
var { create, make, of } = factory;
|
|
49
|
+
var schemas = {
|
|
50
|
+
...generatedSchemas,
|
|
51
|
+
schema: generatedSchemas.schema.transform((val) => val)
|
|
52
|
+
};
|
|
53
|
+
var now = () => Date.now();
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
create,
|
|
57
|
+
factory,
|
|
58
|
+
generatedSchemas,
|
|
59
|
+
make,
|
|
60
|
+
now,
|
|
61
|
+
of,
|
|
62
|
+
rawSchema,
|
|
63
|
+
schemas
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=Timestamp.js.map
|
package/Timestamp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Timestamp.ts"],"sourcesContent":["import createType from '@taqueria/protocol/Base';\nimport { z } from 'zod';\n\nexport const rawSchema = z\n\t.number({ description: 'Timestamp' })\n\t.min(1651846877);\n\ntype Input = z.infer<typeof rawSchema>;\n\nexport const { factory, schemas: generatedSchemas } = createType<Input, Input>({\n\tisStringLike: true,\n\trawSchema,\n\tparseErrMsg: (value: unknown) => `${value} is an invalid timestamp`,\n\tunknownErrMsg: `Something went wrong trying to parse a timestamp`,\n});\n\nexport type Timestamp = z.infer<typeof generatedSchemas.schema>;\nexport type t = Timestamp;\nexport const { create, make, of } = factory;\nexport const schemas = {\n\t...generatedSchemas,\n\tschema: generatedSchemas.schema.transform(val => val as Timestamp),\n};\n\nexport const now = () => Date.now() as Timestamp;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuB;AACvB,iBAAkB;AAEX,IAAM,YAAY,aACvB,OAAO,EAAE,aAAa,YAAY,CAAC,EACnC,IAAI,UAAU;AAIT,IAAM,EAAE,SAAS,SAAS,iBAAiB,QAAI,YAAAA,SAAyB;AAAA,EAC9E,cAAc;AAAA,EACd;AAAA,EACA,aAAa,CAAC,UAAmB,GAAG;AAAA,EACpC,eAAe;AAChB,CAAC;AAIM,IAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;AAC7B,IAAM,UAAU;AAAA,EACtB,GAAG;AAAA,EACH,QAAQ,iBAAiB,OAAO,UAAU,SAAO,GAAgB;AAClE;AAEO,IAAM,MAAM,MAAM,KAAK,IAAI;","names":["createType"]}
|
package/Timestamp.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Timestamp.ts
|
|
2
|
+
import createType from "@taqueria/protocol/Base";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
var rawSchema = z.number({ description: "Timestamp" }).min(1651846877);
|
|
5
|
+
var { factory, schemas: generatedSchemas } = createType({
|
|
6
|
+
isStringLike: true,
|
|
7
|
+
rawSchema,
|
|
8
|
+
parseErrMsg: (value) => `${value} is an invalid timestamp`,
|
|
9
|
+
unknownErrMsg: `Something went wrong trying to parse a timestamp`
|
|
10
|
+
});
|
|
11
|
+
var { create, make, of } = factory;
|
|
12
|
+
var schemas = {
|
|
13
|
+
...generatedSchemas,
|
|
14
|
+
schema: generatedSchemas.schema.transform((val) => val)
|
|
15
|
+
};
|
|
16
|
+
var now = () => Date.now();
|
|
17
|
+
export {
|
|
18
|
+
create,
|
|
19
|
+
factory,
|
|
20
|
+
generatedSchemas,
|
|
21
|
+
make,
|
|
22
|
+
now,
|
|
23
|
+
of,
|
|
24
|
+
rawSchema,
|
|
25
|
+
schemas
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=Timestamp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Timestamp.ts"],"sourcesContent":["import createType from '@taqueria/protocol/Base';\nimport { z } from 'zod';\n\nexport const rawSchema = z\n\t.number({ description: 'Timestamp' })\n\t.min(1651846877);\n\ntype Input = z.infer<typeof rawSchema>;\n\nexport const { factory, schemas: generatedSchemas } = createType<Input, Input>({\n\tisStringLike: true,\n\trawSchema,\n\tparseErrMsg: (value: unknown) => `${value} is an invalid timestamp`,\n\tunknownErrMsg: `Something went wrong trying to parse a timestamp`,\n});\n\nexport type Timestamp = z.infer<typeof generatedSchemas.schema>;\nexport type t = Timestamp;\nexport const { create, make, of } = factory;\nexport const schemas = {\n\t...generatedSchemas,\n\tschema: generatedSchemas.schema.transform(val => val as Timestamp),\n};\n\nexport const now = () => Date.now() as Timestamp;\n"],"mappings":";AAAA,OAAO,gBAAgB;AACvB,SAAS,SAAS;AAEX,IAAM,YAAY,EACvB,OAAO,EAAE,aAAa,YAAY,CAAC,EACnC,IAAI,UAAU;AAIT,IAAM,EAAE,SAAS,SAAS,iBAAiB,IAAI,WAAyB;AAAA,EAC9E,cAAc;AAAA,EACd;AAAA,EACA,aAAa,CAAC,UAAmB,GAAG;AAAA,EACpC,eAAe;AAChB,CAAC;AAIM,IAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;AAC7B,IAAM,UAAU;AAAA,EACtB,GAAG;AAAA,EACH,QAAQ,iBAAiB,OAAO,UAAU,SAAO,GAAgB;AAClE;AAEO,IAAM,MAAM,MAAM,KAAK,IAAI;","names":[]}
|
package/Tz.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as fluture from 'fluture';
|
|
2
|
+
import { TaqError } from './TaqError.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const rawSchema: z.ZodString;
|
|
6
|
+
declare const generatedSchemas: {
|
|
7
|
+
rawSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
8
|
+
internalSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
9
|
+
schema: z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, string & {
|
|
10
|
+
readonly __kind: any;
|
|
11
|
+
}, any>;
|
|
12
|
+
};
|
|
13
|
+
declare const factory: {
|
|
14
|
+
make: (input: string) => fluture.FutureInstance<TaqError, string & {
|
|
15
|
+
readonly __kind: any;
|
|
16
|
+
}>;
|
|
17
|
+
of: (input: unknown) => fluture.FutureInstance<TaqError, string & {
|
|
18
|
+
readonly __kind: any;
|
|
19
|
+
}>;
|
|
20
|
+
create: (input: string) => string & {
|
|
21
|
+
readonly __kind: any;
|
|
22
|
+
};
|
|
23
|
+
from: (input: unknown) => string & {
|
|
24
|
+
readonly __kind: any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare type Tz = z.infer<typeof generatedSchemas.schema>;
|
|
28
|
+
declare const create: (input: string) => string & {
|
|
29
|
+
readonly __kind: any;
|
|
30
|
+
};
|
|
31
|
+
declare const of: (input: unknown) => fluture.FutureInstance<TaqError, string & {
|
|
32
|
+
readonly __kind: any;
|
|
33
|
+
}>;
|
|
34
|
+
declare const make: (input: string) => fluture.FutureInstance<TaqError, string & {
|
|
35
|
+
readonly __kind: any;
|
|
36
|
+
}>;
|
|
37
|
+
declare const schemas: {
|
|
38
|
+
schema: z.ZodEffects<z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, string & {
|
|
39
|
+
readonly __kind: any;
|
|
40
|
+
}, any>, string & {
|
|
41
|
+
readonly __kind: any;
|
|
42
|
+
}, any>;
|
|
43
|
+
rawSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
44
|
+
internalSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { Tz, create, factory, generatedSchemas, make, of, rawSchema, schemas };
|
package/Tz.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// Tz.ts
|
|
27
|
+
var Tz_exports = {};
|
|
28
|
+
__export(Tz_exports, {
|
|
29
|
+
create: () => create,
|
|
30
|
+
factory: () => factory,
|
|
31
|
+
generatedSchemas: () => generatedSchemas,
|
|
32
|
+
make: () => make,
|
|
33
|
+
of: () => of,
|
|
34
|
+
rawSchema: () => rawSchema,
|
|
35
|
+
schemas: () => schemas
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(Tz_exports);
|
|
38
|
+
var import_Base = __toESM(require("@taqueria/protocol/Base"));
|
|
39
|
+
var import_zod = require("zod");
|
|
40
|
+
var rawSchema = import_zod.z.string({ description: "Tz" }).min(1).regex(/^\d([\d_]+\d)?$/);
|
|
41
|
+
var { schemas: generatedSchemas, factory } = (0, import_Base.default)({
|
|
42
|
+
isStringLike: true,
|
|
43
|
+
rawSchema,
|
|
44
|
+
parseErrMsg: (value) => `${value} is an invalid Tz amount`,
|
|
45
|
+
unknownErrMsg: "Something went wrong when parsing the Tz amount"
|
|
46
|
+
});
|
|
47
|
+
var { create, of, make } = factory;
|
|
48
|
+
var schemas = {
|
|
49
|
+
...generatedSchemas,
|
|
50
|
+
schema: generatedSchemas.schema.transform((val) => val)
|
|
51
|
+
};
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
create,
|
|
55
|
+
factory,
|
|
56
|
+
generatedSchemas,
|
|
57
|
+
make,
|
|
58
|
+
of,
|
|
59
|
+
rawSchema,
|
|
60
|
+
schemas
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=Tz.js.map
|
package/Tz.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Tz.ts"],"sourcesContent":["import createType from '@taqueria/protocol/Base';\nimport { z } from 'zod';\n\nexport const rawSchema = z.string({ description: 'Tz' }).min(1).regex(/^\\d([\\d_]+\\d)?$/);\n\ntype RawInput = z.infer<typeof rawSchema>;\n\nexport const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({\n\tisStringLike: true,\n\trawSchema,\n\tparseErrMsg: (value: unknown) => `${value} is an invalid Tz amount`,\n\tunknownErrMsg: 'Something went wrong when parsing the Tz amount',\n});\n\nexport type Tz = z.infer<typeof generatedSchemas.schema>;\n\nexport const { create, of, make } = factory;\n\nexport const schemas = {\n\t...generatedSchemas,\n\tschema: generatedSchemas.schema.transform(val => val as Tz),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuB;AACvB,iBAAkB;AAEX,IAAM,YAAY,aAAE,OAAO,EAAE,aAAa,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,iBAAiB;AAIhF,IAAM,EAAE,SAAS,kBAAkB,QAAQ,QAAI,YAAAA,SAA+B;AAAA,EACpF,cAAc;AAAA,EACd;AAAA,EACA,aAAa,CAAC,UAAmB,GAAG;AAAA,EACpC,eAAe;AAChB,CAAC;AAIM,IAAM,EAAE,QAAQ,IAAI,KAAK,IAAI;AAE7B,IAAM,UAAU;AAAA,EACtB,GAAG;AAAA,EACH,QAAQ,iBAAiB,OAAO,UAAU,SAAO,GAAS;AAC3D;","names":["createType"]}
|
package/Tz.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Tz.ts
|
|
2
|
+
import createType from "@taqueria/protocol/Base";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
var rawSchema = z.string({ description: "Tz" }).min(1).regex(/^\d([\d_]+\d)?$/);
|
|
5
|
+
var { schemas: generatedSchemas, factory } = createType({
|
|
6
|
+
isStringLike: true,
|
|
7
|
+
rawSchema,
|
|
8
|
+
parseErrMsg: (value) => `${value} is an invalid Tz amount`,
|
|
9
|
+
unknownErrMsg: "Something went wrong when parsing the Tz amount"
|
|
10
|
+
});
|
|
11
|
+
var { create, of, make } = factory;
|
|
12
|
+
var schemas = {
|
|
13
|
+
...generatedSchemas,
|
|
14
|
+
schema: generatedSchemas.schema.transform((val) => val)
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
create,
|
|
18
|
+
factory,
|
|
19
|
+
generatedSchemas,
|
|
20
|
+
make,
|
|
21
|
+
of,
|
|
22
|
+
rawSchema,
|
|
23
|
+
schemas
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Tz.mjs.map
|
package/Tz.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Tz.ts"],"sourcesContent":["import createType from '@taqueria/protocol/Base';\nimport { z } from 'zod';\n\nexport const rawSchema = z.string({ description: 'Tz' }).min(1).regex(/^\\d([\\d_]+\\d)?$/);\n\ntype RawInput = z.infer<typeof rawSchema>;\n\nexport const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({\n\tisStringLike: true,\n\trawSchema,\n\tparseErrMsg: (value: unknown) => `${value} is an invalid Tz amount`,\n\tunknownErrMsg: 'Something went wrong when parsing the Tz amount',\n});\n\nexport type Tz = z.infer<typeof generatedSchemas.schema>;\n\nexport const { create, of, make } = factory;\n\nexport const schemas = {\n\t...generatedSchemas,\n\tschema: generatedSchemas.schema.transform(val => val as Tz),\n};\n"],"mappings":";AAAA,OAAO,gBAAgB;AACvB,SAAS,SAAS;AAEX,IAAM,YAAY,EAAE,OAAO,EAAE,aAAa,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,iBAAiB;AAIhF,IAAM,EAAE,SAAS,kBAAkB,QAAQ,IAAI,WAA+B;AAAA,EACpF,cAAc;AAAA,EACd;AAAA,EACA,aAAa,CAAC,UAAmB,GAAG;AAAA,EACpC,eAAe;AAChB,CAAC;AAIM,IAAM,EAAE,QAAQ,IAAI,KAAK,IAAI;AAE7B,IAAM,UAAU;AAAA,EACtB,GAAG;AAAA,EACH,QAAQ,iBAAiB,OAAO,UAAU,SAAO,GAAS;AAC3D;","names":[]}
|
package/Url.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as fluture from 'fluture';
|
|
2
|
+
import { TaqError } from './TaqError.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const rawSchema: z.ZodString;
|
|
6
|
+
declare const generatedSchemas: {
|
|
7
|
+
rawSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
8
|
+
internalSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
9
|
+
schema: z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, string & {
|
|
10
|
+
readonly __kind: any;
|
|
11
|
+
}, any>;
|
|
12
|
+
};
|
|
13
|
+
declare const factory: {
|
|
14
|
+
make: (input: string) => fluture.FutureInstance<TaqError, string & {
|
|
15
|
+
readonly __kind: any;
|
|
16
|
+
}>;
|
|
17
|
+
of: (input: unknown) => fluture.FutureInstance<TaqError, string & {
|
|
18
|
+
readonly __kind: any;
|
|
19
|
+
}>;
|
|
20
|
+
create: (input: string) => string & {
|
|
21
|
+
readonly __kind: any;
|
|
22
|
+
};
|
|
23
|
+
from: (input: unknown) => string & {
|
|
24
|
+
readonly __kind: any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare const toComponents: (url: Url) => URL;
|
|
28
|
+
declare type Url = z.infer<typeof generatedSchemas.schema>;
|
|
29
|
+
declare type t = Url;
|
|
30
|
+
declare const create: (input: string) => string & {
|
|
31
|
+
readonly __kind: any;
|
|
32
|
+
};
|
|
33
|
+
declare const of: (input: unknown) => fluture.FutureInstance<TaqError, string & {
|
|
34
|
+
readonly __kind: any;
|
|
35
|
+
}>;
|
|
36
|
+
declare const make: (input: string) => fluture.FutureInstance<TaqError, string & {
|
|
37
|
+
readonly __kind: any;
|
|
38
|
+
}>;
|
|
39
|
+
declare const schemas: {
|
|
40
|
+
schema: z.ZodEffects<z.ZodEffects<z.ZodType<any, z.ZodTypeDef, any>, string & {
|
|
41
|
+
readonly __kind: any;
|
|
42
|
+
}, any>, string & {
|
|
43
|
+
readonly __kind: any;
|
|
44
|
+
}, any>;
|
|
45
|
+
rawSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
46
|
+
internalSchema: z.ZodType<any, z.ZodTypeDef, any>;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { Url, create, factory, generatedSchemas, make, of, rawSchema, schemas, t, toComponents };
|
package/Url.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// Url.ts
|
|
27
|
+
var Url_exports = {};
|
|
28
|
+
__export(Url_exports, {
|
|
29
|
+
create: () => create,
|
|
30
|
+
factory: () => factory,
|
|
31
|
+
generatedSchemas: () => generatedSchemas,
|
|
32
|
+
make: () => make,
|
|
33
|
+
of: () => of,
|
|
34
|
+
rawSchema: () => rawSchema,
|
|
35
|
+
schemas: () => schemas,
|
|
36
|
+
toComponents: () => toComponents
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(Url_exports);
|
|
39
|
+
var import_Base = __toESM(require("@taqueria/protocol/Base"));
|
|
40
|
+
var import_zod = require("zod");
|
|
41
|
+
var rawSchema = import_zod.z.string({ description: "Url" }).url();
|
|
42
|
+
var { schemas: generatedSchemas, factory } = (0, import_Base.default)({
|
|
43
|
+
rawSchema,
|
|
44
|
+
isStringLike: true,
|
|
45
|
+
parseErrMsg: (value) => `${value} is an invalid url`,
|
|
46
|
+
unknownErrMsg: "Something went wrong trying to parse the url"
|
|
47
|
+
});
|
|
48
|
+
var toComponents = (url) => {
|
|
49
|
+
const parts = new URL(url.toString());
|
|
50
|
+
return parts;
|
|
51
|
+
};
|
|
52
|
+
var { create, of, make } = factory;
|
|
53
|
+
var schemas = {
|
|
54
|
+
...generatedSchemas,
|
|
55
|
+
schema: generatedSchemas.schema.transform((val) => val)
|
|
56
|
+
};
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
create,
|
|
60
|
+
factory,
|
|
61
|
+
generatedSchemas,
|
|
62
|
+
make,
|
|
63
|
+
of,
|
|
64
|
+
rawSchema,
|
|
65
|
+
schemas,
|
|
66
|
+
toComponents
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=Url.js.map
|
package/Url.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Url.ts"],"sourcesContent":["import createType from '@taqueria/protocol/Base';\nimport { z } from 'zod';\n\nexport const rawSchema = z\n\t.string({ description: 'Url' })\n\t.url();\n\ntype RawInput = z.infer<typeof rawSchema>;\n\nexport const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({\n\trawSchema,\n\tisStringLike: true,\n\tparseErrMsg: (value: unknown) => `${value} is an invalid url`,\n\tunknownErrMsg: 'Something went wrong trying to parse the url',\n});\n\nexport const toComponents = (url: Url) => {\n\tconst parts = new URL(url.toString());\n\treturn parts;\n};\n\nexport type Url = z.infer<typeof generatedSchemas.schema>;\nexport type t = Url;\nexport const { create, of, make } = factory;\nexport const schemas = {\n\t...generatedSchemas,\n\tschema: generatedSchemas.schema.transform(val => val as Url),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuB;AACvB,iBAAkB;AAEX,IAAM,YAAY,aACvB,OAAO,EAAE,aAAa,MAAM,CAAC,EAC7B,IAAI;AAIC,IAAM,EAAE,SAAS,kBAAkB,QAAQ,QAAI,YAAAA,SAA+B;AAAA,EACpF;AAAA,EACA,cAAc;AAAA,EACd,aAAa,CAAC,UAAmB,GAAG;AAAA,EACpC,eAAe;AAChB,CAAC;AAEM,IAAM,eAAe,CAAC,QAAa;AACzC,QAAM,QAAQ,IAAI,IAAI,IAAI,SAAS,CAAC;AACpC,SAAO;AACR;AAIO,IAAM,EAAE,QAAQ,IAAI,KAAK,IAAI;AAC7B,IAAM,UAAU;AAAA,EACtB,GAAG;AAAA,EACH,QAAQ,iBAAiB,OAAO,UAAU,SAAO,GAAU;AAC5D;","names":["createType"]}
|