@stardeck-customer-apps/data-store-sdk 0.1.0-preview.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.
@@ -0,0 +1,68 @@
1
+ interface DataStoreClientConfig {
2
+ /** Stardeck platform API base URL (default: CONTROL_PLANE_URL env var) */
3
+ baseUrl?: string;
4
+ storeId: string;
5
+ /** HMAC signing secret (default: DEPLOYMENT_SECRET env var) */
6
+ deploymentSecret?: string;
7
+ organizationId?: string;
8
+ projectId?: string;
9
+ deploymentId?: string;
10
+ maxRetries?: number;
11
+ debug?: boolean;
12
+ }
13
+ interface ColumnDefinition {
14
+ name: string;
15
+ fieldType: string;
16
+ nullable?: boolean;
17
+ displayName?: string;
18
+ config?: Record<string, unknown>;
19
+ }
20
+ interface TableColumn {
21
+ columnName: string;
22
+ dataType: string;
23
+ isNullable: boolean;
24
+ columnDefault: string | null;
25
+ isPrimaryKey: boolean;
26
+ displayName?: string;
27
+ fieldType?: string;
28
+ fieldConfig?: Record<string, unknown> | null;
29
+ position?: number;
30
+ }
31
+ interface TableSchema {
32
+ tableName: string;
33
+ columns: TableColumn[];
34
+ }
35
+ type FilterOperator = "eq" | "neq" | "contains" | "gt" | "lt" | "is_null" | "is_not_null";
36
+ interface QueryFilter {
37
+ column: string;
38
+ operator: FilterOperator;
39
+ value?: unknown;
40
+ }
41
+ interface QueryOptions {
42
+ filters?: QueryFilter[];
43
+ orderBy?: string;
44
+ orderDir?: "asc" | "desc";
45
+ limit?: number;
46
+ offset?: number;
47
+ }
48
+ interface QueryResult {
49
+ rows: Record<string, unknown>[];
50
+ columns: string[];
51
+ total: number;
52
+ limit: number;
53
+ offset: number;
54
+ }
55
+ interface StorageObject {
56
+ key: string;
57
+ size: number;
58
+ lastModified: string;
59
+ contentType?: string;
60
+ }
61
+ interface ListObjectsResult {
62
+ objects: StorageObject[];
63
+ folders: string[];
64
+ cursor?: string;
65
+ hasMore: boolean;
66
+ }
67
+
68
+ export type { ColumnDefinition as C, DataStoreClientConfig as D, FilterOperator as F, ListObjectsResult as L, QueryFilter as Q, StorageObject as S, TableColumn as T, TableSchema as a, QueryOptions as b, QueryResult as c };
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@stardeck-customer-apps/data-store-sdk",
3
+ "version": "0.1.0-preview.0",
4
+ "description": "SDK for accessing Stardeck data stores from deployed projects",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "publishConfig": {
9
+ "registry": "https://registry.npmjs.org/",
10
+ "access": "public"
11
+ },
12
+ "bin": {
13
+ "stardeck-data-store": "./dist/cli/generate-types.js"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.mjs",
22
+ "require": "./dist/index.js",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./server": {
26
+ "types": "./dist/server/index.d.ts",
27
+ "import": "./dist/server/index.mjs",
28
+ "require": "./dist/server/index.js",
29
+ "default": "./dist/server/index.js"
30
+ }
31
+ },
32
+ "scripts": {
33
+ "build": "tsup src/index.ts src/server/index.ts src/cli/generate-types.ts --format cjs,esm --dts",
34
+ "dev": "tsup src/index.ts src/server/index.ts src/cli/generate-types.ts --format cjs,esm --dts --watch",
35
+ "format": "prettier --write . && eslint . --fix",
36
+ "typecheck": "tsc --noEmit",
37
+ "lint": "eslint src/",
38
+ "test": "vitest run",
39
+ "test:watch": "vitest"
40
+ },
41
+ "dependencies": {
42
+ "kysely": "^0.27.0"
43
+ },
44
+ "peerDependencies": {
45
+ "@neondatabase/serverless": ">=0.9.0",
46
+ "kysely-neon": ">=2.0.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "@neondatabase/serverless": {
50
+ "optional": true
51
+ },
52
+ "kysely-neon": {
53
+ "optional": true
54
+ }
55
+ },
56
+ "devDependencies": {
57
+ "@neondatabase/serverless": "^0.10.0",
58
+ "kysely-neon": "^2.0.0",
59
+ "@stardeck-customer-apps/tsconfig": "*",
60
+ "@types/node": "^24.10.1",
61
+ "tsup": "^8.0.0",
62
+ "typescript": "^5.0.0",
63
+ "vitest": "^3.2.4"
64
+ }
65
+ }