@better-giving/donation 1.1.14 → 1.1.15

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/intent.d.mts CHANGED
@@ -21,6 +21,7 @@ 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
23
  readonly firstName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
24
+ readonly companyName: v.OptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, never>;
24
25
  readonly lastName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
25
26
  readonly email: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
26
27
  readonly address: v.OptionalSchema<v.ObjectSchema<{
@@ -80,6 +81,7 @@ export declare const intent: v.ObjectSchema<{
80
81
  readonly donor: v.ObjectSchema<{
81
82
  readonly title: v.PicklistSchema<readonly ["Mr", "Mrs", "Ms", "Mx", ""], undefined>;
82
83
  readonly firstName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
84
+ readonly companyName: v.OptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, never>;
83
85
  readonly lastName: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, undefined>]>;
84
86
  readonly email: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.EmailAction<string, undefined>]>;
85
87
  readonly address: v.OptionalSchema<v.ObjectSchema<{
package/dist/intent.mjs CHANGED
@@ -23,6 +23,7 @@ export const donorAddress = v.object({
23
23
  export const donor = v.object({
24
24
  title: donorTitle,
25
25
  firstName: requiredStr,
26
+ companyName: v.optional(str),
26
27
  lastName: requiredStr,
27
28
  email: v.pipe(str, v.email()),
28
29
  address: v.optional(donorAddress),
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/donation",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "devDependencies": {
5
5
  "@better-giving/config": "1.1.2"
6
6
  },
package/src/intent.mts CHANGED
@@ -37,6 +37,7 @@ export type DonorAddress = v.InferOutput<typeof donorAddress>;
37
37
  export const donor = v.object({
38
38
  title: donorTitle,
39
39
  firstName: requiredStr,
40
+ companyName: v.optional(str),
40
41
  lastName: requiredStr,
41
42
  email: v.pipe(str, v.email()),
42
43
  address: v.optional(donorAddress),
@@ -54,7 +54,7 @@ export const oldIntent = v.pipe(
54
54
  v.transform((input) => ({
55
55
  amount: {
56
56
  amount: input.amount,
57
- currency: input.currency ? input.currency : input.denomination ?? "",
57
+ currency: input.currency ? input.currency : (input.denomination ?? ""),
58
58
  tip: input.tipAmount,
59
59
  feeAllowance: input.feeAllowance,
60
60
  },
@@ -97,8 +97,8 @@ export const oldIntent = v.pipe(
97
97
  : undefined,
98
98
  frequency: (input.type === "subscription"
99
99
  ? "recurring"
100
- : input.type ?? "one-time") as Frequency,
100
+ : (input.type ?? "one-time")) as Frequency,
101
101
  viaName: input.chainName ?? "fiat",
102
- viaId: input.chainId ? input.chainId : input.transactionId ?? "fiat",
102
+ viaId: input.chainId ? input.chainId : (input.transactionId ?? "fiat"),
103
103
  }))
104
104
  );