@better-giving/endowment 3.0.2 → 3.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.
package/dist/schema.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { $, $int_gte1, $req, $req_num_gt0, donate_method_id, donate_method_ids, env, int_gte1, org_designation, unsdg_num } from "@better-giving/schemas";
2
- export { org_designation as endow_designation, env, unsdg_num, donate_method_id, donate_method_ids, $int_gte1, int_gte1, $, $req_num_gt0, $req, };
1
+ import { $, $int_gte1, $req, $req_num_gt0, donate_method_id, donate_method_ids, env, int_gte1, org_designation, unsdg_num, slug } from "@better-giving/schemas";
2
+ export { org_designation as endow_designation, env, unsdg_num, donate_method_id, donate_method_ids, $int_gte1, int_gte1, $, $req_num_gt0, $req, slug, };
3
3
  import * as v from "valibot";
4
4
  export declare const min_payout_amount = 50;
5
5
  export declare const csv: v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.RegexAction<string, "invalid csv">]>>;
@@ -15,9 +15,6 @@ export declare const allocation: v.SchemaWithPipe<[v.ObjectSchema<{
15
15
  }, "must total to 100">]>;
16
16
  export interface IAllocation extends v.InferOutput<typeof allocation> {
17
17
  }
18
- export declare const segment_max_chars = 30;
19
- export declare const segment: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: v.MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>;
20
- export declare const slug: v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: v.MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>;
21
18
  export declare const reg_number: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, "required">, v.RegexAction<string, "must only contain letters and numbers">]>;
22
19
  export declare const _url: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.UrlAction<string, undefined>]>;
23
20
  export declare const social_media_urls: v.ObjectSchema<{
@@ -46,7 +43,7 @@ export interface IIncrement extends v.InferOutput<typeof increment> {
46
43
  export declare const npo: v.ObjectSchema<{
47
44
  readonly id: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
48
45
  readonly env: v.PicklistSchema<readonly ["staging", "production"], undefined>;
49
- readonly slug: v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: v.MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>, never>;
46
+ readonly slug: v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>, never>;
50
47
  readonly registration_number: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, "required">, v.RegexAction<string, "must only contain letters and numbers">]>;
51
48
  readonly name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, "required">]>;
52
49
  readonly endow_designation: v.PicklistSchema<readonly ["Charity", "Religious Organization", "University", "Hospital", "Other"], undefined>;
@@ -107,7 +104,7 @@ export declare const npo: v.ObjectSchema<{
107
104
  export declare const npo_update: Omit<Omit<v.ObjectSchema<{
108
105
  readonly id: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
109
106
  readonly env: v.PicklistSchema<readonly ["staging", "production"], undefined>;
110
- readonly slug: v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: v.MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>, never>;
107
+ readonly slug: v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>, never>;
111
108
  readonly registration_number: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, "required">, v.RegexAction<string, "must only contain letters and numbers">]>;
112
109
  readonly name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, "required">]>;
113
110
  readonly endow_designation: v.PicklistSchema<readonly ["Charity", "Religious Organization", "University", "Hospital", "Other"], undefined>;
@@ -168,7 +165,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
168
165
  readonly entries: Omit<{
169
166
  readonly id: v.SchemaWithPipe<[v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
170
167
  readonly env: v.PicklistSchema<readonly ["staging", "production"], undefined>;
171
- readonly slug: v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: v.MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>, never>;
168
+ readonly slug: v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>, never>;
172
169
  readonly registration_number: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, "required">, v.RegexAction<string, "must only contain letters and numbers">]>;
173
170
  readonly name: v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, "required">]>;
174
171
  readonly endow_designation: v.PicklistSchema<readonly ["Charity", "Religious Organization", "University", "Hospital", "Other"], undefined>;
@@ -230,7 +227,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
230
227
  cash: number;
231
228
  liq: number;
232
229
  lock: number;
233
- }> | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.CustomIssue | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
230
+ }> | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
234
231
  value: string;
235
232
  label: string;
236
233
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>>): v.Dataset<{
@@ -282,7 +279,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
282
279
  cash: number;
283
280
  liq: number;
284
281
  lock: number;
285
- }> | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.CustomIssue | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
282
+ }> | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
286
283
  value: string;
287
284
  label: string;
288
285
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>>;
@@ -383,7 +380,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
383
380
  cash: number;
384
381
  liq: number;
385
382
  lock: number;
386
- }> | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.CustomIssue | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
383
+ }> | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
387
384
  value: string;
388
385
  label: string;
389
386
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>;
@@ -391,7 +388,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
391
388
  }, "_run" | "_types" | "entries"> & {
392
389
  readonly entries: {
393
390
  readonly url: v.OptionalSchema<v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.NonEmptyAction<string, "required">]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.TransformAction<string, string>, v.UrlAction<string, "invalid url">]>>, never>, never>;
