@better-giving/donation 2.0.1 → 2.0.3

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.
@@ -14,8 +14,5 @@ export type FinalRecorderPayload = {
14
14
  /** intent to delete */
15
15
  intentId?: string;
16
16
  hideBgTip: boolean;
17
- /** donation message */
18
- donor_message?: string;
19
- donor_public?: boolean;
20
17
  } & FinalRecord & SettledAmounts & Fund & (Donation.WithKYC | Donation.WithoutKYC);
21
18
  export {};
package/dist/intent.d.mts CHANGED
@@ -2,47 +2,46 @@ import * as v from "valibot";
2
2
  export declare const frequencies: readonly ["one-time", "recurring"];
3
3
  export declare const frequency: v.PicklistSchema<readonly ["one-time", "recurring"], undefined>;
4
4
  export type Frequency = v.InferOutput<typeof frequency>;
5
- export declare const donation_sources: readonly ["bg-marketplace", "bg-widget", "tester-app"];
6
- export declare const donation_source: v.PicklistSchema<readonly ["bg-marketplace", "bg-widget", "tester-app"], undefined>;
7
- export type DonationSource = v.InferOutput<typeof donation_source>;
8
- export declare const donor_titles: readonly ["Mr", "Mrs", "Ms", "Mx", ""];
9
- export declare const donor_title: v.PicklistSchema<readonly ["Mr", "Mrs", "Ms", "Mx", ""], undefined>;
10
- export type DonorTitle = v.InferOutput<typeof donor_title>;
11
- export declare const donor_address: v.ObjectSchema<{
5
+ export declare const donationSources: readonly ["bg-marketplace", "bg-widget", "tester-app"];
6
+ export declare const donationSource: v.PicklistSchema<readonly ["bg-marketplace", "bg-widget", "tester-app"], undefined>;
7
+ export type DonationSource = v.InferOutput<typeof donationSource>;
8
+ export declare const donorTitles: readonly ["Mr", "Mrs", "Ms", "Mx", ""];
9
+ export declare const donorTitle: v.PicklistSchema<readonly ["Mr", "Mrs", "Ms", "Mx", ""], undefined>;
10
+ export type DonorTitle = v.InferOutput<typeof donorTitle>;
11
+ export declare const donorAddress: v.ObjectSchema<{
12
12
  readonly street: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
13
13
  readonly city: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
14
14
  readonly state: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
15
- readonly zip_code: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
15
+ readonly zipCode: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
16
16
  /** country name */
17
17
  readonly country: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
18
- readonly uk_gift_aid: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
18
+ readonly ukGiftAid: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
19
19
  }, undefined>;
20
- export type DonorAddress = v.InferOutput<typeof donor_address>;
20
+ export type DonorAddress = v.InferOutput<typeof donorAddress>;
21
21
  export declare const donor: v.ObjectSchema<{
22
22
  readonly title: v.PicklistSchema<readonly ["Mr", "Mrs", "Ms", "Mx", ""], undefined>;
23
- readonly first_name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
24
- readonly company_name: v.OptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, never>;
25
- readonly last_name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
23
+ readonly firstName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
24
+ readonly lastName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
26
25
  readonly email: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
27
26
  readonly address: v.OptionalSchema<v.ObjectSchema<{
28
27
  readonly street: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
29
28
  readonly city: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
30
29
  readonly state: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
31
- readonly zip_code: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
30
+ readonly zipCode: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
32
31
  /** country name */
33
32
  readonly country: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
34
- readonly uk_gift_aid: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
33
+ readonly ukGiftAid: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
35
34
  }, undefined>, never>;
36
35
  }, undefined>;
37
36
  export type Donor = v.InferOutput<typeof donor>;
38
37
  export declare const amount: v.ObjectSchema<{
39
38
  readonly amount: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
40
- readonly currency: v.SchemaWithPipe<[v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, v.ToUpperCaseAction]>;
39
+ readonly currency: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
41
40
  readonly tip: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
42
- readonly fee_allowance: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
41
+ readonly feeAllowance: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
43
42
  }, undefined>;
44
43
  export type Amount = v.InferOutput<typeof amount>;
45
- export declare const endow_id: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
44
+ export declare const endowId: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
46
45
  export declare const uuid: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.UuidAction<string, undefined>]>;
47
46
  export declare const program: v.ObjectSchema<{
48
47
  readonly id: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.UuidAction<string, undefined>]>;
@@ -51,27 +50,27 @@ export declare const program: v.ObjectSchema<{
51
50
  export type Program = v.InferOutput<typeof program>;
52
51
  export declare const recipient: v.UnionSchema<[v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.UuidAction<string, undefined>]>], undefined>;
53
52
  export type Recipient = v.InferOutput<typeof recipient>;
54
- export declare const tribute_notif: v.ObjectSchema<{
55
- readonly to_email: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
56
- readonly to_fullname: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
57
- readonly from_msg: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 250, undefined>]>;
53
+ export declare const tributeNotif: v.ObjectSchema<{
54
+ readonly toEmail: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
55
+ readonly toFullName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
56
+ readonly fromMsg: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 250, undefined>]>;
58
57
  }, undefined>;
