@better-giving/donation 3.0.18 → 3.0.20
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/donations-db.d.mts +3 -3
- package/dist/donations-db.mjs +2 -3
- package/dist/interfaces.d.mts +0 -3
- package/dist/onhold-db.d.mts +3 -3
- package/package.json +1 -1
- package/src/donations-db.mts +5 -10
- package/src/interfaces.mts +0 -2
- package/src/onhold-db.mts +3 -7
package/dist/donations-db.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type QueryCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
-
import { Db } from "@better-giving/db";
|
|
2
|
+
import { Db, type TxType } from "@better-giving/db";
|
|
3
3
|
import type { IPageKeyed } from "@better-giving/types/api";
|
|
4
|
-
import type { IDonationFinal, IDonationFinalAttr
|
|
4
|
+
import type { IDonationFinal, IDonationFinalAttr } from "./interfaces.mjs";
|
|
5
5
|
import type { IDonationsSearch, IPageOpts } from "./schema.mjs";
|
|
6
6
|
export declare class DonationsDb extends Db {
|
|
7
7
|
static readonly gsi_referrer$settled_date = "Referrer-FinalizedDate_Index";
|
|
@@ -12,7 +12,7 @@ export declare class DonationsDb extends Db {
|
|
|
12
12
|
transactionId: string;
|
|
13
13
|
};
|
|
14
14
|
item(id: string): Promise<IDonationFinal | undefined>;
|
|
15
|
-
put_txi(data:
|
|
15
|
+
put_txi(data: IDonationFinalAttr): TxType["Put"];
|
|
16
16
|
referred_by_q(referrer: string, opts?: IPageOpts): QueryCommandInput;
|
|
17
17
|
referred_by(referrer: string, opts?: IPageOpts): Promise<IPageKeyed<IDonationFinal>>;
|
|
18
18
|
list_to_npo(npo: number, opts?: IDonationsSearch & {
|
package/dist/donations-db.mjs
CHANGED
|
@@ -18,12 +18,11 @@ export class DonationsDb extends Db {
|
|
|
18
18
|
return this.client.send(cmd).then((r) => r.Item);
|
|
19
19
|
}
|
|
20
20
|
put_txi(data) {
|
|
21
|
-
|
|
21
|
+
return {
|
|
22
22
|
TableName: this.table,
|
|
23
23
|
Item: data,
|
|
24
24
|
ConditionExpression: `attribute_not_exists(${"transactionId"})`,
|
|
25
|
-
}
|
|
26
|
-
return this.client.send(cmd);
|
|
25
|
+
};
|
|
27
26
|
}
|
|
28
27
|
referred_by_q(referrer, opts) {
|
|
29
28
|
const q = {
|
package/dist/interfaces.d.mts
CHANGED
|
@@ -154,9 +154,6 @@ export interface IDonationFinalAttrLegacy {
|
|
|
154
154
|
/** @deprecated */
|
|
155
155
|
walletAddress?: string;
|
|
156
156
|
}
|
|
157
|
-
export type TExplicit<T> = {
|
|
158
|
-
[K in keyof T]-?: T[K];
|
|
159
|
-
};
|
|
160
157
|
export interface IDonationFinalAttr {
|
|
161
158
|
transactionId: string;
|
|
162
159
|
/** iso */
|
package/dist/onhold-db.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Db, type TxType } from "@better-giving/db";
|
|
2
2
|
import type { IPageKeyed } from "@better-giving/types/api";
|
|
3
|
-
import type { IDonationOnHold, IDonationOnHoldAttr
|
|
3
|
+
import type { IDonationOnHold, IDonationOnHoldAttr } from "./interfaces.mjs";
|
|
4
4
|
import type { IDonationsSearch } from "./schema.mjs";
|
|
5
5
|
export declare class OnHoldDonationsDb extends Db {
|
|
6
6
|
static readonly gsi_email$tx_date = "email-tx_date-gsi";
|
|
@@ -8,10 +8,10 @@ export declare class OnHoldDonationsDb extends Db {
|
|
|
8
8
|
key(id: string): {
|
|
9
9
|
transactionId: string;
|
|
10
10
|
};
|
|
11
|
-
put(data:
|
|
11
|
+
put(data: IDonationOnHoldAttr): Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput>;
|
|
12
12
|
update(id: string, data: Partial<Omit<IDonationOnHoldAttr, "transactionId">>): Promise<IDonationOnHold>;
|
|
13
13
|
item(id: string): Promise<IDonationOnHold | undefined>;
|
|
14
|
-
put_txi(data:
|
|
14
|
+
put_txi(data: IDonationOnHoldAttr): Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput>;
|
|
15
15
|
del_txi(id: string): TxType["Delete"];
|
|
16
16
|
del(id: string): Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput>;
|
|
17
17
|
list_by_email(email: string, opts?: IDonationsSearch): Promise<IPageKeyed<IDonationOnHold>>;
|
package/package.json
CHANGED
package/src/donations-db.mts
CHANGED
|
@@ -4,13 +4,9 @@ import {
|
|
|
4
4
|
QueryCommand,
|
|
5
5
|
type QueryCommandInput,
|
|
6
6
|
} from "@aws-sdk/lib-dynamodb";
|
|
7
|
-
import { Db } from "@better-giving/db";
|
|
7
|
+
import { Db, type TxType } from "@better-giving/db";
|
|
8
8
|
import type { IPageKeyed } from "@better-giving/types/api";
|
|
9
|
-
import type {
|
|
10
|
-
IDonationFinal,
|
|
11
|
-
IDonationFinalAttr,
|
|
12
|
-
TExplicit,
|
|
13
|
-
} from "./interfaces.mjs";
|
|
9
|
+
import type { IDonationFinal, IDonationFinalAttr } from "./interfaces.mjs";
|
|
14
10
|
import type { IDonationsSearch, IPageOpts } from "./schema.mjs";
|
|
15
11
|
|
|
16
12
|
type K = keyof IDonationFinalAttr;
|
|
@@ -39,13 +35,12 @@ export class DonationsDb extends Db {
|
|
|
39
35
|
return this.client.send(cmd).then((r) => r.Item as any);
|
|
40
36
|
}
|
|
41
37
|
|
|
42
|
-
put_txi(data:
|
|
43
|
-
|
|
38
|
+
put_txi(data: IDonationFinalAttr): TxType["Put"] {
|
|
39
|
+
return {
|
|
44
40
|
TableName: this.table,
|
|
45
41
|
Item: data,
|
|
46
42
|
ConditionExpression: `attribute_not_exists(${"transactionId" satisfies keyof IDonationFinalAttr})`,
|
|
47
|
-
}
|
|
48
|
-
return this.client.send(cmd);
|
|
43
|
+
};
|
|
49
44
|
}
|
|
50
45
|
|
|
51
46
|
referred_by_q(referrer: string, opts?: IPageOpts) {
|
package/src/interfaces.mts
CHANGED
package/src/onhold-db.mts
CHANGED
|
@@ -7,11 +7,7 @@ import {
|
|
|
7
7
|
} from "@aws-sdk/lib-dynamodb";
|
|
8
8
|
import { Db, type TxType, UpdateBuilder } from "@better-giving/db";
|
|
9
9
|
import type { IPageKeyed } from "@better-giving/types/api";
|
|
10
|
-
import type {
|
|
11
|
-
IDonationOnHold,
|
|
12
|
-
IDonationOnHoldAttr,
|
|
13
|
-
TExplicit,
|
|
14
|
-
} from "./interfaces.mjs";
|
|
10
|
+
import type { IDonationOnHold, IDonationOnHoldAttr } from "./interfaces.mjs";
|
|
15
11
|
import type { IDonationsSearch } from "./schema.mjs";
|
|
16
12
|
|
|
17
13
|
type K = keyof IDonationOnHoldAttr;
|
|
@@ -32,7 +28,7 @@ export class OnHoldDonationsDb extends Db {
|
|
|
32
28
|
>;
|
|
33
29
|
}
|
|
34
30
|
|
|
35
|
-
async put(data:
|
|
31
|
+
async put(data: IDonationOnHoldAttr) {
|
|
36
32
|
const cmd = new PutCommand({
|
|
37
33
|
TableName: this.table,
|
|
38
34
|
Item: data,
|
|
@@ -65,7 +61,7 @@ export class OnHoldDonationsDb extends Db {
|
|
|
65
61
|
return this.client.send(cmd).then((r) => r.Item as any);
|
|
66
62
|
}
|
|
67
63
|
|
|
68
|
-
put_txi(data:
|
|
64
|
+
put_txi(data: IDonationOnHoldAttr) {
|
|
69
65
|
const cmd = new PutCommand({
|
|
70
66
|
TableName: this.table,
|
|
71
67
|
Item: data,
|