@forestfuture/active-record 0.8.2 → 0.9.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/dist/adapter.d.mts +2 -2
- package/dist/adapter.mjs +4 -4
- package/dist/{batch-D3nP3g83.mjs → batch-Ca1JtVcK.mjs} +3255 -2527
- package/dist/cli.d.mts +4 -4
- package/dist/cli.mjs +3 -3
- package/dist/command.mjs +19 -18
- package/dist/d1.d.mts +2 -2
- package/dist/d1.mjs +9 -4
- package/dist/for-adapters-Bl6BCiR1.mjs +12 -0
- package/dist/{for-adapters-CgEQfuyD.mjs → for-adapters-D35a5x3t.mjs} +6 -3
- package/dist/{for-adapters-DAn1wSYz.d.mts → for-adapters-DoyXc8Dq.d.mts} +1 -1
- package/dist/{generated-model-FB7oT7V1.mjs → generated-model-L4WAqgOZ.mjs} +1949 -1149
- package/dist/{epoch-storage-C7186hd1.mjs → identifiers-CzqYL_nC.mjs} +248 -223
- package/dist/{index-BfX3Dgy_.d.mts → index-Fq4gT3c8.d.mts} +115 -96
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +5 -5
- package/dist/metadata-BIUbGJlS.d.mts +363 -0
- package/dist/{plugin-BY2QaRpq.mjs → plugin-BHUP4ssD.mjs} +10 -7
- package/dist/{plugin-IHD0I6Rg.mjs → plugin-BMAJKgj6.mjs} +7 -7
- package/dist/postgresql.d.mts +1 -1
- package/dist/postgresql.mjs +28 -4
- package/dist/{src-DnuvSHF6.mjs → src-fYq-nVHE.mjs} +2 -2
- package/dist/{storage-override-BFC-GSR0.mjs → storage-override-yF2NT5ST.mjs} +1 -1
- package/dist/{validations-DFLjJ203.d.mts → validations-CKPJoSj4.d.mts} +290 -103
- package/llms-full.txt +8280 -4094
- package/package.json +1 -1
- package/skills/active-record/SKILL.md +4 -3
- package/dist/for-adapters-l4rNitkK.mjs +0 -31
- package/dist/metadata-CzntpYzC.d.mts +0 -182
|
@@ -1,96 +1,4 @@
|
|
|
1
|
-
import { I as DatetimeAttributeKey, L as NumberAttributeKey, O as AnyDatabase,
|
|
2
|
-
/** One of the attributes of `C`'s records, which a counter cache names. */
|
|
3
|
-
type CounterName<C extends ModelClass> = NumberAttributeKey<InstanceType<C>>;
|
|
4
|
-
/** One of the datetime attributes of `C`'s records, which a belongsTo's or hasOne's `touch` names. */
|
|
5
|
-
type TouchName<C extends ModelClass> = DatetimeAttributeKey<InstanceType<C>>;
|
|
6
|
-
/** What a belongsTo's or hasOne's `touch` sets: `updatedAt`, and the datetime attributes named. */
|
|
7
|
-
type TouchedAttributes<C extends ModelClass> = true | TouchName<C> | readonly TouchName<C>[];
|
|
8
|
-
/** What a hasOne takes to touch its record (#497). */
|
|
9
|
-
interface HasOneTouchOptions<C extends ModelClass> {
|
|
10
|
-
/**
|
|
11
|
-
* Touches the record when this one is updated, destroyed or touched (not created), in the
|
|
12
|
-
* same batch: `true` sets its `updatedAt`, and a datetime attribute's name, or a list, sets
|
|
13
|
-
* those too. The record is loaded first, so its `afterTouch` and commit callbacks run. A
|
|
14
|
-
* record this one's own save writes (built through it, or autosaved), or its `dependent`
|
|
15
|
-
* removes, is left to that write.
|
|
16
|
-
*/
|
|
17
|
-
touch?: TouchedAttributes<C>;
|
|
18
|
-
}
|
|
19
|
-
/** What only a belongsTo takes; `C` is its target, whose attribute a counter cache names. */
|
|
20
|
-
interface BelongsToOptions<C extends ModelClass = ModelClass> {
|
|
21
|
-
/** The record may point at nothing: saving doesn't require its record (#339). */
|
|
22
|
-
optional?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Keeps a count of these records on the target (#61), updated in the same batch as each
|
|
25
|
-
* write: `true` counts them in the attribute named for them (`Reply` → `repliesCount`), or name
|
|
26
|
-
* another of the target's attributes (one every Model a polymorphic belongsTo lists has).
|
|
27
|
-
* `{ attribute, active: false }` keeps it on writes, but `size` doesn't read it yet, so it
|
|
28
|
-
* can be filled in for the rows already there (Rails 7.2's `active: false`).
|
|
29
|
-
*/
|
|
30
|
-
counterCache?: true | CounterName<C> | {
|
|
31
|
-
attribute?: CounterName<C>;
|
|
32
|
-
active?: false;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Touches the target when this record is created, updated, destroyed or touched (#353), in the
|
|
36
|
-
* same batch: `true` sets its `updatedAt`, and a datetime attribute's name, or a list, sets
|
|
37
|
-
* those too. The target is loaded first, so its `afterTouch` and commit callbacks run.
|
|
38
|
-
*/
|
|
39
|
-
touch?: TouchedAttributes<C>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* What a polymorphic belongsTo takes (#60): no `scope` (#436), and the attribute holding the
|
|
43
|
-
* type, inferred as the association's name + `Type` (`commentable` → `commentableType`).
|
|
44
|
-
*/
|
|
45
|
-
type PolymorphicBelongsToOptions<C extends ModelClass = ModelClass> = Omit<AssociationOptions, "dependent" | "scope"> & BelongsToOptions<C> & {
|
|
46
|
-
foreignType?: string;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* This record points at one record of one of `targets` (#60), by the type and key it holds:
|
|
50
|
-
* `commentable = belongsTo([Post, Photo])`.
|
|
51
|
-
*/
|
|
52
|
-
declare function belongsTo<L extends readonly [ModelClass, ...ModelClass[]]>(targets: L, options?: PolymorphicBelongsToOptions<L[number]>): PolymorphicBelongsTo<L[number]>;
|
|
53
|
-
/** This record points at one `target` record through `foreignKey` (its own attribute). */
|
|
54
|
-
declare function belongsTo<C extends ModelClass>(target: C, options?: Omit<AssociationOptions<C>, "dependent"> & BelongsToOptions<C>): BelongsTo<C>;
|
|
55
|
-
/**
|
|
56
|
-
* What only a hasMany or hasOne takes: `as`, the name of the target's polymorphic belongsTo
|
|
57
|
-
* (#60), so its records point at this one by its type and key.
|
|
58
|
-
*/
|
|
59
|
-
interface ToPolymorphicOptions {
|
|
60
|
-
/**
|
|
61
|
-
* The target's polymorphic belongsTo this one is the other side of (#60): its records'
|
|
62
|
-
* `${as}Type` holds this Model's name and `${as}Id` its key.
|
|
63
|
-
*/
|
|
64
|
-
as?: string;
|
|
65
|
-
/** The target's attribute holding the type, inferred from `as` (`commentableType`). */
|
|
66
|
-
foreignType?: string;
|
|
67
|
-
}
|
|
68
|
-
/** What only a hasMany takes. */
|
|
69
|
-
interface HasManyOptions {
|
|
70
|
-
dependent?: HasManyDependent;
|
|
71
|
-
/**
|
|
72
|
-
* The owner's attribute holding a counter cache of these records (#61), which `size` reads:
|
|
73
|
-
* by default the one named for this association (`replies` → `repliesCount`), as Rails'
|
|
74
|
-
* has_many `counter_cache:`. The records' belongsTo keeps it.
|
|
75
|
-
*/
|
|
76
|
-
counterCache?: string;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Many `target` records point at this record through `foreignKey` (theirs); or, with `through`,
|
|
80
|
-
* this record reaches them through another of its associations (#59).
|
|
81
|
-
*/
|
|
82
|
-
declare function hasMany<C extends ModelClass>(target: C, options: ThroughOptions<C> & {
|
|
83
|
-
dependent?: ThroughDependent;
|
|
84
|
-
}): HasManyThrough<C>;
|
|
85
|
-
declare function hasMany<C extends ModelClass>(target: C, options?: AssociationOptions<C> & ToPolymorphicOptions & HasManyOptions): HasMany<C>;
|
|
86
|
-
/**
|
|
87
|
-
* One `target` record points at this record through `foreignKey` (its own); or, with
|
|
88
|
-
* `through`, this record reaches it through another of its associations (#59).
|
|
89
|
-
*/
|
|
90
|
-
declare function hasOne<C extends ModelClass>(target: C, options: ThroughOptions<C> & HasOneTouchOptions<C>): HasOneThrough<C>;
|
|
91
|
-
declare function hasOne<C extends ModelClass>(target: C, options?: AssociationOptions<C> & ToPolymorphicOptions & HasOneTouchOptions<C> & {
|
|
92
|
-
dependent?: HasOneDependent;
|
|
93
|
-
}): HasOne<C>;
|
|
1
|
+
import { I as DatetimeAttributeKey, L as NumberAttributeKey, O as AnyDatabase, _t as HasOneThrough, bt as ThroughOptions, dt as HasMany, f as Model, g as DatabaseSchema, gt as HasOneDependent, ht as HasOne, lt as AssociationOptions, mt as HasManyThrough, p as ModelClass, pt as HasManyDependent, ut as BelongsTo, vt as PolymorphicBelongsTo, yt as ThroughDependent } from "./validations-CKPJoSj4.mjs";
|
|
94
2
|
/** Base class for every error the library throws on purpose. */
|
|
95
3
|
declare class ActiveRecordError extends Error {
|
|
96
4
|
name: string;
|
|
@@ -111,6 +19,13 @@ declare class NoDatabase extends ActiveRecordError {
|
|
|
111
19
|
declare class RecordNotFound extends ActiveRecordError {
|
|
112
20
|
name: string;
|
|
113
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* A token a finder that must find a record was given isn't valid (#517): it was changed, signed
|
|
24
|
+
* with another secret, made for another purpose, or has expired.
|
|
25
|
+
*/
|
|
26
|
+
declare class InvalidToken extends ActiveRecordError {
|
|
27
|
+
name: string;
|
|
28
|
+
}
|
|
114
29
|
/** `sole()` or `findSoleBy()` matched more than one record. */
|
|
115
30
|
declare class SoleRecordExceeded extends ActiveRecordError {
|
|
116
31
|
name: string;
|
|
@@ -123,7 +38,7 @@ declare class MissingAttribute extends ActiveRecordError {
|
|
|
123
38
|
declare class DeleteRestriction extends ActiveRecordError {
|
|
124
39
|
name: string;
|
|
125
40
|
}
|
|
126
|
-
/** `last()` can't reverse an order given as an `sql` fragment
|
|
41
|
+
/** `last()` can't reverse an order given as an `sql` fragment. */
|
|
127
42
|
declare class IrreversibleOrder extends ActiveRecordError {
|
|
128
43
|
name: string;
|
|
129
44
|
}
|
|
@@ -199,6 +114,18 @@ declare function abort(reason?: string): CallbackAbort;
|
|
|
199
114
|
declare class RecordNotSaved extends ActiveRecordError {
|
|
200
115
|
name: string;
|
|
201
116
|
}
|
|
117
|
+
/** What a stale record was refused: its save's update, its destroy, or its `touch()` (#357). */
|
|
118
|
+
type StaleAction = "update" | "destroy" | "touch";
|
|
119
|
+
/**
|
|
120
|
+
* A save, destroy or `touch()` of a record whose row another write changed since it was loaded
|
|
121
|
+
* (#357): its `lockVersion` is no longer the row's. Nothing in the write was kept.
|
|
122
|
+
*/
|
|
123
|
+
declare class StaleRecord extends ActiveRecordError {
|
|
124
|
+
name: string;
|
|
125
|
+
readonly record: Model;
|
|
126
|
+
readonly action: StaleAction;
|
|
127
|
+
constructor(record: Model, action: StaleAction, options?: ErrorOptions);
|
|
128
|
+
}
|
|
202
129
|
/**
|
|
203
130
|
* `abort()` was thrown from an after-write callback (`afterSave`, `afterCreate`, `afterUpdate`,
|
|
204
131
|
* `afterDestroy`, `afterTouch`), or from an around callback once its `next()` resolved. That's a
|
|
@@ -231,7 +158,7 @@ declare class ReadonlyAssociation extends ActiveRecordError {
|
|
|
231
158
|
}
|
|
232
159
|
/**
|
|
233
160
|
* A polymorphic belongsTo's type that names none of the Models it lists (#60), read from the
|
|
234
|
-
* database
|
|
161
|
+
* database.
|
|
235
162
|
*/
|
|
236
163
|
declare class UnknownModelName extends ActiveRecordError {
|
|
237
164
|
name: string;
|
|
@@ -240,6 +167,98 @@ declare class UnknownModelName extends ActiveRecordError {
|
|
|
240
167
|
declare class AssociationNotLoaded extends ActiveRecordError {
|
|
241
168
|
name: string;
|
|
242
169
|
}
|
|
170
|
+
/** One of the attributes of `C`'s records, which a counter cache names. */
|
|
171
|
+
type CounterName<C extends ModelClass> = NumberAttributeKey<InstanceType<C>>;
|
|
172
|
+
/** One of the datetime attributes of `C`'s records, which a belongsTo's or hasOne's `touch` names. */
|
|
173
|
+
type TouchName<C extends ModelClass> = DatetimeAttributeKey<InstanceType<C>>;
|
|
174
|
+
/** What a belongsTo's or hasOne's `touch` sets: `updatedAt`, and the datetime attributes named. */
|
|
175
|
+
type TouchedAttributes<C extends ModelClass> = true | TouchName<C> | readonly TouchName<C>[];
|
|
176
|
+
/** What a hasOne takes to touch its record (#497). */
|
|
177
|
+
interface HasOneTouchOptions<C extends ModelClass> {
|
|
178
|
+
/**
|
|
179
|
+
* Touches the record when this one is updated, destroyed or touched (not created), in the
|
|
180
|
+
* same batch: `true` sets its `updatedAt`, and a datetime attribute's name, or a list, sets
|
|
181
|
+
* those too. The record is loaded first, so its `afterTouch` and commit callbacks run. A
|
|
182
|
+
* record this one's own save writes (built through it, or autosaved), or its `dependent`
|
|
183
|
+
* removes, is left to that write.
|
|
184
|
+
*/
|
|
185
|
+
touch?: TouchedAttributes<C>;
|
|
186
|
+
}
|
|
187
|
+
/** What only a belongsTo takes; `C` is its target, whose attribute a counter cache names. */
|
|
188
|
+
interface BelongsToOptions<C extends ModelClass = ModelClass> {
|
|
189
|
+
/** The record may point at nothing: saving doesn't require its record (#339). */
|
|
190
|
+
optional?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Keeps a count of these records on the target (#61), updated in the same batch as each
|
|
193
|
+
* write: `true` counts them in the attribute named for them (`Reply` → `repliesCount`), or name
|
|
194
|
+
* another of the target's attributes (one every Model a polymorphic belongsTo lists has).
|
|
195
|
+
* `{ attribute, active: false }` keeps it on writes, but `size` doesn't read it yet, so it
|
|
196
|
+
* can be filled in for the rows already there.
|
|
197
|
+
*/
|
|
198
|
+
counterCache?: true | CounterName<C> | {
|
|
199
|
+
attribute?: CounterName<C>;
|
|
200
|
+
active?: false;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Touches the target when this record is created, updated, destroyed or touched (#353), in the
|
|
204
|
+
* same batch: `true` sets its `updatedAt`, and a datetime attribute's name, or a list, sets
|
|
205
|
+
* those too. The target is loaded first, so its `afterTouch` and commit callbacks run.
|
|
206
|
+
*/
|
|
207
|
+
touch?: TouchedAttributes<C>;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* What a polymorphic belongsTo takes (#60): no `scope` (#436), and the attribute holding the
|
|
211
|
+
* type, inferred as the association's name + `Type` (`commentable` → `commentableType`).
|
|
212
|
+
*/
|
|
213
|
+
type PolymorphicBelongsToOptions<C extends ModelClass = ModelClass> = Omit<AssociationOptions, "dependent" | "scope"> & BelongsToOptions<C> & {
|
|
214
|
+
foreignType?: string;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* This record points at one record of one of `targets` (#60), by the type and key it holds:
|
|
218
|
+
* `commentable = belongsTo([Post, Photo])`.
|
|
219
|
+
*/
|
|
220
|
+
declare function belongsTo<L extends readonly [ModelClass, ...ModelClass[]]>(targets: L, options?: PolymorphicBelongsToOptions<L[number]>): PolymorphicBelongsTo<L[number]>;
|
|
221
|
+
/** This record points at one `target` record through `foreignKey` (its own attribute). */
|
|
222
|
+
declare function belongsTo<C extends ModelClass>(target: C, options?: Omit<AssociationOptions<C>, "dependent"> & BelongsToOptions<C>): BelongsTo<C>;
|
|
223
|
+
/**
|
|
224
|
+
* What only a hasMany or hasOne takes: `as`, the name of the target's polymorphic belongsTo
|
|
225
|
+
* (#60), so its records point at this one by its type and key.
|
|
226
|
+
*/
|
|
227
|
+
interface ToPolymorphicOptions {
|
|
228
|
+
/**
|
|
229
|
+
* The target's polymorphic belongsTo this one is the other side of (#60): its records'
|
|
230
|
+
* `${as}Type` holds this Model's name and `${as}Id` its key.
|
|
231
|
+
*/
|
|
232
|
+
as?: string;
|
|
233
|
+
/** The target's attribute holding the type, inferred from `as` (`commentableType`). */
|
|
234
|
+
foreignType?: string;
|
|
235
|
+
}
|
|
236
|
+
/** What only a hasMany takes. */
|
|
237
|
+
interface HasManyOptions {
|
|
238
|
+
dependent?: HasManyDependent;
|
|
239
|
+
/**
|
|
240
|
+
* The owner's attribute holding a counter cache of these records (#61), which `size` reads:
|
|
241
|
+
* by default the one named for this association (`replies` → `repliesCount`).
|
|
242
|
+
* The records' belongsTo keeps it.
|
|
243
|
+
*/
|
|
244
|
+
counterCache?: string;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Many `target` records point at this record through `foreignKey` (theirs); or, with `through`,
|
|
248
|
+
* this record reaches them through another of its associations (#59).
|
|
249
|
+
*/
|
|
250
|
+
declare function hasMany<C extends ModelClass>(target: C, options: ThroughOptions<C> & {
|
|
251
|
+
dependent?: ThroughDependent;
|
|
252
|
+
}): HasManyThrough<C>;
|
|
253
|
+
declare function hasMany<C extends ModelClass>(target: C, options?: AssociationOptions<C> & ToPolymorphicOptions & HasManyOptions): HasMany<C>;
|
|
254
|
+
/**
|
|
255
|
+
* One `target` record points at this record through `foreignKey` (its own); or, with
|
|
256
|
+
* `through`, this record reaches it through another of its associations (#59).
|
|
257
|
+
*/
|
|
258
|
+
declare function hasOne<C extends ModelClass>(target: C, options: ThroughOptions<C> & HasOneTouchOptions<C>): HasOneThrough<C>;
|
|
259
|
+
declare function hasOne<C extends ModelClass>(target: C, options?: AssociationOptions<C> & ToPolymorphicOptions & HasOneTouchOptions<C> & {
|
|
260
|
+
dependent?: HasOneDependent;
|
|
261
|
+
}): HasOne<C>;
|
|
243
262
|
/**
|
|
244
263
|
* Runs `fn` with `databases` as the request's own: queries started from a Model inside it (and
|
|
245
264
|
* everything it awaits) use the one on that Model's binding, with its Session and `onQuery`.
|
|
@@ -260,4 +279,4 @@ declare function withDatabase<R>(databases: AnyDatabase | readonly AnyDatabase[]
|
|
|
260
279
|
* which defines the scope on it; on any other, it's `undefined`.
|
|
261
280
|
*/
|
|
262
281
|
declare function defineSchema<const S extends DatabaseSchema>(schema: S): S;
|
|
263
|
-
export {
|
|
282
|
+
export { StaleAction as A, RecordDestroyed as C, RecordNotSaved as D, RecordNotFound as E, UnknownModelName as F, abort as I, StrictValidationFailed as M, UnknownAssociation as N, RecordNotUnique as O, UnknownAttribute as P, ReadonlyAssociation as S, RecordNotDestroyed as T, InvalidToken as _, hasMany as a, NoDatabase as b, ActiveRecordError as c, CheckViolation as d, ConstraintViolation as f, InvalidModel as g, InvalidForeignKey as h, belongsTo as i, StaleRecord as j, SoleRecordExceeded as k, AssociationNotLoaded as l, IncompatibleRelation as m, withDatabase as n, hasOne as o, DeleteRestriction as p, PolymorphicBelongsToOptions as r, AbortAfterPersistence as s, defineSchema as t, CallbackAbort as u, IrreversibleOrder as v, RecordInvalid as w, NotNullViolation as x, MissingAttribute as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as
|
|
3
|
-
import { A as
|
|
4
|
-
export { AbortAfterPersistence, ActiveRecordError, type AssociatedValidationOptions, AssociationNotLoaded, type AssociationOptions, type AttributeConversions, type AttributeErrorMessages, type AttributeSpec, type AttributeSpecs, type AttributeType, type Batch, type BatchEntry, type BatchResults, type BelongsTo, CallbackAbort, CheckViolation, type ColumnReference, type ColumnValue, type Comparable, type Comparison, type ComparisonBound, type ComparisonOptions, type Conditions, ConstraintViolation, type CountlessPage, type CustomType, type DatabaseSchema, DeleteRestriction, type EpochStorage, type ErrorMessage, type ErrorMessages, Errors, type FilterAttribute, type GroupedRelation, type HasMany, type HasManyCollection, type HasManyDependent, type HasManyThrough, type HasOne, type HasOneDependent, type HasOneThrough, type InOrderOfOptions, IncompatibleRelation, type Init, type InsertOptions, InvalidForeignKey, InvalidModel, IrreversibleOrder, type IterationOptions, type LengthOptions, MissingAttribute, Model, NoDatabase, NotNullViolation, type NumericalityOptions, type OrderSpec, type Page, type PageOptions, type PolymorphicBelongsTo, type PolymorphicBelongsToOptions, type QueryEvent, type QueryListener, type QueryPart, type QuerySql, ReadonlyAssociation, RecordDestroyed, RecordInvalid, RecordNotDestroyed, RecordNotFound, RecordNotSaved, RecordNotUnique, type RecordStatement, Relation, type RelationsFor, type RestrictMessages, type ReturnedRow, type Returning, type SafeSql, type SaveOptions, type Scope, type ScopeMethods, type ScopeStatic, type Scoped, SoleRecordExceeded, type Statement, StrictValidationFailed, type TableAttributes, type TableSchema, type TableSchemas, type ThroughDependent, type ThroughOptions, type TouchOptions, type UniquenessOptions, UnknownAssociation, UnknownAttribute, UnknownModelName, type UpsertOptions, type ValidationCallbackOptions, type ValidationContext, type ValidationContexts, type ValidationError, type ValidationOptions, type WriteResult, abort, batch, belongsTo, between, column, defineSchema, defineType, gt, gte, hasMany, hasOne, lt, lte, sql, withDatabase };
|
|
1
|
+
import { A as defineType, C as SecurePasswordOptions, D as Duration, E as PasswordAlgorithm, _ as SecureTokenOptions, a as AttributeType, i as AttributeSpecs, k as CustomType, r as AttributeSpec, u as EpochStorage, v as generateSecureToken } from "./metadata-BIUbGJlS.mjs";
|
|
2
|
+
import { $ as TouchOptions, At as lt, B as SaveOptions, Bt as ColumnValue, C as QueryEvent, Ct as OrderSpec, Dt as between, Et as Comparison, F as RecordStatement, Ft as QuerySql, G as Relation, Gt as ComparisonBound, H as ValidationContext, Ht as column, J as Scoped, K as Scope, Kt as ComparisonOptions, M as BatchResults, Mt as QueryPart, N as batch, Nt as InOrderOfOptions, Ot as gt, P as Batch, Q as PageOptions, R as SigningEnv, St as InsertOptions, Tt as UpsertOptions, U as ValidationContexts, Ut as sql, V as ValidationCallbackOptions, Vt as SafeSql, W as TokenForOptions, Wt as Comparable, X as CountlessPage, Y as IterationOptions, Z as Page, _ as TableSchema, _t as HasOneThrough, a as ValidationOptions, at as Statement, bt as ThroughOptions, c as AttributeErrorMessages, d as RestrictMessages, dt as HasMany, et as GroupedRelation, f as Model, ft as HasManyCollection, g as DatabaseSchema, gt as HasOneDependent, h as TableAttributes, ht as HasOne, i as UniquenessOptions, it as ReturnedRow, j as BatchEntry, jt as lte, k as RelationsFor, kt as gte, l as ErrorMessage, lt as AssociationOptions, m as ScopeStatic, mt as HasManyThrough, n as LengthOptions, nt as SignedIdOptions, o as Errors, ot as WriteResult, pt as HasManyDependent, q as ScopeMethods, r as NumericalityOptions, rt as Init, s as ValidationError, t as AssociatedValidationOptions, tt as FindSignedOptions, u as ErrorMessages, ut as BelongsTo, v as TableSchemas, vt as PolymorphicBelongsTo, w as QueryListener, wt as Returning, x as AttributeConversions, xt as Conditions, y as FilterAttribute, yt as ThroughDependent, z as SigningSecrets, zt as ColumnReference } from "./validations-CKPJoSj4.mjs";
|
|
3
|
+
import { A as StaleAction, C as RecordDestroyed, D as RecordNotSaved, E as RecordNotFound, F as UnknownModelName, I as abort, M as StrictValidationFailed, N as UnknownAssociation, O as RecordNotUnique, P as UnknownAttribute, S as ReadonlyAssociation, T as RecordNotDestroyed, _ as InvalidToken, a as hasMany, b as NoDatabase, c as ActiveRecordError, d as CheckViolation, f as ConstraintViolation, g as InvalidModel, h as InvalidForeignKey, i as belongsTo, j as StaleRecord, k as SoleRecordExceeded, l as AssociationNotLoaded, m as IncompatibleRelation, n as withDatabase, o as hasOne, p as DeleteRestriction, r as PolymorphicBelongsToOptions, s as AbortAfterPersistence, t as defineSchema, u as CallbackAbort, v as IrreversibleOrder, w as RecordInvalid, x as NotNullViolation, y as MissingAttribute } from "./index-Fq4gT3c8.mjs";
|
|
4
|
+
export { AbortAfterPersistence, ActiveRecordError, type AssociatedValidationOptions, AssociationNotLoaded, type AssociationOptions, type AttributeConversions, type AttributeErrorMessages, type AttributeSpec, type AttributeSpecs, type AttributeType, type Batch, type BatchEntry, type BatchResults, type BelongsTo, CallbackAbort, CheckViolation, type ColumnReference, type ColumnValue, type Comparable, type Comparison, type ComparisonBound, type ComparisonOptions, type Conditions, ConstraintViolation, type CountlessPage, type CustomType, type DatabaseSchema, DeleteRestriction, type Duration, type EpochStorage, type ErrorMessage, type ErrorMessages, Errors, type FilterAttribute, type FindSignedOptions, type GroupedRelation, type HasMany, type HasManyCollection, type HasManyDependent, type HasManyThrough, type HasOne, type HasOneDependent, type HasOneThrough, type InOrderOfOptions, IncompatibleRelation, type Init, type InsertOptions, InvalidForeignKey, InvalidModel, InvalidToken, IrreversibleOrder, type IterationOptions, type LengthOptions, MissingAttribute, Model, NoDatabase, NotNullViolation, type NumericalityOptions, type OrderSpec, type Page, type PageOptions, type PasswordAlgorithm, type PolymorphicBelongsTo, type PolymorphicBelongsToOptions, type QueryEvent, type QueryListener, type QueryPart, type QuerySql, ReadonlyAssociation, RecordDestroyed, RecordInvalid, RecordNotDestroyed, RecordNotFound, RecordNotSaved, RecordNotUnique, type RecordStatement, Relation, type RelationsFor, type RestrictMessages, type ReturnedRow, type Returning, type SafeSql, type SaveOptions, type Scope, type ScopeMethods, type ScopeStatic, type Scoped, type SecurePasswordOptions, type SecureTokenOptions, type SignedIdOptions, type SigningEnv, type SigningSecrets, SoleRecordExceeded, type StaleAction, StaleRecord, type Statement, StrictValidationFailed, type TableAttributes, type TableSchema, type TableSchemas, type ThroughDependent, type ThroughOptions, type TokenForOptions, type TouchOptions, type UniquenessOptions, UnknownAssociation, UnknownAttribute, UnknownModelName, type UpsertOptions, type ValidationCallbackOptions, type ValidationContext, type ValidationContexts, type ValidationError, type ValidationOptions, type WriteResult, abort, batch, belongsTo, between, column, defineSchema, defineType, generateSecureToken, gt, gte, hasMany, hasOne, lt, lte, sql, withDatabase };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { _ as
|
|
3
|
-
import {
|
|
4
|
-
import { t as defineSchema } from "./src-
|
|
5
|
-
export { AbortAfterPersistence, ActiveRecordError, AssociationNotLoaded, CallbackAbort, CheckViolation, ConstraintViolation, DeleteRestriction, Errors, IncompatibleRelation, InvalidForeignKey, InvalidModel, IrreversibleOrder, MissingAttribute, Model, NoDatabase, NotNullViolation, ReadonlyAssociation, RecordDestroyed, RecordInvalid, RecordNotDestroyed, RecordNotFound, RecordNotSaved, RecordNotUnique, Relation, SoleRecordExceeded, StrictValidationFailed, UnknownAssociation, UnknownAttribute, UnknownModelName, abort, batch, belongsTo, between, column, defineSchema, defineType, gt, gte, hasMany, hasOne, lt, lte, sql, withDatabase };
|
|
1
|
+
import { $ as UnknownAssociation, A as AssociationNotLoaded, B as MissingAttribute, F as IncompatibleRelation, G as RecordInvalid, H as NotNullViolation, I as InvalidForeignKey, J as RecordNotSaved, K as RecordNotDestroyed, L as InvalidModel, M as CheckViolation, N as ConstraintViolation, O as AbortAfterPersistence, P as DeleteRestriction, Q as StrictValidationFailed, R as InvalidToken, U as ReadonlyAssociation, V as NoDatabase, W as RecordDestroyed, X as SoleRecordExceeded, Y as RecordNotUnique, Z as StaleRecord, et as UnknownAttribute, j as CallbackAbort, k as ActiveRecordError, nt as abort, q as RecordNotFound, tt as UnknownModelName, z as IrreversibleOrder } from "./identifiers-CzqYL_nC.mjs";
|
|
2
|
+
import { _ as lt, b as hasMany, c as Relation, d as column, f as sql, g as gte, h as gt, m as between, n as Model, r as withDatabase, t as batch, v as lte, x as hasOne, y as belongsTo } from "./batch-Ca1JtVcK.mjs";
|
|
3
|
+
import { Y as Errors, dt as defineType, st as generateSecureToken } from "./generated-model-L4WAqgOZ.mjs";
|
|
4
|
+
import { t as defineSchema } from "./src-fYq-nVHE.mjs";
|
|
5
|
+
export { AbortAfterPersistence, ActiveRecordError, AssociationNotLoaded, CallbackAbort, CheckViolation, ConstraintViolation, DeleteRestriction, Errors, IncompatibleRelation, InvalidForeignKey, InvalidModel, InvalidToken, IrreversibleOrder, MissingAttribute, Model, NoDatabase, NotNullViolation, ReadonlyAssociation, RecordDestroyed, RecordInvalid, RecordNotDestroyed, RecordNotFound, RecordNotSaved, RecordNotUnique, Relation, SoleRecordExceeded, StaleRecord, StrictValidationFailed, UnknownAssociation, UnknownAttribute, UnknownModelName, abort, batch, belongsTo, between, column, defineSchema, defineType, generateSecureToken, gt, gte, hasMany, hasOne, lt, lte, sql, withDatabase };
|