59
- export type TributeNotif = v.InferOutput<typeof tribute_notif>;
58
+ export type TributeNotif = v.InferOutput<typeof tributeNotif>;
60
59
  export declare const tribute: v.ObjectSchema<{
61
- readonly full_name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
60
+ readonly fullName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
62
61
  readonly notif: v.OptionalSchema<v.ObjectSchema<{
63
- readonly to_email: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
64
- readonly to_fullname: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
65
- readonly from_msg: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 250, undefined>]>;
62
+ readonly toEmail: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
63
+ readonly toFullName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
64
+ readonly fromMsg: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 250, undefined>]>;
66
65
  }, undefined>, never>;
67
66
  }, undefined>;
68
67
  export type Tribute = v.InferOutput<typeof tribute>;
69
68
  export declare const intent: v.ObjectSchema<{
70
69
  readonly amount: v.ObjectSchema<{
71
70
  readonly amount: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
72
- readonly currency: v.SchemaWithPipe<[v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, v.ToUpperCaseAction]>;
71
+ readonly currency: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
73
72
  readonly tip: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
74
- readonly fee_allowance: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
73
+ readonly feeAllowance: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>;
75
74
  }, undefined>;
76
75
  readonly recipient: v.UnionSchema<[v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.UuidAction<string, undefined>]>], undefined>;
77
76
  readonly program: v.OptionalSchema<v.ObjectSchema<{
@@ -80,36 +79,32 @@ export declare const intent: v.ObjectSchema<{
80
79
  }, undefined>, never>;
81
80
  readonly donor: v.ObjectSchema<{
82
81
  readonly title: v.PicklistSchema<readonly ["Mr", "Mrs", "Ms", "Mx", ""], undefined>;
83
- readonly first_name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
84
- readonly company_name: v.OptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, never>;
85
- readonly last_name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
82
+ readonly firstName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
83
+ readonly lastName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
86
84
  readonly email: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
87
85
  readonly address: v.OptionalSchema<v.ObjectSchema<{
88
86
  readonly street: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
89
87
  readonly city: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
90
88
  readonly state: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
91
- readonly zip_code: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
89
+ readonly zipCode: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, never>;
92
90
  /** country name */
93
91
  readonly country: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
94
- readonly uk_gift_aid: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
92
+ readonly ukGiftAid: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
95
93
  }, undefined>, never>;
96
94
  }, undefined>;
97
- 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>;
98
- readonly donor_public: v.OptionalSchema<v.BooleanSchema<undefined>, never>;
99
- readonly msg_to_npo: v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>, v.MaxLengthAction<string, 500, undefined>]>, never>;
100
95
  readonly source: v.PicklistSchema<readonly ["bg-marketplace", "bg-widget", "tester-app"], undefined>;
101
96
  readonly tribute: v.OptionalSchema<v.ObjectSchema<{
102
- readonly full_name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
97
+ readonly fullName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
103
98
  readonly notif: v.OptionalSchema<v.ObjectSchema<{
104
- readonly to_email: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
105
- readonly to_fullname: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
106
- readonly from_msg: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 250, undefined>]>;
99
+ readonly toEmail: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
100
+ readonly toFullName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
101
+ readonly fromMsg: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 250, undefined>]>;
107
102
  }, undefined>, never>;
108
103
  }, undefined>, never>;
109
104
  readonly frequency: v.PicklistSchema<readonly ["one-time", "recurring"], undefined>;
110
105
  /** chain name, etc. */
111
- readonly via_name: v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>;
106
+ readonly viaName: v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>;
112
107
  /** chain id, workflow-session-id, etc. */
113
- readonly via_id: v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>;
108
+ readonly viaId: v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>;
114
109
  }, undefined>;
115
110
  export type DonationIntent = v.InferOutput<typeof intent>;
package/dist/intent.mjs CHANGED
@@ -1,69 +1,65 @@
1
1
  import * as v from "valibot";
2
2
  const str = v.pipe(v.string(), v.trim());
3
- const required_str = v.pipe(str, v.nonEmpty());
3
+ const requiredStr = v.pipe(str, v.nonEmpty());
4
4
  export const frequencies = ["one-time", "recurring"];
5
5
  export const frequency = v.picklist(frequencies);
