@better-giving/fundraiser 1.0.0-rc.5 → 1.0.0-rc.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 +15 -14
- package/dist/schema.mjs +6 -3
- package/package.json +3 -6
- package/src/schema.mts +19 -2
package/dist/schema.d.mts
CHANGED
|
@@ -16,7 +16,7 @@ export declare const newFund: import("valibot").ObjectSchema<{
|
|
|
16
16
|
readonly allowBgTip: import("valibot").BooleanSchema<undefined>;
|
|
17
17
|
}, undefined>;
|
|
18
18
|
/** `"0"` - none, {"number"} = fixed */
|
|
19
|
-
readonly target: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"smart", undefined>, import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, undefined>, import("valibot").TransformAction<number, string>]>], undefined>;
|
|
19
|
+
readonly target: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"smart", undefined>, import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TransformAction<string, number>, import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, undefined>, import("valibot").TransformAction<number, string>]>], undefined>;
|
|
20
20
|
}, undefined>;
|
|
21
21
|
export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
22
22
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
@@ -31,7 +31,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
31
31
|
readonly allowBgTip: import("valibot").BooleanSchema<undefined>;
|
|
32
32
|
}, undefined>;
|
|
33
33
|
/** `"0"` - none, {"number"} = fixed */
|
|
34
|
-
readonly target: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"smart", undefined>, import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, undefined>, import("valibot").TransformAction<number, string>]>], undefined>;
|
|
34
|
+
readonly target: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"smart", undefined>, import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TransformAction<string, number>, import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, undefined>, import("valibot").TransformAction<number, string>]>], undefined>;
|
|
35
35
|
}, undefined>, "_types" | "_run" | "entries"> & {
|
|
36
36
|
readonly entries: Pick<{
|
|
37
37
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
@@ -46,23 +46,23 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
46
46
|
readonly allowBgTip: import("valibot").BooleanSchema<undefined>;
|
|
47
47
|
}, undefined>;
|
|
48
48
|
/** `"0"` - none, {"number"} = fixed */
|
|
49
|
-
readonly target: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"smart", undefined>, import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, undefined>, import("valibot").TransformAction<number, string>]>], undefined>;
|
|
49
|
+
readonly target: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"smart", undefined>, import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TransformAction<string, number>, import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, undefined>, import("valibot").TransformAction<number, string>]>], undefined>;
|
|
50
50
|
}, "name" | "description" | "banner" | "logo" | "target" | "featured">;
|
|
51
|
-
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>>): import("valibot").Dataset<{
|
|
51
|
+
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>>): import("valibot").Dataset<{
|
|
52
52
|
name: string;
|
|
53
53
|
description: string;
|
|
54
54
|
banner: string;
|
|
55
55
|
logo: string;
|
|
56
56
|
target: string;
|
|
57
57
|
featured: boolean;
|
|
58
|
-
}, import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>>;
|
|
58
|
+
}, import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>>;
|
|
59
59
|
readonly _types?: {
|
|
60
60
|
readonly input: {
|
|
61
61
|
name: string;
|
|
62
62
|
description: string;
|
|
63
63
|
banner: string;
|
|
64
64
|
logo: string;
|
|
65
|
-
target:
|
|
65
|
+
target: string;
|
|
66
66
|
featured: boolean;
|
|
67
67
|
};
|
|
68
68
|
readonly output: {
|
|
@@ -73,7 +73,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
73
73
|
target: string;
|
|
74
74
|
featured: boolean;
|
|
75
75
|
};
|
|
76
|
-
readonly issue: import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>;
|
|
76
|
+
readonly issue: import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>;
|
|
77
77
|
} | undefined;
|
|
78
78
|
}, "_types" | "_run" | "entries"> & {
|
|
79
79
|
readonly entries: {
|
|
@@ -81,24 +81,24 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
81
81
|
readonly description: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>, never>;
|
|
82
82
|
readonly banner: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
83
83
|
readonly logo: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, never>;
|
|
84
|
-
readonly target: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("valibot").LiteralSchema<"smart", undefined>, import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, undefined>, import("valibot").TransformAction<number, string>]>], undefined>, never>;
|
|
84
|
+
readonly target: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("valibot").LiteralSchema<"smart", undefined>, import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TransformAction<string, number>, import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, undefined>, import("valibot").TransformAction<number, string>]>], undefined>, never>;
|
|
85
85
|
readonly featured: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, never>;
|
|
86
86
|
};
|
|
87
|
-
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>>): import("valibot").Dataset<{
|
|
87
|
+
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>>): import("valibot").Dataset<{
|
|
88
88
|
name?: string | undefined;
|
|
89
89
|
description?: string | undefined;
|
|
90
90
|
banner?: string | undefined;
|
|
91
91
|
logo?: string | undefined;
|
|
92
92
|
target?: string | undefined;
|
|
93
93
|
featured?: boolean | undefined;
|
|
94
|
-
}, import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>>;
|
|
94
|
+
}, import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>>;
|
|
95
95
|
readonly _types?: {
|
|
96
96
|
readonly input: {
|
|
97
97
|
name?: string | undefined;
|
|
98
98
|
description?: string | undefined;
|
|
99
99
|
banner?: string | undefined;
|
|
100
100
|
logo?: string | undefined;
|
|
101
|
-
target?:
|
|
101
|
+
target?: string | undefined;
|
|
102
102
|
featured?: boolean | undefined;
|
|
103
103
|
};
|
|
104
104
|
readonly output: {
|
|
@@ -109,16 +109,17 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
109
109
|
target?: string | undefined;
|
|
110
110
|
featured?: boolean | undefined;
|
|
111
111
|
};
|
|
112
|
-
readonly issue: import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>;
|
|
112
|
+
readonly issue: import("valibot").StringIssue | import("valibot").BooleanIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").NumberIssue | import("valibot").ObjectIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").LiteralIssue | import("valibot").MinValueIssue<number, 0>>;
|
|
113
113
|
} | undefined;
|
|
114
114
|
};
|
|
115
115
|
export declare const fundsParams: import("valibot").ObjectSchema<{
|
|
116
116
|
/** search text */
|
|
117
117
|
readonly query: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, never>;
|
|
118
|
-
|
|
118
|
+
/** input str: from url */
|
|
119
|
+
readonly page: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").TransformAction<string, number>, import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>, never>;
|
|
119
120
|
}, undefined>;
|
|
120
121
|
export declare const fundsEndowMemberOfParams: import("valibot").ObjectSchema<{
|
|
121
|
-
readonly npoProfileFeatured: import("valibot").BooleanSchema<undefined>;
|
|
122
|
+
readonly npoProfileFeatured: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").TransformAction<string, boolean>, import("valibot").BooleanSchema<undefined>]>;
|
|
122
123
|
}, undefined>;
|
|
123
124
|
export interface NewFund extends InferOutput<typeof newFund> {
|
|
124
125
|
}
|
package/dist/schema.mjs
CHANGED
|
@@ -18,14 +18,15 @@ export const newFund = object({
|
|
|
18
18
|
/** `"0"` - none, {"number"} = fixed */
|
|
19
19
|
target: union([
|
|
20
20
|
literal("smart"),
|
|
21
|
-
pipe(number(), minValue(0), transform((v) => v.toString())),
|
|
21
|
+
pipe(string(), transform((v) => +v), number(), minValue(0), transform((v) => v.toString())),
|
|
22
22
|
]),
|
|
23
23
|
});
|
|
24
24
|
export const fundUpdate = partial(pick(newFund, ["name", "description", "banner", "logo", "featured", "target"]));
|
|
25
25
|
export const fundsParams = object({
|
|
26
26
|
/** search text */
|
|
27
27
|
query: optional(str),
|
|
28
|
-
|
|
28
|
+
/** input str: from url */
|
|
29
|
+
page: optional(pipe(str, transform(x => +x), number(), integer(), minValue(1))),
|
|
29
30
|
});
|
|
30
31
|
export const fundsEndowMemberOfParams = object({
|
|
31
32
|
/*
|
|
@@ -33,6 +34,8 @@ export const fundsEndowMemberOfParams = object({
|
|
|
33
34
|
* and is approved:
|
|
34
35
|
* either pre-approval in creation (creator has endow credential)
|
|
35
36
|
* or creator has no credential but later npo approved
|
|
37
|
+
*
|
|
38
|
+
* input str: from url
|
|
36
39
|
*/
|
|
37
|
-
npoProfileFeatured: boolean(),
|
|
40
|
+
npoProfileFeatured: pipe(str, transform(x => x === "true"), boolean()),
|
|
38
41
|
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-giving/fundraiser",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"@better-giving/types": "1.0.0-rc.2",
|
|
6
|
-
"valibot": "0.42.0"
|
|
7
|
-
},
|
|
3
|
+
"version": "1.0.0-rc.7",
|
|
8
4
|
"peerDependencies": {
|
|
5
|
+
"@better-giving/types": "1.0.0-rc.2",
|
|
9
6
|
"valibot": "0.42.0"
|
|
10
7
|
},
|
|
11
8
|
"devDependencies": {
|
|
@@ -23,7 +20,7 @@
|
|
|
23
20
|
},
|
|
24
21
|
"scripts": {
|
|
25
22
|
"publish": "npm publish --access public",
|
|
26
|
-
"build": "
|
|
23
|
+
"build": "tsc --outDir dist",
|
|
27
24
|
"type-chek": "tsc --noEmit"
|
|
28
25
|
}
|
|
29
26
|
}
|
package/src/schema.mts
CHANGED
|
@@ -49,6 +49,8 @@ export const newFund = object({
|
|
|
49
49
|
target: union([
|
|
50
50
|
literal("smart"),
|
|
51
51
|
pipe(
|
|
52
|
+
string(),
|
|
53
|
+
transform((v) => +v),
|
|
52
54
|
number(),
|
|
53
55
|
minValue(0),
|
|
54
56
|
transform((v) => v.toString())
|
|
@@ -63,7 +65,16 @@ export const fundUpdate = partial(
|
|
|
63
65
|
export const fundsParams = object({
|
|
64
66
|
/** search text */
|
|
65
67
|
query: optional(str),
|
|
66
|
-
|
|
68
|
+
/** input str: from url */
|
|
69
|
+
page: optional(
|
|
70
|
+
pipe(
|
|
71
|
+
str,
|
|
72
|
+
transform((x) => +x),
|
|
73
|
+
number(),
|
|
74
|
+
integer(),
|
|
75
|
+
minValue(1)
|
|
76
|
+
)
|
|
77
|
+
),
|
|
67
78
|
});
|
|
68
79
|
|
|
69
80
|
export const fundsEndowMemberOfParams = object({
|
|
@@ -72,8 +83,14 @@ export const fundsEndowMemberOfParams = object({
|
|
|
72
83
|
* and is approved:
|
|
73
84
|
* either pre-approval in creation (creator has endow credential)
|
|
74
85
|
* or creator has no credential but later npo approved
|
|
86
|
+
*
|
|
87
|
+
* input str: from url
|
|
75
88
|
*/
|
|
76
|
-
npoProfileFeatured:
|
|
89
|
+
npoProfileFeatured: pipe(
|
|
90
|
+
str,
|
|
91
|
+
transform((x) => x === "true"),
|
|
92
|
+
boolean()
|
|
93
|
+
),
|
|
77
94
|
});
|
|
78
95
|
|
|
79
96
|
export interface NewFund extends InferOutput<typeof newFund> {}
|