@nbt-dev/nbt 0.0.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nimbit Cloud Infrastructure Inc
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 ADDED
@@ -0,0 +1,41 @@
1
+ # @nbt-dev/nbt
2
+
3
+ The `nbt` CLI and `console` daemon for the nbt-dev console — a fixed-target platform for web development.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i -g @nbt-dev/nbt
9
+ ```
10
+
11
+ ## Workflow
12
+
13
+ ```bash
14
+ npx nbt init # scaffold the project (nbt.json, nbt/, generated/)
15
+ npx nbt init billing # scaffold a cartridge at nbt/billing/
16
+ # ...edit nbt/billing/schema.nbt (entities, indexes, @route decls)…
17
+ npx nbt migrate dev billing --baseline # first migration from the schema
18
+ npx nbt generate # typed TS clients into generated/ — your carts
19
+ # PLUS platform carts (auth, crm, calendar, …)
20
+
21
+ npx nbt install --path nbt/billing # first deploy of a cartridge to a live instance
22
+ npx nbt migrate deploy # apply later migrations (host/port from nbt.json `dev`)
23
+ npx nbt migrate deploy --env prod # target another configured environment
24
+ ```
25
+
26
+ Commands read `nbt.json` for paths and the target instance; `--host`/`--port`/`--root`/`--out`
27
+ flags override it. Run from anywhere inside the project — `nbt` walks up to find `nbt.json`.
28
+
29
+ `npx nbt generate` emits clients for your own carts **and** the platform carts bundled with this
30
+ package, so you get typed access to the whole surface you build against.
31
+
32
+ ```bash
33
+ npx nbt console up --port 8080 --data-dir ./data # boot the console daemon locally
34
+ npx nbt console --help # daemon CLI (up / down / init / …)
35
+ ```
36
+
37
+ Run `npx nbt --help` or `npx nbt <command> --help` for the full surface.
38
+
39
+ ## Platform
40
+
41
+ linux/x64 only for now. macOS / arm64 are not yet published.
@@ -0,0 +1,56 @@
1
+ {
2
+ "cartridge": "audit",
3
+ "version": "0.1",
4
+ "owns": {
5
+ "AuditEvent": {
6
+ "fields": [
7
+ { "name": "id", "type": "ULID", "kind": "scalar" },
8
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
9
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
10
+ { "name": "seq", "type": "u64", "kind": "scalar" },
11
+ { "name": "actor", "type": "string", "kind": "scalar" },
12
+ { "name": "resource", "type": "string", "kind": "scalar" },
13
+ { "name": "verb", "type": "string", "kind": "scalar" },
14
+ { "name": "requestId", "type": "string", "kind": "scalar" },
15
+ { "name": "cartridgeName", "type": "string", "optional": true, "kind": "scalar" },
16
+ { "name": "outcome", "type": "string", "kind": "scalar" },
17
+ { "name": "cap", "type": "string", "optional": true, "kind": "scalar" },
18
+ { "name": "srcIp", "type": "string", "optional": true, "kind": "scalar" },
19
+ { "name": "beforeHash", "type": "string", "optional": true, "kind": "scalar" },
20
+ { "name": "afterHash", "type": "string", "optional": true, "kind": "scalar" },
21
+ { "name": "prevHash", "type": "string", "kind": "scalar" },
22
+ { "name": "detail", "type": "string", "optional": true, "kind": "scalar" },
23
+ { "name": "ts", "type": "DateTime", "kind": "scalar" }
24
+ ],
25
+ "indices": [["seq"]],
26
+ "searchFields": [],
27
+ "methods": [
28
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "AuditEvent" } ] },
29
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<AuditEvent>" } ] },
30
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
31
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "seq", "type": "u64" }, { "name": "actor", "type": "string" }, { "name": "resource", "type": "string" }, { "name": "verb", "type": "string" }, { "name": "requestId", "type": "string" }, { "name": "outcome", "type": "string" }, { "name": "prevHash", "type": "string" }, { "name": "cartridgeName", "type": "string", "optional": true }, { "name": "cap", "type": "string", "optional": true }, { "name": "srcIp", "type": "string", "optional": true }, { "name": "beforeHash", "type": "string", "optional": true }, { "name": "afterHash", "type": "string", "optional": true }, { "name": "detail", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "AuditEvent" } ] },
32
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "seq", "type": "u64", "optional": true }, { "name": "actor", "type": "string", "optional": true }, { "name": "resource", "type": "string", "optional": true }, { "name": "verb", "type": "string", "optional": true }, { "name": "requestId", "type": "string", "optional": true }, { "name": "cartridgeName", "type": "string", "optional": true }, { "name": "outcome", "type": "string", "optional": true }, { "name": "cap", "type": "string", "optional": true }, { "name": "srcIp", "type": "string", "optional": true }, { "name": "beforeHash", "type": "string", "optional": true }, { "name": "afterHash", "type": "string", "optional": true }, { "name": "prevHash", "type": "string", "optional": true }, { "name": "detail", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "AuditEvent" } ] },
33
+ { "name": "find_by_seq", "inputs": [ { "name": "seq", "type": "u64" } ], "outputs": [ { "name": "out", "type": "list<AuditEvent>" } ] }
34
+ ],
35
+ "routes": [
36
+ { "op": "list", "method": "GET", "path": "/api/audit/auditevent" },
37
+ { "op": "create", "method": "POST", "path": "/api/audit/auditevent" },
38
+ { "op": "count", "method": "GET", "path": "/api/audit/auditevent/count" },
39
+ { "op": "batch_get", "method": "POST", "path": "/api/audit/auditevent/_batch" },
40
+ { "op": "get", "method": "GET", "path": "/api/audit/auditevent/:id" }
41
+ ],
42
+ "exported": false
43
+ }
44
+ },
45
+ "structs": [],
46
+ "enums": [],
47
+ "imports": {
48
+ },
49
+ "actions": [],
50
+ "middleware": [],
51
+ "workflows": [],
52
+ "schedules": [],
53
+ "tasks": [],
54
+ "tools": [],
55
+ "widgets": []
56
+ }
@@ -0,0 +1,252 @@
1
+ {
2
+ "cartridge": "auth",
3
+ "version": "0.1",
4
+ "owns": {
5
+ "User": {
6
+ "fields": [
7
+ { "name": "id", "type": "ULID", "kind": "scalar" },
8
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
9
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
10
+ { "name": "name", "type": "string", "kind": "scalar" },
11
+ { "name": "username", "type": "string", "optional": true, "kind": "scalar" },
12
+ { "name": "email", "type": "string", "optional": true, "kind": "scalar" },
13
+ { "name": "emailVerified", "type": "bool", "kind": "scalar" },
14
+ { "name": "externalId", "type": "string", "optional": true, "kind": "scalar" },
15
+ { "name": "capsVersion", "type": "u32", "kind": "scalar" }
16
+ ],
17
+ "indices": [["email"], ["externalId"], ["email"]],
18
+ "searchFields": [],
19
+ "methods": [
20
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "User" } ] },
21
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<User>" } ] },
22
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
23
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "name", "type": "string" }, { "name": "emailVerified", "type": "bool" }, { "name": "capsVersion", "type": "u32" }, { "name": "username", "type": "string", "optional": true }, { "name": "email", "type": "string", "optional": true }, { "name": "externalId", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "User" } ] },
24
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "name", "type": "string", "optional": true }, { "name": "username", "type": "string", "optional": true }, { "name": "email", "type": "string", "optional": true }, { "name": "emailVerified", "type": "bool", "optional": true }, { "name": "externalId", "type": "string", "optional": true }, { "name": "capsVersion", "type": "u32", "optional": true }], "outputs": [ { "name": "out", "type": "User" } ] },
25
+ { "name": "find_by_email", "inputs": [ { "name": "email", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<User>" } ] },
26
+ { "name": "find_by_externalId", "inputs": [ { "name": "externalId", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<User>" } ] },
27
+ { "name": "find_by_email", "inputs": [ { "name": "email", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<User>" } ] }
28
+ ],
29
+ "routes": [
30
+ { "op": "list", "method": "GET", "path": "/api/auth/user" },
31
+ { "op": "create", "method": "POST", "path": "/api/auth/user" },
32
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/auth/user" },
33
+ { "op": "count", "method": "GET", "path": "/api/auth/user/count" },
34
+ { "op": "batch_get", "method": "POST", "path": "/api/auth/user/_batch" },
35
+ { "op": "get", "method": "GET", "path": "/api/auth/user/:id" },
36
+ { "op": "update", "method": "PUT", "path": "/api/auth/user/:id" },
37
+ { "op": "delete", "method": "DELETE", "path": "/api/auth/user/:id" }
38
+ ],
39
+ "exported": true
40
+ },
41
+ "UserRole": {
42
+ "fields": [
43
+ { "name": "id", "type": "ULID", "kind": "scalar" },
44
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
45
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
46
+ { "name": "userId", "type": "string", "kind": "scalar" },
47
+ { "name": "cart", "type": "string", "kind": "scalar" },
48
+ { "name": "role", "type": "string", "kind": "scalar" }
49
+ ],
50
+ "indices": [["userId"]],
51
+ "searchFields": [],
52
+ "methods": [
53
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "UserRole" } ] },
54
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<UserRole>" } ] },
55
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
56
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "userId", "type": "string" }, { "name": "cart", "type": "string" }, { "name": "role", "type": "string" }], "outputs": [ { "name": "out", "type": "UserRole" } ] },
57
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "userId", "type": "string", "optional": true }, { "name": "cart", "type": "string", "optional": true }, { "name": "role", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "UserRole" } ] },
58
+ { "name": "find_by_userId", "inputs": [ { "name": "userId", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<UserRole>" } ] }
59
+ ],
60
+ "routes": [
61
+ { "op": "list", "method": "GET", "path": "/api/auth/userrole" },
62
+ { "op": "create", "method": "POST", "path": "/api/auth/userrole" },
63
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/auth/userrole" },
64
+ { "op": "count", "method": "GET", "path": "/api/auth/userrole/count" },
65
+ { "op": "batch_get", "method": "POST", "path": "/api/auth/userrole/_batch" },
66
+ { "op": "get", "method": "GET", "path": "/api/auth/userrole/:id" },
67
+ { "op": "update", "method": "PUT", "path": "/api/auth/userrole/:id" },
68
+ { "op": "delete", "method": "DELETE", "path": "/api/auth/userrole/:id" }
69
+ ],
70
+ "exported": false
71
+ },
72
+ "Session": {
73
+ "fields": [
74
+ { "name": "id", "type": "ULID", "kind": "scalar" },
75
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
76
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
77
+ { "name": "userId", "type": "string", "kind": "scalar" },
78
+ { "name": "token", "type": "string", "kind": "scalar" },
79
+ { "name": "expiresAt", "type": "DateTime", "kind": "scalar" },
80
+ { "name": "ipAddress", "type": "string", "optional": true, "kind": "scalar" },
81
+ { "name": "userAgent", "type": "string", "optional": true, "kind": "scalar" }
82
+ ],
83
+ "indices": [["token"], ["userId"]],
84
+ "searchFields": [],
85
+ "methods": [
86
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "Session" } ] },
87
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<Session>" } ] },
88
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
89
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "userId", "type": "string" }, { "name": "token", "type": "string" }, { "name": "expiresAt", "type": "DateTime" }, { "name": "ipAddress", "type": "string", "optional": true }, { "name": "userAgent", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "Session" } ] },
90
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "userId", "type": "string", "optional": true }, { "name": "token", "type": "string", "optional": true }, { "name": "expiresAt", "type": "DateTime", "optional": true }, { "name": "ipAddress", "type": "string", "optional": true }, { "name": "userAgent", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "Session" } ] },
91
+ { "name": "find_by_token", "inputs": [ { "name": "token", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<Session>" } ] },
92
+ { "name": "find_by_userId", "inputs": [ { "name": "userId", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<Session>" } ] }
93
+ ],
94
+ "routes": [
95
+ { "op": "list", "method": "GET", "path": "/api/auth/session" },
96
+ { "op": "create", "method": "POST", "path": "/api/auth/session" },
97
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/auth/session" },
98
+ { "op": "count", "method": "GET", "path": "/api/auth/session/count" },
99
+ { "op": "batch_get", "method": "POST", "path": "/api/auth/session/_batch" },
100
+ { "op": "get", "method": "GET", "path": "/api/auth/session/:id" },
101
+ { "op": "update", "method": "PUT", "path": "/api/auth/session/:id" },
102
+ { "op": "delete", "method": "DELETE", "path": "/api/auth/session/:id" }
103
+ ],
104
+ "exported": false
105
+ },
106
+ "Account": {
107
+ "fields": [
108
+ { "name": "id", "type": "ULID", "kind": "scalar" },
109
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
110
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
111
+ { "name": "userId", "type": "string", "kind": "scalar" },
112
+ { "name": "providerId", "type": "string", "kind": "scalar" },
113
+ { "name": "password", "type": "string", "kind": "scalar" },
114
+ { "name": "accessToken", "type": "string", "kind": "scalar" },
115
+ { "name": "refreshToken", "type": "string", "kind": "scalar" },
116
+ { "name": "idToken", "type": "string", "kind": "scalar" },
117
+ { "name": "accessTokenExpiresAt", "type": "DateTime", "kind": "scalar" },
118
+ { "name": "refreshTokenExpiresAt", "type": "DateTime", "kind": "scalar" },
119
+ { "name": "scope", "type": "string", "kind": "scalar" }
120
+ ],
121
+ "indices": [["userId"]],
122
+ "searchFields": [],
123
+ "methods": [
124
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "Account" } ] },
125
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<Account>" } ] },
126
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
127
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "userId", "type": "string" }, { "name": "providerId", "type": "string" }, { "name": "password", "type": "string" }, { "name": "accessToken", "type": "string" }, { "name": "refreshToken", "type": "string" }, { "name": "idToken", "type": "string" }, { "name": "accessTokenExpiresAt", "type": "DateTime" }, { "name": "refreshTokenExpiresAt", "type": "DateTime" }, { "name": "scope", "type": "string" }], "outputs": [ { "name": "out", "type": "Account" } ] },
128
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "userId", "type": "string", "optional": true }, { "name": "providerId", "type": "string", "optional": true }, { "name": "password", "type": "string", "optional": true }, { "name": "accessToken", "type": "string", "optional": true }, { "name": "refreshToken", "type": "string", "optional": true }, { "name": "idToken", "type": "string", "optional": true }, { "name": "accessTokenExpiresAt", "type": "DateTime", "optional": true }, { "name": "refreshTokenExpiresAt", "type": "DateTime", "optional": true }, { "name": "scope", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "Account" } ] },
129
+ { "name": "find_by_userId", "inputs": [ { "name": "userId", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<Account>" } ] }
130
+ ],
131
+ "routes": [
132
+ { "op": "list", "method": "GET", "path": "/api/auth/account" },
133
+ { "op": "create", "method": "POST", "path": "/api/auth/account" },
134
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/auth/account" },
135
+ { "op": "count", "method": "GET", "path": "/api/auth/account/count" },
136
+ { "op": "batch_get", "method": "POST", "path": "/api/auth/account/_batch" },
137
+ { "op": "get", "method": "GET", "path": "/api/auth/account/:id" },
138
+ { "op": "update", "method": "PUT", "path": "/api/auth/account/:id" },
139
+ { "op": "delete", "method": "DELETE", "path": "/api/auth/account/:id" }
140
+ ],
141
+ "exported": false
142
+ },
143
+ "Verification": {
144
+ "fields": [
145
+ { "name": "id", "type": "ULID", "kind": "scalar" },
146
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
147
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
148
+ { "name": "identifier", "type": "string", "kind": "scalar" },
149
+ { "name": "value", "type": "string", "kind": "scalar" },
150
+ { "name": "expiresAt", "type": "DateTime", "kind": "scalar" }
151
+ ],
152
+ "indices": [["identifier"]],
153
+ "searchFields": [],
154
+ "methods": [
155
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "Verification" } ] },
156
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<Verification>" } ] },
157
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
158
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "identifier", "type": "string" }, { "name": "value", "type": "string" }, { "name": "expiresAt", "type": "DateTime" }], "outputs": [ { "name": "out", "type": "Verification" } ] },
159
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "identifier", "type": "string", "optional": true }, { "name": "value", "type": "string", "optional": true }, { "name": "expiresAt", "type": "DateTime", "optional": true }], "outputs": [ { "name": "out", "type": "Verification" } ] },
160
+ { "name": "find_by_identifier", "inputs": [ { "name": "identifier", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<Verification>" } ] }
161
+ ],
162
+ "routes": [
163
+ { "op": "list", "method": "GET", "path": "/api/auth/verification" },
164
+ { "op": "create", "method": "POST", "path": "/api/auth/verification" },
165
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/auth/verification" },
166
+ { "op": "count", "method": "GET", "path": "/api/auth/verification/count" },
167
+ { "op": "batch_get", "method": "POST", "path": "/api/auth/verification/_batch" },
168
+ { "op": "get", "method": "GET", "path": "/api/auth/verification/:id" },
169
+ { "op": "update", "method": "PUT", "path": "/api/auth/verification/:id" },
170
+ { "op": "delete", "method": "DELETE", "path": "/api/auth/verification/:id" }
171
+ ],
172
+ "exported": false
173
+ },
174
+ "ApiKey": {
175
+ "fields": [
176
+ { "name": "id", "type": "ULID", "kind": "scalar" },
177
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
178
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
179
+ { "name": "name", "type": "string", "kind": "scalar" },
180
+ { "name": "projectId", "type": "string", "kind": "scalar" },
181
+ { "name": "start", "type": "string", "kind": "scalar" },
182
+ { "name": "prefix", "type": "string", "kind": "scalar" },
183
+ { "name": "key", "type": "string", "kind": "scalar" },
184
+ { "name": "permissions", "type": "string", "kind": "scalar" },
185
+ { "name": "roles", "type": "string", "kind": "scalar" }
186
+ ],
187
+ "indices": [],
188
+ "searchFields": [],
189
+ "methods": [
190
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "ApiKey" } ] },
191
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<ApiKey>" } ] },
192
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
193
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "name", "type": "string" }, { "name": "projectId", "type": "string" }, { "name": "start", "type": "string" }, { "name": "prefix", "type": "string" }, { "name": "key", "type": "string" }, { "name": "permissions", "type": "string" }, { "name": "roles", "type": "string" }], "outputs": [ { "name": "out", "type": "ApiKey" } ] },
194
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "name", "type": "string", "optional": true }, { "name": "projectId", "type": "string", "optional": true }, { "name": "start", "type": "string", "optional": true }, { "name": "prefix", "type": "string", "optional": true }, { "name": "key", "type": "string", "optional": true }, { "name": "permissions", "type": "string", "optional": true }, { "name": "roles", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "ApiKey" } ] }
195
+ ],
196
+ "routes": [
197
+ { "op": "list", "method": "GET", "path": "/api/auth/apikey" },
198
+ { "op": "create", "method": "POST", "path": "/api/auth/apikey" },
199
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/auth/apikey" },
200
+ { "op": "count", "method": "GET", "path": "/api/auth/apikey/count" },
201
+ { "op": "batch_get", "method": "POST", "path": "/api/auth/apikey/_batch" },
202
+ { "op": "get", "method": "GET", "path": "/api/auth/apikey/:id" },
203
+ { "op": "update", "method": "PUT", "path": "/api/auth/apikey/:id" },
204
+ { "op": "delete", "method": "DELETE", "path": "/api/auth/apikey/:id" }
205
+ ],
206
+ "exported": false
207
+ },
208
+ "SshKey": {
209
+ "fields": [
210
+ { "name": "id", "type": "ULID", "kind": "scalar" },
211
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
212
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
213
+ { "name": "userId", "type": "string", "kind": "scalar" },
214
+ { "name": "label", "type": "string", "kind": "scalar" },
215
+ { "name": "blob", "type": "string", "kind": "scalar" }
216
+ ],
217
+ "indices": [["userId"], ["blob"]],
218
+ "searchFields": [],
219
+ "methods": [
220
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "SshKey" } ] },
221
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<SshKey>" } ] },
222
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
223
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "userId", "type": "string" }, { "name": "label", "type": "string" }, { "name": "blob", "type": "string" }], "outputs": [ { "name": "out", "type": "SshKey" } ] },
224
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "userId", "type": "string", "optional": true }, { "name": "label", "type": "string", "optional": true }, { "name": "blob", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "SshKey" } ] },
225
+ { "name": "find_by_userId", "inputs": [ { "name": "userId", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<SshKey>" } ] },
226
+ { "name": "find_by_blob", "inputs": [ { "name": "blob", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<SshKey>" } ] }
227
+ ],
228
+ "routes": [
229
+ { "op": "list", "method": "GET", "path": "/api/auth/sshkey" },
230
+ { "op": "create", "method": "POST", "path": "/api/auth/sshkey" },
231
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/auth/sshkey" },
232
+ { "op": "count", "method": "GET", "path": "/api/auth/sshkey/count" },
233
+ { "op": "batch_get", "method": "POST", "path": "/api/auth/sshkey/_batch" },
234
+ { "op": "get", "method": "GET", "path": "/api/auth/sshkey/:id" },
235
+ { "op": "update", "method": "PUT", "path": "/api/auth/sshkey/:id" },
236
+ { "op": "delete", "method": "DELETE", "path": "/api/auth/sshkey/:id" }
237
+ ],
238
+ "exported": false
239
+ }
240
+ },
241
+ "structs": [],
242
+ "enums": [],
243
+ "imports": {
244
+ },
245
+ "actions": [],
246
+ "middleware": [],
247
+ "workflows": [],
248
+ "schedules": [],
249
+ "tasks": [],
250
+ "tools": [],
251
+ "widgets": []
252
+ }
@@ -0,0 +1,141 @@
1
+ {
2
+ "cartridge": "calendar",
3
+ "version": "0.1",
4
+ "owns": {
5
+ "Calendar": {
6
+ "fields": [
7
+ { "name": "id", "type": "ULID", "kind": "scalar" },
8
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
9
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
10
+ { "name": "name", "type": "string", "kind": "scalar" },
11
+ { "name": "description", "type": "string", "optional": true, "kind": "scalar" },
12
+ { "name": "timezone", "type": "string", "optional": true, "kind": "scalar" },
13
+ { "name": "slotDuration", "type": "u32", "optional": true, "kind": "scalar" },
14
+ { "name": "slotInterval", "type": "u32", "optional": true, "kind": "scalar" },
15
+ { "name": "isActive", "type": "bool", "kind": "scalar" },
16
+ { "name": "source", "type": "string", "optional": true, "kind": "scalar" }
17
+ ],
18
+ "indices": [],
19
+ "searchFields": [],
20
+ "methods": [
21
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "Calendar" } ] },
22
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<Calendar>" } ] },
23
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
24
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "name", "type": "string" }, { "name": "isActive", "type": "bool" }, { "name": "description", "type": "string", "optional": true }, { "name": "timezone", "type": "string", "optional": true }, { "name": "slotDuration", "type": "u32", "optional": true }, { "name": "slotInterval", "type": "u32", "optional": true }, { "name": "source", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "Calendar" } ] },
25
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "name", "type": "string", "optional": true }, { "name": "description", "type": "string", "optional": true }, { "name": "timezone", "type": "string", "optional": true }, { "name": "slotDuration", "type": "u32", "optional": true }, { "name": "slotInterval", "type": "u32", "optional": true }, { "name": "isActive", "type": "bool", "optional": true }, { "name": "source", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "Calendar" } ] }
26
+ ],
27
+ "routes": [
28
+ { "op": "list", "method": "GET", "path": "/api/calendar/calendar" },
29
+ { "op": "create", "method": "POST", "path": "/api/calendar/calendar" },
30
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/calendar/calendar" },
31
+ { "op": "count", "method": "GET", "path": "/api/calendar/calendar/count" },
32
+ { "op": "batch_get", "method": "POST", "path": "/api/calendar/calendar/_batch" },
33
+ { "op": "get", "method": "GET", "path": "/api/calendar/calendar/:id" },
34
+ { "op": "update", "method": "PUT", "path": "/api/calendar/calendar/:id" },
35
+ { "op": "delete", "method": "DELETE", "path": "/api/calendar/calendar/:id" }
36
+ ],
37
+ "exported": false
38
+ },
39
+ "Appointment": {
40
+ "fields": [
41
+ { "name": "id", "type": "ULID", "kind": "scalar" },
42
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
43
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
44
+ { "name": "calendar", "type": "Calendar", "kind": "relation", "target": "Calendar", "target_cart": "calendar", "fk_field": "calendarId", "relation_kind": "many_to_one" },
45
+ { "name": "contact", "type": "Contact", "kind": "relation", "target": "Contact", "target_cart": "crm", "fk_field": "contactId", "relation_kind": "many_to_one" },
46
+ { "name": "title", "type": "string", "optional": true, "kind": "scalar" },
47
+ { "name": "address", "type": "string", "optional": true, "kind": "scalar" },
48
+ { "name": "notes", "type": "string", "optional": true, "kind": "scalar" },
49
+ { "name": "startTime", "type": "DateTime", "kind": "scalar" },
50
+ { "name": "endTime", "type": "DateTime", "kind": "scalar" },
51
+ { "name": "timezone", "type": "string", "optional": true, "kind": "scalar" },
52
+ { "name": "status", "type": "string", "kind": "scalar" },
53
+ { "name": "source", "type": "string", "optional": true, "kind": "scalar" },
54
+ { "name": "assignedUser", "type": "User", "optional": true, "kind": "relation", "target": "User", "target_cart": "auth", "fk_field": "assignedUserId", "relation_kind": "many_to_one" },
55
+ { "name": "isRescheduled", "type": "bool", "kind": "scalar" },
56
+ { "name": "originalStartTime", "type": "DateTime", "optional": true, "kind": "scalar" },
57
+ { "name": "originalEndTime", "type": "DateTime", "optional": true, "kind": "scalar" },
58
+ { "name": "state", "type": "string", "optional": true, "kind": "scalar" },
59
+ { "name": "outcomeClass", "type": "string", "optional": true, "kind": "scalar" },
60
+ { "name": "embedText", "type": "string", "optional": true, "kind": "scalar" }
61
+ ],
62
+ "indices": [["contactId"], ["calendarId"], ["state"], ["outcomeClass"]],
63
+ "searchFields": [],
64
+ "methods": [
65
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "Appointment" } ] },
66
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<Appointment>" } ] },
67
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
68
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "calendarId", "type": "string" }, { "name": "contactId", "type": "string" }, { "name": "startTime", "type": "DateTime" }, { "name": "endTime", "type": "DateTime" }, { "name": "status", "type": "string" }, { "name": "isRescheduled", "type": "bool" }, { "name": "title", "type": "string", "optional": true }, { "name": "address", "type": "string", "optional": true }, { "name": "notes", "type": "string", "optional": true }, { "name": "timezone", "type": "string", "optional": true }, { "name": "source", "type": "string", "optional": true }, { "name": "assignedUserId", "type": "string", "optional": true }, { "name": "originalStartTime", "type": "DateTime", "optional": true }, { "name": "originalEndTime", "type": "DateTime", "optional": true }, { "name": "state", "type": "string", "optional": true }, { "name": "outcomeClass", "type": "string", "optional": true }, { "name": "embedText", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "Appointment" } ] },
69
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "calendarId", "type": "string", "optional": true }, { "name": "contactId", "type": "string", "optional": true }, { "name": "title", "type": "string", "optional": true }, { "name": "address", "type": "string", "optional": true }, { "name": "notes", "type": "string", "optional": true }, { "name": "startTime", "type": "DateTime", "optional": true }, { "name": "endTime", "type": "DateTime", "optional": true }, { "name": "timezone", "type": "string", "optional": true }, { "name": "status", "type": "string", "optional": true }, { "name": "source", "type": "string", "optional": true }, { "name": "assignedUserId", "type": "string", "optional": true }, { "name": "isRescheduled", "type": "bool", "optional": true }, { "name": "originalStartTime", "type": "DateTime", "optional": true }, { "name": "originalEndTime", "type": "DateTime", "optional": true }, { "name": "state", "type": "string", "optional": true }, { "name": "outcomeClass", "type": "string", "optional": true }, { "name": "embedText", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "Appointment" } ] },
70
+ { "name": "find_by_contactId", "inputs": [ { "name": "contactId", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<Appointment>" } ] },
71
+ { "name": "find_by_calendarId", "inputs": [ { "name": "calendarId", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<Appointment>" } ] },
72
+ { "name": "find_by_state", "inputs": [ { "name": "state", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<Appointment>" } ] },
73
+ { "name": "find_by_outcomeClass", "inputs": [ { "name": "outcomeClass", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<Appointment>" } ] }
74
+ ],
75
+ "routes": [
76
+ { "op": "list", "method": "GET", "path": "/api/calendar/appointment" },
77
+ { "op": "create", "method": "POST", "path": "/api/calendar/appointment" },
78
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/calendar/appointment" },
79
+ { "op": "count", "method": "GET", "path": "/api/calendar/appointment/count" },
80
+ { "op": "batch_get", "method": "POST", "path": "/api/calendar/appointment/_batch" },
81
+ { "op": "get", "method": "GET", "path": "/api/calendar/appointment/:id" },
82
+ { "op": "update", "method": "PUT", "path": "/api/calendar/appointment/:id" },
83
+ { "op": "delete", "method": "DELETE", "path": "/api/calendar/appointment/:id" }
84
+ ],
85
+ "exported": true
86
+ },
87
+ "AppointmentParticipant": {
88
+ "fields": [
89
+ { "name": "id", "type": "ULID", "kind": "scalar" },
90
+ { "name": "createdAt", "type": "DateTime", "kind": "scalar" },
91
+ { "name": "updatedAt", "type": "DateTime", "kind": "scalar" },
92
+ { "name": "appointment", "type": "Appointment", "kind": "relation", "target": "Appointment", "target_cart": "calendar", "fk_field": "appointmentId", "relation_kind": "many_to_one" },
93
+ { "name": "user", "type": "User", "kind": "relation", "target": "User", "target_cart": "auth", "fk_field": "userId", "relation_kind": "many_to_one" },
94
+ { "name": "role", "type": "string", "kind": "scalar" },
95
+ { "name": "assignedAt", "type": "DateTime", "kind": "scalar" },
96
+ { "name": "assignedBy", "type": "User", "optional": true, "kind": "relation", "target": "User", "target_cart": "auth", "fk_field": "assignedById", "relation_kind": "many_to_one" },
97
+ { "name": "notes", "type": "string", "optional": true, "kind": "scalar" }
98
+ ],
99
+ "indices": [["appointmentId", "role", "userId"], ["appointmentId"], ["userId", "role"]],
100
+ "searchFields": [],
101
+ "methods": [
102
+ { "name": "find_by_id", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [ { "name": "out", "type": "AppointmentParticipant" } ] },
103
+ { "name": "list", "inputs": [], "outputs": [ { "name": "out", "type": "list<AppointmentParticipant>" } ] },
104
+ { "name": "delete", "inputs": [ { "name": "id", "type": "string" } ], "outputs": [] },
105
+ { "name": "create", "inputs": [{ "name": "id", "type": "ULID" }, { "name": "appointmentId", "type": "string" }, { "name": "userId", "type": "string" }, { "name": "role", "type": "string" }, { "name": "assignedById", "type": "string", "optional": true }, { "name": "notes", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "AppointmentParticipant" } ] },
106
+ { "name": "update", "inputs": [{ "name": "id", "type": "string" }, { "name": "id", "type": "ULID", "optional": true }, { "name": "appointmentId", "type": "string", "optional": true }, { "name": "userId", "type": "string", "optional": true }, { "name": "role", "type": "string", "optional": true }, { "name": "assignedById", "type": "string", "optional": true }, { "name": "notes", "type": "string", "optional": true }], "outputs": [ { "name": "out", "type": "AppointmentParticipant" } ] },
107
+ { "name": "find_by_appointmentId", "inputs": [ { "name": "appointmentId", "type": "string" } ], "outputs": [ { "name": "out", "type": "list<AppointmentParticipant>" } ] }
108
+ ],
109
+ "routes": [
110
+ { "op": "list", "method": "GET", "path": "/api/calendar/appointmentparticipant" },
111
+ { "op": "create", "method": "POST", "path": "/api/calendar/appointmentparticipant" },
112
+ { "op": "delete_by_query", "method": "DELETE", "path": "/api/calendar/appointmentparticipant" },
113
+ { "op": "count", "method": "GET", "path": "/api/calendar/appointmentparticipant/count" },
114
+ { "op": "batch_get", "method": "POST", "path": "/api/calendar/appointmentparticipant/_batch" },
115
+ { "op": "get", "method": "GET", "path": "/api/calendar/appointmentparticipant/:id" },
116
+ { "op": "update", "method": "PUT", "path": "/api/calendar/appointmentparticipant/:id" },
117
+ { "op": "delete", "method": "DELETE", "path": "/api/calendar/appointmentparticipant/:id" }
118
+ ],
119
+ "exported": true
120
+ }
121
+ },
122
+ "structs": [],
123
+ "enums": [],
124
+ "imports": {
125
+ "auth": {
126
+ "entities": ["User"],
127
+ "enums": []
128
+ },
129
+ "crm": {
130
+ "entities": ["Contact"],
131
+ "enums": []
132
+ }
133
+ },
134
+ "actions": [],
135
+ "middleware": [],
136
+ "workflows": [],
137
+ "schedules": [],
138
+ "tasks": [],
139
+ "tools": [],
140
+ "widgets": []
141
+ }