@kelviq/cli 0.1.1
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 +313 -0
- package/dist/cli-ui/auth-hint.d.ts +6 -0
- package/dist/cli-ui/auth-hint.js +34 -0
- package/dist/cli-ui/auth-hint.js.map +1 -0
- package/dist/cli-ui/hints.d.ts +5 -0
- package/dist/cli-ui/hints.js +19 -0
- package/dist/cli-ui/hints.js.map +1 -0
- package/dist/cli-ui/spinner.d.ts +7 -0
- package/dist/cli-ui/spinner.js +61 -0
- package/dist/cli-ui/spinner.js.map +1 -0
- package/dist/cli-ui/style.d.ts +47 -0
- package/dist/cli-ui/style.js +71 -0
- package/dist/cli-ui/style.js.map +1 -0
- package/dist/cli-ui/tty.d.ts +1 -0
- package/dist/cli-ui/tty.js +13 -0
- package/dist/cli-ui/tty.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +51 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/env.d.ts +34 -0
- package/dist/commands/env.js +52 -0
- package/dist/commands/env.js.map +1 -0
- package/dist/commands/init.d.ts +15 -0
- package/dist/commands/init.js +70 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +22 -0
- package/dist/commands/login.js +205 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +13 -0
- package/dist/commands/logout.js +39 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/promote.d.ts +42 -0
- package/dist/commands/promote.js +243 -0
- package/dist/commands/promote.js.map +1 -0
- package/dist/commands/pull.d.ts +31 -0
- package/dist/commands/pull.js +108 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/push-shared.d.ts +97 -0
- package/dist/commands/push-shared.js +283 -0
- package/dist/commands/push-shared.js.map +1 -0
- package/dist/commands/push.d.ts +42 -0
- package/dist/commands/push.js +268 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/config-format/builders.d.ts +10 -0
- package/dist/config-format/builders.js +46 -0
- package/dist/config-format/builders.js.map +1 -0
- package/dist/config-format/index.d.ts +4 -0
- package/dist/config-format/index.js +9 -0
- package/dist/config-format/index.js.map +1 -0
- package/dist/config-format/load.d.ts +23 -0
- package/dist/config-format/load.js +82 -0
- package/dist/config-format/load.js.map +1 -0
- package/dist/config-format/schema.d.ts +423 -0
- package/dist/config-format/schema.js +105 -0
- package/dist/config-format/schema.js.map +1 -0
- package/dist/core/config.d.ts +48 -0
- package/dist/core/config.js +128 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/errors.d.ts +20 -0
- package/dist/core/errors.js +58 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/http.d.ts +39 -0
- package/dist/core/http.js +104 -0
- package/dist/core/http.js.map +1 -0
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +14 -0
- package/dist/core/version.js.map +1 -0
- package/dist/generated/openapi.json +6635 -0
- package/dist/sync/apply.d.ts +38 -0
- package/dist/sync/apply.js +234 -0
- package/dist/sync/apply.js.map +1 -0
- package/dist/sync/diff.d.ts +186 -0
- package/dist/sync/diff.js +402 -0
- package/dist/sync/diff.js.map +1 -0
- package/dist/sync/fetch-catalog.d.ts +105 -0
- package/dist/sync/fetch-catalog.js +100 -0
- package/dist/sync/fetch-catalog.js.map +1 -0
- package/dist/sync/price-filter.d.ts +37 -0
- package/dist/sync/price-filter.js +195 -0
- package/dist/sync/price-filter.js.map +1 -0
- package/dist/sync/prune.d.ts +77 -0
- package/dist/sync/prune.js +112 -0
- package/dist/sync/prune.js.map +1 -0
- package/dist/sync/publish.d.ts +75 -0
- package/dist/sync/publish.js +126 -0
- package/dist/sync/publish.js.map +1 -0
- package/dist/sync/push-plan-json.d.ts +79 -0
- package/dist/sync/push-plan-json.js +70 -0
- package/dist/sync/push-plan-json.js.map +1 -0
- package/dist/sync/render-plan.d.ts +83 -0
- package/dist/sync/render-plan.js +358 -0
- package/dist/sync/render-plan.js.map +1 -0
- package/dist/sync/serialize.d.ts +18 -0
- package/dist/sync/serialize.js +108 -0
- package/dist/sync/serialize.js.map +1 -0
- package/dist/sync/to-config.d.ts +9 -0
- package/dist/sync/to-config.js +191 -0
- package/dist/sync/to-config.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { featureDefSchema, planDefSchema, productDefSchema, } from './schema.js';
|
|
2
|
+
function brand(value, kind) {
|
|
3
|
+
Object.defineProperty(value, '__kind', {
|
|
4
|
+
value: kind,
|
|
5
|
+
enumerable: false,
|
|
6
|
+
writable: false,
|
|
7
|
+
configurable: false,
|
|
8
|
+
});
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
/** Best-effort identifier extraction for error messages — works even when `def` itself is malformed. */
|
|
12
|
+
function identifierOf(def) {
|
|
13
|
+
if (typeof def === 'object' && def !== null && 'identifier' in def) {
|
|
14
|
+
const id = def.identifier;
|
|
15
|
+
if (typeof id === 'string' && id.length > 0)
|
|
16
|
+
return id;
|
|
17
|
+
}
|
|
18
|
+
return '<unknown>';
|
|
19
|
+
}
|
|
20
|
+
function parseOrThrow(schema, def, kind) {
|
|
21
|
+
const result = schema.safeParse(def);
|
|
22
|
+
if (!result.success) {
|
|
23
|
+
const issues = result.error.issues
|
|
24
|
+
.map((issue) => ` - ${issue.path.length ? issue.path.join('.') : '(root)'}: ${issue.message}`)
|
|
25
|
+
.join('\n');
|
|
26
|
+
throw new Error(`Invalid ${kind} "${identifierOf(def)}":\n${issues}`);
|
|
27
|
+
}
|
|
28
|
+
return result.data;
|
|
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.
|
|
37
|
+
export function product(def) {
|
|
38
|
+
return brand(parseOrThrow(productDefSchema, def, 'product'), 'product');
|
|
39
|
+
}
|
|
40
|
+
export function feature(def) {
|
|
41
|
+
return brand(parseOrThrow(featureDefSchema, def, 'feature'), 'feature');
|
|
42
|
+
}
|
|
43
|
+
export function plan(def) {
|
|
44
|
+
return brand(parseOrThrow(planDefSchema, def, 'plan'), 'plan');
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -0,0 +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,IAAI,GAAG,KAAK,IAAI,IAAI,YAAY,IAAI,GAAG,EAAE,CAAC;QACnE,MAAM,EAAE,GAAI,GAA+B,CAAC,UAAU,CAAC;QACvD,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,EAAE,CAAC;IACzD,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,YAAY,CAAI,MAAoB,EAAE,GAAY,EAAE,IAAU;IACrE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM;aAC/B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,CAAC,IAAI,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,mEAAmE;AACnE,4EAA4E;AAC5E,0EAA0E;AAC1E,yEAAyE;AACzE,sEAAsE;AACtE,mEAAmE;AACnE,6CAA6C;AAC7C,MAAM,UAAU,OAAO,CAAC,GAAqC;IAC3D,OAAO,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAqC;IAC3D,OAAO,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAkC;IACrD,OAAO,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { product, feature, plan } from './builders.js';
|
|
2
|
+
export type { Branded, Kind } from './builders.js';
|
|
3
|
+
export { featureDefSchema, entitlementDefSchema, priceDefSchema, planDefSchema, productDefSchema, kelviqConfigSchema, taxCodeSchema, featureTypeSchema, resetSchema, taxBehaviorSchema, priceTypeSchema, identifierSchema, } from './schema.js';
|
|
4
|
+
export type { FeatureDef, EntitlementDef, PriceDef, PlanDef, ProductDef, KelviqConfig, TaxCode, FeatureType, Reset, TaxBehavior, PriceType, } from './schema.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Public entry point for the `@kelviq/cli/config` subpath — this is what
|
|
2
|
+
// user `kelviq.config.ts` files import. Keep this module's surface small and
|
|
3
|
+
// stable: it's the CLI's public contract (see CLI plan 004 maintenance
|
|
4
|
+
// notes). `./load.ts` (the config-file loader) is intentionally NOT
|
|
5
|
+
// re-exported here — it's a CLI-internal concern (used by `pull`/`push`,
|
|
6
|
+
// plans 005/006), not part of what a user's config file imports.
|
|
7
|
+
export { product, feature, plan } from './builders.js';
|
|
8
|
+
export { featureDefSchema, entitlementDefSchema, priceDefSchema, planDefSchema, productDefSchema, kelviqConfigSchema, taxCodeSchema, featureTypeSchema, resetSchema, taxBehaviorSchema, priceTypeSchema, identifierSchema, } from './schema.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config-format/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,6EAA6E;AAC7E,uEAAuE;AACvE,oEAAoE;AACpE,yEAAyE;AACzE,iEAAiE;AACjE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { KelviqConfig } from './schema.js';
|
|
2
|
+
export interface LoadConfigResult {
|
|
3
|
+
config: KelviqConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Non-fatal problems worth surfacing to the user (e.g. a plan referencing
|
|
6
|
+
* a product/feature this file doesn't define — which may still exist
|
|
7
|
+
* remotely; push/pull decide, not the loader).
|
|
8
|
+
*/
|
|
9
|
+
warnings: string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Dynamically loads `path` (a `.ts` or `.js` kelviq config file) and
|
|
13
|
+
* collects every exported value branded by `product()`/`feature()`/`plan()`
|
|
14
|
+
* (see ./builders.ts). Non-branded exports (helpers, re-exports, etc.) are
|
|
15
|
+
* ignored.
|
|
16
|
+
*
|
|
17
|
+
* Throws on duplicate identifiers within a kind (a hard error — silently
|
|
18
|
+
* picking one would be a footgun). Cross-references that don't resolve
|
|
19
|
+
* within this file (`plan.product`, `entitlement.feature`) are collected as
|
|
20
|
+
* warnings, not errors, because the referenced product/feature may exist
|
|
21
|
+
* remotely only.
|
|
22
|
+
*/
|
|
23
|
+
export declare function loadConfigFile(path: string): Promise<LoadConfigResult>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Loads a user's `kelviq.config.ts` file and classifies its exports into a
|
|
2
|
+
// `KelviqConfig`. Used by CLI-internal commands (pull/push, plans 005/006) —
|
|
3
|
+
// NOT re-exported from ./index.ts, which is the public `@kelviq/cli/config`
|
|
4
|
+
// surface a user's config file imports from.
|
|
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.
|
|
18
|
+
import { pathToFileURL } from 'node:url';
|
|
19
|
+
import { tsImport } from 'tsx/esm/api';
|
|
20
|
+
/**
|
|
21
|
+
* Dynamically loads `path` (a `.ts` or `.js` kelviq config file) and
|
|
22
|
+
* collects every exported value branded by `product()`/`feature()`/`plan()`
|
|
23
|
+
* (see ./builders.ts). Non-branded exports (helpers, re-exports, etc.) are
|
|
24
|
+
* ignored.
|
|
25
|
+
*
|
|
26
|
+
* Throws on duplicate identifiers within a kind (a hard error — silently
|
|
27
|
+
* picking one would be a footgun). Cross-references that don't resolve
|
|
28
|
+
* within this file (`plan.product`, `entitlement.feature`) are collected as
|
|
29
|
+
* warnings, not errors, because the referenced product/feature may exist
|
|
30
|
+
* remotely only.
|
|
31
|
+
*/
|
|
32
|
+
export async function loadConfigFile(path) {
|
|
33
|
+
const fileUrl = pathToFileURL(path).href;
|
|
34
|
+
const mod = (await tsImport(fileUrl, import.meta.url));
|
|
35
|
+
const products = [];
|
|
36
|
+
const features = [];
|
|
37
|
+
const plans = [];
|
|
38
|
+
for (const value of Object.values(mod)) {
|
|
39
|
+
if (typeof value !== 'object' || value === null)
|
|
40
|
+
continue;
|
|
41
|
+
const kind = value.__kind;
|
|
42
|
+
if (kind === 'product')
|
|
43
|
+
products.push(value);
|
|
44
|
+
else if (kind === 'feature')
|
|
45
|
+
features.push(value);
|
|
46
|
+
else if (kind === 'plan')
|
|
47
|
+
plans.push(value);
|
|
48
|
+
}
|
|
49
|
+
requireUniqueIdentifiers(products, 'product');
|
|
50
|
+
requireUniqueIdentifiers(features, 'feature');
|
|
51
|
+
requireUniqueIdentifiers(plans, 'plan');
|
|
52
|
+
const warnings = collectReferenceWarnings(products, features, plans);
|
|
53
|
+
return { config: { products, features, plans }, warnings };
|
|
54
|
+
}
|
|
55
|
+
function requireUniqueIdentifiers(defs, kind) {
|
|
56
|
+
const seen = new Set();
|
|
57
|
+
for (const def of defs) {
|
|
58
|
+
if (seen.has(def.identifier)) {
|
|
59
|
+
throw new Error(`Duplicate ${kind} identifier "${def.identifier}" — identifiers must be unique within each kind.`);
|
|
60
|
+
}
|
|
61
|
+
seen.add(def.identifier);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function collectReferenceWarnings(products, features, plans) {
|
|
65
|
+
const productIds = new Set(products.map((p) => p.identifier));
|
|
66
|
+
const featureIds = new Set(features.map((f) => f.identifier));
|
|
67
|
+
const warnings = [];
|
|
68
|
+
for (const p of plans) {
|
|
69
|
+
if (!productIds.has(p.product)) {
|
|
70
|
+
warnings.push(`Plan "${p.identifier}" references product "${p.product}", which isn't defined in this file ` +
|
|
71
|
+
`(only a problem if it doesn't exist remotely either).`);
|
|
72
|
+
}
|
|
73
|
+
for (const entitlement of p.entitlements ?? []) {
|
|
74
|
+
if (!featureIds.has(entitlement.feature)) {
|
|
75
|
+
warnings.push(`Plan "${p.identifier}" has an entitlement referencing feature "${entitlement.feature}", which isn't ` +
|
|
76
|
+
`defined in this file (only a problem if it doesn't exist remotely either).`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return warnings;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config-format/load.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** URL-safe slug used as the sole cross-reference key throughout the config. */
|
|
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>;
|
|
14
|
+
export declare const featureDefSchema: z.ZodObject<{
|
|
15
|
+
identifier: z.ZodString;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
type: z.ZodEnum<["BOOLEAN", "CUSTOMIZABLE", "METER"]>;
|
|
18
|
+
description: z.ZodOptional<z.ZodString>;
|
|
19
|
+
featureDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
|
+
meter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
name: string;
|
|
24
|
+
type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
|
|
25
|
+
identifier: string;
|
|
26
|
+
description?: string | undefined;
|
|
27
|
+
featureDetails?: Record<string, unknown> | undefined;
|
|
28
|
+
meter?: Record<string, unknown> | undefined;
|
|
29
|
+
metadata?: Record<string, unknown> | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
name: string;
|
|
32
|
+
type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
|
|
33
|
+
identifier: string;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
featureDetails?: Record<string, unknown> | undefined;
|
|
36
|
+
meter?: Record<string, unknown> | undefined;
|
|
37
|
+
metadata?: Record<string, unknown> | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export type FeatureDef = z.infer<typeof featureDefSchema>;
|
|
40
|
+
export declare const entitlementDefSchema: z.ZodObject<{
|
|
41
|
+
feature: z.ZodString;
|
|
42
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
43
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
45
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
47
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
48
|
+
feature: z.ZodString;
|
|
49
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
50
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
52
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
54
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
55
|
+
feature: z.ZodString;
|
|
56
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
57
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
59
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
61
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
62
|
+
export type EntitlementDef = z.infer<typeof entitlementDefSchema>;
|
|
63
|
+
export declare const priceDefSchema: z.ZodObject<{
|
|
64
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
65
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
66
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
69
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
70
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
71
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
72
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
73
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
76
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
77
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
78
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
79
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
80
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
83
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
84
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
85
|
+
export type PriceDef = z.infer<typeof priceDefSchema>;
|
|
86
|
+
export declare const planDefSchema: z.ZodObject<{
|
|
87
|
+
identifier: z.ZodString;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
product: z.ZodString;
|
|
90
|
+
description: z.ZodOptional<z.ZodString>;
|
|
91
|
+
isVisible: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
entitlements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
93
|
+
feature: z.ZodString;
|
|
94
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
95
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
97
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
99
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
100
|
+
feature: z.ZodString;
|
|
101
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
102
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
104
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
106
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
107
|
+
feature: z.ZodString;
|
|
108
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
109
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
111
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
113
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
114
|
+
prices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
115
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
116
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
117
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
120
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
121
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
122
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
123
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
124
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
127
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
128
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
129
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
130
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
131
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
134
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
135
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
136
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
name: string;
|
|
139
|
+
identifier: string;
|
|
140
|
+
product: string;
|
|
141
|
+
description?: string | undefined;
|
|
142
|
+
metadata?: Record<string, unknown> | undefined;
|
|
143
|
+
isVisible?: boolean | undefined;
|
|
144
|
+
entitlements?: z.objectOutputType<{
|
|
145
|
+
feature: z.ZodString;
|
|
146
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
147
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
149
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
151
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
152
|
+
prices?: z.objectOutputType<{
|
|
153
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
154
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
155
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
158
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
159
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
name: string;
|
|
162
|
+
identifier: string;
|
|
163
|
+
product: string;
|
|
164
|
+
description?: string | undefined;
|
|
165
|
+
metadata?: Record<string, unknown> | undefined;
|
|
166
|
+
isVisible?: boolean | undefined;
|
|
167
|
+
entitlements?: z.objectInputType<{
|
|
168
|
+
feature: z.ZodString;
|
|
169
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
170
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
172
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
174
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
175
|
+
prices?: z.objectInputType<{
|
|
176
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
177
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
178
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
181
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
182
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
export type PlanDef = z.infer<typeof planDefSchema>;
|
|
185
|
+
export declare const productDefSchema: z.ZodObject<{
|
|
186
|
+
identifier: z.ZodString;
|
|
187
|
+
name: z.ZodString;
|
|
188
|
+
taxCode: z.ZodEnum<["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"]>;
|
|
189
|
+
description: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
name: string;
|
|
192
|
+
identifier: string;
|
|
193
|
+
taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
|
|
194
|
+
description?: string | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
name: string;
|
|
197
|
+
identifier: string;
|
|
198
|
+
taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
|
|
199
|
+
description?: string | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
export type ProductDef = z.infer<typeof productDefSchema>;
|
|
202
|
+
export declare const kelviqConfigSchema: z.ZodObject<{
|
|
203
|
+
products: z.ZodArray<z.ZodObject<{
|
|
204
|
+
identifier: z.ZodString;
|
|
205
|
+
name: z.ZodString;
|
|
206
|
+
taxCode: z.ZodEnum<["saas", "saas_business", "software", "videocontent", "informationservice", "ebook", "digitalgraphic", "videogame", "eservice", "training"]>;
|
|
207
|
+
description: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
name: string;
|
|
210
|
+
identifier: string;
|
|
211
|
+
taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
|
|
212
|
+
description?: string | undefined;
|
|
213
|
+
}, {
|
|
214
|
+
name: string;
|
|
215
|
+
identifier: string;
|
|
216
|
+
taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
|
|
217
|
+
description?: string | undefined;
|
|
218
|
+
}>, "many">;
|
|
219
|
+
features: z.ZodArray<z.ZodObject<{
|
|
220
|
+
identifier: z.ZodString;
|
|
221
|
+
name: z.ZodString;
|
|
222
|
+
type: z.ZodEnum<["BOOLEAN", "CUSTOMIZABLE", "METER"]>;
|
|
223
|
+
description: z.ZodOptional<z.ZodString>;
|
|
224
|
+
featureDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
225
|
+
meter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
226
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
name: string;
|
|
229
|
+
type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
|
|
230
|
+
identifier: string;
|
|
231
|
+
description?: string | undefined;
|
|
232
|
+
featureDetails?: Record<string, unknown> | undefined;
|
|
233
|
+
meter?: Record<string, unknown> | undefined;
|
|
234
|
+
metadata?: Record<string, unknown> | undefined;
|
|
235
|
+
}, {
|
|
236
|
+
name: string;
|
|
237
|
+
type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
|
|
238
|
+
identifier: string;
|
|
239
|
+
description?: string | undefined;
|
|
240
|
+
featureDetails?: Record<string, unknown> | undefined;
|
|
241
|
+
meter?: Record<string, unknown> | undefined;
|
|
242
|
+
metadata?: Record<string, unknown> | undefined;
|
|
243
|
+
}>, "many">;
|
|
244
|
+
plans: z.ZodArray<z.ZodObject<{
|
|
245
|
+
identifier: z.ZodString;
|
|
246
|
+
name: z.ZodString;
|
|
247
|
+
product: z.ZodString;
|
|
248
|
+
description: z.ZodOptional<z.ZodString>;
|
|
249
|
+
isVisible: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
entitlements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
251
|
+
feature: z.ZodString;
|
|
252
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
253
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
255
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
257
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
258
|
+
feature: z.ZodString;
|
|
259
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
260
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
261
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
262
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
263
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
264
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
265
|
+
feature: z.ZodString;
|
|
266
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
267
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
268
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
269
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
270
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
271
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
272
|
+
prices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
273
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
274
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
275
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
276
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
278
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
279
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
280
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
281
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
282
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
283
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
285
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
286
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
287
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
288
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
289
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
290
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
291
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
292
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
293
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
294
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
295
|
+
}, "strip", z.ZodTypeAny, {
|
|
296
|
+
name: string;
|
|
297
|
+
identifier: string;
|
|
298
|
+
product: string;
|
|
299
|
+
description?: string | undefined;
|
|
300
|
+
metadata?: Record<string, unknown> | undefined;
|
|
301
|
+
isVisible?: boolean | undefined;
|
|
302
|
+
entitlements?: z.objectOutputType<{
|
|
303
|
+
feature: z.ZodString;
|
|
304
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
305
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
306
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
307
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
308
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
309
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
310
|
+
prices?: z.objectOutputType<{
|
|
311
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
312
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
313
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
314
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
315
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
316
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
317
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
318
|
+
}, {
|
|
319
|
+
name: string;
|
|
320
|
+
identifier: string;
|
|
321
|
+
product: string;
|
|
322
|
+
description?: string | undefined;
|
|
323
|
+
metadata?: Record<string, unknown> | undefined;
|
|
324
|
+
isVisible?: boolean | undefined;
|
|
325
|
+
entitlements?: z.objectInputType<{
|
|
326
|
+
feature: z.ZodString;
|
|
327
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
328
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
329
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
330
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
331
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
332
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
333
|
+
prices?: z.objectInputType<{
|
|
334
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
335
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
336
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
337
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
339
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
340
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
341
|
+
}>, "many">;
|
|
342
|
+
}, "strip", z.ZodTypeAny, {
|
|
343
|
+
products: {
|
|
344
|
+
name: string;
|
|
345
|
+
identifier: string;
|
|
346
|
+
taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
|
|
347
|
+
description?: string | undefined;
|
|
348
|
+
}[];
|
|
349
|
+
features: {
|
|
350
|
+
name: string;
|
|
351
|
+
type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
|
|
352
|
+
identifier: string;
|
|
353
|
+
description?: string | undefined;
|
|
354
|
+
featureDetails?: Record<string, unknown> | undefined;
|
|
355
|
+
meter?: Record<string, unknown> | undefined;
|
|
356
|
+
metadata?: Record<string, unknown> | undefined;
|
|
357
|
+
}[];
|
|
358
|
+
plans: {
|
|
359
|
+
name: string;
|
|
360
|
+
identifier: string;
|
|
361
|
+
product: string;
|
|
362
|
+
description?: string | undefined;
|
|
363
|
+
metadata?: Record<string, unknown> | undefined;
|
|
364
|
+
isVisible?: boolean | undefined;
|
|
365
|
+
entitlements?: z.objectOutputType<{
|
|
366
|
+
feature: z.ZodString;
|
|
367
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
368
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
369
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
370
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
371
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
372
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
373
|
+
prices?: z.objectOutputType<{
|
|
374
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
375
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
376
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
377
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
378
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
379
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
380
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
381
|
+
}[];
|
|
382
|
+
}, {
|
|
383
|
+
products: {
|
|
384
|
+
name: string;
|
|
385
|
+
identifier: string;
|
|
386
|
+
taxCode: "saas" | "saas_business" | "software" | "videocontent" | "informationservice" | "ebook" | "digitalgraphic" | "videogame" | "eservice" | "training";
|
|
387
|
+
description?: string | undefined;
|
|
388
|
+
}[];
|
|
389
|
+
features: {
|
|
390
|
+
name: string;
|
|
391
|
+
type: "BOOLEAN" | "CUSTOMIZABLE" | "METER";
|
|
392
|
+
identifier: string;
|
|
393
|
+
description?: string | undefined;
|
|
394
|
+
featureDetails?: Record<string, unknown> | undefined;
|
|
395
|
+
meter?: Record<string, unknown> | undefined;
|
|
396
|
+
metadata?: Record<string, unknown> | undefined;
|
|
397
|
+
}[];
|
|
398
|
+
plans: {
|
|
399
|
+
name: string;
|
|
400
|
+
identifier: string;
|
|
401
|
+
product: string;
|
|
402
|
+
description?: string | undefined;
|
|
403
|
+
metadata?: Record<string, unknown> | undefined;
|
|
404
|
+
isVisible?: boolean | undefined;
|
|
405
|
+
entitlements?: z.objectInputType<{
|
|
406
|
+
feature: z.ZodString;
|
|
407
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
|
|
408
|
+
hasUnlimitedUsage: z.ZodOptional<z.ZodBoolean>;
|
|
409
|
+
reset: z.ZodOptional<z.ZodEnum<["NEVER", "EVERY_DAY", "EVERY_MONTH", "EVERY_QUARTER", "EVERY_YEAR"]>>;
|
|
410
|
+
hardLimit: z.ZodOptional<z.ZodBoolean>;
|
|
411
|
+
usageAlerts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
412
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
413
|
+
prices?: z.objectInputType<{
|
|
414
|
+
priceType: z.ZodEnum<["FREE", "PAID", "CUSTOM"]>;
|
|
415
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
416
|
+
freeTrial: z.ZodOptional<z.ZodBoolean>;
|
|
417
|
+
trialPeriod: z.ZodOptional<z.ZodNumber>;
|
|
418
|
+
taxBehavior: z.ZodOptional<z.ZodEnum<["INCLUSIVE", "EXCLUSIVE", "UNSPECIFIED"]>>;
|
|
419
|
+
chargeCatalogPrice: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
420
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
421
|
+
}[];
|
|
422
|
+
}>;
|
|
423
|
+
export type KelviqConfig = z.infer<typeof kelviqConfigSchema>;
|