@better-giving/endowment 6.1.0 → 7.0.0

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.d.mts CHANGED
@@ -43,7 +43,7 @@ export declare class NpoDb extends Db {
43
43
  npo_media(npo: number, opts: IMediaSearchObj): Promise<IMediaPage>;
44
44
  npo_referred_by(id: string): Promise<INpoReferredBy[]>;
45
45
  npo_with_rid(id: string): Promise<INpoWithRid | undefined>;
46
- npo_with_keyword(keyword: string, env?: import("@better-giving/types/list").Environment): Promise<INpoWithKeyword | undefined>;
46
+ npo_with_keyword(keyword: string): Promise<INpoWithKeyword | undefined>;
47
47
  npo_with_regnum(regnum: string, country?: string): Promise<INpoWithRegNum | undefined>;
48
48
  npo_record(data: INpo): {
49
49
  gsi2PK?: string | undefined;
@@ -86,6 +86,7 @@ export declare class NpoDb extends Db {
86
86
  lock: number;
87
87
  } | undefined;
88
88
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
89
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
89
90
  increments?: {
90
91
  value: string;
91
92
  label: string;
package/dist/db.mjs CHANGED
@@ -131,7 +131,7 @@ export class NpoDb extends Db {
131
131
  const i = Items[0];
132
132
  return i && this.sans_keys(i);
133
133
  }
134
- async npo_with_keyword(keyword, env = this.env) {
134
+ async npo_with_keyword(keyword) {
135
135
  const cmd = new QueryCommand({
136
136
  TableName: NpoDb.table,
137
137
  IndexName: NpoDb.keyword_env_gsi,
@@ -142,7 +142,7 @@ export class NpoDb extends Db {
142
142
  },
143
143
  ExpressionAttributeValues: {
144
144
  ":kw": keyword,
145
- ":env": env,
145
+ ":env": this.env,
146
146
  },
147
147
  Limit: 1,
148
148
  });
package/dist/npo.mjs CHANGED
@@ -35,4 +35,5 @@ export const npo_fields = {
35
35
  w_form: "",
36
36
  payout_minimum: "",
37
37
  donor_address_required: "",
38
+ donate_frequencies: "",
38
39
  };
package/dist/schema.d.mts CHANGED
@@ -74,6 +74,7 @@ export declare const npo: v.ObjectSchema<{
74
74
  lock: number;
75
75
  }, "must total to 100">]>, undefined>;
76
76
  readonly donateMethods: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], "required">, undefined>, undefined>;
77
+ readonly donate_frequencies: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["one-time", "monthly", "weekly", "annual"], "Please select donation frequency">, undefined>, v.TransformAction<("one-time" | "monthly" | "weekly" | "annual")[], ("one-time" | "monthly" | "weekly" | "annual")[]>, v.MinLengthAction<("one-time" | "monthly" | "weekly" | "annual")[], 1, "at least one frequency must be selected">]>, undefined>;
77
78
  readonly increments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
78
79
  readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<"required">, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>, import("valibot").TransformAction<string, number>, import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, "must be > 0">]>, import("valibot").TransformAction<number, string>]>, import("valibot").TransformAction<string, string>]>;
79
80
  readonly label: import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<"required">, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 60, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 60>) => string>]>;
@@ -140,6 +141,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
140
141
  lock: number;
141
142
  }, "must total to 100">]>, undefined>;
142
143
  readonly donateMethods: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], "required">, undefined>, undefined>;
144
+ readonly donate_frequencies: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["one-time", "monthly", "weekly", "annual"], "Please select donation frequency">, undefined>, v.TransformAction<("one-time" | "monthly" | "weekly" | "annual")[], ("one-time" | "monthly" | "weekly" | "annual")[]>, v.MinLengthAction<("one-time" | "monthly" | "weekly" | "annual")[], 1, "at least one frequency must be selected">]>, undefined>;
143
145
  readonly increments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
144
146
  readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<"required">, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>, import("valibot").TransformAction<string, number>, import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, "must be > 0">]>, import("valibot").TransformAction<number, string>]>, import("valibot").TransformAction<string, string>]>;
145
147
  readonly label: import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<"required">, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 60, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 60>) => string>]>;
@@ -206,6 +208,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
206
208
  lock: number;
207
209
  }, "must total to 100">]>, undefined>;
208
210
  readonly donateMethods: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], "required">, undefined>, undefined>;
