js-bao 0.2.10 → 0.2.12
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/README.md +174 -0
- package/dist/BaseModel-5YQCROYE.js +17 -0
- package/dist/BaseModel-5YQCROYE.js.map +1 -0
- package/dist/BaseModel-FCNWDJBH.js +17 -0
- package/dist/BaseModel-FCNWDJBH.js.map +1 -0
- package/dist/BrowserDatabaseFactory-PXOTK2DQ.js +119 -0
- package/dist/BrowserDatabaseFactory-PXOTK2DQ.js.map +1 -0
- package/dist/BrowserDatabaseFactory-WD4VX2VZ.js +119 -0
- package/dist/BrowserDatabaseFactory-WD4VX2VZ.js.map +1 -0
- package/dist/IncludeResolver-RCKQGNPZ.js +385 -0
- package/dist/IncludeResolver-RCKQGNPZ.js.map +1 -0
- package/dist/IncludeResolver-WGSQDMS7.js +385 -0
- package/dist/IncludeResolver-WGSQDMS7.js.map +1 -0
- package/dist/NodeDatabaseFactory-J4Z36UF3.js +165 -0
- package/dist/NodeDatabaseFactory-J4Z36UF3.js.map +1 -0
- package/dist/NodeDatabaseFactory-QIEKAXBM.js +10 -0
- package/dist/NodeDatabaseFactory-QIEKAXBM.js.map +1 -0
- package/dist/NodeSqliteEngine-HJSAYE4E.js +383 -0
- package/dist/NodeSqliteEngine-HJSAYE4E.js.map +1 -0
- package/dist/NodeSqliteEngine-I5SLWLME.js +383 -0
- package/dist/NodeSqliteEngine-I5SLWLME.js.map +1 -0
- package/dist/browser.cjs +3779 -3370
- package/dist/browser.d.cts +18 -1
- package/dist/browser.d.ts +18 -1
- package/dist/browser.js +3750 -3341
- package/dist/chunk-3PZWHUZO.js +4153 -0
- package/dist/chunk-3PZWHUZO.js.map +1 -0
- package/dist/chunk-53MS4MN7.js +373 -0
- package/dist/chunk-53MS4MN7.js.map +1 -0
- package/dist/chunk-65G2P4GL.js +709 -0
- package/dist/chunk-65G2P4GL.js.map +1 -0
- package/dist/chunk-6UX3YSCW.js +4151 -0
- package/dist/chunk-6UX3YSCW.js.map +1 -0
- package/dist/chunk-DANSD6BE.js +709 -0
- package/dist/chunk-DANSD6BE.js.map +1 -0
- package/dist/chunk-DF3JEQXA.js +373 -0
- package/dist/chunk-DF3JEQXA.js.map +1 -0
- package/dist/chunk-GO3APTPX.js +61 -0
- package/dist/chunk-GO3APTPX.js.map +1 -0
- package/dist/chunk-ID4U6IQC.js +53 -0
- package/dist/chunk-ID4U6IQC.js.map +1 -0
- package/dist/chunk-RQVS3LVL.js +165 -0
- package/dist/chunk-RQVS3LVL.js.map +1 -0
- package/dist/client.cjs +837 -0
- package/dist/client.d.cts +1101 -0
- package/dist/client.d.ts +1101 -0
- package/dist/client.js +806 -0
- package/dist/cloudflare-do.cjs +3637 -0
- package/dist/cloudflare-do.d.cts +1366 -0
- package/dist/cloudflare-do.d.ts +1366 -0
- package/dist/cloudflare-do.js +3614 -0
- package/dist/cloudflare.cjs +1048 -0
- package/dist/cloudflare.d.cts +1381 -0
- package/dist/cloudflare.d.ts +1381 -0
- package/dist/cloudflare.js +1017 -0
- package/dist/codegen.cjs +259 -18
- package/dist/environment-TOTQICSE.js +17 -0
- package/dist/environment-TOTQICSE.js.map +1 -0
- package/dist/index.cjs +1906 -1493
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +1871 -1458
- package/dist/node.cjs +4779 -4366
- package/dist/node.d.cts +18 -1
- package/dist/node.d.ts +18 -1
- package/dist/node.js +4602 -4189
- package/package.json +41 -12
package/dist/index.d.cts
CHANGED
|
@@ -139,6 +139,19 @@ type SortSpec = {
|
|
|
139
139
|
type ProjectionSpec = {
|
|
140
140
|
[field: string]: 1 | 0;
|
|
141
141
|
};
|
|
142
|
+
interface IncludeSpec {
|
|
143
|
+
model: string;
|
|
144
|
+
type: "refersTo" | "hasMany" | "refersToMany";
|
|
145
|
+
sourceField?: string;
|
|
146
|
+
foreignKey?: string;
|
|
147
|
+
localField?: string;
|
|
148
|
+
as?: string;
|
|
149
|
+
projection?: ProjectionSpec;
|
|
150
|
+
limit?: number;
|
|
151
|
+
sort?: SortSpec;
|
|
152
|
+
filter?: DocumentFilter;
|
|
153
|
+
include?: IncludeSpec[];
|
|
154
|
+
}
|
|
142
155
|
interface QueryOptions {
|
|
143
156
|
sort?: SortSpec;
|
|
144
157
|
projection?: ProjectionSpec;
|
|
@@ -146,6 +159,7 @@ interface QueryOptions {
|
|
|
146
159
|
limit?: number;
|
|
147
160
|
uniqueStartKey?: string;
|
|
148
161
|
direction?: 1 | -1;
|
|
162
|
+
include?: IncludeSpec[];
|
|
149
163
|
}
|
|
150
164
|
interface PaginatedResult<T> {
|
|
151
165
|
data: T[];
|
|
@@ -314,7 +328,10 @@ declare class DocumentQueryTranslator {
|
|
|
314
328
|
/**
|
|
315
329
|
* Translate document filter to SQL WHERE clause
|
|
316
330
|
*/
|
|
317
|
-
|
|
331
|
+
translateFilter(filter: DocumentFilter): {
|
|
332
|
+
sql: string;
|
|
333
|
+
params: any[];
|
|
334
|
+
};
|
|
318
335
|
/**
|
|
319
336
|
* Translate logical operators ($and, $or)
|
|
320
337
|
*/
|
|
@@ -806,4 +823,4 @@ declare function dumpYDocToPlain(yDoc: Y.Doc, options?: DumpOptions): PlainYDoc;
|
|
|
806
823
|
*/
|
|
807
824
|
declare function summarizePlainYDoc(dump: PlainYDoc): DumpSummary;
|
|
808
825
|
|
|
809
|
-
export { BaseModel, type ConnectedDocument, type DatabaseConfig, DatabaseEngine, DocumentClosedError, type DocumentConnectionCallback, type DocumentConnectionEvent, type DocumentFilter, type DocumentManager, type DocumentPermissionHint, DocumentResolutionError, type DumpOptions, type DumpSummary, type DumpSummaryEntry, Field, type FieldOptions, type InferAttrs, type InitJsBaoOptions, type InitJsBaoResult, LogLevel, Logger, Model, type ModelConstructor, type ModelOptions, ModelRegistry, type PaginatedResult, type PaginationOptions, type PlainYDoc, type ProjectionSpec, type QueryOptions, type QueryResult, RecordNotFoundError, type SaveOptions, StringSet, UniqueConstraintViolationError, attachAndRegisterModel, attachSchemaToClass, autoRegisterModel, createModelClass, defineModelSchema, dumpYDocToPlain, generateULID, initJsBao, resetJsBao, summarizePlainYDoc };
|
|
826
|
+
export { BaseModel, type ConnectedDocument, type DatabaseConfig, DatabaseEngine, DocumentClosedError, type DocumentConnectionCallback, type DocumentConnectionEvent, type DocumentFilter, type DocumentManager, type DocumentPermissionHint, DocumentResolutionError, type DumpOptions, type DumpSummary, type DumpSummaryEntry, Field, type FieldOptions, type IncludeSpec, type InferAttrs, type InitJsBaoOptions, type InitJsBaoResult, LogLevel, Logger, Model, type ModelConstructor, type ModelOptions, ModelRegistry, type PaginatedResult, type PaginationOptions, type PlainYDoc, type ProjectionSpec, type QueryOptions, type QueryResult, RecordNotFoundError, type SaveOptions, StringSet, UniqueConstraintViolationError, attachAndRegisterModel, attachSchemaToClass, autoRegisterModel, createModelClass, defineModelSchema, dumpYDocToPlain, generateULID, initJsBao, resetJsBao, summarizePlainYDoc };
|
package/dist/index.d.ts
CHANGED
|
@@ -139,6 +139,19 @@ type SortSpec = {
|
|
|
139
139
|
type ProjectionSpec = {
|
|
140
140
|
[field: string]: 1 | 0;
|
|
141
141
|
};
|
|
142
|
+
interface IncludeSpec {
|
|
143
|
+
model: string;
|
|
144
|
+
type: "refersTo" | "hasMany" | "refersToMany";
|
|
145
|
+
sourceField?: string;
|
|
146
|
+
foreignKey?: string;
|
|
147
|
+
localField?: string;
|
|
148
|
+
as?: string;
|
|
149
|
+
projection?: ProjectionSpec;
|
|
150
|
+
limit?: number;
|
|
151
|
+
sort?: SortSpec;
|
|
152
|
+
filter?: DocumentFilter;
|
|
153
|
+
include?: IncludeSpec[];
|
|
154
|
+
}
|
|
142
155
|
interface QueryOptions {
|
|
143
156
|
sort?: SortSpec;
|
|
144
157
|
projection?: ProjectionSpec;
|
|
@@ -146,6 +159,7 @@ interface QueryOptions {
|
|
|
146
159
|
limit?: number;
|
|
147
160
|
uniqueStartKey?: string;
|
|
148
161
|
direction?: 1 | -1;
|
|
162
|
+
include?: IncludeSpec[];
|
|
149
163
|
}
|
|
150
164
|
interface PaginatedResult<T> {
|
|
151
165
|
data: T[];
|
|
@@ -314,7 +328,10 @@ declare class DocumentQueryTranslator {
|
|
|
314
328
|
/**
|
|
315
329
|
* Translate document filter to SQL WHERE clause
|
|
316
330
|
*/
|
|
317
|
-
|
|
331
|
+
translateFilter(filter: DocumentFilter): {
|
|
332
|
+
sql: string;
|
|
333
|
+
params: any[];
|
|
334
|
+
};
|
|
318
335
|
/**
|
|
319
336
|
* Translate logical operators ($and, $or)
|
|
320
337
|
*/
|
|
@@ -806,4 +823,4 @@ declare function dumpYDocToPlain(yDoc: Y.Doc, options?: DumpOptions): PlainYDoc;
|
|
|
806
823
|
*/
|
|
807
824
|
declare function summarizePlainYDoc(dump: PlainYDoc): DumpSummary;
|
|
808
825
|
|
|
809
|
-
export { BaseModel, type ConnectedDocument, type DatabaseConfig, DatabaseEngine, DocumentClosedError, type DocumentConnectionCallback, type DocumentConnectionEvent, type DocumentFilter, type DocumentManager, type DocumentPermissionHint, DocumentResolutionError, type DumpOptions, type DumpSummary, type DumpSummaryEntry, Field, type FieldOptions, type InferAttrs, type InitJsBaoOptions, type InitJsBaoResult, LogLevel, Logger, Model, type ModelConstructor, type ModelOptions, ModelRegistry, type PaginatedResult, type PaginationOptions, type PlainYDoc, type ProjectionSpec, type QueryOptions, type QueryResult, RecordNotFoundError, type SaveOptions, StringSet, UniqueConstraintViolationError, attachAndRegisterModel, attachSchemaToClass, autoRegisterModel, createModelClass, defineModelSchema, dumpYDocToPlain, generateULID, initJsBao, resetJsBao, summarizePlainYDoc };
|
|
826
|
+
export { BaseModel, type ConnectedDocument, type DatabaseConfig, DatabaseEngine, DocumentClosedError, type DocumentConnectionCallback, type DocumentConnectionEvent, type DocumentFilter, type DocumentManager, type DocumentPermissionHint, DocumentResolutionError, type DumpOptions, type DumpSummary, type DumpSummaryEntry, Field, type FieldOptions, type IncludeSpec, type InferAttrs, type InitJsBaoOptions, type InitJsBaoResult, LogLevel, Logger, Model, type ModelConstructor, type ModelOptions, ModelRegistry, type PaginatedResult, type PaginationOptions, type PlainYDoc, type ProjectionSpec, type QueryOptions, type QueryResult, RecordNotFoundError, type SaveOptions, StringSet, UniqueConstraintViolationError, attachAndRegisterModel, attachSchemaToClass, autoRegisterModel, createModelClass, defineModelSchema, dumpYDocToPlain, generateULID, initJsBao, resetJsBao, summarizePlainYDoc };
|