@teable/app 7.0.5 → 7.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/dist/build/cli.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  buildServer,
4
4
  buildWorker
5
- } from "../chunks/UDRXJPLD.js";
6
- import "../chunks/N6PYNICH.js";
5
+ } from "../chunks/AZZIO5NR.js";
6
+ import "../chunks/ZKTI2IGQ.js";
7
7
 
8
8
  // src/build/cli.ts
9
9
  import { mkdirSync, rmSync, writeFileSync } from "node:fs";
@@ -3,8 +3,8 @@ import {
3
3
  buildWorker,
4
4
  sqlAsText,
5
5
  teable
6
- } from "../chunks/UDRXJPLD.js";
7
- import "../chunks/N6PYNICH.js";
6
+ } from "../chunks/AZZIO5NR.js";
7
+ import "../chunks/ZKTI2IGQ.js";
8
8
  export {
9
9
  buildServer,
10
10
  buildWorker,
@@ -10,7 +10,7 @@ import {
10
10
  isMember,
11
11
  pagesBridge,
12
12
  spaceRoleOf
13
- } from "./N6PYNICH.js";
13
+ } from "./ZKTI2IGQ.js";
14
14
 
15
15
  // src/build/index.ts
16
16
  import { existsSync, readFileSync } from "node:fs";
@@ -5,7 +5,7 @@ import {
5
5
  PREVIEW_QUERY,
6
6
  SESSION_PATH,
7
7
  fileKeyPath
8
- } from "./N6PYNICH.js";
8
+ } from "./ZKTI2IGQ.js";
9
9
 
10
10
  // src/client.ts
11
11
  var MethodError = class extends Error {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  describeTables
3
- } from "./QNWCYG6K.js";
3
+ } from "./YVAP26TZ.js";
4
4
  import {
5
5
  CAPABILITIES,
6
6
  PROTOCOL_VERSION,
7
7
  admit,
8
8
  isPageAccess
9
- } from "./N6PYNICH.js";
9
+ } from "./ZKTI2IGQ.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 "./N6PYNICH.js";
4
+ } from "./ZKTI2IGQ.js";
5
5
 
6
6
  // src/schema.ts
7
7
  import { getTableColumns, getTableName, is } from "drizzle-orm";
@@ -271,6 +271,11 @@ function fileKeyPath(key) {
271
271
  var DEPLOY_HEADERS = { commit: "X-Teable-Commit", message: "X-Teable-Message" };
272
272
  var DEPLOY_PARTS = { server: "server", worker: "worker", pages: "pages" };
273
273
  var PAGES_APP_META = "teable-app";
274
+ var SECRET_FILE_PREFIXES = [".env", ".dev.vars"];
275
+ function isSecretFile(path) {
276
+ const name = path.slice(path.lastIndexOf("/") + 1);
277
+ return SECRET_FILE_PREFIXES.some((prefix) => name.startsWith(prefix));
278
+ }
274
279
  var DOMAIN_NAME = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
275
280
  function normalizeDomain(input) {
276
281
  return input.trim().toLowerCase().replace(/^https?:\/\//, "").replace(/\/+$/, "").replace(/\.$/, "");
@@ -363,6 +368,8 @@ export {
363
368
  DEPLOY_HEADERS,
364
369
  DEPLOY_PARTS,
365
370
  PAGES_APP_META,
371
+ SECRET_FILE_PREFIXES,
372
+ isSecretFile,
366
373
  normalizeDomain,
367
374
  isDomainName,
368
375
  BADGE_RULES,
package/dist/client.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MethodError,
3
3
  createClient
4
- } from "./chunks/OXDV76VZ.js";
5
- import "./chunks/N6PYNICH.js";
4
+ } from "./chunks/KWMJ6RAV.js";
5
+ import "./chunks/ZKTI2IGQ.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/N6PYNICH.js";
13
+ } from "../chunks/ZKTI2IGQ.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/QHPLAVFD.js";
5
- import "./chunks/QNWCYG6K.js";
6
- import "./chunks/N6PYNICH.js";
4
+ } from "./chunks/OTMVSMPE.js";
5
+ import "./chunks/YVAP26TZ.js";
6
+ import "./chunks/ZKTI2IGQ.js";
7
7
 
8
8
  // src/index.ts
9
9
  import { z } from "zod";
@@ -701,6 +701,50 @@ export interface VersionInfo {
701
701
  /** Whether it is the version that serves the app now. */
702
702
  live: boolean;
703
703
  }