6
- export const donation_sources = [
6
+ export const donationSources = [
7
7
  "bg-marketplace",
8
8
  "bg-widget",
9
9
  "tester-app",
10
10
  ];
11
- export const donation_source = v.picklist(donation_sources);
12
- export const donor_titles = ["Mr", "Mrs", "Ms", "Mx", ""];
13
- export const donor_title = v.picklist(donor_titles);
14
- export const donor_address = v.object({
15
- street: required_str,
16
- city: required_str,
17
- state: v.optional(required_str),
18
- zip_code: v.optional(required_str),
11
+ export const donationSource = v.picklist(donationSources);
12
+ export const donorTitles = ["Mr", "Mrs", "Ms", "Mx", ""];
13
+ export const donorTitle = v.picklist(donorTitles);
14
+ export const donorAddress = v.object({
15
+ street: requiredStr,
16
+ city: requiredStr,
17
+ state: v.optional(requiredStr),
18
+ zipCode: v.optional(requiredStr),
19
19
  /** country name */
20
- country: required_str,
21
- uk_gift_aid: v.optional(v.boolean()),
20
+ country: requiredStr,
21
+ ukGiftAid: v.optional(v.boolean()),
22
22
  });
23
23
  export const donor = v.object({
24
- title: donor_title,
25
- first_name: required_str,
26
- company_name: v.optional(str),
27
- last_name: required_str,
24
+ title: donorTitle,
25
+ firstName: requiredStr,
26
+ lastName: requiredStr,
28
27
  email: v.pipe(str, v.email()),
29
- address: v.optional(donor_address),
28
+ address: v.optional(donorAddress),
30
29
  });
31
30
  const money = v.pipe(v.number(), v.minValue(0));
32
31
  export const amount = v.object({
33
32
  amount: money,
34
- currency: v.pipe(required_str, v.toUpperCase()),
33
+ currency: requiredStr,
35
34
  tip: money,
36
- fee_allowance: money,
35
+ feeAllowance: money,
37
36
  });
38
- export const endow_id = v.pipe(str, v.transform((x) => +x), v.number(), v.integer(), v.minValue(1));
37
+ export const endowId = v.pipe(str, v.transform((x) => +x), v.number(), v.integer(), v.minValue(1));
39
38
  export const uuid = v.pipe(str, v.uuid());
40
39
  export const program = v.object({
41
40
  id: uuid,
42
- name: required_str,
41
+ name: requiredStr,
43
42
  });
44
- export const recipient = v.union([endow_id, uuid]);
45
- export const tribute_notif = v.object({
46
- to_email: v.pipe(str, v.email()),
47
- to_fullname: v.pipe(str, v.nonEmpty()),
48
- from_msg: v.pipe(str, v.maxLength(250)),
43
+ export const recipient = v.union([endowId, uuid]);
44
+ export const tributeNotif = v.object({
45
+ toEmail: v.pipe(str, v.email()),
46
+ toFullName: v.pipe(str, v.nonEmpty()),
47
+ fromMsg: v.pipe(str, v.maxLength(250)),
49
48
  });
50
49
  export const tribute = v.object({
51
- full_name: required_str,
52
- notif: v.optional(tribute_notif),
50
+ fullName: requiredStr,
51
+ notif: v.optional(tributeNotif),
53
52
  });
54
53
  export const intent = v.object({
55
54
  amount,
56
55
  recipient,
57
56
  program: v.optional(program),
58
57
  donor,
59
- donor_message: v.optional(v.pipe(required_str, v.maxLength(500))),
60
- donor_public: v.optional(v.boolean()),
61
- msg_to_npo: v.optional(v.pipe(required_str, v.maxLength(500))),
62
- source: donation_source,
58
+ source: donationSource,
63
59
  tribute: v.optional(tribute),
64
60
  frequency,
65
61
  /** chain name, etc. */
66
- via_name: str,
62
+ viaName: str,
67
63
  /** chain id, workflow-session-id, etc. */
68
- via_id: str,
64
+ viaId: str,
69
65
  });
@@ -41,7 +41,7 @@ export const oldIntent = v.pipe(v.object({
41
41
  }), v.transform((input) => ({
42
42
  amount: {
43
43
  amount: input.amount,
44
- currency: input.currency ? input.currency : (input.denomination ?? ""),
44
+ currency: input.currency ? input.currency : input.denomination ?? "",
45
45
  tip: input.tipAmount,
46
46
  feeAllowance: input.feeAllowance,
47
47
  },
@@ -83,7 +83,7 @@ export const oldIntent = v.pipe(v.object({
83
83
  : undefined,
84
84
  frequency: (input.type === "subscription"
85
85
  ? "recurring"
86
- : (input.type ?? "one-time")),
86
+ : input.type ?? "one-time"),
87
87
  viaName: input.chainName ?? "fiat",
88
- viaId: input.chainId ? input.chainId : (input.transactionId ?? "fiat"),
88
+ viaId: input.chainId ? input.chainId : input.transactionId ?? "fiat",
89
89
  })));
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@better-giving/donation",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "devDependencies": {
5
5
  "@better-giving/config": "1.1.2"
6
6
  },
7
7
  "peerDependencies": {
8
- "@better-giving/types": "1.1.7",
9
- "@better-giving/schemas": "1.2.0",
8
+ "@better-giving/types": "1.1.8",
9
+ "@better-giving/schemas": "1.2.2",
10
10
  "valibot": "0.42.0"
11
11
  },
12
12
  "files": [