atmn 0.0.21 → 0.0.23
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/dist/cli.cjs +1455 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +792 -67707
- package/dist/commands/init.d.ts +3 -1
- package/dist/commands/pull.d.ts +2 -2
- package/dist/commands/push.d.ts +1 -6
- package/dist/compose/builders/builderFunctions.d.ts +2 -3
- package/dist/compose/index.d.ts +4 -4
- package/dist/compose/models/composeModels.d.ts +0 -1
- package/dist/constants.d.ts +2 -2
- package/dist/core/api.d.ts +10 -17
- package/dist/core/builders/features.d.ts +2 -0
- package/dist/core/builders/productBuilder.d.ts +0 -4
- package/dist/core/builders/products.d.ts +18 -0
- package/dist/core/config.d.ts +0 -1
- package/dist/core/pull.d.ts +27 -11
- package/dist/core/push.d.ts +4 -36
- package/dist/core/utils.d.ts +2 -3
- package/dist/index.cjs +58 -0
- package/dist/index.d.cts +184 -0
- package/dist/index.d.ts +184 -1
- package/dist/index.js +3 -37
- package/package.json +3 -3
package/dist/commands/init.d.ts
CHANGED
package/dist/commands/pull.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function Pull(
|
|
2
|
-
|
|
1
|
+
export default function Pull({ config }: {
|
|
2
|
+
config: any;
|
|
3
3
|
}): Promise<void>;
|
package/dist/commands/push.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import type { Feature, Product } from '../compose/index.js';
|
|
2
1
|
export default function Push({ config, yes, prod, }: {
|
|
3
|
-
config:
|
|
4
|
-
features: Feature[];
|
|
5
|
-
products: Product[];
|
|
6
|
-
env: string;
|
|
7
|
-
};
|
|
2
|
+
config: any;
|
|
8
3
|
yes: boolean;
|
|
9
4
|
prod: boolean;
|
|
10
5
|
}): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Product, Feature } from '../models/composeModels.js';
|
|
2
|
+
import { ProductItem, ProductItemInterval, UsageModel } from '../models/productItemModels.js';
|
|
3
3
|
export declare const product: (p: Product) => {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
@@ -35,7 +35,6 @@ export declare const feature: (f: Feature) => {
|
|
|
35
35
|
metered_feature_id: string;
|
|
36
36
|
credit_cost: number;
|
|
37
37
|
}[] | undefined;
|
|
38
|
-
archived?: boolean | null | undefined;
|
|
39
38
|
};
|
|
40
39
|
export declare const featureItem: ({ feature_id, included_usage, interval, reset_usage_when_enabled, entity_feature_id, }: {
|
|
41
40
|
feature_id: string;
|
package/dist/compose/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { product, priceItem, feature, featureItem, pricedFeatureItem } from './builders/builderFunctions.js';
|
|
2
|
+
import { Feature, Product } from './models/composeModels.js';
|
|
3
|
+
import { ProductItem } from './models/productItemModels.js';
|
|
4
4
|
export { product, priceItem, feature, featureItem, pricedFeatureItem };
|
|
5
5
|
export type { Feature, Product, ProductItem };
|
|
6
|
-
export type Infinity =
|
|
6
|
+
export type Infinity = 'infinity';
|
|
7
7
|
export type AutumnConfig = {
|
|
8
8
|
products: Product[];
|
|
9
9
|
features: Feature[];
|
|
@@ -68,7 +68,6 @@ export declare const FeatureSchema: z.ZodObject<{
|
|
|
68
68
|
metered_feature_id: z.ZodString;
|
|
69
69
|
credit_cost: z.ZodNumber;
|
|
70
70
|
}, z.core.$strip>>>;
|
|
71
|
-
archived: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
72
71
|
}, z.core.$strip>;
|
|
73
72
|
export type Feature = z.infer<typeof FeatureSchema>;
|
|
74
73
|
export type Product = z.infer<typeof ProductSchema>;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const FRONTEND_URL = "http://
|
|
2
|
-
export declare const BACKEND_URL = "
|
|
1
|
+
export declare const FRONTEND_URL = "http://localhost:3000";
|
|
2
|
+
export declare const BACKEND_URL = "http://localhost:8080";
|
|
3
3
|
export declare const DEFAULT_CONFIG = "import {\n\tfeature,\n\tproduct,\n\tpriceItem,\n\tfeatureItem,\n\tpricedFeatureItem,\n} from 'atmn';\n\nexport const seats = feature({\n\tid: 'seats',\n\tname: 'Seats',\n\ttype: 'continuous_use',\n});\n\nexport const messages = feature({\n\tid: 'messages',\n\tname: 'Messages',\n\ttype: 'single_use',\n});\n\nexport const pro = product({\n\tid: 'pro',\n\tname: 'Pro',\n\titems: [\n\t\t// 500 messages per month\n\t\tfeatureItem({\n\t\t\tfeature_id: messages.id,\n\t\t\tincluded_usage: 500,\n\t\t\tinterval: 'month',\n\t\t}),\n\n\t\t// $10 per seat per month\n\t\tpricedFeatureItem({\n\t\t\tfeature_id: seats.id,\n\t\t\tprice: 10,\n\t\t\tinterval: 'month',\n\t\t}),\n\n\t\t// $50 / month\n\t\tpriceItem({\n\t\t\tprice: 50,\n\t\t\tinterval: 'month',\n\t\t}),\n\t],\n});\n";
|
package/dist/core/api.d.ts
CHANGED
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
export declare function request({ method, base, path, data, headers, customAuth, throwOnError, secretKey,
|
|
1
|
+
export declare function request({ method, base, path, data, headers, customAuth, throwOnError, secretKey, }: {
|
|
2
2
|
method: string;
|
|
3
3
|
base: string;
|
|
4
4
|
path: string;
|
|
5
|
-
data?:
|
|
6
|
-
headers?:
|
|
5
|
+
data?: any;
|
|
6
|
+
headers?: any;
|
|
7
7
|
customAuth?: string;
|
|
8
8
|
throwOnError?: boolean;
|
|
9
9
|
secretKey?: string;
|
|
10
|
-
queryParams?: Record<string, string>;
|
|
11
10
|
}): Promise<any>;
|
|
12
11
|
export declare function internalRequest({ method, path, data, headers, customAuth, }: {
|
|
13
12
|
method: string;
|
|
14
13
|
path: string;
|
|
15
|
-
data?:
|
|
16
|
-
headers?:
|
|
14
|
+
data?: any;
|
|
15
|
+
headers?: any;
|
|
17
16
|
customAuth?: string;
|
|
18
17
|
}): Promise<any>;
|
|
19
|
-
export declare function externalRequest({ method, path, data, headers, customAuth, throwOnError,
|
|
18
|
+
export declare function externalRequest({ method, path, data, headers, customAuth, throwOnError, }: {
|
|
20
19
|
method: string;
|
|
21
20
|
path: string;
|
|
22
|
-
data?:
|
|
23
|
-
headers?:
|
|
21
|
+
data?: any;
|
|
22
|
+
headers?: any;
|
|
24
23
|
customAuth?: string;
|
|
25
24
|
throwOnError?: boolean;
|
|
26
|
-
queryParams?: Record<string, any>;
|
|
27
|
-
}): Promise<any>;
|
|
28
|
-
export declare function deleteFeature({ id }: {
|
|
29
|
-
id: string;
|
|
30
|
-
}): Promise<any>;
|
|
31
|
-
export declare function deleteProduct({ id, allVersions, }: {
|
|
32
|
-
id: string;
|
|
33
|
-
allVersions?: boolean;
|
|
34
25
|
}): Promise<any>;
|
|
26
|
+
export declare function deleteFeature(id: string): Promise<any>;
|
|
27
|
+
export declare function deleteProduct(id: string): Promise<any>;
|
|
35
28
|
export declare function updateCLIStripeKeys({ stripeSecretKey, autumnSecretKey, }: {
|
|
36
29
|
stripeSecretKey: string;
|
|
37
30
|
autumnSecretKey: string;
|
|
@@ -5,10 +5,6 @@ export declare function productBuilder({ product, features, }: {
|
|
|
5
5
|
product: Product;
|
|
6
6
|
features: Feature[];
|
|
7
7
|
}): string;
|
|
8
|
-
export declare const getFeatureIdStr: ({ featureId, features, }: {
|
|
9
|
-
featureId: string;
|
|
10
|
-
features: Feature[];
|
|
11
|
-
}) => string;
|
|
12
8
|
export declare function pricedFeatureItemBuilder({ item, features, }: {
|
|
13
9
|
item: ProductItem;
|
|
14
10
|
features: Feature[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ProductItem, Product, Feature } from '../../compose/index.js';
|
|
2
|
+
export declare function importBuilder(): string;
|
|
3
|
+
export declare function exportBuilder(productIds: string[], featureIds: string[]): string;
|
|
4
|
+
export declare function productBuilder({ product, features, }: {
|
|
5
|
+
product: Product;
|
|
6
|
+
features: Feature[];
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function pricedFeatureItemBuilder({ item, features, }: {
|
|
9
|
+
item: ProductItem;
|
|
10
|
+
features: Feature[];
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function featureItemBuilder({ item, features, }: {
|
|
13
|
+
item: ProductItem;
|
|
14
|
+
features: Feature[];
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function priceItemBuilder({ item }: {
|
|
17
|
+
item: ProductItem;
|
|
18
|
+
}): string;
|
package/dist/core/config.d.ts
CHANGED
package/dist/core/pull.d.ts
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function getProducts(ids: string[]): Promise<Product[]>;
|
|
3
|
-
export declare function getAllProducts(params?: {
|
|
4
|
-
archived?: boolean;
|
|
5
|
-
}): Promise<Product[]>;
|
|
6
|
-
export declare function getAllProductVariants(): Promise<any[]>;
|
|
7
|
-
export declare function getFeatures(params?: {
|
|
8
|
-
includeArchived?: boolean;
|
|
9
|
-
}): Promise<any>;
|
|
10
|
-
export declare function getCustomers(limit?: number, offset?: number): Promise<{
|
|
1
|
+
export declare function getProducts(ids: string[]): Promise<{
|
|
11
2
|
id: string;
|
|
12
|
-
|
|
3
|
+
name: string;
|
|
4
|
+
items: {
|
|
5
|
+
type?: "feature" | "priced_feature" | null | undefined;
|
|
6
|
+
feature_id?: string | null | undefined;
|
|
7
|
+
included_usage?: number | "inf" | null | undefined;
|
|
8
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
9
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
10
|
+
price?: number | null | undefined;
|
|
11
|
+
tiers?: {
|
|
12
|
+
amount: number;
|
|
13
|
+
to: number | "inf";
|
|
14
|
+
}[] | null | undefined;
|
|
15
|
+
billing_units?: number | null | undefined;
|
|
16
|
+
reset_usage_when_enabled?: boolean | undefined;
|
|
17
|
+
entity_feature_id?: string | undefined;
|
|
18
|
+
}[];
|
|
19
|
+
is_add_on?: boolean | undefined;
|
|
20
|
+
is_default?: boolean | undefined;
|
|
21
|
+
free_trial?: {
|
|
22
|
+
duration: "day" | "month" | "year";
|
|
23
|
+
length: number;
|
|
24
|
+
unique_fingerprint: boolean;
|
|
25
|
+
card_required: boolean;
|
|
26
|
+
} | undefined;
|
|
13
27
|
}[]>;
|
|
28
|
+
export declare function getAllProducts(): Promise<any>;
|
|
29
|
+
export declare function getFeatures(): Promise<any>;
|
package/dist/core/push.d.ts
CHANGED
|
@@ -1,50 +1,18 @@
|
|
|
1
|
-
import type { Spinner } from
|
|
2
|
-
import type { Feature, Product } from
|
|
1
|
+
import type { Spinner } from "yocto-spinner";
|
|
2
|
+
import type { Feature, Product } from "../compose/index.js";
|
|
3
3
|
export declare function checkForDeletables(currentFeatures: Feature[], currentProducts: Product[]): Promise<{
|
|
4
|
-
allFeatures: any;
|
|
5
4
|
curFeatures: any;
|
|
6
|
-
curProducts:
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
items: {
|
|
10
|
-
type?: "feature" | "priced_feature" | null | undefined;
|
|
11
|
-
feature_id?: string | null | undefined;
|
|
12
|
-
included_usage?: number | "inf" | null | undefined;
|
|
13
|
-
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
14
|
-
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
15
|
-
price?: number | null | undefined;
|
|
16
|
-
tiers?: {
|
|
17
|
-
amount: number;
|
|
18
|
-
to: number | "inf";
|
|
19
|
-
}[] | null | undefined;
|
|
20
|
-
billing_units?: number | null | undefined;
|
|
21
|
-
reset_usage_when_enabled?: boolean | undefined;
|
|
22
|
-
entity_feature_id?: string | undefined;
|
|
23
|
-
}[];
|
|
24
|
-
is_add_on?: boolean | undefined;
|
|
25
|
-
is_default?: boolean | undefined;
|
|
26
|
-
free_trial?: {
|
|
27
|
-
duration: "day" | "month" | "year";
|
|
28
|
-
length: number;
|
|
29
|
-
unique_fingerprint: boolean;
|
|
30
|
-
card_required: boolean;
|
|
31
|
-
} | undefined;
|
|
32
|
-
}[];
|
|
5
|
+
curProducts: any;
|
|
33
6
|
featuresToDelete: any;
|
|
34
|
-
productsToDelete:
|
|
7
|
+
productsToDelete: any;
|
|
35
8
|
}>;
|
|
36
9
|
export declare function upsertFeature(feature: Feature, s: Spinner): Promise<any>;
|
|
37
10
|
export declare function checkProductForConfirmation({ curProducts, product, }: {
|
|
38
11
|
curProducts: Product[];
|
|
39
12
|
product: Product;
|
|
40
13
|
}): Promise<{
|
|
41
|
-
id: string;
|
|
42
|
-
will_version: boolean;
|
|
43
|
-
archived?: undefined;
|
|
44
|
-
} | {
|
|
45
14
|
id: string;
|
|
46
15
|
will_version: any;
|
|
47
|
-
archived: any;
|
|
48
16
|
}>;
|
|
49
17
|
export declare function upsertProduct({ curProducts, product, spinner, shouldUpdate, }: {
|
|
50
18
|
curProducts: Product[];
|
package/dist/core/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const notNullish: (value:
|
|
2
|
-
export declare const nullish: (value:
|
|
1
|
+
export declare const notNullish: (value: any) => boolean;
|
|
2
|
+
export declare const nullish: (value: any) => boolean;
|
|
3
3
|
export declare const isProdFlag: () => boolean;
|
|
4
4
|
export declare function snakeCaseToCamelCase(value: string): string;
|
|
5
5
|
export declare function idToVar({ id, prefix, }: {
|
|
@@ -9,4 +9,3 @@ export declare function idToVar({ id, prefix, }: {
|
|
|
9
9
|
export declare function storeToEnv(prodKey: string, sandboxKey: string): Promise<void>;
|
|
10
10
|
export declare function readFromEnv(): string;
|
|
11
11
|
export declare function initSpinner(message: string): import("yocto-spinner").Spinner;
|
|
12
|
-
export declare function isSandboxKey(apiKey: string): Promise<boolean>;
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// source/compose/builders/builderFunctions.ts
|
|
4
|
+
var product = (p) => p;
|
|
5
|
+
var feature = (f) => f;
|
|
6
|
+
var featureItem = ({
|
|
7
|
+
feature_id,
|
|
8
|
+
included_usage,
|
|
9
|
+
interval,
|
|
10
|
+
reset_usage_when_enabled,
|
|
11
|
+
entity_feature_id
|
|
12
|
+
}) => {
|
|
13
|
+
return {
|
|
14
|
+
included_usage,
|
|
15
|
+
feature_id,
|
|
16
|
+
interval,
|
|
17
|
+
reset_usage_when_enabled,
|
|
18
|
+
entity_feature_id
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
var pricedFeatureItem = ({
|
|
22
|
+
feature_id,
|
|
23
|
+
price,
|
|
24
|
+
tiers,
|
|
25
|
+
interval,
|
|
26
|
+
included_usage = void 0,
|
|
27
|
+
billing_units = 1,
|
|
28
|
+
usage_model = "pay_per_use",
|
|
29
|
+
reset_usage_when_enabled,
|
|
30
|
+
entity_feature_id
|
|
31
|
+
}) => {
|
|
32
|
+
return {
|
|
33
|
+
price,
|
|
34
|
+
tiers,
|
|
35
|
+
interval,
|
|
36
|
+
billing_units,
|
|
37
|
+
feature_id,
|
|
38
|
+
usage_model,
|
|
39
|
+
included_usage,
|
|
40
|
+
reset_usage_when_enabled,
|
|
41
|
+
entity_feature_id
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
var priceItem = ({
|
|
45
|
+
price,
|
|
46
|
+
interval
|
|
47
|
+
}) => {
|
|
48
|
+
return {
|
|
49
|
+
price,
|
|
50
|
+
interval
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.feature = feature;
|
|
55
|
+
exports.featureItem = featureItem;
|
|
56
|
+
exports.priceItem = priceItem;
|
|
57
|
+
exports.pricedFeatureItem = pricedFeatureItem;
|
|
58
|
+
exports.product = product;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
|
|
3
|
+
declare const ProductSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
is_add_on: z.ZodOptional<z.ZodPrefault<z.ZodBoolean>>;
|
|
7
|
+
is_default: z.ZodOptional<z.ZodPrefault<z.ZodBoolean>>;
|
|
8
|
+
items: z.ZodArray<z.ZodObject<{
|
|
9
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
10
|
+
feature: "feature";
|
|
11
|
+
priced_feature: "priced_feature";
|
|
12
|
+
}>>>;
|
|
13
|
+
feature_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
included_usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>>>;
|
|
15
|
+
interval: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
16
|
+
minute: "minute";
|
|
17
|
+
hour: "hour";
|
|
18
|
+
day: "day";
|
|
19
|
+
week: "week";
|
|
20
|
+
month: "month";
|
|
21
|
+
quarter: "quarter";
|
|
22
|
+
semi_annual: "semi_annual";
|
|
23
|
+
year: "year";
|
|
24
|
+
}>>>;
|
|
25
|
+
usage_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
26
|
+
prepaid: "prepaid";
|
|
27
|
+
pay_per_use: "pay_per_use";
|
|
28
|
+
}>>>;
|
|
29
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
30
|
+
tiers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
31
|
+
amount: z.ZodNumber;
|
|
32
|
+
to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
|
|
33
|
+
}, z.core.$strip>>>>;
|
|
34
|
+
billing_units: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
35
|
+
reset_usage_when_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
entity_feature_id: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
free_trial: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
duration: z.ZodEnum<{
|
|
40
|
+
day: "day";
|
|
41
|
+
month: "month";
|
|
42
|
+
year: "year";
|
|
43
|
+
}>;
|
|
44
|
+
length: z.ZodNumber;
|
|
45
|
+
unique_fingerprint: z.ZodBoolean;
|
|
46
|
+
card_required: z.ZodBoolean;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
declare const FeatureSchema: z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
type: z.ZodEnum<{
|
|
53
|
+
boolean: "boolean";
|
|
54
|
+
single_use: "single_use";
|
|
55
|
+
continuous_use: "continuous_use";
|
|
56
|
+
credit_system: "credit_system";
|
|
57
|
+
}>;
|
|
58
|
+
credit_schema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
metered_feature_id: z.ZodString;
|
|
60
|
+
credit_cost: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>>>;
|
|
62
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
type Feature = z.infer<typeof FeatureSchema>;
|
|
65
|
+
type Product = z.infer<typeof ProductSchema>;
|
|
66
|
+
|
|
67
|
+
declare const ProductItemIntervalEnum: z.ZodEnum<{
|
|
68
|
+
minute: "minute";
|
|
69
|
+
hour: "hour";
|
|
70
|
+
day: "day";
|
|
71
|
+
week: "week";
|
|
72
|
+
month: "month";
|
|
73
|
+
quarter: "quarter";
|
|
74
|
+
semi_annual: "semi_annual";
|
|
75
|
+
year: "year";
|
|
76
|
+
}>;
|
|
77
|
+
declare const UsageModelEnum: z.ZodEnum<{
|
|
78
|
+
prepaid: "prepaid";
|
|
79
|
+
pay_per_use: "pay_per_use";
|
|
80
|
+
}>;
|
|
81
|
+
type ProductItemInterval = z.infer<typeof ProductItemIntervalEnum>;
|
|
82
|
+
type UsageModel = z.infer<typeof UsageModelEnum>;
|
|
83
|
+
declare const ProductItemSchema: z.ZodObject<{
|
|
84
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
85
|
+
feature: "feature";
|
|
86
|
+
priced_feature: "priced_feature";
|
|
87
|
+
}>>>;
|
|
88
|
+
feature_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
included_usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>>>;
|
|
90
|
+
interval: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
91
|
+
minute: "minute";
|
|
92
|
+
hour: "hour";
|
|
93
|
+
day: "day";
|
|
94
|
+
week: "week";
|
|
95
|
+
month: "month";
|
|
96
|
+
quarter: "quarter";
|
|
97
|
+
semi_annual: "semi_annual";
|
|
98
|
+
year: "year";
|
|
99
|
+
}>>>;
|
|
100
|
+
usage_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
101
|
+
prepaid: "prepaid";
|
|
102
|
+
pay_per_use: "pay_per_use";
|
|
103
|
+
}>>>;
|
|
104
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
105
|
+
tiers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
106
|
+
amount: z.ZodNumber;
|
|
107
|
+
to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
|
|
108
|
+
}, z.core.$strip>>>>;
|
|
109
|
+
billing_units: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
110
|
+
reset_usage_when_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
entity_feature_id: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
type ProductItem = z.infer<typeof ProductItemSchema>;
|
|
114
|
+
|
|
115
|
+
declare const product: (p: Product) => {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
items: {
|
|
119
|
+
type?: "feature" | "priced_feature" | null | undefined;
|
|
120
|
+
feature_id?: string | null | undefined;
|
|
121
|
+
included_usage?: number | "inf" | null | undefined;
|
|
122
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
123
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
124
|
+
price?: number | null | undefined;
|
|
125
|
+
tiers?: {
|
|
126
|
+
amount: number;
|
|
127
|
+
to: number | "inf";
|
|
128
|
+
}[] | null | undefined;
|
|
129
|
+
billing_units?: number | null | undefined;
|
|
130
|
+
reset_usage_when_enabled?: boolean | undefined;
|
|
131
|
+
entity_feature_id?: string | undefined;
|
|
132
|
+
}[];
|
|
133
|
+
is_add_on?: boolean | undefined;
|
|
134
|
+
is_default?: boolean | undefined;
|
|
135
|
+
free_trial?: {
|
|
136
|
+
duration: "day" | "month" | "year";
|
|
137
|
+
length: number;
|
|
138
|
+
unique_fingerprint: boolean;
|
|
139
|
+
card_required: boolean;
|
|
140
|
+
} | undefined;
|
|
141
|
+
};
|
|
142
|
+
declare const feature: (f: Feature) => {
|
|
143
|
+
id: string;
|
|
144
|
+
type: "boolean" | "single_use" | "continuous_use" | "credit_system";
|
|
145
|
+
name?: string | undefined;
|
|
146
|
+
credit_schema?: {
|
|
147
|
+
metered_feature_id: string;
|
|
148
|
+
credit_cost: number;
|
|
149
|
+
}[] | undefined;
|
|
150
|
+
archived?: boolean | undefined;
|
|
151
|
+
};
|
|
152
|
+
declare const featureItem: ({ feature_id, included_usage, interval, reset_usage_when_enabled, entity_feature_id, }: {
|
|
153
|
+
feature_id: string;
|
|
154
|
+
included_usage?: number | "inf";
|
|
155
|
+
interval?: ProductItemInterval;
|
|
156
|
+
reset_usage_when_enabled?: boolean;
|
|
157
|
+
entity_feature_id?: string;
|
|
158
|
+
}) => ProductItem;
|
|
159
|
+
declare const pricedFeatureItem: ({ feature_id, price, tiers, interval, included_usage, billing_units, usage_model, reset_usage_when_enabled, entity_feature_id, }: {
|
|
160
|
+
feature_id: string;
|
|
161
|
+
price?: number;
|
|
162
|
+
tiers?: {
|
|
163
|
+
to: number | "inf";
|
|
164
|
+
amount: number;
|
|
165
|
+
}[];
|
|
166
|
+
interval?: ProductItemInterval;
|
|
167
|
+
included_usage?: number;
|
|
168
|
+
billing_units?: number;
|
|
169
|
+
usage_model?: UsageModel;
|
|
170
|
+
reset_usage_when_enabled?: boolean;
|
|
171
|
+
entity_feature_id?: string;
|
|
172
|
+
}) => ProductItem;
|
|
173
|
+
declare const priceItem: ({ price, interval, }: {
|
|
174
|
+
price: number;
|
|
175
|
+
interval?: ProductItemInterval;
|
|
176
|
+
}) => ProductItem;
|
|
177
|
+
|
|
178
|
+
type Infinity = "infinity";
|
|
179
|
+
type AutumnConfig = {
|
|
180
|
+
products: Product[];
|
|
181
|
+
features: Feature[];
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export { type AutumnConfig, type Feature, type Infinity, type Product, type ProductItem, feature, featureItem, priceItem, pricedFeatureItem, product };
|