@rikalabs/akter-cli 0.0.0-stage → 0.1.0-alpha.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.
@@ -0,0 +1,347 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * The plan of an organization with a billing account, tagged `known` like the
4
+ * organization's `KnownPlan`, so `Plan | UnboundPlan` is a tagged union.
5
+ */
6
+ export declare const Plan: Schema.TaggedStruct<"known", {
7
+ readonly id: Schema.Literals<readonly ["free", "pro", "team", "enterprise"]>;
8
+ readonly name: Schema.String;
9
+ readonly basePriceCents: Schema.Int;
10
+ readonly currency: Schema.Literal<"usd">;
11
+ readonly renewsAt: Schema.NullOr<Schema.DateTimeUtc>;
12
+ readonly monthToDateEstimateCents: Schema.Int;
13
+ readonly provisional: Schema.optionalKey<Schema.Boolean>;
14
+ readonly subscribedId: Schema.optionalKey<Schema.Literals<readonly ["free", "pro", "team", "enterprise"]>>;
15
+ readonly paymentStatus: Schema.optionalKey<Schema.Literals<readonly ["free", "active", "past_due", "unpaid", "canceled", "incomplete"]>>;
16
+ }>;
17
+ export type Plan = typeof Plan.Type;
18
+ /** A card on file. */
19
+ export declare const CardPaymentMethod: Schema.TaggedStruct<"card", {
20
+ readonly brand: Schema.String;
21
+ readonly lastFour: Schema.String;
22
+ readonly expiryMonth: Schema.Int;
23
+ readonly expiryYear: Schema.Int;
24
+ }>;
25
+ /**
26
+ * A Link account on file. Stripe reports only the account's email, which is null when Link holds
27
+ * none, and nothing about the card behind it.
28
+ */
29
+ export declare const LinkPaymentMethod: Schema.TaggedStruct<"link", {
30
+ readonly email: Schema.NullOr<Schema.String>;
31
+ }>;
32
+ export declare const PaymentMethod: Schema.Union<readonly [Schema.TaggedStruct<"card", {
33
+ readonly brand: Schema.String;
34
+ readonly lastFour: Schema.String;
35
+ readonly expiryMonth: Schema.Int;
36
+ readonly expiryYear: Schema.Int;
37
+ }>, Schema.TaggedStruct<"link", {
38
+ readonly email: Schema.NullOr<Schema.String>;
39
+ }>]>;
40
+ export type PaymentMethod = typeof PaymentMethod.Type;
41
+ export declare const SpendLimit: Schema.Struct<{
42
+ readonly limitCents: Schema.NullOr<Schema.Int>;
43
+ readonly currentSpendCents: Schema.Int;
44
+ }>;
45
+ export type SpendLimit = typeof SpendLimit.Type;
46
+ /**
47
+ * One cap as the edge's admission decides it now, whatever period is being
48
+ * reported, discriminated by `cap`. `limit` is null when the cap does not
49
+ * apply. `atCap` means usage has reached the limit; `refusing` means the edge
50
+ * would refuse the next new command, or for `connections` the next new
51
+ * connection, or for `storage` that the organization's managed databases are
52
+ * read-only: writes fail and reads still work. `reason` is `unbound` when the
53
+ * edge refuses everything because the organization has no billing account;
54
+ * such caps have no limit.
55
+ *
56
+ * `limit` and `used` are cents for `spend`, open connections for
57
+ * `connections`, compute unit-hours used in the current billing period for
58
+ * `compute`, and decimal gigabytes for `storage`: the organization's pooled
59
+ * managed database storage, where `used` is the latest pooled sample. A
60
+ * database the customer brings never counts toward it.
61
+ */
62
+ export declare const CapState: Schema.Struct<{
63
+ readonly limit: Schema.NullOr<Schema.Finite>;
64
+ readonly used: Schema.Finite;
65
+ readonly atCap: Schema.Boolean;
66
+ readonly refusing: Schema.Boolean;
67
+ readonly reason: Schema.optionalKey<Schema.Literal<"unbound">>;
68
+ readonly cap: Schema.Literals<readonly ["spend", "connections", "compute", "storage"]>;
69
+ }>;
70
+ export type CapState = typeof CapState.Type;
71
+ /**
72
+ * `plan` is `unbound` when the organization has no billing account: it has no
73
+ * plan, price or allowances, and is never reported as Free. Its spend limit is
74
+ * then null and its current spend zero, since the edge admits nothing for it.
75
+ */
76
+ export declare const BillingSummary: Schema.Struct<{
77
+ readonly plan: Schema.Union<readonly [Schema.TaggedStruct<"known", {
78
+ readonly id: Schema.Literals<readonly ["free", "pro", "team", "enterprise"]>;
79
+ readonly name: Schema.String;
80
+ readonly basePriceCents: Schema.Int;
81
+ readonly currency: Schema.Literal<"usd">;
82
+ readonly renewsAt: Schema.NullOr<Schema.DateTimeUtc>;
83
+ readonly monthToDateEstimateCents: Schema.Int;
84
+ readonly provisional: Schema.optionalKey<Schema.Boolean>;
85
+ readonly subscribedId: Schema.optionalKey<Schema.Literals<readonly ["free", "pro", "team", "enterprise"]>>;
86
+ readonly paymentStatus: Schema.optionalKey<Schema.Literals<readonly ["free", "active", "past_due", "unpaid", "canceled", "incomplete"]>>;
87
+ }>, Schema.TaggedStruct<"unbound", {}>]>;
88
+ readonly paymentMethod: Schema.NullOr<Schema.Union<readonly [Schema.TaggedStruct<"card", {
89
+ readonly brand: Schema.String;
90
+ readonly lastFour: Schema.String;
91
+ readonly expiryMonth: Schema.Int;
92
+ readonly expiryYear: Schema.Int;
93
+ }>, Schema.TaggedStruct<"link", {
94
+ readonly email: Schema.NullOr<Schema.String>;
95
+ }>]>>;
96
+ readonly billingEmail: Schema.NullOr<Schema.brand<Schema.String, "Email">>;
97
+ readonly spendLimit: Schema.Struct<{
98
+ readonly limitCents: Schema.NullOr<Schema.Int>;
99
+ readonly currentSpendCents: Schema.Int;
100
+ }>;
101
+ readonly caps: Schema.optionalKey<Schema.$Array<Schema.Struct<{
102
+ readonly limit: Schema.NullOr<Schema.Finite>;
103
+ readonly used: Schema.Finite;
104
+ readonly atCap: Schema.Boolean;
105
+ readonly refusing: Schema.Boolean;
106
+ readonly reason: Schema.optionalKey<Schema.Literal<"unbound">>;
107
+ readonly cap: Schema.Literals<readonly ["spend", "connections", "compute", "storage"]>;
108
+ }>>>;
109
+ }>;
110
+ export type BillingSummary = typeof BillingSummary.Type;
111
+ export declare const SetSpendLimit: Schema.Struct<{
112
+ readonly limitCents: Schema.NullOr<Schema.Int>;
113
+ }>;
114
+ export type SetSpendLimit = typeof SetSpendLimit.Type;
115
+ export declare const Invoice: Schema.Struct<{
116
+ readonly id: Schema.brand<Schema.String, "InvoiceId">;
117
+ readonly number: Schema.String;
118
+ readonly periodStart: Schema.DateTimeUtc;
119
+ readonly periodEnd: Schema.DateTimeUtc;
120
+ readonly amountCents: Schema.Int;
121
+ readonly currency: Schema.Literal<"usd">;
122
+ readonly status: Schema.Literals<readonly ["draft", "open", "paid", "void", "uncollectible"]>;
123
+ readonly pdfUrl: Schema.NullOr<Schema.String>;
124
+ }>;
125
+ export type Invoice = typeof Invoice.Type;
126
+ /** The paid plan to move to; the server builds the checkout and return URLs. */
127
+ export declare const StartCheckout: Schema.Struct<{
128
+ readonly plan: Schema.Literals<readonly ["pro", "team", "enterprise"]>;
129
+ }>;
130
+ export type StartCheckout = typeof StartCheckout.Type;
131
+ /** A plan change on the existing subscription; payment confirmation can leave it pending. */
132
+ export declare const PlanChange: Schema.Struct<{
133
+ readonly requestId: Schema.String;
134
+ readonly status: Schema.Literals<readonly ["pending", "completed", "failed"]>;
135
+ }>;
136
+ export type PlanChange = typeof PlanChange.Type;
137
+ /** A hosted Stripe page the browser should navigate to. */
138
+ export declare const HostedSession: Schema.Struct<{
139
+ readonly url: Schema.String;
140
+ }>;
141
+ export type HostedSession = typeof HostedSession.Type;
142
+ /**
143
+ * What a plan offers, derived from the pricing configuration: billed compute
144
+ * overage, a hard compute cap, billed storage overage, a hard storage cap, a
145
+ * database the customer brings, a dedicated database, and a paid subscription
146
+ * bought through checkout.
147
+ */
148
+ export declare const PlanFeature: Schema.Literals<readonly ["compute-overage", "compute-cap", "storage-overage", "storage-cap", "byo-database", "dedicated-database", "checkout"]>;
149
+ export type PlanFeature = typeof PlanFeature.Type;
150
+ /**
151
+ * One tier of the pricing configuration. `allowances.computeUnitHours` is the
152
+ * included compute unit-hours and `allowances.computeUnitHourCap` its hard
153
+ * stop (null when overage is billed instead at
154
+ * `overage.computeCentsPerUnitHour`). A machine size's hour bills the compute
155
+ * unit-hours `PlanCatalog.computeSizes` gives it.
156
+ *
157
+ * `allowances.storageGb` is the managed database storage included in the
158
+ * plan, in decimal gigabytes, pooled across the organization's managed
159
+ * environment databases. `allowances.storageGbCap` is its hard stop, past
160
+ * which those databases are read-only, and is null when overage is billed
161
+ * instead at `overage.storageCentsPerGbMonth`. A provisional tier's prices
162
+ * are not yet published.
163
+ */
164
+ export declare const CatalogPlan: Schema.Struct<{
165
+ readonly id: Schema.Literals<readonly ["free", "pro", "team", "enterprise"]>;
166
+ readonly name: Schema.String;
167
+ readonly basePriceCents: Schema.Int;
168
+ readonly currency: Schema.Literal<"usd">;
169
+ readonly allowances: Schema.Struct<{
170
+ readonly computeUnitHours: Schema.Finite;
171
+ readonly computeUnitHourCap: Schema.NullOr<Schema.Finite>;
172
+ readonly storageGb: Schema.Finite;
173
+ readonly storageGbCap: Schema.NullOr<Schema.Finite>;
174
+ readonly concurrentConnections: Schema.Int;
175
+ }>;
176
+ readonly overage: Schema.Struct<{
177
+ readonly computeCentsPerUnitHour: Schema.Finite;
178
+ readonly storageCentsPerGbMonth: Schema.Finite;
179
+ }>;
180
+ readonly features: Schema.$Array<Schema.Literals<readonly ["compute-overage", "compute-cap", "storage-overage", "storage-cap", "byo-database", "dedicated-database", "checkout"]>>;
181
+ readonly provisional: Schema.Boolean;
182
+ }>;
183
+ export type CatalogPlan = typeof CatalogPlan.Type;
184
+ /**
185
+ * One machine size's weight in compute units: an hour of the size bills
186
+ * `unitsPerHour` compute unit-hours. The weights come from the pricing
187
+ * configuration.
188
+ */
189
+ export declare const ComputeSize: Schema.Struct<{
190
+ readonly cpuKind: Schema.Literals<readonly ["shared", "performance"]>;
191
+ readonly cpus: Schema.Int;
192
+ readonly memoryMb: Schema.Int;
193
+ readonly unitsPerHour: Schema.Finite;
194
+ }>;
195
+ export type ComputeSize = typeof ComputeSize.Type;
196
+ /**
197
+ * Every plan, cheapest first; `provisional` is true while any plan's prices
198
+ * are provisional. `computeSizes` lists the compute unit weight of every
199
+ * machine size the platform runs.
200
+ */
201
+ export declare const PlanCatalog: Schema.Struct<{
202
+ readonly plans: Schema.$Array<Schema.Struct<{
203
+ readonly id: Schema.Literals<readonly ["free", "pro", "team", "enterprise"]>;
204
+ readonly name: Schema.String;
205
+ readonly basePriceCents: Schema.Int;
206
+ readonly currency: Schema.Literal<"usd">;
207
+ readonly allowances: Schema.Struct<{
208
+ readonly computeUnitHours: Schema.Finite;
209
+ readonly computeUnitHourCap: Schema.NullOr<Schema.Finite>;
210
+ readonly storageGb: Schema.Finite;
211
+ readonly storageGbCap: Schema.NullOr<Schema.Finite>;
212
+ readonly concurrentConnections: Schema.Int;
213
+ }>;
214
+ readonly overage: Schema.Struct<{
215
+ readonly computeCentsPerUnitHour: Schema.Finite;
216
+ readonly storageCentsPerGbMonth: Schema.Finite;
217
+ }>;
218
+ readonly features: Schema.$Array<Schema.Literals<readonly ["compute-overage", "compute-cap", "storage-overage", "storage-cap", "byo-database", "dedicated-database", "checkout"]>>;
219
+ readonly provisional: Schema.Boolean;
220
+ }>>;
221
+ readonly computeSizes: Schema.$Array<Schema.Struct<{
222
+ readonly cpuKind: Schema.Literals<readonly ["shared", "performance"]>;
223
+ readonly cpus: Schema.Int;
224
+ readonly memoryMb: Schema.Int;
225
+ readonly unitsPerHour: Schema.Finite;
226
+ }>>;
227
+ readonly provisional: Schema.Boolean;
228
+ }>;
229
+ export type PlanCatalog = typeof PlanCatalog.Type;
230
+ /**
231
+ * `runnerHours` is measured in compute unit-hours (see `ComputeUsage`), not
232
+ * machine hours; raw machine hours are reported per machine size in
233
+ * `ComputeUsage.machineHours`. `storageGb` is the average pooled managed
234
+ * database storage over the period in decimal gigabytes, billed per GB-month.
235
+ */
236
+ export declare const UsageMeterName: Schema.Literals<readonly ["runnerHours", "storageGb"]>;
237
+ export type UsageMeterName = typeof UsageMeterName.Type;
238
+ export declare const UsageMeter: Schema.Struct<{
239
+ readonly meter: Schema.Literals<readonly ["runnerHours", "storageGb"]>;
240
+ readonly used: Schema.Finite;
241
+ readonly included: Schema.Finite;
242
+ readonly overage: Schema.Finite;
243
+ readonly overageCostCents: Schema.Finite;
244
+ }>;
245
+ export type UsageMeter = typeof UsageMeter.Type;
246
+ /**
247
+ * The published rules usage is priced by, sent with every usage report.
248
+ * `computeCentsPerUnitHour` prices compute unit-hours beyond the plan's
249
+ * allowance and `storageCentsPerGbMonth` prices managed database storage
250
+ * beyond it; each is 0 where the plan bills no overage.
251
+ */
252
+ export declare const UsagePricing: Schema.Struct<{
253
+ readonly computeCentsPerUnitHour: Schema.Finite;
254
+ readonly storageCentsPerGbMonth: Schema.Finite;
255
+ readonly provisional: Schema.optionalKey<Schema.Boolean>;
256
+ }>;
257
+ export type UsagePricing = typeof UsagePricing.Type;
258
+ /**
259
+ * Compute used by one machine size in one environment during the period:
260
+ * `machineHours` raw machine hours, billed as `computeUnitHours` at the
261
+ * size's `ComputeSize.unitsPerHour` in the plan catalog.
262
+ */
263
+ export declare const ComputeUsage: Schema.Struct<{
264
+ readonly cpuKind: Schema.Literals<readonly ["shared", "performance"]>;
265
+ readonly cpus: Schema.Int;
266
+ readonly memoryMb: Schema.Int;
267
+ readonly environmentId: Schema.brand<Schema.String, "EnvironmentId">;
268
+ readonly machineHours: Schema.Finite;
269
+ readonly computeUnitHours: Schema.Finite;
270
+ }>;
271
+ export type ComputeUsage = typeof ComputeUsage.Type;
272
+ /**
273
+ * The organization's latest pooled managed database storage: the sum of the
274
+ * sampled bytes of its managed environment databases, and when it was
275
+ * sampled. A database the customer brings is excluded.
276
+ */
277
+ export declare const StorageSample: Schema.Struct<{
278
+ readonly bytes: Schema.Finite;
279
+ readonly sampledAt: Schema.DateTimeUtc;
280
+ }>;
281
+ export type StorageSample = typeof StorageSample.Type;
282
+ /**
283
+ * `caps` describe now whatever `period` is reported. A project's
284
+ * `computeUnitHours` is its compute for the period and `compute` breaks it
285
+ * down by environment and machine size; its `storageGbMonths` is its managed
286
+ * databases' storage for the period.
287
+ */
288
+ export declare const Usage: Schema.Struct<{
289
+ readonly period: Schema.String;
290
+ readonly meters: Schema.$Array<Schema.Struct<{
291
+ readonly meter: Schema.Literals<readonly ["runnerHours", "storageGb"]>;
292
+ readonly used: Schema.Finite;
293
+ readonly included: Schema.Finite;
294
+ readonly overage: Schema.Finite;
295
+ readonly overageCostCents: Schema.Finite;
296
+ }>>;
297
+ readonly latestStorageSample: Schema.NullOr<Schema.Struct<{
298
+ readonly bytes: Schema.Finite;
299
+ readonly sampledAt: Schema.DateTimeUtc;
300
+ }>>;
301
+ readonly caps: Schema.$Array<Schema.Struct<{
302
+ readonly limit: Schema.NullOr<Schema.Finite>;
303
+ readonly used: Schema.Finite;
304
+ readonly atCap: Schema.Boolean;
305
+ readonly refusing: Schema.Boolean;
306
+ readonly reason: Schema.optionalKey<Schema.Literal<"unbound">>;
307
+ readonly cap: Schema.Literals<readonly ["spend", "connections", "compute", "storage"]>;
308
+ }>>;
309
+ readonly byProject: Schema.$Array<Schema.Struct<{
310
+ readonly projectId: Schema.brand<Schema.String, "ProjectId">;
311
+ readonly name: Schema.String;
312
+ readonly computeUnitHours: Schema.Finite;
313
+ readonly compute: Schema.$Array<Schema.Struct<{
314
+ readonly cpuKind: Schema.Literals<readonly ["shared", "performance"]>;
315
+ readonly cpus: Schema.Int;
316
+ readonly memoryMb: Schema.Int;
317
+ readonly environmentId: Schema.brand<Schema.String, "EnvironmentId">;
318
+ readonly machineHours: Schema.Finite;
319
+ readonly computeUnitHours: Schema.Finite;
320
+ }>>;
321
+ readonly storageGbMonths: Schema.Finite;
322
+ readonly estimatedCostCents: Schema.Finite;
323
+ }>>;
324
+ readonly pricing: Schema.Struct<{
325
+ readonly computeCentsPerUnitHour: Schema.Finite;
326
+ readonly storageCentsPerGbMonth: Schema.Finite;
327
+ readonly provisional: Schema.optionalKey<Schema.Boolean>;
328
+ }>;
329
+ }>;
330
+ export type Usage = typeof Usage.Type;
331
+ export declare const AuditEntry: Schema.Struct<{
332
+ readonly id: Schema.String;
333
+ readonly at: Schema.DateTimeUtc;
334
+ readonly actor: Schema.Struct<{
335
+ readonly kind: Schema.Literals<readonly ["user", "api-key"]>;
336
+ readonly id: Schema.String;
337
+ readonly name: Schema.NullOr<Schema.String>;
338
+ }>;
339
+ readonly action: Schema.String;
340
+ readonly target: Schema.Struct<{
341
+ readonly type: Schema.String;
342
+ readonly id: Schema.NullOr<Schema.String>;
343
+ readonly name: Schema.NullOr<Schema.String>;
344
+ }>;
345
+ readonly ipAddress: Schema.NullOr<Schema.String>;
346
+ }>;
347
+ export type AuditEntry = typeof AuditEntry.Type;