@better-giving/endowment 1.0.32 → 1.0.33
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 +16 -19
- package/dist/schema.mjs +3 -5
- package/package.json +3 -3
- package/src/cloudsearch.mts +14 -6
- package/src/index.mts +1 -0
- package/src/schema.mts +15 -6
package/dist/schema.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { env, orgDesignation, unSdgNum } from "@better-giving/schemas";
|
|
2
|
-
export type { OrgDesignation as EndowDesignation, Environment, UnSdgNum, } from "@better-giving/schemas";
|
|
3
|
-
export { orgDesignation as endowDesignation, env, unSdgNum };
|
|
1
|
+
import { env, orgDesignation, unSdgNum, donateMethodId, donateMethodIds } from "@better-giving/schemas";
|
|
2
|
+
export type { OrgDesignation as EndowDesignation, Environment, UnSdgNum, DonateMethodId, } from "@better-giving/schemas";
|
|
3
|
+
export { orgDesignation as endowDesignation, env, unSdgNum, donateMethodId, donateMethodIds, };
|
|
4
4
|
import { type InferInput, type InferOutput } from "valibot";
|
|
5
5
|
export declare const str: import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>;
|
|
6
6
|
export declare const csv: 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">]>>;
|
|
@@ -23,9 +23,6 @@ export declare const segmentMaxChars = 30;
|
|
|
23
23
|
export declare const segment: 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">]>;
|
|
24
24
|
export declare const slug: 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">]>>;
|
|
25
25
|
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">]>;
|
|
26
|
-
export declare const donateMethodIds: readonly ["stripe", "crypto", "daf", "stocks"];
|
|
27
|
-
export declare const donateMethodId: import("valibot").PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], undefined>;
|
|
28
|
-
export type DonateMethodId = InferOutput<typeof donateMethodId>;
|
|
29
26
|
export declare const _url: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>;
|
|
30
27
|
export declare const httpsUrl: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").StartsWithAction<string, "https://", "should start with https://">, import("valibot").CustomSchema<string, "incomplete url">, import("valibot").UrlAction<string, "invalid url">]>;
|
|
31
28
|
export declare const maybeEmptyHttpsUrl: 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").StartsWithAction<string, "https://", "should start with https://">, import("valibot").CustomSchema<string, "incomplete url">, import("valibot").UrlAction<string, "invalid url">]>>;
|
|
@@ -43,12 +40,12 @@ export interface SocialMediaURLs extends InferOutput<typeof social_media_urls> {
|
|
|
43
40
|
export declare const MAX_RECEIPT_MSG_CHAR = 500;
|
|
44
41
|
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>]>;
|
|
45
42
|
export declare const MAX_NUM_INCREMENTS = 4;
|
|
46
|
-
export declare const incrementLabelMaxChars =
|
|
43
|
+
export declare const incrementLabelMaxChars = 30;
|
|
47
44
|
export declare const taglineMaxChars = 140;
|
|
48
|
-
export declare const incrementLabel: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string,
|
|
45
|
+
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>]>;
|
|
49
46
|
export declare const increment: import("valibot").ObjectSchema<{
|
|
50
47
|
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>]>;
|
|
51
|
-
readonly label: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string,
|
|
48
|
+
readonly label: 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>]>;
|
|
52
49
|
}, undefined>;
|
|
53
50
|
export interface Increment extends InferOutput<typeof increment> {
|
|
54
51
|
}
|
|
@@ -96,7 +93,7 @@ export declare const endowment: import("valibot").ObjectSchema<{
|
|
|
96
93
|
readonly donateMethods: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], undefined>, undefined>, never>;
|
|
97
94
|
readonly increments: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
98
95
|
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>]>;
|
|
99
|
-
readonly label: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string,
|
|
96
|
+
readonly label: 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>]>;
|
|
100
97
|
}, undefined>, undefined>, import("valibot").MaxLengthAction<{
|
|
101
98
|
value: string;
|
|
102
99
|
label: string;
|
|
@@ -152,7 +149,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
152
149
|
readonly donateMethods: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], undefined>, undefined>, never>;
|
|
153
150
|
readonly increments: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
154
151
|
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>]>;
|
|
155
|
-
readonly label: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string,
|
|
152
|
+
readonly label: 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>]>;
|
|
156
153
|
}, undefined>, undefined>, import("valibot").MaxLengthAction<{
|
|
157
154
|
value: string;
|
|
158
155
|
label: string;
|
|
@@ -208,7 +205,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
208
205
|
readonly donateMethods: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], undefined>, undefined>, never>;
|
|
209
206
|
readonly increments: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
210
207
|
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>]>;
|
|
211
|
-
readonly label: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string,
|
|
208
|
+
readonly label: 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>]>;
|
|
212
209
|
}, undefined>, undefined>, import("valibot").MaxLengthAction<{
|
|
213
210
|
value: string;
|
|
214
211
|
label: string;
|
|
@@ -224,7 +221,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
224
221
|
cash: number;
|
|
225
222
|
liq: number;
|
|
226
223
|
lock: number;
|
|
227
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").
|
|
224
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").StartsWithIssue<string, "https://"> | import("valibot").PicklistIssue | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 3 | 4 | 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<{
|
|
228
225
|
value: string;
|
|
229
226
|
label: string;
|
|
230
227
|
}[], 4> | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue>>): import("valibot").Dataset<{
|
|
@@ -271,7 +268,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
271
268
|
cash: number;
|
|
272
269
|
liq: number;
|
|
273
270
|
lock: number;
|
|
274
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").
|
|
271
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").StartsWithIssue<string, "https://"> | import("valibot").PicklistIssue | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 3 | 4 | 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<{
|
|
275
272
|
value: string;
|
|
276
273
|
label: string;
|
|
277
274
|
}[], 4> | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue>>;
|
|
@@ -362,7 +359,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
362
359
|
cash: number;
|
|
363
360
|
liq: number;
|
|
364
361
|
lock: number;
|
|
365
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").
|
|
362
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").StartsWithIssue<string, "https://"> | import("valibot").PicklistIssue | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 3 | 4 | 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<{
|
|
366
363
|
value: string;
|
|
367
364
|
label: string;
|
|
368
365
|
}[], 4> | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue>;
|
|
@@ -397,7 +394,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
397
394
|
readonly donateMethods: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], undefined>, undefined>, never>, never>;
|
|
398
395
|
readonly increments: import("valibot").OptionalSchema<import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
399
396
|
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>]>;
|
|
400
|
-
readonly label: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string,
|
|
397
|
+
readonly label: 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>]>;
|
|
401
398
|
}, undefined>, undefined>, import("valibot").MaxLengthAction<{
|
|
402
399
|
value: string;
|
|
403
400
|
label: string;
|
|
@@ -420,7 +417,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
420
417
|
cash: number;
|
|
421
418
|
liq: number;
|
|
422
419
|
lock: number;
|
|
423
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").
|
|
420
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").StartsWithIssue<string, "https://"> | import("valibot").PicklistIssue | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 3 | 4 | 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<{
|
|
424
421
|
value: string;
|
|
425
422
|
label: string;
|
|
426
423
|
}[], 4> | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue>>): import("valibot").Dataset<{
|
|
@@ -467,7 +464,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
467
464
|
cash: number;
|
|
468
465
|
liq: number;
|
|
469
466
|
lock: number;
|
|
470
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").
|
|
467
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").StartsWithIssue<string, "https://"> | import("valibot").PicklistIssue | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 3 | 4 | 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<{
|
|
471
468
|
value: string;
|
|
472
469
|
label: string;
|
|
473
470
|
}[], 4> | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue>>;
|
|
@@ -558,7 +555,7 @@ export declare const endowUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
558
555
|
cash: number;
|
|
559
556
|
liq: number;
|
|
560
557
|
lock: number;
|
|
561
|
-
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").
|
|
558
|
+
}> | import("valibot").MaxLengthIssue<string, 30> | import("valibot").ExcludesIssue<string, ".."> | import("valibot").CustomIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").StartsWithIssue<string, "https://"> | import("valibot").PicklistIssue | import("valibot").MaxLengthIssue<string, 140> | import("valibot").ArrayIssue | import("valibot").NonEmptyIssue<string[]> | import("valibot").MinLengthIssue<(2 | 1 | 3 | 4 | 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<{
|
|
562
559
|
value: string;
|
|
563
560
|
label: string;
|
|
564
561
|
}[], 4> | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue>;
|
package/dist/schema.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { env, orgDesignation, unSdgNum } from "@better-giving/schemas";
|
|
2
|
-
export { orgDesignation as endowDesignation, env, unSdgNum };
|
|
1
|
+
import { env, orgDesignation, unSdgNum, donateMethodId, donateMethodIds, } from "@better-giving/schemas";
|
|
2
|
+
export { orgDesignation as endowDesignation, env, unSdgNum, donateMethodId, donateMethodIds, };
|
|
3
3
|
import { url, array, base64, boolean, check, custom, excludes, filterItems, integer, isoTimestamp, keyof, lazy, literal, maxLength, maxValue, minLength, minValue, nonEmpty, nullish, number, object, omit, optional, partial, picklist, pipe, regex, startsWith, string, transform, trim, union, uuid, } from "valibot";
|
|
4
4
|
export const str = pipe(string(), trim());
|
|
5
5
|
export const csv = lazy((x) => {
|
|
@@ -24,8 +24,6 @@ regex(/^(?!^\d+$)/, "should not be an id"),
|
|
|
24
24
|
regex(/^[a-zA-Z0-9-._~]+$/, "allowed: numbers | letters | - | . | _ | ~"), excludes("..", "should not contain double periods"), custom((x) => !x.startsWith("."), "should not start with dot"), custom((x) => !x.endsWith("."), "should not end with dot"));
|
|
25
25
|
export const slug = lazy((x) => (x ? segment : str));
|
|
26
26
|
export const reg_number = pipe(str, nonEmpty("required"), regex(/^[a-zA-Z0-9]+$/, "must only contain letters and numbers"));
|
|
27
|
-
export const donateMethodIds = ["stripe", "crypto", "daf", "stocks"];
|
|
28
|
-
export const donateMethodId = picklist(donateMethodIds);
|
|
29
27
|
export const _url = pipe(str, url());
|
|
30
28
|
export const httpsUrl = pipe(str, startsWith("https://", "should start with https://"), custom((x) => x !== "https://", "incomplete url"), url("invalid url"));
|
|
31
29
|
export const maybeEmptyHttpsUrl = lazy((x) => {
|
|
@@ -47,7 +45,7 @@ export const incrementVal = pipe(str, nonEmpty("required"), transform((x) => +x)
|
|
|
47
45
|
//parsed output
|
|
48
46
|
transform((x) => x.toString()));
|
|
49
47
|
export const MAX_NUM_INCREMENTS = 4;
|
|
50
|
-
export const incrementLabelMaxChars =
|
|
48
|
+
export const incrementLabelMaxChars = 30;
|
|
51
49
|
export const taglineMaxChars = 140;
|
|
52
50
|
export const incrementLabel = pipe(str, maxLength(incrementLabelMaxChars, ({ requirement: r }) => `cannot exceed ${r} characters`));
|
|
53
51
|
export const increment = object({
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-giving/endowment",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@better-giving/schemas": "1.0.
|
|
6
|
-
"@better-giving/types": "1.0.
|
|
5
|
+
"@better-giving/schemas": "1.0.2",
|
|
6
|
+
"@better-giving/types": "1.0.2",
|
|
7
7
|
"valibot": "0.42.0"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
package/src/cloudsearch.mts
CHANGED
|
@@ -59,12 +59,14 @@ export const cloudsearchEndow = object({
|
|
|
59
59
|
export const cloudSearchEndowFields = keyof(cloudsearchEndow);
|
|
60
60
|
|
|
61
61
|
export const endowsQueryParams = object({
|
|
62
|
-
query: str,
|
|
63
|
-
page:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
query: optional(str),
|
|
63
|
+
page: optional(
|
|
64
|
+
pipe(
|
|
65
|
+
string(),
|
|
66
|
+
transform((x) => +x),
|
|
67
|
+
integer(),
|
|
68
|
+
minValue(1)
|
|
69
|
+
)
|
|
68
70
|
),
|
|
69
71
|
endow_designation: optional(pipe(csvStrs, array(orgDesignation))),
|
|
70
72
|
sdgs: optional(
|
|
@@ -81,9 +83,15 @@ export const endowsQueryParams = object({
|
|
|
81
83
|
fields: optional(pipe(csvStrs, array(cloudSearchEndowFields))),
|
|
82
84
|
});
|
|
83
85
|
|
|
86
|
+
export interface CloudsearchEndowsQueryParamsObj
|
|
87
|
+
extends InferInput<typeof endowsQueryParams> {}
|
|
88
|
+
|
|
84
89
|
export interface CloudsearchEndowsQueryParams
|
|
85
90
|
extends InferInput<typeof endowsQueryParams> {}
|
|
86
91
|
|
|
92
|
+
export interface CloudsearchEndowsQueryParamsParsed
|
|
93
|
+
extends InferOutput<typeof endowsQueryParams> {}
|
|
94
|
+
|
|
87
95
|
export interface CloudsearchEndow
|
|
88
96
|
extends InferOutput<typeof cloudsearchEndow> {}
|
|
89
97
|
|
package/src/index.mts
CHANGED
|
@@ -26,6 +26,7 @@ export type {
|
|
|
26
26
|
export type {
|
|
27
27
|
CloudsearchEndow as EndowItem,
|
|
28
28
|
CloudsearchEndowsQueryParams as EndowsQueryParams,
|
|
29
|
+
CloudsearchEndowsQueryParamsParsed as EndowsQueryParamsParsed,
|
|
29
30
|
} from "./cloudsearch.mjs";
|
|
30
31
|
|
|
31
32
|
/** client responsible on T depending on keys projected */
|
package/src/schema.mts
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
donateMethodId,
|
|
3
|
+
donateMethodIds,
|
|
4
|
+
env,
|
|
5
|
+
orgDesignation,
|
|
6
|
+
unSdgNum,
|
|
7
|
+
} from "@better-giving/schemas";
|
|
2
8
|
export type {
|
|
3
9
|
OrgDesignation as EndowDesignation,
|
|
4
10
|
Environment,
|
|
5
11
|
UnSdgNum,
|
|
12
|
+
DonateMethodId,
|
|
6
13
|
} from "@better-giving/schemas";
|
|
7
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
orgDesignation as endowDesignation,
|
|
16
|
+
env,
|
|
17
|
+
unSdgNum,
|
|
18
|
+
donateMethodId,
|
|
19
|
+
donateMethodIds,
|
|
20
|
+
};
|
|
8
21
|
import {
|
|
9
22
|
url,
|
|
10
23
|
type InferInput,
|
|
@@ -98,10 +111,6 @@ export const reg_number = pipe(
|
|
|
98
111
|
regex(/^[a-zA-Z0-9]+$/, "must only contain letters and numbers")
|
|
99
112
|
);
|
|
100
113
|
|
|
101
|
-
export const donateMethodIds = ["stripe", "crypto", "daf", "stocks"] as const;
|
|
102
|
-
export const donateMethodId = picklist(donateMethodIds);
|
|
103
|
-
export type DonateMethodId = InferOutput<typeof donateMethodId>;
|
|
104
|
-
|
|
105
114
|
export const _url = pipe(str, url());
|
|
106
115
|
|
|
107
116
|
export const httpsUrl = pipe(
|