@taqueria/protocol 0.13.0 → 0.13.16
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/Config.ts +3 -0
- package/Environment.ts +4 -0
- package/MetadataConfig.ts +37 -0
- package/package.json +1 -1
- package/taqueria-protocol-types.ts +1 -0
package/Config.ts
CHANGED
|
@@ -2,6 +2,7 @@ import createType, { Flatten } from '@taqueria/protocol/Base';
|
|
|
2
2
|
import * as Contract from '@taqueria/protocol/Contract';
|
|
3
3
|
import * as Environment from '@taqueria/protocol/Environment';
|
|
4
4
|
import * as InstalledPlugin from '@taqueria/protocol/InstalledPlugin';
|
|
5
|
+
import * as MetadataConfig from '@taqueria/protocol/MetadataConfig';
|
|
5
6
|
import * as NetworkConfig from '@taqueria/protocol/NetworkConfig';
|
|
6
7
|
import * as SandboxConfig from '@taqueria/protocol/SandboxConfig';
|
|
7
8
|
import * as Tz from '@taqueria/protocol/Tz';
|
|
@@ -101,6 +102,7 @@ export const internalSchema = commonSchema.extend({
|
|
|
101
102
|
environment: environmentMap,
|
|
102
103
|
accounts: accountsMap,
|
|
103
104
|
contracts: z.record(Contract.schemas.schema).optional(),
|
|
105
|
+
metadata: MetadataConfig.schemas.schema.optional(),
|
|
104
106
|
});
|
|
105
107
|
|
|
106
108
|
export const rawSchema = commonSchema.extend({
|
|
@@ -138,6 +140,7 @@ export const rawSchema = commonSchema.extend({
|
|
|
138
140
|
{ description: 'config.accounts' },
|
|
139
141
|
)
|
|
140
142
|
.optional(),
|
|
143
|
+
metadata: MetadataConfig.rawSchema.optional(),
|
|
141
144
|
}).describe('config');
|
|
142
145
|
|
|
143
146
|
type RawInput = z.infer<typeof rawSchema>;
|
package/Environment.ts
CHANGED
|
@@ -15,6 +15,10 @@ export const rawSchema = z.object({
|
|
|
15
15
|
{ description: 'Environment storage' },
|
|
16
16
|
)
|
|
17
17
|
.optional(),
|
|
18
|
+
aliases: z.record(
|
|
19
|
+
z.any({ description: 'Environment address alias' }),
|
|
20
|
+
{ description: 'Environment alias' },
|
|
21
|
+
).optional(),
|
|
18
22
|
}).describe('Environment Config');
|
|
19
23
|
|
|
20
24
|
type RawInput = z.infer<typeof rawSchema>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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/package.json
CHANGED
|
@@ -7,6 +7,7 @@ export * as HumanReadableIdentifier from '@taqueria/protocol/HumanReadableIdenti
|
|
|
7
7
|
export * as i18n from '@taqueria/protocol/i18n';
|
|
8
8
|
export * as InstalledPlugin from '@taqueria/protocol/InstalledPlugin';
|
|
9
9
|
export * as LoadedConfig from '@taqueria/protocol/LoadedConfig';
|
|
10
|
+
export * as MetadataConfig from '@taqueria/protocol/MetadataConfig';
|
|
10
11
|
export * as NetworkConfig from '@taqueria/protocol/NetworkConfig';
|
|
11
12
|
export * as Operation from '@taqueria/protocol/Operation';
|
|
12
13
|
export * as Option from '@taqueria/protocol/Option';
|