@teable/app 6.1.0 → 6.1.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/dist/build/cli.js +2 -2
- package/dist/build/index.d.ts +9 -0
- package/dist/build/index.js +2 -2
- package/dist/chunks/{YGOAZOUE.js → A27ZPYPU.js} +1 -1
- package/dist/chunks/{SQSAV7KS.js → APGIRZ24.js} +2 -2
- package/dist/chunks/{FBIHOTDB.js → NOOZYN7X.js} +1 -1
- package/dist/chunks/{TXLTJKEX.js → V7ENYEWD.js} +6 -1
- package/dist/chunks/{VMIIUPHE.js → WKI563UT.js} +2 -0
- package/dist/client.js +2 -2
- package/dist/dev/host.js +1 -1
- package/dist/index.js +3 -3
- package/dist/protocol.d.ts +14 -6
- package/dist/protocol.js +3 -1
- package/dist/schema.d.ts +4 -1
- package/dist/schema.js +2 -2
- package/dist/testing.js +4 -4
- package/dist/worker.js +2 -2
- package/package.json +1 -1
package/dist/build/cli.js
CHANGED
package/dist/build/index.d.ts
CHANGED
|
@@ -131,6 +131,15 @@ export declare function teable(options?: TeableOptions): {
|
|
|
131
131
|
};
|
|
132
132
|
};
|
|
133
133
|
}>;
|
|
134
|
+
/** The pages name the app they are built for: a deploy to another app refuses them. */
|
|
135
|
+
transformIndexHtml(): {
|
|
136
|
+
tag: string;
|
|
137
|
+
attrs: {
|
|
138
|
+
name: string;
|
|
139
|
+
content: string;
|
|
140
|
+
};
|
|
141
|
+
injectTo: string;
|
|
142
|
+
}[];
|
|
134
143
|
configureServer(server: DevServer): (() => void) | undefined;
|
|
135
144
|
};
|
|
136
145
|
export {};
|
package/dist/build/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
describeTables
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./NOOZYN7X.js";
|
|
4
4
|
import {
|
|
5
5
|
CAPABILITIES,
|
|
6
6
|
PROTOCOL_VERSION,
|
|
7
7
|
admit,
|
|
8
8
|
isPageAccess
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./WKI563UT.js";
|
|
10
10
|
|
|
11
11
|
// src/server/errors.ts
|
|
12
12
|
import { z } from "zod";
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
APP_COMPATIBILITY_DATE,
|
|
4
4
|
ASSETS_HEADER,
|
|
5
5
|
DEV_PATHS,
|
|
6
|
+
PAGES_APP_META,
|
|
6
7
|
SESSION_PATH,
|
|
7
8
|
checkAccess
|
|
8
|
-
} from "./
|
|
9
|
+
} from "./WKI563UT.js";
|
|
9
10
|
|
|
10
11
|
// src/build/index.ts
|
|
11
12
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -178,6 +179,10 @@ function teable(options = {}) {
|
|
|
178
179
|
server: { proxy: { [APPS_PATH]: proxy, ...remote ? {} : { [SESSION_PATH]: proxy } } }
|
|
179
180
|
};
|
|
180
181
|
},
|
|
182
|
+
/** The pages name the app they are built for: a deploy to another app refuses them. */
|
|
183
|
+
transformIndexHtml() {
|
|
184
|
+
return [{ tag: "meta", attrs: { name: PAGES_APP_META, content: appId }, injectTo: "head" }];
|
|
185
|
+
},
|
|
181
186
|
configureServer(server) {
|
|
182
187
|
if (!workerd && !options.remote) return;
|
|
183
188
|
if (options.remote) {
|
|
@@ -77,6 +77,7 @@ function fileKeyPath(key) {
|
|
|
77
77
|
}
|
|
78
78
|
var DEPLOY_HEADERS = { commit: "X-Teable-Commit", message: "X-Teable-Message" };
|
|
79
79
|
var DEPLOY_PARTS = { server: "server", worker: "worker", pages: "pages" };
|
|
80
|
+
var PAGES_APP_META = "teable-app";
|
|
80
81
|
function checkAccess(caller, access) {
|
|
81
82
|
if (caller.kind === "system") return null;
|
|
82
83
|
if (access === "internal") return "FORBIDDEN";
|
|
@@ -124,6 +125,7 @@ export {
|
|
|
124
125
|
fileKeyPath,
|
|
125
126
|
DEPLOY_HEADERS,
|
|
126
127
|
DEPLOY_PARTS,
|
|
128
|
+
PAGES_APP_META,
|
|
127
129
|
checkAccess,
|
|
128
130
|
admit,
|
|
129
131
|
isMember,
|
package/dist/client.js
CHANGED
package/dist/dev/host.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createApp,
|
|
3
3
|
fail
|
|
4
|
-
} from "./chunks/
|
|
5
|
-
import "./chunks/
|
|
6
|
-
import "./chunks/
|
|
4
|
+
} from "./chunks/APGIRZ24.js";
|
|
5
|
+
import "./chunks/NOOZYN7X.js";
|
|
6
|
+
import "./chunks/WKI563UT.js";
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
import { z } from "zod";
|
package/dist/protocol.d.ts
CHANGED
|
@@ -316,15 +316,17 @@ export type Result<T> = {
|
|
|
316
316
|
};
|
|
317
317
|
/**
|
|
318
318
|
* What methods' JSON Schemas tell the builder beside `KindKeywords`, so its
|
|
319
|
-
* Data view edits rows in place
|
|
320
|
-
* table a write edits. The host passes schemas through and
|
|
321
|
-
* so they are not part of the host ↔ app contract above: an
|
|
322
|
-
* without them shows its rows read-only.
|
|
319
|
+
* Data view edits rows in place and starts writes from a row: the column a
|
|
320
|
+
* value is, and the table a write edits. The host passes schemas through and
|
|
321
|
+
* reads neither, so they are not part of the host ↔ app contract above: an
|
|
322
|
+
* app built without them shows its rows read-only, with no row actions.
|
|
323
323
|
*/
|
|
324
324
|
export interface EditKeywords {
|
|
325
325
|
/**
|
|
326
|
-
* On a value
|
|
327
|
-
*
|
|
326
|
+
* On a value of a column (`schemaOf`): that column, by its SQLite names, as
|
|
327
|
+
* `x-teable-references` names the column a reference points at. In an
|
|
328
|
+
* output, the column the value is read from; in an input, the column it
|
|
329
|
+
* names a row by (its table's primary key) or is written to.
|
|
328
330
|
*/
|
|
329
331
|
"x-teable-column": {
|
|
330
332
|
table: string;
|
|
@@ -474,6 +476,12 @@ export declare const DEPLOY_PARTS: {
|
|
|
474
476
|
readonly worker: "worker";
|
|
475
477
|
readonly pages: "pages";
|
|
476
478
|
};
|
|
479
|
+
/**
|
|
480
|
+
* The `<meta>` name under which an app's built `index.html` names the app it
|
|
481
|
+
* was built for, as `teable()` writes it. A deploy refuses pages built for
|
|
482
|
+
* another app: they would call that app's API, not this one's.
|
|
483
|
+
*/
|
|
484
|
+
export declare const PAGES_APP_META = "teable-app";
|
|
477
485
|
/**
|
|
478
486
|
* `POST {APPS_PATH}/:appId/rollback` with `{ "to": <version> }` deploys that
|
|
479
487
|
* version's bundle again, as a new version. Its answer (201) is a deploy's,
|
package/dist/protocol.js
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
ERROR_CODES,
|
|
11
11
|
ERROR_STATUS,
|
|
12
12
|
FILE_NAME_HEADER,
|
|
13
|
+
PAGES_APP_META,
|
|
13
14
|
PROTOCOL_VERSION,
|
|
14
15
|
SESSION_PATH,
|
|
15
16
|
SPACE_ROLES,
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
isExposed,
|
|
22
23
|
isMember,
|
|
23
24
|
isPageAccess
|
|
24
|
-
} from "./chunks/
|
|
25
|
+
} from "./chunks/WKI563UT.js";
|
|
25
26
|
export {
|
|
26
27
|
APPS_PATH,
|
|
27
28
|
APP_COMPATIBILITY_DATE,
|
|
@@ -34,6 +35,7 @@ export {
|
|
|
34
35
|
ERROR_CODES,
|
|
35
36
|
ERROR_STATUS,
|
|
36
37
|
FILE_NAME_HEADER,
|
|
38
|
+
PAGES_APP_META,
|
|
37
39
|
PROTOCOL_VERSION,
|
|
38
40
|
SESSION_PATH,
|
|
39
41
|
SPACE_ROLES,
|
package/dist/schema.d.ts
CHANGED
|
@@ -35,10 +35,13 @@ type RowShape<T extends SQLiteTable> = {
|
|
|
35
35
|
* kind into the JSON Schema callers see (`KindKeywords`), so they tell money
|
|
36
36
|
* from a plain number, and know its currency, and names the column
|
|
37
37
|
* (`EditKeywords`), so the builder can edit a row it shows with the write
|
|
38
|
-
* that edits its table. Given a table, its rows.
|
|
38
|
+
* that edits its table. Given a table, its rows. In an input, a table's key
|
|
39
|
+
* names the row a write acts on, and the builder starts the write from that
|
|
40
|
+
* row.
|
|
39
41
|
*
|
|
40
42
|
* output: z.array(schemaOf(skus)),
|
|
41
43
|
* output: z.object({ orders: z.number().int(), revenue: schemaOf(orders.amount) }),
|
|
44
|
+
* input: z.object({ orderId: schemaOf(orders.id) }),
|
|
42
45
|
*/
|
|
43
46
|
export declare function schemaOf<T extends SQLiteTable>(table: T): z.ZodObject<RowShape<T>>;
|
|
44
47
|
export declare function schemaOf<C extends SQLiteColumn>(column: C): z.ZodType<ValueOf<C>, ValueOf<C>>;
|
package/dist/schema.js
CHANGED
package/dist/testing.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
methodName
|
|
3
|
-
} from "./chunks/
|
|
4
|
-
import "./chunks/
|
|
3
|
+
} from "./chunks/APGIRZ24.js";
|
|
4
|
+
import "./chunks/NOOZYN7X.js";
|
|
5
5
|
import {
|
|
6
6
|
MethodError
|
|
7
|
-
} from "./chunks/
|
|
7
|
+
} from "./chunks/A27ZPYPU.js";
|
|
8
8
|
import {
|
|
9
9
|
ERROR_STATUS
|
|
10
|
-
} from "./chunks/
|
|
10
|
+
} from "./chunks/WKI563UT.js";
|
|
11
11
|
|
|
12
12
|
// src/testing.ts
|
|
13
13
|
var OWNER = { kind: "user", userId: "test-owner", role: "owner", via: "api" };
|
package/dist/worker.js
CHANGED