@better-giving/fundraiser 1.0.9 → 1.0.11
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 +2 -2
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -1
- package/dist/schema.d.mts +17 -13
- package/dist/schema.mjs +7 -4
- package/package.json +23 -23
- package/src/cloudsearch.mts +8 -3
- package/src/index.mts +2 -0
- package/src/schema.mts +9 -6
package/dist/cloudsearch.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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"
|
|
4
|
-
/** iso | "9999-12-31T23:59:
|
|
3
|
+
export interface CloudsearchFund extends Pick<NewFund, "name" | "description" | "logo" | "banner" | "featured" | "members" | "target">, Pick<FundInternal, "id" | "env" | "active" | "verified" | "donation_total_usd" | "creator_id" | "creator_name"> {
|
|
4
|
+
/** iso | "9999-12-31T23:59:59Z" year 9999 */
|
|
5
5
|
expiration: string;
|
|
6
6
|
}
|
|
7
7
|
/** uuidv4 */
|
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const MAX_EXPIRATION = "9999-12-31T23:59:59Z";
|
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<{
|
|
@@ -148,7 +151,8 @@ export interface FundInternal {
|
|
|
148
151
|
verified: boolean;
|
|
149
152
|
/** to date received: initialized to `0` */
|
|
150
153
|
donation_total_usd: number;
|
|
151
|
-
/**
|
|
152
|
-
|
|
154
|
+
/** "{number}" - endow id, "{email} - user*/
|
|
155
|
+
creator_id: string;
|
|
156
|
+
creator_name: string;
|
|
153
157
|
settings: FundSettings;
|
|
154
158
|
}
|
package/dist/schema.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { url, array, boolean,
|
|
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
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
"name": "@better-giving/fundraiser",
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@better-giving/schemas": "1.0.2",
|
|
6
|
+
"@better-giving/types": "1.0.5"
|
|
7
|
+
},
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@better-giving/config": "workspace:*"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"src",
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./dist/index.mjs",
|
|
17
|
+
"./schema": "./dist/schema.mjs",
|
|
18
|
+
"./db": "./dist/db.mjs",
|
|
19
|
+
"./cloudsearch": "./dist/cloudsearch.mjs"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"publish": "npm publish --access public",
|
|
23
|
+
"build": "tsc --outDir dist"
|
|
24
|
+
}
|
|
25
25
|
}
|
package/src/cloudsearch.mts
CHANGED
|
@@ -15,13 +15,18 @@ export interface CloudsearchFund
|
|
|
15
15
|
| "featured"
|
|
16
16
|
| "members"
|
|
17
17
|
| "target"
|
|
18
|
-
| "npoOwner"
|
|
19
18
|
>,
|
|
20
19
|
Pick<
|
|
21
20
|
FundInternal,
|
|
22
|
-
|
|
21
|
+
| "id"
|
|
22
|
+
| "env"
|
|
23
|
+
| "active"
|
|
24
|
+
| "verified"
|
|
25
|
+
| "donation_total_usd"
|
|
26
|
+
| "creator_id"
|
|
27
|
+
| "creator_name"
|
|
23
28
|
> {
|
|
24
|
-
/** iso | "9999-12-31T23:59:
|
|
29
|
+
/** iso | "9999-12-31T23:59:59Z" year 9999 */
|
|
25
30
|
expiration: string;
|
|
26
31
|
}
|
|
27
32
|
|
package/src/index.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(
|
|
@@ -131,7 +133,8 @@ export interface FundInternal {
|
|
|
131
133
|
verified: boolean;
|
|
132
134
|
/** to date received: initialized to `0` */
|
|
133
135
|
donation_total_usd: number;
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
+
/** "{number}" - endow id, "{email} - user*/
|
|
137
|
+
creator_id: string;
|
|
138
|
+
creator_name: string;
|
|
136
139
|
settings: FundSettings;
|
|
137
140
|
}
|