@better-giving/endowment 1.0.6 → 1.0.7
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/schema.d.mts +18 -16
- package/dist/schema.mjs +4 -2
- package/package.json +1 -1
- package/src/schema.mts +8 -2
package/dist/schema.d.mts
CHANGED
|
@@ -15,7 +15,8 @@ export type Allocation = InferOutput<typeof allocation>;
|
|
|
15
15
|
export declare const endowId: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>;
|
|
16
16
|
export type EndowId = InferOutput<typeof endowId>;
|
|
17
17
|
export declare const endowIdParam: import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TransformAction<string, number>, import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>]>;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const segmentMaxChars = 30;
|
|
19
|
+
export declare const segment: import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, import("valibot").RegexAction<string, "should not be an id">, import("valibot").RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, import("valibot").ExcludesAction<string, "..", "should not contain double periods">, import("valibot").CustomSchema<string, "should not start with dot">, import("valibot").CustomSchema<string, "should not end with dot">]>>;
|
|
19
20
|
export declare const reg_number: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">, import("valibot").RegexAction<string, "must only contain letters and numbers">]>;
|
|
20
21
|
export declare const donateMethodIds: readonly ["stripe", "crypto", "daf", "stocks"];
|
|
21
22
|
export declare const donateMethodId: import("valibot").PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], undefined>;
|
|
@@ -34,6 +35,7 @@ export declare const MAX_RECEIPT_MSG_CHAR = 500;
|
|
|
34
35
|
export declare const incrementVal: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">, import("valibot").TransformAction<string, number>, import("valibot").NumberSchema<"must be a number">, import("valibot").MinValueAction<number, 0, "must be greater than 0">, import("valibot").TransformAction<number, string>]>;
|
|
35
36
|
export declare const MAX_NUM_INCREMENTS = 4;
|
|
36
37
|
export declare const incrementLabelMaxChars = 30;
|
|
38
|
+
export declare const taglineMaxChars = 140;
|
|
37
39
|
export declare const incrementLabel: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>]>;
|
|
38
40
|
export declare const increment: import("valibot").ObjectSchema<{
|
|
39
41
|
readonly value: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">, import("valibot").TransformAction<string, number>, import("valibot").NumberSchema<"must be a number">, import("valibot").MinValueAction<number, 0, "must be greater than 0">, import("valibot").TransformAction<number, string>]>;
|
|
@@ -42,12 +44,12 @@ export declare const increment: import("valibot").ObjectSchema<{
|
|
|
42
44
|
export type Increment = InferOutput<typeof increment>;
|
|
43
45
|
export declare const endowment: import("valibot").ObjectSchema<{
|
|
44
46
|
readonly id: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>;
|
|
45
|
-
readonly slug: import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, "
|
|
47
|
+
readonly slug: import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, import("valibot").RegexAction<string, "should not be an id">, import("valibot").RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, import("valibot").ExcludesAction<string, "..", "should not contain double periods">, import("valibot").CustomSchema<string, "should not start with dot">, import("valibot").CustomSchema<string, "should not end with dot">]>>, never>;
|
|
46
48
|
readonly registration_number: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">, import("valibot").RegexAction<string, "must only contain letters and numbers">]>;
|
|
47
49
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
48
50
|
readonly endow_designation: import("valibot").PicklistSchema<readonly ["Charity", "Religious Organization", "University", "Hospital", "Other"], undefined>;
|
|
49
51
|
readonly overview: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>;
|
|
50
|
-
readonly tagline: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>;
|
|
52
|
+
readonly tagline: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 140, undefined>]>, never>;
|
|
51
53
|
readonly image: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
52
54
|
readonly logo: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
53
55
|
readonly card_img: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
@@ -92,12 +94,12 @@ export declare const endowment: import("valibot").ObjectSchema<{
|
|
|
92
94
|
}, undefined>;
|
|
93
95
|
export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
94
96
|
readonly id: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>;
|
|
95
|
-
readonly slug: import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, "
|
|
97
|
+
readonly slug: import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, import("valibot").RegexAction<string, "should not be an id">, import("valibot").RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, import("valibot").ExcludesAction<string, "..", "should not contain double periods">, import("valibot").CustomSchema<string, "should not start with dot">, import("valibot").CustomSchema<string, "should not end with dot">]>>, never>;
|
|
96
98
|
readonly registration_number: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">, import("valibot").RegexAction<string, "must only contain letters and numbers">]>;
|
|
97
99
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
98
100
|
readonly endow_designation: import("valibot").PicklistSchema<readonly ["Charity", "Religious Organization", "University", "Hospital", "Other"], undefined>;
|
|
99
101
|
readonly overview: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>;
|
|
100
|
-
readonly tagline: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>;
|
|
102
|
+
readonly tagline: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 140, undefined>]>, never>;
|
|
101
103
|
readonly image: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
102
104
|
readonly logo: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
103
105
|
readonly card_img: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
@@ -142,12 +144,12 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
142
144
|
}, undefined>, "_types" | "_run" | "entries"> & {
|
|
143
145
|
readonly entries: Omit<{
|
|
144
146
|
readonly id: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>;
|
|
145
|
-
readonly slug: import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, "
|
|
147
|
+
readonly slug: import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, import("valibot").RegexAction<string, "should not be an id">, import("valibot").RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, import("valibot").ExcludesAction<string, "..", "should not contain double periods">, import("valibot").CustomSchema<string, "should not start with dot">, import("valibot").CustomSchema<string, "should not end with dot">]>>, never>;
|
|
146
148
|
readonly registration_number: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">, import("valibot").RegexAction<string, "must only contain letters and numbers">]>;
|
|
147
149
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
148
150
|
readonly endow_designation: import("valibot").PicklistSchema<readonly ["Charity", "Religious Organization", "University", "Hospital", "Other"], undefined>;
|
|
149
151
|
readonly overview: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>;
|
|
150
|
-
readonly tagline: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>;
|
|
152
|
+
readonly tagline: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 140, undefined>]>, never>;
|
|
151
153
|
readonly image: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
152
154
|
readonly logo: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
153
155
|
readonly card_img: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
@@ -194,7 +196,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
194
196
|
cash: number;
|
|
195
197
|
liq: number;
|
|
196
198
|
lock: number;
|
|
197
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
199
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
198
200
|
value: string;
|
|
199
201
|
label: string;
|
|
200
202
|
}[], 4>>): import("valibot").Dataset<{
|
|
@@ -240,7 +242,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
240
242
|
cash: number;
|
|
241
243
|
liq: number;
|
|
242
244
|
lock: number;
|
|
243
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
245
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
244
246
|
value: string;
|
|
245
247
|
label: string;
|
|
246
248
|
}[], 4>>;
|
|
@@ -329,7 +331,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
329
331
|
cash: number;
|
|
330
332
|
liq: number;
|
|
331
333
|
lock: number;
|
|
332
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
334
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
333
335
|
value: string;
|
|
334
336
|
label: string;
|
|
335
337
|
}[], 4>;
|
|
@@ -337,10 +339,10 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
337
339
|
}, "_types" | "_run" | "entries"> & {
|
|
338
340
|
readonly entries: {
|
|
339
341
|
readonly url: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>, never>;
|
|
340
|
-
readonly slug: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, "
|
|
342
|
+
readonly slug: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, import("valibot").RegexAction<string, "should not be an id">, import("valibot").RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, import("valibot").ExcludesAction<string, "..", "should not contain double periods">, import("valibot").CustomSchema<string, "should not start with dot">, import("valibot").CustomSchema<string, "should not end with dot">]>>, never>, never>;
|
|
341
343
|
readonly name: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>, never>;
|
|
342
344
|
readonly overview: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>, never>;
|
|
343
|
-
readonly tagline: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>, never>;
|
|
345
|
+
readonly tagline: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 140, undefined>]>, never>, never>;
|
|
344
346
|
readonly image: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>, never>;
|
|
345
347
|
readonly logo: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>, never>;
|
|
346
348
|
readonly card_img: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>, never>;
|
|
@@ -386,7 +388,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
386
388
|
cash: number;
|
|
387
389
|
liq: number;
|
|
388
390
|
lock: number;
|
|
389
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
391
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
390
392
|
value: string;
|
|
391
393
|
label: string;
|
|
392
394
|
}[], 4>>): import("valibot").Dataset<{
|
|
@@ -432,7 +434,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
432
434
|
cash: number;
|
|
433
435
|
liq: number;
|
|
434
436
|
lock: number;
|
|
435
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
437
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
436
438
|
value: string;
|
|
437
439
|
label: string;
|
|
438
440
|
}[], 4>>;
|
|
@@ -521,7 +523,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
521
523
|
cash: number;
|
|
522
524
|
liq: number;
|
|
523
525
|
lock: number;
|
|
524
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
526
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").RegexIssue<string> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").PicklistIssue | import("valibot").UrlIssue<string> | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | import("valibot").MaxLengthIssue<string, 500> | import("valibot").BooleanIssue | import("valibot").MaxLengthIssue<{
|
|
525
527
|
value: string;
|
|
526
528
|
label: string;
|
|
527
529
|
}[], 4>;
|
|
@@ -545,7 +547,7 @@ export declare const endowsQueryParams: import("valibot").ObjectSchema<{
|
|
|
545
547
|
export type EndowsQueryParams = InferInput<typeof endowsQueryParams>;
|
|
546
548
|
export declare const endowQueryParam: import("valibot").ObjectSchema<{
|
|
547
549
|
readonly fields: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").RegexAction<string, "invalid csv">]>>, import("valibot").TransformAction<string, string[]>, import("valibot").ArraySchema<import("valibot").PicklistSchema<["url", "slug", "name", "overview", "tagline", "image", "logo", "card_img", "hq_country", "active_in_countries", "street_address", "sdgs", "receiptMsg", "hide_bg_tip", "published", "progDonationsAllowed", "allocation", "donateMethods", "increments", "fund_opt_in", "id", "registration_number", "endow_designation", "social_media_urls"], undefined>, undefined>]>, never>;
|
|
548
|
-
readonly slug: import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, "
|
|
550
|
+
readonly slug: import("valibot").OptionalSchema<import("valibot").LazySchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]> | import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, import("valibot").RegexAction<string, "should not be an id">, import("valibot").RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, import("valibot").ExcludesAction<string, "..", "should not contain double periods">, import("valibot").CustomSchema<string, "should not start with dot">, import("valibot").CustomSchema<string, "should not end with dot">]>>, never>;
|
|
549
551
|
readonly env: import("valibot").PicklistSchema<readonly ["staging", "production"], undefined>;
|
|
550
552
|
}, undefined>;
|
|
551
553
|
export type EndowQueryParam = InferInput<typeof endowQueryParam>;
|
package/dist/schema.mjs
CHANGED
|
@@ -10,10 +10,11 @@ export const allocation = pipe(object({
|
|
|
10
10
|
}), check((x) => x.cash + x.liq + x.lock === 100, "must total to 100"));
|
|
11
11
|
export const endowId = pipe(number(), integer(), minValue(1));
|
|
12
12
|
export const endowIdParam = pipe(string(), transform((x) => +x), endowId);
|
|
13
|
+
export const segmentMaxChars = 30;
|
|
13
14
|
export const segment = lazy((x) => {
|
|
14
15
|
if (!x)
|
|
15
16
|
return str;
|
|
16
|
-
return pipe(str, maxLength(
|
|
17
|
+
return pipe(str, maxLength(segmentMaxChars, ({ requirement: r }) => `cannot exceed ${r} chars`),
|
|
17
18
|
//must not be id-like
|
|
18
19
|
regex(/^(?!^\d+$)/, "should not be an id"),
|
|
19
20
|
//valid characters
|
|
@@ -38,6 +39,7 @@ export const incrementVal = pipe(str, nonEmpty("required"), transform((x) => +x)
|
|
|
38
39
|
transform((x) => x.toString()));
|
|
39
40
|
export const MAX_NUM_INCREMENTS = 4;
|
|
40
41
|
export const incrementLabelMaxChars = 30;
|
|
42
|
+
export const taglineMaxChars = 140;
|
|
41
43
|
export const incrementLabel = pipe(str, maxLength(incrementLabelMaxChars, ({ requirement: r }) => `cannot exceed ${r} characters`));
|
|
42
44
|
export const increment = object({
|
|
43
45
|
value: incrementVal,
|
|
@@ -50,7 +52,7 @@ export const endowment = object({
|
|
|
50
52
|
name: pipe(str, nonEmpty("required")),
|
|
51
53
|
endow_designation: orgDesignation,
|
|
52
54
|
overview: optional(str),
|
|
53
|
-
tagline: optional(str),
|
|
55
|
+
tagline: optional(pipe(str, maxLength(taglineMaxChars))),
|
|
54
56
|
image: optional(_url),
|
|
55
57
|
logo: optional(_url),
|
|
56
58
|
card_img: optional(_url),
|
package/package.json
CHANGED
package/src/schema.mts
CHANGED
|
@@ -60,11 +60,15 @@ export const endowIdParam = pipe(
|
|
|
60
60
|
endowId
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
+
export const segmentMaxChars = 30;
|
|
63
64
|
export const segment = lazy((x) => {
|
|
64
65
|
if (!x) return str;
|
|
65
66
|
return pipe(
|
|
66
67
|
str,
|
|
67
|
-
maxLength(
|
|
68
|
+
maxLength(
|
|
69
|
+
segmentMaxChars,
|
|
70
|
+
({ requirement: r }) => `cannot exceed ${r} chars`
|
|
71
|
+
),
|
|
68
72
|
//must not be id-like
|
|
69
73
|
regex(/^(?!^\d+$)/, "should not be an id"),
|
|
70
74
|
//valid characters
|
|
@@ -113,6 +117,8 @@ export const incrementVal = pipe(
|
|
|
113
117
|
|
|
114
118
|
export const MAX_NUM_INCREMENTS = 4;
|
|
115
119
|
export const incrementLabelMaxChars = 30;
|
|
120
|
+
export const taglineMaxChars = 140;
|
|
121
|
+
|
|
116
122
|
export const incrementLabel = pipe(
|
|
117
123
|
str,
|
|
118
124
|
maxLength(
|
|
@@ -135,7 +141,7 @@ export const endowment = object({
|
|
|
135
141
|
name: pipe(str, nonEmpty("required")),
|
|
136
142
|
endow_designation: orgDesignation,
|
|
137
143
|
overview: optional(str),
|
|
138
|
-
tagline: optional(str),
|
|
144
|
+
tagline: optional(pipe(str, maxLength(taglineMaxChars))),
|
|
139
145
|
image: optional(_url),
|
|
140
146
|
logo: optional(_url),
|
|
141
147
|
card_img: optional(_url),
|