@taqueria/protocol 0.4.2 → 0.5.0-rc1

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 (3) hide show
  1. package/Settings.ts +27 -0
  2. package/i18n.ts +2 -0
  3. package/package.json +1 -1
package/Settings.ts ADDED
@@ -0,0 +1,27 @@
1
+ import createType from '@taqueria/protocol/Base';
2
+ import { z } from 'zod';
3
+
4
+ export const rawSchema = z.object({
5
+ consent: z.union(
6
+ [z.literal('opt_in'), z.literal('opt_out')],
7
+ { description: 'Consent' },
8
+ ),
9
+ }).describe('Setting');
10
+
11
+ type RawInput = z.infer<typeof rawSchema>;
12
+
13
+ export const { schemas: generatedSchemas, factory } = createType<RawInput, RawInput>({
14
+ rawSchema,
15
+ parseErrMsg: (value: unknown) => `${value} is not a valid settings type`,
16
+ unknownErrMsg: 'Something went wrong when parsing the settings file',
17
+ });
18
+
19
+ export type Settings = z.infer<typeof generatedSchemas.schema>;
20
+ export type t = Settings;
21
+
22
+ export const { create, of, make } = factory;
23
+
24
+ export const schemas = {
25
+ ...generatedSchemas,
26
+ schema: generatedSchemas.schema.transform(val => val as Settings),
27
+ };
package/i18n.ts CHANGED
@@ -22,6 +22,8 @@ export default async (): Promise<i18n> => {
22
22
  'betaWarning': "Taqueria is currently in BETA. You've been warned. :)",
23
23
  'configDirDesc': 'Config directory (default ./.taq)',
24
24
  'initDesc': 'Initialize a new project',
25
+ 'optInDesc': 'Opt-in to sharing anonymous usage analytics',
26
+ 'optOutDesc': 'Opt-out of sharing anonymous usage analytics',
25
27
  'initPathDesc': 'Path to your project directory',
26
28
  'scaffoldDesc': 'Generate a new project using pre-made scaffold',
27
29
  'scaffoldUrlDesc': 'Alias or Url for the scaffold project',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taqueria/protocol",
3
- "version": "0.4.2",
3
+ "version": "0.5.0-rc1",
4
4
  "description": "A TypeScript package which contains types that are to be shared between @taqueria/node-sdk and @taqueria/taqueria.",
5
5
  "main": "index.js",
6
6
  "scripts": {