211
+ readonly donate_frequencies: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["one-time", "monthly", "weekly", "annual"], "Please select donation frequency">, undefined>, v.TransformAction<("one-time" | "monthly" | "weekly" | "annual")[], ("one-time" | "monthly" | "weekly" | "annual")[]>, v.MinLengthAction<("one-time" | "monthly" | "weekly" | "annual")[], 1, "at least one frequency must be selected">]>, undefined>;
209
212
  readonly increments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
210
213
  readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<"required">, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>, import("valibot").TransformAction<string, number>, import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, "must be > 0">]>, import("valibot").TransformAction<number, string>]>, import("valibot").TransformAction<string, string>]>;
211
214
  readonly label: import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<"required">, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 60, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 60>) => string>]>;
@@ -251,6 +254,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
251
254
  lock: number;
252
255
  } | undefined;
253
256
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
257
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
254
258
  increments?: {
255
259
  value: string;
256
260
  label: string;
@@ -298,6 +302,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
298
302
  lock: number;
299
303
  } | undefined;
300
304
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
305
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
301
306
  increments?: {
302
307
  value: string;
303
308
  label: string;
@@ -346,6 +351,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
346
351
  lock: number;
347
352
  } | undefined;
348
353
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
354
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
349
355
  increments?: {
350
356
  value: string;
351
357
  label: string;
@@ -375,7 +381,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
375
381
  cash: number;
376
382
  liq: number;
377
383
  lock: number;
378
- }> | v.UrlIssue<string> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 10 | 5 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<string, 60> | v.MaxLengthIssue<{
384
+ }> | v.UrlIssue<string> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 10 | 5 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MinLengthIssue<("one-time" | "monthly" | "weekly" | "annual")[], 1> | v.MaxLengthIssue<string, 60> | v.MaxLengthIssue<{
379
385
  value: string;
380
386
  label: string;
381
387
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>>;
@@ -402,6 +408,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
402
408
  lock: number;
403
409
  } | undefined;
404
410
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
411
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
405
412
  increments?: {
406
413
  value: string;
407
414
  label: string;
@@ -450,6 +457,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
450
457
  lock: number;
451
458
  } | undefined;
452
459
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
460
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
453
461
  increments?: {
454
462
  value: string;
455
463
  label: string;
@@ -480,7 +488,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
480
488
  cash: number;
481
489
  liq: number;
482
490
  lock: number;
483
- }> | v.UrlIssue<string> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 10 | 5 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<string, 60> | v.MaxLengthIssue<{
491
+ }> | v.UrlIssue<string> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 10 | 5 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MinLengthIssue<("one-time" | "monthly" | "weekly" | "annual")[], 1> | v.MaxLengthIssue<string, 60> | v.MaxLengthIssue<{
484
492
  value: string;
485
493
  label: string;
486
494
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>;
@@ -512,6 +520,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
512
520
  lock: number;
513
521
  }, "must total to 100">]>, undefined>, undefined>;
514
522
  readonly donateMethods: v.OptionalSchema<v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["stripe", "crypto", "daf", "stocks"], "required">, undefined>, undefined>, undefined>;
523
+ readonly donate_frequencies: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["one-time", "monthly", "weekly", "annual"], "Please select donation frequency">, undefined>, v.TransformAction<("one-time" | "monthly" | "weekly" | "annual")[], ("one-time" | "monthly" | "weekly" | "annual")[]>, v.MinLengthAction<("one-time" | "monthly" | "weekly" | "annual")[], 1, "at least one frequency must be selected">]>, undefined>, undefined>;
515
524
  readonly increments: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
516
525
  readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<"required">, import("valibot").TrimAction]>, import("valibot").NonEmptyAction<string, "required">]>, import("valibot").TransformAction<string, number>, import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, 0, "must be > 0">]>, import("valibot").TransformAction<number, string>]>, import("valibot").TransformAction<string, string>]>;
517
526
  readonly label: import("valibot").SchemaWithPipe<readonly [import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<"required">, import("valibot").TrimAction]>, import("valibot").MaxLengthAction<string, 60, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 60>) => string>]>;
@@ -566,6 +575,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
566
575
  lock: number;
567
576
  } | undefined;
568
577
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
578
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
569
579
  increments?: {
570
580
  value: string;
571
581
  label: string;
@@ -613,6 +623,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
613
623
  lock: number;
614
624
  } | undefined;
615
625
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
626
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
616
627
  increments?: {
617
628
  value: string;
618
629
  label: string;
@@ -661,6 +672,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
661
672
  lock: number;
662
673
  } | undefined;