394
- readonly slug: v.OptionalSchema<v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: v.MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>, never>, never>;
391
+ readonly slug: v.OptionalSchema<v.OptionalSchema<v.LazySchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]> | v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 30, ({ requirement: r }: import("valibot").MaxLengthIssue<string, 30>) => string>, v.RegexAction<string, "should not be an id">, v.RegexAction<string, "allowed: numbers | letters | - | . | _ | ~">, v.ExcludesAction<string, "..", "should not contain double periods">, v.CustomSchema<string, "should not start with dot">, v.CustomSchema<string, "should not end with dot">]>>, never>, never>;
395
392
  readonly overview: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, never>, never>;
396
393
  readonly tagline: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.MaxLengthAction<string, 140, undefined>]>, never>, never>;
397
394
  readonly image: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<[v.SchemaWithPipe<[v.StringSchema<undefined>, v.TrimAction]>, v.UrlAction<string, undefined>]>, never>, never>;
@@ -446,7 +443,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
446
443
  cash: number;
447
444
  liq: number;
448
445
  lock: number;
449
- }> | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.CustomIssue | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
446
+ }> | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
450
447
  value: string;
451
448
  label: string;
452
449
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>>): v.Dataset<{
@@ -498,7 +495,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
498
495
  cash: number;
499
496
  liq: number;
500
497
  lock: number;
501
- }> | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.CustomIssue | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
498
+ }> | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
502
499
  value: string;
503
500
  label: string;
504
501
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>>;
@@ -599,7 +596,7 @@ export declare const npo_update: Omit<Omit<v.ObjectSchema<{
599
596
  cash: number;
600
597
  liq: number;
601
598
  lock: number;
602
- }> | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.CustomIssue | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
599
+ }> | v.NonEmptyIssue<string> | v.UrlIssue<string> | v.MaxLengthIssue<string, 60> | v.PicklistIssue | v.CustomIssue | v.MaxLengthIssue<string, 30> | v.ExcludesIssue<string, ".."> | v.MaxLengthIssue<string, 140> | v.ArrayIssue | v.NonEmptyIssue<string[]> | v.MinLengthIssue<(2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17)[], 1> | v.MaxLengthIssue<string, 500> | v.BooleanIssue | v.MaxLengthIssue<{
603
600
  value: string;
604
601
  label: string;
605
602
  }[], 4> | v.LiteralIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.MinValueIssue<number, 0> | v.LiteralIssue> | v.IsoTimestampIssue<string> | v.MinValueIssue<number, 50>;
package/dist/schema.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { $, $int_gte1, $req, $req_num_gt0, donate_method_id, donate_method_ids, env, https_url, int_gte1, org_designation, unsdg_num, } from "@better-giving/schemas";
2
- export { org_designation as endow_designation, env, unsdg_num, donate_method_id, donate_method_ids, $int_gte1, int_gte1, $, $req_num_gt0, $req, };
1
+ import { $, $int_gte1, $req, $req_num_gt0, donate_method_id, donate_method_ids, env, https_url, int_gte1, org_designation, unsdg_num, slug, } from "@better-giving/schemas";
2
+ export { org_designation as endow_designation, env, unsdg_num, donate_method_id, donate_method_ids, $int_gte1, int_gte1, $, $req_num_gt0, $req, slug, };
3
3
  import * as v from "valibot";
4
4
  export const min_payout_amount = 50;
5
5
  export const csv = v.lazy((x) => {
@@ -14,13 +14,6 @@ export const allocation = v.pipe(v.object({
14
14
  liq: pct,
15
15
  lock: pct,
16
16
  }), v.check((x) => x.cash + x.liq + x.lock === 100, "must total to 100"));
17
- export const segment_max_chars = 30;
18
- export const segment = v.pipe($, v.maxLength(segment_max_chars, ({ requirement: r }) => `cannot exceed ${r} chars`),
19
- //must not be id-like
20
- v.regex(/^(?!^\d+$)/, "should not be an id"),
21
- //valid characters
22
- v.regex(/^[a-zA-Z0-9-._~]+$/, "allowed: numbers | letters | - | . | _ | ~"), v.excludes("..", "should not contain double periods"), v.custom((x) => !x.startsWith("."), "should not start with dot"), v.custom((x) => !x.endsWith("."), "should not end with dot"));
23
- export const slug = v.lazy((x) => (x ? segment : $));
24
17
  export const reg_number = v.pipe($, v.nonEmpty("required"), v.regex(/^[a-zA-Z0-9]+$/, "must only contain letters and numbers"));
25
18
  export const _url = v.pipe($, v.url());
26
19
  export const social_media_urls = v.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/endowment",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "dependencies": {
5
5
  "ksuid": "3.0.0"
6
6
  },
package/src/schema.mts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  int_gte1,
11
11
  org_designation,
12
12
  unsdg_num,
13
+ slug,
13
14
  } from "@better-giving/schemas";
14
15
  export {
15
16
  org_designation as endow_designation,
@@ -22,6 +23,7 @@ export {
22
23
  $,
23
24
  $req_num_gt0,
24
25
  $req,
26
+ slug,
25
27
  };
26
28
  import * as v from "valibot";
27
29