@kmlckj/licos-platform-sdk 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -41
- package/package.json +2 -2
- package/src/database.js +684 -251
- package/src/index.d.ts +251 -208
- package/src/runtime.js +81 -7
- package/src/storage.js +3 -3
package/README.md
CHANGED
|
@@ -1,47 +1,58 @@
|
|
|
1
|
-
# @kmlckj/licos-platform-sdk
|
|
2
|
-
|
|
3
|
-
LICOS platform SDK for server-side project runtime code.
|
|
4
|
-
|
|
5
|
-
## Runtime Configuration
|
|
6
|
-
|
|
7
|
-
Server-side helpers call platform Studio runtime APIs. Project code does not
|
|
1
|
+
# @kmlckj/licos-platform-sdk
|
|
2
|
+
|
|
3
|
+
LICOS platform SDK for server-side project runtime code.
|
|
4
|
+
|
|
5
|
+
## Runtime Configuration
|
|
6
|
+
|
|
7
|
+
Server-side helpers call platform Studio runtime APIs. Project code does not
|
|
8
8
|
pass API base URLs, project IDs, tokens, or environment scopes. The SDK loads
|
|
9
|
-
|
|
9
|
+
identity from runtime environment variables injected by LICOS. Authentication
|
|
10
|
+
is resolved automatically by the runtime:
|
|
10
11
|
|
|
11
12
|
- `LICOS_PLATFORM_API_BASE_URL`
|
|
12
|
-
- `LICOS_RUNTIME_TOKEN` or `LICOS_USER_TOKEN`
|
|
13
13
|
- `LICOS_PROJECT_ID` or `AGENT_PROJECT_ID`
|
|
14
14
|
- `LICOS_WORKSPACE_ID` or `AGENT_WORKSPACE_ID`
|
|
15
|
+
- `LICOS_USER_ID` or `AGENT_USER_ID`
|
|
15
16
|
- `LICOS_PROJECT_ENV`, mapped internally to `dev` or `prod`
|
|
16
|
-
|
|
17
|
-
## Database
|
|
18
|
-
|
|
19
|
-
Database helpers call the runtime database data plane only.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
.
|
|
28
|
-
.
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
17
|
+
|
|
18
|
+
## Database
|
|
19
|
+
|
|
20
|
+
Database CRUD helpers call the runtime database data plane only. Tooling helpers
|
|
21
|
+
can fetch platform schema metadata for ORM export. The SDK does not expose
|
|
22
|
+
service deletion APIs.
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { database } from '@kmlckj/licos-platform-sdk';
|
|
26
|
+
|
|
27
|
+
const rows = await database
|
|
28
|
+
.table('todos')
|
|
29
|
+
.select('id', 'title')
|
|
30
|
+
.eq('done', false)
|
|
31
|
+
.order('created_at', { desc: true })
|
|
32
|
+
.limit(10)
|
|
33
|
+
.execute();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
ORM export is a tooling helper. It fetches platform schema metadata and returns
|
|
37
|
+
source text; it does not use direct database credentials.
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import { database } from '@kmlckj/licos-platform-sdk';
|
|
41
|
+
|
|
42
|
+
const source = await database.exportOrm({ language: 'typescript', orm: 'drizzle' });
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Object Storage
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
import { storage } from '@kmlckj/licos-platform-sdk';
|
|
49
|
+
|
|
50
|
+
await storage.createFolder('reports');
|
|
51
|
+
const file = await storage.uploadFile('/tmp/report.pdf');
|
|
52
|
+
const link = await storage.shareUrl(file.id);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`uploadFile` limits each file to 20 MiB.
|
|
56
|
+
|
|
57
|
+
The browser entry does not export object storage helpers because runtime tokens
|
|
58
|
+
must not be bundled into public frontend code.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmlckj/licos-platform-sdk",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "LICOS platform SDK package shell for browser and Node runtimes",
|
|
3
|
+
"version": "0.6.5",
|
|
4
|
+
"description": "LICOS platform SDK package shell for browser and Node runtimes",
|
|
5
5
|
"author": "kmlckj",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./src/index.js",
|