cloesce 0.0.4-unstable.9 → 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.
Binary file
package/dist/orm.wasm CHANGED
Binary file
@@ -1,22 +1,7 @@
1
- import { D1Database } from "@cloudflare/workers-types/experimental";
2
- import { HttpResult } from "../common.js";
1
+ import { D1Database } from "@cloudflare/workers-types/experimental/index.js";
3
2
  /**
4
- * A wrapper for Model Instances, containing definitions for built-in CRUD methods.
3
+ * Wraps an object in a Proxy that will intercept non-overriden CRUD methods,
4
+ * calling a default implementation.
5
5
  */
6
- export declare class CrudContext {
7
- private d1;
8
- private instance;
9
- private ctor;
10
- private constructor();
11
- static fromInstance(d1: D1Database, instance: any, ctor: new () => object): CrudContext;
12
- static fromCtor(d1: D1Database, ctor: new () => object): CrudContext;
13
- /**
14
- * Invokes a method on the instance, intercepting built-in CRUD methods and injecting
15
- * a default definition.
16
- */
17
- interceptCrud(methodName: string): Function;
18
- upsert(obj: object, dataSource: string): Promise<HttpResult<unknown>>;
19
- get(id: any, dataSource: string): Promise<HttpResult<unknown>>;
20
- list(dataSource: string): Promise<HttpResult<unknown>>;
21
- }
22
- //# sourceMappingURL=crud.d.ts.map
6
+ export declare function proxyCrud(obj: any, ctor: any, d1: D1Database): any;
7
+ //# sourceMappingURL=crud.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../src/router/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAG1D;;GAEG;AACH,qBAAa,WAAW;IAEpB,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,IAAI;IAHd,OAAO;IAMP,MAAM,CAAC,YAAY,CACjB,EAAE,EAAE,UAAU,EACd,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,UAAU,MAAM,GACrB,WAAW;IAId,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,MAAM,GAAG,WAAW;IAIpE;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ;IAWrC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAiBrE,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAU9D,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;CAW7D"}
1
+ {"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../src/router/crud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAK7E;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,UAAU,OAyB5D"}
@@ -1,70 +1,59 @@
1
- import { NO_DATA_SOURCE } from "../common.js";
2
1
  import { Orm } from "../ui/backend.js";
2
+ import { HttpResult } from "../ui/common.js";
3
+ import { NO_DATA_SOURCE } from "../ast.js";
3
4
  /**
4
- * A wrapper for Model Instances, containing definitions for built-in CRUD methods.
5
+ * Wraps an object in a Proxy that will intercept non-overriden CRUD methods,
6
+ * calling a default implementation.
5
7
  */