663
674
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
675
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
664
676
  increments?: {
665
677
  value: string;
666
678
  label: string;
@@ -690,7 +702,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
690
702
  cash: number;
691
703
  liq: number;
692
704
  lock: number;
693
- }> | v.UrlIssue<string> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 10 | 5 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<string, 60> | v.MaxLengthIssue<{
705
+ }> | v.UrlIssue<string> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 10 | 5 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MinLengthIssue<("one-time" | "monthly" | "weekly" | "annual")[], 1> | v.MaxLengthIssue<string, 60> | v.MaxLengthIssue<{
694
706
  value: string;
695
707
  label: string;
696
708
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>>;
@@ -717,6 +729,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
717
729
  lock: number;
718
730
  } | undefined;
719
731
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
732
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
720
733
  increments?: {
721
734
  value: string;
722
735
  label: string;
@@ -765,6 +778,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
765
778
  lock: number;
766
779
  } | undefined;
767
780
  donateMethods?: ("stripe" | "crypto" | "daf" | "stocks")[] | undefined;
781
+ donate_frequencies?: ("one-time" | "monthly" | "weekly" | "annual")[] | undefined;
768
782
  increments?: {
769
783
  value: string;
770
784
  label: string;
@@ -795,13 +809,13 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
795
809
  cash: number;
796
810
  liq: number;
797
811
  lock: number;
798
- }> | v.UrlIssue<string> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 10 | 5 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<string, 60> | v.MaxLengthIssue<{
812
+ }> | v.UrlIssue<string> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 10 | 5 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MinLengthIssue<("one-time" | "monthly" | "weekly" | "annual")[], 1> | v.MaxLengthIssue<string, 60> | v.MaxLengthIssue<{
799
813
  value: string;
800
814
  label: string;
801
815
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>;
802
816
  } | undefined;
803
817
  };
804
- export declare const npo_fields: v.PicklistSchema<["url", "slug", "keyword", "overview", "tagline", "image", "logo", "card_img", "active_in_countries", "street_address", "sdgs", "receiptMsg", "hide_bg_tip", "published", "progDonationsAllowed", "allocation", "donateMethods", "increments", "fund_opt_in", "target", "referral_id", "referrer", "referrer_expiry", "w_form", "payout_minimum", "donor_address_required", "id", "env", "registration_number", "name", "endow_designation", "hq_country", "social_media_urls", "claimed", "kyc_donors_only", "fiscal_sponsored"], undefined>;
818
+ export declare const npo_fields: v.PicklistSchema<["url", "slug", "keyword", "overview", "tagline", "image", "logo", "card_img", "active_in_countries", "street_address", "sdgs", "receiptMsg", "hide_bg_tip", "published", "progDonationsAllowed", "allocation", "donateMethods", "donate_frequencies", "increments", "fund_opt_in", "target", "referral_id", "referrer", "referrer_expiry", "w_form", "payout_minimum", "donor_address_required", "id", "env", "registration_number", "name", "endow_designation", "hq_country", "social_media_urls", "claimed", "kyc_donors_only", "fiscal_sponsored"], undefined>;
805
819
  export interface INpo extends v.InferOutput<typeof npo> {
806
820
  }
807
821
  export interface INpoUpdate extends v.InferOutput<typeof npo_update> {
@@ -809,7 +823,7 @@ export interface INpoUpdate extends v.InferOutput<typeof npo_update> {
809
823
  export type INpoFields = v.InferOutput<typeof npo_fields>;
810
824
  /** for ein path, only fields in reg-num/env gsi is available */
811
825
  export declare const npo_search: v.ObjectSchema<{
812
- readonly fields: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.LazySchema<v.SchemaWithPipe<readonly [v.StringSchema<"required">, v.TrimAction]> | v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<"required">, v.TrimAction]>, v.RegexAction<string, "invalid csv">]>>, v.TransformAction<string, string[]>, v.FilterItemsAction<string[]>]>, v.ArraySchema<v.PicklistSchema<["url", "slug", "keyword", "overview", "tagline", "image", "logo", "card_img", "active_in_countries", "street_address", "sdgs", "receiptMsg", "hide_bg_tip", "published", "progDonationsAllowed", "allocation", "donateMethods", "increments", "fund_opt_in", "target", "referral_id", "referrer", "referrer_expiry", "w_form", "payout_minimum", "donor_address_required", "id", "env", "registration_number", "name", "endow_designation", "hq_country", "social_media_urls", "claimed", "kyc_donors_only", "fiscal_sponsored"], undefined>, undefined>]>, undefined>;
826
+ readonly fields: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.LazySchema<v.SchemaWithPipe<readonly [v.StringSchema<"required">, v.TrimAction]> | v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<"required">, v.TrimAction]>, v.RegexAction<string, "invalid csv">]>>, v.TransformAction<string, string[]>, v.FilterItemsAction<string[]>]>, v.ArraySchema<v.PicklistSchema<["url", "slug", "keyword", "overview", "tagline", "image", "logo", "card_img", "active_in_countries", "street_address", "sdgs", "receiptMsg", "hide_bg_tip", "published", "progDonationsAllowed", "allocation", "donateMethods", "donate_frequencies", "increments", "fund_opt_in", "target", "referral_id", "referrer", "referrer_expiry", "w_form", "payout_minimum", "donor_address_required", "id", "env", "registration_number", "name", "endow_designation", "hq_country", "social_media_urls", "claimed", "kyc_donors_only", "fiscal_sponsored"], undefined>, undefined>]>, undefined>;
813
827
  }, undefined>;
