@better-giving/fundraiser 7.0.1 → 7.1.0
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 +1 -0
- package/dist/db.mjs +7 -0
- package/dist/interfaces.d.mts +1 -1
- package/package.json +1 -1
- package/src/db.mts +8 -0
- package/src/interfaces.mts +1 -1
package/dist/db.d.mts
CHANGED
|
@@ -48,6 +48,7 @@ export declare class FundDb extends Db {
|
|
|
48
48
|
fund(id: string): Promise<IFund | undefined>;
|
|
49
49
|
funds_get(ids: string[]): Promise<IFund[]>;
|
|
50
50
|
funds(opts: IFundsPageOpts): Promise<import("@better-giving/types/api").IPageKeyed<IFund>>;
|
|
51
|
+
fund_delete(id: string): Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
|
|
51
52
|
fund_update(id: string, { target, slug, ...update }: IFundUpdate): Promise<Record<string, any>>;
|
|
52
53
|
fund_contrib_update_txi(id: string, amount: number): TxType["Update"];
|
|
53
54
|
fund_close(fund: string): Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
|
package/dist/db.mjs
CHANGED
|
@@ -74,6 +74,13 @@ export class FundDb extends Db {
|
|
|
74
74
|
});
|
|
75
75
|
return this.client.send(cmd).then((this.to_page));
|
|
76
76
|
}
|
|
77
|
+
async fund_delete(id) {
|
|
78
|
+
const command = new UpdateCommand({
|
|
79
|
+
TableName: FundDb.table,
|
|
80
|
+
Key: this.key_fund(id),
|
|
81
|
+
});
|
|
82
|
+
return this.client.send(command);
|
|
83
|
+
}
|
|
77
84
|
async fund_update(id, { target, slug, ...update }) {
|
|
78
85
|
const updates = new UpdateBuilder();
|
|
79
86
|
if (slug)
|
package/dist/interfaces.d.mts
CHANGED
|
@@ -31,7 +31,7 @@ export interface IFundItem extends Pick<IFundNew, "name" | "description" | "logo
|
|
|
31
31
|
expiration: number;
|
|
32
32
|
members_csv: string;
|
|
33
33
|
}
|
|
34
|
-
export interface IFundItemsPage extends IPageNumbered<
|
|
34
|
+
export interface IFundItemsPage extends IPageNumbered<IFundItem> {
|
|
35
35
|
}
|
|
36
36
|
export interface IFundsPageOpts {
|
|
37
37
|
limit?: number;
|
package/package.json
CHANGED
package/src/db.mts
CHANGED
|
@@ -91,6 +91,14 @@ export class FundDb extends Db {
|
|
|
91
91
|
return this.client.send(cmd).then(this.to_page<IFund>);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
async fund_delete(id: string) {
|
|
95
|
+
const command = new UpdateCommand({
|
|
96
|
+
TableName: FundDb.table,
|
|
97
|
+
Key: this.key_fund(id),
|
|
98
|
+
});
|
|
99
|
+
return this.client.send(command);
|
|
100
|
+
}
|
|
101
|
+
|
|
94
102
|
async fund_update(id: string, { target, slug, ...update }: IFundUpdate) {
|
|
95
103
|
const updates = new UpdateBuilder();
|
|
96
104
|
|
package/src/interfaces.mts
CHANGED
|
@@ -56,7 +56,7 @@ export interface IFundItem
|
|
|
56
56
|
members_csv: string;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export interface IFundItemsPage extends IPageNumbered<
|
|
59
|
+
export interface IFundItemsPage extends IPageNumbered<IFundItem> {}
|
|
60
60
|
export interface IFundsPageOpts {
|
|
61
61
|
limit?: number;
|
|
62
62
|
next?: string;
|