6
- export class CrudContext {
7
- d1;
8
- instance;
9
- ctor;
10
- constructor(d1, instance, ctor) {
11
- this.d1 = d1;
12
- this.instance = instance;
13
- this.ctor = ctor;
14
- }
15
- static fromInstance(d1, instance, ctor) {
16
- return new this(d1, instance, ctor);
17
- }
18
- static fromCtor(d1, ctor) {
19
- return new this(d1, ctor, ctor);
20
- }
21
- /**
22
- * Invokes a method on the instance, intercepting built-in CRUD methods and injecting
23
- * a default definition.
24
- */
25
- interceptCrud(methodName) {
26
- const map = {
27
- save: this.upsert.bind(this),
28
- get: this.get.bind(this),
29
- list: this.list.bind(this),
30
- };
31
- const fn = this.instance && this.instance[methodName];
32
- return fn ? fn.bind(this.instance) : map[methodName];
33
- }
34
- async upsert(obj, dataSource) {
35
- const includeTree = findIncludeTree(dataSource, this.ctor);
36
- // Upsert
37
- const orm = Orm.fromD1(this.d1);
38
- const upsert = await orm.upsert(this.ctor, obj, includeTree);
39
- if (upsert.isLeft()) {
40
- return { ok: false, status: 500, data: upsert.value }; // TODO: better status code?
41
- }
42
- // Get
43
- const get = await orm.get(this.ctor, upsert.value, includeTree);
44
- return get.isRight()
45
- ? { ok: true, status: 200, data: get.value }
46
- : { ok: false, status: 500, data: get.value };
47
- }
48
- async get(id, dataSource) {
49
- const includeTree = findIncludeTree(dataSource, this.ctor);
50
- const orm = Orm.fromD1(this.d1);
51
- const res = await orm.get(this.ctor, id, includeTree);
52
- return res.isRight()
53
- ? { ok: true, status: 200, data: res.value }
54
- : { ok: false, status: 500, data: res.value };
55
- }
56
- async list(dataSource) {
57
- const includeTree = findIncludeTree(dataSource, this.ctor);
58
- const orm = Orm.fromD1(this.d1);
59
- const res = await orm.list(this.ctor, {
60
- includeTree,
61
- });
62
- return res.isRight()
63
- ? { ok: true, status: 200, data: res.value }
64
- : { ok: false, status: 500, data: res.value };
65
- }
8
+ export function proxyCrud(obj, ctor, d1) {
9
+ return new Proxy(obj, {
10
+ get(target, method) {
11
+ // If the instance defines the method, always use it (override allowed)
12
+ const value = Reflect.get(target, method);
13
+ if (typeof value === "function") {
14
+ return value.bind(target);
15
+ }
16
+ // Fallback to CRUD methods
17
+ if (method === "save") {
18
+ return (body, ds) => upsert(ctor, body, ds, d1);
19
+ }
20
+ if (method === "list") {
21
+ return (ds) => list(ctor, ds, d1);
22
+ }
23
+ if (method === "get") {
24
+ return (id, ds) => _get(ctor, id, ds, d1);
25
+ }
26
+ return value;
27
+ },
28
+ });
29
+ }
30
+ async function upsert(ctor, body, dataSource, d1) {
31
+ const includeTree = findIncludeTree(dataSource, ctor);
32
+ const orm = Orm.fromD1(d1);
33
+ const result = await orm.upsert(ctor, body, includeTree);
34
+ if (result.isLeft()) return HttpResult.fail(500, result.value);
35
+ const getRes = await orm.get(ctor, result.value, includeTree);
36
+ return getRes.isRight()
37
+ ? HttpResult.ok(200, getRes.value)
38
+ : HttpResult.fail(500, getRes.value);
39
+ }
40
+ async function _get(ctor, id, dataSource, d1) {
41
+ const includeTree = findIncludeTree(dataSource, ctor);
42
+ const orm = Orm.fromD1(d1);
43
+ const res = await orm.get(ctor, id, includeTree);
44
+ return res.isRight()
45
+ ? HttpResult.ok(200, res.value)
46
+ : HttpResult.fail(500, res.value);
47
+ }
48
+ async function list(ctor, dataSource, d1) {
49
+ const includeTree = findIncludeTree(dataSource, ctor);
50
+ const orm = Orm.fromD1(d1);
51
+ const res = await orm.list(ctor, { includeTree });
52
+ return res.isRight()
53
+ ? HttpResult.ok(200, res.value)
54
+ : HttpResult.fail(500, res.value);
66
55
  }
67
56
  function findIncludeTree(dataSource, ctor) {
68
- const normalizedDs = dataSource === NO_DATA_SOURCE ? null : dataSource;
69
- return normalizedDs ? ctor[normalizedDs] : null;
57
+ const normalizedDs = dataSource === NO_DATA_SOURCE ? null : dataSource;
58
+ return normalizedDs ? ctor[normalizedDs] : null;
70
59
  }
@@ -1,133 +1,191 @@
1
- import { HttpResult, Either, ModelMethod, CloesceAst, Model, KeysOfType } from "../common.js";
2
1
  import { OrmWasmExports } from "./wasm.js";
3
- import { CrudContext } from "./crud.js";
2
+ import { HttpResult } from "../ui/backend.js";
3
+ import { Either, KeysOfType } from "../ui/common.js";
4
+ import { CloesceAst, Model, ApiMethod, Service } from "../ast.js";
4
5
  /**
5
6
  * Dependency injection container, mapping an object type name to an instance of that object.
6
7
  *
7
8
  * Comes with the WranglerEnv and Request by default.
8
9
  */
9
- export type DependencyInjector = Map<string, any>;
10
+ export type DependencyContainer = Map<string, any>;
10
11
  /**
11
- * Map of model names to their respective constructor.
12
+ * Map of Plain Old Objects, Models and Services to their constructor.
12
13
  *
13
- * The value accepted into the `cloesce` function is generated by the Cloesce compiler, and
14
- * is guaranteed to contain all model definitions.
14
+ * Generated by the compiler and guaranteed to contain all CIDL definitions.
15
15
  */
16
- type ModelConstructorRegistry = Record<string, new () => any>;
16
+ export type ConstructorRegistry = Record<string, new () => any>;
17
17
  /**
18
- * Meta information on the wrangler env and db bindings
18
+ * Singleton instance containing the cidl, constructor registry, and wasm binary.
19
+ * These values are guaranteed to never change throughout a workers lifetime.
19
20
  */
20
- interface MetaWranglerEnv {
21
- envName: string;
22
- dbName: string;
23
- }
24
- export type MiddlewareFn = (request: Request, env: any, di: DependencyInjector) => Promise<HttpResult | void>;
25
- export type ResponseMiddlewareFn = (request: Request, env: any, di: DependencyInjector, response: Response) => Promise<HttpResult | void>;
26
- export declare class CloesceApp {
27
- private globalMiddleware;
28
- private modelMiddleware;
29
- private methodMiddleware;
30
- private responseMiddleware;
31
- routePrefix: string;
32
- /**
33
- * Registers global middleware which runs before any route matching.
34
- *
35
- * @param m - The middleware function to register.
36
- */
37
- onRequest(m: MiddlewareFn): void;
38
- /**
39
- * Registers middleware which runs after the response is generated, but before
40
- * it is returned to the client.
41
- *
42
- * Optionally, return a new HttpResult to short-circuit the response.
43
- *
44
- * Errors thrown in response middleware are caught and returned as a 500 response.
45
- *
46
- * Errors thrown in earlier middleware or route processing are not caught here.
47
- *
48
- * @param m - The middleware function to register.
49
- */
50
- onResponse(m: ResponseMiddlewareFn): void;
51
- /**
52
- * Registers middleware for a specific model type.
53
- *
54
- * Runs before request validation and method middleware.
55
- *
56
- * @typeParam T - The model type.
57
- * @param ctor - The model constructor (used to derive its name).
58
- * @param m - The middleware function to register.
59
- */
60
- onModel<T>(ctor: new () => T, m: MiddlewareFn): void;
61
- /**
62
- * Registers middleware for a specific method on a model.
63
- *
64
- * Runs after model middleware and request validation.
65
- *
66
- * @typeParam T - The model type.
67
- * @param ctor - The model constructor (used to derive its name).
68
- * @param method - The method name on the model.
69
- * @param m - The middleware function to register.
70
- */
71
- onMethod<T>(ctor: new () => T, method: KeysOfType<T, (...args: any) => any>, m: MiddlewareFn): void;
72
- /**
73
- * Router entry point. Undergoes route matching, request validation, hydration, and method dispatch.
74
- */
75
- private cloesce;
76
- /**
77
- * Runs the Cloesce app. Intended to be called from the generated workers code.
78
- */
79
- run(request: Request, env: any, ast: CloesceAst, constructorRegistry: ModelConstructorRegistry, envMeta: MetaWranglerEnv): Promise<Response>;
21
+ export declare class RuntimeContainer {
22
+ readonly ast: CloesceAst;
23
+ readonly constructorRegistry: ConstructorRegistry;
24
+ readonly wasm: OrmWasmExports;
25
+ private static instance;
26
+ private constructor();
27
+ static init(
28
+ ast: CloesceAst,
29
+ constructorRegistry: ConstructorRegistry,
30
+ wasm?: WebAssembly.Instance,
31
+ ): Promise<void>;
32
+ static get(): RuntimeContainer;
33
+ /**
34
+ * Disposes the singleton instance. For testing purposes only.
35
+ */
36
+ static dispose(): void;
80
37
  }
81
38
  /**
82
39
  * Given a request, this represents a map of each body / url param name to
83
40
  * its actual value. Unknown, as the a request can be anything.
84
41
  */
85
42
  export type RequestParamMap = Record<string, unknown>;
43
+ export type MiddlewareFn = (
44
+ di: DependencyContainer,
45
+ ) => Promise<HttpResult | void>;
46
+ export type ResultMiddlewareFn = (
47
+ di: DependencyContainer,
48
+ result: HttpResult,
49
+ ) => Promise<HttpResult | void>;
86
50
  /**
87
- * Singleton instance containing the cidl, constructor registry, and wasm binary.
88
- * These values are guaranteed to never change throughout a workers lifetime.
51
+ * Expected states in which the router may exit.
89
52
  */
90
- export declare class RuntimeContainer {
91
- readonly ast: CloesceAst;
92
- readonly constructorRegistry: ModelConstructorRegistry;
93
- readonly wasm: OrmWasmExports;
94
- private static instance;
95
- private constructor();
96
- static init(ast: CloesceAst, constructorRegistry: ModelConstructorRegistry, wasm?: WebAssembly.Instance): Promise<void>;
97
- static get(): RuntimeContainer;
53
+ export declare enum RouterError {
54
+ UnknownPrefix = 0,
55
+ UnknownRoute = 1,
56
+ UnmatchedHttpVerb = 2,
57
+ InstantiatedMethodMissingId = 3,
58
+ RequestMissingBody = 4,
59
+ RequestBodyMissingParameters = 5,
60
+ RequestBodyInvalidParameter = 6,
61
+ InstantiatedMethodMissingDataSource = 7,
62
+ MissingDependency = 8,
63
+ InvalidDatabaseQuery = 9,
64
+ ModelNotFound = 10,
65
+ UncaughtException = 11,
98
66
  }
67
+ export declare class CloesceApp {
68
+ routePrefix: string;
69
+ private globalMiddleware;
70
+ /**
71
+ * Registers global middleware which runs before any route matching.
72
+ *
73
+ * TODO: Middleware may violate the API contract and return unexpected types
74
+ *
75
+ * @param m - The middleware function to register.
76
+ */
77
+ onRequest(m: MiddlewareFn): void;
78
+ private resultMiddleware;
79
+ /**
80
+ * Registers middleware which runs after the response is generated, but before
81
+ * it is returned to the client.
82
+ *
83
+ * Optionally, return a new HttpResult to short-circuit the response.
84
+ *
85
+ * Errors thrown in response middleware are caught and returned as a 500 response.
86
+ *
87
+ * TODO: Middleware may violate the API contract and return unexpected types
88
+ *
89
+ * @param m - The middleware function to register.
90
+ */
91
+ onResult(m: ResultMiddlewareFn): void;
92
+ private namespaceMiddleware;
93
+ /**
94
+ * Registers middleware for a specific namespace (being, a model or service)
95
+ *
96
+ * Runs before request validation and method middleware.
97
+ *
98
+ * TODO: Middleware may violate the API contract and return unexpected types
99
+ *
100
+ * @typeParam T - The namespace type
101
+ * @param ctor - The namespace's constructor (used to derive its name).
102
+ * @param m - The middleware function to register.
103
+ */
104
+ onNamespace<T>(ctor: new () => T, m: MiddlewareFn): void;
105
+ private methodMiddleware;
106
+ /**
107
+ * Registers middleware for a specific method on a namespace
108
+ *
109
+ * Runs after namespace middleware and request validation.
110
+ *
111
+ * TODO: Middleware may violate the API contract and return unexpected types
112
+ *
113
+ * @typeParam T - The namespace type
114
+ * @param ctor - The namespace constructor
115
+ * @param method - The method name on the namespace.
116
+ * @param m - The middleware function to register.
117
+ */
118
+ onMethod<T>(
119
+ ctor: new () => T,
120
+ method: KeysOfType<T, (...args: any) => any>,
121
+ m: MiddlewareFn,
122
+ ): void;
123
+ private router;
124
+ /**
125
+ * Runs the Cloesce app. Intended to be called from the generated workers code.
126
+ */
127
+ run(
128
+ request: Request,
129
+ env: any,
130
+ ast: CloesceAst,
131
+ ctorReg: ConstructorRegistry,
132
+ ): Promise<Response>;
133
+ }
134
+ export type MatchedRoute = {
135
+ kind: "model" | "service";
136
+ namespace: string;
137
+ method: ApiMethod;
138
+ id: string | null;
139
+ model?: Model;
140
+ service?: Service;
141
+ };
99
142
  /**
100
- * Matches a request to a method on a model.
143
+ * Matches a request to an ApiInvocation
101
144
  * @param apiRoute The route from the domain to the actual API, ie https://foo.com/route/to/api => route/to/api/
102
- * @returns 404 or a `MatchedRoute`
145
+ * @returns 404 or a matched route.
103
146
  */
104
- declare function matchRoute(request: Request, ast: CloesceAst, routePrefix: string): Either<HttpResult, {
105
- model: Model;
106
- method: ModelMethod;
107
- id: string | null;
108
- }>;
147
+ declare function matchRoute(
148
+ request: Request,
149
+ ast: CloesceAst,
150
+ routePrefix: string,
151
+ ): Either<HttpResult, MatchedRoute>;
109
152
  /**
110
153
  * Validates the request's body/search params against a ModelMethod
111
154
  * @returns 400 or a `RequestParamMap` consisting of each parameters name mapped to its value, and
112
155
  * a data source
113
156
  */
114
- declare function validateRequest(request: Request, ast: CloesceAst, model: Model, method: ModelMethod, id: string | null): Promise<Either<HttpResult, {
115
- params: RequestParamMap;
116
- dataSource: string | null;
117
- }>>;
157
+ declare function validateRequest(
158
+ request: Request,
159
+ ast: CloesceAst,
160
+ ctorReg: ConstructorRegistry,
161
+ route: MatchedRoute,
162
+ ): Promise<
163
+ Either<
164
+ HttpResult,
165
+ {
166
+ params: RequestParamMap;
167
+ dataSource: string | null;
168
+ }
169
+ >
170
+ >;
118
171
  /**
119
172
  * Calls a method on a model given a list of parameters.
120
173
  * @returns 500 on an uncaught client error, 200 with a result body on success
121
174
  */
122
- declare function methodDispatch(crudCtx: CrudContext, instanceRegistry: DependencyInjector, method: ModelMethod, params: Record<string, unknown>): Promise<HttpResult<unknown>>;
175
+ declare function methodDispatch(
176
+ obj: any,
177
+ di: DependencyContainer,
178
+ route: MatchedRoute,
179
+ params: Record<string, unknown>,
180
+ ): Promise<HttpResult<unknown>>;
123
181
  /**
124
182
  * For testing purposes
125
183
  */
126
184
  export declare const _cloesceInternal: {
127
- matchRoute: typeof matchRoute;
128
- validateRequest: typeof validateRequest;
129
- methodDispatch: typeof methodDispatch;
130
- RuntimeContainer: typeof RuntimeContainer;
185
+ matchRoute: typeof matchRoute;
186
+ validateRequest: typeof validateRequest;
187
+ methodDispatch: typeof methodDispatch;
188
+ RuntimeContainer: typeof RuntimeContainer;
131
189
  };
132
190
  export {};
133
- //# sourceMappingURL=router.d.ts.map
191
+ //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,MAAM,EACN,WAAW,EAEX,UAAU,EAEV,KAAK,EAGL,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAuB,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAElD;;;;;GAKG;AACH,KAAK,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,CAAC,CAAC;AAE9D;;GAEG;AACH,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,CACzB,OAAO,EAAE,OAAO,EAChB,GAA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