@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/LoadedConfig.ts DELETED
@@ -1,45 +0,0 @@
1
- import createType, { Flatten } from '@taqueria/protocol/Base';
2
- import * as Config from '@taqueria/protocol/Config';
3
- import * as SanitizedAbsPath from '@taqueria/protocol/SanitizedAbsPath';
4
- import * as SHA256 from '@taqueria/protocol/SHA256';
5
- import { z } from 'zod';
6
-
7
- export const rawSchema = Config.rawSchema
8
- .omit({ plugins: true })
9
- .extend({
10
- plugins: Config.pluginsRawSchema,
11
- projectDir: SanitizedAbsPath.rawSchema.describe('loadedConfig.projectDir'),
12
- configFile: SanitizedAbsPath.rawSchema.describe('loadedConfig.configFile'),
13
- hash: SHA256.rawSchema.describe('loadedConfig.hash'),
14
- })
15
- .describe('LoadedConfig');
16
-
17
- export const internalSchema = Config.internalSchema
18
- .omit({ plugins: true })
19
- .extend({
20
- plugins: Config.pluginsInternalSchema,
21
- projectDir: SanitizedAbsPath.schemas.schema.describe('loadedConfig.projectDir'),
22
- configFile: SanitizedAbsPath.schemas.schema.describe('loadedConfig.configFile'),
23
- hash: SHA256.schemas.schema.describe('loadedConfig.hash'),
24
- })
25
- .describe('LoadedConfig');
26
-
27
- type RawInput = z.infer<typeof rawSchema>;
28
- type Input = Flatten<z.infer<typeof internalSchema>>;
29
-
30
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
31
- rawSchema,
32
- internalSchema,
33
- parseErrMsg: (value: unknown) => `The following configuration is invalid: ${value}`,
34
- unknownErrMsg: 'Something went wrong trying to parse the configuration to load',
35
- });
36
-
37
- export type LoadedConfig = z.infer<typeof generatedSchemas.schema>;
38
- export type t = LoadedConfig;
39
- export const { create, of, make } = factory;
40
- export const schemas = {
41
- ...generatedSchemas,
42
- schema: generatedSchemas.schema.transform(val => val as LoadedConfig),
43
- };
44
-
45
- export const toConfig = (config: LoadedConfig) => Config.make(config);
package/MetadataConfig.ts DELETED
@@ -1,37 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import { z } from 'zod';
3
-
4
- export const rawSchema = z.object({
5
- name: z.string({ description: 'Project Name' }).optional(),
6
- projectDescription: z.string({ description: 'Project Description' }).optional(),
7
- authors: z.array(z.string({ description: 'Project Author' })).default([]).describe('Project Authors').optional(),
8
- license: z.string({ description: 'Project License' }).optional(),
9
- homepage: z.string({ description: 'Project Web Url' }).optional(),
10
- });
11
-
12
- const internalSchema = z.object({
13
- name: z.string({ description: 'Project Name' }).optional(),
14
- projectDescription: z.string({ description: 'Project Description' }).optional(),
15
- authors: z.array(z.string({ description: 'Project Author' })).default([]).describe('Project Authors').optional(),
16
- license: z.string({ description: 'Project License' }).optional(),
17
- homepage: z.string({ description: 'Project Web Url' }).optional(),
18
- }, { description: 'Project Metadata' });
19
-
20
- type RawInput = z.infer<typeof rawSchema>;
21
- type Input = z.infer<typeof internalSchema>;
22
-
23
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
24
- rawSchema,
25
- internalSchema,
26
- parseErrMsg: (value: unknown) => `${value} is not a valid metadata configuration `,
27
- unknownErrMsg: 'Something went wrong trying to parse the metadata configuration',
28
- });
29
-
30
- export type MetadataConfig = z.infer<typeof generatedSchemas.schema>;
31
- export type t = MetadataConfig;
32
- export const { create, of, make } = factory;
33
-
34
- export const schemas = {
35
- ...generatedSchemas,
36
- schema: generatedSchemas.schema.transform(val => val as MetadataConfig),
37
- };
package/NetworkConfig.ts DELETED
@@ -1,39 +0,0 @@
1
- import createType, { Flatten } from '@taqueria/protocol/Base';
2
- import * as EconomicalProtocolHash from '@taqueria/protocol/EconomicalProtocolHash';
3
- import * as Faucet from '@taqueria/protocol/Faucet';
4
- import * as HumanReadableIdentifier from '@taqueria/protocol/HumanReadableIdentifier';
5
- import * as Url from '@taqueria/protocol/Url';
6
- import { z } from 'zod';
7
-
8
- export const rawSchema = z.object({
9
- label: HumanReadableIdentifier.rawSchema,
10
- rpcUrl: Url.rawSchema,
11
- protocol: EconomicalProtocolHash.rawSchema,
12
- faucet: Faucet.rawSchema.describe('Network Faucet'),
13
- }).describe('Network Config');
14
-
15
- const internalSchema = z.object({
16
- label: HumanReadableIdentifier.schemas.schema.describe('Network Label'),
17
- rpcUrl: Url.schemas.schema.describe('Network RPC Url'),
18
- protocol: EconomicalProtocolHash.schemas.schema.describe('Network Protocol Hash'),
19
- faucet: Faucet.schemas.schema.describe('Network Faucet'),
20
- }).describe('Network Config');
21
-
22
- type RawInput = z.infer<typeof rawSchema>;
23
- type Input = z.infer<typeof internalSchema>;
24
-
25
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
26
- rawSchema,
27
- internalSchema,
28
- parseErrMsg: (value: unknown) => `${value} is not a valid network configuration`,
29
- unknownErrMsg: 'Something went wrong trying to parse the network configuration',
30
- });
31
-
32
- export type NetworkConfig = Flatten<z.infer<typeof generatedSchemas.schema>>;
33
- export type t = NetworkConfig;
34
- export const { create, of, make } = factory;
35
-
36
- export const schemas = {
37
- ...generatedSchemas,
38
- schema: generatedSchemas.schema.transform(val => val as NetworkConfig),
39
- };
package/Operation.ts DELETED
@@ -1,70 +0,0 @@
1
- import createType, { Flatten } from '@taqueria/protocol/Base';
2
- import * as Command from '@taqueria/protocol/Command';
3
- import * as Option from '@taqueria/protocol/Option';
4
- import * as PersistentState from '@taqueria/protocol/PersistentState';
5
- import * as PositionalArg from '@taqueria/protocol/PositionalArg';
6
- import * as RequestArgs from '@taqueria/protocol/RequestArgs';
7
- import * as Verb from '@taqueria/protocol/Verb';
8
- import { z } from 'zod';
9
-
10
- type Handler = (state: PersistentState.t) => <T extends RequestArgs.t>(opts: T) => unknown;
11
-
12
- export const rawSchema = z.object({
13
- operation: Verb.rawSchema.describe('Operation Name'),
14
- command: Command.rawSchema.describe('Operation Command'),
15
- description: z.string({ description: 'Operation Description' }).optional(),
16
- positionals: z.array(PositionalArg.rawSchema).default([]).describe('Operation Positional Args').optional(),
17
- options: z.preprocess(
18
- (val: unknown) => val ?? [],
19
- z.array(
20
- Option.rawSchema.describe('Operation Option'),
21
- { description: 'Operation Options' },
22
- ).optional(),
23
- ),
24
- handler: z.function()
25
- .args(PersistentState.rawSchema)
26
- .returns(
27
- z.function()
28
- .args(RequestArgs.schemas.internalSchema),
29
- )
30
- .describe('Operation Handler')
31
- .transform((val: unknown) => val as Handler),
32
- }).describe('Operation');
33
-
34
- export const internalSchema = z.object({
35
- operation: Verb.schemas.schema.describe('Operation Name'),
36
- command: Command.schemas.schema.describe('Operation Command'),
37
- description: z.string({ description: 'Optionation Description' }).optional(),
38
- positionals: z.array(PositionalArg.schemas.schema).default([]).describe('Operation Positional Args').optional(),
39
- options: z.preprocess(
40
- (val: unknown) => val ?? [] as Option.t[],
41
- z.array(Option.schemas.schema.describe('Operation Option'), { description: 'Operation Options' }).optional(),
42
- ),
43
- handler: z.function()
44
- .args(PersistentState.rawSchema)
45
- .returns(
46
- z.function()
47
- .args(RequestArgs.schemas.schema),
48
- )
49
- .describe('Operation Handler')
50
- .transform((val: unknown) => val as Handler),
51
- }).describe('Operation');
52
-
53
- type Input = Flatten<z.infer<typeof internalSchema>>;
54
- type RawInput = z.infer<typeof rawSchema>;
55
-
56
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
57
- rawSchema,
58
- internalSchema,
59
- parseErrMsg: (value: unknown) => `The following operation is invalid: ${value}`,
60
- unknownErrMsg: 'Something went wrong trying to parse the operation',
61
- });
62
-
63
- export type Operation = Flatten<z.infer<typeof generatedSchemas.schema>>;
64
- export type t = Operation;
65
- export const { make, of, create } = factory;
66
-
67
- export const schemas = {
68
- ...generatedSchemas,
69
- schema: generatedSchemas.schema.transform(val => val as Operation),
70
- };
package/Option.ts DELETED
@@ -1,64 +0,0 @@
1
- import createType, { Flatten } from '@taqueria/protocol/Base';
2
- import * as SingleChar from '@taqueria/protocol/SingleChar';
3
- import * as Verb from '@taqueria/protocol/Verb';
4
- import { z } from 'zod';
5
-
6
- export const internalSchema = z.object({
7
- shortFlag: SingleChar.schemas.schema.describe('Option Short Flag').optional(),
8
- flag: Verb.schemas.schema.describe('Option Long Flag'),
9
- description: z.string({ description: 'Option Description' }).min(1),
10
- defaultValue: z.union(
11
- [z.string(), z.number(), z.boolean()],
12
- { description: 'Option Default Value' },
13
- ).optional(),
14
- choices: z.array(
15
- z.string({ description: 'Option Choice' }),
16
- { description: 'Option Choices' },
17
- ).optional(),
18
- required: z.boolean({ description: 'Option Is Required' }).default(false).optional(),
19
- boolean: z.boolean({ description: 'Option Is Boolean' }).default(false).optional(),
20
- type: z.union(
21
- [z.literal('string'), z.literal('number'), z.literal('boolean')],
22
- { description: 'Positional Arg Datatype' },
23
- ).optional(),
24
- }).describe('Option');
25
-
26
- export const rawSchema = z.object({
27
- shortFlag: SingleChar.rawSchema.describe('Option Short Flag').optional(),
28
- flag: Verb.rawSchema.describe('Option Long Flag'),
29
- description: z.string({ description: 'Option Description' }).min(1),
30
- defaultValue: z.union(
31
- [z.string(), z.number(), z.boolean()],
32
- { description: 'Option Default Value' },
33
- ).optional(),
34
- choices: z.array(
35
- z.string({ description: 'Option Choice' }),
36
- { description: 'Option Choices' },
37
- ).optional(),
38
- required: z.boolean({ description: 'Option Is Required' }).default(false).optional(),
39
- boolean: z.boolean({ description: 'Option Is Boolean' }).default(false).optional(),
40
- type: z.union(
41
- [z.literal('string'), z.literal('number'), z.literal('boolean')],
42
- { description: 'Positional Arg Datatype' },
43
- ).optional(),
44
- }).describe('Option');
45
-
46
- type RawInput = z.infer<typeof rawSchema>;
47
- type Input = z.infer<typeof internalSchema>;
48
-
49
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
50
- rawSchema,
51
- internalSchema,
52
- parseErrMsg: (value: unknown) => `The following option is invalid: ${value}`,
53
- unknownErrMsg: 'Something went wrong trying to parse the option',
54
- });
55
-
56
- export type Option = Flatten<z.infer<typeof generatedSchemas.schema>>;
57
- export type t = Option;
58
-
59
- export const { make, create, of } = factory;
60
-
61
- export const schemas = {
62
- ...generatedSchemas,
63
- schema: generatedSchemas.schema.transform(val => val as Option),
64
- };
@@ -1,33 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as Operation from '@taqueria/protocol/Operation';
3
- import { z } from 'zod';
4
-
5
- const internalSchema = Operation
6
- .internalSchema
7
- .describe('ParsedOperation')
8
- .omit({ handler: true });
9
-
10
- export const rawSchema = Operation
11
- .rawSchema
12
- .omit({ handler: true })
13
- .describe('ParsedOperation');
14
-
15
- type RawInput = z.infer<typeof rawSchema>;
16
- type Input = z.infer<typeof internalSchema>;
17
-
18
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
19
- rawSchema,
20
- internalSchema,
21
- parseErrMsg: (value: unknown) => `Could not parse the following operation: ${value}`,
22
- unknownErrMsg: 'Something went wrong trying to parse an operation',
23
- });
24
-
25
- export type ParsedOperation = z.infer<typeof generatedSchemas.schema>;
26
- export type t = ParsedOperation;
27
-
28
- export const { create, make, of } = factory;
29
-
30
- export const schemas = {
31
- ...generatedSchemas,
32
- schema: generatedSchemas.schema.transform(val => val as ParsedOperation),
33
- };
package/ParsedTemplate.ts DELETED
@@ -1,40 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as PluginResponseEncoding from '@taqueria/protocol/PluginResponseEncoding';
3
- import * as Template from '@taqueria/protocol/Template';
4
- import { z } from 'zod';
5
-
6
- const internalSchema = Template
7
- .internalSchema
8
- .extend({
9
- handler: z.string(),
10
- encoding: PluginResponseEncoding.schemas.schema,
11
- })
12
- .describe('ParsedTemplate');
13
-
14
- export const rawSchema = Template
15
- .rawSchema
16
- .extend({
17
- handler: z.string(),
18
- encoding: PluginResponseEncoding.schemas.schema,
19
- })
20
- .describe('ParsedTemplate');
21
-
22
- type RawInput = z.infer<typeof rawSchema>;
23
- type Input = z.infer<typeof internalSchema>;
24
-
25
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
26
- rawSchema,
27
- internalSchema,
28
- parseErrMsg: (value: unknown) => `Could not parse the following template: ${value}`,
29
- unknownErrMsg: 'Something went wrong trying to parse an template',
30
- });
31
-
32
- export type ParsedTemplate = z.infer<typeof generatedSchemas.schema>;
33
- export type t = ParsedTemplate;
34
-
35
- export const { create, make, of } = factory;
36
-
37
- export const schemas = {
38
- ...generatedSchemas,
39
- schema: generatedSchemas.schema.transform(val => val as ParsedTemplate),
40
- };
@@ -1,69 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as SHA256 from '@taqueria/protocol/SHA256';
3
- import * as Timestamp from '@taqueria/protocol/Timestamp';
4
- import * as Verb from '@taqueria/protocol/Verb';
5
- import { z } from 'zod';
6
-
7
- const rawOpSchema = z.object({
8
- hash: SHA256.rawSchema.describe('state.op.hash'),
9
- time: Timestamp.rawSchema.describe('state.op.time'),
10
- output: z.unknown().describe('state.op.output'),
11
- }).describe('Persistent State Operation');
12
-
13
- const rawTaskSchema = z.object({
14
- task: Verb.schemas.rawSchema,
15
- plugin: z.string().min(1),
16
- time: Timestamp.rawSchema.describe('state.task.time'),
17
- output: z.unknown().describe('state.task.output'),
18
- });
19
-
20
- const internalOpSchema = z.object({
21
- hash: SHA256.schemas.schema.describe('state.op.hash'),
22
- time: Timestamp.schemas.schema.describe('state.op.time'),
23
- output: z.unknown().describe('state.op.output'),
24
- });
25
-
26
- const internalTaskSchema = z.object({
27
- task: Verb.schemas.schema,
28
- plugin: z.string().min(1),
29
- time: Timestamp.schemas.schema.describe('state.task.time'),
30
- output: z.unknown().describe('state.op.output'),
31
- });
32
-
33
- export type PersistedTask = z.infer<typeof internalTaskSchema>;
34
-
35
- export type PersistedOperation = z.infer<typeof internalOpSchema>;
36
-
37
- export const rawSchema = z.object({
38
- operations: z.record(rawOpSchema),
39
- tasks: z.record(rawTaskSchema),
40
- });
41
-
42
- export const internalSchema = z.object({
43
- operations: z.record(internalOpSchema),
44
- tasks: z.record(internalTaskSchema),
45
- }).transform(val => ({
46
- operations: val.operations as unknown as Record<string, PersistedOperation>,
47
- tasks: val.tasks as unknown as Record<string, PersistedTask>,
48
- }));
49
-
50
- type RawInput = z.infer<typeof rawSchema>;
51
-
52
- type Input = z.infer<typeof internalSchema>;
53
-
54
- export const { schemas: generatedSchemas, factory } = createType<RawInput, Input>({
55
- rawSchema,
56
- parseErrMsg: `The persistent state is invalid`,
57
- unknownErrMsg: `Something went wrong trying to parse the persistent state`,
58
- });
59
-
60
- export type PersistentState = z.infer<typeof generatedSchemas.schema>;
61
- export type t = PersistentState;
62
- export type State = PersistentState;
63
-
64
- export const { create, of, make } = factory;
65
-
66
- export const schemas = {
67
- ...generatedSchemas,
68
- schema: generatedSchemas.schema.transform(val => val as unknown as PersistentState),
69
- };
@@ -1,28 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import { z } from 'zod';
3
-
4
- const rawSchema = z.union([
5
- z.literal('checkRuntimeDependencies'),
6
- z.literal('installRuntimeDependencies'),
7
- z.literal('proxy'),
8
- z.literal('proxyTemplate'),
9
- z.literal('pluginInfo'),
10
- ]);
11
-
12
- const internalSchema = rawSchema;
13
-
14
- export type PluginActionName = z.infer<typeof rawSchema>;
15
- export type t = PluginActionName;
16
-
17
- const pluginActionNotSupportedSchema = z.object({
18
- status: z.literal('notSupported'),
19
- msg: z.string(),
20
- });
21
-
22
- export type PluginActionNotSupportedResponse = z.infer<typeof pluginActionNotSupportedSchema>;
23
-
24
- export const schemas = {
25
- schema: internalSchema,
26
- internalSchema,
27
- rawSchema,
28
- };
@@ -1,33 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import { z } from 'zod';
3
-
4
- const rawRuntimeDependency = z.object({
5
- name: z.string(),
6
- path: z.string(),
7
- version: z.string(),
8
- kind: z.union([z.literal('required'), z.literal('optional')]),
9
- });
10
-
11
- type RawRuntimeDependencyInput = z.infer<typeof rawRuntimeDependency>;
12
-
13
- export const { schemas, factory } = createType<RawRuntimeDependencyInput, RawRuntimeDependencyInput>({
14
- rawSchema: rawRuntimeDependency,
15
- internalSchema: rawRuntimeDependency,
16
- parseErrMsg: (value: unknown) => `The following runtime dependency is invalid: ${value}`,
17
- unknownErrMsg: 'Something went wrong trying to parse the template',
18
- });
19
-
20
- export type RuntimeDependency = z.infer<typeof schemas.schema>;
21
-
22
- const runtimeDependencyReport = rawRuntimeDependency.extend({ met: z.boolean() });
23
-
24
- export type RuntimeDependencyReport = z.infer<typeof runtimeDependencyReport>;
25
-
26
- const dependenciesResponseSchema = z.object({
27
- report: z.array(runtimeDependencyReport),
28
- });
29
-
30
- export type PluginDependenciesResponse = z.infer<typeof dependenciesResponseSchema>;
31
- export type t = PluginDependenciesResponse;
32
-
33
- export const { of, make, create } = factory;
package/PluginInfo.ts DELETED
@@ -1,76 +0,0 @@
1
- import * as Alias from '@taqueria/protocol/Alias';
2
- import createType, { Flatten } from '@taqueria/protocol/Base';
3
- import * as ParsedOperation from '@taqueria/protocol/ParsedOperation';
4
- import * as ParsedTemplate from '@taqueria/protocol/ParsedTemplate';
5
- import * as Task from '@taqueria/protocol/Task';
6
- import * as VersionNumber from '@taqueria/protocol/VersionNumber';
7
- import { z } from 'zod';
8
-
9
- export const rawSchema = z.object({
10
- name: z.string({ description: 'Plugin Name' }).min(1),
11
- version: VersionNumber.rawSchema.describe('Plugin Version #'),
12
- schema: VersionNumber.rawSchema.describe('Plugin Schema Version #'),
13
- alias: Alias.rawSchema.describe('Plugin Alias'),
14
- tasks: z.preprocess(
15
- val => val ?? [],
16
- z.array(
17
- Task.schemas.schema.describe('Plugin Task'),
18
- { description: 'Plugin Tasks' },
19
- ),
20
- ).optional(),
21
- operations: z.preprocess(
22
- val => val ?? [],
23
- z.array(
24
- ParsedOperation.schemas.schema.describe('Plugin Operation'),
25
- { description: 'Plugin Operations' },
26
- ),
27
- ).optional(),
28
- templates: z.preprocess(
29
- val => val ?? [],
30
- z.array(
31
- ParsedTemplate.schemas.schema.describe('Plugin Template'),
32
- ),
33
- ).optional(),
34
- });
35
-
36
- export const internalSchema = rawSchema.extend({
37
- version: VersionNumber.schemas.schema.describe('Plugin Version #'),
38
- schema: VersionNumber.schemas.schema.describe('Plugin Schema Version #'),
39
- alias: Alias.schemas.schema.describe('Plugin Alias'),
40
- tasks: z.preprocess(
41
- val => val ?? [],
42
- z.array(
43
- Task.schemas.schema.describe('Plugin Task'),
44
- { description: 'Plugin Tasks' },
45
- ),
46
- ).optional(),
47
- operations: z.preprocess(
48
- val => val ?? [],
49
- z.array(
50
- ParsedOperation.schemas.schema.describe('Plugin Operation'),
51
- { description: 'Plugin Operations' },
52
- ),
53
- ).optional(),
54
- templates: z.preprocess(
55
- val => val ?? [],
56
- z.array(
57
- ParsedTemplate.schemas.schema.describe('Plugin Template'),
58
- ),
59
- ).optional(),
60
- }).describe('Plugin Schema');
61
-
62
- // export const rawSchema = internalSchema;
63
-
64
- type RawInput = z.infer<typeof rawSchema>;
65
- type Input = Flatten<z.infer<typeof internalSchema>>;
66
-
67
- export const { schemas, factory } = createType<RawInput, Input>({
68
- rawSchema,
69
- internalSchema,
70
- parseErrMsg: 'The schema returned from the plugin is invalid',
71
- unknownErrMsg: 'Something went wrong parsing the schema from a plugin',
72
- });
73
-
74
- export type PluginInfo = Flatten<z.infer<typeof schemas.schema>>;
75
- export type t = PluginInfo;
76
- export const { create, of, make } = factory;
@@ -1,26 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import { z } from 'zod';
3
-
4
- export const rawSchema = z.object({
5
- data: z.unknown().optional(),
6
- render: z.union([
7
- z.literal('none'),
8
- z.literal('table'),
9
- z.literal('string'),
10
- ]).optional(),
11
- });
12
-
13
- type RawPluginJsonResponseInput = z.infer<typeof rawSchema>;
14
-
15
- export const pluginJsonResponse = createType<RawPluginJsonResponseInput, RawPluginJsonResponseInput>({
16
- rawSchema: rawSchema,
17
- internalSchema: rawSchema,
18
- parseErrMsg: (value: unknown) => `The following JSON response is invalid: ${value}`,
19
- unknownErrMsg: 'Something went wrong trying to parse the template',
20
- });
21
-
22
- export type PluginJsonResponse = z.infer<typeof pluginJsonResponse.schemas.schema>;
23
-
24
- export type t = PluginJsonResponse;
25
-
26
- export const { schemas, factory } = pluginJsonResponse;
@@ -1,24 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import * as PluginJsonResponse from '@taqueria/protocol/PluginJsonResponse';
3
- import { z } from 'zod';
4
-
5
- const internalSchema = z.union([
6
- PluginJsonResponse.schemas.internalSchema,
7
- z.void(),
8
- ]);
9
-
10
- export const rawSchema = internalSchema;
11
-
12
- type Input = z.infer<typeof internalSchema>;
13
-
14
- export const { schemas, factory } = createType<Input, Input>({
15
- rawSchema,
16
- internalSchema,
17
- parseErrMsg: 'The response from the proxy request is invalid',
18
- unknownErrMsg: 'Something went wrong parsing the proxy response from the plugin',
19
- });
20
-
21
- export type PluginProxyResponse = z.infer<typeof schemas.schema>;
22
- export type t = PluginProxyResponse;
23
-
24
- export const { of, make, create } = factory;
@@ -1,27 +0,0 @@
1
- import createType from '@taqueria/protocol/Base';
2
- import { z } from 'zod';
3
-
4
- export const rawSchema = z.preprocess(
5
- (val: unknown) => val ?? 'none',
6
- z.union([
7
- z.literal('json'),
8
- z.literal('application/json'),
9
- z.literal('none'),
10
- ])
11
- .default('none')
12
- .optional(),
13
- );
14
-
15
- type RawInput = z.infer<typeof rawSchema>;
16
-
17
- export const { schemas, factory } = createType<RawInput, RawInput>({
18
- rawSchema,
19
- internalSchema: rawSchema,
20
- parseErrMsg: (value: unknown) => `The following encoding is invalid: ${value}`,
21
- unknownErrMsg: 'Something went wrong trying to parse the encoding',
22
- });
23
-
24
- export type PluginResponseEncoding = z.infer<typeof schemas.schema>;
25
- export type t = PluginResponseEncoding;
26
-
27
- export const { create, of, make } = factory;