@better-giving/fundraiser 3.0.8 → 3.0.10
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 +11 -0
- package/dist/index.d.mts +1 -0
- package/package.json +1 -1
- package/src/db.mts +13 -0
- package/src/index.mts +1 -0
package/dist/db.d.mts
CHANGED
|
@@ -35,4 +35,5 @@ export declare class FundDb extends Db {
|
|
|
35
35
|
/**@param id - slug or uuid */
|
|
36
36
|
fund(id: string): Promise<IFund | undefined>;
|
|
37
37
|
fund_edit(id: string, { target, slug, ...update }: IFundUpdate): Promise<Record<string, any>>;
|
|
38
|
+
fund_close(fund: string): Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
|
|
38
39
|
}
|
package/dist/db.mjs
CHANGED
|
@@ -65,4 +65,15 @@ export class FundDb extends Db {
|
|
|
65
65
|
});
|
|
66
66
|
return this.client.send(command).then((res) => res.Attributes ?? {});
|
|
67
67
|
}
|
|
68
|
+
async fund_close(fund) {
|
|
69
|
+
const updates = new UpdateBuilder();
|
|
70
|
+
updates.set("active", false);
|
|
71
|
+
const command = new UpdateCommand({
|
|
72
|
+
TableName: FundDb.table,
|
|
73
|
+
Key: this.key_fund(fund),
|
|
74
|
+
ReturnValues: "ALL_NEW",
|
|
75
|
+
...updates.collect(),
|
|
76
|
+
});
|
|
77
|
+
return this.client.send(command);
|
|
78
|
+
}
|
|
68
79
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { CloudsearchFund as FundItem } from "./cloudsearch.mjs";
|
|
2
2
|
export type { IFundNew, IFundUpdate, IFundsNpoMemberOfSearchObj, IFundsSearchObj, DonateMethodId, Environment, } from "./schema.mjs";
|
|
3
|
+
export type * from "./interfaces.mjs";
|
|
3
4
|
export { FundDb } from "./db.mjs";
|
|
4
5
|
export declare const MAX_EXPIRATION = "9999-12-31T23:59:59Z";
|
package/package.json
CHANGED
package/src/db.mts
CHANGED
|
@@ -75,4 +75,17 @@ export class FundDb extends Db {
|
|
|
75
75
|
|
|
76
76
|
return this.client.send(command).then((res) => res.Attributes ?? {});
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
async fund_close(fund: string) {
|
|
80
|
+
const updates = new UpdateBuilder();
|
|
81
|
+
updates.set("active", false);
|
|
82
|
+
|
|
83
|
+
const command = new UpdateCommand({
|
|
84
|
+
TableName: FundDb.table,
|
|
85
|
+
Key: this.key_fund(fund),
|
|
86
|
+
ReturnValues: "ALL_NEW",
|
|
87
|
+
...updates.collect(),
|
|
88
|
+
});
|
|
89
|
+
return this.client.send(command);
|
|
90
|
+
}
|
|
78
91
|
}
|