@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 CHANGED
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  buildServer,
4
4
  buildWorker
5
- } from "../chunks/TXLTJKEX.js";
6
- import "../chunks/VMIIUPHE.js";
5
+ } from "../chunks/V7ENYEWD.js";
6
+ import "../chunks/WKI563UT.js";
7
7
 
8
8
  // src/build/cli.ts
9
9
  import { mkdirSync, rmSync, writeFileSync } from "node:fs";
@@ -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 {};
@@ -3,8 +3,8 @@ import {
3
3
  buildWorker,
4
4
  sqlAsText,
5
5
  teable
6
- } from "../chunks/TXLTJKEX.js";
7
- import "../chunks/VMIIUPHE.js";
6
+ } from "../chunks/V7ENYEWD.js";
7
+ import "../chunks/WKI563UT.js";
8
8
  export {
9
9
  buildServer,
10
10
  buildWorker,
@@ -4,7 +4,7 @@ import {
4
4
  FILE_NAME_HEADER,
5
5
  SESSION_PATH,
6
6
  fileKeyPath
7
- } from "./VMIIUPHE.js";
7
+ } from "./WKI563UT.js";
8
8
 
9
9
  // src/client.ts
10
10
  var MethodError = class extends Error {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  describeTables
3
- } from "./FBIHOTDB.js";
3
+ } from "./NOOZYN7X.js";
4
4
  import {
5
5
  CAPABILITIES,
6
6
  PROTOCOL_VERSION,
7
7
  admit,
8
8
  isPageAccess
9
- } from "./VMIIUPHE.js";
9
+ } from "./WKI563UT.js";
10
10
 
11
11
  // src/server/errors.ts
12
12
  import { z } from "zod";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_CURRENCY,
3
3
  currencyDigits
4
- } from "./VMIIUPHE.js";
4
+ } from "./WKI563UT.js";
5
5
 
6
6
  // src/schema.ts
7
7
  import { getTableColumns, getTableName, is } from "drizzle-orm";
@@ -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 "./VMIIUPHE.js";
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
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MethodError,
3
3
  createClient
4
- } from "./chunks/YGOAZOUE.js";
5
- import "./chunks/VMIIUPHE.js";
4
+ } from "./chunks/A27ZPYPU.js";
5
+ import "./chunks/WKI563UT.js";
6
6
  export {
7
7
  MethodError,
8
8
  createClient
package/dist/dev/host.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  callableMethods,
11
11
  checkAccess,
12
12
  isMember
13
- } from "../chunks/VMIIUPHE.js";
13
+ } from "../chunks/WKI563UT.js";
14
14
 
15
15
  // src/dev/host.ts
16
16
  import { DurableObject, WorkerEntrypoint } from "cloudflare:workers";
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createApp,
3
3
  fail
4
- } from "./chunks/SQSAV7KS.js";
5
- import "./chunks/FBIHOTDB.js";
6
- import "./chunks/VMIIUPHE.js";
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";
@@ -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: the column a value is read from, and the
320
- * table a write edits. The host passes schemas through and reads neither,
321
- * so they are not part of the host ↔ app contract above: an app built
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 read from a column (`schemaOf`): that column, by its SQLite
327
- * names, as `x-teable-references` names the column a reference points at.
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/VMIIUPHE.js";
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
@@ -3,8 +3,8 @@ import {
3
3
  col,
4
4
  describeTables,
5
5
  schemaOf
6
- } from "./chunks/FBIHOTDB.js";
7
- import "./chunks/VMIIUPHE.js";
6
+ } from "./chunks/NOOZYN7X.js";
7
+ import "./chunks/WKI563UT.js";
8
8
  export {
9
9
  attachment,
10
10
  col,
package/dist/testing.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  methodName
3
- } from "./chunks/SQSAV7KS.js";
4
- import "./chunks/FBIHOTDB.js";
3
+ } from "./chunks/APGIRZ24.js";
4
+ import "./chunks/NOOZYN7X.js";
5
5
  import {
6
6
  MethodError
7
- } from "./chunks/YGOAZOUE.js";
7
+ } from "./chunks/A27ZPYPU.js";
8
8
  import {
9
9
  ERROR_STATUS
10
- } from "./chunks/VMIIUPHE.js";
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
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  MethodError
3
- } from "./chunks/YGOAZOUE.js";
3
+ } from "./chunks/A27ZPYPU.js";
4
4
  import {
5
5
  ERROR_STATUS
6
- } from "./chunks/VMIIUPHE.js";
6
+ } from "./chunks/WKI563UT.js";
7
7
 
8
8
  // src/worker.ts
9
9
  function thrower(caller) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teable/app",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "Write a Teable app as a Drizzle schema plus methods",
5
5
  "license": "MIT",
6
6
  "repository": {