@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/fundraiser",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "peerDependencies": {
5
5
  "valibot": "0.42.0",
6
6
  "@better-giving/schemas": "2.0.0",
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
  }
package/src/index.mts CHANGED
@@ -7,6 +7,7 @@ export type {
7
7
  DonateMethodId,
8
8
  Environment,
9
9
  } from "./schema.mjs";
10
+ export type * from "./interfaces.mjs";
10
11
  export { FundDb } from "./db.mjs";
11
12
 
12
13
  export const MAX_EXPIRATION = "9999-12-31T23:59:59Z";