@absolutejs/billing 0.2.2 → 0.3.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "contract": 1,
2
+ "contract": 2,
3
3
  "identity": {
4
4
  "accent": "#f59e0b",
5
5
  "category": "commerce",
@@ -66,6 +66,16 @@
66
66
  "annotations": {
67
67
  "readOnlyHint": true
68
68
  },
69
+ "authorization": {
70
+ "approval": "never",
71
+ "audience": "authenticated",
72
+ "effects": [
73
+ "read"
74
+ ],
75
+ "requiredScopes": [
76
+ "billing:read"
77
+ ]
78
+ },
69
79
  "description": "Describe the app's pricing plan: base fee, per-dimension unit prices or tier tables, free-tier allowances, rounding, and minimum charge. Amounts are integer micros (1,000,000 micros = 1 currency unit). Custom function-priced dimensions are reported as 'custom'.",
70
80
  "input": {
71
81
  "type": "object",
@@ -78,6 +88,21 @@
78
88
  "idempotentHint": true,
79
89
  "readOnlyHint": true
80
90
  },
91
+ "authorization": {
92
+ "approval": "never",
93
+ "audience": "owner",
94
+ "effects": [
95
+ "read"
96
+ ],
97
+ "requiredScopes": [
98
+ "billing:preview"
99
+ ],
100
+ "resource": {
101
+ "idField": "tenant",
102
+ "tenantIdField": "tenant",
103
+ "type": "billing-preview"
104
+ }
105
+ },
81
106
  "description": "Dry-run an invoice: price a usage snapshot through the app's plan and return the line items and total in integer micros. Pure math — nothing is charged or stored. Usage keys must match the plan's priced dimensions.",
82
107
  "input": {
83
108
  "type": "object",
@@ -111,8 +136,26 @@
111
136
  },
112
137
  "provider_balances": {
113
138
  "annotations": {
114
- "openWorldHint": true,
115
- "readOnlyHint": true
139
+ "idempotentHint": true,
140
+ "openWorldHint": true
141
+ },
142
+ "authorization": {
143
+ "approval": "policy",
144
+ "audience": "admin",
145
+ "destinations": [
146
+ "configured-billing-provider"
147
+ ],
148
+ "effects": [
149
+ "read",
150
+ "external-network"
151
+ ],
152
+ "idempotency": {
153
+ "mode": "host"
154
+ },
155
+ "requiredScopes": [
156
+ "billing:providers:read"
157
+ ],
158
+ "reversible": false
116
159
  },
117
160
  "description": "Read each configured upstream vendor's OWN reported balance, quota, or spend (Anthropic/OpenAI report spend; Twilio/Deepgram report balance; ElevenLabs/Apollo report quota). Free reporting endpoints — no per-call charge. Reports only the providers the host wired credentials for.",
118
161
  "input": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/billing",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "Cost-model substrate for the AbsoluteJS PaaS. createPlan declares a priced product (base fee + per-dimension unit prices + tiered / free-tier rules); computeInvoice turns a @absolutejs/metering Usage snapshot into Invoice line items in integer micros (no float drift). Pluggable invoice sinks (Stripe / etc.) live in @absolutejs/billing-adapters/*.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,19 +53,16 @@
53
53
  "saas",
54
54
  "pricing"
55
55
  ],
56
- "peerDependencies": {
57
- "bun-types": "^1.3.14"
58
- },
59
56
  "devDependencies": {
60
57
  "@types/bun": "^1.3.14",
61
58
  "prettier": "^3.8.3",
62
59
  "typescript": "^5.9.0"
63
60
  },
64
61
  "dependencies": {
65
- "@absolutejs/manifest": "^0.1.0",
62
+ "@absolutejs/manifest": "^0.7.1",
66
63
  "@sinclair/typebox": "^0.34.0"
67
64
  },
68
65
  "absolutejs": {
69
- "manifestContract": 1
66
+ "manifestContract": 2
70
67
  }
71
68
  }