cloesce 0.0.4-unstable.8 → 0.0.5-unstable.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.
@@ -1,8 +1,17 @@
1
1
  import { D1Database } from "@cloudflare/workers-types/experimental/index.js";
2
- import { CrudKind, DeepPartial, Either, KeysOfType } from "../common.js";
3
- export { cloesce } from "../router/router.js";
4
- export type { HttpResult, Either, DeepPartial, InstanceRegistry, CrudKind, } from "../common.js";
5
- export { CloesceApp } from "../common.js";
2
+ import { DeepPartial, Either, KeysOfType } from "./common.js";
3
+ import { CrudKind } from "../ast.js";
4
+ /**
5
+ * cloesce/backend
6
+ */
7
+ export {
8
+ CloesceApp,
9
+ DependencyContainer as DependencyInjector,
10
+ } from "../router/router.js";
11
+ export type { MiddlewareFn, ResultMiddlewareFn } from "../router/router.js";
12
+ export { HttpResult, Either, Stream } from "./common.js";
13
+ export type { DeepPartial } from "./common.js";
14
+ export type { CrudKind } from "../ast.js";
6
15
  /**
7
16
  * Marks a class as a D1-backed SQL model.
8
17
  *
@@ -24,6 +33,7 @@ export { CloesceApp } from "../common.js";
24
33
  * ```
25
34
  */
26
35
  export declare const D1: ClassDecorator;
36
+ export declare const Service: ClassDecorator;
27
37
  /**
28
38
  * Marks a class as a plain serializable object.
29
39
  *
@@ -168,7 +178,9 @@ export declare const DataSource: PropertyDecorator;
168
178
  * dogs: Dog[];
169
179
  * ```
170
180
  */
171
- export declare const OneToMany: (_foreignKeyColumn: string) => PropertyDecorator;
181
+ export declare const OneToMany: (
182
+ _foreignKeyColumn: string,
183
+ ) => PropertyDecorator;
172
184
  /**
173
185
  * Declares a one-to-one relationship between models.
174
186
  *
@@ -284,10 +296,14 @@ type Primitive = string | number | boolean | bigint | symbol | null | undefined;
284
296
  * }
285
297
  * ```
286
298
  */