814
828
  export interface INposSearch extends v.InferInput<typeof npo_search> {
815
829
  }
package/dist/schema.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $, $int_gte1, $req, MAX_NUM_INCREMENTS, donate_method_id, env, https_url, increment, int_gte1, org_designation, slug, target, unsdg_num, } from "@better-giving/schemas";
1
+ import { $, $int_gte1, $req, MAX_NUM_INCREMENTS, donate_method_id, env, https_url, increment, int_gte1, org_designation, slug, target, unsdg_num, frequency_opts, } from "@better-giving/schemas";
2
2
  export { $, $req, $req_num_gt0, donate_method_id, env, https_url, int_gte1, $int_gte1, org_designation, slug, unsdg_num, } from "@better-giving/schemas";
3
3
  import * as v from "valibot";
4
4
  export const min_payout_amount = 50;
@@ -57,6 +57,7 @@ export const npo = v.object({
57
57
  progDonationsAllowed: v.optional(v.boolean()),
58
58
  allocation: v.optional(allocation),
59
59
  donateMethods: v.optional(v.array(donate_method_id)),
60
+ donate_frequencies: v.optional(frequency_opts),
60
61
  increments: v.optional(v.pipe(v.array(increment), v.maxLength(MAX_NUM_INCREMENTS, ({ requirement }) => `cannot have more than ${requirement} increments`))),
61
62
  fund_opt_in: v.optional(v.boolean()),
62
63
  target: v.optional(target),
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@better-giving/endowment",
3
- "version": "6.1.0",
3
+ "version": "7.0.0",
4
4
  "dependencies": {
5
5
  "ksuid": "3.0.0"
6
6
  },
7
7
  "peerDependencies": {
8
- "@better-giving/schemas": "^2.0.0",
8
+ "@better-giving/schemas": "^2.3.0",
9
9
  "@better-giving/types": "^1.0.0",
10
10
  "@better-giving/db": "^2.0.0",
11
11
  "@aws-sdk/lib-dynamodb": "^3.900.0",
package/src/db.mts CHANGED
@@ -189,8 +189,7 @@ export class NpoDb extends Db {
189
189
  return i && this.sans_keys(i);
190
190
  }
191
191
  async npo_with_keyword(
192
- keyword: string,
193
- env = this.env
192
+ keyword: string
194
193
  ): Promise<INpoWithKeyword | undefined> {
195
194
  const cmd = new QueryCommand({
196
195
  TableName: NpoDb.table,
@@ -202,7 +201,7 @@ export class NpoDb extends Db {
202
201
  },
203
202
  ExpressionAttributeValues: {
204
203
  ":kw": keyword,
205
- ":env": env,
204
+ ":env": this.env,
206
205
  },
207
206
  Limit: 1,
208
207
  });
package/src/npo.mts CHANGED
@@ -37,4 +37,5 @@ export const npo_fields: { [K in keyof Required<INpo>]: "" } = {
37
37
  w_form: "",
38
38
  payout_minimum: "",
39
39
  donor_address_required: "",
40
+ donate_frequencies: "",
40
41
  };
package/src/schema.mts CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  slug,
13
13
  target,
14
14
  unsdg_num,
15
+ frequency_opts,
15
16
  } from "@better-giving/schemas";
16
17
  export {
17
18
  $,
@@ -114,6 +115,7 @@ export const npo = v.object({
114
115
 
115
116
  allocation: v.optional(allocation),
116
117
  donateMethods: v.optional(v.array(donate_method_id)),
118
+ donate_frequencies: v.optional(frequency_opts),
117
119
  increments: v.optional(
118
120
  v.pipe(
119
121
  v.array(increment),