@simpleapps-com/augur-utils 2026.11.5 → 2026.11.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/EXPORTS.md +2 -0
- package/README.md +7 -1
- package/dist/index.cjs +19 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/log-line.d.ts +21 -0
- package/dist/log-line.d.ts.map +1 -0
- package/llms.txt +2 -0
- package/package.json +3 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A log line: `context`, then `": "` and `errorName` when there is one. There is no way to pass
|
|
3
|
+
* anything else, so a token, a customer's details or an upstream body never reach a log.
|
|
4
|
+
*
|
|
5
|
+
* @ensures exactly the model's LogLine
|
|
6
|
+
*/
|
|
7
|
+
export declare function logLineOf(context: string, errorName: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* The name logged for an error: Auth.js errors carry a `type` ("JWTSessionError") that survives
|
|
10
|
+
* minification, others only their `name`.
|
|
11
|
+
*
|
|
12
|
+
* @ensures exactly the model's ErrorNameOf
|
|
13
|
+
*/
|
|
14
|
+
export declare function errorNameOf(hasType: boolean, typeName: string, name: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* The log line for a thrown value: `context` and the error's type name only. The one place the
|
|
17
|
+
* packages read a caught value for a log; it reads `type` and `name`, never `message`, `cause` or
|
|
18
|
+
* `stack`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function errorLogLine(context: string, error: unknown): string;
|
|
21
|
+
//# sourceMappingURL=log-line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-line.d.ts","sourceRoot":"","sources":["../src/log-line.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAMpE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMpF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAKpE"}
|
package/llms.txt
CHANGED
|
@@ -41,6 +41,7 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
|
|
|
41
41
|
- function: createImageConfig - Creates a frozen ImageConfig object.
|
|
42
42
|
- const: days - `n` days, in seconds.
|
|
43
43
|
- function: derivePrice - Pure price derivation — usable in hooks AND server components.
|
|
44
|
+
- function: errorLogLine - The log line for a thrown value: `context` and the error's type name only. The one place the packages read a caught value for a log; it reads `type` and `name`, never `message`, `cause` or `stack`.
|
|
44
45
|
- const: faqLd - A FAQ page's FAQPage markup as text: one Question per entry.
|
|
45
46
|
- function: firstAddressIdFrom - The first id in `ids` from `i` on, null when none is (each already read by `addressIdOf`).
|
|
46
47
|
- const: floorSeconds - Milliseconds as whole seconds, rounded down.
|
|
@@ -62,6 +63,7 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
|
|
|
62
63
|
- function: isUsableAddressId - Whether `value` is a usable address id (`addressIdOf` gives one). A plain boolean, not a type guard: "0" is a string that is no id, so a false MUST NOT narrow it away from `string`.
|
|
63
64
|
- function: lineHasQuantity - Whether a cart line has a quantity (augur always stores one; the type allows null).
|
|
64
65
|
- function: linePriceAt - Line `i`'s unit price from the per-line list (cart order): its own, fetched at its own quantity, so one item on two lines (two units of measure) keeps two prices; 0 past the end.
|
|
66
|
+
- function: logLineOf - A log line: `context`, then `": "` and `errorName` when there is one. There is no way to pass anything else, so a token, a customer's details or an upstream body never reach a log.
|
|
65
67
|
- const: millis - `n` milliseconds, for a duration under a second.
|
|
66
68
|
- const: millisOf - `n` as `Millis`, or null unless it is a safe integer at least 0.
|
|
67
69
|
- const: minusMillis - A reading less a duration, never below 0.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simpleapps-com/augur-utils",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.6",
|
|
4
4
|
"description": "Shared types, cache configuration, and utility functions for Augur ecommerce sites",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"valibot": "^1.5.0",
|
|
61
61
|
"vitest": "~5.0.3",
|
|
62
62
|
"@atlas/eslint-config": "0.0.0",
|
|
63
|
-
"@atlas/tsup-config": "0.0.0",
|
|
64
63
|
"@atlas/tsconfig": "0.0.0",
|
|
64
|
+
"@atlas/tsup-config": "0.0.0",
|
|
65
65
|
"@atlas/foundation": "0.0.0",
|
|
66
66
|
"@atlas/utils": "0.0.0",
|
|
67
67
|
"@atlas/vitest-config": "0.0.0",
|
|
68
|
-
"@simpleapps-com/augur-api": "2026.11.
|
|
68
|
+
"@simpleapps-com/augur-api": "2026.11.10"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=22.0.0"
|