287
- export type IncludeTree<T> = (T extends Primitive ? never : {
288
- [K in keyof T]?: T[K] extends (infer U)[] ? IncludeTree<NonNullable<U>> : IncludeTree<NonNullable<T[K]>>;
289
- }) & {
290
- __brand?: "IncludeTree";
299
+ export type IncludeTree<T> = (T extends Primitive
300
+ ? never
301
+ : {
302
+ [K in keyof T]?: T[K] extends (infer U)[]
303
+ ? IncludeTree<NonNullable<U>>
304
+ : IncludeTree<NonNullable<T[K]>>;
305
+ }) & {
306
+ __brand?: "IncludeTree";
291
307
  };
292
308
  /**
293
309
  * Represents the name of a `@DataSource` available on a model type `T`,
@@ -314,8 +330,11 @@ export type IncludeTree<T> = (T extends Primitive ? never : {
314
330
  * async foo(ds: "default" | "none"): Promise<void> {...}
315
331
  * ```
316
332
  */
317
- export type DataSourceOf<T extends object> = (KeysOfType<T, IncludeTree<T>> | "none") & {
318
- __brand?: "DataSource";
333
+ export type DataSourceOf<T extends object> = (
334
+ | KeysOfType<T, IncludeTree<T>>
335
+ | "none"
336
+ ) & {
337
+ __brand?: "DataSource";
319
338
  };
320
339
  /**
321
340
  * A branded `number` type indicating that the corresponding
@@ -335,179 +354,203 @@ export type DataSourceOf<T extends object> = (KeysOfType<T, IncludeTree<T>> | "n
335
354
  * ```
336
355
  */
337
356
  export type Integer = number & {
338
- __brand?: "Integer";
357
+ __brand?: "Integer";
339
358
  };
340
359
  /**
341
360
  * Exposes the ORM primitives Cloesce uses to interact with D1 databases.
342
361
  */
343
362
  export declare class Orm {
344
- private db;
345
- private constructor();
346
- /**
347
- * Creates an instance of an `Orm`
348
- * @param db The database to use for ORM calls.
349
- */
350
- static fromD1(db: D1Database): Orm;
351
- /**
352
- * Maps SQL records to an instantiated Model. The records must be flat
353
- * (e.g., of the form "id, name, address") or derive from a Cloesce data source view
354
- * (e.g., of the form "Horse.id, Horse.name, Horse.address")
355
- * @param ctor The model constructor
356
- * @param records D1 Result records
357
- * @param includeTree Include tree to define the relationships to join.
358
- */
359
- static mapSql<T extends object>(ctor: new () => T, records: Record<string, any>[], includeTree?: IncludeTree<T> | null): Either<string, T[]>;
360
- /**
361
- * Executes an "upsert" query, adding or augmenting a model in the database.
362
- *
363
- * If a model's primary key is not defined in `newModel`, the query is assumed to be an insert.
364
- *
365
- * If a model's primary key _is_ defined, but some attributes are missing, the query is assumed to be an update.
366
- *
367
- * Finally, if the primary key is defined, but all attributes are included, a SQLite upsert will be performed.
368
- *
369
- * In any other case, an error string will be returned.
370
- *
371
- * ### Inserting a new Model
372
- * ```ts
373
- * const model = {name: "julio", lastname: "pumpkin"};
374
- * const idRes = await orm.upsert(Person, model, null);
375
- * ```
376
- *
377
- * ### Updating an existing model
378
- * ```ts
379
- * const model = {id: 1, name: "timothy"};
380
- * const idRes = await orm.upsert(Person, model, null);
381
- * // (in db)=> {id: 1, name: "timothy", lastname: "pumpkin"}
382
- * ```
383
- *
384
- * ### Upserting a model
385
- * ```ts
386
- * // (assume a Person already exists)
387
- * const model = {
388
- * id: 1,
389
- * lastname: "burger", // updates last name
390
- * dog: {
391
- * name: "fido" // insert dog relationship
392
- * }
393
- * };
394
- * const idRes = await orm.upsert(Person, model, null);
395
- * // (in db)=> Person: {id: 1, dogId: 1 ...} ; Dog: {id: 1, name: "fido"}
396
- * ```
397
- *
398
- * @param ctor A model constructor.
399
- * @param newModel The new or augmented model.
400
- * @param includeTree An include tree describing which foreign keys to join.
401
- * @returns An error string, or the primary key of the inserted model.
402
- */
403
- upsert<T extends object>(ctor: new () => T, newModel: DeepPartial<T>, includeTree?: IncludeTree<T> | null): Promise<Either<string, any>>;
404
- /**
405
- * Returns a select query, creating a CTE view for the model using the provided include tree.
406
- *
407
- * @param ctor The model constructor.
408
- * @param includeTree An include tree describing which related models to join.
409
- * @param from An optional custom `FROM` clause to use instead of the base table.
410
- * @param tagCte An optional CTE name to tag the query with. Defaults to "Model.view".
411
- *
412
- * ### Example:
413
- * ```ts
414
- * // Using a data source
415
- * const query = Orm.listQuery(Person, "default");
416
- *
417
- * // Using a custom from statement
418
- * const query = Orm.listQuery(Person, null, "SELECT * FROM Person WHERE age > 18");
419
- * ```
420
- *
421
- * ### Example SQL output:
422
- * ```sql
423
- * WITH Person_view AS (
424
- * SELECT
425
- * "Person"."id" AS "id",
426
- * ...
427
- * FROM "Person"
428
- * LEFT JOIN ...
429
- * )
430
- * SELECT * FROM Person_view
431
- * ```
432
- */
433
- static listQuery<T extends object>(ctor: new () => T, opts: {
434
- includeTree?: IncludeTree<T> | null;
435
- from?: string;
436
- tagCte?: string;
437
- }): Either<string, string>;
438
- /**
439
- * Returns a select query for a single model by primary key, creating a CTE view using the provided include tree.
440
- *
441
- * @param ctor The model constructor.
442
- * @param includeTree An include tree describing which related models to join.
443
- *
444
- * ### Example:
445
- * ```ts
446
- * // Using a data source
447
- * const query = Orm.getQuery(Person, "default");
448
- * ```
449
- *
450
- * ### Example SQL output:
451
- *
452
- * ```sql
453
- * WITH Person_view AS (
454
- * SELECT
455
- * "Person"."id" AS "id",
456
- * ...
457
- * FROM "Person"
458
- * LEFT JOIN ...
459
- * )
460
- * SELECT * FROM Person_view WHERE [Person].[id] = ?
461
- * ```
462
- */
463
- static getQuery<T extends object>(ctor: new () => T, includeTree?: IncludeTree<T> | null): Either<string, string>;
464
- /**
465
- * Retrieves all instances of a model from the database.
466
- * @param ctor The model constructor.
467
- * @param includeTree An include tree describing which related models to join.
468
- * @param from An optional custom `FROM` clause to use instead of the base table.
469
- * @returns Either an error string, or an array of model instances.
470
- *
471
- * ### Example:
472
- * ```ts
473
- * const orm = Orm.fromD1(env.db);
474
- * const horses = await orm.list(Horse, Horse.default);
475
- * ```
476
- *
477
- * ### Example with custom from:
478
- * ```ts
479
- * const orm = Orm.fromD1(env.db);
480
- * const adultHorses = await orm.list(Horse, Horse.default, "SELECT * FROM Horse ORDER BY age DESC LIMIT 10");
481
- * ```
482
- *
483
- * =>
484
- *
485
- * ```sql
486
- * SELECT
487
- * "Horse"."id" AS "id",
488
- * ...
489
- * FROM (SELECT * FROM Horse ORDER BY age DESC LIMIT 10)
490
- * LEFT JOIN ...
491
- * ```
492
- *
493
- */
494
- list<T extends object>(ctor: new () => T, opts: {
495
- includeTree?: IncludeTree<T> | null;
496
- from?: string;
497
- }): Promise<Either<string, T[]>>;
498
- /**
499
- * Retrieves a single model by primary key.
500
- * @param ctor The model constructor.
501
- * @param id The primary key value.
502
- * @param includeTree An include tree describing which related models to join.
503
- * @returns Either an error string, or the model instance (null if not found).
504
- *
505
- * ### Example:
506
- * ```ts
507
- * const orm = Orm.fromD1(env.db);
508
- * const horse = await orm.get(Horse, 1, Horse.default);
509
- * ```
510
- */
511
- get<T extends object>(ctor: new () => T, id: any, includeTree?: IncludeTree<T> | null): Promise<Either<string, T | null>>;
363
+ private db;
364
+ private constructor();
365
+ /**
366
+ * Creates an instance of an `Orm`
367
+ * @param db The database to use for ORM calls.
368
+ */
369
+ static fromD1(db: D1Database): Orm;
370
+ /**
371
+ * Maps SQL records to an instantiated Model. The records must be flat
372
+ * (e.g., of the form "id, name, address") or derive from a Cloesce data source view
373
+ * (e.g., of the form "Horse.id, Horse.name, Horse.address")
374
+ *
375
+ * Assumes the data is formatted correctly, throwing an error otherwise.
376
+ *
377
+ * @param ctor The model constructor
378
+ * @param records D1 Result records
379
+ * @param includeTree Include tree to define the relationships to join.
380
+ */
381
+ static mapSql<T extends object>(
382
+ ctor: new () => T,
383
+ records: Record<string, any>[],
384
+ includeTree?: IncludeTree<T> | null,
385
+ ): T[];
386
+ /**
387
+ * Executes an "upsert" query, adding or augmenting a model in the database.
388
+ *
389
+ * If a model's primary key is not defined in `newModel`, the query is assumed to be an insert.
390
+ *
391
+ * If a model's primary key _is_ defined, but some attributes are missing, the query is assumed to be an update.
392
+ *
393
+ * Finally, if the primary key is defined, but all attributes are included, a SQLite upsert will be performed.
394
+ *
395
+ * In any other case, an error string will be returned.
396
+ *
397
+ * ### Inserting a new Model
398
+ * ```ts
399
+ * const model = {name: "julio", lastname: "pumpkin"};
400
+ * const idRes = await orm.upsert(Person, model, null);
401
+ * ```
402
+ *
403
+ * ### Updating an existing model
404
+ * ```ts
405
+ * const model = {id: 1, name: "timothy"};
406
+ * const idRes = await orm.upsert(Person, model, null);
407
+ * // (in db)=> {id: 1, name: "timothy", lastname: "pumpkin"}
408
+ * ```
409
+ *
410
+ * ### Upserting a model
411
+ * ```ts
412
+ * // (assume a Person already exists)
413
+ * const model = {
414
+ * id: 1,
415
+ * lastname: "burger", // updates last name
416
+ * dog: {
417
+ * name: "fido" // insert dog relationship
418
+ * }
419
+ * };
420
+ * const idRes = await orm.upsert(Person, model, null);
421
+ * // (in db)=> Person: {id: 1, dogId: 1 ...} ; Dog: {id: 1, name: "fido"}
422
+ * ```
423
+ *
424
+ * @param ctor A model constructor.
425
+ * @param newModel The new or augmented model.
426
+ * @param includeTree An include tree describing which foreign keys to join.
427
+ * @returns An error string, or the primary key of the inserted model.
428
+ */
429
+ upsert<T extends object>(
430
+ ctor: new () => T,
431
+ newModel: DeepPartial<T>,
432
+ includeTree?: IncludeTree<T> | null,
433
+ ): Promise<Either<string, any>>;
434
+ /**
435
+ * Returns a select query, creating a CTE view for the model using the provided include tree.
436
+ *
437
+ * @param ctor The model constructor.
438
+ * @param includeTree An include tree describing which related models to join.
439
+ * @param from An optional custom `FROM` clause to use instead of the base table.
440
+ * @param tagCte An optional CTE name to tag the query with. Defaults to "Model.view".
441
+ *
442
+ * ### Example:
443
+ * ```ts
444
+ * // Using a data source
445
+ * const query = Orm.listQuery(Person, "default");
446
+ *
447
+ * // Using a custom from statement
448
+ * const query = Orm.listQuery(Person, null, "SELECT * FROM Person WHERE age > 18");
449
+ * ```
450
+ *
451
+ * ### Example SQL output:
452
+ * ```sql
453
+ * WITH Person_view AS (
454
+ * SELECT
455
+ * "Person"."id" AS "id",
456
+ * ...
457
+ * FROM "Person"
458
+ * LEFT JOIN ...
459
+ * )
460
+ * SELECT * FROM Person_view
461
+ * ```
462
+ */
463
+ static listQuery<T extends object>(
464
+ ctor: new () => T,
465
+ opts: {
466
+ includeTree?: IncludeTree<T> | null;
467
+ from?: string;
468
+ tagCte?: string;
469
+ },
470
+ ): string;
471
+ /**
472
+ * Returns a select query for a single model by primary key, creating a CTE view using the provided include tree.
473
+ *
474
+ * @param ctor The model constructor.
475
+ * @param includeTree An include tree describing which related models to join.
476
+ *
477
+ * ### Example:
478
+ * ```ts
479
+ * // Using a data source
480
+ * const query = Orm.getQuery(Person, "default");
481
+ * ```
482
+ *
483
+ * ### Example SQL output:
484
+ *
485
+ * ```sql
486
+ * WITH Person_view AS (
487
+ * SELECT
488
+ * "Person"."id" AS "id",
489
+ * ...
490
+ * FROM "Person"
491
+ * LEFT JOIN ...
492
+ * )
493
+ * SELECT * FROM Person_view WHERE [Person].[id] = ?
494
+ * ```
495
+ */
496
+ static getQuery<T extends object>(
497
+ ctor: new () => T,
498
+ includeTree?: IncludeTree<T> | null,
499
+ ): string;
500
+ /**
501
+ * Retrieves all instances of a model from the database.
502
+ * @param ctor The model constructor.
503
+ * @param includeTree An include tree describing which related models to join.
504
+ * @param from An optional custom `FROM` clause to use instead of the base table.
505
+ * @returns Either an error string, or an array of model instances.
506
+ *
507
+ * ### Example:
508
+ * ```ts
509
+ * const orm = Orm.fromD1(env.db);
510
+ * const horses = await orm.list(Horse, Horse.default);
511
+ * ```
512
+ *
513
+ * ### Example with custom from:
514
+ * ```ts
515
+ * const orm = Orm.fromD1(env.db);
516
+ * const adultHorses = await orm.list(Horse, Horse.default, "SELECT * FROM Horse ORDER BY age DESC LIMIT 10");
517
+ * ```
518
+ *
519
+ * =>
520
+ *
521
+ * ```sql
522
+ * SELECT
523
+ * "Horse"."id" AS "id",
524
+ * ...
525
+ * FROM (SELECT * FROM Horse ORDER BY age DESC LIMIT 10)
526
+ * LEFT JOIN ...
527
+ * ```
528
+ *
529
+ */
530
+ list<T extends object>(
531
+ ctor: new () => T,
532
+ opts: {
533
+ includeTree?: IncludeTree<T> | null;
534
+ from?: string;
535
+ },
536
+ ): Promise<Either<string, T[]>>;
537
+ /**
538
+ * Retrieves a single model by primary key.
539
+ * @param ctor The model constructor.
540
+ * @param id The primary key value.
541
+ * @param includeTree An include tree describing which related models to join.
542
+ * @returns Either an error string, or the model instance (null if not found).
543
+ *
544
+ * ### Example:
545
+ * ```ts
546
+ * const orm = Orm.fromD1(env.db);
547
+ * const horse = await orm.get(Horse, 1, Horse.default);
548
+ * ```
549
+ */
550
+ get<T extends object>(
551
+ ctor: new () => T,
552
+ id: any,
553
+ includeTree?: IncludeTree<T> | null,
554
+ ): Promise<Either<string, T | null>>;
512
555
  }
513
- //# sourceMappingURL=backend.d.ts.map
556
+ //# sourceMappingURL=backend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/ui/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQzE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,YAAY,EACV,UAAU,EACV,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,EAAE,EAAE,cAAyB,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,EAAE,cAAyB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW,EAAE,cAAyB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,EAAE,iBAA4B,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,GAAG,EAAE,eAA0B,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,eAA0B,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,GAAG,EAAE,eAA0B,CAAC;AAE7C;;;GAGG;AAC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