@better-giving/fundraiser 3.0.30 → 3.0.32
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/db.d.mts +26 -24
- package/dist/db.mjs +1 -4
- package/dist/index.d.mts +1 -1
- package/dist/schema.mjs +1 -1
- package/package.json +2 -2
- package/src/db.mts +4 -5
- package/src/index.mts +1 -1
- package/src/schema.mts +1 -1
package/dist/db.d.mts
CHANGED
|
@@ -5,35 +5,35 @@ export declare class FundDb extends Db {
|
|
|
5
5
|
static readonly table = "funds";
|
|
6
6
|
static readonly slug_env_gsi = "slug-env-gsi";
|
|
7
7
|
key_fund(id: string): {
|
|
8
|
-
PK: string
|
|
9
|
-
SK: string
|
|
8
|
+
readonly PK: `Fund#${string}`;
|
|
9
|
+
readonly SK: `Fund#${string}`;
|
|
10
10
|
};
|
|
11
11
|
fund_record(data: IFund): {
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
banner: string;
|
|
15
|
-
logo: string;
|
|
16
|
-
members: number[];
|
|
17
|
-
videos: string[];
|
|
18
|
-
featured: boolean;
|
|
19
|
-
target: string;
|
|
20
|
-
npo_owner: number;
|
|
21
|
-
expiration?: string | undefined;
|
|
22
|
-
increments?: {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly banner: string;
|
|
15
|
+
readonly logo: string;
|
|
16
|
+
readonly members: number[];
|
|
17
|
+
readonly videos: string[];
|
|
18
|
+
readonly featured: boolean;
|
|
19
|
+
readonly target: string;
|
|
20
|
+
readonly npo_owner: number;
|
|
21
|
+
readonly expiration?: string | undefined;
|
|
22
|
+
readonly increments?: {
|
|
23
23
|
value: string;
|
|
24
24
|
label: string;
|
|
25
25
|
}[] | undefined;
|
|
26
|
-
slug?: string | undefined;
|
|
27
|
-
id: string;
|
|
28
|
-
env: import("@better-giving/schemas").Environment;
|
|
29
|
-
active: boolean;
|
|
30
|
-
verified: boolean;
|
|
31
|
-
donation_total_usd: number;
|
|
32
|
-
settings: import("./interfaces.mjs").IFundSettings;
|
|
33
|
-
creator_id: string;
|
|
34
|
-
creator_name: string;
|
|
35
|
-
PK: string
|
|
36
|
-
SK: string
|
|
26
|
+
readonly slug?: string | undefined;
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly env: import("@better-giving/schemas").Environment;
|
|
29
|
+
readonly active: boolean;
|
|
30
|
+
readonly verified: boolean;
|
|
31
|
+
readonly donation_total_usd: number;
|
|
32
|
+
readonly settings: import("./interfaces.mjs").IFundSettings;
|
|
33
|
+
readonly creator_id: string;
|
|
34
|
+
readonly creator_name: string;
|
|
35
|
+
readonly PK: `Fund#${string}`;
|
|
36
|
+
readonly SK: `Fund#${string}`;
|
|
37
37
|
};
|
|
38
38
|
fund_put_txi(data: IFund): TxType["Put"];
|
|
39
39
|
/**@param id - slug or uuid */
|
|
@@ -42,3 +42,5 @@ export declare class FundDb extends Db {
|
|
|
42
42
|
fund_update(id: string, { target, slug, ...update }: IFundUpdate): Promise<Record<string, any>>;
|
|
43
43
|
fund_close(fund: string): Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
|
|
44
44
|
}
|
|
45
|
+
export interface IFundDb extends ReturnType<FundDb["fund_record"]> {
|
|
46
|
+
}
|
package/dist/db.mjs
CHANGED
|
@@ -5,10 +5,7 @@ export class FundDb extends Db {
|
|
|
5
5
|
static table = "funds";
|
|
6
6
|
static slug_env_gsi = "slug-env-gsi";
|
|
7
7
|
key_fund(id) {
|
|
8
|
-
return {
|
|
9
|
-
PK: `Fund#${id}`,
|
|
10
|
-
SK: `Fund#${id}`,
|
|
11
|
-
};
|
|
8
|
+
return { PK: `Fund#${id}`, SK: `Fund#${id}` };
|
|
12
9
|
}
|
|
13
10
|
fund_record(data) {
|
|
14
11
|
return {
|
package/dist/index.d.mts
CHANGED
package/dist/schema.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $, $int_gte1,
|
|
1
|
+
import { $, $int_gte1, MAX_NUM_INCREMENTS, increment, slug, target, } from "@better-giving/schemas";
|
|
2
2
|
import { url, array, boolean, integer, isoTimestamp, maxLength, minValue, nonEmpty, number, object, optional, partial, pick, pipe, transform, uuid, } from "valibot";
|
|
3
3
|
export { slug } from "@better-giving/schemas";
|
|
4
4
|
export const fund_id = pipe($, uuid());
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-giving/fundraiser",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.32",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"valibot": "0.42.0",
|
|
6
6
|
"@better-giving/schemas": "2.0.4",
|
|
7
7
|
"@better-giving/types": "1.1.8",
|
|
8
|
-
"@better-giving/db": "2.0.
|
|
8
|
+
"@better-giving/db": "2.0.7",
|
|
9
9
|
"@aws-sdk/lib-dynamodb": "3.485.0"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
package/src/db.mts
CHANGED
|
@@ -18,16 +18,13 @@ export class FundDb extends Db {
|
|
|
18
18
|
static readonly table = "funds";
|
|
19
19
|
static readonly slug_env_gsi = "slug-env-gsi";
|
|
20
20
|
key_fund(id: string) {
|
|
21
|
-
return {
|
|
22
|
-
PK: `Fund#${id}`,
|
|
23
|
-
SK: `Fund#${id}`,
|
|
24
|
-
};
|
|
21
|
+
return { PK: `Fund#${id}`, SK: `Fund#${id}` } as const;
|
|
25
22
|
}
|
|
26
23
|
fund_record(data: IFund) {
|
|
27
24
|
return {
|
|
28
25
|
...this.key_fund(data.id),
|
|
29
26
|
...data,
|
|
30
|
-
};
|
|
27
|
+
} as const;
|
|
31
28
|
}
|
|
32
29
|
fund_put_txi(data: IFund): TxType["Put"] {
|
|
33
30
|
return {
|
|
@@ -112,3 +109,5 @@ export class FundDb extends Db {
|
|
|
112
109
|
return this.client.send(command);
|
|
113
110
|
}
|
|
114
111
|
}
|
|
112
|
+
|
|
113
|
+
export interface IFundDb extends ReturnType<FundDb["fund_record"]> {}
|
package/src/index.mts
CHANGED