@better-giving/endowment 3.0.0 → 3.0.2
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/dist/cloudsearch.d.mts +1 -1
- package/package.json +2 -2
- package/src/cloudsearch.mts +1 -1
- package/src/schema.mts +0 -18
package/dist/cloudsearch.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToDoc, ToHitFields, ToUpdate } from "@better-giving/types/cloudsearch";
|
|
2
|
-
import { type InferInput, type InferOutput } from "valibot";
|
|
3
2
|
import type { Environment } from "@better-giving/types/list";
|
|
3
|
+
import { type InferInput, type InferOutput } from "valibot";
|
|
4
4
|
export declare const cloudsearchEndowFields: import("valibot").ObjectSchema<{
|
|
5
5
|
readonly contributions_total: import("valibot").NumberSchema<undefined>;
|
|
6
6
|
readonly contributions_count: import("valibot").NumberSchema<undefined>;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-giving/endowment",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"ksuid": "3.0.0"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@better-giving/schemas": "1.2.
|
|
8
|
+
"@better-giving/schemas": "1.2.3",
|
|
9
9
|
"@better-giving/types": "1.1.8",
|
|
10
10
|
"@better-giving/db": "1.0.11",
|
|
11
11
|
"@aws-sdk/lib-dynamodb": "3.485.0",
|
package/src/cloudsearch.mts
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
ToHitFields,
|
|
5
5
|
ToUpdate,
|
|
6
6
|
} from "@better-giving/types/cloudsearch";
|
|
7
|
+
import type { Environment } from "@better-giving/types/list";
|
|
7
8
|
import {
|
|
8
9
|
type InferInput,
|
|
9
10
|
type InferOutput,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
pipe,
|
|
19
20
|
} from "valibot";
|
|
20
21
|
import { $, csvStrs, npo } from "./schema.mjs";
|
|
21
|
-
import type { Environment } from "@better-giving/types/list";
|
|
22
22
|
|
|
23
23
|
const boolCsv = pipe(
|
|
24
24
|
csvStrs,
|
package/src/schema.mts
CHANGED
|
@@ -49,24 +49,6 @@ export const allocation = v.pipe(
|
|
|
49
49
|
|
|
50
50
|
export interface IAllocation extends v.InferOutput<typeof allocation> {}
|
|
51
51
|
|
|
52
|
-
export const segment_max_chars = 30;
|
|
53
|
-
export const segment = v.pipe(
|
|
54
|
-
$,
|
|
55
|
-
v.maxLength(
|
|
56
|
-
segment_max_chars,
|
|
57
|
-
({ requirement: r }) => `cannot exceed ${r} chars`
|
|
58
|
-
),
|
|
59
|
-
//must not be id-like
|
|
60
|
-
v.regex(/^(?!^\d+$)/, "should not be an id"),
|
|
61
|
-
//valid characters
|
|
62
|
-
v.regex(/^[a-zA-Z0-9-._~]+$/, "allowed: numbers | letters | - | . | _ | ~"),
|
|
63
|
-
v.excludes("..", "should not contain double periods"),
|
|
64
|
-
v.custom((x) => !(x as string).startsWith("."), "should not start with dot"),
|
|
65
|
-
v.custom((x) => !(x as string).endsWith("."), "should not end with dot")
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
export const slug = v.lazy((x) => (x ? segment : $));
|
|
69
|
-
|
|
70
52
|
export const reg_number = v.pipe(
|
|
71
53
|
$,
|
|
72
54
|
v.nonEmpty("required"),
|