@samoa-house-lib/shl-types 1.3.4 → 1.3.6
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/src/constants.d.ts +98 -0
- package/dist/src/constants.js +106 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +18 -0
- package/dist/src/types.d.ts +379 -0
- package/dist/src/types.js +74 -0
- package/package.json +2 -2
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export declare enum SectionVariant {
|
|
2
|
+
MOANA = "Moana",
|
|
3
|
+
MAORI = "Toi Maori",
|
|
4
|
+
AOTEAROA = "Aotearoa Art",
|
|
5
|
+
INTERNATIONAL = "International Art",
|
|
6
|
+
THEORY = "Theory",
|
|
7
|
+
HISTORY = "Art History",
|
|
8
|
+
LITERATURE = "Literature",
|
|
9
|
+
REFERENCE = "Reference"
|
|
10
|
+
}
|
|
11
|
+
export declare enum ConditionVariant {
|
|
12
|
+
EXQUISITE = "Mint",
|
|
13
|
+
GOOD = "Good",
|
|
14
|
+
OK = "Okay",
|
|
15
|
+
BAD = "Bad",
|
|
16
|
+
RUIN = "Poor",
|
|
17
|
+
BINDING = "Binding Undone",
|
|
18
|
+
TORN = "Pages Torn",
|
|
19
|
+
SUN = "Sun Damage",
|
|
20
|
+
WET = "Moisture Damage",
|
|
21
|
+
COVER_MISS = "Cover Missing",
|
|
22
|
+
PAGE_MISS = "Pages Missing",
|
|
23
|
+
NOTES = "Hand-written Notation"
|
|
24
|
+
}
|
|
25
|
+
export declare enum TextVariant {
|
|
26
|
+
DEFAULT = "Book",
|
|
27
|
+
HARDCOVER = "Hardcover",
|
|
28
|
+
PAPERBACK = "Paperback",
|
|
29
|
+
CHAPBOOK = "Chapbook",
|
|
30
|
+
JOURNAL = "Journal",
|
|
31
|
+
MAGAZINE = "Magazine",
|
|
32
|
+
ZINE = "Zine",
|
|
33
|
+
RECORD = "Record",
|
|
34
|
+
CATALOGUE = "Catalogue",
|
|
35
|
+
REPORT = "Report",
|
|
36
|
+
LARGE = "Large",
|
|
37
|
+
SMALL = "Small",
|
|
38
|
+
ARCHIVE = "Archive Box",
|
|
39
|
+
EPHEMERA = "Ephemera",
|
|
40
|
+
AUC_CATA = "Auction Catalogue",
|
|
41
|
+
EX_CATA = "Exhibition Catalogue",
|
|
42
|
+
EX_TEXT = "Exhibition Text",
|
|
43
|
+
EX_PROG = "Exhibition Programme",
|
|
44
|
+
GAL_PUB = "Gallery Publication",
|
|
45
|
+
ARTIST_BOOK = "Artist Book",
|
|
46
|
+
ARTIST_PUB = "Artist Publication",
|
|
47
|
+
ARTWORK = "Artwork",
|
|
48
|
+
NEWSPAPER = "Newspaper",
|
|
49
|
+
NEWSLETTER = "Newsletter",
|
|
50
|
+
POSTCARD = "Postcard",
|
|
51
|
+
CARD = "Card",
|
|
52
|
+
POSTER = "Poster",
|
|
53
|
+
OHP = "Overhead Projector Laminate",
|
|
54
|
+
TAPE = "Cassette Tape",
|
|
55
|
+
DVD = "DVD",
|
|
56
|
+
VHS = "VHS",
|
|
57
|
+
CD = "CD",
|
|
58
|
+
ESSAY = "Essay",
|
|
59
|
+
RINGBOUND = "Ringbound",
|
|
60
|
+
ENVELOPE = "Envelope",
|
|
61
|
+
CALENDAR = "Calendar",
|
|
62
|
+
MEMOIR = "Memoir",
|
|
63
|
+
SPECIAL = "Special",
|
|
64
|
+
NOTEBOOK = "Notebook",
|
|
65
|
+
MULTI_VOL = "Multiple Volumes",
|
|
66
|
+
PAPER = "Paper",
|
|
67
|
+
CRAFT = "Hand Crafted",
|
|
68
|
+
THESIS = "Thesis",
|
|
69
|
+
MONOGRAPH = "Monograph",
|
|
70
|
+
BOOKLET = "Booklet",
|
|
71
|
+
SLIP = "Slipcase",
|
|
72
|
+
CONF_TEXT = "Conference Text"
|
|
73
|
+
}
|
|
74
|
+
export declare enum ColumnNames {
|
|
75
|
+
ID = "id",
|
|
76
|
+
RUNNING_NUMBER = "running_number",
|
|
77
|
+
DONOR_FIRST_NAME = "donor_first_name",
|
|
78
|
+
DONOR_LAST_NAME = "donor_last_name",
|
|
79
|
+
SHL_ID = "shl_id",
|
|
80
|
+
TERMS = "terms",
|
|
81
|
+
TITLE = "title",
|
|
82
|
+
AUTHOR_FIRST_NAME = "author_first_name",
|
|
83
|
+
AUTHOR_LAST_NAME = "author_last_name",
|
|
84
|
+
ISBN_ISSN = "isbn_issn",
|
|
85
|
+
RECIEPEIENT = "recipient",
|
|
86
|
+
DATE_PROCESSED = "date_processed",
|
|
87
|
+
SECTION = "section",
|
|
88
|
+
BOOK_TYPE = "book_type",
|
|
89
|
+
PUBLISHER = "publisher",
|
|
90
|
+
DATE_PUBLISHED = "date_published",
|
|
91
|
+
NOTES = "notes",
|
|
92
|
+
SPECIAL_CONDITION = "special_conditions",
|
|
93
|
+
CONDITION = "condition"
|
|
94
|
+
}
|
|
95
|
+
export declare enum Responses {
|
|
96
|
+
SUCCESS = "Request Success",
|
|
97
|
+
FAILURE = "Request Failure"
|
|
98
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Responses = exports.ColumnNames = exports.TextVariant = exports.ConditionVariant = exports.SectionVariant = void 0;
|
|
4
|
+
var SectionVariant;
|
|
5
|
+
(function (SectionVariant) {
|
|
6
|
+
SectionVariant["MOANA"] = "Moana";
|
|
7
|
+
SectionVariant["MAORI"] = "Toi Maori";
|
|
8
|
+
SectionVariant["AOTEAROA"] = "Aotearoa Art";
|
|
9
|
+
SectionVariant["INTERNATIONAL"] = "International Art";
|
|
10
|
+
SectionVariant["THEORY"] = "Theory";
|
|
11
|
+
SectionVariant["HISTORY"] = "Art History";
|
|
12
|
+
SectionVariant["LITERATURE"] = "Literature";
|
|
13
|
+
SectionVariant["REFERENCE"] = "Reference";
|
|
14
|
+
})(SectionVariant || (exports.SectionVariant = SectionVariant = {}));
|
|
15
|
+
var ConditionVariant;
|
|
16
|
+
(function (ConditionVariant) {
|
|
17
|
+
ConditionVariant["EXQUISITE"] = "Mint";
|
|
18
|
+
ConditionVariant["GOOD"] = "Good";
|
|
19
|
+
ConditionVariant["OK"] = "Okay";
|
|
20
|
+
ConditionVariant["BAD"] = "Bad";
|
|
21
|
+
ConditionVariant["RUIN"] = "Poor";
|
|
22
|
+
ConditionVariant["BINDING"] = "Binding Undone";
|
|
23
|
+
ConditionVariant["TORN"] = "Pages Torn";
|
|
24
|
+
ConditionVariant["SUN"] = "Sun Damage";
|
|
25
|
+
ConditionVariant["WET"] = "Moisture Damage";
|
|
26
|
+
ConditionVariant["COVER_MISS"] = "Cover Missing";
|
|
27
|
+
ConditionVariant["PAGE_MISS"] = "Pages Missing";
|
|
28
|
+
ConditionVariant["NOTES"] = "Hand-written Notation";
|
|
29
|
+
})(ConditionVariant || (exports.ConditionVariant = ConditionVariant = {}));
|
|
30
|
+
var TextVariant;
|
|
31
|
+
(function (TextVariant) {
|
|
32
|
+
TextVariant["DEFAULT"] = "Book";
|
|
33
|
+
TextVariant["HARDCOVER"] = "Hardcover";
|
|
34
|
+
TextVariant["PAPERBACK"] = "Paperback";
|
|
35
|
+
TextVariant["CHAPBOOK"] = "Chapbook";
|
|
36
|
+
TextVariant["JOURNAL"] = "Journal";
|
|
37
|
+
TextVariant["MAGAZINE"] = "Magazine";
|
|
38
|
+
TextVariant["ZINE"] = "Zine";
|
|
39
|
+
TextVariant["RECORD"] = "Record";
|
|
40
|
+
TextVariant["CATALOGUE"] = "Catalogue";
|
|
41
|
+
TextVariant["REPORT"] = "Report";
|
|
42
|
+
TextVariant["LARGE"] = "Large";
|
|
43
|
+
TextVariant["SMALL"] = "Small";
|
|
44
|
+
TextVariant["ARCHIVE"] = "Archive Box";
|
|
45
|
+
TextVariant["EPHEMERA"] = "Ephemera";
|
|
46
|
+
TextVariant["AUC_CATA"] = "Auction Catalogue";
|
|
47
|
+
TextVariant["EX_CATA"] = "Exhibition Catalogue";
|
|
48
|
+
TextVariant["EX_TEXT"] = "Exhibition Text";
|
|
49
|
+
TextVariant["EX_PROG"] = "Exhibition Programme";
|
|
50
|
+
TextVariant["GAL_PUB"] = "Gallery Publication";
|
|
51
|
+
TextVariant["ARTIST_BOOK"] = "Artist Book";
|
|
52
|
+
TextVariant["ARTIST_PUB"] = "Artist Publication";
|
|
53
|
+
TextVariant["ARTWORK"] = "Artwork";
|
|
54
|
+
TextVariant["NEWSPAPER"] = "Newspaper";
|
|
55
|
+
TextVariant["NEWSLETTER"] = "Newsletter";
|
|
56
|
+
TextVariant["POSTCARD"] = "Postcard";
|
|
57
|
+
TextVariant["CARD"] = "Card";
|
|
58
|
+
TextVariant["POSTER"] = "Poster";
|
|
59
|
+
TextVariant["OHP"] = "Overhead Projector Laminate";
|
|
60
|
+
TextVariant["TAPE"] = "Cassette Tape";
|
|
61
|
+
TextVariant["DVD"] = "DVD";
|
|
62
|
+
TextVariant["VHS"] = "VHS";
|
|
63
|
+
TextVariant["CD"] = "CD";
|
|
64
|
+
TextVariant["ESSAY"] = "Essay";
|
|
65
|
+
TextVariant["RINGBOUND"] = "Ringbound";
|
|
66
|
+
TextVariant["ENVELOPE"] = "Envelope";
|
|
67
|
+
TextVariant["CALENDAR"] = "Calendar";
|
|
68
|
+
TextVariant["MEMOIR"] = "Memoir";
|
|
69
|
+
TextVariant["SPECIAL"] = "Special";
|
|
70
|
+
TextVariant["NOTEBOOK"] = "Notebook";
|
|
71
|
+
TextVariant["MULTI_VOL"] = "Multiple Volumes";
|
|
72
|
+
TextVariant["PAPER"] = "Paper";
|
|
73
|
+
TextVariant["CRAFT"] = "Hand Crafted";
|
|
74
|
+
TextVariant["THESIS"] = "Thesis";
|
|
75
|
+
TextVariant["MONOGRAPH"] = "Monograph";
|
|
76
|
+
TextVariant["BOOKLET"] = "Booklet";
|
|
77
|
+
TextVariant["SLIP"] = "Slipcase";
|
|
78
|
+
TextVariant["CONF_TEXT"] = "Conference Text";
|
|
79
|
+
})(TextVariant || (exports.TextVariant = TextVariant = {}));
|
|
80
|
+
var ColumnNames;
|
|
81
|
+
(function (ColumnNames) {
|
|
82
|
+
ColumnNames["ID"] = "id";
|
|
83
|
+
ColumnNames["RUNNING_NUMBER"] = "running_number";
|
|
84
|
+
ColumnNames["DONOR_FIRST_NAME"] = "donor_first_name";
|
|
85
|
+
ColumnNames["DONOR_LAST_NAME"] = "donor_last_name";
|
|
86
|
+
ColumnNames["SHL_ID"] = "shl_id";
|
|
87
|
+
ColumnNames["TERMS"] = "terms";
|
|
88
|
+
ColumnNames["TITLE"] = "title";
|
|
89
|
+
ColumnNames["AUTHOR_FIRST_NAME"] = "author_first_name";
|
|
90
|
+
ColumnNames["AUTHOR_LAST_NAME"] = "author_last_name";
|
|
91
|
+
ColumnNames["ISBN_ISSN"] = "isbn_issn";
|
|
92
|
+
ColumnNames["RECIEPEIENT"] = "recipient";
|
|
93
|
+
ColumnNames["DATE_PROCESSED"] = "date_processed";
|
|
94
|
+
ColumnNames["SECTION"] = "section";
|
|
95
|
+
ColumnNames["BOOK_TYPE"] = "book_type";
|
|
96
|
+
ColumnNames["PUBLISHER"] = "publisher";
|
|
97
|
+
ColumnNames["DATE_PUBLISHED"] = "date_published";
|
|
98
|
+
ColumnNames["NOTES"] = "notes";
|
|
99
|
+
ColumnNames["SPECIAL_CONDITION"] = "special_conditions";
|
|
100
|
+
ColumnNames["CONDITION"] = "condition";
|
|
101
|
+
})(ColumnNames || (exports.ColumnNames = ColumnNames = {}));
|
|
102
|
+
var Responses;
|
|
103
|
+
(function (Responses) {
|
|
104
|
+
Responses["SUCCESS"] = "Request Success";
|
|
105
|
+
Responses["FAILURE"] = "Request Failure";
|
|
106
|
+
})(Responses || (exports.Responses = Responses = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export type Book = z.infer<typeof dbEntrySchema>;
|
|
3
|
+
export type BookBatch = z.infer<typeof bookBatchSchema>;
|
|
4
|
+
export type BookWithID = z.infer<typeof newDbEntrySchema>;
|
|
5
|
+
export type CreateBookRequest = z.infer<typeof addBookRequest>;
|
|
6
|
+
export type UpdateRequest = z.infer<typeof updateRequestSchema>;
|
|
7
|
+
export type ColumnName = z.infer<typeof dbColumnNameSchema>;
|
|
8
|
+
export type ShlID = z.infer<typeof shlIdSchema>;
|
|
9
|
+
export type Name = z.infer<typeof nameSchema>;
|
|
10
|
+
export type Terms = z.infer<typeof termsSchema>;
|
|
11
|
+
export type Section = z.infer<typeof sectionSchema>;
|
|
12
|
+
export type TextType = z.infer<typeof textTypeSchema>;
|
|
13
|
+
export type Condition = z.infer<typeof conditionSchema>;
|
|
14
|
+
export declare const shlIdSchema: z.ZodBranded<z.ZodString, "SamoaHouseLibraryID">;
|
|
15
|
+
export declare const nameSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
16
|
+
export declare const termsSchema: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"D">, z.ZodLiteral<"R">]>>;
|
|
17
|
+
export declare const dbColumnNameSchema: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
|
|
18
|
+
export declare const sectionSchema: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
|
|
19
|
+
export declare const textTypeSchema: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
|
|
20
|
+
export declare const conditionSchema: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
|
|
21
|
+
export declare const addBookRequest: z.ZodObject<{
|
|
22
|
+
donor_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
23
|
+
donor_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
24
|
+
terms: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"D">, z.ZodLiteral<"R">]>>>;
|
|
25
|
+
title: z.ZodString;
|
|
26
|
+
author_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
27
|
+
author_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
28
|
+
isbn_issn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
recipient: z.ZodString;
|
|
30
|
+
date_processed: z.ZodString;
|
|
31
|
+
section: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>>;
|
|
32
|
+
book_type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
33
|
+
publisher: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
34
|
+
date_published: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
35
|
+
notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
36
|
+
special_conditions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
37
|
+
condition: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
title: string;
|
|
40
|
+
recipient: string;
|
|
41
|
+
date_processed: string;
|
|
42
|
+
donor_first_name?: string | undefined;
|
|
43
|
+
donor_last_name?: string | null | undefined;
|
|
44
|
+
terms?: "D" | "R" | undefined;
|
|
45
|
+
author_first_name?: string | undefined;
|
|
46
|
+
author_last_name?: string | null | undefined;
|
|
47
|
+
isbn_issn?: string | null | undefined;
|
|
48
|
+
section?: string | null | undefined;
|
|
49
|
+
book_type?: string | undefined;
|
|
50
|
+
publisher?: string | null | undefined;
|
|
51
|
+
date_published?: string | null | undefined;
|
|
52
|
+
notes?: string | null | undefined;
|
|
53
|
+
special_conditions?: string | null | undefined;
|
|
54
|
+
condition?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
title: string;
|
|
57
|
+
recipient: string;
|
|
58
|
+
date_processed: string;
|
|
59
|
+
donor_first_name?: string | undefined;
|
|
60
|
+
donor_last_name?: string | null | undefined;
|
|
61
|
+
terms?: "D" | "R" | undefined;
|
|
62
|
+
author_first_name?: string | undefined;
|
|
63
|
+
author_last_name?: string | null | undefined;
|
|
64
|
+
isbn_issn?: string | null | undefined;
|
|
65
|
+
section?: string | null | undefined;
|
|
66
|
+
book_type?: string | undefined;
|
|
67
|
+
publisher?: string | null | undefined;
|
|
68
|
+
date_published?: string | null | undefined;
|
|
69
|
+
notes?: string | null | undefined;
|
|
70
|
+
special_conditions?: string | null | undefined;
|
|
71
|
+
condition?: string | undefined;
|
|
72
|
+
}>;
|
|
73
|
+
export declare const newDbEntrySchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
74
|
+
donor_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
75
|
+
donor_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
76
|
+
terms: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"D">, z.ZodLiteral<"R">]>>>;
|
|
77
|
+
title: z.ZodString;
|
|
78
|
+
author_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
79
|
+
author_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
80
|
+
isbn_issn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
81
|
+
recipient: z.ZodString;
|
|
82
|
+
date_processed: z.ZodString;
|
|
83
|
+
section: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>>;
|
|
84
|
+
book_type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
85
|
+
publisher: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
86
|
+
date_published: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
87
|
+
notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
88
|
+
special_conditions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
89
|
+
condition: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
90
|
+
}, {
|
|
91
|
+
shl_id: z.ZodBranded<z.ZodString, "SamoaHouseLibraryID">;
|
|
92
|
+
}>, "strip", z.ZodTypeAny, {
|
|
93
|
+
shl_id: string & z.BRAND<"SamoaHouseLibraryID">;
|
|
94
|
+
title: string;
|
|
95
|
+
recipient: string;
|
|
96
|
+
date_processed: string;
|
|
97
|
+
donor_first_name?: string | undefined;
|
|
98
|
+
donor_last_name?: string | null | undefined;
|
|
99
|
+
terms?: "D" | "R" | undefined;
|
|
100
|
+
author_first_name?: string | undefined;
|
|
101
|
+
author_last_name?: string | null | undefined;
|
|
102
|
+
isbn_issn?: string | null | undefined;
|
|
103
|
+
section?: string | null | undefined;
|
|
104
|
+
book_type?: string | undefined;
|
|
105
|
+
publisher?: string | null | undefined;
|
|
106
|
+
date_published?: string | null | undefined;
|
|
107
|
+
notes?: string | null | undefined;
|
|
108
|
+
special_conditions?: string | null | undefined;
|
|
109
|
+
condition?: string | undefined;
|
|
110
|
+
}, {
|
|
111
|
+
shl_id: string;
|
|
112
|
+
title: string;
|
|
113
|
+
recipient: string;
|
|
114
|
+
date_processed: string;
|
|
115
|
+
donor_first_name?: string | undefined;
|
|
116
|
+
donor_last_name?: string | null | undefined;
|
|
117
|
+
terms?: "D" | "R" | undefined;
|
|
118
|
+
author_first_name?: string | undefined;
|
|
119
|
+
author_last_name?: string | null | undefined;
|
|
120
|
+
isbn_issn?: string | null | undefined;
|
|
121
|
+
section?: string | null | undefined;
|
|
122
|
+
book_type?: string | undefined;
|
|
123
|
+
publisher?: string | null | undefined;
|
|
124
|
+
date_published?: string | null | undefined;
|
|
125
|
+
notes?: string | null | undefined;
|
|
126
|
+
special_conditions?: string | null | undefined;
|
|
127
|
+
condition?: string | undefined;
|
|
128
|
+
}>;
|
|
129
|
+
export declare const dbEntrySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
130
|
+
donor_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
131
|
+
donor_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
132
|
+
terms: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"D">, z.ZodLiteral<"R">]>>>;
|
|
133
|
+
title: z.ZodString;
|
|
134
|
+
author_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
135
|
+
author_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
136
|
+
isbn_issn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
137
|
+
recipient: z.ZodString;
|
|
138
|
+
date_processed: z.ZodString;
|
|
139
|
+
section: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>>;
|
|
140
|
+
book_type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
141
|
+
publisher: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
142
|
+
date_published: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
143
|
+
notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
144
|
+
special_conditions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
145
|
+
condition: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
146
|
+
}, {
|
|
147
|
+
shl_id: z.ZodBranded<z.ZodString, "SamoaHouseLibraryID">;
|
|
148
|
+
}>, {
|
|
149
|
+
id: z.ZodNumber;
|
|
150
|
+
running_number: z.ZodNumber;
|
|
151
|
+
}>, "strip", z.ZodTypeAny, {
|
|
152
|
+
id: number;
|
|
153
|
+
running_number: number;
|
|
154
|
+
shl_id: string & z.BRAND<"SamoaHouseLibraryID">;
|
|
155
|
+
title: string;
|
|
156
|
+
recipient: string;
|
|
157
|
+
date_processed: string;
|
|
158
|
+
donor_first_name?: string | undefined;
|
|
159
|
+
donor_last_name?: string | null | undefined;
|
|
160
|
+
terms?: "D" | "R" | undefined;
|
|
161
|
+
author_first_name?: string | undefined;
|
|
162
|
+
author_last_name?: string | null | undefined;
|
|
163
|
+
isbn_issn?: string | null | undefined;
|
|
164
|
+
section?: string | null | undefined;
|
|
165
|
+
book_type?: string | undefined;
|
|
166
|
+
publisher?: string | null | undefined;
|
|
167
|
+
date_published?: string | null | undefined;
|
|
168
|
+
notes?: string | null | undefined;
|
|
169
|
+
special_conditions?: string | null | undefined;
|
|
170
|
+
condition?: string | undefined;
|
|
171
|
+
}, {
|
|
172
|
+
id: number;
|
|
173
|
+
running_number: number;
|
|
174
|
+
shl_id: string;
|
|
175
|
+
title: string;
|
|
176
|
+
recipient: string;
|
|
177
|
+
date_processed: string;
|
|
178
|
+
donor_first_name?: string | undefined;
|
|
179
|
+
donor_last_name?: string | null | undefined;
|
|
180
|
+
terms?: "D" | "R" | undefined;
|
|
181
|
+
author_first_name?: string | undefined;
|
|
182
|
+
author_last_name?: string | null | undefined;
|
|
183
|
+
isbn_issn?: string | null | undefined;
|
|
184
|
+
section?: string | null | undefined;
|
|
185
|
+
book_type?: string | undefined;
|
|
186
|
+
publisher?: string | null | undefined;
|
|
187
|
+
date_published?: string | null | undefined;
|
|
188
|
+
notes?: string | null | undefined;
|
|
189
|
+
special_conditions?: string | null | undefined;
|
|
190
|
+
condition?: string | undefined;
|
|
191
|
+
}>;
|
|
192
|
+
export declare const bookBatchSchema: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
193
|
+
donor_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
194
|
+
donor_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
195
|
+
terms: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"D">, z.ZodLiteral<"R">]>>>;
|
|
196
|
+
title: z.ZodString;
|
|
197
|
+
author_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
198
|
+
author_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
199
|
+
isbn_issn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
200
|
+
recipient: z.ZodString;
|
|
201
|
+
date_processed: z.ZodString;
|
|
202
|
+
section: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>>;
|
|
203
|
+
book_type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
204
|
+
publisher: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
205
|
+
date_published: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
206
|
+
notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
207
|
+
special_conditions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
208
|
+
condition: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
209
|
+
}, {
|
|
210
|
+
shl_id: z.ZodBranded<z.ZodString, "SamoaHouseLibraryID">;
|
|
211
|
+
}>, {
|
|
212
|
+
id: z.ZodNumber;
|
|
213
|
+
running_number: z.ZodNumber;
|
|
214
|
+
}>, "strip", z.ZodTypeAny, {
|
|
215
|
+
id: number;
|
|
216
|
+
running_number: number;
|
|
217
|
+
shl_id: string & z.BRAND<"SamoaHouseLibraryID">;
|
|
218
|
+
title: string;
|
|
219
|
+
recipient: string;
|
|
220
|
+
date_processed: string;
|
|
221
|
+
donor_first_name?: string | undefined;
|
|
222
|
+
donor_last_name?: string | null | undefined;
|
|
223
|
+
terms?: "D" | "R" | undefined;
|
|
224
|
+
author_first_name?: string | undefined;
|
|
225
|
+
author_last_name?: string | null | undefined;
|
|
226
|
+
isbn_issn?: string | null | undefined;
|
|
227
|
+
section?: string | null | undefined;
|
|
228
|
+
book_type?: string | undefined;
|
|
229
|
+
publisher?: string | null | undefined;
|
|
230
|
+
date_published?: string | null | undefined;
|
|
231
|
+
notes?: string | null | undefined;
|
|
232
|
+
special_conditions?: string | null | undefined;
|
|
233
|
+
condition?: string | undefined;
|
|
234
|
+
}, {
|
|
235
|
+
id: number;
|
|
236
|
+
running_number: number;
|
|
237
|
+
shl_id: string;
|
|
238
|
+
title: string;
|
|
239
|
+
recipient: string;
|
|
240
|
+
date_processed: string;
|
|
241
|
+
donor_first_name?: string | undefined;
|
|
242
|
+
donor_last_name?: string | null | undefined;
|
|
243
|
+
terms?: "D" | "R" | undefined;
|
|
244
|
+
author_first_name?: string | undefined;
|
|
245
|
+
author_last_name?: string | null | undefined;
|
|
246
|
+
isbn_issn?: string | null | undefined;
|
|
247
|
+
section?: string | null | undefined;
|
|
248
|
+
book_type?: string | undefined;
|
|
249
|
+
publisher?: string | null | undefined;
|
|
250
|
+
date_published?: string | null | undefined;
|
|
251
|
+
notes?: string | null | undefined;
|
|
252
|
+
special_conditions?: string | null | undefined;
|
|
253
|
+
condition?: string | undefined;
|
|
254
|
+
}>, "many">;
|
|
255
|
+
export declare const responseSchema: z.ZodObject<{
|
|
256
|
+
message: z.ZodString;
|
|
257
|
+
data: z.ZodNullable<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
258
|
+
donor_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
259
|
+
donor_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
260
|
+
terms: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"D">, z.ZodLiteral<"R">]>>>;
|
|
261
|
+
title: z.ZodString;
|
|
262
|
+
author_first_name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
263
|
+
author_last_name: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
264
|
+
isbn_issn: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
265
|
+
recipient: z.ZodString;
|
|
266
|
+
date_processed: z.ZodString;
|
|
267
|
+
section: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>>;
|
|
268
|
+
book_type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
269
|
+
publisher: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
270
|
+
date_published: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
271
|
+
notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
272
|
+
special_conditions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
273
|
+
condition: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>>;
|
|
274
|
+
}, {
|
|
275
|
+
shl_id: z.ZodBranded<z.ZodString, "SamoaHouseLibraryID">;
|
|
276
|
+
}>, {
|
|
277
|
+
id: z.ZodNumber;
|
|
278
|
+
running_number: z.ZodNumber;
|
|
279
|
+
}>, "strip", z.ZodTypeAny, {
|
|
280
|
+
id: number;
|
|
281
|
+
running_number: number;
|
|
282
|
+
shl_id: string & z.BRAND<"SamoaHouseLibraryID">;
|
|
283
|
+
title: string;
|
|
284
|
+
recipient: string;
|
|
285
|
+
date_processed: string;
|
|
286
|
+
donor_first_name?: string | undefined;
|
|
287
|
+
donor_last_name?: string | null | undefined;
|
|
288
|
+
terms?: "D" | "R" | undefined;
|
|
289
|
+
author_first_name?: string | undefined;
|
|
290
|
+
author_last_name?: string | null | undefined;
|
|
291
|
+
isbn_issn?: string | null | undefined;
|
|
292
|
+
section?: string | null | undefined;
|
|
293
|
+
book_type?: string | undefined;
|
|
294
|
+
publisher?: string | null | undefined;
|
|
295
|
+
date_published?: string | null | undefined;
|
|
296
|
+
notes?: string | null | undefined;
|
|
297
|
+
special_conditions?: string | null | undefined;
|
|
298
|
+
condition?: string | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
id: number;
|
|
301
|
+
running_number: number;
|
|
302
|
+
shl_id: string;
|
|
303
|
+
title: string;
|
|
304
|
+
recipient: string;
|
|
305
|
+
date_processed: string;
|
|
306
|
+
donor_first_name?: string | undefined;
|
|
307
|
+
donor_last_name?: string | null | undefined;
|
|
308
|
+
terms?: "D" | "R" | undefined;
|
|
309
|
+
author_first_name?: string | undefined;
|
|
310
|
+
author_last_name?: string | null | undefined;
|
|
311
|
+
isbn_issn?: string | null | undefined;
|
|
312
|
+
section?: string | null | undefined;
|
|
313
|
+
book_type?: string | undefined;
|
|
314
|
+
publisher?: string | null | undefined;
|
|
315
|
+
date_published?: string | null | undefined;
|
|
316
|
+
notes?: string | null | undefined;
|
|
317
|
+
special_conditions?: string | null | undefined;
|
|
318
|
+
condition?: string | undefined;
|
|
319
|
+
}>, "many">>;
|
|
320
|
+
}, "strip", z.ZodTypeAny, {
|
|
321
|
+
message: string;
|
|
322
|
+
data: {
|
|
323
|
+
id: number;
|
|
324
|
+
running_number: number;
|
|
325
|
+
shl_id: string & z.BRAND<"SamoaHouseLibraryID">;
|
|
326
|
+
title: string;
|
|
327
|
+
recipient: string;
|
|
328
|
+
date_processed: string;
|
|
329
|
+
donor_first_name?: string | undefined;
|
|
330
|
+
donor_last_name?: string | null | undefined;
|
|
331
|
+
terms?: "D" | "R" | undefined;
|
|
332
|
+
author_first_name?: string | undefined;
|
|
333
|
+
author_last_name?: string | null | undefined;
|
|
334
|
+
isbn_issn?: string | null | undefined;
|
|
335
|
+
section?: string | null | undefined;
|
|
336
|
+
book_type?: string | undefined;
|
|
337
|
+
publisher?: string | null | undefined;
|
|
338
|
+
date_published?: string | null | undefined;
|
|
339
|
+
notes?: string | null | undefined;
|
|
340
|
+
special_conditions?: string | null | undefined;
|
|
341
|
+
condition?: string | undefined;
|
|
342
|
+
}[] | null;
|
|
343
|
+
}, {
|
|
344
|
+
message: string;
|
|
345
|
+
data: {
|
|
346
|
+
id: number;
|
|
347
|
+
running_number: number;
|
|
348
|
+
shl_id: string;
|
|
349
|
+
title: string;
|
|
350
|
+
recipient: string;
|
|
351
|
+
date_processed: string;
|
|
352
|
+
donor_first_name?: string | undefined;
|
|
353
|
+
donor_last_name?: string | null | undefined;
|
|
354
|
+
terms?: "D" | "R" | undefined;
|
|
355
|
+
author_first_name?: string | undefined;
|
|
356
|
+
author_last_name?: string | null | undefined;
|
|
357
|
+
isbn_issn?: string | null | undefined;
|
|
358
|
+
section?: string | null | undefined;
|
|
359
|
+
book_type?: string | undefined;
|
|
360
|
+
publisher?: string | null | undefined;
|
|
361
|
+
date_published?: string | null | undefined;
|
|
362
|
+
notes?: string | null | undefined;
|
|
363
|
+
special_conditions?: string | null | undefined;
|
|
364
|
+
condition?: string | undefined;
|
|
365
|
+
}[] | null;
|
|
366
|
+
}>;
|
|
367
|
+
export declare const updateRequestSchema: z.ZodObject<{
|
|
368
|
+
colName: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
|
|
369
|
+
colValue: z.ZodString;
|
|
370
|
+
id: z.ZodBranded<z.ZodString, "SamoaHouseLibraryID">;
|
|
371
|
+
}, "strip", z.ZodTypeAny, {
|
|
372
|
+
id: string & z.BRAND<"SamoaHouseLibraryID">;
|
|
373
|
+
colName: string;
|
|
374
|
+
colValue: string;
|
|
375
|
+
}, {
|
|
376
|
+
id: string;
|
|
377
|
+
colName: string;
|
|
378
|
+
colValue: string;
|
|
379
|
+
}>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.updateRequestSchema = exports.responseSchema = exports.bookBatchSchema = exports.dbEntrySchema = exports.newDbEntrySchema = exports.addBookRequest = exports.conditionSchema = exports.textTypeSchema = exports.sectionSchema = exports.dbColumnNameSchema = exports.termsSchema = exports.nameSchema = exports.shlIdSchema = void 0;
|
|
27
|
+
const z = __importStar(require("zod"));
|
|
28
|
+
const constants_1 = require("./constants");
|
|
29
|
+
const unionBuilder_1 = require("../utils/unionBuilder");
|
|
30
|
+
exports.shlIdSchema = z.string().min(3).brand("SamoaHouseLibraryID");
|
|
31
|
+
exports.nameSchema = z.string().transform((val) => {
|
|
32
|
+
const initial = val.charAt(0).toUpperCase();
|
|
33
|
+
return initial.concat(val.slice(1, val.length));
|
|
34
|
+
});
|
|
35
|
+
exports.termsSchema = z.union([z.literal("D"), z.literal("R")]).optional();
|
|
36
|
+
exports.dbColumnNameSchema = (0, unionBuilder_1.unionFromEnum)(constants_1.ColumnNames);
|
|
37
|
+
exports.sectionSchema = (0, unionBuilder_1.unionFromEnum)(constants_1.SectionVariant);
|
|
38
|
+
exports.textTypeSchema = (0, unionBuilder_1.unionFromEnum)(constants_1.TextVariant);
|
|
39
|
+
exports.conditionSchema = (0, unionBuilder_1.unionFromEnum)(constants_1.ConditionVariant);
|
|
40
|
+
exports.addBookRequest = z.object({
|
|
41
|
+
donor_first_name: exports.nameSchema.optional(),
|
|
42
|
+
donor_last_name: exports.nameSchema.optional().nullable(),
|
|
43
|
+
terms: exports.termsSchema.optional(),
|
|
44
|
+
title: z.string().max(150),
|
|
45
|
+
author_first_name: exports.nameSchema.optional(),
|
|
46
|
+
author_last_name: exports.nameSchema.optional().nullable(),
|
|
47
|
+
isbn_issn: z.string().max(13).optional().nullable(),
|
|
48
|
+
recipient: z.string().max(2),
|
|
49
|
+
date_processed: z.string().max(27),
|
|
50
|
+
section: exports.sectionSchema.optional().nullable(),
|
|
51
|
+
book_type: exports.textTypeSchema.optional(),
|
|
52
|
+
publisher: z.string().optional().nullable(),
|
|
53
|
+
date_published: z.string().max(27).optional().nullable(),
|
|
54
|
+
notes: z.string().max(100).optional().nullable(),
|
|
55
|
+
special_conditions: z.string().optional().nullable(),
|
|
56
|
+
condition: exports.conditionSchema.optional()
|
|
57
|
+
});
|
|
58
|
+
exports.newDbEntrySchema = exports.addBookRequest.extend({
|
|
59
|
+
shl_id: exports.shlIdSchema
|
|
60
|
+
});
|
|
61
|
+
exports.dbEntrySchema = exports.newDbEntrySchema.extend({
|
|
62
|
+
id: z.number(),
|
|
63
|
+
running_number: z.number()
|
|
64
|
+
});
|
|
65
|
+
exports.bookBatchSchema = z.array(exports.dbEntrySchema);
|
|
66
|
+
exports.responseSchema = z.object({
|
|
67
|
+
message: z.string(),
|
|
68
|
+
data: exports.bookBatchSchema.nullable()
|
|
69
|
+
});
|
|
70
|
+
exports.updateRequestSchema = z.object({
|
|
71
|
+
colName: exports.dbColumnNameSchema,
|
|
72
|
+
colValue: z.string(),
|
|
73
|
+
id: exports.shlIdSchema
|
|
74
|
+
});
|
package/package.json
CHANGED