@better-giving/endowment 4.0.23 → 4.0.25
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 +2 -1
- package/dist/db.mjs +9 -1
- package/package.json +1 -1
- package/src/db.mts +15 -1
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): 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
|
+
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
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 {
|
|
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,14 @@ export class NpoDb extends Db {
|
|
|
373
379
|
});
|
|
374
380
|
return this.client.send(cmd);
|
|
375
381
|
}
|
|
382
|
+
npo_update_txi(id: number, update: INpoUpdate): TxType["Update"] {
|
|
383
|
+
const upd8 = this.npo_update_comps(update);
|
|
384
|
+
return {
|
|
385
|
+
TableName: NpoDb.table,
|
|
386
|
+
Key: this.key_npo(id),
|
|
387
|
+
...upd8,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
376
390
|
|
|
377
391
|
async prog_milestones(id: string): Promise<IMilestone[]> {
|
|
378
392
|
const command = new QueryCommand({
|