@better-giving/endowment 4.0.23 → 4.0.24

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
@@ -1,4 +1,4 @@
1
- import { Db, type UpdateComps } from "@better-giving/db";
1
+ import { Db, type TxType, type UpdateComps } from "@better-giving/db";
2
2
  import type { IMedia, IMediaPage, INpoReferredBy, INpoWithRegNum, INpoWithRid, TBinFlag, TNpoDbKeys, TNpoDbProjectedTo } from "./interfaces.mjs";
3
3
  import type { IMediaSearchObj, IMediaUpdate, IMilestone, IMilestoneNew, IMilestoneUpdate, INpo, INpoUpdate, IProgram, IProgramDb, IProgramNew, IProgramUpdate, TMediaType } from "./schema.mjs";
4
4
  export declare class NpoDb extends Db {
@@ -136,6 +136,7 @@ export declare class NpoDb extends Db {
136
136
  npo<T extends TNpoDbKeys[]>(id: string | number, fields?: T): Promise<TNpoDbProjectedTo<T> | undefined>;
137
137
  npo_update_comps({ target, slug, social_media_urls, ...update }: INpoUpdate): UpdateComps;
138
138
  npo_update(id: number, update: INpoUpdate): Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
139
+ npo_update_txi(id: number, update: INpoUpdate): Promise<TxType["Update"]>;
139
140
  prog_milestones(id: string): Promise<IMilestone[]>;
140
141
  prog_milestone_delete(pid: string, mid: string): Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput>;
141
142
  prog_milestone_put(pid: string, content: IMilestoneNew): Promise<string>;
package/dist/db.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BatchGetCommand, DeleteCommand, GetCommand, PutCommand, QueryCommand, TransactWriteCommand, UpdateCommand, } from "@aws-sdk/lib-dynamodb";
2
- import { Db, Txs, UpdateBuilder } from "@better-giving/db";
2
+ import { Db, Txs, UpdateBuilder, } from "@better-giving/db";
3
3
  import KSUID from "ksuid";
4
4
  import { med_key_filter, med_sk, to_imedia } from "./media.mjs";
5
5
  import { projection } from "./npo.mjs";
@@ -287,6 +287,14 @@ export class NpoDb extends Db {
287
287
  });
288
288
  return this.client.send(cmd);
289
289
  }
290
+ async npo_update_txi(id, update) {
291
+ const upd8 = this.npo_update_comps(update);
292
+ return {
293
+ TableName: NpoDb.table,
294
+ Key: this.key_npo(id),
295
+ ...upd8,
296
+ };
297
+ }
290
298
  async prog_milestones(id) {
291
299
  const command = new QueryCommand({
292
300
  TableName: NpoDb.table,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/endowment",
3
- "version": "4.0.23",
3
+ "version": "4.0.24",
4
4
  "dependencies": {
5
5
  "ksuid": "3.0.0"
6
6
  },
package/src/db.mts CHANGED
@@ -7,7 +7,13 @@ import {
7
7
  TransactWriteCommand,
8
8
  UpdateCommand,
9
9
  } from "@aws-sdk/lib-dynamodb";
10
- import { Db, Txs, UpdateBuilder, type UpdateComps } from "@better-giving/db";
10
+ import {
11
+ Db,
12
+ Txs,
13
+ UpdateBuilder,
14
+ type TxType,
15
+ type UpdateComps,
16
+ } from "@better-giving/db";
11
17
  import KSUID from "ksuid";
12
18
  import type {
13
19
  IMedia,
@@ -373,6 +379,17 @@ export class NpoDb extends Db {
373
379
  });
374
380
  return this.client.send(cmd);
375
381
  }
382
+ async npo_update_txi(
383
+ id: number,
384
+ update: INpoUpdate
385
+ ): Promise<TxType["Update"]> {
386
+ const upd8 = this.npo_update_comps(update);
387
+ return {
388
+ TableName: NpoDb.table,
389
+ Key: this.key_npo(id),
390
+ ...upd8,
391
+ };
392
+ }
376
393
 
377
394
  async prog_milestones(id: string): Promise<IMilestone[]> {
378
395
  const command = new QueryCommand({