@better-giving/fundraiser 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 +11 -6
- package/dist/schema.mjs +4 -1
- package/package.json +1 -1
- package/src/schema.mts +4 -0
package/dist/schema.d.mts
CHANGED
|
@@ -3,6 +3,8 @@ import type { Environment } from "@better-giving/types/list";
|
|
|
3
3
|
export type { Environment } from "@better-giving/types/list";
|
|
4
4
|
import { type InferOutput } from "valibot";
|
|
5
5
|
export declare const fundId: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UuidAction<string, undefined>]>;
|
|
6
|
+
/** when fundraiser is created in the context of an NPO, all members of that NPO can edit the fundraiser */
|
|
7
|
+
export declare const npoOwner: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>;
|
|
6
8
|
export declare const newFund: import("valibot").ObjectSchema<{
|
|
7
9
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
8
10
|
readonly description: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
@@ -15,6 +17,7 @@ export declare const newFund: import("valibot").ObjectSchema<{
|
|
|
15
17
|
/** `"0"` - none, {"number"} = fixed */
|
|
16
18
|
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>;
|
|
17
19
|
readonly videos: import("valibot").ArraySchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, undefined>;
|
|
20
|
+
readonly npoOwner: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>, never>;
|
|
18
21
|
}, undefined>;
|
|
19
22
|
export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
20
23
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
@@ -28,6 +31,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
28
31
|
/** `"0"` - none, {"number"} = fixed */
|
|
29
32
|
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>;
|
|
30
33
|
readonly videos: import("valibot").ArraySchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, undefined>;
|
|
34
|
+
readonly npoOwner: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>, never>;
|
|
31
35
|
}, undefined>, "_types" | "_run" | "entries"> & {
|
|
32
36
|
readonly entries: Pick<{
|
|
33
37
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
@@ -41,8 +45,9 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
41
45
|
/** `"0"` - none, {"number"} = fixed */
|
|
42
46
|
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>;
|
|
43
47
|
readonly videos: import("valibot").ArraySchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, undefined>;
|
|
48
|
+
readonly npoOwner: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>]>, never>;
|
|
44
49
|
}, "name" | "description" | "banner" | "logo" | "target" | "videos" | "featured">;
|
|
45
|
-
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").
|
|
50
|
+
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | 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").ObjectIssue>): import("valibot").Dataset<{
|
|
46
51
|
name: string;
|
|
47
52
|
description: string;
|
|
48
53
|
banner: string;
|
|
@@ -50,7 +55,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
50
55
|
target: string;
|
|
51
56
|
videos: string[];
|
|
52
57
|
featured: boolean;
|
|
53
|
-
}, import("valibot").StringIssue | import("valibot").
|
|
58
|
+
}, import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | 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").ObjectIssue>;
|
|
54
59
|
readonly _types?: {
|
|
55
60
|
readonly input: {
|
|
56
61
|
name: string;
|
|
@@ -70,7 +75,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
70
75
|
videos: string[];
|
|
71
76
|
featured: boolean;
|
|
72
77
|
};
|
|
73
|
-
readonly issue: import("valibot").StringIssue | import("valibot").
|
|
78
|
+
readonly issue: import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | 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").ObjectIssue;
|
|
74
79
|
} | undefined;
|
|
75
80
|
}, "_types" | "_run" | "entries"> & {
|
|
76
81
|
readonly entries: {
|
|
@@ -82,7 +87,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
82
87
|
readonly videos: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").UrlAction<string, undefined>]>, undefined>, never>;
|
|
83
88
|
readonly featured: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, never>;
|
|
84
89
|
};
|
|
85
|
-
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").
|
|
90
|
+
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | 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").ObjectIssue>): import("valibot").Dataset<{
|
|
86
91
|
name?: string | undefined;
|
|
87
92
|
description?: string | undefined;
|
|
88
93
|
banner?: string | undefined;
|
|
@@ -90,7 +95,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
90
95
|
target?: string | undefined;
|
|
91
96
|
videos?: string[] | undefined;
|
|
92
97
|
featured?: boolean | undefined;
|
|
93
|
-
}, import("valibot").StringIssue | import("valibot").
|
|
98
|
+
}, import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | 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").ObjectIssue>;
|
|
94
99
|
readonly _types?: {
|
|
95
100
|
readonly input: {
|
|
96
101
|
name?: string | undefined;
|
|
@@ -110,7 +115,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
110
115
|
videos?: string[] | undefined;
|
|
111
116
|
featured?: boolean | undefined;
|
|
112
117
|
};
|
|
113
|
-
readonly issue: import("valibot").StringIssue | import("valibot").
|
|
118
|
+
readonly issue: import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | 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").ObjectIssue;
|
|
114
119
|
} | undefined;
|
|
115
120
|
};
|
|
116
121
|
export declare const fundsParams: import("valibot").ObjectSchema<{
|
package/dist/schema.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { url, array, boolean, integer, isoTimestamp, literal, maxLength, minValue, nonEmpty, number, object, optional, partial, pick, pipe, string, transform, trim, union, uuid, } from "valibot";
|
|
1
|
+
import { url, array, boolean, integer, isoTimestamp, literal, maxLength, minValue, nonEmpty, number, object, optional, partial, pick, pipe, string, transform, trim, union, uuid, email, } from "valibot";
|
|
2
2
|
const str = pipe(string(), trim());
|
|
3
3
|
export const fundId = pipe(str, uuid());
|
|
4
|
+
/** when fundraiser is created in the context of an NPO, all members of that NPO can edit the fundraiser */
|
|
5
|
+
export const npoOwner = pipe(number(), integer(), minValue(1));
|
|
4
6
|
export const newFund = object({
|
|
5
7
|
name: pipe(str, nonEmpty("required")),
|
|
6
8
|
description: pipe(str, nonEmpty("required")),
|
|
@@ -17,6 +19,7 @@ export const newFund = object({
|
|
|
17
19
|
pipe(string(), transform((v) => +v), number(), minValue(0), transform((v) => v.toString())),
|
|
18
20
|
]),
|
|
19
21
|
videos: array(pipe(str, url())),
|
|
22
|
+
npoOwner: optional(npoOwner),
|
|
20
23
|
});
|
|
21
24
|
export const fundUpdate = partial(pick(newFund, [
|
|
22
25
|
"name",
|
package/package.json
CHANGED
package/src/schema.mts
CHANGED
|
@@ -23,11 +23,14 @@ import {
|
|
|
23
23
|
trim,
|
|
24
24
|
union,
|
|
25
25
|
uuid,
|
|
26
|
+
email,
|
|
26
27
|
} from "valibot";
|
|
27
28
|
|
|
28
29
|
const str = pipe(string(), trim());
|
|
29
30
|
|
|
30
31
|
export const fundId = pipe(str, uuid());
|
|
32
|
+
/** when fundraiser is created in the context of an NPO, all members of that NPO can edit the fundraiser */
|
|
33
|
+
export const npoOwner = pipe(number(), integer(), minValue(1));
|
|
31
34
|
|
|
32
35
|
export const newFund = object({
|
|
33
36
|
name: pipe(str, nonEmpty("required")),
|
|
@@ -60,6 +63,7 @@ export const newFund = object({
|
|
|
60
63
|
),
|
|
61
64
|
]),
|
|
62
65
|
videos: array(pipe(str, url())),
|
|
66
|
+
npoOwner: optional(npoOwner),
|
|
63
67
|
});
|
|
64
68
|
|
|
65
69
|
export const fundUpdate = partial(
|