@archlast/server 0.1.7 → 0.1.8
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/LICENSE +21 -21
- package/README.md +99 -99
- package/dist/auth/better-auth-instance.d.ts +7 -11
- package/dist/auth/better-auth-instance.d.ts.map +1 -1
- package/dist/controllers/crud-generator.controller.js +123 -123
- package/dist/controllers/introspection.controller.d.ts +24 -0
- package/dist/controllers/introspection.controller.d.ts.map +1 -1
- package/dist/controllers/introspection.controller.js +17 -0
- package/dist/controllers/introspection.controller.js.map +1 -1
- package/dist/controllers/system.controller.d.ts +16 -0
- package/dist/controllers/system.controller.d.ts.map +1 -1
- package/dist/controllers/system.controller.js +28 -0
- package/dist/controllers/system.controller.js.map +1 -1
- package/dist/deployment/handler.d.ts.map +1 -1
- package/dist/deployment/handler.js +33 -6
- package/dist/deployment/handler.js.map +1 -1
- package/dist/http/router.d.ts +1 -0
- package/dist/http/router.d.ts.map +1 -1
- package/dist/http/router.js +14 -3
- package/dist/http/router.js.map +1 -1
- package/dist/http/server.d.ts.map +1 -1
- package/dist/http/server.js +22 -19
- package/dist/http/server.js.map +1 -1
- package/dist/schema/input-types.d.ts +1 -1
- package/dist/schema/input-types.d.ts.map +1 -1
- package/dist/schema/input-types.js +4 -3
- package/dist/schema/input-types.js.map +1 -1
- package/dist/schema/modifiers.d.ts +2 -1
- package/dist/schema/modifiers.d.ts.map +1 -1
- package/dist/schema/modifiers.js +41 -5
- package/dist/schema/modifiers.js.map +1 -1
- package/dist/schema/type-helpers.d.ts +35 -0
- package/dist/schema/type-helpers.d.ts.map +1 -1
- package/dist/schema/type-helpers.js +32 -21
- package/dist/schema/type-helpers.js.map +1 -1
- package/dist/schema/validators.d.ts +1 -1
- package/dist/schema/validators.d.ts.map +1 -1
- package/dist/schema/validators.js +27 -16
- package/dist/schema/validators.js.map +1 -1
- package/dist/services/admin/backup/SqliteGenerator.js +8 -8
- package/dist/services/introspection.service.d.ts.map +1 -1
- package/dist/services/introspection.service.js +6 -3
- package/dist/services/introspection.service.js.map +1 -1
- package/dist/services/system.service.d.ts +4 -0
- package/dist/services/system.service.d.ts.map +1 -1
- package/dist/services/system.service.js +42 -0
- package/dist/services/system.service.js.map +1 -1
- package/docker/README.md +10 -10
- package/package.json +210 -210
- package/templates/.env.example +55 -55
- package/templates/archlast.config.js +37 -37
- package/templates/docker-compose.dev.yml +8 -8
- package/templates/docker-compose.prod.yml +15 -15
- package/templates/docker-compose.yml +33 -33
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Archlast Team
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Archlast Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
# @archlast/server
|
|
2
|
-
|
|
3
|
-
Type-safe server definitions and runtime helpers for Archlast. This package is
|
|
4
|
-
used to define schema, functions, and shared types, and it ships Docker
|
|
5
|
-
templates for runtime deployment.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install -D @archlast/server
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Library vs runtime
|
|
14
|
-
|
|
15
|
-
This package is a dev-time library for schema and function definitions. The
|
|
16
|
-
runtime server is delivered via the Docker image (`algochad/archlast-server`) and managed
|
|
17
|
-
by the CLI (`archlast start`).
|
|
18
|
-
|
|
19
|
-
## Schema
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
import { defineSchema, defineTable, v } from "@archlast/server/schema/definition";
|
|
23
|
-
|
|
24
|
-
export default defineSchema({
|
|
25
|
-
tasks: defineTable({
|
|
26
|
-
id: v.id(),
|
|
27
|
-
text: v.string(),
|
|
28
|
-
}),
|
|
29
|
-
});
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Functions
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
import { query, mutation } from "@archlast/server/functions/definition";
|
|
36
|
-
import { z } from "zod";
|
|
37
|
-
|
|
38
|
-
export const list = query({
|
|
39
|
-
handler: async (ctx) => ctx.db.table("tasks").findMany(),
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export const create = mutation({
|
|
43
|
-
args: { text: z.string() },
|
|
44
|
-
handler: async (ctx, args) => ctx.db.table("tasks").insert({ text: args.text }),
|
|
45
|
-
});
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Other function types:
|
|
49
|
-
- `action` for long running tasks
|
|
50
|
-
- `http` for explicit HTTP routes
|
|
51
|
-
- `webhook` for signed incoming events
|
|
52
|
-
- `rpc` for tRPC-style public procedures
|
|
53
|
-
|
|
54
|
-
## Auth and permissions
|
|
55
|
-
|
|
56
|
-
All functions default to `auth: "required"`. You can mark functions public or
|
|
57
|
-
optional, and attach permissions.
|
|
58
|
-
|
|
59
|
-
```ts
|
|
60
|
-
export const publicPing = query({
|
|
61
|
-
auth: "public",
|
|
62
|
-
handler: async () => "pong",
|
|
63
|
-
});
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Runtime exports
|
|
67
|
-
|
|
68
|
-
Common entry points:
|
|
69
|
-
- `@archlast/server/schema/definition` and `@archlast/server/schema/validators`
|
|
70
|
-
- `@archlast/server/functions/definition` and `@archlast/server/functions/types`
|
|
71
|
-
- `@archlast/server/http` and `@archlast/server/webhook`
|
|
72
|
-
- `@archlast/server/jobs`
|
|
73
|
-
- `@archlast/server/storage/types`
|
|
74
|
-
- `@archlast/server/context`
|
|
75
|
-
|
|
76
|
-
## Docker templates
|
|
77
|
-
|
|
78
|
-
Templates live under `templates/` in this package:
|
|
79
|
-
- `docker-compose.yml`, `docker-compose.dev.yml`, `docker-compose.prod.yml`
|
|
80
|
-
- `.env.example`
|
|
81
|
-
- `archlast.config.js`
|
|
82
|
-
|
|
83
|
-
The CLI uses these templates to generate a local Docker setup.
|
|
84
|
-
|
|
85
|
-
## Environment configuration
|
|
86
|
-
|
|
87
|
-
Key variables used by the server runtime:
|
|
88
|
-
- `PORT` (default: 4000)
|
|
89
|
-
- `ARCHLAST_DB_ROOT` (default: `./data`)
|
|
90
|
-
- `ARCHLAST_ALLOWED_ORIGINS` (CSV)
|
|
91
|
-
- `ARCHLAST_CORS_ALLOW_CREDENTIALS` (`true` or `false`)
|
|
92
|
-
- `STORAGE_ROOT` and `STORAGE_SIGNING_SECRET`
|
|
93
|
-
- `S3_ENABLED`, `S3_BUCKET`, `S3_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`
|
|
94
|
-
- `ARCHLAST_ADMIN_TOKEN` (deprecated), `ARCHLAST_AUTH_TOKEN_PEPPER`
|
|
95
|
-
- `ARCHLAST_DASHBOARD_DIR` or `ARCHLAST_DASHBOARD_URL`
|
|
96
|
-
- `ARCHLAST_STORE_PORT`, `ARCHLAST_STORE_NO_TLS`
|
|
97
|
-
|
|
98
|
-
## Publishing (maintainers)
|
|
99
|
-
|
|
1
|
+
# @archlast/server
|
|
2
|
+
|
|
3
|
+
Type-safe server definitions and runtime helpers for Archlast. This package is
|
|
4
|
+
used to define schema, functions, and shared types, and it ships Docker
|
|
5
|
+
templates for runtime deployment.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -D @archlast/server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Library vs runtime
|
|
14
|
+
|
|
15
|
+
This package is a dev-time library for schema and function definitions. The
|
|
16
|
+
runtime server is delivered via the Docker image (`algochad/archlast-server`) and managed
|
|
17
|
+
by the CLI (`archlast start`).
|
|
18
|
+
|
|
19
|
+
## Schema
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { defineSchema, defineTable, v } from "@archlast/server/schema/definition";
|
|
23
|
+
|
|
24
|
+
export default defineSchema({
|
|
25
|
+
tasks: defineTable({
|
|
26
|
+
id: v.id(),
|
|
27
|
+
text: v.string(),
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Functions
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { query, mutation } from "@archlast/server/functions/definition";
|
|
36
|
+
import { z } from "zod";
|
|
37
|
+
|
|
38
|
+
export const list = query({
|
|
39
|
+
handler: async (ctx) => ctx.db.table("tasks").findMany(),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const create = mutation({
|
|
43
|
+
args: { text: z.string() },
|
|
44
|
+
handler: async (ctx, args) => ctx.db.table("tasks").insert({ text: args.text }),
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Other function types:
|
|
49
|
+
- `action` for long running tasks
|
|
50
|
+
- `http` for explicit HTTP routes
|
|
51
|
+
- `webhook` for signed incoming events
|
|
52
|
+
- `rpc` for tRPC-style public procedures
|
|
53
|
+
|
|
54
|
+
## Auth and permissions
|
|
55
|
+
|
|
56
|
+
All functions default to `auth: "required"`. You can mark functions public or
|
|
57
|
+
optional, and attach permissions.
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
export const publicPing = query({
|
|
61
|
+
auth: "public",
|
|
62
|
+
handler: async () => "pong",
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Runtime exports
|
|
67
|
+
|
|
68
|
+
Common entry points:
|
|
69
|
+
- `@archlast/server/schema/definition` and `@archlast/server/schema/validators`
|
|
70
|
+
- `@archlast/server/functions/definition` and `@archlast/server/functions/types`
|
|
71
|
+
- `@archlast/server/http` and `@archlast/server/webhook`
|
|
72
|
+
- `@archlast/server/jobs`
|
|
73
|
+
- `@archlast/server/storage/types`
|
|
74
|
+
- `@archlast/server/context`
|
|
75
|
+
|
|
76
|
+
## Docker templates
|
|
77
|
+
|
|
78
|
+
Templates live under `templates/` in this package:
|
|
79
|
+
- `docker-compose.yml`, `docker-compose.dev.yml`, `docker-compose.prod.yml`
|
|
80
|
+
- `.env.example`
|
|
81
|
+
- `archlast.config.js`
|
|
82
|
+
|
|
83
|
+
The CLI uses these templates to generate a local Docker setup.
|
|
84
|
+
|
|
85
|
+
## Environment configuration
|
|
86
|
+
|
|
87
|
+
Key variables used by the server runtime:
|
|
88
|
+
- `PORT` (default: 4000)
|
|
89
|
+
- `ARCHLAST_DB_ROOT` (default: `./data`)
|
|
90
|
+
- `ARCHLAST_ALLOWED_ORIGINS` (CSV)
|
|
91
|
+
- `ARCHLAST_CORS_ALLOW_CREDENTIALS` (`true` or `false`)
|
|
92
|
+
- `STORAGE_ROOT` and `STORAGE_SIGNING_SECRET`
|
|
93
|
+
- `S3_ENABLED`, `S3_BUCKET`, `S3_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`
|
|
94
|
+
- `ARCHLAST_ADMIN_TOKEN` (deprecated), `ARCHLAST_AUTH_TOKEN_PEPPER`
|
|
95
|
+
- `ARCHLAST_DASHBOARD_DIR` or `ARCHLAST_DASHBOARD_URL`
|
|
96
|
+
- `ARCHLAST_STORE_PORT`, `ARCHLAST_STORE_NO_TLS`
|
|
97
|
+
|
|
98
|
+
## Publishing (maintainers)
|
|
99
|
+
|
|
100
100
|
See `docs/npm-publishing.md` for release and publish steps.
|
|
@@ -1038,19 +1038,15 @@ export declare function createBetterAuthInstance(userOptions: BetterAuthInstance
|
|
|
1038
1038
|
image?: string | null | undefined;
|
|
1039
1039
|
}> & Record<string, unknown>, context: import("better-auth", { with: { "resolution-mode": "import" } }).GenericEndpointContext | null): Promise<{
|
|
1040
1040
|
data: {
|
|
1041
|
-
displayUsername
|
|
1042
|
-
username?: string | undefined;
|
|
1043
|
-
id? /**
|
|
1044
|
-
* Maximum expiration time (in days)
|
|
1045
|
-
*/: string | undefined;
|
|
1046
|
-
createdAt?: Date | undefined;
|
|
1047
|
-
updatedAt
|
|
1041
|
+
displayUsername
|
|
1048
1042
|
/**
|
|
1049
|
-
*
|
|
1043
|
+
* Default expiration time for API keys (in milliseconds)
|
|
1050
1044
|
*/
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1045
|
+
?: string | undefined;
|
|
1046
|
+
username?: string | undefined;
|
|
1047
|
+
id?: string | undefined;
|
|
1048
|
+
createdAt?: Date | undefined;
|
|
1049
|
+
updatedAt?: Date | undefined;
|
|
1054
1050
|
email?: string | undefined;
|
|
1055
1051
|
emailVerified?: boolean | undefined;
|
|
1056
1052
|
name?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth-instance.d.ts","sourceRoot":"","sources":["../../src/auth/better-auth-instance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;OAEG;IACH,EAAE,EAAE,eAAe,CAAC;IAEpB;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE;QACP;;WAEG;QACH,WAAW,CAAC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
|
|
69
69
|
.join("");
|
|
70
70
|
// Linked mode: return a simple re-export
|
|
71
71
|
if (mode === "linked") {
|
|
72
|
-
return `// Auto-generated CRUD re-export for "${collection}"
|
|
73
|
-
// This file links to the auto-generated handlers in _generated/crud
|
|
74
|
-
// Re-run "archlast dev" to regenerate _generated/crud when schema changes
|
|
75
|
-
|
|
76
|
-
export * from "../_generated/crud/${collection}";
|
|
77
|
-
|
|
78
|
-
// You can also import specific handlers:
|
|
79
|
-
// import { list${exportName}, get${exportName}, create${exportName}, update${exportName}, delete${exportName} } from "../_generated/crud/${collection}";
|
|
72
|
+
return `// Auto-generated CRUD re-export for "${collection}"
|
|
73
|
+
// This file links to the auto-generated handlers in _generated/crud
|
|
74
|
+
// Re-run "archlast dev" to regenerate _generated/crud when schema changes
|
|
75
|
+
|
|
76
|
+
export * from "../_generated/crud/${collection}";
|
|
77
|
+
|
|
78
|
+
// You can also import specific handlers:
|
|
79
|
+
// import { list${exportName}, get${exportName}, create${exportName}, update${exportName}, delete${exportName} } from "../_generated/crud/${collection}";
|
|
80
80
|
`;
|
|
81
81
|
}
|
|
82
82
|
// Ejected mode: return full standalone code
|
|
83
|
-
const code = `// Auto-generated CRUD routes for "${collection}"
|
|
84
|
-
// Add this file to your Archlast app's functions directory
|
|
85
|
-
|
|
86
|
-
import { http } from "../_generated/server";
|
|
87
|
-
import type { DataModel } from "../_generated/server";
|
|
88
|
-
|
|
89
|
-
// Type for the collection document
|
|
90
|
-
type ${exportName}Doc = DataModel["${collection}"];
|
|
91
|
-
// Type for creating a document (excludes auto-generated fields)
|
|
92
|
-
type ${exportName}Create = Omit<${exportName}Doc, "_id" | "_collection">;
|
|
93
|
-
// Type for updating a document (all fields optional)
|
|
94
|
-
type ${exportName}Update = Partial<${exportName}Create>;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* GET ${prefix}
|
|
98
|
-
* List all ${collection} records with optional pagination
|
|
99
|
-
*/
|
|
100
|
-
export const list${exportName} = http.get({
|
|
101
|
-
path: "${prefix}",
|
|
102
|
-
${auth}
|
|
103
|
-
handler: async (ctx) => {
|
|
104
|
-
// Query params are already parsed into ctx.req.query
|
|
105
|
-
const limitStr = ctx.req.query.limit;
|
|
106
|
-
const offsetStr = ctx.req.query.offset;
|
|
107
|
-
const limit = limitStr ? Number(limitStr) : 50;
|
|
108
|
-
const offset = offsetStr ? Number(offsetStr) : 0;
|
|
109
|
-
|
|
110
|
-
// Use .take() and .skip() for pagination
|
|
111
|
-
const result = await ctx.db.query("${collection}")
|
|
112
|
-
.take(limit)
|
|
113
|
-
.skip(offset)
|
|
114
|
-
.findMany();
|
|
115
|
-
|
|
116
|
-
return result;
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* GET ${prefix}/:id
|
|
122
|
-
* Get a single ${collection} record by ID
|
|
123
|
-
*/
|
|
124
|
-
export const get${exportName} = http.get({
|
|
125
|
-
path: "${prefix}/:id",
|
|
126
|
-
${auth}
|
|
127
|
-
handler: async (ctx) => {
|
|
128
|
-
// Path params are available in ctx.req.params
|
|
129
|
-
const id = ctx.req.params.id;
|
|
130
|
-
const result = await ctx.db.get("${collection}", id);
|
|
131
|
-
|
|
132
|
-
if (!result) {
|
|
133
|
-
return { error: "${collection} not found" };
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return result;
|
|
137
|
-
},
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* POST ${prefix}
|
|
142
|
-
* Create a new ${collection} record
|
|
143
|
-
*/
|
|
144
|
-
export const create${exportName} = http.post({
|
|
145
|
-
path: "${prefix}",
|
|
146
|
-
${auth}
|
|
147
|
-
handler: async (ctx) => {
|
|
148
|
-
// Parse JSON body from the request with proper type
|
|
149
|
-
const data = await ctx.req.json<${exportName}Create>();
|
|
150
|
-
|
|
151
|
-
// Validate required fields based on your schema
|
|
152
|
-
const result = await ctx.db.insert("${collection}", data);
|
|
153
|
-
|
|
154
|
-
return result;
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* PATCH ${prefix}/:id
|
|
160
|
-
* Update a ${collection} record
|
|
161
|
-
*/
|
|
162
|
-
export const update${exportName} = http.patch({
|
|
163
|
-
path: "${prefix}/:id",
|
|
164
|
-
${auth}
|
|
165
|
-
handler: async (ctx) => {
|
|
166
|
-
const id = ctx.req.params.id;
|
|
167
|
-
const data = await ctx.req.json<${exportName}Update>();
|
|
168
|
-
|
|
169
|
-
const existing = await ctx.db.get("${collection}", id);
|
|
170
|
-
if (!existing) {
|
|
171
|
-
return { error: "${collection} not found" };
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
const result = await ctx.db.update("${collection}", id, data);
|
|
175
|
-
return result;
|
|
176
|
-
},
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* DELETE ${prefix}/:id
|
|
181
|
-
* Delete a ${collection} record
|
|
182
|
-
*/
|
|
183
|
-
export const delete${exportName} = http.delete({
|
|
184
|
-
path: "${prefix}/:id",
|
|
185
|
-
${auth}
|
|
186
|
-
handler: async (ctx) => {
|
|
187
|
-
const id = ctx.req.params.id;
|
|
188
|
-
|
|
189
|
-
const existing = await ctx.db.get("${collection}", id);
|
|
190
|
-
if (!existing) {
|
|
191
|
-
return { error: "${collection} not found" };
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
await ctx.db.delete("${collection}", id);
|
|
195
|
-
return { success: true };
|
|
196
|
-
},
|
|
197
|
-
});
|
|
83
|
+
const code = `// Auto-generated CRUD routes for "${collection}"
|
|
84
|
+
// Add this file to your Archlast app's functions directory
|
|
85
|
+
|
|
86
|
+
import { http } from "../_generated/server";
|
|
87
|
+
import type { DataModel } from "../_generated/server";
|
|
88
|
+
|
|
89
|
+
// Type for the collection document
|
|
90
|
+
type ${exportName}Doc = DataModel["${collection}"];
|
|
91
|
+
// Type for creating a document (excludes auto-generated fields)
|
|
92
|
+
type ${exportName}Create = Omit<${exportName}Doc, "_id" | "_collection">;
|
|
93
|
+
// Type for updating a document (all fields optional)
|
|
94
|
+
type ${exportName}Update = Partial<${exportName}Create>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* GET ${prefix}
|
|
98
|
+
* List all ${collection} records with optional pagination
|
|
99
|
+
*/
|
|
100
|
+
export const list${exportName} = http.get({
|
|
101
|
+
path: "${prefix}",
|
|
102
|
+
${auth}
|
|
103
|
+
handler: async (ctx) => {
|
|
104
|
+
// Query params are already parsed into ctx.req.query
|
|
105
|
+
const limitStr = ctx.req.query.limit;
|
|
106
|
+
const offsetStr = ctx.req.query.offset;
|
|
107
|
+
const limit = limitStr ? Number(limitStr) : 50;
|
|
108
|
+
const offset = offsetStr ? Number(offsetStr) : 0;
|
|
109
|
+
|
|
110
|
+
// Use .take() and .skip() for pagination
|
|
111
|
+
const result = await ctx.db.query("${collection}")
|
|
112
|
+
.take(limit)
|
|
113
|
+
.skip(offset)
|
|
114
|
+
.findMany();
|
|
115
|
+
|
|
116
|
+
return result;
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* GET ${prefix}/:id
|
|
122
|
+
* Get a single ${collection} record by ID
|
|
123
|
+
*/
|
|
124
|
+
export const get${exportName} = http.get({
|
|
125
|
+
path: "${prefix}/:id",
|
|
126
|
+
${auth}
|
|
127
|
+
handler: async (ctx) => {
|
|
128
|
+
// Path params are available in ctx.req.params
|
|
129
|
+
const id = ctx.req.params.id;
|
|
130
|
+
const result = await ctx.db.get("${collection}", id);
|
|
131
|
+
|
|
132
|
+
if (!result) {
|
|
133
|
+
return { error: "${collection} not found" };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return result;
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* POST ${prefix}
|
|
142
|
+
* Create a new ${collection} record
|
|
143
|
+
*/
|
|
144
|
+
export const create${exportName} = http.post({
|
|
145
|
+
path: "${prefix}",
|
|
146
|
+
${auth}
|
|
147
|
+
handler: async (ctx) => {
|
|
148
|
+
// Parse JSON body from the request with proper type
|
|
149
|
+
const data = await ctx.req.json<${exportName}Create>();
|
|
150
|
+
|
|
151
|
+
// Validate required fields based on your schema
|
|
152
|
+
const result = await ctx.db.insert("${collection}", data);
|
|
153
|
+
|
|
154
|
+
return result;
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* PATCH ${prefix}/:id
|
|
160
|
+
* Update a ${collection} record
|
|
161
|
+
*/
|
|
162
|
+
export const update${exportName} = http.patch({
|
|
163
|
+
path: "${prefix}/:id",
|
|
164
|
+
${auth}
|
|
165
|
+
handler: async (ctx) => {
|
|
166
|
+
const id = ctx.req.params.id;
|
|
167
|
+
const data = await ctx.req.json<${exportName}Update>();
|
|
168
|
+
|
|
169
|
+
const existing = await ctx.db.get("${collection}", id);
|
|
170
|
+
if (!existing) {
|
|
171
|
+
return { error: "${collection} not found" };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const result = await ctx.db.update("${collection}", id, data);
|
|
175
|
+
return result;
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* DELETE ${prefix}/:id
|
|
181
|
+
* Delete a ${collection} record
|
|
182
|
+
*/
|
|
183
|
+
export const delete${exportName} = http.delete({
|
|
184
|
+
path: "${prefix}/:id",
|
|
185
|
+
${auth}
|
|
186
|
+
handler: async (ctx) => {
|
|
187
|
+
const id = ctx.req.params.id;
|
|
188
|
+
|
|
189
|
+
const existing = await ctx.db.get("${collection}", id);
|
|
190
|
+
if (!existing) {
|
|
191
|
+
return { error: "${collection} not found" };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
await ctx.db.delete("${collection}", id);
|
|
195
|
+
return { success: true };
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
198
|
`;
|
|
199
199
|
return code.trim();
|
|
200
200
|
}
|
|
@@ -275,6 +275,30 @@ export declare const introspectionController: Elysia<"", {
|
|
|
275
275
|
};
|
|
276
276
|
};
|
|
277
277
|
};
|
|
278
|
+
} & {
|
|
279
|
+
introspect: {
|
|
280
|
+
"http-routes-runtime": {
|
|
281
|
+
get: {
|
|
282
|
+
body: unknown;
|
|
283
|
+
params: {};
|
|
284
|
+
query: unknown;
|
|
285
|
+
headers: unknown;
|
|
286
|
+
response: {
|
|
287
|
+
200: {
|
|
288
|
+
error: string;
|
|
289
|
+
routes?: undefined;
|
|
290
|
+
} | {
|
|
291
|
+
routes: {
|
|
292
|
+
method: import("../functions/definition.js").HttpMethod;
|
|
293
|
+
path: string;
|
|
294
|
+
type: "http" | "webhook";
|
|
295
|
+
}[];
|
|
296
|
+
error?: undefined;
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
};
|
|
278
302
|
} & {
|
|
279
303
|
jobs: {
|
|
280
304
|
trigger: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspection.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/introspection.controller.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAK,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"introspection.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/introspection.controller.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAK,MAAM,QAAQ,CAAC;AAuBnC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAod/B,CAAC"}
|
|
@@ -239,6 +239,23 @@ exports.introspectionController = new elysia_1.Elysia({ tags: ["Introspection"]
|
|
|
239
239
|
}, {
|
|
240
240
|
params: elysia_1.t.Object({ id: elysia_1.t.String() }),
|
|
241
241
|
detail: { summary: "Get job" },
|
|
242
|
+
})
|
|
243
|
+
/**
|
|
244
|
+
* GET /_archlast/introspect/http-routes-runtime
|
|
245
|
+
* Runtime HTTP router routes (admin only)
|
|
246
|
+
*/
|
|
247
|
+
.get("/introspect/http-routes-runtime", async (ctx) => {
|
|
248
|
+
const { request, set, httpRouter } = (0, context_helper_js_1.getCtx)(ctx);
|
|
249
|
+
const auth = await (0, role_helpers_js_1.requireAdmin)((0, context_helper_js_1.getBetterAuth)(), request);
|
|
250
|
+
if (!auth) {
|
|
251
|
+
set.status = 401;
|
|
252
|
+
return { error: "Unauthorized" };
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
routes: httpRouter ? httpRouter.listRoutes() : [],
|
|
256
|
+
};
|
|
257
|
+
}, {
|
|
258
|
+
detail: { summary: "List runtime HTTP router routes" },
|
|
242
259
|
})
|
|
243
260
|
/**
|
|
244
261
|
* POST /_archlast/jobs/trigger
|