@better-giving/schemas 1.0.1

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.
@@ -0,0 +1,16 @@
1
+ import { type InferOutput } from "valibot";
2
+ export declare const fileObject: import("valibot").ObjectSchema<{
3
+ readonly name: import("valibot").StringSchema<undefined>;
4
+ readonly publicUrl: import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").UrlAction<string, undefined>]>;
5
+ }, undefined>;
6
+ export declare const orgDesignations: readonly ["Charity", "Religious Organization", "University", "Hospital", "Other"];
7
+ export declare const orgDesignation: import("valibot").PicklistSchema<readonly ["Charity", "Religious Organization", "University", "Hospital", "Other"], undefined>;
8
+ export type OrgDesignation = InferOutput<typeof orgDesignation>;
9
+ export interface FileObject extends InferOutput<typeof fileObject> {
10
+ }
11
+ export declare const unSdgNums: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
12
+ export declare const unSdgNum: import("valibot").PicklistSchema<readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], undefined>;
13
+ export type UnSdgNum = InferOutput<typeof unSdgNum>;
14
+ export declare const envs: readonly ["staging", "production"];
15
+ export declare const env: import("valibot").PicklistSchema<readonly ["staging", "production"], undefined>;
16
+ export type Environment = InferOutput<typeof env>;
package/dist/index.mjs ADDED
@@ -0,0 +1,19 @@
1
+ import { url, object, picklist, pipe, string } from "valibot";
2
+ export const fileObject = object({
3
+ name: string(),
4
+ publicUrl: pipe(string(), url()),
5
+ });
6
+ export const orgDesignations = [
7
+ "Charity",
8
+ "Religious Organization",
9
+ "University",
10
+ "Hospital",
11
+ "Other",
12
+ ];
13
+ export const orgDesignation = picklist(orgDesignations);
14
+ export const unSdgNums = [
15
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
16
+ ];
17
+ export const unSdgNum = picklist(unSdgNums);
18
+ export const envs = ["staging", "production"];
19
+ export const env = picklist(envs);
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@better-giving/schemas",
3
+ "version": "1.0.1",
4
+ "devDependencies": {
5
+ "@better-giving/config": "workspace:*"
6
+ },
7
+ "files": [
8
+ "src",
9
+ "dist"
10
+ ],
11
+ "peerDependencies": {
12
+ "valibot": "0.42.0"
13
+ },
14
+ "scripts": {
15
+ "publish": "npm publish --access public",
16
+ "build": "tsc --outDir dist"
17
+ },
18
+ "exports": {
19
+ ".": "./dist/index.mjs"
20
+ }
21
+ }
package/src/index.mts ADDED
@@ -0,0 +1,30 @@
1
+ import { url, type InferOutput, object, picklist, pipe, string } from "valibot";
2
+
3
+ export const fileObject = object({
4
+ name: string(),
5
+ publicUrl: pipe(string(), url()),
6
+ });
7
+
8
+ export const orgDesignations = [
9
+ "Charity",
10
+ "Religious Organization",
11
+ "University",
12
+ "Hospital",
13
+ "Other",
14
+ ] as const;
15
+
16
+ export const orgDesignation = picklist(orgDesignations);
17
+ export type OrgDesignation = InferOutput<typeof orgDesignation>;
18
+
19
+ export interface FileObject extends InferOutput<typeof fileObject> {}
20
+
21
+ export const unSdgNums = [
22
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
23
+ ] as const;
24
+
25
+ export const unSdgNum = picklist(unSdgNums);
26
+ export type UnSdgNum = InferOutput<typeof unSdgNum>;
27
+
28
+ export const envs = ["staging", "production"] as const;
29
+ export const env = picklist(envs);
30
+ export type Environment = InferOutput<typeof env>;