@better-giving/endowment 4.0.26 → 4.0.28
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.mjs +3 -0
- package/package.json +2 -2
- package/src/db.mts +2 -0
- package/src/schema.mts +1 -1
package/dist/db.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
1
2
|
import { BatchGetCommand, DeleteCommand, GetCommand, PutCommand, QueryCommand, TransactWriteCommand, UpdateCommand, } from "@aws-sdk/lib-dynamodb";
|
|
2
3
|
import { Db, Txs, UpdateBuilder, } from "@better-giving/db";
|
|
3
4
|
import KSUID from "ksuid";
|
|
@@ -56,6 +57,8 @@ export class NpoDb extends Db {
|
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
59
|
async npos_get(ids, fields) {
|
|
60
|
+
if (ids.length === 0)
|
|
61
|
+
return [];
|
|
59
62
|
const { names, expression } = projection(fields);
|
|
60
63
|
const cmd = new BatchGetCommand({
|
|
61
64
|
RequestItems: {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-giving/endowment",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.28",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"ksuid": "3.0.0"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@better-giving/schemas": "2.0.
|
|
8
|
+
"@better-giving/schemas": "2.0.2",
|
|
9
9
|
"@better-giving/types": "1.1.8",
|
|
10
10
|
"@better-giving/db": "2.0.6",
|
|
11
11
|
"@aws-sdk/lib-dynamodb": "3.485.0",
|
package/src/db.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
1
2
|
import {
|
|
2
3
|
BatchGetCommand,
|
|
3
4
|
DeleteCommand,
|
|
@@ -105,6 +106,7 @@ export class NpoDb extends Db {
|
|
|
105
106
|
ids: number[],
|
|
106
107
|
fields?: T
|
|
107
108
|
): Promise<TNpoDbProjectedTo<T>[]> {
|
|
109
|
+
if (ids.length === 0) return [];
|
|
108
110
|
const { names, expression } = projection(fields);
|
|
109
111
|
const cmd = new BatchGetCommand({
|
|
110
112
|
RequestItems: {
|
package/src/schema.mts
CHANGED
|
@@ -299,4 +299,4 @@ export const npos_search = v.object({
|
|
|
299
299
|
});
|
|
300
300
|
|
|
301
301
|
export interface INposSearch extends v.InferInput<typeof npos_search> {}
|
|
302
|
-
export interface INposSearchObj extends v.InferOutput<typeof npos_search> {}
|
|
302
|
+
export interface INposSearchObj extends v.InferOutput<typeof npos_search> {}
|