@mark1russell7/stack-spend 0.0.0-bootstrap.0 → 0.1.5
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 +471 -1
- 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-CpHvgGvh.d.ts +51 -0
- package/build/check-CpHvgGvh.d.ts.map +1 -0
- package/build/index.d.ts +333 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +488 -0
- package/build/index.js.map +1 -0
- package/build/join-BsjQ9eKd.js +413 -0
- package/build/join-BsjQ9eKd.js.map +1 -0
- package/build/layer-BYSJfC_1.d.ts +104 -0
- package/build/layer-BYSJfC_1.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 +95 -0
- package/build/schema.js.map +1 -0
- package/package.json +72 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reads-BNyUIVaY.js","names":[],"sources":["../src/layer.ts","../src/reads.ts"],"sourcesContent":["// The records of the spend add-on. They are one layer of a stack, with the key `spend/1` in `Stack.layers`.\n// Each record gives the cost of one part: its plan, its price and the limits of its cost in a month.\n\n/** The name of the format of a spend layer. It is the key of the layer in `Stack.layers`. */\nexport const SPEND_SCHEMA = \"spend/1\";\n\n/**\n * These are the kinds of billing of a service.\n *\n * - `free`: the provider cannot take money. The account has no payment method, or the plan has no paid use.\n * - `fixed`: the price of a month is fixed, and the use does not change it. A price that was paid one time is a fixed price of 0.\n * - `metered`: the cost grows with the use. A free allowance with a payment method on the account is `metered`.\n */\nexport const BILLINGS: readonly [\"free\", \"fixed\", \"metered\"] = [\"free\", \"fixed\", \"metered\"];\n\n/** A kind of billing of a service. */\nexport type Billing = (typeof BILLINGS)[number];\n\n/**\n * These are the kinds of limit of the cost of a month.\n *\n * - `provider`: a hard limit of the provider. The provider stops the service at the amount.\n * - `prepaid`: a prepaid balance. The provider stops the service when the balance is empty.\n * - `code`: a stop by code. A part of the stack counts the cost and stops the use at the amount.\n * - `alert`: a message at the amount. An alert stops nothing, so it is not a hard limit.\n */\nexport const LIMIT_KINDS: readonly [\"provider\", \"prepaid\", \"code\", \"alert\"] = [\"provider\", \"prepaid\", \"code\", \"alert\"];\n\n/** A kind of limit of the cost of a month. */\nexport type LimitKind = (typeof LIMIT_KINDS)[number];\n\n/** A limit of the cost of a service in a month. */\nexport interface Limit {\n readonly kind: LimitKind;\n /** The amount of the limit for a month, in the currency of the layer. For `prepaid`, it is the largest balance. */\n readonly amount: number;\n /** For `prepaid`: the provider adds money to the balance automatically. Such a balance is not a hard limit. */\n readonly recharge?: boolean | undefined;\n /** For `code`: the `id` of the part of the stack that stops the use. */\n readonly stop?: string | undefined;\n}\n\n/** The proof of a record: who read the settings of the service, and on which date. */\nexport interface Proof {\n /** The date of the read, as `YYYY-MM-DD`. */\n readonly date: string;\n /** The reader of the settings, for example the owner of the account or the name of a program. */\n readonly by: string;\n /** The source of the read, for example the name of a page of the account. */\n readonly source?: string | undefined;\n}\n\n/**\n * The cost of a service after the end of its plan. It has the fields of a cost record that give a cost.\n * The gate examines it with the rules of a cost record: a cost that grows with the use must have a hard limit.\n */\nexport interface NextPlan {\n /** The name of the plan after the end. */\n readonly plan?: string | undefined;\n readonly billing: Billing;\n /** The fixed price of a month after the end, in the currency of the layer. A `fixed` plan must have one. */\n readonly price?: number | undefined;\n /** The limits that are in force after the end. A `metered` plan must have one hard limit, or more. */\n readonly limits?: readonly Limit[] | undefined;\n}\n\n/**\n * The end of the plan of a service: a trial, a free credit or a term that ends on a date.\n *\n * - With no `next`, the provider stops the service after the date, and it takes no money. The part does not work after the date.\n * - With a `next`, the service continues after the date, with the cost of `next`.\n */\nexport interface PlanEnd {\n /** The last day of the plan, as `YYYY-MM-DD`. */\n readonly date: string;\n /** The cost of the service after the end. A service that stops has none. */\n readonly next?: NextPlan | undefined;\n}\n\n/** The cost record of one part of the stack. */\nexport interface Service {\n /** The `id` of the part of the stack with the cost. */\n readonly part: string;\n /** The name of the plan of the service. */\n readonly plan?: string | undefined;\n readonly billing: Billing;\n /** The fixed price of a month, in the currency of the layer. A `fixed` service must have one. */\n readonly price?: number | undefined;\n /** The limits that are in force. A `metered` service must have one hard limit, or more. */\n readonly limits?: readonly Limit[] | undefined;\n /** A limit that is not in force: the owner must set it. The gate fails until it is in `limits`. */\n readonly wanted?: Limit | undefined;\n /** The end of the plan, for a plan that ends on a date. The fields `billing`, `price` and `limits` give the cost before the end. */\n readonly ends?: PlanEnd | undefined;\n /** The proof of the record. Each record must have one, and a proof becomes too old. */\n readonly proof?: Proof | undefined;\n /** The steps of the owner in the account of the service, to set or to read a limit. */\n readonly steps?: readonly string[] | undefined;\n}\n\n/** The default count of days before the end of a plan from which the gate gives a warning. */\nexport const END_DAYS = 30;\n\n/** A spend layer: the cost records of the parts of a stack. */\nexport interface SpendLayer {\n readonly schema: typeof SPEND_SCHEMA;\n /** The currency of each amount of the layer, as a code of ISO 4217, for example `USD`. */\n readonly currency: string;\n /** The kinds of the parts that can have a cost. Each part of one of these kinds must have a record. */\n readonly kinds: readonly string[];\n /** The largest age of a proof, in days. */\n readonly proofDays: number;\n /** The count of days before the end of a plan from which the gate gives a warning. The default is `END_DAYS`. */\n readonly endDays?: number | undefined;\n readonly services: readonly Service[];\n}\n","// The reads of the used amount of a service. A read is live data: a program makes it, and it is no record of the layer.\n// The functions of `use.ts` and of `use-check.ts` take a list of reads.\n\n/**\n * These are the sources of a read.\n *\n * - `count`: a part of the stack counted the use, and it gives the cost of that use.\n * - `provider`: the provider of the service shows the cost of the use, for example on a usage page or in a usage API.\n */\nexport const USE_SOURCES: readonly [\"count\", \"provider\"] = [\"count\", \"provider\"];\n\n/** A source of a read. */\nexport type UseSource = (typeof USE_SOURCES)[number];\n\n/**\n * A read of the cost of the use of one service.\n *\n * The amount is the cost of the use from the start of a month until the read. It is the part of the cost that grows\n * with the use: the fixed price of a plan is not in it.\n */\nexport interface UseRead {\n /** The `id` of the part of the service. */\n readonly part: string;\n readonly source: UseSource;\n /** The cost of the use from the start of the month until the read, in the currency of the layer. */\n readonly amount: number;\n /** The date of the read, as `YYYY-MM-DD`. The month of this date is the month of the amount. */\n readonly date: string;\n}\n\n/** These are the default levels of the used share of a hard limit: 50, 80 and 100 percent. */\nexport const USE_LEVELS: readonly number[] = [0.5, 0.8, 1];\n\n/** The options of the functions of the used amount. */\nexport interface UseOptions {\n /** The date of the check, as `YYYY-MM-DD`. Its month is the month of the used amounts. The functions have no clock. */\n readonly today: string;\n /** The levels: shares of the hard limit, each one above 0. The default is `USE_LEVELS`. */\n readonly levels?: readonly number[] | undefined;\n /** The largest age of the newest read of a service, in days. With no value, the gate examines no age. */\n readonly readDays?: number | undefined;\n}\n"],"mappings":";;AAIA,MAAa,eAAe;;;;;;;;AAS5B,MAAa,WAAkD;CAAC;CAAQ;CAAS;AAAS;;;;;;;;;AAa1F,MAAa,cAAiE;CAAC;CAAY;CAAW;CAAQ;AAAO;;AA2ErH,MAAa,WAAW;;;;;;;;AC5FxB,MAAa,cAA8C,CAAC,SAAS,UAAU;;AAsB/E,MAAa,aAAgC;CAAC;CAAK;CAAK;AAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are the sources of a read.
|
|
3
|
+
*
|
|
4
|
+
* - `count`: a part of the stack counted the use, and it gives the cost of that use.
|
|
5
|
+
* - `provider`: the provider of the service shows the cost of the use, for example on a usage page or in a usage API.
|
|
6
|
+
*/
|
|
7
|
+
declare const USE_SOURCES: readonly ["count", "provider"];
|
|
8
|
+
/** A source of a read. */
|
|
9
|
+
type UseSource = (typeof USE_SOURCES)[number];
|
|
10
|
+
/**
|
|
11
|
+
* A read of the cost of the use of one service.
|
|
12
|
+
*
|
|
13
|
+
* The amount is the cost of the use from the start of a month until the read. It is the part of the cost that grows
|
|
14
|
+
* with the use: the fixed price of a plan is not in it.
|
|
15
|
+
*/
|
|
16
|
+
interface UseRead {
|
|
17
|
+
/** The `id` of the part of the service. */
|
|
18
|
+
readonly part: string;
|
|
19
|
+
readonly source: UseSource;
|
|
20
|
+
/** The cost of the use from the start of the month until the read, in the currency of the layer. */
|
|
21
|
+
readonly amount: number;
|
|
22
|
+
/** The date of the read, as `YYYY-MM-DD`. The month of this date is the month of the amount. */
|
|
23
|
+
readonly date: string;
|
|
24
|
+
}
|
|
25
|
+
/** These are the default levels of the used share of a hard limit: 50, 80 and 100 percent. */
|
|
26
|
+
declare const USE_LEVELS: readonly number[];
|
|
27
|
+
/** The options of the functions of the used amount. */
|
|
28
|
+
interface UseOptions {
|
|
29
|
+
/** The date of the check, as `YYYY-MM-DD`. Its month is the month of the used amounts. The functions have no clock. */
|
|
30
|
+
readonly today: string;
|
|
31
|
+
/** The levels: shares of the hard limit, each one above 0. The default is `USE_LEVELS`. */
|
|
32
|
+
readonly levels?: readonly number[] | undefined;
|
|
33
|
+
/** The largest age of the newest read of a service, in days. With no value, the gate examines no age. */
|
|
34
|
+
readonly readDays?: number | undefined;
|
|
35
|
+
}
|
|
36
|
+
export { UseSource as a, UseRead as i, USE_SOURCES as n, UseOptions as r, USE_LEVELS as t };
|
|
37
|
+
//# sourceMappingURL=reads-HuHaDiHO.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reads-HuHaDiHO.d.ts","names":[],"sources":["../src/reads.ts"],"mappings":";;;;;;cASa;;KAGD,oBAAoB;;;;;;;UAQf;;WAEN;WACA,QAAQ;;WAER;;WAEA;;;cAIE;;UAGI;;WAEN;;WAEA;;WAEA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { f as SpendLayer } from "./layer-BYSJfC_1.js";
|
|
2
|
+
import { i as UseRead } from "./reads-HuHaDiHO.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
/**
|
|
5
|
+
* The schema of a spend layer. It examines the form of the record: the fields, their types and the finite numbers.
|
|
6
|
+
* It refuses a field that the format does not have. `checkSpend` examines the meaning of a layer with a correct form.
|
|
7
|
+
*/
|
|
8
|
+
export declare const spendSchema: z.ZodType<SpendLayer>;
|
|
9
|
+
/** The result of the read of a spend layer: the layer, or the faults of its form. */
|
|
10
|
+
export type SpendParse = {
|
|
11
|
+
readonly ok: true;
|
|
12
|
+
readonly layer: SpendLayer;
|
|
13
|
+
} | {
|
|
14
|
+
readonly ok: false;
|
|
15
|
+
readonly errors: readonly string[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* This function reads the JSON of a spend layer. It gives the layer, or the faults of its form.
|
|
19
|
+
* Each fault names its place in the record, for example `services.0.part`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseSpend(value: unknown): SpendParse;
|
|
22
|
+
/**
|
|
23
|
+
* The schema of a list of reads of the used amounts. It examines the form of each read: the fields, their types and the finite numbers.
|
|
24
|
+
* `checkUse` examines the meaning of the reads with a correct form.
|
|
25
|
+
*/
|
|
26
|
+
export declare const readsSchema: z.ZodType<readonly UseRead[]>;
|
|
27
|
+
/** The result of the read of a list of reads: the reads, or the faults of their form. */
|
|
28
|
+
export type ReadsParse = {
|
|
29
|
+
readonly ok: true;
|
|
30
|
+
readonly reads: readonly UseRead[];
|
|
31
|
+
} | {
|
|
32
|
+
readonly ok: false;
|
|
33
|
+
readonly errors: readonly string[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* This function reads the JSON of a list of reads of the used amounts. It gives the reads, or the faults of their form.
|
|
37
|
+
* Each fault names its place in the list, for example `0.amount`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseReads(value: unknown): ReadsParse;
|
|
40
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","names":[],"sources":["../src/schema.ts"],"mappings":";;;;;;;qBAmDa,aAAa,EAAE,QAAQ;;YAUxB;WAAwB;WAAmB,OAAO;;WAA0B;WAAoB;;;;;;wBAM5F,WAAW,iBAAiB;;;;;qBAoB/B,aAAa,EAAE,iBAAiB;;YAGjC;WAAwB;WAAmB,gBAAgB;;WAAyB;WAAoB;;;;;;wBAMpG,WAAW,iBAAiB"}
|
package/build/schema.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { a as LIMIT_KINDS, n as USE_SOURCES, o as SPEND_SCHEMA, r as BILLINGS } from "./reads-BNyUIVaY.js";
|
|
2
|
+
import { formErrors } from "@mark1russell7/system-stack/schema";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
// src/schema.ts
|
|
5
|
+
const id = z.string().min(1);
|
|
6
|
+
const limit = z.strictObject({
|
|
7
|
+
kind: z.enum([...LIMIT_KINDS]),
|
|
8
|
+
amount: z.number(),
|
|
9
|
+
recharge: z.boolean().optional(),
|
|
10
|
+
stop: id.optional()
|
|
11
|
+
});
|
|
12
|
+
const proof = z.strictObject({
|
|
13
|
+
date: z.string(),
|
|
14
|
+
by: z.string().min(1),
|
|
15
|
+
source: z.string().optional()
|
|
16
|
+
});
|
|
17
|
+
const next = z.strictObject({
|
|
18
|
+
plan: z.string().optional(),
|
|
19
|
+
billing: z.enum([...BILLINGS]),
|
|
20
|
+
price: z.number().optional(),
|
|
21
|
+
limits: z.array(limit).readonly().optional()
|
|
22
|
+
});
|
|
23
|
+
const ends = z.strictObject({
|
|
24
|
+
date: z.string(),
|
|
25
|
+
next: next.optional()
|
|
26
|
+
});
|
|
27
|
+
const service = z.strictObject({
|
|
28
|
+
part: id,
|
|
29
|
+
plan: z.string().optional(),
|
|
30
|
+
billing: z.enum([...BILLINGS]),
|
|
31
|
+
price: z.number().optional(),
|
|
32
|
+
limits: z.array(limit).readonly().optional(),
|
|
33
|
+
wanted: limit.optional(),
|
|
34
|
+
ends: ends.optional(),
|
|
35
|
+
proof: proof.optional(),
|
|
36
|
+
steps: z.array(z.string()).readonly().optional()
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* The schema of a spend layer. It examines the form of the record: the fields, their types and the finite numbers.
|
|
40
|
+
* It refuses a field that the format does not have. `checkSpend` examines the meaning of a layer with a correct form.
|
|
41
|
+
*/
|
|
42
|
+
const spendSchema = z.strictObject({
|
|
43
|
+
schema: z.literal(SPEND_SCHEMA),
|
|
44
|
+
currency: z.string().regex(/^[A-Z]{3}$/, "The currency is a code of three capital letters."),
|
|
45
|
+
kinds: z.array(z.string().min(1)).readonly(),
|
|
46
|
+
proofDays: z.number().positive(),
|
|
47
|
+
endDays: z.number().nonnegative().optional(),
|
|
48
|
+
services: z.array(service).readonly()
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* This function reads the JSON of a spend layer. It gives the layer, or the faults of its form.
|
|
52
|
+
* Each fault names its place in the record, for example `services.0.part`.
|
|
53
|
+
*/
|
|
54
|
+
function parseSpend(value) {
|
|
55
|
+
const read = spendSchema.safeParse(value);
|
|
56
|
+
if (read.success) return {
|
|
57
|
+
ok: true,
|
|
58
|
+
layer: read.data
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
ok: false,
|
|
62
|
+
errors: formErrors(SPEND_SCHEMA, read.error.issues)
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const read = z.strictObject({
|
|
66
|
+
part: id,
|
|
67
|
+
source: z.enum([...USE_SOURCES]),
|
|
68
|
+
amount: z.number(),
|
|
69
|
+
date: z.string()
|
|
70
|
+
});
|
|
71
|
+
/** The name of a list of reads in a fault of its form. */
|
|
72
|
+
const READS_NAME = `${SPEND_SCHEMA} reads`;
|
|
73
|
+
/**
|
|
74
|
+
* The schema of a list of reads of the used amounts. It examines the form of each read: the fields, their types and the finite numbers.
|
|
75
|
+
* `checkUse` examines the meaning of the reads with a correct form.
|
|
76
|
+
*/
|
|
77
|
+
const readsSchema = z.array(read).readonly();
|
|
78
|
+
/**
|
|
79
|
+
* This function reads the JSON of a list of reads of the used amounts. It gives the reads, or the faults of their form.
|
|
80
|
+
* Each fault names its place in the list, for example `0.amount`.
|
|
81
|
+
*/
|
|
82
|
+
function parseReads(value) {
|
|
83
|
+
const result = readsSchema.safeParse(value);
|
|
84
|
+
if (result.success) return {
|
|
85
|
+
ok: true,
|
|
86
|
+
reads: result.data
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
ok: false,
|
|
90
|
+
errors: formErrors(READS_NAME, result.error.issues)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export { parseReads, parseSpend, readsSchema, spendSchema };
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { formErrors } from \"@mark1russell7/system-stack/schema\";\nimport { z } from \"zod\";\nimport { BILLINGS, LIMIT_KINDS, SPEND_SCHEMA, type SpendLayer } from \"./layer.ts\";\nimport { USE_SOURCES, type UseRead } from \"./reads.ts\";\n\n// The zod schema of a spend layer, and the read of its JSON. This module is the entry `/schema` of the package.\n// The root entry has no zod, so a page that only evaluates the cost math gets no schema library.\n\nconst id = z.string().min(1);\n\nconst limit = z.strictObject({\n kind: z.enum([...LIMIT_KINDS]),\n amount: z.number(),\n recharge: z.boolean().optional(),\n stop: id.optional(),\n});\n\nconst proof = z.strictObject({\n date: z.string(),\n by: z.string().min(1),\n source: z.string().optional(),\n});\n\nconst next = z.strictObject({\n plan: z.string().optional(),\n billing: z.enum([...BILLINGS]),\n price: z.number().optional(),\n limits: z.array(limit).readonly().optional(),\n});\n\nconst ends = z.strictObject({\n date: z.string(),\n next: next.optional(),\n});\n\nconst service = z.strictObject({\n part: id,\n plan: z.string().optional(),\n billing: z.enum([...BILLINGS]),\n price: z.number().optional(),\n limits: z.array(limit).readonly().optional(),\n wanted: limit.optional(),\n ends: ends.optional(),\n proof: proof.optional(),\n steps: z.array(z.string()).readonly().optional(),\n});\n\n/**\n * The schema of a spend layer. It examines the form of the record: the fields, their types and the finite numbers.\n * It refuses a field that the format does not have. `checkSpend` examines the meaning of a layer with a correct form.\n */\nexport const spendSchema: z.ZodType<SpendLayer> = z.strictObject({\n schema: z.literal(SPEND_SCHEMA),\n currency: z.string().regex(/^[A-Z]{3}$/, \"The currency is a code of three capital letters.\"),\n kinds: z.array(z.string().min(1)).readonly(),\n proofDays: z.number().positive(),\n endDays: z.number().nonnegative().optional(),\n services: z.array(service).readonly(),\n});\n\n/** The result of the read of a spend layer: the layer, or the faults of its form. */\nexport type SpendParse = { readonly ok: true; readonly layer: SpendLayer } | { readonly ok: false; readonly errors: readonly string[] };\n\n/**\n * This function reads the JSON of a spend layer. It gives the layer, or the faults of its form.\n * Each fault names its place in the record, for example `services.0.part`.\n */\nexport function parseSpend(value: unknown): SpendParse {\n const read = spendSchema.safeParse(value);\n if (read.success) return { ok: true, layer: read.data };\n return { ok: false, errors: formErrors(SPEND_SCHEMA, read.error.issues) };\n}\n\nconst read = z.strictObject({\n part: id,\n source: z.enum([...USE_SOURCES]),\n amount: z.number(),\n date: z.string(),\n});\n\n/** The name of a list of reads in a fault of its form. */\nconst READS_NAME = `${SPEND_SCHEMA} reads`;\n\n/**\n * The schema of a list of reads of the used amounts. It examines the form of each read: the fields, their types and the finite numbers.\n * `checkUse` examines the meaning of the reads with a correct form.\n */\nexport const readsSchema: z.ZodType<readonly UseRead[]> = z.array(read).readonly();\n\n/** The result of the read of a list of reads: the reads, or the faults of their form. */\nexport type ReadsParse = { readonly ok: true; readonly reads: readonly UseRead[] } | { readonly ok: false; readonly errors: readonly string[] };\n\n/**\n * This function reads the JSON of a list of reads of the used amounts. It gives the reads, or the faults of their form.\n * Each fault names its place in the list, for example `0.amount`.\n */\nexport function parseReads(value: unknown): ReadsParse {\n const result = readsSchema.safeParse(value);\n if (result.success) return { ok: true, reads: result.data };\n return { ok: false, errors: formErrors(READS_NAME, result.error.issues) };\n}\n"],"mappings":";;;;AAQA,MAAM,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAE3B,MAAM,QAAQ,EAAE,aAAa;CAC3B,MAAM,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC;CAC7B,QAAQ,EAAE,OAAO;CACjB,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,MAAM,GAAG,SAAS;AACpB,CAAC;AAED,MAAM,QAAQ,EAAE,aAAa;CAC3B,MAAM,EAAE,OAAO;CACf,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;AAC9B,CAAC;AAED,MAAM,OAAO,EAAE,aAAa;CAC1B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,SAAS,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC;CAC7B,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,QAAQ,EAAE,MAAM,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AAC7C,CAAC;AAED,MAAM,OAAO,EAAE,aAAa;CAC1B,MAAM,EAAE,OAAO;CACf,MAAM,KAAK,SAAS;AACtB,CAAC;AAED,MAAM,UAAU,EAAE,aAAa;CAC7B,MAAM;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,SAAS,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC;CAC7B,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,QAAQ,EAAE,MAAM,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC3C,QAAQ,MAAM,SAAS;CACvB,MAAM,KAAK,SAAS;CACpB,OAAO,MAAM,SAAS;CACtB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACjD,CAAC;;;;;AAMD,MAAa,cAAqC,EAAE,aAAa;CAC/D,QAAQ,EAAE,QAAQ,YAAY;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,MAAM,cAAc,kDAAkD;CAC3F,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;CAC3C,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,SAAS,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS;CAC3C,UAAU,EAAE,MAAM,OAAO,CAAC,CAAC,SAAS;AACtC,CAAC;;;;;AASD,SAAgB,WAAW,OAA4B;CACrD,MAAM,OAAO,YAAY,UAAU,KAAK;CACxC,IAAI,KAAK,SAAS,OAAO;EAAE,IAAI;EAAM,OAAO,KAAK;CAAK;CACtD,OAAO;EAAE,IAAI;EAAO,QAAQ,WAAW,cAAc,KAAK,MAAM,MAAM;CAAE;AAC1E;AAEA,MAAM,OAAO,EAAE,aAAa;CAC1B,MAAM;CACN,QAAQ,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC;CAC/B,QAAQ,EAAE,OAAO;CACjB,MAAM,EAAE,OAAO;AACjB,CAAC;;AAGD,MAAM,aAAa,GAAG,aAAa;;;;;AAMnC,MAAa,cAA6C,EAAE,MAAM,IAAI,CAAC,CAAC,SAAS;;;;;AASjF,SAAgB,WAAW,OAA4B;CACrD,MAAM,SAAS,YAAY,UAAU,KAAK;CAC1C,IAAI,OAAO,SAAS,OAAO;EAAE,IAAI;EAAM,OAAO,OAAO;CAAK;CAC1D,OAAO;EAAE,IAAI;EAAO,QAAQ,WAAW,YAAY,OAAO,MAAM,MAAM;CAAE;AAC1E"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package",
|
|
2
3
|
"name": "@mark1russell7/stack-spend",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
4
|
+
"version": "0.1.5",
|
|
5
|
+
"description": "The cost of each part of a system stack as data: plans, prices and hard monthly limits, a gate, and the largest cost of a month as Vex programs. An add-on of system-stack.",
|
|
6
|
+
"license": "MIT",
|
|
5
7
|
"repository": {
|
|
6
8
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/mark1russell7/system-stack.git"
|
|
9
|
+
"url": "git+https://github.com/mark1russell7/system-stack.git",
|
|
10
|
+
"directory": "packages/stack-spend"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://mark1russell7.github.io/system-stack/",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/mark1russell7/system-stack/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"spend",
|
|
18
|
+
"cost",
|
|
19
|
+
"budget",
|
|
20
|
+
"limit",
|
|
21
|
+
"cap",
|
|
22
|
+
"billing",
|
|
23
|
+
"gate",
|
|
24
|
+
"system-stack",
|
|
25
|
+
"vex"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"main": "./build/index.js",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./build/index.d.ts",
|
|
33
|
+
"import": "./build/index.js",
|
|
34
|
+
"default": "./build/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./schema": {
|
|
37
|
+
"types": "./build/schema.d.ts",
|
|
38
|
+
"import": "./build/schema.js",
|
|
39
|
+
"default": "./build/schema.js"
|
|
40
|
+
},
|
|
41
|
+
"./add-on": {
|
|
42
|
+
"types": "./build/add-on.d.ts",
|
|
43
|
+
"import": "./build/add-on.js",
|
|
44
|
+
"default": "./build/add-on.js"
|
|
45
|
+
},
|
|
46
|
+
"./package.json": "./package.json"
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"build"
|
|
50
|
+
],
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@mark1russell7/system-stack": "0.1.4",
|
|
53
|
+
"@mark1russell7/vex": "^0.19.1",
|
|
54
|
+
"@mark1russell7/vex-domains": "^0.19.1",
|
|
55
|
+
"zod": "^4.6.7"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@mark1russell7/cue": "^2.0.0",
|
|
59
|
+
"@types/node": "^26.6.5",
|
|
60
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
61
|
+
"fast-check": "^4.10.2",
|
|
62
|
+
"tsdown": "^0.23.1",
|
|
63
|
+
"typescript": "^7.0.2",
|
|
64
|
+
"vitest": "^5.0.3"
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=22"
|
|
8
68
|
},
|
|
9
|
-
"license": "MIT",
|
|
10
69
|
"publishConfig": {
|
|
11
70
|
"access": "public"
|
|
12
|
-
}
|
|
13
|
-
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "tsdown",
|
|
74
|
+
"test": "vitest run",
|
|
75
|
+
"test:watch": "vitest",
|
|
76
|
+
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json"
|
|
77
|
+
},
|
|
78
|
+
"types": "./build/index.d.ts"
|
|
79
|
+
}
|