kitcn 0.27.4 → 0.28.0
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/CHANGELOG.md +220 -0
- package/dist/aggregate/index.d.ts +2 -2
- package/dist/auth/client/index.d.ts +44 -16
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/generated/index.js +1 -1
- package/dist/auth/index.d.ts +58 -33
- package/dist/auth/index.js +175 -52
- package/dist/auth/nextjs/index.js +1 -1
- package/dist/auth/start/server/index.js +1 -1
- package/dist/{capabilities-CLCYgRdY.d.ts → capabilities-DkfnnNp7.d.ts} +18 -0
- package/dist/cli.mjs +43 -11
- package/dist/{convex-plugin-DfOhBU9g.js → convex-plugin-Dic0l-k8.js} +77 -68
- package/dist/{create-schema-DqhLA_UF.js → create-schema-ojI-OH_9.js} +15 -3
- package/dist/{create-schema-orm-C3y6GLwQ.js → create-schema-orm-HcJzGCxj.js} +26 -6
- package/dist/{generated-contract-disabled-SzH57bhp.d.ts → generated-contract-disabled-Btfy2opW.d.ts} +54 -12
- package/dist/{generated-contract-disabled-CZa0iyV0.js → generated-contract-disabled-_1Mjg9pW.js} +2 -0
- package/dist/orm/aggregate-index/index.d.ts +1 -1
- package/dist/orm/aggregate-index/index.js +1 -1
- package/dist/orm/index.d.ts +2 -2
- package/dist/orm/index.js +61 -18
- package/dist/orm/migrations/index.d.ts +2 -2
- package/dist/{schema-C5WWEqsj.js → schema-D95Z3Kss.js} +34 -1
- package/dist/solid/index.d.ts +44 -16
- package/dist/{token-DcV_0fkF.js → token-B0NKKxqP.js} +1 -1
- package/dist/{where-clause-compiler-DAPEBp1y.d.ts → where-clause-compiler-CETRjurp.d.ts} +116 -116
- package/package.json +2 -2
package/dist/orm/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import { a as pretendRequired, i as pretend, n as deprecated } from "../validato
|
|
|
4
4
|
import { t as id } from "../id-CuSfWa5q.js";
|
|
5
5
|
import { A as or, C as matchLikePattern, D as notIlike, E as notBetween, O as notInArray, S as lte, T as not, _ as isFieldReference, a as between, b as like, c as endsWith, d as filterValueInList, f as filterValuesEqual, g as inArray, h as ilike, i as arrayOverlaps, j as startsWith, k as notLike, l as eq, m as gte, n as arrayContained, o as column, p as gt, r as arrayContains, s as contains, t as and, u as fieldRef, v as isNotNull, w as ne, x as lt, y as isNull } from "../filter-expression-Dydt8wS0.js";
|
|
6
6
|
import { a as indexKeyWithinBounds, c as streamIndexRange, i as getIndexFields, l as isUnsetToken, n as EmptyStream, o as mergedStream, r as QueryStream, s as stream, t as getByIdWithOrmQueryFallback, u as unsetToken } from "../query-context-DOm5Xm3H.js";
|
|
7
|
-
import { $ as resolveOrmRuntimeDefaults, A as enforceUniqueIndexes, B as getMutationAsyncDelayMs, C as collectPrimaryIdLookupRows, Ct as
|
|
7
|
+
import { $ as resolveOrmRuntimeDefaults, A as enforceUniqueIndexes, B as getMutationAsyncDelayMs, C as collectPrimaryIdLookupRows, Ct as CREATED_AT_MIGRATION_MESSAGE, D as enforceCheckConstraints, E as encodeUndefinedDeep, Et as usesSystemCreatedAtAlias, F as evaluateFilter, G as getTableDeleteConfig, H as getMutationExecutionMode, I as extractPrimaryIdLookup, J as hardDeleteRow, K as getTableName, L as getChecks, M as ensureNonNullValues, N as ensureNullableColumns, O as enforceForeignKeys, P as evaluateCheckConstraintTriState, Q as patchReferencingRows, R as getColumnName$1, S as collectMutationRowsBounded, St as resolveIndexOrderPushdown, T as deserializeFilterExpression, Tt as PUBLIC_CREATED_AT_FIELD, U as getOrmContext, V as getMutationCollectionLimits, W as getTableColumns$2, X as normalizeDateFieldsForWrite, Y as hydrateDateFieldsForRead, Z as normalizeTemporalComparableValue, _ as applyDefaults, _t as findSearchIndexByName, at as stripUnsetFields, b as buildForeignKeyGraph, bt as getIndexes, c as getAggregateIndexDefinitions, ct as unsetFieldsOf, d as COUNT_ERROR, dt as compileConvexFilter, et as returningSelectionReadsCreationTime, f as createAggregateError, ft as convexAnd, g as ensureCountAllowedForRls, gt as findRelationIndex, h as ensureAggregateAllowedForRls, ht as findIndexForColumns, it as splitReturningSelection, j as ensureDefaultColumns, k as enforcePolymorphicWrite, l as getRankIndexDefinitions, lt as hasLifecycleHooks, mt as mapWithConcurrency, nt as serializeFilterExpression, o as aggregateExtension, ot as takeRowsWithinByteBudget, p as createCountError, pt as isConvexEnforceableFilter, q as getUniqueIndexes, rt as softDeleteRow, st as toConvexFilter, tt as selectReturningRowWithHydration, u as AGGREGATE_ERROR, ut as markLifecycleHookedTables, v as applyIncomingForeignKeyActionsOnDelete, vt as findVectorIndexByName, w as decodeUndefinedDeep, wt as INTERNAL_CREATION_TIME_FIELD, x as canUsePrimaryIdLookupCursor, xt as getRankIndexes, y as applyIncomingForeignKeyActionsOnUpdate, yt as getAggregateIndexes, z as getForeignKeys } from "../schema-D95Z3Kss.js";
|
|
8
8
|
import { t as defineSchemaExtension } from "../extensions-Blzsyekm.js";
|
|
9
|
-
import { compareValues, v } from "convex/values";
|
|
9
|
+
import { compareValues, convexToJson, jsonToConvex, v } from "convex/values";
|
|
10
10
|
import { defineSchema as defineSchema$1, internalActionGeneric, internalMutationGeneric } from "convex/server";
|
|
11
11
|
|
|
12
12
|
//#region src/orm/builders/bigint.ts
|
|
@@ -1560,6 +1560,33 @@ var GelRelationalQuery = class GelRelationalQuery extends QueryPromise {
|
|
|
1560
1560
|
this._countIndexReadinessByKey = countIndexReadiness ?? /* @__PURE__ */ new Map();
|
|
1561
1561
|
}
|
|
1562
1562
|
/**
|
|
1563
|
+
* Relation counts for a document the caller is already holding.
|
|
1564
|
+
*
|
|
1565
|
+
* `returning({ _count })` runs inside the mutation that just wrote the row,
|
|
1566
|
+
* so resolving it through `execute()` spends one `db.get` re-reading a
|
|
1567
|
+
* document that is already in the transaction's write set. The count engine
|
|
1568
|
+
* only ever reads the counted edges' source fields off its parent, and the
|
|
1569
|
+
* caller's document carries all of them, so the root read is pure waste.
|
|
1570
|
+
* Everything else `execute()` would have done to that row — the select-plan
|
|
1571
|
+
* assertion and the RLS select filter — still runs here.
|
|
1572
|
+
*
|
|
1573
|
+
* Reached through the static accessor below rather than exposed on the instance:
|
|
1574
|
+
* `GelRelationalQuery` is the declared return type of the public query
|
|
1575
|
+
* builders, so an instance method would land in every user's autocomplete.
|
|
1576
|
+
*/
|
|
1577
|
+
async _countRelationsForHeldRow(row, countSelection) {
|
|
1578
|
+
this._assertRlsSelectPlan({ _count: countSelection }, this.tableConfig, this.edgeMetadata, 0, 3);
|
|
1579
|
+
const carrier = { ...row };
|
|
1580
|
+
const visible = await this._applyRlsSelectFilter([carrier], this.tableConfig);
|
|
1581
|
+
if (visible.length === 0) return {};
|
|
1582
|
+
await this._loadRelationCounts(visible, countSelection, this.edgeMetadata, this.tableConfig);
|
|
1583
|
+
return carrier._count ?? {};
|
|
1584
|
+
}
|
|
1585
|
+
/** @internal Accessor for `returning({ _count })`; see `returning-count.ts`. */
|
|
1586
|
+
static countRelationsForHeldRow(query, row, countSelection) {
|
|
1587
|
+
return query._countRelationsForHeldRow(row, countSelection);
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1563
1590
|
* The aggregate-index runtime, registered at `createOrm()`.
|
|
1564
1591
|
*
|
|
1565
1592
|
* Only `count()`, `aggregate()` and relation counts reach this; plain reads
|
|
@@ -5118,13 +5145,26 @@ function createReturningCountLoader(db, table, ormContext) {
|
|
|
5118
5145
|
const tableEdges = edgeMetadata.filter((edge) => edge.sourceTable === tableName);
|
|
5119
5146
|
const countIndexReadiness = /* @__PURE__ */ new Map();
|
|
5120
5147
|
return { async load(row, countSelection) {
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
columns: {},
|
|
5124
|
-
with: { _count: countSelection }
|
|
5125
|
-
}, "first", edgeMetadata, ormContext?.rls, ormContext?.relationLoading, void 0, void 0, countIndexReadiness).execute())?._count ?? {};
|
|
5148
|
+
const query = new GelRelationalQuery(schema, tableConfig, tableEdges, db, {}, "first", edgeMetadata, ormContext?.rls, ormContext?.relationLoading, void 0, void 0, countIndexReadiness);
|
|
5149
|
+
return await GelRelationalQuery.countRelationsForHeldRow(query, row, countSelection);
|
|
5126
5150
|
} };
|
|
5127
5151
|
}
|
|
5152
|
+
/**
|
|
5153
|
+
* True when any edge leaving `tableName` keys on `_creationTime`.
|
|
5154
|
+
*
|
|
5155
|
+
* The count engine reads an edge's source fields straight off the row it is
|
|
5156
|
+
* handed, so a caller that derives that row instead of reading it back has to
|
|
5157
|
+
* know whether `_creationTime` is load-bearing — a derived insert post-image
|
|
5158
|
+
* cannot have it, and a missing source value counts zero without erroring.
|
|
5159
|
+
* Asked of every edge on the table rather than only the counted ones: the
|
|
5160
|
+
* count selection varies per statement, the schema does not.
|
|
5161
|
+
*/
|
|
5162
|
+
function countedEdgesReadCreationTime(edgeMetadata, tableName) {
|
|
5163
|
+
return (edgeMetadata ?? []).some((edge) => {
|
|
5164
|
+
if (edge.sourceTable !== tableName) return false;
|
|
5165
|
+
return (edge.sourceFields.length > 0 ? edge.sourceFields : [edge.fieldName]).some((field) => field === INTERNAL_CREATION_TIME_FIELD || field === PUBLIC_CREATED_AT_FIELD);
|
|
5166
|
+
});
|
|
5167
|
+
}
|
|
5128
5168
|
|
|
5129
5169
|
//#endregion
|
|
5130
5170
|
//#region src/orm/delete.ts
|
|
@@ -5459,6 +5499,7 @@ var ConvexDeleteBuilder = class extends QueryPromise {
|
|
|
5459
5499
|
|
|
5460
5500
|
//#endregion
|
|
5461
5501
|
//#region src/orm/insert.ts
|
|
5502
|
+
const canonicalizeStoredRow = (row) => jsonToConvex(convexToJson(row));
|
|
5462
5503
|
var ConvexInsertBuilder = class extends QueryPromise {
|
|
5463
5504
|
valuesList = [];
|
|
5464
5505
|
returningFields;
|
|
@@ -5509,13 +5550,15 @@ var ConvexInsertBuilder = class extends QueryPromise {
|
|
|
5509
5550
|
async execute() {
|
|
5510
5551
|
if (this.valuesList.length === 0) throw new Error("values() must be called before execute()");
|
|
5511
5552
|
const ormContext = getOrmContext(this.db);
|
|
5553
|
+
const tableName = getTableName(this.table);
|
|
5512
5554
|
const returningSelection = this.returningFields && this.returningFields !== true ? splitReturningSelection(this.returningFields) : void 0;
|
|
5555
|
+
const derivedRowSatisfiesCount = returningSelection?.countSelection === void 0 || !countedEdgesReadCreationTime(ormContext?.edgeMetadata, tableName) && !isRlsEnabled(this.table);
|
|
5556
|
+
const canDerivePostImage = returningSelection !== void 0 && !hasLifecycleHooks(this.db, tableName) && !returningSelectionReadsCreationTime(returningSelection.columnSelection) && derivedRowSatisfiesCount;
|
|
5513
5557
|
const results = [];
|
|
5514
5558
|
for (const value of this.valuesList) {
|
|
5515
5559
|
const preparedValue = normalizeDateFieldsForWrite(this.table, applyDefaults(this.table, value));
|
|
5516
5560
|
enforcePolymorphicWrite(this.table, preparedValue);
|
|
5517
5561
|
const rls = ormContext?.rls;
|
|
5518
|
-
const tableName = getTableName(this.table);
|
|
5519
5562
|
const rlsResolution = createRlsPolicyResolutionCache();
|
|
5520
5563
|
if (!await canInsertRow({
|
|
5521
5564
|
cache: rlsResolution,
|
|
@@ -5534,7 +5577,10 @@ var ConvexInsertBuilder = class extends QueryPromise {
|
|
|
5534
5577
|
await enforceUniqueIndexes(this.db, this.table, preparedValue, { changedFields: new Set(Object.keys(preparedValue)) });
|
|
5535
5578
|
const id = await this.db.insert(tableName, preparedValue);
|
|
5536
5579
|
if (!this.returningFields) continue;
|
|
5537
|
-
const inserted =
|
|
5580
|
+
const inserted = canDerivePostImage ? canonicalizeStoredRow({
|
|
5581
|
+
...preparedValue,
|
|
5582
|
+
_id: id
|
|
5583
|
+
}) : await this.db.get(id);
|
|
5538
5584
|
if (inserted) results.push(await this.resolveReturningRow(inserted, returningSelection, ormContext));
|
|
5539
5585
|
}
|
|
5540
5586
|
if (!this.returningFields) return;
|
|
@@ -5625,7 +5671,10 @@ var ConvexInsertBuilder = class extends QueryPromise {
|
|
|
5625
5671
|
await this.db.patch(tableName, existing._id, writeSet);
|
|
5626
5672
|
return {
|
|
5627
5673
|
status: "updated",
|
|
5628
|
-
row: this.returningFields ? await this.db.get(existing._id) :
|
|
5674
|
+
row: this.returningFields ? hasLifecycleHooks(this.db, tableName) ? await this.db.get(existing._id) : canonicalizeStoredRow(stripUnsetFields({
|
|
5675
|
+
...existing,
|
|
5676
|
+
...writeSet
|
|
5677
|
+
}, unsetFieldsOf(writeSet))) : null
|
|
5629
5678
|
};
|
|
5630
5679
|
}
|
|
5631
5680
|
async findConflictRow(value, targetColumns) {
|
|
@@ -6637,13 +6686,7 @@ var ConvexUpdateBuilder = class extends QueryPromise {
|
|
|
6637
6686
|
const hooksCanWriteMidLoop = hasLifecycleHooks(this.db, tableName) || incomingForeignKeys.some((foreignKey) => hasLifecycleHooks(this.db, foreignKey.sourceTableName));
|
|
6638
6687
|
const cascadeTargetsThisTable = incomingForeignKeys.some((foreignKey) => foreignKey.sourceTableName === tableName);
|
|
6639
6688
|
const canDerivePostImage = !(hooksCanWriteMidLoop || cascadeTargetsThisTable);
|
|
6640
|
-
const unsetFields =
|
|
6641
|
-
const derivePostImage = (candidate) => {
|
|
6642
|
-
if (unsetFields.length === 0) return candidate;
|
|
6643
|
-
const postImage = { ...candidate };
|
|
6644
|
-
for (const field of unsetFields) delete postImage[field];
|
|
6645
|
-
return postImage;
|
|
6646
|
-
};
|
|
6689
|
+
const unsetFields = unsetFieldsOf(writeSet);
|
|
6647
6690
|
/**
|
|
6648
6691
|
* A single-column `references()` FK to `_id` whose column is supplied by
|
|
6649
6692
|
* `set()` probes a byte-identical id on every row, and nothing in this loop
|
|
@@ -6690,7 +6733,7 @@ var ConvexUpdateBuilder = class extends QueryPromise {
|
|
|
6690
6733
|
await this.db.patch(tableName, row._id, writeSet);
|
|
6691
6734
|
numAffected++;
|
|
6692
6735
|
if (!this.returningFields) continue;
|
|
6693
|
-
const updated = canDerivePostImage ?
|
|
6736
|
+
const updated = canDerivePostImage ? stripUnsetFields(updatedRow, unsetFields) : await this.db.get(row._id);
|
|
6694
6737
|
if (!updated) continue;
|
|
6695
6738
|
if (this.returningFields === true) results.push(hydrateDateFieldsForRead(this.table, updated));
|
|
6696
6739
|
else {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as MigrationTableName, D as defineMigrationSet, E as defineMigration, O as detectMigrationDrift, S as MigrationStep, T as buildMigrationPlan, _ as MigrationMigrateOne, a as MigrationCancelArgs, b as MigrationSet, c as MigrationStatusArgs, d as MigrationDefinition, f as MigrationDirection, g as MigrationManifestEntry, h as MigrationDriftIssue, l as createMigrationHandlers, m as MigrationDocContext, o as MigrationRunArgs, p as MigrationDoc, s as MigrationRunChunkArgs, u as MigrationAppliedState, v as MigrationPlan, w as MigrationWriteMode, x as MigrationStateMap, y as MigrationRunStatus } from "../../capabilities-
|
|
2
|
-
import { Ct as migrationCapability, dt as MIGRATION_STORAGE_TABLE_NAMES, ft as injectMigrationStorageTables, lt as MIGRATION_RUN_TABLE, mt as migrationStorageTables, pt as migrationExtension, ut as MIGRATION_STATE_TABLE } from "../../where-clause-compiler-
|
|
1
|
+
import { C as MigrationTableName, D as defineMigrationSet, E as defineMigration, O as detectMigrationDrift, S as MigrationStep, T as buildMigrationPlan, _ as MigrationMigrateOne, a as MigrationCancelArgs, b as MigrationSet, c as MigrationStatusArgs, d as MigrationDefinition, f as MigrationDirection, g as MigrationManifestEntry, h as MigrationDriftIssue, l as createMigrationHandlers, m as MigrationDocContext, o as MigrationRunArgs, p as MigrationDoc, s as MigrationRunChunkArgs, u as MigrationAppliedState, v as MigrationPlan, w as MigrationWriteMode, x as MigrationStateMap, y as MigrationRunStatus } from "../../capabilities-DkfnnNp7.js";
|
|
2
|
+
import { Ct as migrationCapability, dt as MIGRATION_STORAGE_TABLE_NAMES, ft as injectMigrationStorageTables, lt as MIGRATION_RUN_TABLE, mt as migrationStorageTables, pt as migrationExtension, ut as MIGRATION_STATE_TABLE } from "../../where-clause-compiler-CETRjurp.js";
|
|
3
3
|
export { MIGRATION_RUN_TABLE, MIGRATION_STATE_TABLE, MIGRATION_STORAGE_TABLE_NAMES, type MigrationAppliedState, type MigrationCancelArgs, type MigrationDefinition, type MigrationDirection, type MigrationDoc, type MigrationDocContext, type MigrationDriftIssue, type MigrationManifestEntry, type MigrationMigrateOne, type MigrationPlan, type MigrationRunArgs, type MigrationRunChunkArgs, type MigrationRunStatus, type MigrationSet, type MigrationStateMap, type MigrationStatusArgs, type MigrationStep, type MigrationTableName, type MigrationWriteMode, buildMigrationPlan, createMigrationHandlers, defineMigration, defineMigrationSet, detectMigrationDrift, injectMigrationStorageTables, migrationCapability, migrationExtension, migrationStorageTables };
|
|
@@ -1142,6 +1142,39 @@ function splitReturningSelection(fields) {
|
|
|
1142
1142
|
countSelection
|
|
1143
1143
|
};
|
|
1144
1144
|
}
|
|
1145
|
+
/**
|
|
1146
|
+
* The keys a `patch` payload removes rather than writes.
|
|
1147
|
+
*
|
|
1148
|
+
* `patch` drops a key whose value is `undefined`; a local `{ ...row, ...set }`
|
|
1149
|
+
* merge keeps it, and `hydrateDateFieldsForRead` would then emit it. Hoisted
|
|
1150
|
+
* out of per-row loops by callers: one statement writes one `set()`.
|
|
1151
|
+
*/
|
|
1152
|
+
function unsetFieldsOf(writeSet) {
|
|
1153
|
+
return Object.keys(writeSet).filter((field) => writeSet[field] === void 0);
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Removes the keys `patch` would have dropped from a locally derived
|
|
1157
|
+
* post-image. Returns `candidate` untouched when there is nothing to remove.
|
|
1158
|
+
*/
|
|
1159
|
+
function stripUnsetFields(candidate, unsetFields) {
|
|
1160
|
+
if (unsetFields.length === 0) return candidate;
|
|
1161
|
+
const postImage = { ...candidate };
|
|
1162
|
+
for (const field of unsetFields) delete postImage[field];
|
|
1163
|
+
return postImage;
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* True when the projection reads `_creationTime`, under either the public
|
|
1167
|
+
* `createdAt` alias or a user column that shadows it.
|
|
1168
|
+
*
|
|
1169
|
+
* `insert()` derives its post-image from the payload it just wrote, and
|
|
1170
|
+
* `_creationTime` is the one field that payload can never carry: Convex's
|
|
1171
|
+
* insert syscall returns the id and nothing else.
|
|
1172
|
+
*/
|
|
1173
|
+
function returningSelectionReadsCreationTime(columnSelection) {
|
|
1174
|
+
if (!columnSelection) return false;
|
|
1175
|
+
for (const column of Object.values(columnSelection)) if (getSelectionColumnName(column) === INTERNAL_CREATION_TIME_FIELD) return true;
|
|
1176
|
+
return false;
|
|
1177
|
+
}
|
|
1145
1178
|
const matchLike = matchLikePattern;
|
|
1146
1179
|
function evaluateFilter(row, filter) {
|
|
1147
1180
|
if (filter.type === "binary") {
|
|
@@ -1489,4 +1522,4 @@ function aggregateExtension() {
|
|
|
1489
1522
|
}
|
|
1490
1523
|
|
|
1491
1524
|
//#endregion
|
|
1492
|
-
export { resolveOrmRuntimeDefaults as $, enforceUniqueIndexes as A, getMutationAsyncDelayMs as B, collectPrimaryIdLookupRows as C,
|
|
1525
|
+
export { resolveOrmRuntimeDefaults as $, enforceUniqueIndexes as A, getMutationAsyncDelayMs as B, collectPrimaryIdLookupRows as C, CREATED_AT_MIGRATION_MESSAGE as Ct, enforceCheckConstraints as D, encodeUndefinedDeep as E, usesSystemCreatedAtAlias as Et, evaluateFilter as F, getTableDeleteConfig as G, getMutationExecutionMode as H, extractPrimaryIdLookup as I, hardDeleteRow as J, getTableName as K, getChecks as L, ensureNonNullValues as M, ensureNullableColumns as N, enforceForeignKeys as O, evaluateCheckConstraintTriState as P, patchReferencingRows as Q, getColumnName as R, collectMutationRowsBounded as S, resolveIndexOrderPushdown as St, deserializeFilterExpression as T, PUBLIC_CREATED_AT_FIELD as Tt, getOrmContext as U, getMutationCollectionLimits as V, getTableColumns as W, normalizeDateFieldsForWrite as X, hydrateDateFieldsForRead as Y, normalizeTemporalComparableValue as Z, applyDefaults as _, findSearchIndexByName as _t, AGGREGATE_STATE_TABLE as a, stripUnsetFields as at, buildForeignKeyGraph as b, getIndexes as bt, getAggregateIndexDefinitions as c, unsetFieldsOf as ct, COUNT_ERROR as d, compileConvexFilter as dt, returningSelectionReadsCreationTime as et, createAggregateError as f, convexAnd as ft, ensureCountAllowedForRls as g, findRelationIndex as gt, ensureAggregateAllowedForRls as h, findIndexForColumns as ht, AGGREGATE_RANK_TREE_TABLE as i, splitReturningSelection as it, ensureDefaultColumns as j, enforcePolymorphicWrite as k, getRankIndexDefinitions as l, hasLifecycleHooks as lt, createError as m, mapWithConcurrency as mt, AGGREGATE_EXTREMA_TABLE as n, serializeFilterExpression as nt, aggregateExtension as o, takeRowsWithinByteBudget as ot, createCountError as p, isConvexEnforceableFilter as pt, getUniqueIndexes as q, AGGREGATE_MEMBER_TABLE as r, softDeleteRow as rt, rankAggregateName as s, toConvexFilter as st, AGGREGATE_BUCKET_TABLE as t, selectReturningRowWithHydration as tt, AGGREGATE_ERROR as u, markLifecycleHookedTables as ut, applyIncomingForeignKeyActionsOnDelete as v, findVectorIndexByName as vt, decodeUndefinedDeep as w, INTERNAL_CREATION_TIME_FIELD as wt, canUsePrimaryIdLookupCursor as x, getRankIndexes as xt, applyIncomingForeignKeyActionsOnUpdate as y, getAggregateIndexes as yt, getForeignKeys as z };
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -8,8 +8,6 @@ import { BetterAuthClientPlugin } from "better-auth/client";
|
|
|
8
8
|
import { createAuthClient } from "better-auth/solid";
|
|
9
9
|
import * as better_auth0 from "better-auth";
|
|
10
10
|
import { Session, User } from "better-auth";
|
|
11
|
-
import * as better_auth_api0 from "better-auth/api";
|
|
12
|
-
import * as better_auth_plugins_oidc_provider0 from "better-auth/plugins/oidc-provider";
|
|
13
11
|
import * as jose from "jose";
|
|
14
12
|
import { BetterAuthOptions } from "better-auth/minimal";
|
|
15
13
|
|
|
@@ -977,18 +975,15 @@ declare const convex$1: (opts: {
|
|
|
977
975
|
hooks: {
|
|
978
976
|
before: ({
|
|
979
977
|
matcher(context: better_auth0.HookEndpointContext): boolean;
|
|
980
|
-
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
978
|
+
handler: better_auth0.Middleware<better_auth0.MiddlewareOptions, (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
981
979
|
context: {
|
|
982
980
|
headers: Headers;
|
|
983
981
|
};
|
|
984
|
-
} | undefined
|
|
982
|
+
} | undefined>>;
|
|
985
983
|
} | {
|
|
986
984
|
matcher: (ctx: better_auth0.HookEndpointContext) => boolean;
|
|
987
|
-
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
988
|
-
context: better_auth0.MiddlewareContext<better_auth0.MiddlewareOptions, {
|
|
989
|
-
returned?: unknown | undefined;
|
|
990
|
-
responseHeaders?: Headers | undefined;
|
|
991
|
-
} & better_auth0.PluginContext<BetterAuthOptions> & better_auth0.InfoContext & {
|
|
985
|
+
handler: better_auth0.Middleware<better_auth0.MiddlewareOptions, (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
986
|
+
context: better_auth0.MiddlewareContext<better_auth0.MiddlewareOptions, better_auth0.PluginContext<BetterAuthOptions> & better_auth0.InfoContext & {
|
|
992
987
|
options: BetterAuthOptions;
|
|
993
988
|
trustedOrigins: string[];
|
|
994
989
|
trustedProviders: string[];
|
|
@@ -1080,6 +1075,7 @@ declare const convex$1: (opts: {
|
|
|
1080
1075
|
updateAge: number;
|
|
1081
1076
|
expiresIn: number;
|
|
1082
1077
|
freshAge: number;
|
|
1078
|
+
cookieCacheSigner?: better_auth0.CookieCacheSigner | undefined;
|
|
1083
1079
|
cookieRefreshCache: false | {
|
|
1084
1080
|
enabled: true;
|
|
1085
1081
|
updateAge: number;
|
|
@@ -1113,12 +1109,15 @@ declare const convex$1: (opts: {
|
|
|
1113
1109
|
skipCSRFCheck: boolean;
|
|
1114
1110
|
runInBackground: (promise: Promise<unknown>) => void;
|
|
1115
1111
|
runInBackgroundOrAwait: (promise: Promise<unknown> | void) => better_auth0.Awaitable<unknown>;
|
|
1112
|
+
} & {
|
|
1113
|
+
returned?: unknown | undefined;
|
|
1114
|
+
responseHeaders?: Headers | undefined;
|
|
1116
1115
|
}>;
|
|
1117
|
-
}
|
|
1116
|
+
}>>;
|
|
1118
1117
|
})[];
|
|
1119
1118
|
after: {
|
|
1120
|
-
matcher: (
|
|
1121
|
-
handler:
|
|
1119
|
+
matcher: (ctx: better_auth0.HookEndpointContext) => boolean;
|
|
1120
|
+
handler: better_auth0.Middleware<better_auth0.MiddlewareOptions, (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>>;
|
|
1122
1121
|
}[];
|
|
1123
1122
|
};
|
|
1124
1123
|
endpoints: {
|
|
@@ -1127,7 +1126,25 @@ declare const convex$1: (opts: {
|
|
|
1127
1126
|
metadata: {
|
|
1128
1127
|
isAction: false;
|
|
1129
1128
|
};
|
|
1130
|
-
},
|
|
1129
|
+
}, {
|
|
1130
|
+
issuer: string;
|
|
1131
|
+
authorization_endpoint: string;
|
|
1132
|
+
token_endpoint: string;
|
|
1133
|
+
userinfo_endpoint: string;
|
|
1134
|
+
jwks_uri: string;
|
|
1135
|
+
registration_endpoint: string;
|
|
1136
|
+
end_session_endpoint: string;
|
|
1137
|
+
scopes_supported: string[];
|
|
1138
|
+
response_types_supported: string[];
|
|
1139
|
+
response_modes_supported: string[];
|
|
1140
|
+
grant_types_supported: string[];
|
|
1141
|
+
acr_values_supported: string[];
|
|
1142
|
+
subject_types_supported: string[];
|
|
1143
|
+
id_token_signing_alg_values_supported: string[];
|
|
1144
|
+
token_endpoint_auth_methods_supported: string[];
|
|
1145
|
+
code_challenge_methods_supported: string[];
|
|
1146
|
+
claims_supported: string[];
|
|
1147
|
+
}>;
|
|
1131
1148
|
getJwks: better_auth0.StrictEndpoint<"/convex/jwks", {
|
|
1132
1149
|
method: "GET";
|
|
1133
1150
|
metadata: {
|
|
@@ -1164,7 +1181,7 @@ declare const convex$1: (opts: {
|
|
|
1164
1181
|
getToken: better_auth0.StrictEndpoint<"/convex/token", {
|
|
1165
1182
|
method: "GET";
|
|
1166
1183
|
requireHeaders: true;
|
|
1167
|
-
use: (
|
|
1184
|
+
use: better_auth0.Middleware<better_auth0.MiddlewareOptions, (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
1168
1185
|
session: {
|
|
1169
1186
|
session: Record<string, any> & {
|
|
1170
1187
|
id: string;
|
|
@@ -1186,7 +1203,7 @@ declare const convex$1: (opts: {
|
|
|
1186
1203
|
image?: string | null | undefined;
|
|
1187
1204
|
};
|
|
1188
1205
|
};
|
|
1189
|
-
}
|
|
1206
|
+
}>>[];
|
|
1190
1207
|
metadata: {
|
|
1191
1208
|
openapi: {
|
|
1192
1209
|
description: string;
|
|
@@ -1215,6 +1232,14 @@ declare const convex$1: (opts: {
|
|
|
1215
1232
|
type: "date";
|
|
1216
1233
|
required: false;
|
|
1217
1234
|
};
|
|
1235
|
+
alg: {
|
|
1236
|
+
type: "string";
|
|
1237
|
+
required: false;
|
|
1238
|
+
};
|
|
1239
|
+
crv: {
|
|
1240
|
+
type: "string";
|
|
1241
|
+
required: false;
|
|
1242
|
+
};
|
|
1218
1243
|
};
|
|
1219
1244
|
};
|
|
1220
1245
|
user: {
|
|
@@ -1288,7 +1313,10 @@ type SolidAuthProviderClient = {
|
|
|
1288
1313
|
type AuthClientWithPlugins<Plugins extends BetterAuthClientPlugin[]> = ReturnType<typeof createAuthClient<{
|
|
1289
1314
|
plugins: Plugins;
|
|
1290
1315
|
}>>;
|
|
1291
|
-
type
|
|
1316
|
+
type HydratableAuthClient<Plugins extends BetterAuthClientPlugin[]> = Omit<AuthClientWithPlugins<Plugins>, 'hydrateSession'> & {
|
|
1317
|
+
hydrateSession(session: Parameters<AuthClientWithPlugins<Plugins>['hydrateSession']>[0]): void;
|
|
1318
|
+
};
|
|
1319
|
+
type SolidAuthClient = HydratableAuthClient<PluginsWithCrossDomain> | HydratableAuthClient<PluginsWithoutCrossDomain>;
|
|
1292
1320
|
//#endregion
|
|
1293
1321
|
//#region src/solid/convex-auth-provider.d.ts
|
|
1294
1322
|
type ConvexAuthProviderProps = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as JWT_COOKIE_NAME } from "./convex-plugin-
|
|
1
|
+
import { t as JWT_COOKIE_NAME } from "./convex-plugin-Dic0l-k8.js";
|
|
2
2
|
import { betterFetch } from "@better-fetch/fetch";
|
|
3
3
|
import { getSessionCookie } from "better-auth/cookies";
|
|
4
4
|
import * as jose from "jose";
|