@isaijs/core 0.1.5 → 0.1.8
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/adapters/storage/r2/index.d.ts +3 -0
- package/dist/adapters/storage/r2/index.js +13 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -2
- package/dist/cli/index.js +79 -11
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +18 -13
- package/dist/{create-auth-BHdX68Ng.js → create-auth-BCvMwlVD.js} +18 -10
- package/dist/{data-layer-C5oJZ8V1.js → data-layer-CVCFjPyv.js} +15 -10
- package/dist/{data-layer-43pme0Gy.d.ts → data-layer-nvm_ivGQ.d.ts} +6 -2
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.js +5 -5
- package/dist/{index-D0FEnMhn.d.ts → index-Bb9Px6SR.d.ts} +116 -22
- package/dist/{index-CYcklQ1l.d.ts → index-CaR3hb0i.d.ts} +5 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +169 -79
- package/dist/{make-ByA-84h8.js → make-jMJABOWI.js} +21 -3
- package/dist/{makers-P9kg68C8.js → makers-A0Pj6Tda.js} +3 -3
- package/dist/{migrator-B25prc9n.js → migrator-DxTpns_-.js} +174 -30
- package/dist/{model-Dc3HunKb.js → model-6pJBqqGd.js} +31 -1
- package/dist/{policies-KsqmlX67.js → policies-C_oiSgmY.js} +1 -1
- package/dist/{resource-BQK7bkPQ.js → resource-BIMAiOre.js} +8 -6
- package/dist/{tables-DgSwge7s.js → tables-DjW96Ubl.js} +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +4 -4
- package/dist/{types-BgOkJy5d.d.ts → types-D5SIVeej.d.ts} +59 -2
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +1 -1
- package/dist/{validation-Cppmd0RV.js → validation-C3MCRBQO.js} +26 -3
- package/package.json +1 -1
|
@@ -1105,6 +1105,10 @@ const IMAGE_TYPES = [
|
|
|
1105
1105
|
const MB = 1048576;
|
|
1106
1106
|
/** At most this many files in one field. */
|
|
1107
1107
|
const FILES_MAX = 10;
|
|
1108
|
+
/** At most this many documents in one field: an order's files, all its lines'. */
|
|
1109
|
+
const DOCUMENTS_MAX = 100;
|
|
1110
|
+
/** A document's size: the Workers body limit, the most one request can carry. */
|
|
1111
|
+
const DOCUMENT_BYTES = 100 * MB;
|
|
1108
1112
|
/** A file's id: `fil_` and a ULID. */
|
|
1109
1113
|
const FILE_ID = /^fil_[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
1110
1114
|
/** A storage's name: a key of `storage` in `app.ts`. */
|
|
@@ -1244,10 +1248,27 @@ function image(options = {}) {
|
|
|
1244
1248
|
many: false
|
|
1245
1249
|
}));
|
|
1246
1250
|
}
|
|
1251
|
+
const DOCUMENT_TYPES = [
|
|
1252
|
+
"pdf",
|
|
1253
|
+
"png",
|
|
1254
|
+
"jpeg",
|
|
1255
|
+
"webp"
|
|
1256
|
+
];
|
|
1257
|
+
/** A PDF or an image to print or read whole (never resized), up to 100 MB. */
|
|
1258
|
+
function document(options = {}) {
|
|
1259
|
+
return fileKind("document", specOf({
|
|
1260
|
+
...options,
|
|
1261
|
+
types: DOCUMENT_TYPES
|
|
1262
|
+
}, ALL_TYPES, {
|
|
1263
|
+
image: false,
|
|
1264
|
+
maxBytes: DOCUMENT_BYTES,
|
|
1265
|
+
many: false
|
|
1266
|
+
}));
|
|
1267
|
+
}
|
|
1247
1268
|
/** A list kind of files, carrying its item's spec as a list. */
|
|
1248
|
-
function many(name, item) {
|
|
1269
|
+
function many(name, item, max = FILES_MAX) {
|
|
1249
1270
|
return new Kind({
|
|
1250
|
-
...named(name, list(item).max(
|
|
1271
|
+
...named(name, list(item).max(max)).spec,
|
|
1251
1272
|
file: {
|
|
1252
1273
|
...item.spec.file,
|
|
1253
1274
|
many: true
|
|
@@ -1258,6 +1279,8 @@ function many(name, item) {
|
|
|
1258
1279
|
const files = (options = {}) => many("files", file(options));
|
|
1259
1280
|
/** Up to 10 images. */
|
|
1260
1281
|
const images = (options = {}) => many("images", image(options));
|
|
1282
|
+
/** Up to 100 documents (PDFs and images, each up to 100 MB). */
|
|
1283
|
+
const documents = (options = {}) => many("documents", document(options), DOCUMENTS_MAX);
|
|
1261
1284
|
//#endregion
|
|
1262
1285
|
//#region src/internal/phone.ts
|
|
1263
1286
|
/**
|
|
@@ -1313,4 +1336,4 @@ function phone(options = {}) {
|
|
|
1313
1336
|
return phoneKind(() => region);
|
|
1314
1337
|
}
|
|
1315
1338
|
//#endregion
|
|
1316
|
-
export {
|
|
1339
|
+
export { date as A, list as B, slugify as C, token as D, textKind as E, int as F, Kind as G, serialize as H, money as I, Fake as J, kind as K, quantity as L, fakeUlid as M, flag as N, url as O, id as P, sequence as R, slug as S, text as T, toKind as U, object as V, validate as W, fakeValue as Y, line as _, document as a, personName as b, fileTypeNames as c, images as d, define as f, host as g, email as h, SIZES_MAX as i, datetime as j, choice as k, files as l, urls as m, phoneKind as n, documents as o, json as p, ValidationError as q, isPhoneRegion as r, file as s, phone as t, image as u, markdown as v, subdomain as w, secret as x, newToken as y, LIST_MAX as z };
|