atmn 1.1.21 → 1.1.22

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.
@@ -1,12 +1,62 @@
1
1
  import { z } from "zod/v4";
2
+ export declare const CreditTierSchema: z.ZodObject<{
3
+ to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
4
+ creditCost: z.ZodNumber;
5
+ }, z.core.$strip>;
6
+ export declare const FlatCreditSchemaItemSchema: z.ZodObject<{
7
+ meteredFeatureId: z.ZodString;
8
+ billingUnits: z.ZodOptional<z.ZodNumber>;
9
+ creditCost: z.ZodNumber;
10
+ tierBehavior: z.ZodOptional<z.ZodNever>;
11
+ tiers: z.ZodOptional<z.ZodNever>;
12
+ }, z.core.$strip>;
13
+ export declare const GraduatedCreditSchemaItemSchema: z.ZodObject<{
14
+ meteredFeatureId: z.ZodString;
15
+ billingUnits: z.ZodOptional<z.ZodNumber>;
16
+ creditCost: z.ZodOptional<z.ZodNever>;
17
+ tierBehavior: z.ZodLiteral<"graduated">;
18
+ tiers: z.ZodArray<z.ZodObject<{
19
+ to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
20
+ creditCost: z.ZodNumber;
21
+ }, z.core.$strip>>;
22
+ }, z.core.$strip>;
23
+ export declare const CreditSchemaItemSchema: z.ZodUnion<readonly [z.ZodObject<{
24
+ meteredFeatureId: z.ZodString;
25
+ billingUnits: z.ZodOptional<z.ZodNumber>;
26
+ creditCost: z.ZodNumber;
27
+ tierBehavior: z.ZodOptional<z.ZodNever>;
28
+ tiers: z.ZodOptional<z.ZodNever>;
29
+ }, z.core.$strip>, z.ZodObject<{
30
+ meteredFeatureId: z.ZodString;
31
+ billingUnits: z.ZodOptional<z.ZodNumber>;
32
+ creditCost: z.ZodOptional<z.ZodNever>;
33
+ tierBehavior: z.ZodLiteral<"graduated">;
34
+ tiers: z.ZodArray<z.ZodObject<{
35
+ to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
36
+ creditCost: z.ZodNumber;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>]>;
39
+ export type CreditSchemaItem = z.infer<typeof CreditSchemaItemSchema>;
2
40
  export declare const FeatureSchema: z.ZodObject<{
3
41
  id: z.ZodString;
4
42
  name: z.ZodString;
5
43
  eventNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
- creditSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
7
- metered_feature_id: z.ZodString;
8
- credit_cost: z.ZodNumber;
9
- }, z.core.$strip>>>;
44
+ creditSchema: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
45
+ meteredFeatureId: z.ZodString;
46
+ billingUnits: z.ZodOptional<z.ZodNumber>;
47
+ creditCost: z.ZodNumber;
48
+ tierBehavior: z.ZodOptional<z.ZodNever>;
49
+ tiers: z.ZodOptional<z.ZodNever>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ meteredFeatureId: z.ZodString;
52
+ billingUnits: z.ZodOptional<z.ZodNumber>;
53
+ creditCost: z.ZodOptional<z.ZodNever>;
54
+ tierBehavior: z.ZodLiteral<"graduated">;
55
+ tiers: z.ZodArray<z.ZodObject<{
56
+ to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
57
+ creditCost: z.ZodNumber;
58
+ }, z.core.$strip>>;
59
+ }, z.core.$strip>]>>>;
10
60
  archived: z.ZodBoolean;
11
61
  }, z.core.$strip>;
12
62
  type FeatureBase = {
@@ -19,10 +69,7 @@ type FeatureBase = {
19
69
  /** Event names that trigger this feature */
20
70
  eventNames?: string[];
21
71
  /** Credit schema for credit_system features */
22
- creditSchema?: Array<{
23
- meteredFeatureId: string;
24
- creditCost: number;
25
- }>;
72
+ creditSchema?: CreditSchemaItem[];
26
73
  };
27
74
  /** Boolean feature - no consumable field allowed */
28
75
  export type BooleanFeature = FeatureBase & {
@@ -41,10 +88,7 @@ export type CreditSystemFeature = FeatureBase & {
41
88
  /** Credit systems are always consumable */
42
89
  consumable?: true;
43
90
  /** Required: defines how credits map to metered features */
44
- creditSchema: Array<{
45
- meteredFeatureId: string;
46
- creditCost: number;
47
- }>;
91
+ creditSchema: CreditSchemaItem[];
48
92
  };
49
93
  export type ModelMarkupEntry = {
50
94
  /** Per-model markup override. Omit to inherit provider/global markup. */
@@ -65,6 +65,7 @@ export declare const PlanItemSchema: z.ZodObject<{
65
65
  featureId: z.ZodString;
66
66
  included: z.ZodOptional<z.ZodNumber>;
67
67
  unlimited: z.ZodOptional<z.ZodBoolean>;
68
+ pooled: z.ZodOptional<z.ZodBoolean>;
68
69
  reset: z.ZodOptional<z.ZodObject<{
69
70
  interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"minute">, z.ZodLiteral<"hour">, z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
70
71
  interval_count: z.ZodOptional<z.ZodNumber>;
@@ -133,6 +134,7 @@ export declare const PlanSchema: z.ZodObject<{
133
134
  featureId: z.ZodString;
134
135
  included: z.ZodOptional<z.ZodNumber>;
135
136
  unlimited: z.ZodOptional<z.ZodBoolean>;
137
+ pooled: z.ZodOptional<z.ZodBoolean>;
136
138
  reset: z.ZodOptional<z.ZodObject<{
137
139
  interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"minute">, z.ZodLiteral<"hour">, z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
138
140
  interval_count: z.ZodOptional<z.ZodNumber>;
@@ -241,6 +243,8 @@ type PlanItemBaseFields = {
241
243
  included?: number;
242
244
  /** Whether usage is unlimited */
243
245
  unlimited?: boolean;
246
+ /** Whether entity-level grants contribute to a shared customer balance */
247
+ pooled?: boolean;
244
248
  /** Proration rules for quantity changes */
245
249
  proration?: ProrationConfig;
246
250
  /** Rollover policy for unused usage */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atmn",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "atmn": "dist/cli.js"