@kelviq/cli 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -103,6 +103,12 @@ UUIDs), but that resolution is sync's job, not something you write by hand.
103
103
  The plan lifecycle (draft → publish) is deliberately absent from this
104
104
  format: it describes desired state, not deployment state.
105
105
 
106
+ Fields like `taxCode`, `type`, `priceType`, `taxBehavior`, and `reset` are
107
+ open enums: known values (like the ones above) get editor autocomplete, but
108
+ the API may accept additional values — some require enabling from the
109
+ Kelviq dashboard first. The CLI passes any value it doesn't recognize
110
+ through unchanged; the server validates it on `push`.
111
+
106
112
  `kelviq pull` generates this same shape from a live environment's catalog
107
113
  instead of you writing it by hand — the two are meant to be interchangeable
108
114
  starting points.
@@ -1,10 +1,9 @@
1
- import type { z } from 'zod';
2
- import { featureDefSchema, planDefSchema, productDefSchema, type FeatureDef, type PlanDef, type ProductDef } from './schema.js';
1
+ import { type FeatureDef, type PlanDef, type ProductDef } from './schema.js';
3
2
  export type Kind = 'product' | 'feature' | 'plan';
4
3
  /** A parsed def plus a non-enumerable `__kind` tag identifying which builder produced it. */
5
4
  export type Branded<T, K extends Kind> = T & {
6
5
  readonly __kind: K;
7
6
  };
8
- export declare function product(def: z.input<typeof productDefSchema>): Branded<ProductDef, 'product'>;
9
- export declare function feature(def: z.input<typeof featureDefSchema>): Branded<FeatureDef, 'feature'>;
10
- export declare function plan(def: z.input<typeof planDefSchema>): Branded<PlanDef, 'plan'>;
7
+ export declare function product(def: ProductDef): Branded<ProductDef, 'product'>;
8
+ export declare function feature(def: FeatureDef): Branded<FeatureDef, 'feature'>;
9
+ export declare function plan(def: PlanDef): Branded<PlanDef, 'plan'>;
@@ -27,13 +27,20 @@ function parseOrThrow(schema, def, kind) {
27
27
  }
28
28
  return result.data;
29
29
  }
