@better-giving/fundraiser 1.0.8 → 1.0.9-bg758.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cloudsearch.d.mts +1 -1
- package/dist/schema.d.mts +14 -11
- package/dist/schema.mjs +7 -4
- package/package.json +1 -1
- package/src/cloudsearch.mts +1 -0
- package/src/schema.mts +6 -4
package/dist/cloudsearch.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToDoc, ToHitFields, ToUpdate } from "@better-giving/types/cloudsearch";
|
|
2
2
|
import type { FundInternal, NewFund } from "./schema.mjs";
|
|
3
|
-
export interface CloudsearchFund extends Pick<NewFund, "name" | "description" | "logo" | "banner" | "featured" | "members" | "target">, Pick<FundInternal, "id" | "env" | "active" | "verified" | "donation_total_usd" | "creator"> {
|
|
3
|
+
export interface CloudsearchFund extends Pick<NewFund, "name" | "description" | "logo" | "banner" | "featured" | "members" | "target" | "npo_owner">, Pick<FundInternal, "id" | "env" | "active" | "verified" | "donation_total_usd" | "creator"> {
|
|
4
4
|
/** iso | "9999-12-31T23:59:59.000Z" year 9999 */
|
|
5
5
|
expiration: string;
|
|
6
6
|
}
|
package/dist/schema.d.mts
CHANGED
|
@@ -3,8 +3,11 @@ 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
|
-
/**
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* when fundraiser is created in the context of an NPO, all members of that NPO can edit the fundraiser
|
|
8
|
+
* 0 - none
|
|
9
|
+
*/
|
|
10
|
+
export declare const npo_owner: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>;
|
|
8
11
|
export declare const newFund: import("valibot").ObjectSchema<{
|
|
9
12
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
10
13
|
readonly description: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
@@ -17,7 +20,7 @@ export declare const newFund: import("valibot").ObjectSchema<{
|
|
|
17
20
|
/** `"0"` - none, {"number"} = fixed */
|
|
18
21
|
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>;
|
|
19
22
|
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
|
|
23
|
+
readonly npo_owner: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>;
|
|
21
24
|
}, undefined>;
|
|
22
25
|
export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
23
26
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
@@ -31,7 +34,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
31
34
|
/** `"0"` - none, {"number"} = fixed */
|
|
32
35
|
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>;
|
|
33
36
|
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
|
|
37
|
+
readonly npo_owner: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>;
|
|
35
38
|
}, undefined>, "_types" | "_run" | "entries"> & {
|
|
36
39
|
readonly entries: Pick<{
|
|
37
40
|
readonly name: import("valibot").SchemaWithPipe<[import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>;
|
|
@@ -45,9 +48,9 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
45
48
|
/** `"0"` - none, {"number"} = fixed */
|
|
46
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>;
|
|
47
50
|
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
|
|
51
|
+
readonly npo_owner: import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>;
|
|
49
52
|
}, "name" | "description" | "banner" | "logo" | "target" | "videos" | "featured">;
|
|
50
|
-
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").
|
|
53
|
+
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue> | import("valibot").ObjectIssue>): import("valibot").Dataset<{
|
|
51
54
|
name: string;
|
|
52
55
|
description: string;
|
|
53
56
|
banner: string;
|
|
@@ -55,7 +58,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
55
58
|
target: string;
|
|
56
59
|
videos: string[];
|
|
57
60
|
featured: boolean;
|
|
58
|
-
}, import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").
|
|
61
|
+
}, import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue> | import("valibot").ObjectIssue>;
|
|
59
62
|
readonly _types?: {
|
|
60
63
|
readonly input: {
|
|
61
64
|
name: string;
|
|
@@ -75,7 +78,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
75
78
|
videos: string[];
|
|
76
79
|
featured: boolean;
|
|
77
80
|
};
|
|
78
|
-
readonly issue: import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").
|
|
81
|
+
readonly issue: import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue> | import("valibot").ObjectIssue;
|
|
79
82
|
} | undefined;
|
|
80
83
|
}, "_types" | "_run" | "entries"> & {
|
|
81
84
|
readonly entries: {
|
|
@@ -87,7 +90,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
87
90
|
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>;
|
|
88
91
|
readonly featured: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, never>;
|
|
89
92
|
};
|
|
90
|
-
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").
|
|
93
|
+
_run(dataset: import("valibot").Dataset<unknown, never>, config: import("valibot").Config<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue> | import("valibot").ObjectIssue>): import("valibot").Dataset<{
|
|
91
94
|
name?: string | undefined;
|
|
92
95
|
description?: string | undefined;
|
|
93
96
|
banner?: string | undefined;
|
|
@@ -95,7 +98,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
95
98
|
target?: string | undefined;
|
|
96
99
|
videos?: string[] | undefined;
|
|
97
100
|
featured?: boolean | undefined;
|
|
98
|
-
}, import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").
|
|
101
|
+
}, import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue> | import("valibot").ObjectIssue>;
|
|
99
102
|
readonly _types?: {
|
|
100
103
|
readonly input: {
|
|
101
104
|
name?: string | undefined;
|
|
@@ -115,7 +118,7 @@ export declare const fundUpdate: Omit<Omit<import("valibot").ObjectSchema<{
|
|
|
115
118
|
videos?: string[] | undefined;
|
|
116
119
|
featured?: boolean | undefined;
|
|
117
120
|
};
|
|
118
|
-
readonly issue: import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").
|
|
121
|
+
readonly issue: import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").NonEmptyIssue<string> | import("valibot").UrlIssue<string> | import("valibot").ArrayIssue | import("valibot").BooleanIssue | import("valibot").LiteralIssue | import("valibot").UnionIssue<import("valibot").StringIssue | import("valibot").NumberIssue | import("valibot").MinValueIssue<number, 0> | import("valibot").LiteralIssue> | import("valibot").ObjectIssue;
|
|
119
122
|
} | undefined;
|
|
120
123
|
};
|
|
121
124
|
export declare const fundsParams: import("valibot").ObjectSchema<{
|
package/dist/schema.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { url, array, boolean, integer, isoTimestamp, literal, maxLength, minValue, nonEmpty, number, object, optional, partial, pick, pipe, string, transform, trim, union, uuid,
|
|
1
|
+
import { url, array, boolean, integer, isoTimestamp, literal, maxLength, minValue, nonEmpty, number, object, optional, partial, pick, pipe, string, transform, trim, union, uuid, } from "valibot";
|
|
2
2
|
const str = pipe(string(), trim());
|
|
3
3
|
export const fundId = pipe(str, uuid());
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* when fundraiser is created in the context of an NPO, all members of that NPO can edit the fundraiser
|
|
6
|
+
* 0 - none
|
|
7
|
+
*/
|
|
8
|
+
export const npo_owner = pipe(number(), integer(), minValue(0));
|
|
6
9
|
export const newFund = object({
|
|
7
10
|
name: pipe(str, nonEmpty("required")),
|
|
8
11
|
description: pipe(str, nonEmpty("required")),
|
|
@@ -19,7 +22,7 @@ export const newFund = object({
|
|
|
19
22
|
pipe(string(), transform((v) => +v), number(), minValue(0), transform((v) => v.toString())),
|
|
20
23
|
]),
|
|
21
24
|
videos: array(pipe(str, url())),
|
|
22
|
-
|
|
25
|
+
npo_owner,
|
|
23
26
|
});
|
|
24
27
|
export const fundUpdate = partial(pick(newFund, [
|
|
25
28
|
"name",
|
package/package.json
CHANGED
package/src/cloudsearch.mts
CHANGED
package/src/schema.mts
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
type InferOutput,
|
|
7
7
|
array,
|
|
8
8
|
boolean,
|
|
9
|
-
email,
|
|
10
9
|
integer,
|
|
11
10
|
isoTimestamp,
|
|
12
11
|
literal,
|
|
@@ -29,8 +28,11 @@ import {
|
|
|
29
28
|
const str = pipe(string(), trim());
|
|
30
29
|
|
|
31
30
|
export const fundId = pipe(str, uuid());
|
|
32
|
-
/**
|
|
33
|
-
|
|
31
|
+
/**
|
|
32
|
+
* when fundraiser is created in the context of an NPO, all members of that NPO can edit the fundraiser
|
|
33
|
+
* 0 - none
|
|
34
|
+
*/
|
|
35
|
+
export const npo_owner = pipe(number(), integer(), minValue(0));
|
|
34
36
|
|
|
35
37
|
export const newFund = object({
|
|
36
38
|
name: pipe(str, nonEmpty("required")),
|
|
@@ -63,7 +65,7 @@ export const newFund = object({
|
|
|
63
65
|
),
|
|
64
66
|
]),
|
|
65
67
|
videos: array(pipe(str, url())),
|
|
66
|
-
|
|
68
|
+
npo_owner,
|
|
67
69
|
});
|
|
68
70
|
|
|
69
71
|
export const fundUpdate = partial(
|