@isaijs/core 0.1.4 → 0.1.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/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -2
- package/dist/case-DpXlJCL9.js +63 -0
- package/dist/cli/index.js +10 -6
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +119 -5
- package/dist/{create-auth-9y_43vJf.js → create-auth-BFKvQVOG.js} +18 -10
- package/dist/{data-layer-D1BFo3wO.d.ts → data-layer-43pme0Gy.d.ts} +13 -1
- package/dist/{data-layer-_TZtuy-F.js → data-layer-C5oJZ8V1.js} +16 -3
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.js +4 -4
- package/dist/{index-DlgVg3D8.d.ts → index-a7ElyL3B.d.ts} +67 -34
- package/dist/index.d.ts +1 -1
- package/dist/index.js +136 -17
- package/dist/{make-DKBn79cH.js → make-ByA-84h8.js} +1 -1
- package/dist/{makers-DeSNM0Nd.js → makers-P9kg68C8.js} +2 -2
- package/dist/{migrator-BU3_PHk8.js → migrator-B25prc9n.js} +152 -108
- package/dist/{base64url-C5GTYIL5.js → model-Dc3HunKb.js} +424 -418
- package/dist/{policies-D_G5Rmxv.js → policies-KsqmlX67.js} +1 -1
- package/dist/{resource-CkzoR3Rq.js → resource-BQK7bkPQ.js} +5 -3
- package/dist/{tables-IrLjsomf.js → tables-DgSwge7s.js} +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +4 -4
- package/dist/{types-S6zF5IXV.d.ts → types-BgOkJy5d.d.ts} +17 -3
- package/package.json +1 -1
- package/dist/case-BnpcvhdW.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as isRecorded, _ as Expr, c as rowOf, h as Condition, j as nodesOf, r as columnName, w as conditionNode } from "./model-Dc3HunKb.js";
|
|
2
2
|
//#region src/auth/enforce.ts
|
|
3
3
|
/**
|
|
4
4
|
* Checking a policy: its action's condition, with the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { G as ValidationError, H as validate, V as toKind, z as object } from "./validation-Cppmd0RV.js";
|
|
2
|
-
import { J as
|
|
3
|
-
import {
|
|
4
|
-
import { r as actionsOf } from "./policies-
|
|
2
|
+
import { J as NotFound, K as CheckFailed, X as UniqueFailed, Y as ReferenceFailed } from "./migrator-B25prc9n.js";
|
|
3
|
+
import { C as asCondition, _ as Expr, g as Embed, l as IMPLICIT_FIELDS, r as columnName, s as computedFieldOf } from "./model-Dc3HunKb.js";
|
|
4
|
+
import { r as actionsOf } from "./policies-KsqmlX67.js";
|
|
5
5
|
import { n as RESERVED, t as LOOKUPS } from "./syntax-CrUZFrS7.js";
|
|
6
6
|
//#region src/api/fail.ts
|
|
7
7
|
/**
|
|
@@ -38,8 +38,10 @@ function fail(code, message) {
|
|
|
38
38
|
* 405 MethodNotAllowed a known path with another method (`Allow`)
|
|
39
39
|
* 409 UniqueFailed (`fields`, and `issues` for a form), CheckFailed, ReferenceFailed, or the
|
|
40
40
|
* app's own code from `fail`
|
|
41
|
+
* 409 InProgress a write whose `Idempotency-Key` is still running (`./idempotency`)
|
|
41
42
|
* 411/413/415 uploads without a size, too large, of a refused type; a body over
|
|
42
43
|
* the JSON limit (413) or not JSON (415)
|
|
44
|
+
* 422 IdempotencyKeyReused a key sent again with another route, user or body
|
|
43
45
|
* 429 TooManyRequests anonymous writes past the per-IP limit (`Retry-After`)
|
|
44
46
|
* 503 TenantSuspended a suspended tenant
|
|
45
47
|
* 500 InternalError anything else: logged with its stack as one JSON line, nothing sent
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as DatabaseDriver, g as Storage } from "../index-Ce5p2-EB.js";
|
|
2
|
-
import { I as Clock, L as FixedClock, R as fixedClock, V as AnyModel, i as Row, l as Overrides, p as Database, s as Makers, u as Seed } from "../types-
|
|
2
|
+
import { I as Clock, L as FixedClock, R as fixedClock, V as AnyModel, i as Row, l as Overrides, p as Database, s as Makers, u as Seed } from "../types-BgOkJy5d.js";
|
|
3
3
|
//#region src/testing/conformance/database.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Makes the driver under test. Every call must return a driver on an **empty** database:
|
package/dist/testing/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as createDataLayer } from "../data-layer-
|
|
5
|
-
import { d as forgetGoogleKeys, r as authOf, s as GOOGLE, t as makers, y as seedAs } from "../makers-
|
|
2
|
+
import { F as dialectFor, H as fixedClock, L as PLATFORM, R as TENANT, W as utc, a as currentRelease, b as Database, c as rollback, i as acquireLock, j as keyCondition, l as setReleaseStatus, m as emptySnapshot, n as migrateFresh, o as holdOf, p as generateMigration, r as sync, s as releaseLock, t as migrate, u as startRelease, v as dataStep, y as MigrationError } from "../migrator-B25prc9n.js";
|
|
3
|
+
import { L as toBase64url, t as Model } from "../model-Dc3HunKb.js";
|
|
4
|
+
import { t as createDataLayer } from "../data-layer-C5oJZ8V1.js";
|
|
5
|
+
import { d as forgetGoogleKeys, r as authOf, s as GOOGLE, t as makers, y as seedAs } from "../makers-P9kg68C8.js";
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
//#region src/testing/conformance/database.ts
|
|
8
8
|
/**
|
|
@@ -372,15 +372,18 @@ interface CoalesceNode {
|
|
|
372
372
|
readonly t: "coalesce";
|
|
373
373
|
readonly items: readonly Operand[];
|
|
374
374
|
}
|
|
375
|
-
/**
|
|
375
|
+
/**
|
|
376
|
+
* The rows of another table that reference a row (`fest.events`: events whose `fest_id` is the
|
|
377
|
+
* fest), or, without an owner, every row of a table (`rows(Product)`).
|
|
378
|
+
*/
|
|
376
379
|
interface RelationNode {
|
|
377
380
|
/** The row that owns the relation: its scope, and the refs followed to reach it. */
|
|
378
|
-
readonly owner
|
|
381
|
+
readonly owner?: {
|
|
379
382
|
readonly scope: ScopeId;
|
|
380
383
|
readonly path: readonly RefStep[];
|
|
381
384
|
};
|
|
382
385
|
readonly table: string;
|
|
383
|
-
/** The related table's column holding the owner's id. */
|
|
386
|
+
/** The related table's column holding the owner's id (unused without an owner). */
|
|
384
387
|
readonly column: string;
|
|
385
388
|
/** The scope of the related rows inside the callback. */
|
|
386
389
|
readonly scope: ScopeId;
|
|
@@ -1112,6 +1115,11 @@ interface Dialect {
|
|
|
1112
1115
|
totals(model: ModelSpec, query: TotalsQuery, context: SqlContext): Sql;
|
|
1113
1116
|
/** A totals row's values, decoded by what each one is. */
|
|
1114
1117
|
decodeTotals(query: TotalsQuery, row: Row$1): Record<string, unknown>;
|
|
1118
|
+
/**
|
|
1119
|
+
* `SELECT <node> AS "value"`: a value that needs no row of `model`, such as a count over a whole
|
|
1120
|
+
* table (`rows(Product).count()`), for a create's rule. `model` only names the statement's table.
|
|
1121
|
+
*/
|
|
1122
|
+
value(model: ModelSpec, node: Operand, context: SqlContext): Sql;
|
|
1115
1123
|
/** One row (`"found"`) when any row matches. */
|
|
1116
1124
|
exists(model: ModelSpec, where: readonly ConditionNode[], context: SqlContext): Sql;
|
|
1117
1125
|
update(model: ModelSpec, assignments: Assignments, where: readonly ConditionNode[], context: SqlContext, returning: Returning): Sql;
|
|
@@ -1482,6 +1490,8 @@ declare class Transaction {
|
|
|
1482
1490
|
type WriteOnly<T> = T extends PromiseLike<unknown> ? never : T;
|
|
1483
1491
|
declare const UPKEEP: unique symbol;
|
|
1484
1492
|
declare const CLOCK: unique symbol;
|
|
1493
|
+
declare const DRIVER: unique symbol;
|
|
1494
|
+
declare const TOTALS: unique symbol;
|
|
1485
1495
|
declare const RECORD: unique symbol;
|
|
1486
1496
|
declare const DECODE: unique symbol;
|
|
1487
1497
|
declare class Database {
|
|
@@ -1495,6 +1505,10 @@ declare class Database {
|
|
|
1495
1505
|
[DECODE](model: ModelSpec, row: Row$1): Record<string, unknown>;
|
|
1496
1506
|
/** See `clockOf`. */
|
|
1497
1507
|
[CLOCK](): Clock;
|
|
1508
|
+
/** See `withTableTotals`. */
|
|
1509
|
+
[TOTALS](model: ModelSpec, node: ConditionNode): Promise<ConditionNode>;
|
|
1510
|
+
/** See `driverOf`. */
|
|
1511
|
+
[DRIVER](): DatabaseDriver;
|
|
1498
1512
|
/**
|
|
1499
1513
|
* The post-commit write stream: `listener` is called after every committed write with what it
|
|
1500
1514
|
* created, changed and deleted (an `atomic`'s writes in one call). Returns the unsubscribe.
|
package/package.json
CHANGED
package/dist/case-BnpcvhdW.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/internal/case.ts
|
|
2
|
-
/** `manageProducts` → `manage-products`, `markPaid` → `mark-paid`: path segments. */
|
|
3
|
-
function kebabCase(name) {
|
|
4
|
-
return snakeCase(name).replace(/_/g, "-");
|
|
5
|
-
}
|
|
6
|
-
/** `RegistrationMember` → `registration_member`, `startsAt` → `starts_at`. */
|
|
7
|
-
function snakeCase(name) {
|
|
8
|
-
return name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toLowerCase();
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { snakeCase as n, kebabCase as t };
|