30
- // Each builder takes the schema's *input* type (z.input<...>), not
31
- // `unknown`: this is what gives kelviq.config.ts authors compile-time field
32
- // checking and editor autocomplete (a misspelled `taxCod:` or wrong-typed
33
- // field is a tsc error, not a surprise at runtime). The `parseOrThrow` /
34
- // `safeParse` call below stays regardless — it's belt-and-suspenders,
35
- // protecting ./load.ts when a config file's values are constructed
36
- // dynamically and bypass these static types.
30
+ // Each builder takes the schema's `*Def` type (not `unknown`, not
31
+ // `z.input<...>`): this is what gives kelviq.config.ts authors compile-time
32
+ // field checking and editor autocomplete (a misspelled `taxCod:` or
33
+ // wrong-typed field is a tsc error, not a surprise at runtime). None of
34
+ // these schemas use `.transform()`, so a def's input and output shapes are
35
+ // identical except for the API-owned enum fields (taxCode, type, reset,
36
+ // priceType, taxBehavior) — those are open enums (CLI plan 019) and
37
+ // `z.input<...>` would collapse their known-value literals down to plain
38
+ // `string`, losing autocomplete; ./schema.ts's `*Def` types re-type just
39
+ // those fields to `Known | (string & {})` instead, which is why builders
40
+ // use them here rather than deriving a parameter type from the schema. The
41
+ // `parseOrThrow` / `safeParse` call below stays regardless — it's
42
+ // belt-and-suspenders, protecting ./load.ts when a config file's values are
43
+ // constructed dynamically and bypass these static types.
37
44
  export function product(def) {
38
45
  return brand(parseOrThrow(productDefSchema, def, 'product'), 'product');
39
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"builders.js","sourceRoot":"","sources":["../../src/config-format/builders.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GAIjB,MAAM,aAAa,CAAC;AAOrB,SAAS,KAAK,CAAmC,KAAQ,EAAE,IAAO;IAChE,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE;QACrC,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IACH,OAAO,KAAsB,CAAC;AAChC,CAAC;AAED,wGAAwG;AACxG,SAAS,YAAY,CAAC,GAAY;IAChC,IAAI,OAAO,GAAG,KAAK,QAAQ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,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;aAC9F,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,YAAY,CAAC,GAAG,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,kEAAkE;AAClE,4EAA4E;AAC5E,oEAAoE;AACpE,wEAAwE;AACxE,2EAA2E;AAC3E,wEAAwE;AACxE,oEAAoE;AACpE,yEAAyE;AACzE,yEAAyE;AACzE,yEAAyE;AACzE,2EAA2E;AAC3E,kEAAkE;AAClE,4EAA4E;AAC5E,yDAAyD;AACzD,MAAM,UAAU,OAAO,CAAC,GAAe;IACrC,OAAO,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAe;IACrC,OAAO,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAY;IAC/B,OAAO,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC"}
@@ -3,20 +3,32 @@
3
3
  // NOT re-exported from ./index.ts, which is the public `@kelviq/cli/config`
4
4
  // surface a user's config file imports from.
5
5
  //
6
- // Loading strategy: dynamic `import()` alone can't run a `.ts` file outside
7
- // the CLI's own `tsx` dev runner (a built, published CLI has no TS loader
8
- // registered in the consuming Node process). `tsx`'s programmatic API
9
- // (`tsImport` from `tsx/esm/api`) transpiles-and-imports on demand, so it
10
- // works identically whether this code is running under `npm run dev` (tsx
11
- // already active) or from the compiled `dist/` output (tsx invoked
12
- // explicitly here). This is why `tsx` moved from devDependencies to
13
- // dependencies in package.json — it adds real install size to the published
14
- // package, but hand-rolling a TS transpiler or adding a second bundler
15
- // (esbuild) is out of scope for v0 (see CLI plan 004 STOP conditions).
16
- // Revisit with an esbuild-based loader if the size tradeoff becomes a
17
- // problem.
6
+ // Loading strategy: bundle-and-import (the same pattern Vite/Vitest/tsup use
7
+ // for loading a user's config file at runtime). CLI plan 018 replaced two
8
+ // tsx-based loaders that both turned out to be compromised:
9
+ // - `tsImport()` (tsx/esm/api): on Windows, its scoped-namespace resolver
10
+ // emits a raw `C:\...?namespace=...` path for the config's nested bare
11
+ // imports (e.g. `@kelviq/cli/config`) instead of a file:// URL, which
12
+ // Node's ESM loader rejects with ERR_MODULE_NOT_FOUND (plan 018, the bug
13
+ // report).
14
+ // - tsx's global `register()` + plain `import()`: on Node >=22.15,
15
+ // collides with vitest's own `module.registerHooks()` — the stacked
16
+ // loader hooks corrupt nested absolute-URL resolution and broke 46
17
+ // tests (plan 018 v1, STOPPED).
18
+ // Neither replacement may use Node's ESM loader hooks. Instead: esbuild
19
+ // bundles the config file (inlining any relative imports it has, leaving
20
+ // bare specifiers — `@kelviq/cli/config`, node builtins — external) into
21
+ // one self-contained ESM text; we write that text to a uniquely-named temp
22
+ // file NEXT TO the original config (so its external bare imports resolve
23
+ // through the user's own node_modules, exactly as if the config itself had
24
+ // been run directly); `import()` that temp file by its file:// URL via
25
+ // node:url; and delete it in a `finally`. No loader hooks, no namespaces —
26
+ // nothing for Windows (or vitest) to mangle. Do not reintroduce tsx here.
27
+ import { randomUUID } from 'node:crypto';
28
+ import { existsSync } from 'node:fs';
29
+ import { rm, writeFile } from 'node:fs/promises';
18
30
  import { pathToFileURL } from 'node:url';
19
- import { tsImport } from 'tsx/esm/api';
31
+ import { build } from 'esbuild';
20
32
  /**
21
33
  * Dynamically loads `path` (a `.ts` or `.js` kelviq config file) and
22
34
  * collects every exported value branded by `product()`/`feature()`/`plan()`
@@ -30,8 +42,7 @@ import { tsImport } from 'tsx/esm/api';
30
42
  * remotely only.
31
43
  */
32
44
  export async function loadConfigFile(path) {
33
- const fileUrl = pathToFileURL(path).href;
34
- const mod = (await tsImport(fileUrl, import.meta.url));
45
+ const mod = await bundleAndImport(path);
35
46
  const products = [];
36
47
  const features = [];
37
48
  const plans = [];
@@ -52,6 +63,64 @@ export async function loadConfigFile(path) {
52
63
  const warnings = collectReferenceWarnings(products, features, plans);
53
64
  return { config: { products, features, plans }, warnings };
54
65
  }
66
+ /**
67
+ * Bundles `path` with esbuild, writes the result to a throwaway `.tmp.mjs`
68
+ * sibling, imports it, and removes it — success or failure. The temp file's
69
+ * directory (same as `path`) is load-bearing: it's how the bundle's
70
+ * external bare imports (e.g. `@kelviq/cli/config`) find the user project's
71
+ * `node_modules` via normal Node resolution.
72
+ */
73
+ async function bundleAndImport(path) {
74
+ if (!existsSync(path)) {
75
+ throw new Error(`Config file not found: ${path}`);
76
+ }
77
+ const bundled = await bundleConfig(path);
78
+ const tempPath = `${path}.${randomUUID()}.tmp.mjs`;
79
+ try {
80
+ await writeFile(tempPath, bundled, 'utf8');
81
+ return (await import(pathToFileURL(tempPath).href));
82
+ }
83
+ finally {
84
+ await rm(tempPath, { force: true });
85
+ }
86
+ }
87
+ /** Runs esbuild and returns the bundled ESM text, or throws a clean one-line error. */
88
+ async function bundleConfig(path) {
89
+ try {
90
+ const result = await build({
91
+ entryPoints: [path],
92
+ bundle: true,
93
+ format: 'esm',
94
+ platform: 'node',
95
+ packages: 'external',
96
+ write: false,
97
+ // We format and throw our own clean one-line error below — don't let
98
+ // esbuild additionally print its own colorized error/code-frame to
99
+ // stderr on a build failure.
100
+ logLevel: 'silent',
101
+ });
102
+ // `outputFiles` is only absent when `write` isn't `false` — it is here.
103
+ return result.outputFiles[0].text;
104
+ }
105
+ catch (err) {
106
+ throw new Error(`Failed to load config file "${path}": ${formatEsbuildError(err)}`, { cause: err });
107
+ }
108
+ }
109
+ /** Reduces an esbuild `BuildFailure` to a single readable line (file:line: message), never a raw stack. */
110
+ function formatEsbuildError(err) {
111
+ const errors = isBuildFailure(err) ? err.errors : undefined;
112
+ if (errors && errors.length > 0) {
113
+ return errors.map(formatEsbuildMessage).join('; ');
114
+ }
115
+ return err instanceof Error ? err.message : String(err);
116
+ }
117
+ function formatEsbuildMessage(message) {
118
+ const loc = message.location;
119
+ return loc ? `${loc.file}:${loc.line}:${loc.column}: ${message.text}` : message.text;
120
+ }
121
+ function isBuildFailure(err) {
122
+ return err instanceof Error && Array.isArray(err.errors);
123
+ }
55
124
  function requireUniqueIdentifiers(defs, kind) {
56
125
  const seen = new Set();
57
126
  for (const def of defs) {
@@ -1 +1 @@
1
- {"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config-format/load.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAC5E,6CAA6C;AAC7C,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,sEAAsE;AACtE,0EAA0E;AAC1E,0EAA0E;AAC1E,mEAAmE;AACnE,oEAAoE;AACpE,4EAA4E;AAC5E,uEAAuE;AACvE,uEAAuE;AACvE,sEAAsE;AACtE,WAAW;AACX,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAkBvC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAY;IAC/C,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;IACzC,MAAM,GAAG,GAAG,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAA4B,CAAC;IAElF,MAAM,QAAQ,GAAiB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAiB,EAAE,C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;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,27 +1,37 @@
1
1
  import { z } from 'zod';
2
2
  /** URL-safe slug used as the sole cross-reference key throughout the config. */
3
3
  export declare const identifierSchema: z.ZodString;
4
- export declare const taxCodeSchema: z.ZodEnum<["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"]>;
5
- export type TaxCode = z.infer<typeof taxCodeSchema>;
6
- export declare const featureTypeSchema: z.ZodEnum<["BOOLEAN", "CUSTOMIZABLE", "METER"]>;
7
- export type FeatureType = z.infer<typeof featureTypeSchema>;
8
- export declare const resetSchema: z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>;
9
- export type Reset = z.infer<typeof resetSchema>;
10
- export declare const taxBehaviorSchema: z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>;
11
- export type TaxBehavior = z.infer<typeof taxBehaviorSchema>;
12
- export declare const priceTypeSchema: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
13
- export type PriceType = z.infer<typeof priceTypeSchema>;
4
+ export declare const KNOWN_TAX_CODES: readonly ["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"];
5
+ export type KnownTaxCode = (typeof KNOWN_TAX_CODES)[number];
6
+ export type TaxCode = KnownTaxCode | (string & {});
7
+ export declare const taxCodeSchema: z.ZodUnion<[z.ZodEnum<["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"]>, z.ZodString]>;
8
+ export declare const KNOWN_FEATURE_TYPES: readonly ["BOOLEAN", "CUSTOMIZABLE", "METER"];
9
+ export type KnownFeatureType = (typeof KNOWN_FEATURE_TYPES)[number];
10
+ export type FeatureType = KnownFeatureType | (string & {});
11
+ export declare const featureTypeSchema: z.ZodUnion<[z.ZodEnum<["BOOLEAN", "CUSTOMIZABLE", "METER"]>, z.ZodString]>;
12
+ export declare const KNOWN_RESETS: readonly ["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"];
13
+ export type KnownReset = (typeof KNOWN_RESETS)[number];
14
+ export type Reset = KnownReset | (string & {});
15
+ export declare const resetSchema: z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>;
16
+ export declare const KNOWN_TAX_BEHAVIORS: readonly ["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"];
17
+ export type KnownTaxBehavior = (typeof KNOWN_TAX_BEHAVIORS)[number];
18
+ export type TaxBehavior = KnownTaxBehavior | (string & {});
19
+ export declare const taxBehaviorSchema: z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>;
20
+ export declare const KNOWN_PRICE_TYPES: readonly ["FREE", "PAID", "CUSTOM"];
21
+ export type KnownPriceType = (typeof KNOWN_PRICE_TYPES)[number];
22
+ export type PriceType = KnownPriceType | (string & {});
23
+ export declare const priceTypeSchema: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
14
24
  export declare const featureDefSchema: z.ZodObject<{
15
25
  identifier: z.ZodString;
16
26
  name: z.ZodString;
17
- type: z.ZodEnum<["BOOLEAN", "CUSTOMIZABLE", "METER"]>;
27
+ type: z.ZodUnion<[z.ZodEnum<["BOOLEAN", "CUSTOMIZABLE", "METER"]>, z.ZodString]>;
18
28
  description: z.ZodOptional<z.ZodString>;
19
29
  featureDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
20
30
  meter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
21
31
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
22
32
  }, "strip", z.ZodTypeAny, {
23
33
  name: string;
24
- type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
34
+ type: string;
25
35
  identifier: string;
26
36
  description?: string | undefined;
27
37
  featureDetails?: Record<string, unknown> | undefined;
@@ -29,60 +39,113 @@ export declare const featureDefSchema: z.ZodObject<{
29
39
  metadata?: Record<string, unknown> | undefined;
30
40
  }, {
31
41
  name: string;
32
- type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
42
+ type: string;
33
43
  identifier: string;
34
44
  description?: string | undefined;
35
45
  featureDetails?: Record<string, unknown> | undefined;
36
46
  meter?: Record<string, unknown> | undefined;
37
47
  metadata?: Record<string, unknown> | undefined;
38
48
  }>;
39
- export type FeatureDef = z.infer<typeof featureDefSchema>;
49
+ export type FeatureDef = Omit<z.infer<typeof featureDefSchema>, 'type'> & {
50
+ type: FeatureType;
51
+ };
52
+ declare const entitlementDefShape: z.ZodObject<{
53
+ feature: z.ZodString;
54
+ value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
55
+ hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
56
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
57
+ hardLimit: z.ZodOptional<z.ZodBoolean>;
58
+ usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ feature: string;
61
+ value?: number | boolean | undefined;
62
+ hasUnlimitedUsage?: boolean | undefined;
63
+ reset?: string | undefined;
64
+ hardLimit?: boolean | undefined;
65
+ usageAlerts?: Record<string, unknown> | undefined;
66
+ }, {
67
+ feature: string;
68
+ value?: number | boolean | undefined;
69
+ hasUnlimitedUsage?: boolean | undefined;
70
+ reset?: string | undefined;
71
+ hardLimit?: boolean | undefined;
72
+ usageAlerts?: Record<string, unknown> | undefined;
73
+ }>;
40
74
  export declare const entitlementDefSchema: z.ZodObject<{
41
75
  feature: z.ZodString;
42
76
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
43
77
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
44
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
78
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
45
79
  hardLimit: z.ZodOptional<z.ZodBoolean>;
46
80
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
47
81
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
48
82
  feature: z.ZodString;
49
83
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
50
84
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
51
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
85
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
52
86
  hardLimit: z.ZodOptional<z.ZodBoolean>;
53
87
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
54
88
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
55
89
  feature: z.ZodString;
56
90
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
57
91
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
58
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
92
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
59
93
  hardLimit: z.ZodOptional<z.ZodBoolean>;
60
94
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
61
95
  }, z.ZodTypeAny, "passthrough">>;
62
- export type EntitlementDef = z.infer<typeof entitlementDefSchema>;
96
+ export type EntitlementDef = Omit<z.infer<typeof entitlementDefShape>, 'reset'> & {
97
+ reset?: Reset;
98
+ [key: string]: unknown;
99
+ };
100
+ declare const priceDefShape: z.ZodObject<{
101
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
102
+ currency: z.ZodOptional<z.ZodString>;
103
+ freeTrial: z.ZodOptional<z.ZodBoolean>;
104
+ trialPeriod: z.ZodOptional<z.ZodNumber>;
105
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
106
+ chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ priceType: string;
109
+ currency?: string | undefined;
110
+ freeTrial?: boolean | undefined;
111
+ trialPeriod?: number | undefined;
112
+ taxBehavior?: string | undefined;
113
+ chargeCatalogPrice?: Record<string, unknown>[] | undefined;
114
+ }, {
115
+ priceType: string;
116
+ currency?: string | undefined;
117
+ freeTrial?: boolean | undefined;
118
+ trialPeriod?: number | undefined;
119
+ taxBehavior?: string | undefined;
120
+ chargeCatalogPrice?: Record<string, unknown>[] | undefined;
121
+ }>;
63
122
  export declare const priceDefSchema: z.ZodObject<{
64
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
123
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
65
124
  currency: z.ZodOptional<z.ZodString>;
66
125
  freeTrial: z.ZodOptional<z.ZodBoolean>;
67
126
  trialPeriod: z.ZodOptional<z.ZodNumber>;
68
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
127
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
69
128
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
70
129
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
71
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
130
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
72
131
  currency: z.ZodOptional<z.ZodString>;
73
132
  freeTrial: z.ZodOptional<z.ZodBoolean>;
74
133
  trialPeriod: z.ZodOptional<z.ZodNumber>;
75
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
134
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
76
135
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
77
136
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
78
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
137
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
79
138
  currency: z.ZodOptional<z.ZodString>;
80
139
  freeTrial: z.ZodOptional<z.ZodBoolean>;
81
140
  trialPeriod: z.ZodOptional<z.ZodNumber>;
82
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
141
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
83
142
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
84
143
  }, z.ZodTypeAny, "passthrough">>;
85
- export type PriceDef = z.infer<typeof priceDefSchema>;
144
+ export type PriceDef = Omit<z.infer<typeof priceDefShape>, 'priceType' | 'taxBehavior'> & {
145
+ priceType: PriceType;
146
+ taxBehavior?: TaxBehavior;
147
+ [key: string]: unknown;
148
+ };
86
149
  export declare const planDefSchema: z.ZodObject<{
87
150
  identifier: z.ZodString;
88
151
  name: z.ZodString;
@@ -93,44 +156,44 @@ export declare const planDefSchema: z.ZodObject<{
93
156
  feature: z.ZodString;
94
157
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
95
158
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
96
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
159
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
97
160
  hardLimit: z.ZodOptional<z.ZodBoolean>;
98
161
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
99
162
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
100
163
  feature: z.ZodString;
101
164
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
102
165
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
103
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
166
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
104
167
  hardLimit: z.ZodOptional<z.ZodBoolean>;
105
168
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
106
169
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
107
170
  feature: z.ZodString;
108
171
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
109
172
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
110
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
173
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
111
174
  hardLimit: z.ZodOptional<z.ZodBoolean>;
112
175
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
113
176
  }, z.ZodTypeAny, "passthrough">>, "many">>;
114
177
  prices: z.ZodOptional<z.ZodArray<z.ZodObject<{
115
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
178
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
116
179
  currency: z.ZodOptional<z.ZodString>;
117
180
  freeTrial: z.ZodOptional<z.ZodBoolean>;
118
181
  trialPeriod: z.ZodOptional<z.ZodNumber>;
119
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
182
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
120
183
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
121
184
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
122
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
185
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
123
186
  currency: z.ZodOptional<z.ZodString>;
124
187
  freeTrial: z.ZodOptional<z.ZodBoolean>;
125
188
  trialPeriod: z.ZodOptional<z.ZodNumber>;
126
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
189
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
127
190
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
128
191
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
129
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
192
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
130
193
  currency: z.ZodOptional<z.ZodString>;
131
194
  freeTrial: z.ZodOptional<z.ZodBoolean>;
132
195
  trialPeriod: z.ZodOptional<z.ZodNumber>;
133
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
196
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
134
197
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
135
198
  }, z.ZodTypeAny, "passthrough">>, "many">>;
136
199
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -145,16 +208,16 @@ export declare const planDefSchema: z.ZodObject<{
145
208
  feature: z.ZodString;
146
209
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
147
210
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
148
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
211
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
149
212
  hardLimit: z.ZodOptional<z.ZodBoolean>;
150
213
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
151
214
  }, z.ZodTypeAny, "passthrough">[] | undefined;
152
215
  prices?: z.objectOutputType<{
153
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
216
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
154
217
  currency: z.ZodOptional<z.ZodString>;
155
218
  freeTrial: z.ZodOptional<z.ZodBoolean>;
156
219
  trialPeriod: z.ZodOptional<z.ZodNumber>;
157
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
220
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
158
221
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
159
222
  }, z.ZodTypeAny, "passthrough">[] | undefined;
160
223
  }, {
@@ -168,65 +231,70 @@ export declare const planDefSchema: z.ZodObject<{
168
231
  feature: z.ZodString;
169
232
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
170
233
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
171
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
234
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
172
235
  hardLimit: z.ZodOptional<z.ZodBoolean>;
173
236
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
174
237
  }, z.ZodTypeAny, "passthrough">[] | undefined;
175
238
  prices?: z.objectInputType<{
176
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
239
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
177
240
  currency: z.ZodOptional<z.ZodString>;
178
241
  freeTrial: z.ZodOptional<z.ZodBoolean>;
179
242
  trialPeriod: z.ZodOptional<z.ZodNumber>;
180
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
243
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
181
244
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
182
245
  }, z.ZodTypeAny, "passthrough">[] | undefined;
183
246
  }>;
184
- export type PlanDef = z.infer<typeof planDefSchema>;
247
+ export type PlanDef = Omit<z.infer<typeof planDefSchema>, 'entitlements' | 'prices'> & {
248
+ entitlements?: EntitlementDef[];
249
+ prices?: PriceDef[];
250
+ };
185
251
  export declare const productDefSchema: z.ZodObject<{
186
252
  identifier: z.ZodString;
187
253
  name: z.ZodString;
188
- taxCode: z.ZodEnum<["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"]>;
254
+ taxCode: z.ZodUnion<[z.ZodEnum<["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"]>, z.ZodString]>;
189
255
  description: z.ZodOptional<z.ZodString>;
190
256
  }, "strip", z.ZodTypeAny, {
191
257
  name: string;
192
258
  identifier: string;
193
- taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
259
+ taxCode: string;
194
260
  description?: string | undefined;
195
261
  }, {
196
262
  name: string;
197
263
  identifier: string;
198
- taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
264
+ taxCode: string;
199
265
  description?: string | undefined;
200
266
  }>;
201
- export type ProductDef = z.infer<typeof productDefSchema>;
267
+ export type ProductDef = Omit<z.infer<typeof productDefSchema>, 'taxCode'> & {
268
+ taxCode: TaxCode;
269
+ };
202
270
  export declare const kelviqConfigSchema: z.ZodObject<{
203
271
  products: z.ZodArray<z.ZodObject<{
204
272
  identifier: z.ZodString;
205
273
  name: z.ZodString;
206
- taxCode: z.ZodEnum<["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"]>;
274
+ taxCode: z.ZodUnion<[z.ZodEnum<["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"]>, z.ZodString]>;
207
275
  description: z.ZodOptional<z.ZodString>;
208
276
  }, "strip", z.ZodTypeAny, {
209
277
  name: string;
210
278
  identifier: string;
211
- taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
279
+ taxCode: string;
212
280
  description?: string | undefined;
213
281
  }, {
214
282
  name: string;
215
283
  identifier: string;
216
- taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
284
+ taxCode: string;
217
285
  description?: string | undefined;
218
286
  }>, "many">;
219
287
  features: z.ZodArray<z.ZodObject<{
220
288
  identifier: z.ZodString;
221
289
  name: z.ZodString;
222
- type: z.ZodEnum<["BOOLEAN", "CUSTOMIZABLE", "METER"]>;
290
+ type: z.ZodUnion<[z.ZodEnum<["BOOLEAN", "CUSTOMIZABLE", "METER"]>, z.ZodString]>;
223
291
  description: z.ZodOptional<z.ZodString>;
224
292
  featureDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
225
293
  meter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
226
294
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
227
295
  }, "strip", z.ZodTypeAny, {
228
296
  name: string;
229
- type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
297
+ type: string;
230
298
  identifier: string;
231
299
  description?: string | undefined;
232
300
  featureDetails?: Record<string, unknown> | undefined;
@@ -234,7 +302,7 @@ export declare const kelviqConfigSchema: z.ZodObject<{
234
302
  metadata?: Record<string, unknown> | undefined;
235
303
  }, {
236
304
  name: string;
237
- type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
305
+ type: string;
238
306
  identifier: string;
239
307
  description?: string | undefined;
240
308
  featureDetails?: Record<string, unknown> | undefined;
@@ -251,44 +319,44 @@ export declare const kelviqConfigSchema: z.ZodObject<{
251
319
  feature: z.ZodString;
252
320
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
253
321
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
254
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
322
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
255
323
  hardLimit: z.ZodOptional<z.ZodBoolean>;
256
324
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
257
325
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
258
326
  feature: z.ZodString;
259
327
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
260
328
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
261
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
329
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
262
330
  hardLimit: z.ZodOptional<z.ZodBoolean>;
263
331
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
264
332
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
265
333
  feature: z.ZodString;
266
334
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
267
335
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
268
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
336
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
269
337
  hardLimit: z.ZodOptional<z.ZodBoolean>;
270
338
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
271
339
  }, z.ZodTypeAny, "passthrough">>, "many">>;
272
340
  prices: z.ZodOptional<z.ZodArray<z.ZodObject<{
273
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
341
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
274
342
  currency: z.ZodOptional<z.ZodString>;
275
343
  freeTrial: z.ZodOptional<z.ZodBoolean>;
276
344
  trialPeriod: z.ZodOptional<z.ZodNumber>;
277
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
345
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
278
346
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
279
347
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
280
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
348
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
281
349
  currency: z.ZodOptional<z.ZodString>;
282
350
  freeTrial: z.ZodOptional<z.ZodBoolean>;
283
351
  trialPeriod: z.ZodOptional<z.ZodNumber>;
284
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
352
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
285
353
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
286
354
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
287
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
355
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
288
356
  currency: z.ZodOptional<z.ZodString>;
289
357
  freeTrial: z.ZodOptional<z.ZodBoolean>;
290
358
  trialPeriod: z.ZodOptional<z.ZodNumber>;
291
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
359
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
292
360
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
293
361
  }, z.ZodTypeAny, "passthrough">>, "many">>;
294
362
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -303,16 +371,16 @@ export declare const kelviqConfigSchema: z.ZodObject<{
303
371
  feature: z.ZodString;
304
372
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
305
373
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
306
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
374
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
307
375
  hardLimit: z.ZodOptional<z.ZodBoolean>;
308
376
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
309
377
  }, z.ZodTypeAny, "passthrough">[] | undefined;
310
378
  prices?: z.objectOutputType<{
311
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
379
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
312
380
  currency: z.ZodOptional<z.ZodString>;
313
381
  freeTrial: z.ZodOptional<z.ZodBoolean>;
314
382
  trialPeriod: z.ZodOptional<z.ZodNumber>;
315
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
383
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
316
384
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
317
385
  }, z.ZodTypeAny, "passthrough">[] | undefined;
318
386
  }, {
@@ -326,16 +394,16 @@ export declare const kelviqConfigSchema: z.ZodObject<{
326
394
  feature: z.ZodString;
327
395
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
328
396
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
329
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
397
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
330
398
  hardLimit: z.ZodOptional<z.ZodBoolean>;
331
399
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
332
400
  }, z.ZodTypeAny, "passthrough">[] | undefined;
333
401
  prices?: z.objectInputType<{
334
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
402
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
335
403
  currency: z.ZodOptional<z.ZodString>;
336
404
  freeTrial: z.ZodOptional<z.ZodBoolean>;
337
405
  trialPeriod: z.ZodOptional<z.ZodNumber>;
338
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
406
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
339
407
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
340
408
  }, z.ZodTypeAny, "passthrough">[] | undefined;
341
409
  }>, "many">;
@@ -343,12 +411,12 @@ export declare const kelviqConfigSchema: z.ZodObject<{
343
411
  products: {
344
412
  name: string;
345
413
  identifier: string;
346
- taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
414
+ taxCode: string;
347
415
  description?: string | undefined;
348
416
  }[];
349
417
  features: {
350
418
  name: string;
351
- type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
419
+ type: string;
352
420
  identifier: string;
353
421
  description?: string | undefined;
354
422
  featureDetails?: Record<string, unknown> | undefined;
@@ -366,16 +434,16 @@ export declare const kelviqConfigSchema: z.ZodObject<{
366
434
  feature: z.ZodString;
367
435
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
368
436
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
369
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
437
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
370
438
  hardLimit: z.ZodOptional<z.ZodBoolean>;
371
439
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
372
440
  }, z.ZodTypeAny, "passthrough">[] | undefined;
373
441
  prices?: z.objectOutputType<{
374
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
442
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
375
443
  currency: z.ZodOptional<z.ZodString>;
376
444
  freeTrial: z.ZodOptional<z.ZodBoolean>;
377
445
  trialPeriod: z.ZodOptional<z.ZodNumber>;
378
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
446
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
379
447
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
380
448
  }, z.ZodTypeAny, "passthrough">[] | undefined;
381
449
  }[];
@@ -383,12 +451,12 @@ export declare const kelviqConfigSchema: z.ZodObject<{
383
451
  products: {
384
452
  name: string;
385
453
  identifier: string;
386
- taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
454
+ taxCode: string;
387
455
  description?: string | undefined;
388
456
  }[];
389
457
  features: {
390
458
  name: string;
391
- type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
459
+ type: string;
392
460
  identifier: string;
393
461
  description?: string | undefined;
394
462
  featureDetails?: Record<string, unknown> | undefined;
@@ -406,18 +474,19 @@ export declare const kelviqConfigSchema: z.ZodObject<{
406
474
  feature: z.ZodString;
407
475
  value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
408
476
  hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
409
- reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
477
+ reset: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_28_DAYS", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>, z.ZodString]>>;
410
478
  hardLimit: z.ZodOptional<z.ZodBoolean>;
411
479
  usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
412
480
  }, z.ZodTypeAny, "passthrough">[] | undefined;
413
481
  prices?: z.objectInputType<{
414
- priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
482
+ priceType: z.ZodUnion<[z.ZodEnum<["FREE", "PAID", "CUSTOM"]>, z.ZodString]>;
415
483
  currency: z.ZodOptional<z.ZodString>;
416
484
  freeTrial: z.ZodOptional<z.ZodBoolean>;
417
485
  trialPeriod: z.ZodOptional<z.ZodNumber>;
418
- taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
486
+ taxBehavior: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>, z.ZodString]>>;
419
487
  chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
420
488
  }, z.ZodTypeAny, "passthrough">[] | undefined;
421
489
  }[];
422
490
  }>;
423
491
  export type KelviqConfig = z.infer<typeof kelviqConfigSchema>;
492
+ export {};
@@ -14,12 +14,37 @@ import { z } from 'zod';
14
14
  export const identifierSchema = z
15
15
  .string()
16
16
  .regex(/^[a-z0-9][a-z0-9-_]*$/, 'must be a lowercase, URL-safe slug starting with a letter or digit (e.g. "my-plan")');
17
+ // --- Open-enum pattern (CLI plan 019) --------------------------------------
18
+ //
19
+ // Every enum below is API-owned: the server, not this CLI, is the validator
20
+ // of record. Two things make a hardcoded closed enum unsafe here:
21
+ // 1. This list can go stale vs the deployed OpenAPI spec between CLI
22
+ // releases (the drift-guard in test/sync-price-filter.test.ts catches
23
+ // that at `npm run snapshot` time, but a shipped CLI still has to work
24
+ // against a spec that has since moved on).
25
+ // 2. Some values are org-flag-gated server-side (e.g. `EVERY_28_DAYS` on
26
+ // `reset` was "only available when enabled from backend" per the API
27
+ // maintainer) — even a perfectly fresh KNOWN list can't be exhaustive
28
+ // for every org.
29
+ //
30
+ // So each `KNOWN_*` tuple below is autocomplete freshness, not a runtime
31
+ // gate: the zod schema validates known values and passes any other string
32
+ // through verbatim (never transformed/normalized), and the exported
33
+ // TypeScript type is `KnownX | (string & {})` rather than a plain closed
34
+ // union. `(string & {})` (not plain `string`) is required to keep the
35
+ // known-value literals showing up in editor autocomplete — a plain
36
+ // `KnownX | string` union collapses to `string` in TS's displayed/suggested
37
+ // type, silently losing the autocomplete this format is for. The server
38
+ // remains the authority: an unknown value that isn't actually enabled for
39
+ // the org still gets rejected on `push`.
17
40
  // Sourced from src/generated/openapi.json:
18
41
  // components.schemas.ProductCreateRequest.properties.taxCode.enum
42
+ // (also components.schemas.Product.taxCode, ProductUpdateRequest.taxCode —
43
+ // all three agree; see the drift-guard in test/sync-price-filter.test.ts)
19
44
  // Hardcoded (not read at runtime) per CLI plan 004 Step 1 — re-verify against
20
45
  // a fresh `npm run snapshot` if the API starts rejecting a previously-valid
21
46
  // taxCode.
22
- export const taxCodeSchema = z.enum([
47
+ export const KNOWN_TAX_CODES = [
23
48
  'saas',
24
49
  'saas_business',
25
50
  'software',
@@ -30,11 +55,34 @@ export const taxCodeSchema = z.enum([
30
55
  'videogame',
31
56
  'eservice',
32
57
  'training',
33
- ]);
34
- export const featureTypeSchema = z.enum(['BOOLEAN', 'CUSTOMIZABLE', 'METER']);
35
- export const resetSchema = z.enum(['NEVER', 'EVERY_DAY', 'EVERY_MONTH', 'EVERY_QUARTER', 'EVERY_YEAR']);
36
- export const taxBehaviorSchema = z.enum(['INCLUSIVE', 'EXCLUSIVE', 'UNSPECIFIED']);
37
- export const priceTypeSchema = z.enum(['FREE', 'PAID', 'CUSTOM']);
58
+ ];
59
+ export const taxCodeSchema = z.union([z.enum(KNOWN_TAX_CODES), z.string()]);
60
+ // Sourced from src/generated/openapi.json:
61
+ // components.schemas.CatalogFeature.properties.featureType.enum
62
+ // (also FeatureCreateRequest.featureType — agrees; see drift-guard)
63
+ export const KNOWN_FEATURE_TYPES = ['BOOLEAN', 'CUSTOMIZABLE', 'METER'];
64
+ export const featureTypeSchema = z.union([z.enum(KNOWN_FEATURE_TYPES), z.string()]);
65
+ // Sourced from src/generated/openapi.json:
66
+ // components.schemas.PlanChargeCatalogPrice.properties.reset.enum
67
+ // components.schemas.PlanEntitlementDetails.properties.reset.enum
68
+ // (`reset` appears in TWO schemas — the drift-guard asserts both agree
69
+ // with each other AND with this list; a spec-internal divergence between
70
+ // the two sites is itself drift worth failing on)
71
+ // EVERY_28_DAYS added 2026-07-24 (CLI plan 019) — it was already live in the
72
+ // spec (org-flag-gated) but missing from this list, which hard-failed pull
73
+ // for any org with the flag enabled. See CLI plan 019 for the bug report.
74
+ export const KNOWN_RESETS = ['NEVER', 'EVERY_DAY', 'EVERY_28_DAYS', 'EVERY_MONTH', 'EVERY_QUARTER', 'EVERY_YEAR'];
75
+ export const resetSchema = z.union([z.enum(KNOWN_RESETS), z.string()]);
76
+ // Sourced from src/generated/openapi.json:
77
+ // components.schemas.PlanPrice.properties.taxBehavior.enum
78
+ // (also PlanPriceCreateRequest.taxBehavior — agrees; see drift-guard)
79
+ export const KNOWN_TAX_BEHAVIORS = ['INCLUSIVE', 'EXCLUSIVE', 'UNSPECIFIED'];
80
+ export const taxBehaviorSchema = z.union([z.enum(KNOWN_TAX_BEHAVIORS), z.string()]);
81
+ // Sourced from src/generated/openapi.json:
82
+ // components.schemas.PlanPrice.properties.priceType.enum
83
+ // (also PlanPriceCreateRequest.priceType — agrees; see drift-guard)
84
+ export const KNOWN_PRICE_TYPES = ['FREE', 'PAID', 'CUSTOM'];
85
+ export const priceTypeSchema = z.union([z.enum(KNOWN_PRICE_TYPES), z.string()]);
38
86
  export const featureDefSchema = z.object({
39
87
  identifier: identifierSchema,
40
88
  name: z.string().min(1),
@@ -46,9 +94,17 @@ export const featureDefSchema = z.object({
46
94
  });
47
95
  // Entitlement shape varies by featureType and the API accepts extra keys —
48
96
  // `.passthrough()` so callers can pass forward whatever the API needs
49
- // without this format having to track every field.
50
- export const entitlementDefSchema = z
51
- .object({
97
+ // without this format having to track every field. The shape is built as
98
+ // its own (non-passthrough) schema first, and `entitlementDefSchema` adds
99
+ // `.passthrough()` on top of it — `EntitlementDef` below derives from the
100
+ // shape, not from `entitlementDefSchema` itself: zod's `.passthrough()`
101
+ // output type is an intersection with a `{ [k: string]: unknown }`
102
+ // catchall, and TS's `keyof` of an intersected/indexed type collapses to
103
+ // `string`, which makes `Omit<...>` erase every named field down to
104
+ // `unknown` instead of just removing `reset` — a TS structural quirk
105
+ // unrelated to zod's own behavior (verified against this file's zod
106
+ // version). Omitting from the pre-passthrough shape's inferred type sidesteps it.
107
+ const entitlementDefShape = z.object({
52
108
  feature: identifierSchema,
53
109
  value: z.union([z.boolean(), z.number()]).optional(),
54
110
  hasUnlimitedUsage: z.boolean().optional(),
@@ -59,14 +115,15 @@ export const entitlementDefSchema = z
59
115
  // responses that return `hardLimit: false`/`true`.
60
116
  hardLimit: z.boolean().optional(),
61
117
  usageAlerts: z.record(z.unknown()).optional(),
62
- })
63
- .passthrough();
118
+ });
119
+ export const entitlementDefSchema = entitlementDefShape.passthrough();
64
120
  // Prices nest deeply and vary per charge type (chargeCatalogPrice). This is
65
121
  // deliberately loose: validate the envelope, pass the depths through
66
122
  // untouched. Do NOT enumerate charge shapes here — see CLI plan 004 STOP
67
- // conditions.
68
- export const priceDefSchema = z
69
- .object({
123
+ // conditions. Same shape-then-passthrough split as entitlementDefShape above
124
+ // (and for the same reason: Omit-over-a-passthrough-output-type erases
125
+ // every named field, not just the ones being replaced).
126
+ const priceDefShape = z.object({
70
127
  priceType: priceTypeSchema,
71
128
  currency: z.string().optional(),
72
129
  // Documented as boolean/int respectively in the API's own request
@@ -79,8 +136,8 @@ export const priceDefSchema = z
79
136
  trialPeriod: z.number().optional(),
80
137
  taxBehavior: taxBehaviorSchema.optional(),
81
138
  chargeCatalogPrice: z.array(z.record(z.unknown())).optional(),
82
- })
83
- .passthrough();
139
+ });
140
+ export const priceDefSchema = priceDefShape.passthrough();
84
141
  export const planDefSchema = z.object({
85
142
  identifier: identifierSchema,
86
143
  name: z.string().min(1),
@@ -1 +1 @@
1
- {"version":3,"file":"schema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CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,gBAAgB;IACzB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;IACtD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC;AASH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,UAAU,EAAE,gBAAgB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACnC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;CAC9B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kelviq/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Pricing-as-code CLI for Kelviq — pull, push, and promote your catalog as typed TypeScript",
6
6
  "keywords": [
@@ -53,14 +53,15 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "commander": "^12",
56
+ "esbuild": "^0.28.0",
56
57
  "picocolors": "^1.1.1",
57
- "tsx": "^4",
58
58
  "zod": "^3"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@eslint/js": "^10",
62
62
  "@types/node": "^20",
63
63
  "eslint": "^10",
64
+ "tsx": "^4",
64
65
  "typescript": "^5",
65
66
  "typescript-eslint": "^8",
66
67
  "vitest": "^4"