@luvabase/sdk 0.0.4 → 0.0.6
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 +22 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest-schema.json +108 -0
- package/package.json +5 -1
- package/src/manifestSchema.ts +2 -1
- package/examples/minimal/app.lumo +0 -0
- package/examples/minimal/index.js +0 -11
- package/examples/minimal/luva.jsonc +0 -6
- package/examples/minimal/package-lock.json +0 -1547
- package/examples/minimal/package.json +0 -13
- package/examples/minimal/public/icon.png +0 -0
- package/examples/minimal/wrangler.jsonc +0 -6
- package/examples/snake/icon.png +0 -0
- package/examples/snake/lumobase.jsonc +0 -11
- package/examples/snake/package-lock.json +0 -1016
- package/examples/snake/package.json +0 -15
- package/examples/snake/public/index.html +0 -602
- package/examples/snake/snake.lumo +0 -0
- package/tsconfig.json +0 -10
- package/tsdown.config.ts +0 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luvabase, https://github.com/luvabase/luvabase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare function parseEnv(env: Record<string, unknown>): {
|
|
3
|
+
podId: string;
|
|
4
|
+
appVersion: string;
|
|
5
|
+
installedAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
services: Record<string, {
|
|
8
|
+
type: "turso";
|
|
9
|
+
name: string;
|
|
10
|
+
databaseName: string;
|
|
11
|
+
databaseApiToken: string;
|
|
12
|
+
databaseHostname: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { parseEnv };
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";iBAEgB,QAAA,CAAS,GAAA,EAAK,MAAA;;;;;YAAA,MAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/envSchema.ts
|
|
4
|
+
const LuvaEnv = z.lazy(() => z.object({
|
|
5
|
+
podId: z.string().describe("The id of the pod"),
|
|
6
|
+
appVersion: z.string(),
|
|
7
|
+
installedAt: z.string(),
|
|
8
|
+
updatedAt: z.string(),
|
|
9
|
+
services: z.record(z.string(), RuntimeService)
|
|
10
|
+
}));
|
|
11
|
+
const TursoRuntimeService = z.object({
|
|
12
|
+
type: z.literal("turso"),
|
|
13
|
+
name: z.string(),
|
|
14
|
+
databaseName: z.string(),
|
|
15
|
+
databaseApiToken: z.string(),
|
|
16
|
+
databaseHostname: z.string()
|
|
17
|
+
});
|
|
18
|
+
const RuntimeService = z.union([TursoRuntimeService]);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/index.ts
|
|
22
|
+
function parseEnv(env) {
|
|
23
|
+
return LuvaEnv.parse(env);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { parseEnv };
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/envSchema.ts","../src/index.ts"],"sourcesContent":["import { z } from \"zod\"\n\nexport type LuvaEnvType = z.infer<typeof LuvaEnv>\nexport const LuvaEnv = z.lazy(() =>\n z.object({\n podId: z.string().describe(\"The id of the pod\"),\n appVersion: z.string(),\n installedAt: z.string(),\n updatedAt: z.string(),\n services: z.record(z.string(), RuntimeService),\n }),\n)\n\nconst TursoRuntimeService = z.object({\n type: z.literal(\"turso\"),\n name: z.string(),\n databaseName: z.string(),\n databaseApiToken: z.string(),\n databaseHostname: z.string(),\n})\n\nconst RuntimeService = z.union([TursoRuntimeService])\n","import { LuvaEnv } from \"./envSchema\"\n\nexport function parseEnv(env: Record<string, unknown>) {\n const luvabaseEnv = LuvaEnv.parse(env)\n return luvabaseEnv\n}\n"],"mappings":";;;AAGA,MAAa,UAAU,EAAE,WACvB,EAAE,OAAO;CACP,OAAO,EAAE,QAAQ,CAAC,SAAS,oBAAoB;CAC/C,YAAY,EAAE,QAAQ;CACtB,aAAa,EAAE,QAAQ;CACvB,WAAW,EAAE,QAAQ;CACrB,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe;CAC/C,CAAC,CACH;AAED,MAAM,sBAAsB,EAAE,OAAO;CACnC,MAAM,EAAE,QAAQ,QAAQ;CACxB,MAAM,EAAE,QAAQ;CAChB,cAAc,EAAE,QAAQ;CACxB,kBAAkB,EAAE,QAAQ;CAC5B,kBAAkB,EAAE,QAAQ;CAC7B,CAAC;AAEF,MAAM,iBAAiB,EAAE,MAAM,CAAC,oBAAoB,CAAC;;;;ACnBrD,SAAgB,SAAS,KAA8B;AAErD,QADoB,QAAQ,MAAM,IAAI"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"identifier": {
|
|
6
|
+
"description": "Globally unique url safe and lowercased identifier for the app e.g. 'luvabase-snake' (required for Luvabase submissions)",
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 3,
|
|
9
|
+
"maxLength": 50,
|
|
10
|
+
"pattern": "^[a-z0-9-]+$"
|
|
11
|
+
},
|
|
12
|
+
"name": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 3,
|
|
15
|
+
"maxLength": 30,
|
|
16
|
+
"description": "Name of the app e.g. 'Snake' (max 30 characters)"
|
|
17
|
+
},
|
|
18
|
+
"subtitle": {
|
|
19
|
+
"description": "Subtitle of the app e.g. 'Play the classic of classics' (max 50 characters)",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"minLength": 3,
|
|
22
|
+
"maxLength": 50
|
|
23
|
+
},
|
|
24
|
+
"description": {
|
|
25
|
+
"description": "Full description of the app",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"maxLength": 10000
|
|
28
|
+
},
|
|
29
|
+
"screenshots": {
|
|
30
|
+
"description": "Relative paths of app screenshots e.g. ['images/screenshot1.png', 'images/screenshot2.png']",
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"category": {
|
|
37
|
+
"description": "Could be 'productivity', 'health', etc (must be one of the standard categories listed here https://github.com/w3c/manifest/wiki/Categories)",
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
40
|
+
"icon": {
|
|
41
|
+
"description": "Relative path of the app icon inside the .luva app file e.g. 'images/icon.png'",
|
|
42
|
+
"type": "string"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"description": "URL of the source code repository e.g. 'https://github.com/luvabase/snake'",
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"services": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"type": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"enum": [
|
|
56
|
+
"turso"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"name": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"required": [
|
|
64
|
+
"type",
|
|
65
|
+
"name"
|
|
66
|
+
],
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"relatedApps": {
|
|
71
|
+
"type": "array",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"properties": {
|
|
75
|
+
"type": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"enum": [
|
|
78
|
+
"android",
|
|
79
|
+
"ios"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"identifier": {
|
|
83
|
+
"type": "string"
|
|
84
|
+
},
|
|
85
|
+
"downloadLink": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"redirectUrls": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"items": {
|
|
91
|
+
"type": "string"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": [
|
|
96
|
+
"type",
|
|
97
|
+
"identifier",
|
|
98
|
+
"redirectUrls"
|
|
99
|
+
],
|
|
100
|
+
"additionalProperties": false
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": [
|
|
105
|
+
"name"
|
|
106
|
+
],
|
|
107
|
+
"additionalProperties": false
|
|
108
|
+
}
|
package/package.json
CHANGED
package/src/manifestSchema.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { z } from "zod"
|
|
|
3
3
|
export type AppManifest = z.infer<typeof AppManifest>
|
|
4
4
|
export const AppManifest = z.lazy(() =>
|
|
5
5
|
z.object({
|
|
6
|
+
$schema: z.string().optional().describe("JSON Schema for the manifest"),
|
|
6
7
|
identifier: z
|
|
7
8
|
.string()
|
|
8
9
|
.regex(/^[a-z0-9-]+$/)
|
|
@@ -57,7 +58,7 @@ export const AppManifest = z.lazy(() =>
|
|
|
57
58
|
services: z
|
|
58
59
|
.array(
|
|
59
60
|
z.object({
|
|
60
|
-
type: z.enum(["turso"]),
|
|
61
|
+
type: z.enum(["turso", "cloudflare-kv"]),
|
|
61
62
|
name: z.string(),
|
|
62
63
|
}),
|
|
63
64
|
)
|
|
Binary file
|