@taqueria/protocol 0.16.0 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/Alias.d.ts +42 -0
  2. package/Alias.d.ts.map +1 -0
  3. package/Alias.js +70 -0
  4. package/Alias.js.map +1 -0
  5. package/Alias.mjs +34 -0
  6. package/Alias.mjs.map +1 -0
  7. package/Base.d.ts +48 -0
  8. package/Base.d.ts.map +1 -0
  9. package/Base.js +83 -0
  10. package/Base.js.map +1 -0
  11. package/Base.mjs +57 -0
  12. package/Base.mjs.map +1 -0
  13. package/Command.d.ts +24 -0
  14. package/Command.d.ts.map +1 -0
  15. package/Command.js +61 -0
  16. package/Command.js.map +1 -0
  17. package/Command.mjs +25 -0
  18. package/Command.mjs.map +1 -0
  19. package/Config.d.ts +2055 -0
  20. package/Config.d.ts.map +1 -0
  21. package/Config.js +175 -0
  22. package/Config.js.map +1 -0
  23. package/Config.mjs +135 -0
  24. package/Config.mjs.map +1 -0
  25. package/Contract.d.ts +82 -0
  26. package/Contract.d.ts.map +1 -0
  27. package/Contract.js +68 -0
  28. package/Contract.js.map +1 -0
  29. package/Contract.mjs +32 -0
  30. package/Contract.mjs.map +1 -0
  31. package/Crypto.d.ts +4 -0
  32. package/Crypto.d.ts.map +1 -0
  33. package/Crypto.js +35 -0
  34. package/Crypto.js.map +1 -0
  35. package/Crypto.mjs +10 -0
  36. package/Crypto.mjs.map +1 -0
  37. package/EconomicalProtocolHash.d.ts +41 -0
  38. package/EconomicalProtocolHash.d.ts.map +1 -0
  39. package/EconomicalProtocolHash.js +64 -0
  40. package/EconomicalProtocolHash.js.map +1 -0
  41. package/EconomicalProtocolHash.mjs +27 -0
  42. package/EconomicalProtocolHash.mjs.map +1 -0
  43. package/Environment.d.ts +134 -0
  44. package/Environment.d.ts.map +1 -0
  45. package/Environment.js +78 -0
  46. package/Environment.js.map +1 -0
  47. package/Environment.mjs +40 -0
  48. package/Environment.mjs.map +1 -0
  49. package/EphemeralState.d.ts +4556 -0
  50. package/EphemeralState.d.ts.map +1 -0
  51. package/EphemeralState.js +268 -0
  52. package/EphemeralState.js.map +1 -0
  53. package/EphemeralState.mjs +228 -0
  54. package/EphemeralState.mjs.map +1 -0
  55. package/Faucet.d.ts +203 -0
  56. package/Faucet.d.ts.map +1 -0
  57. package/Faucet.js +84 -0
  58. package/Faucet.js.map +1 -0
  59. package/Faucet.mjs +47 -0
  60. package/Faucet.mjs.map +1 -0
  61. package/HumanReadableIdentifier.d.ts +24 -0
  62. package/HumanReadableIdentifier.d.ts.map +1 -0
  63. package/HumanReadableIdentifier.js +61 -0
  64. package/HumanReadableIdentifier.js.map +1 -0
  65. package/HumanReadableIdentifier.mjs +25 -0
  66. package/HumanReadableIdentifier.mjs.map +1 -0
  67. package/InstalledPlugin.d.ts +92 -0
  68. package/InstalledPlugin.d.ts.map +1 -0
  69. package/InstalledPlugin.js +67 -0
  70. package/InstalledPlugin.js.map +1 -0
  71. package/InstalledPlugin.mjs +30 -0
  72. package/InstalledPlugin.mjs.map +1 -0
  73. package/LoadedConfig.d.ts +2318 -0
  74. package/LoadedConfig.d.ts.map +1 -0
  75. package/LoadedConfig.js +80 -0
  76. package/LoadedConfig.js.map +1 -0
  77. package/LoadedConfig.mjs +41 -0
  78. package/LoadedConfig.mjs.map +1 -0
  79. package/MetadataConfig.d.ts +155 -0
  80. package/MetadataConfig.d.ts.map +1 -0
  81. package/MetadataConfig.js +75 -0
  82. package/MetadataConfig.js.map +1 -0
  83. package/MetadataConfig.mjs +38 -0
  84. package/MetadataConfig.mjs.map +1 -0
  85. package/NetworkConfig.d.ts +424 -0
  86. package/NetworkConfig.d.ts.map +1 -0
  87. package/NetworkConfig.js +77 -0
  88. package/NetworkConfig.js.map +1 -0
  89. package/NetworkConfig.mjs +40 -0
  90. package/NetworkConfig.mjs.map +1 -0
  91. package/Operation.d.ts +1470 -0
  92. package/Operation.d.ts.map +1 -0
  93. package/Operation.js +98 -0
  94. package/Operation.js.map +1 -0
  95. package/Operation.mjs +60 -0
  96. package/Operation.mjs.map +1 -0
  97. package/Option.d.ts +309 -0
  98. package/Option.d.ts.map +1 -0
  99. package/Option.js +103 -0
  100. package/Option.js.map +1 -0
  101. package/Option.mjs +65 -0
  102. package/Option.mjs.map +1 -0
  103. package/ParsedOperation.d.ts +880 -0
  104. package/ParsedOperation.d.ts.map +1 -0
  105. package/ParsedOperation.js +63 -0
  106. package/ParsedOperation.js.map +1 -0
  107. package/ParsedOperation.mjs +26 -0
  108. package/ParsedOperation.mjs.map +1 -0
  109. package/ParsedTemplate.d.ts +1024 -0
  110. package/ParsedTemplate.d.ts.map +1 -0
  111. package/ParsedTemplate.js +71 -0
  112. package/ParsedTemplate.js.map +1 -0
  113. package/ParsedTemplate.mjs +34 -0
  114. package/ParsedTemplate.mjs.map +1 -0
  115. package/PersistentState.d.ts +575 -0
  116. package/PersistentState.d.ts.map +1 -0
  117. package/PersistentState.js +98 -0
  118. package/PersistentState.js.map +1 -0
  119. package/PersistentState.mjs +60 -0
  120. package/PersistentState.mjs.map +1 -0
  121. package/PluginActionName.d.ts +22 -0
  122. package/PluginActionName.d.ts.map +1 -0
  123. package/PluginActionName.js +48 -0
  124. package/PluginActionName.js.map +1 -0
  125. package/PluginActionName.mjs +23 -0
  126. package/PluginActionName.mjs.map +1 -0
  127. package/PluginDependenciesResponse.d.ts +152 -0
  128. package/PluginDependenciesResponse.d.ts.map +1 -0
  129. package/PluginDependenciesResponse.js +63 -0
  130. package/PluginDependenciesResponse.js.map +1 -0
  131. package/PluginDependenciesResponse.mjs +28 -0
  132. package/PluginDependenciesResponse.mjs.map +1 -0
  133. package/PluginInfo.d.ts +3418 -0
  134. package/PluginInfo.d.ts.map +1 -0
  135. package/PluginInfo.js +113 -0
  136. package/PluginInfo.js.map +1 -0
  137. package/PluginInfo.mjs +76 -0
  138. package/PluginInfo.mjs.map +1 -0
  139. package/PluginJsonResponse.d.ts +99 -0
  140. package/PluginJsonResponse.d.ts.map +1 -0
  141. package/PluginJsonResponse.js +59 -0
  142. package/PluginJsonResponse.js.map +1 -0
  143. package/PluginJsonResponse.mjs +25 -0
  144. package/PluginJsonResponse.mjs.map +1 -0
  145. package/PluginProxyResponse.d.ts +16 -0
  146. package/PluginProxyResponse.d.ts.map +1 -0
  147. package/PluginProxyResponse.js +61 -0
  148. package/PluginProxyResponse.js.map +1 -0
  149. package/PluginProxyResponse.mjs +25 -0
  150. package/PluginProxyResponse.mjs.map +1 -0
  151. package/PluginResponseEncoding.d.ts +32 -0
  152. package/PluginResponseEncoding.d.ts.map +1 -0
  153. package/PluginResponseEncoding.js +63 -0
  154. package/PluginResponseEncoding.js.map +1 -0
  155. package/PluginResponseEncoding.mjs +27 -0
  156. package/PluginResponseEncoding.mjs.map +1 -0
  157. package/PluginSchema.d.ts +7324 -0
  158. package/PluginSchema.d.ts.map +1 -0
  159. package/PluginSchema.js +107 -0
  160. package/PluginSchema.js.map +1 -0
  161. package/PluginSchema.mjs +70 -0
  162. package/PluginSchema.mjs.map +1 -0
  163. package/PositionalArg.d.ts +183 -0
  164. package/PositionalArg.d.ts.map +1 -0
  165. package/PositionalArg.js +78 -0
  166. package/PositionalArg.js.map +1 -0
  167. package/PositionalArg.mjs +41 -0
  168. package/PositionalArg.mjs.map +1 -0
  169. package/Provisioner.d.ts +269 -0
  170. package/Provisioner.d.ts.map +1 -0
  171. package/Provisioner.js +86 -0
  172. package/Provisioner.js.map +1 -0
  173. package/Provisioner.mjs +48 -0
  174. package/Provisioner.mjs.map +1 -0
  175. package/ProvisionerID.d.ts +41 -0
  176. package/ProvisionerID.d.ts.map +1 -0
  177. package/ProvisionerID.js +61 -0
  178. package/ProvisionerID.js.map +1 -0
  179. package/ProvisionerID.mjs +24 -0
  180. package/ProvisionerID.mjs.map +1 -0
  181. package/Provisions.d.ts +237 -0
  182. package/Provisions.d.ts.map +1 -0
  183. package/Provisions.js +93 -0
  184. package/Provisions.js.map +1 -0
  185. package/Provisions.mjs +57 -0
  186. package/Provisions.mjs.map +1 -0
  187. package/PublicKeyHash.d.ts +42 -0
  188. package/PublicKeyHash.d.ts.map +1 -0
  189. package/PublicKeyHash.js +65 -0
  190. package/PublicKeyHash.js.map +1 -0
  191. package/PublicKeyHash.mjs +28 -0
  192. package/PublicKeyHash.mjs.map +1 -0
  193. package/RequestArgs.d.ts +5548 -0
  194. package/RequestArgs.d.ts.map +1 -0
  195. package/RequestArgs.js +136 -0
  196. package/RequestArgs.js.map +1 -0
  197. package/RequestArgs.mjs +89 -0
  198. package/RequestArgs.mjs.map +1 -0
  199. package/SHA256.d.ts +29 -0
  200. package/SHA256.d.ts.map +1 -0
  201. package/SHA256.js +79 -0
  202. package/SHA256.js.map +1 -0
  203. package/SHA256.mjs +42 -0
  204. package/SHA256.mjs.map +1 -0
  205. package/SandboxAccountConfig.d.ts +145 -0
  206. package/SandboxAccountConfig.d.ts.map +1 -0
  207. package/SandboxAccountConfig.js +72 -0
  208. package/SandboxAccountConfig.js.map +1 -0
  209. package/SandboxAccountConfig.mjs +35 -0
  210. package/SandboxAccountConfig.mjs.map +1 -0
  211. package/SandboxConfig.d.ts +543 -0
  212. package/SandboxConfig.d.ts.map +1 -0
  213. package/SandboxConfig.js +103 -0
  214. package/SandboxConfig.js.map +1 -0
  215. package/SandboxConfig.mjs +66 -0
  216. package/SandboxConfig.mjs.map +1 -0
  217. package/SanitizedAbsPath.d.ts +41 -0
  218. package/SanitizedAbsPath.d.ts.map +1 -0
  219. package/SanitizedAbsPath.js +64 -0
  220. package/SanitizedAbsPath.js.map +1 -0
  221. package/SanitizedAbsPath.mjs +27 -0
  222. package/SanitizedAbsPath.mjs.map +1 -0
  223. package/SanitizedArgs.d.ts +2900 -0
  224. package/SanitizedArgs.d.ts.map +1 -0
  225. package/SanitizedArgs.js +269 -0
  226. package/SanitizedArgs.js.map +1 -0
  227. package/SanitizedArgs.mjs +197 -0
  228. package/SanitizedArgs.mjs.map +1 -0
  229. package/SanitizedPath.d.ts +24 -0
  230. package/SanitizedPath.d.ts.map +1 -0
  231. package/SanitizedPath.js +64 -0
  232. package/SanitizedPath.js.map +1 -0
  233. package/SanitizedPath.mjs +28 -0
  234. package/SanitizedPath.mjs.map +1 -0
  235. package/ScaffoldConfig.d.ts +5 -0
  236. package/ScaffoldConfig.d.ts.map +1 -0
  237. package/ScaffoldConfig.js +19 -0
  238. package/ScaffoldConfig.js.map +1 -0
  239. package/ScaffoldConfig.mjs +1 -0
  240. package/ScaffoldConfig.mjs.map +1 -0
  241. package/Settings.d.ts +75 -0
  242. package/Settings.d.ts.map +1 -0
  243. package/Settings.js +66 -0
  244. package/Settings.js.map +1 -0
  245. package/Settings.mjs +29 -0
  246. package/Settings.mjs.map +1 -0
  247. package/SingleChar.d.ts +41 -0
  248. package/SingleChar.d.ts.map +1 -0
  249. package/SingleChar.js +62 -0
  250. package/SingleChar.js.map +1 -0
  251. package/SingleChar.mjs +25 -0
  252. package/SingleChar.mjs.map +1 -0
  253. package/TaqError.d.ts +21 -0
  254. package/TaqError.d.ts.map +1 -0
  255. package/TaqError.js +65 -0
  256. package/TaqError.js.map +1 -0
  257. package/TaqError.mjs +35 -0
  258. package/TaqError.mjs.map +1 -0
  259. package/Task.d.ts +818 -0
  260. package/Task.d.ts.map +1 -0
  261. package/Task.js +95 -0
  262. package/Task.js.map +1 -0
  263. package/Task.mjs +58 -0
  264. package/Task.mjs.map +1 -0
  265. package/Template.d.ts +1738 -0
  266. package/Template.d.ts.map +1 -0
  267. package/Template.js +117 -0
  268. package/Template.js.map +1 -0
  269. package/Template.mjs +79 -0
  270. package/Template.mjs.map +1 -0
  271. package/Timestamp.d.ts +44 -0
  272. package/Timestamp.d.ts.map +1 -0
  273. package/Timestamp.js +65 -0
  274. package/Timestamp.js.map +1 -0
  275. package/Timestamp.mjs +27 -0
  276. package/Timestamp.mjs.map +1 -0
  277. package/Tz.d.ts +40 -0
  278. package/Tz.d.ts.map +1 -0
  279. package/Tz.js +62 -0
  280. package/Tz.js.map +1 -0
  281. package/Tz.mjs +25 -0
  282. package/Tz.mjs.map +1 -0
  283. package/Url.d.ts +42 -0
  284. package/Url.d.ts.map +1 -0
  285. package/Url.js +68 -0
  286. package/Url.js.map +1 -0
  287. package/Url.mjs +30 -0
  288. package/Url.mjs.map +1 -0
  289. package/Verb.d.ts +41 -0
  290. package/Verb.d.ts.map +1 -0
  291. package/Verb.js +62 -0
  292. package/Verb.js.map +1 -0
  293. package/Verb.mjs +25 -0
  294. package/Verb.mjs.map +1 -0
  295. package/VersionNumber.d.ts +24 -0
  296. package/VersionNumber.d.ts.map +1 -0
  297. package/VersionNumber.js +61 -0
  298. package/VersionNumber.js.map +1 -0
  299. package/VersionNumber.mjs +25 -0
  300. package/VersionNumber.mjs.map +1 -0
  301. package/i18n.d.ts +7 -0
  302. package/i18n.d.ts.map +1 -0
  303. package/i18n.js +96 -0
  304. package/i18n.js.map +1 -0
  305. package/i18n.mjs +67 -0
  306. package/i18n.mjs.map +1 -0
  307. package/package.json +31 -3
  308. package/{taqueria-protocol-types.ts → taqueria-protocol-types.d.ts} +1 -0
  309. package/taqueria-protocol-types.d.ts.map +1 -0
  310. package/taqueria-protocol-types.js +142 -0
  311. package/taqueria-protocol-types.js.map +1 -0
  312. package/taqueria-protocol-types.mjs +76 -0
  313. package/taqueria-protocol-types.mjs.map +1 -0
  314. package/tzkt-config.d.ts +109 -0
  315. package/tzkt-config.d.ts.map +1 -0
  316. package/tzkt-config.js +65 -0
  317. package/tzkt-config.js.map +1 -0
  318. package/tzkt-config.mjs +28 -0
  319. package/tzkt-config.mjs.map +1 -0
  320. package/Alias.ts +0 -38
  321. package/Base.ts +0 -105
  322. package/Command.ts +0 -26
  323. package/Config.ts +0 -163
  324. package/Contract.ts +0 -35
  325. package/Crypto.ts +0 -3
  326. package/EconomicalProtocolHash.ts +0 -26
  327. package/Environment.ts +0 -40
  328. package/EphemeralState.ts +0 -282
  329. package/Faucet.ts +0 -46
  330. package/HumanReadableIdentifier.ts +0 -26
  331. package/InstalledPlugin.ts +0 -28
  332. package/LoadedConfig.ts +0 -45
  333. package/MetadataConfig.ts +0 -37
  334. package/NetworkConfig.ts +0 -39
  335. package/Operation.ts +0 -70
  336. package/Option.ts +0 -64
  337. package/ParsedOperation.ts +0 -33
  338. package/ParsedTemplate.ts +0 -40
  339. package/PersistentState.ts +0 -69
  340. package/PluginActionName.ts +0 -28
  341. package/PluginDependenciesResponse.ts +0 -33
  342. package/PluginInfo.ts +0 -76
  343. package/PluginJsonResponse.ts +0 -26
  344. package/PluginProxyResponse.ts +0 -24
  345. package/PluginResponseEncoding.ts +0 -27
  346. package/PluginSchema.ts +0 -81
  347. package/PositionalArg.ts +0 -41
  348. package/Provisioner.ts +0 -61
  349. package/ProvisionerID.ts +0 -25
  350. package/Provisions.ts +0 -70
  351. package/PublicKeyHash.ts +0 -28
  352. package/RequestArgs.ts +0 -97
  353. package/SHA256.ts +0 -42
  354. package/SandboxAccountConfig.ts +0 -35
  355. package/SandboxConfig.ts +0 -66
  356. package/SanitizedAbsPath.ts +0 -23
  357. package/SanitizedArgs.ts +0 -213
  358. package/SanitizedPath.ts +0 -28
  359. package/ScaffoldConfig.ts +0 -6
  360. package/Settings.ts +0 -27
  361. package/SingleChar.ts +0 -23
  362. package/TaqError.ts +0 -78
  363. package/Task.ts +0 -57
  364. package/Template.ts +0 -77
  365. package/Timestamp.ts +0 -25
  366. package/Tz.ts +0 -22
  367. package/Url.ts +0 -28
  368. package/Verb.ts +0 -23
  369. package/VersionNumber.ts +0 -25
  370. package/i18n.ts +0 -74
  371. package/tzkt-config.ts +0 -27
