@mark1russell7/stack-spend 0.0.0-stage → 0.1.6
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/LICENSE +21 -0
- package/README.md +483 -2
- package/build/add-on.d.ts +16 -0
- package/build/add-on.d.ts.map +1 -0
- package/build/add-on.js +28 -0
- package/build/add-on.js.map +1 -0
- package/build/check-Dh9mPQSu.d.ts +52 -0
- package/build/check-Dh9mPQSu.d.ts.map +1 -0
- package/build/index.d.ts +336 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +490 -0
- package/build/index.js.map +1 -0
- package/build/join-98opeDSl.js +421 -0
- package/build/join-98opeDSl.js.map +1 -0
- package/build/layer-Dm7OM6CQ.d.ts +116 -0
- package/build/layer-Dm7OM6CQ.d.ts.map +1 -0
- package/build/reads-BNyUIVaY.js +48 -0
- package/build/reads-BNyUIVaY.js.map +1 -0
- package/build/reads-HuHaDiHO.d.ts +37 -0
- package/build/reads-HuHaDiHO.d.ts.map +1 -0
- package/build/schema.d.ts +40 -0
- package/build/schema.d.ts.map +1 -0
- package/build/schema.js +100 -0
- package/build/schema.js.map +1 -0
- package/package.json +76 -3
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { a as LIMIT_KINDS, c as NextPlan, d as SPEND_SCHEMA, f as Service, i as EndDecision, l as PlanEnd, n as Billing, o as Limit, p as SpendLayer, r as END_DAYS, s as LimitKind, t as BILLINGS, u as Proof } from "./layer-Dm7OM6CQ.js";
|
|
2
|
+
import { a as checkSpend, i as SpendOptions, n as SpendCode, o as dayNumber, r as SpendFault, t as SPEND_CODES } from "./check-Dh9mPQSu.js";
|
|
3
|
+
import { a as UseSource, i as UseRead, n as USE_SOURCES, r as UseOptions, t as USE_LEVELS } from "./reads-HuHaDiHO.js";
|
|
4
|
+
import { Axis, Expr, Result, Space } from "@mark1russell7/vex";
|
|
5
|
+
import { Fault, LayerParse, LayerPiece, Stack } from "@mark1russell7/system-stack";
|
|
6
|
+
/**
|
|
7
|
+
* These are the kinds of the nodes of the spend tree.
|
|
8
|
+
*
|
|
9
|
+
* - `layer`: the root.
|
|
10
|
+
* - `service`: a child of the layer. It gives the cost of a service, or the cost before the end of its plan.
|
|
11
|
+
* - `limit`: a child of a service or of a `next` node.
|
|
12
|
+
* - `next`: a child of a service. It gives the cost after the end of the plan.
|
|
13
|
+
*/
|
|
14
|
+
export declare const NODE_KINDS: readonly ["layer", "service", "limit", "next"];
|
|
15
|
+
/** A kind of node of the spend tree. */
|
|
16
|
+
export type NodeKind = (typeof NODE_KINDS)[number];
|
|
17
|
+
/**
|
|
18
|
+
* This test tells if a limit node is a hard limit: the service stops at its amount.
|
|
19
|
+
* A hard limit is a limit of the provider, a stop by code, or a prepaid balance with no automatic recharge.
|
|
20
|
+
*/
|
|
21
|
+
export declare const IS_HARD: Expr;
|
|
22
|
+
/** The hard limits of a plan: its limit nodes that pass `IS_HARD`. */
|
|
23
|
+
export declare const HARD_LIMITS: Axis;
|
|
24
|
+
/** The count of the hard limits of a plan. */
|
|
25
|
+
export declare const HARD_COUNT: Expr;
|
|
26
|
+
/**
|
|
27
|
+
* The hard limit of a plan for a month: the smallest amount of its hard limits.
|
|
28
|
+
* A plan with no hard limit gives `#N/A`. The program evaluates at a service node or at a `next` node.
|
|
29
|
+
*/
|
|
30
|
+
export declare const HARD_LIMIT: Expr;
|
|
31
|
+
/**
|
|
32
|
+
* The largest cost of one plan in a month. The program evaluates at a service node or at a `next` node.
|
|
33
|
+
*
|
|
34
|
+
* - `free`: 0.
|
|
35
|
+
* - `fixed`: the price. A plan with no price gives `#N/A`.
|
|
36
|
+
* - `metered`: the price, or 0, plus the hard limit. A plan with no hard limit gives `#N/A`: its cost has no bound.
|
|
37
|
+
*/
|
|
38
|
+
export declare const PLAN_MAX: Expr;
|
|
39
|
+
/** The plan of a service after the end of its plan: the `next` node among the children of the service. A service has one at most. */
|
|
40
|
+
export declare const NEXT_PLANS: Axis;
|
|
41
|
+
/**
|
|
42
|
+
* The largest cost of a service in a month, before the end of its plan or after it.
|
|
43
|
+
*
|
|
44
|
+
* - A service with no plan after an end gives `PLAN_MAX`.
|
|
45
|
+
* - A service with a plan after an end gives the larger of the two costs. When one of the two has no bound, the result is `#N/A`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const MONTH_MAX: Expr;
|
|
48
|
+
/** The sum of the largest costs of the services that have a bound. The program evaluates at the layer node. */
|
|
49
|
+
export declare const BOUNDED_TOTAL: Expr;
|
|
50
|
+
/** The keys of the services whose cost in a month has no bound. The program evaluates at the layer node. */
|
|
51
|
+
export declare const OPEN_SERVICES: Expr;
|
|
52
|
+
/** The key of the layer node: the root of the spend tree. */
|
|
53
|
+
export declare const LAYER_KEY = "layer";
|
|
54
|
+
/** This function gives the key of the node of a service: the text `service:` and the `id` of its part. */
|
|
55
|
+
export declare function serviceKey(part: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* This function gives the key of the node of the plan after the end of the plan of a service.
|
|
58
|
+
* The key is the text `next:` and the `id` of the part of the service.
|
|
59
|
+
*/
|
|
60
|
+
export declare function nextKey(part: string): string;
|
|
61
|
+
/** This function gives the first record of each part of a layer, in the sequence of the records. */
|
|
62
|
+
export declare function firstServices(layer: SpendLayer): readonly Service[];
|
|
63
|
+
/**
|
|
64
|
+
* This function gives the tree of a layer, as a space of Vex.
|
|
65
|
+
*
|
|
66
|
+
* - The layer is the root, with the key `LAYER_KEY`.
|
|
67
|
+
* - A service is a child of the layer. Its fields are `billing` and `price`.
|
|
68
|
+
* - A limit in force is a child of its service. Its fields are `limit` (its kind), `amount`, `recharge` and `stop`.
|
|
69
|
+
* - The plan after the end of a plan is a child of its service, with the kind `next` and the key of `nextKey`. Its fields are `billing` and `price`.
|
|
70
|
+
* - A limit of the plan after the end is a child of that `next` node.
|
|
71
|
+
*
|
|
72
|
+
* A wanted limit is not in the tree, because it is not in force. The first record of a part is used.
|
|
73
|
+
*/
|
|
74
|
+
export declare function spendSpace(layer: SpendLayer): Space;
|
|
75
|
+
/**
|
|
76
|
+
* This function evaluates a program of `formulas.ts` at a service of a tree. It gives the value, or the error value.
|
|
77
|
+
* `tree` is the result of `spendSpace`, and `part` is the `id` of the part of the service.
|
|
78
|
+
*/
|
|
79
|
+
export declare function evaluateService(program: Expr, tree: Space, part: string): Result<unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* This function evaluates a program of `formulas.ts` at the plan of a service after the end of its plan.
|
|
82
|
+
* A service with no plan after an end gives an error value. `tree` is the result of `spendSpace`.
|
|
83
|
+
*/
|
|
84
|
+
export declare function evaluateNext(program: Expr, tree: Space, part: string): Result<unknown>;
|
|
85
|
+
/** The state of the cost of one service of a layer. */
|
|
86
|
+
export interface ServiceState {
|
|
87
|
+
/** The `id` of the part of the service. */
|
|
88
|
+
readonly part: string;
|
|
89
|
+
readonly billing: Billing;
|
|
90
|
+
/** The hard limit of the service for a month: the smallest amount of its hard limits. A service with no hard limit has none. */
|
|
91
|
+
readonly hardLimit?: number | undefined;
|
|
92
|
+
/** The hard limit for a month after the end of the plan. A service has none with no plan after an end, or with no hard limit in that plan. */
|
|
93
|
+
readonly nextLimit?: number | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* The largest cost of the service in a month, before the end of its plan or after it.
|
|
96
|
+
* A service has none when one of these costs has no bound.
|
|
97
|
+
*/
|
|
98
|
+
readonly monthMax?: number | undefined;
|
|
99
|
+
}
|
|
100
|
+
/** This function gives the state of the cost of each service of a layer, in the sequence of the services. */
|
|
101
|
+
export declare function serviceStates(layer: SpendLayer): ServiceState[];
|
|
102
|
+
/** The largest cost of a layer in a month. */
|
|
103
|
+
export interface MonthTotal {
|
|
104
|
+
/** The sum of the largest costs of the services that have a bound, in the currency of the layer. */
|
|
105
|
+
readonly bounded: number;
|
|
106
|
+
/** The `id` of the part of each service whose cost has no bound. With one or more, the cost of the layer has no bound. */
|
|
107
|
+
readonly open: readonly string[];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* This function gives the largest cost of a layer in a month.
|
|
111
|
+
* The cost of the layer has a bound only when `open` is empty. Then `bounded` is that bound.
|
|
112
|
+
*/
|
|
113
|
+
export declare function monthTotal(layer: SpendLayer): MonthTotal;
|
|
114
|
+
/** The end of the plan of one service, from the date of a check. */
|
|
115
|
+
export interface PlanEndState {
|
|
116
|
+
/** The `id` of the part of the service. */
|
|
117
|
+
readonly part: string;
|
|
118
|
+
/** The last day of the plan, as `YYYY-MM-DD`. */
|
|
119
|
+
readonly date: string;
|
|
120
|
+
/** The count of days from the date of the check to the last day. A plan that ended gives a count below 0. */
|
|
121
|
+
readonly days: number;
|
|
122
|
+
/** This field tells if the provider stops the service after the date: the record gives no plan after the end. */
|
|
123
|
+
readonly stops: boolean;
|
|
124
|
+
/** This field tells if the record has the decision of the owner about the end. An end with no decision is work of the owner. */
|
|
125
|
+
readonly decided: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* This function gives the end of the plan of each service that has one, with the nearest date first.
|
|
129
|
+
*
|
|
130
|
+
* - Two ends on one date are in the sequence of the records. The first record of a part is used.
|
|
131
|
+
* - A record whose date is not a date is not in the result. The gate gives the fault `end-date` for it.
|
|
132
|
+
*
|
|
133
|
+
* The function is pure. It has no clock: the caller gives the date.
|
|
134
|
+
*
|
|
135
|
+
* @throws RangeError when `today` is not a date `YYYY-MM-DD`
|
|
136
|
+
*/
|
|
137
|
+
export declare function planEnds(layer: SpendLayer, options: SpendOptions): PlanEndState[];
|
|
138
|
+
/** The options of `endStops`. */
|
|
139
|
+
export interface EndOptions extends SpendOptions {
|
|
140
|
+
/**
|
|
141
|
+
* The largest count of days from `today` to the last day of a plan, for a plan to be in the result.
|
|
142
|
+
* The default is the `endDays` of the layer, or `END_DAYS`. Thus the default result agrees with the fault `end-soon` of the gate.
|
|
143
|
+
*/
|
|
144
|
+
readonly days?: number | undefined;
|
|
145
|
+
}
|
|
146
|
+
/** The parts of a stack that stop at the ends of the plans of a layer. */
|
|
147
|
+
export interface EndStops {
|
|
148
|
+
/** The `id` of the part of each service that its provider stops, with the nearest date first. */
|
|
149
|
+
readonly ended: readonly string[];
|
|
150
|
+
/** The `id` of each part of the stack that stops when the parts of `ended` do not work, in the order of the parts. */
|
|
151
|
+
readonly stopped: readonly string[];
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* This function gives the parts of a stack that stop when the plans that end in `days` days, or fewer, come to their end.
|
|
155
|
+
*
|
|
156
|
+
* - A plan that ended before `today` is in the result too.
|
|
157
|
+
* - A service with a plan after the end does not stop: its cost changes.
|
|
158
|
+
* - `stopped` comes from the needs of the stack: `stopped` of the core, with the parts of `ended` down.
|
|
159
|
+
*
|
|
160
|
+
* For the parts that stop with one service, use `stopped` of the core with the `id` of its part.
|
|
161
|
+
* The function is pure.
|
|
162
|
+
*
|
|
163
|
+
* @throws RangeError when `today` is not a date `YYYY-MM-DD`
|
|
164
|
+
*/
|
|
165
|
+
export declare function endStops(layer: SpendLayer, stack: Stack, options: EndOptions): EndStops;
|
|
166
|
+
/**
|
|
167
|
+
* This function joins the spend layers of the fragments of a stack into one layer.
|
|
168
|
+
*
|
|
169
|
+
* - The cost records are in the order of the fragments. The record of a part is in one fragment.
|
|
170
|
+
* - A part with a record in two or more fragments is a fault, also when the records are equal.
|
|
171
|
+
* - The layer has one currency and one largest age of a proof. A fragment with a different value is a fault.
|
|
172
|
+
* - The count of days of warning before the end of a plan is one value too. A fragment with no value takes the value of the others.
|
|
173
|
+
* - The kinds are the kinds of each fragment, one time each, in the order of the fragments.
|
|
174
|
+
*
|
|
175
|
+
* The kinds of the joined layer hold for each part of the joined stack. Thus a kind of one fragment needs a cost
|
|
176
|
+
* record also for the parts of that kind in the other fragments. The function is pure, and it changes no layer.
|
|
177
|
+
* The gate `checkSpend` examines the joined layer afterward.
|
|
178
|
+
*
|
|
179
|
+
* @param pieces - The layers, with the name of the fragment of each one, in the order of the fragments.
|
|
180
|
+
* @returns The joined layer, or the faults of the join. An empty list of layers is a fault.
|
|
181
|
+
*/
|
|
182
|
+
export declare function joinSpend(pieces: readonly LayerPiece<SpendLayer>[]): LayerParse<SpendLayer>;
|
|
183
|
+
/** These are the codes of the faults that the owner of an account corrects in the account of the service. */
|
|
184
|
+
export declare const OWNER_CODES: readonly ["limit-wanted", "limit-recharge", "end-past", "end-soon", "end-open", "proof-none", "proof-old"];
|
|
185
|
+
/** A code of a fault that the owner of an account corrects. */
|
|
186
|
+
export type OwnerCode = (typeof OWNER_CODES)[number];
|
|
187
|
+
/** One piece of work of the owner of an account. */
|
|
188
|
+
export interface OwnerStep {
|
|
189
|
+
/** The `id` of the part of the service. */
|
|
190
|
+
readonly part: string;
|
|
191
|
+
/** The name of the part, or its `id`. */
|
|
192
|
+
readonly name: string;
|
|
193
|
+
readonly code: OwnerCode;
|
|
194
|
+
/** The work, in one sentence. */
|
|
195
|
+
readonly text: string;
|
|
196
|
+
/** The steps in the account of the service, from the record. */
|
|
197
|
+
readonly steps: readonly string[];
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* This function gives the work of the owner of the accounts, in the sequence of the records.
|
|
201
|
+
*
|
|
202
|
+
* - `limit-wanted`: set the wanted limit in the account. A wanted stop by code is the work of a programmer, so it gives no step.
|
|
203
|
+
* - `limit-recharge`: stop the automatic recharge of the balance.
|
|
204
|
+
* - `end-soon`: decide before the date. A service with no plan after the end stops, and the cost of each other service changes.
|
|
205
|
+
* An end with a decision (`ends.decided`) gives no step.
|
|
206
|
+
* - `end-open`: set a hard limit for the cost after the end, or stop the service before the date. Then `end-soon` gives no second step.
|
|
207
|
+
* - `end-past`, `proof-none` and `proof-old`: read the plan and the limits in the account, and give them with the date.
|
|
208
|
+
*
|
|
209
|
+
* Each other fault of the gate is a fault of the records, which their writer corrects.
|
|
210
|
+
*
|
|
211
|
+
* @throws RangeError when `today` is not a date `YYYY-MM-DD`
|
|
212
|
+
*/
|
|
213
|
+
export declare function ownerSteps(layer: SpendLayer, stack: Stack, options: SpendOptions): OwnerStep[];
|
|
214
|
+
/** The reads of a service in the month of the check. */
|
|
215
|
+
export declare const MONTH_READS: Axis;
|
|
216
|
+
/** The largest amount that a part of the stack counted for a service in the month. With no such read, it gives `#N/A`. */
|
|
217
|
+
export declare const COUNT_USED: Expr;
|
|
218
|
+
/** The largest amount that the provider showed for a service in the month. With no such read, it gives `#N/A`. */
|
|
219
|
+
export declare const PROVIDER_USED: Expr;
|
|
220
|
+
/**
|
|
221
|
+
* The used amount of a service in the month: the larger of the count of the stack and the amount of the provider.
|
|
222
|
+
* It is the largest amount of the reads of the month, because the cost of a month does not go down.
|
|
223
|
+
* With no read of the month, it gives `#N/A`.
|
|
224
|
+
*/
|
|
225
|
+
export declare const USED: Expr;
|
|
226
|
+
/** The used share of the hard limit of a service: the used amount divided by the limit. With no read or no limit, it gives an error value. */
|
|
227
|
+
export declare const USE_SHARE: Expr;
|
|
228
|
+
/** This test tells if the used amount of a service is more than its hard limit. Such a limit did not hold. */
|
|
229
|
+
export declare const USE_OVER: Expr;
|
|
230
|
+
/**
|
|
231
|
+
* The tolerance of the comparison of a share with a level. A share reaches a level when it is the level less this
|
|
232
|
+
* tolerance, or more. Thus the rounding of a division does not hide a level: 2.4 of 3 reaches the level 0.8.
|
|
233
|
+
*/
|
|
234
|
+
export declare const LEVEL_TOLERANCE = 1e-9;
|
|
235
|
+
/**
|
|
236
|
+
* The largest level that the used share of a service reached. A share below each level gives 0.
|
|
237
|
+
* With no read or no limit, it gives `#N/A`. The levels are in the field `levels` of the layer node.
|
|
238
|
+
*/
|
|
239
|
+
export declare const USE_LEVEL: Expr;
|
|
240
|
+
/** The age of the newest read of a service in the month, in days. With no read of the month, it gives `#N/A`. */
|
|
241
|
+
export declare const READ_AGE: Expr;
|
|
242
|
+
/**
|
|
243
|
+
* This function gives the tree of the reads of a layer, as a space of Vex.
|
|
244
|
+
*
|
|
245
|
+
* - The layer is the root, with the key `LAYER_KEY`. Its fields are `month` (the month of the check) and `levels`.
|
|
246
|
+
* - A service is a child of the layer. Its fields are `billing` and `limit`: its hard limit, from `serviceStates`.
|
|
247
|
+
* - A read is a child of its service. Its fields are `source`, `amount`, `month` and `age`: the days from its date to the check.
|
|
248
|
+
*
|
|
249
|
+
* A read with a fault is not in the tree, and `checkUse` tells the fault. The first record of a part is used.
|
|
250
|
+
*
|
|
251
|
+
* @throws RangeError when `today` is not a date `YYYY-MM-DD`, or `levels` or `readDays` is not valid
|
|
252
|
+
*/
|
|
253
|
+
export declare function useSpace(layer: SpendLayer, reads: readonly UseRead[], options: UseOptions): Space;
|
|
254
|
+
/** The state of the used amount of one service in the month of the check. A field with no known value is absent. */
|
|
255
|
+
export interface UseState {
|
|
256
|
+
/** The `id` of the part of the service. */
|
|
257
|
+
readonly part: string;
|
|
258
|
+
readonly billing: Billing;
|
|
259
|
+
/** The largest amount that a part of the stack counted in the month. */
|
|
260
|
+
readonly count?: number | undefined;
|
|
261
|
+
/** The largest amount that the provider showed in the month. */
|
|
262
|
+
readonly provider?: number | undefined;
|
|
263
|
+
/** The used amount of the month: the larger of `count` and `provider`. A service with no read of the month has none. */
|
|
264
|
+
readonly used?: number | undefined;
|
|
265
|
+
/** The hard limit of the service for a month. */
|
|
266
|
+
readonly limit?: number | undefined;
|
|
267
|
+
/** The used share of the hard limit: `used` divided by `limit`. */
|
|
268
|
+
readonly share?: number | undefined;
|
|
269
|
+
/** The largest level that the share reached. A share below each level has none. */
|
|
270
|
+
readonly level?: number | undefined;
|
|
271
|
+
/** This field tells if the used amount is more than the hard limit. */
|
|
272
|
+
readonly over?: boolean | undefined;
|
|
273
|
+
/** The age of the newest read of the month, in days. */
|
|
274
|
+
readonly age?: number | undefined;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* This function gives the state of the used amount of each service of a layer, in the sequence of the services.
|
|
278
|
+
* The month is the month of `today`: a read of a different month does not count.
|
|
279
|
+
*
|
|
280
|
+
* @throws RangeError when `today` is not a date `YYYY-MM-DD`, or `levels` or `readDays` is not valid
|
|
281
|
+
*/
|
|
282
|
+
export declare function useStates(layer: SpendLayer, reads: readonly UseRead[], options: UseOptions): UseState[];
|
|
283
|
+
/** These are the codes of the faults of the used amounts of a layer. */
|
|
284
|
+
export declare const USE_CODES: readonly ["read-part", "read-amount", "read-date", "use-billing", "use-over", "use-level", "use-count", "use-none", "use-old"];
|
|
285
|
+
/** A code of a fault of the used amounts of a layer. */
|
|
286
|
+
export type UseCode = (typeof USE_CODES)[number];
|
|
287
|
+
/** A fault of the used amounts of a layer. Its field `at` is the `id` of the part. */
|
|
288
|
+
export interface UseFault extends Fault {
|
|
289
|
+
readonly code: UseCode;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* This function gives each fault of the used amounts of a layer. A list with no error tells that the gate passes.
|
|
293
|
+
*
|
|
294
|
+
* The reads, as errors:
|
|
295
|
+
* - `read-part`: a read names a part with no cost record.
|
|
296
|
+
* - `read-amount`: the amount of a read is less than 0 or not finite.
|
|
297
|
+
* - `read-date`: the date of a read is not a date, or it is after `today`.
|
|
298
|
+
*
|
|
299
|
+
* The services, as errors:
|
|
300
|
+
* - `use-billing`: a read shows a cost of the use of a `free` or `fixed` service. The cost record is not correct.
|
|
301
|
+
* - `use-over`: the used amount of a `metered` service is more than its hard limit. The limit did not hold.
|
|
302
|
+
*
|
|
303
|
+
* The services, as warnings:
|
|
304
|
+
* - `use-level`: the used amount of a `metered` service reached a level of its hard limit.
|
|
305
|
+
* - `use-count`: the provider shows more than the stack counted. The count does not have all the use.
|
|
306
|
+
* - `use-none`: a `metered` service has no read of the month, so its used amount is not known.
|
|
307
|
+
* - `use-old`: the newest read of a `metered` service is older than `readDays`.
|
|
308
|
+
*
|
|
309
|
+
* A read with a fault does not count. The faults are in the sequence of the reads, then of the services. The function is pure.
|
|
310
|
+
*
|
|
311
|
+
* @throws RangeError when `today` is not a date `YYYY-MM-DD`, or `levels` or `readDays` is not valid
|
|
312
|
+
*/
|
|
313
|
+
export declare function checkUse(layer: SpendLayer, reads: readonly UseRead[], options: UseOptions): UseFault[];
|
|
314
|
+
/** The date of the check of the sample. With it, the gate gives the faults that the README shows. */
|
|
315
|
+
export declare const SAMPLE_TODAY = "2026-11-16";
|
|
316
|
+
/**
|
|
317
|
+
* A sample spend layer for `SAMPLE_STACK` of the core. Each name and each amount is an example.
|
|
318
|
+
* It has two faults: the only limit of the cloud account is an alert, and the balance of the call account gets money automatically.
|
|
319
|
+
*/
|
|
320
|
+
export declare const SAMPLE_SPEND: SpendLayer;
|
|
321
|
+
/**
|
|
322
|
+
* A sample spend layer for `SAMPLE_STACK` of the core, with two plans that end. Each name, each date and each amount is an example.
|
|
323
|
+
*
|
|
324
|
+
* - The free trial of the cloud account ends. After the end, the cost grows with the use, and its only limit is an alert.
|
|
325
|
+
* - The free credit of the call account ends. The record gives no plan after the end, so the provider stops the service.
|
|
326
|
+
*
|
|
327
|
+
* With the date `SAMPLE_TODAY`, the two ends are in the 30 days of warning.
|
|
328
|
+
*/
|
|
329
|
+
export declare const SAMPLE_ENDS: SpendLayer;
|
|
330
|
+
/**
|
|
331
|
+
* Sample reads of the used amounts of `SAMPLE_SPEND`, for the date `SAMPLE_TODAY`. Each amount is an example.
|
|
332
|
+
* The provider of the call account shows more than the stack counted, and the used amount is at 50 percent of the hard limit, or more.
|
|
333
|
+
*/
|
|
334
|
+
export declare const SAMPLE_READS: readonly UseRead[];
|
|
335
|
+
export { BILLINGS, Billing, END_DAYS, EndDecision, LIMIT_KINDS, Limit, LimitKind, NextPlan, PlanEnd, Proof, SPEND_CODES, SPEND_SCHEMA, Service, SpendCode, SpendFault, SpendLayer, SpendOptions, USE_LEVELS, USE_SOURCES, UseOptions, UseRead, UseSource, checkSpend, dayNumber };
|
|
336
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/formulas.ts","../src/states.ts","../src/ends.ts","../src/join.ts","../src/steps.ts","../src/use.ts","../src/use-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