704
+ /**
705
+ * An app's code is a git repository (ADR 0029): one in Cloudflare
706
+ * Artifacts, named after the app, which the runtime keeps. Those who may
707
+ * publish the app ask for credentials to it with `POST
708
+ * {APPS_PATH}/:appId/git/credentials` and `{ "ops": GitOps }`; git sends the
709
+ * token as `Authorization: Bearer <token>`.
710
+ */
711
+ export type GitOps = "fetch" | "push";
712
+ export interface GitCredentials {
713
+ /** The repository's HTTPS address. */
714
+ gitUrl: string;
715
+ /** Secret: for git's header only, never stored or shown. */
716
+ token: string;
717
+ /** When the token stops working (ISO 8601). */
718
+ expiresAt: string;
719
+ /** What it allows: fetching, or fetching and pushing. */
720
+ ops: GitOps[];
721
+ }
722
+ /**
723
+ * What the app's repository holds on `main`, as `GET
724
+ * {APPS_PATH}/:appId/code` answers those who may publish the app.
725
+ */
726
+ export interface AppCode {
727
+ /** `main`'s commit; null while nothing has been pushed. */
728
+ commit: string | null;
729
+ /** Every file but secret files (`isSecretFile`), by path. */
730
+ files: AppCodeFile[];
731
+ }
732
+ export interface AppCodeFile {
733
+ /** From the repository's root, separated by `/`. */
734
+ path: string;
735
+ /** In bytes. */
736
+ size: number;
737
+ /** The file as text; null for a binary file, or one too large to show. */
738
+ content: string | null;
739
+ }
740
+ /**
741
+ * Where secrets are kept, by how a file's name starts, anywhere in the tree:
742
+ * env files and wrangler's `.dev.vars`. Their values stay out of an app's
743
+ * repository: the CLI refuses to push one, and its code is never shown with one.
744
+ */
745
+ export declare const SECRET_FILE_PREFIXES: readonly [".env", ".dev.vars"];
746
+ /** Whether the file at `path` (separated by `/`) is where secrets are kept. */
747
+ export declare function isSecretFile(path: string): boolean;
704
748
  /**
705
749
  * A failure of the app's own, as `GET {APPS_PATH}/:appId/failures` lists
706
750
  * them for its creators: what broke in it lately, each failure once, with
package/dist/protocol.js CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  PAGES_APP_META,
16
16
  PREVIEW_QUERY,
17
17
  PROTOCOL_VERSION,
18
+ SECRET_FILE_PREFIXES,
18
19
  SECRET_NAME,
19
20
  SECRET_PLACEHOLDER,
20
21
  SESSION_PATH,
@@ -31,6 +32,7 @@ import {
31
32
  isExposed,
32
33
  isMember,
33
34
  isPageAccess,
35
+ isSecretFile,
34
36
  normalizeDomain,
35
37
  pagesBridge,
36
38
  roleAsAsked,
@@ -38,7 +40,7 @@ import {
38
40
  secretPlaceholder,
39
41
  signedInAsAsked,
40
42
  spaceRoleOf
41
- } from "./chunks/N6PYNICH.js";
43
+ } from "./chunks/ZKTI2IGQ.js";
42
44
  export {
43
45
  APPS_PATH,
44
46
  APP_COMPATIBILITY_DATE,
@@ -56,6 +58,7 @@ export {
56
58
  PAGES_APP_META,
57
59
  PREVIEW_QUERY,
58
60
  PROTOCOL_VERSION,
61
+ SECRET_FILE_PREFIXES,
59
62
  SECRET_NAME,
60
63
  SECRET_PLACEHOLDER,
61
64
  SESSION_PATH,
@@ -72,6 +75,7 @@ export {
72
75
  isExposed,
73
76
  isMember,
74
77
  isPageAccess,
78
+ isSecretFile,
75
79
  normalizeDomain,
76
80
  pagesBridge,
77
81
  roleAsAsked,
package/dist/schema.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  col,
4
4
  describeTables,
5
5
  schemaOf
6
- } from "./chunks/QNWCYG6K.js";
7
- import "./chunks/N6PYNICH.js";
6
+ } from "./chunks/YVAP26TZ.js";
7
+ import "./chunks/ZKTI2IGQ.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/QHPLAVFD.js";
4
- import "./chunks/QNWCYG6K.js";
3
+ } from "./chunks/OTMVSMPE.js";
4
+ import "./chunks/YVAP26TZ.js";
5
5
  import {
6
6
  MethodError
7
- } from "./chunks/OXDV76VZ.js";
7
+ } from "./chunks/KWMJ6RAV.js";
8
8
  import {
9
9
  ERROR_STATUS
10
- } from "./chunks/N6PYNICH.js";
10
+ } from "./chunks/ZKTI2IGQ.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/OXDV76VZ.js";
3
+ } from "./chunks/KWMJ6RAV.js";
4
4
  import {
5
5
  ERROR_STATUS
6
- } from "./chunks/N6PYNICH.js";
6
+ } from "./chunks/ZKTI2IGQ.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": "7.0.5",
3
+ "version": "7.0.6",
4
4
  "description": "Write a Teable app as a Drizzle schema plus methods",
5
5
  "license": "MIT",
6
6
  "repository": {