package/PluginSchema.ts DELETED
@@ -1,81 +0,0 @@
1
- import * as Alias from '@taqueria/protocol/Alias';
2
- import createType from '@taqueria/protocol/Base';
3
- import * as Operation from '@taqueria/protocol/Operation';
4
- import * as PluginDependenciesResponse from '@taqueria/protocol/PluginDependenciesResponse';
5
- import * as PluginInfo from '@taqueria/protocol/PluginInfo';
6
- import * as PluginProxyResponse from '@taqueria/protocol/PluginProxyResponse';
7
- import * as RequestArgs from '@taqueria/protocol/RequestArgs';
8
- import * as Template from '@taqueria/protocol/Template';
9
- import { z } from 'zod';
10
-
11
- const proxyFnSchema = z
12
- .function()
13
- .args(RequestArgs.proxySchemas.schema)
14
- .returns(z.promise(PluginProxyResponse.schemas.schema));
15
-
16
- const runtimeDependenciesFn = z
17
- .function()
18
- .args(RequestArgs.schemas.schema)
19
- .returns(z.promise(PluginDependenciesResponse.schemas.schema));
20
-
21
- const internalSchema = PluginInfo.internalSchema.extend({
22
- operations: z.preprocess(
23
- val => val ?? [],
24
- z.array(
25
- Operation.schemas.schema,
26
- { description: 'ParsedOperations' },
27
- )
28
- .optional(),
29
- ),
30
- templates: z.preprocess(
31
- val => val ?? [],
32
- z.array(
33
- Template.schemas.schema,
34
- ).optional(),
35
- ),
36
- proxy: proxyFnSchema.optional(),
37
- checkRuntimeDependencies: runtimeDependenciesFn.optional(),
38
- installRuntimeDependencies: runtimeDependenciesFn.optional(),
39
- }).describe('ParsedPluginInfo');
40
-
41
- export const rawSchema = PluginInfo.rawSchema.extend({
42
- name: Alias.rawSchema.optional(),
43
- operations: z.preprocess(
44
- val => val ?? [],
45
- z.array(
46
- Operation.rawSchema,
47
- { description: 'ParsedOperation' },
48
- ),
49
- )
50
- .optional(),
51
- templates: z.preprocess(
52
- val => val ?? [],
53
- z.array(
54
- Template.schemas.schema,
55
- ).optional(),
56
- ),
57
- proxy: proxyFnSchema.optional(),
58
- checkRuntimeDependencies: runtimeDependenciesFn.optional(),
59
- installRuntimeDependencies: runtimeDependenciesFn.optional(),
60
- }).describe('ParsedPluginInfo');
61
-
62
- type Input = z.infer<typeof internalSchema>;
63
-
64
- export type RawPluginSchema = z.infer<typeof rawSchema>;
65
-
66
- export const { schemas: generatedSchemas, factory } = createType<RawPluginSchema, Input>({
67
- rawSchema,
68
- internalSchema,
69
- parseErrMsg: (value: unknown) =>
70
- `The following plugin info gave us trouble when parsing the following plugin information: ${value}`,
71
- unknownErrMsg: 'Something went wrong trying to parse the plugin information',
72
- });
73
-
74
- export type ParsedPluginInfo = z.infer<typeof generatedSchemas.schema>;
75
- export type t = ParsedPluginInfo;
76
- export const { create, of, make } = factory;
77
-
78
- export const schemas = {
79
- ...generatedSchemas,
80
- schema: generatedSchemas.schema.transform(val => val as ParsedPluginInfo),
81
- };
package/PositionalArg.ts DELETED
@@ -1,41 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as HumanReadableIdentifier from '@taqueria/protocol/HumanReadableIdentifier';
3
- import { z } from 'zod';
4
-
5
- export const rawSchema = z.object({
6
- placeholder: HumanReadableIdentifier.rawSchema.describe('Positional Arg Placeholder'),
7
- description: z.string({ description: 'Positional Arg Description' }).min(1),
8
- defaultValue: z.union(
9
- [z.string(), z.number(), z.boolean()],
10
- { description: 'Positional Arg Default Value' },
11
- ).optional(),
12
- type: z.union(
13
- [z.literal('string'), z.literal('number'), z.literal('boolean')],
14
- { description: 'Positional Arg Datatype' },
15
- ).optional(),
16
- required: z.boolean().optional(),
17
- }).describe('Positional Arg');
18
-
19
- const internalSchema = rawSchema.extend({
20
- placeholder: HumanReadableIdentifier.schemas.schema.describe('Positional Arg Placeholder'),
21
- }).describe('Positional Arg');
22
-
23
- type RawInput = z.infer<typeof rawSchema>;
24
- type Input = z.infer<typeof internalSchema>;
25
-
26
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
27
- rawSchema,
28
- internalSchema,
29
- parseErrMsg: (value: unknown) => `The following positional argument is invalid: ${value}`,
30
- unknownErrMsg: 'Something went wrong parsing the positional argument',
31
- });
32
-
33
- export type PositionalArg = z.infer<typeof generatedSchemas.schema>;
34
- export type t = PositionalArg;
35
-
36
- export const { create, of, make } = factory;
37
-
38
- export const schemas = {
39
- ...generatedSchemas,
40
- schema: generatedSchemas.schema.transform(val => val as unknown as PositionalArg),
41
- };
package/Provisioner.ts DELETED
@@ -1,61 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as ProvisionerID from '@taqueria/protocol/ProvisionerID';
3
- import { z } from 'zod';
4
-
5
- export const rawSchema = z.object(
6
- {
7
- id: ProvisionerID.rawSchema,
8
- plugin: z
9
- .string()
10
- .min(1)
11
- .describe('Provisioner Plugin')
12
- .optional(),
13
- operation: z
14
- .union([
15
- z.string().min(1),
16
- z.literal('custom'),
17
- ])
18
- .describe('Provisioner Operation'),
19
- command: z
20
- .string()
21
- .describe('Provisioner Custom Command')
22
- .optional(),
23
- label: z
24
- .string()
25
- .describe('Provisioner Label')
26
- .optional(),
27
- depends_on: z
28
- .array(
29
- ProvisionerID.rawSchema,
30
- )
31
- .optional(),
32
- },
33
- {
34
- description: 'Provisioner',
35
- },
36
- )
37
- .passthrough();
38
-
39
- export const internalSchema = rawSchema.extend({
40
- id: ProvisionerID.schemas.schema,
41
- depends_on: z.array(ProvisionerID.schemas.schema).optional(),
42
- });
43
-
44
- type RawInput = z.infer<typeof rawSchema>;
45
- type Input = z.infer<typeof internalSchema>;
46
-
47
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
48
- rawSchema,
49
- internalSchema,
50
- parseErrMsg: 'There was a problem trying to parse the provisioner',
51
- unknownErrMsg: 'Something went wrong trying to parse the provisioner',
52
- });
53
-
54
- export type Provisioner = z.infer<typeof generatedSchemas.schema>;
55
- export type t = Provisioner;
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 DELETED
@@ -1,25 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import { z } from 'zod';
3
-
4
- export const rawSchema = z
5
- .string()
6
- .min(1)
7
- .regex(/^[A-Za-z0-9]+[A-Za-z0-9-_]+\.[A-Za-z0-9]+[A-Za-z0-9-_]+\.[A-Za-z0-9]+[A-Za-z0-9-_]+$/)
8
- .describe('Provisioner ID');
9
-
10
- type RawInput = z.infer<typeof rawSchema>;
11
-
12
- export const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
13
- rawSchema,
14
- parseErrMsg: (value: unknown) => `${value} is not a valid provisioner ID`,
15
- unknownErrMsg: 'Something went wrong trying to parse the provision ID',
16
- });
17
-
18
- export type ProvisionerID = z.infer<typeof generatedSchemas.schema>;
19
- export type t = ProvisionerID;
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 DELETED
@@ -1,70 +0,0 @@
1
- import createType, { Flatten } from '@taqueria/protocol/Base';
2
- import * as Provisioner from '@taqueria/protocol/Provisioner';
3
- import * as ProvisionerID from '@taqueria/protocol/ProvisionerID';
4
- import { memoizy } from 'memoizy';
5
- import { partitionArray, uniq } from 'rambda';
6
- import { z } from 'zod';
7
-
8
- const getInvalidIds = memoizy((provisions: Provisioner.t[]) => {
9
- const ids = provisions.map(p => p.id);
10
- return provisions.reduce(
11
- (retval, provision) => {
12
- const depends_on = provision.depends_on ?? [];
13
- const invalid = partitionArray(
14
- (id: ProvisionerID.t) => ids.includes(id),
15
- depends_on,
16
- ).pop() as ProvisionerID.t[];
17
-
18
- return uniq([...retval, ...invalid]);
19
- },
20
- [] as ProvisionerID.t[],
21
- );
22
- });
23
-
24
- const rawSchema = z
25
- .array(
26
- Provisioner.rawSchema,
27
- )
28
- .refine(
29
- provisions => getInvalidIds(provisions).length === 0,
30
- provisions => ({
31
- message:
32
- `One or more of your provisioners depends on an invalid provisioner. The following provisioner ids were referenced that do not exist: ${
33
- getInvalidIds(provisions).join(', ')
34
- }`,
35
- }),
36
- )
37
- .describe('Provisions');
38
-
39
- type RawInput = z.infer<typeof rawSchema>;
40
-
41
- const internalSchema = z
42
- .array(Provisioner.schemas.schema)
43
- .refine(
44
- provisions => getInvalidIds(provisions).length === 0,
45
- provisions => ({
46
- message:
47
- `One or more of your provisioners depends on an invalid provisioner. The following provisioner ids were referenced that do not exist: ${
48
- getInvalidIds(provisions).join(', ')
49
- }`,
50
- }),
51
- )
52
- .describe('Provisions');
53
-
54
- type Input = z.infer<typeof internalSchema>;
55
-
56
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
57
- rawSchema,
58
- internalSchema,
59
- parseErrMsg: (value: unknown) => `The following provision is invalid: ${value}`,
60
- unknownErrMsg: 'Something went wrong parsing the list of provisioners',
61
- });
62
-
63
- export type Provisions = Flatten<z.infer<typeof generatedSchemas.schema>>;
64
- export type t = Provisions;
65
- export const { create, of, make } = factory;
66
-
67
- export const schemas = {
68
- ...generatedSchemas,
69
- schema: generatedSchemas.schema.transform(val => val as Provisions),
70
- };
package/PublicKeyHash.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: 'Public Key Hash' })
6
- .min(1) // TODO: what's the actual minimum length here?
7
- .refine(
8
- val => val.startsWith('tz1'),
9
- val => ({ message: `${val} is not a valid public key hash` }),
10
- );
11
-
12
- type RawInput = z.infer<typeof rawSchema>;
13
-
14
- export const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
15
- isStringLike: true,
16
- rawSchema,
17
- parseErrMsg: (value: unknown) => `${value} is an invalid public key hash`,
18
- unknownErrMsg: 'Something went wrong parsing the public key hash',
19
- });
20
-
21
- export type PublicKeyHash = z.infer<typeof generatedSchemas.schema>;
22
- export type t = PublicKeyHash;
23
- export type PKH = PublicKeyHash;
24
- export const { create, of, make } = factory;
25
- export const schemas = {
26
- ...generatedSchemas,
27
- schema: generatedSchemas.schema.transform(val => val as PublicKeyHash),
28
- };
package/RequestArgs.ts DELETED
@@ -1,97 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as LoadedConfig from '@taqueria/protocol/LoadedConfig';
3
- import { rawSchema as sanitizedArgsSchema } from '@taqueria/protocol/SanitizedArgs';
4
- import { z } from 'zod';
5
-
6
- const taqRunSchema = z.union([
7
- z.literal('pluginInfo'),
8
- z.literal('proxy'),
9
- z.literal('checkRuntimeDependencies'),
10
- z.literal('installRuntimeDependencies'),
11
- z.literal('proxyTemplate'),
12
- ]);
13
-
14
- const rawSchema = sanitizedArgsSchema.extend({
15
- taqRun: taqRunSchema,
16
- config: z.preprocess(
17
- val => typeof val === 'string' ? JSON.parse(val) : val,
18
- LoadedConfig.rawSchema,
19
- ),
20
- }).describe('RequestArgs').passthrough();
21
-
22
- const internalSchema = sanitizedArgsSchema.extend({
23
- taqRun: taqRunSchema,
24
- config: z.preprocess(
25
- val => typeof val === 'string' ? JSON.parse(val) : val,
26
- LoadedConfig.schemas.schema,
27
- ),
28
- }).describe('RequestArgs').passthrough();
29
-
30
- type RawInput = z.infer<typeof rawSchema>;
31
- type Input = z.infer<typeof internalSchema>;
32
-
33
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
34
- rawSchema,
35
- internalSchema,
36
- parseErrMsg: 'The request is invalid',
37
- unknownErrMsg: 'Something went wrong trying to parse the request',
38
- });
39
-
40
- export type RequestArgs = z.infer<typeof generatedSchemas.schema>;
41
- export type t = RequestArgs;
42
-
43
- export const schemas = {
44
- ...generatedSchemas,
45
- schema: generatedSchemas.schema.transform(val => val as RequestArgs),
46
- };
47
-
48
- const rawProxyTaskSchema = rawSchema.extend({
49
- task: z.string().min(1),
50
- }).describe('ProxyRequestArgs').passthrough();
51
-
52
- const internalProxyTaskSchema = internalSchema.extend({
53
- task: z.string().min(1),
54
- }).describe('ProxyRequestArgs').passthrough();
55
-
56
- const rawProxyTemplateSchema = rawSchema.extend({
57
- template: z.string().min(1),
58
- });
59
-
60
- const internalProxyTemplateSchema = rawSchema.extend({
61
- template: z.string().min(1),
62
- });
63
-
64
- type RawProxyInput = z.infer<typeof rawProxyTaskSchema>;
65
- type ProxyInput = z.infer<typeof internalProxyTaskSchema>;
66
- type RawProxyTemplateInput = z.infer<typeof rawProxyTemplateSchema>;
67
- type ProxyTemplateInput = z.infer<typeof internalProxyTemplateSchema>;
68
-
69
- export const proxy = createType<RawProxyInput, ProxyInput>({
70
- rawSchema: rawProxyTaskSchema,
71
- internalSchema: internalProxyTaskSchema,
72
- parseErrMsg: 'The request is invalid',
73
- unknownErrMsg: 'Something went wrong trying to parse the request',
74
- });
75
-
76
- export const proxyTemplate = createType<RawProxyTemplateInput, ProxyTemplateInput>({
77
- rawSchema: rawProxyTemplateSchema,
78
- internalSchema: internalProxyTemplateSchema,
79
- parseErrMsg: 'The request is invalid',
80
- unknownErrMsg: 'Something went wrong trying to parse the request',
81
- });
82
-
83
- export const proxySchemas = proxy.schemas;
84
- export const proxyFactory = proxy.factory;
85
-
86
- export type ProxyRequestArgs = z.infer<typeof proxySchemas.schema>;
87
- export type ProxyTemplateRequestArgs = z.infer<typeof proxyTemplate.schemas.schema>;
88
-
89
- export const createProxyRequestArgs = proxyFactory.from;
90
- export const makeProxyRequestArgs = proxyFactory.make;
91
- export const ofProxyRequestArgs = proxyFactory.of;
92
-
93
- export const createProxyTemplateRequestArgs = proxyTemplate.factory.from;
94
- export const makeProxyTemplateRequestArgs = proxyTemplate.factory.make;
95
- export const ofProxyTemplateRequestArgs = proxyTemplate.factory.of;
96
-
97
- export const { create, make, of, from } = factory;
package/SHA256.ts DELETED
@@ -1,42 +0,0 @@
1
- import { Crypto } from '@peculiar/webcrypto';
2
- import createType from '@taqueria/protocol/Base';
3
- import { E_TaqError, TaqError } from '@taqueria/protocol/TaqError';
4
- import { FutureInstance as Future, mapRej, promise } from 'fluture';
5
- import { TextEncoder } from 'util';
6
- import { z } from 'zod';
7
-
8
- const eager = <T>(f: Future<TaqError, T>) =>
9
- promise(
10
- mapRej((err: TaqError) => new E_TaqError(err))(f),
11
- );
12
-
13
- export const rawSchema = z.string({ description: 'SHA256' }).length(64);
14
-
15
- type RawInput = z.infer<typeof rawSchema>;
16
-
17
- const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
18
- isStringLike: true,
19
- rawSchema,
20
- parseErrMsg: (value: unknown) => `${value} is an invalid SHA256 hash`,
21
- unknownErrMsg: (value: unknown) => `Something went wrong trying to parse the following as a SHA256 value, ${value}`,
22
- });
23
-
24
- export const toSHA256 = async (value: string) => {
25
- const encoder = new TextEncoder();
26
- const data = encoder.encode(value);
27
- const crypto = new Crypto();
28
- const hash = await crypto.subtle.digest('SHA-256', data);
29
- const hashArray = Array.from(new Uint8Array(hash)); // convert buffer to byte array
30
- const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
31
- return eager(factory.make(hashHex));
32
- };
33
-
34
- export const internalSchema = generatedSchemas.schema;
35
-
36
- export type SHA256 = z.infer<typeof internalSchema>;
37
- export type t = SHA256;
38
- export const { create, of, make } = factory;
39
- export const schemas = {
40
- ...generatedSchemas,
41
- schema: generatedSchemas.schema.transform(val => val as SHA256),
42
- };
@@ -1,35 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as PublicKeyHash from '@taqueria/protocol/PublicKeyHash';
3
- import { z } from 'zod';
4
-
5
- const internalSchema = z.object({
6
- encryptedKey: z.string({ description: 'Sandbox Account Encrypted Key' }).min(1),
7
- publicKeyHash: PublicKeyHash.schemas.schema.describe('Sandbox Account Public Key Hash'),
8
- secretKey: z.string({ description: 'Sandbox Account Secret Key' }).min(1),
9
- }, { description: 'Sandbox Account Configuration' });
10
-
11
- export const rawSchema = z.object({
12
- encryptedKey: z.string({ description: 'Sandbox Account Encrypted Key' }).min(1),
13
- publicKeyHash: z.string({ description: 'Sandbox Account Public Key Hash' }).min(1),
14
- secretKey: z.string({ description: 'Sandbox Account Secret Key' }).min(1),
15
- }, { description: 'Sandbox Account Configuration' });
16
-
17
- type Input = z.infer<typeof internalSchema>;
18
-
19
- type RawInput = z.infer<typeof rawSchema>;
20
-
21
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
22
- rawSchema,
23
- internalSchema,
24
- parseErrMsg: 'The sandbox account configuration is invalid',
25
- unknownErrMsg: 'Something went wrong trying to parse the sandbox account configuration',
26
- });
27
-
28
- export type SandboxAccountConfig = z.infer<typeof generatedSchemas.schema>;
29
- export type t = SandboxAccountConfig;
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 DELETED
@@ -1,66 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as EconomicalProtocolHash from '@taqueria/protocol/EconomicalProtocolHash';
3
- import * as HumanReadableIdentifier from '@taqueria/protocol/HumanReadableIdentifier';
4
- import * as SandboxAccountConfig from '@taqueria/protocol/SandboxAccountConfig';
5
- import * as TzKt from '@taqueria/protocol/tzkt-config';
6
- import * as Url from '@taqueria/protocol/Url';
7
- import * as Verb from '@taqueria/protocol/Verb';
8
- import { z } from 'zod';
9
-
10
- const accountMapSchema = z.record(
11
- z.union([
12
- z.string().nonempty(),
13
- SandboxAccountConfig.schemas.schema,
14
- ]),
15
- );
16
-
17
- export const rawSchema = z.object({
18
- label: z.string({ description: 'Sandbox Label' }).min(1),
19
- rpcUrl: z.string({ description: 'Sandbox RPC Url' }).min(5).url(),
20
- protocol: z.string({ description: 'Sandbox Protocol Hash' }).min(8),
21
- attributes: z.record(
22
- z.union(
23
- [z.string(), z.number(), z.boolean()],
24
- { description: 'Sandbox Attribute' },
25
- ),
26
- { description: 'Sandbox Attributes' },
27
- ).optional(),
28
- plugin: Verb.rawSchema.describe('Sandbox Plugin').optional(),
29
- accounts: z.union([
30
- z.object({ default: z.string().min(1) }),
31
- z.record(SandboxAccountConfig.rawSchema),
32
- ], { description: 'Sandbox Accounts' }).optional(),
33
- tzkt: TzKt.rawSchema.describe('TzKt config').optional(),
34
- });
35
-
36
- const internalSchema = z.object({
37
- label: HumanReadableIdentifier.schemas.schema.describe('Sandbox Label'),
38
- rpcUrl: Url.schemas.schema.describe('Sandbox RPC Url'),
39
- protocol: EconomicalProtocolHash.schemas.schema.describe('Sandbox Protocol Hash'),
40
- attributes: z.record(
41
- z.union([z.string(), z.number(), z.boolean()]),
42
- { description: 'Sandbox Attributes' },
43
- ).optional(),
44
- plugin: Verb.schemas.schema.describe('Sandbox Plugin').optional(),
45
- accounts: accountMapSchema.optional(),
46
- tzkt: TzKt.rawSchema.describe('TzKt config').optional(),
47
- }, { description: 'Sandbox Configuration' });
48
-
49
- type RawInput = z.infer<typeof rawSchema>;
50
- type Input = z.infer<typeof internalSchema>;
51
-
52
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
53
- rawSchema,
54
- internalSchema,
55
- parseErrMsg: (value: unknown) => `${value} is not a valid sandbox configuration `,
56
- unknownErrMsg: 'Something went wrong trying to parse the sandbox configuration',
57
- });
58
-
59
- export type SandboxConfig = z.infer<typeof generatedSchemas.schema>;
60
- export type t = SandboxConfig;
61
- export const { create, of, make } = factory;
62
-
63
- export const schemas = {
64
- ...generatedSchemas,
65
- schema: generatedSchemas.schema.transform(val => val as SandboxConfig),
66
- };
@@ -1,23 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as path from 'path';
3
- import { z } from 'zod';
4
-
5
- export const rawSchema = z.string({ description: 'SanitizedAbsPath' }).min(1);
6
-
7
- type RawInput = z.infer<typeof rawSchema>;
8
-
9
- export const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
10
- isStringLike: true,
11
- rawSchema,
12
- transformer: (value: unknown) => path.resolve(value as string) as unknown,
13
- parseErrMsg: (value: unknown) => `${value} is an invalid absolute path`,
14
- unknownErrMsg: (value: unknown) => `Something went wrong trying to parse the absolute path, ${value}`,
15
- });
16
-
17
- export type SanitizedAbsPath = z.infer<typeof generatedSchemas.schema>;
18
- export type t = SanitizedAbsPath;
19
- export const { create, make, of } = factory;
20
- export const schemas = {
21
- ...generatedSchemas,
22
- schema: generatedSchemas.schema.transform(val => val as SanitizedAbsPath),
23
- };