@better-giving/donation 1.1.3 → 1.1.5
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/donation-message.d.mts +30 -0
- package/dist/donation-message.mjs +1 -0
- package/dist/donation.d.mts +2 -0
- package/dist/intent.d.mts +2 -0
- package/dist/intent.mjs +2 -0
- package/package.json +1 -1
- package/src/donation-message.mts +34 -0
- package/src/donation.mts +3 -3
- package/src/intent.mts +2 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ISODate } from "@better-giving/types/alias";
|
|
2
|
+
import type { Environment } from "@better-giving/types/list";
|
|
3
|
+
export declare namespace GSI1 {
|
|
4
|
+
type Name = "donor-gsi";
|
|
5
|
+
interface Key {
|
|
6
|
+
/** `Donor#{donor_id}#{env}` */
|
|
7
|
+
gsi1PK: `Donor#${string}#${Environment}`;
|
|
8
|
+
gsi1SK: ISODate;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare namespace DonationMessage {
|
|
12
|
+
interface PrimaryKey {
|
|
13
|
+
/** `Recipient#{recipient_id}#{env}` */
|
|
14
|
+
PK: `Recipient#${string}#${Environment}`;
|
|
15
|
+
SK: ISODate;
|
|
16
|
+
}
|
|
17
|
+
interface NonKeyAttributes {
|
|
18
|
+
/** USD amount at the time of donation */
|
|
19
|
+
amount: number;
|
|
20
|
+
donation_id: string;
|
|
21
|
+
donor_id: string;
|
|
22
|
+
donor_message: string;
|
|
23
|
+
donor_name: string;
|
|
24
|
+
env: Environment;
|
|
25
|
+
/** Endow or fund ID */
|
|
26
|
+
recipient_id: string;
|
|
27
|
+
}
|
|
28
|
+
interface DBRecord extends PrimaryKey, NonKeyAttributes, GSI1.Key {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/donation.d.mts
CHANGED
|
@@ -292,6 +292,8 @@ export declare namespace OnHoldDonation {
|
|
|
292
292
|
inHonorOf?: string;
|
|
293
293
|
/** only allowed if honoree is provided */
|
|
294
294
|
tributeNotif?: Donation.TributeNotif;
|
|
295
|
+
donor_message?: string;
|
|
296
|
+
donor_public?: boolean;
|
|
295
297
|
} & (ApesAttributes | EmptyObject) & (Donation.WithKYC | Donation.WithoutKYC);
|
|
296
298
|
type CryptoDBRecord = PrimaryKey & NonKeyAttributes & CryptoAttributes & Donation.EmailIndexKey;
|
|
297
299
|
type FiatDBRecord = PrimaryKey & Required<Donation.FiatRamp_IndexKey> & NonKeyAttributes & FiatAttributes & Required<Donation.EmailIndexKey>;
|
package/dist/intent.d.mts
CHANGED
|
@@ -92,6 +92,8 @@ export declare const intent: v.ObjectSchema<{
|
|
|
92
92
|
readonly ukGiftAid: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
|
|
93
93
|
}, undefined>, never>;
|
|
94
94
|
}, undefined>;
|
|
95
|
+
readonly donor_message: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, v.MaxLengthAction<string, 500, undefined>]>, never>;
|
|
96
|
+
readonly donor_public: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
|
|
95
97
|
readonly source: v.PicklistSchema<readonly ["bg-marketplace", "bg-widget", "tester-app"], undefined>;
|
|
96
98
|
readonly tribute: v.OptionalSchema<v.ObjectSchema<{
|
|
97
99
|
readonly fullName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
|
package/dist/intent.mjs
CHANGED
|
@@ -55,6 +55,8 @@ export const intent = v.object({
|
|
|
55
55
|
recipient,
|
|
56
56
|
program: v.optional(program),
|
|
57
57
|
donor,
|
|
58
|
+
donor_message: v.optional(v.pipe(requiredStr, v.maxLength(500))),
|
|
59
|
+
donor_public: v.optional(v.boolean()),
|
|
58
60
|
source: donationSource,
|
|
59
61
|
tribute: v.optional(tribute),
|
|
60
62
|
frequency,
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ISODate } from "@better-giving/types/alias";
|
|
2
|
+
import type { Environment } from "@better-giving/types/list";
|
|
3
|
+
|
|
4
|
+
export declare namespace GSI1 {
|
|
5
|
+
type Name = "donor-gsi";
|
|
6
|
+
|
|
7
|
+
interface Key {
|
|
8
|
+
/** `Donor#{donor_id}#{env}` */
|
|
9
|
+
gsi1PK: `Donor#${string}#${Environment}`;
|
|
10
|
+
gsi1SK: ISODate;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare namespace DonationMessage {
|
|
15
|
+
interface PrimaryKey {
|
|
16
|
+
/** `Recipient#{recipient_id}#{env}` */
|
|
17
|
+
PK: `Recipient#${string}#${Environment}`;
|
|
18
|
+
SK: ISODate;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface NonKeyAttributes {
|
|
22
|
+
/** USD amount at the time of donation */
|
|
23
|
+
amount: number;
|
|
24
|
+
donation_id: string;
|
|
25
|
+
donor_id: string;
|
|
26
|
+
donor_message: string;
|
|
27
|
+
donor_name: string;
|
|
28
|
+
env: Environment;
|
|
29
|
+
/** Endow or fund ID */
|
|
30
|
+
recipient_id: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface DBRecord extends PrimaryKey, NonKeyAttributes, GSI1.Key {}
|
|
34
|
+
}
|
package/src/donation.mts
CHANGED
|
@@ -339,7 +339,7 @@ export declare namespace OnHoldDonation {
|
|
|
339
339
|
/** status of this record should NOT be changed by our pipelines */
|
|
340
340
|
third_party?: true;
|
|
341
341
|
/** Nowpayments: number, custom: uuid */
|
|
342
|
-
payment_id?: number | string;
|
|
342
|
+
payment_id?: number | string;
|
|
343
343
|
};
|
|
344
344
|
|
|
345
345
|
type FiatAttributes = {
|
|
@@ -349,8 +349,6 @@ export declare namespace OnHoldDonation {
|
|
|
349
349
|
paymentMethod?: string;
|
|
350
350
|
/** only exists if donor opts for manual bank verification */
|
|
351
351
|
stripeDepositVerifyUrl?: string;
|
|
352
|
-
// TODO: create donation intents for subscriptions as well, then uncomment the below line
|
|
353
|
-
// frequency: FiatDonations.Frequency;
|
|
354
352
|
};
|
|
355
353
|
|
|
356
354
|
type NonKeyAttributes = {
|
|
@@ -396,6 +394,8 @@ export declare namespace OnHoldDonation {
|
|
|
396
394
|
inHonorOf?: string;
|
|
397
395
|
/** only allowed if honoree is provided */
|
|
398
396
|
tributeNotif?: Donation.TributeNotif;
|
|
397
|
+
donor_message?: string;
|
|
398
|
+
donor_public?: boolean;
|
|
399
399
|
} & (ApesAttributes | EmptyObject) &
|
|
400
400
|
(Donation.WithKYC | Donation.WithoutKYC);
|
|
401
401
|
|
package/src/intent.mts
CHANGED
|
@@ -95,6 +95,8 @@ export const intent = v.object({
|
|
|
95
95
|
recipient,
|
|
96
96
|
program: v.optional(program),
|
|
97
97
|
donor,
|
|
98
|
+
donor_message: v.optional(v.pipe(requiredStr, v.maxLength(500))),
|
|
99
|
+
donor_public: v.optional(v.boolean()),
|
|
98
100
|
source: donationSource,
|
|
99
101
|
tribute: v.optional(tribute),
|
|
100
102
|
frequency,
|