@teable/app 7.0.6 → 7.0.7

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/AZZIO5NR.js";
6
- import "../chunks/ZKTI2IGQ.js";
5
+ } from "../chunks/H6R7E3GY.js";
6
+ import "../chunks/ZYCZJSHS.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/AZZIO5NR.js";
7
- import "../chunks/ZKTI2IGQ.js";
6
+ } from "../chunks/H6R7E3GY.js";
7
+ import "../chunks/ZYCZJSHS.js";
8
8
  export {
9
9
  buildServer,
10
10
  buildWorker,
@@ -5,7 +5,7 @@ import {
5
5
  PREVIEW_QUERY,
6
6
  SESSION_PATH,
7
7
  fileKeyPath
8
- } from "./ZKTI2IGQ.js";
8
+ } from "./ZYCZJSHS.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 "./YVAP26TZ.js";
3
+ } from "./QMWZJWS3.js";
4
4
  import {
5
5
  CAPABILITIES,
6
6
  PROTOCOL_VERSION,
7
7
  admit,
8
8
  isPageAccess
9
- } from "./ZKTI2IGQ.js";
9
+ } from "./ZYCZJSHS.js";
10
10
 
11
11
  // src/server/errors.ts
12
12
  import { z } from "zod";
@@ -10,7 +10,7 @@ import {
10
10
  isMember,
11
11
  pagesBridge,
12
12
  spaceRoleOf
13
- } from "./ZKTI2IGQ.js";
13
+ } from "./ZYCZJSHS.js";
14
14
 
15
15
  // src/build/index.ts
16
16
  import { existsSync, readFileSync } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_CURRENCY,
3
3
  currencyDigits
4
- } from "./ZKTI2IGQ.js";
4
+ } from "./ZYCZJSHS.js";
5
5
 
6
6
  // src/schema.ts
7
7
  import { getTableColumns, getTableName, is } from "drizzle-orm";
@@ -276,6 +276,8 @@ function isSecretFile(path) {
276
276
  const name = path.slice(path.lastIndexOf("/") + 1);
277
277
  return SECRET_FILE_PREFIXES.some((prefix) => name.startsWith(prefix));
278
278
  }
279
+ var GITHUB_CONFLICT_BRANCH = "teable-sync";
280
+ var GITHUB_CHANNEL = "teable-github";
279
281
  var DOMAIN_NAME = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
280
282
  function normalizeDomain(input) {
281
283
  return input.trim().toLowerCase().replace(/^https?:\/\//, "").replace(/\/+$/, "").replace(/\.$/, "");
@@ -370,6 +372,8 @@ export {
370
372
  PAGES_APP_META,
371
373
  SECRET_FILE_PREFIXES,
372
374
  isSecretFile,
375
+ GITHUB_CONFLICT_BRANCH,
376
+ GITHUB_CHANNEL,
373
377
  normalizeDomain,
374
378
  isDomainName,
375
379
  BADGE_RULES,
package/dist/client.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MethodError,
3
3
  createClient
4
- } from "./chunks/KWMJ6RAV.js";
5
- import "./chunks/ZKTI2IGQ.js";
4
+ } from "./chunks/55YHKIYV.js";
5
+ import "./chunks/ZYCZJSHS.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/ZKTI2IGQ.js";
13
+ } from "../chunks/ZYCZJSHS.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/OTMVSMPE.js";
5
- import "./chunks/YVAP26TZ.js";
6
- import "./chunks/ZKTI2IGQ.js";
4
+ } from "./chunks/G4M5LS7T.js";
5
+ import "./chunks/QMWZJWS3.js";
6
+ import "./chunks/ZYCZJSHS.js";
7
7
 
8
8
  // src/index.ts
9
9
  import { z } from "zod";
@@ -745,6 +745,97 @@ export interface AppCodeFile {
745
745
  export declare const SECRET_FILE_PREFIXES: readonly [".env", ".dev.vars"];
746
746
  /** Whether the file at `path` (separated by `/`) is where secrets are kept. */
747
747
  export declare function isSecretFile(path: string): boolean;
748
+ /**
749
+ * How an app's GitHub sync stands (ADR 0031): `syncing` while a sync waits
750
+ * or runs; `active` while the repository's branch and the app's `main` hold
751
+ * the same commit; `conflict` while both moved, the app's `main` waiting on
752
+ * the repository's `teable-sync` branch for someone to merge it; `paused`
753
+ * while the GitHub App cannot reach the repository; `error` after a sync
754
+ * failed.
755
+ */
756
+ export type GithubSyncStatus = "syncing" | "active" | "paused" | "conflict" | "error";
757
+ /**
758
+ * The branch of a linked repository where the app's `main` waits while it
759
+ * and the repository's branch both moved (`conflict`), for someone to merge
760
+ * it on GitHub. GitHub sync forces no other branch.
761
+ */
762
+ export declare const GITHUB_CONFLICT_BRANCH = "teable-sync";
763
+ /** The GitHub repository an app's code is synced with (ADR 0031). */
764
+ export interface GithubLink {
765
+ /** `owner/name`. */
766
+ repository: string;
767
+ /** Its page on GitHub. */
768
+ url: string;
769
+ /** Its branch that moves with the app's `main`. */
770
+ branch: string;
771
+ status: GithubSyncStatus;
772
+ /** Why it is paused, in conflict or failed, in GitHub's words where they are its; null otherwise. */
773
+ message: string | null;
774
+ /** When both last held the same commit (epoch milliseconds); null before. */
775
+ syncedAt: number | null;
776
+ }
777
+ /**
778
+ * The app's GitHub sync (ADR 0031), as `GET {APPS_PATH}/:appId/github`
779
+ * answers those who may publish the app.
780
+ */
781
+ export interface AppGithub {
782
+ /** Whether this platform has a GitHub App: without one, nothing links. */
783
+ configured: boolean;
784
+ /** Whether the space's plan includes GitHub sync (Business and above). */
785
+ allowed: boolean;
786
+ link: GithubLink | null;
787
+ /**
788
+ * The GitHub user the person signed in as, through the GitHub App, to
789
+ * link a repository; null before, and once that sign-in ran out (8 hours).
790
+ */
791
+ user: {
792
+ login: string;
793
+ } | null;
794
+ }
795
+ /**
796
+ * A GitHub account the person may link a repository of: one the GitHub App
797
+ * is installed on that GitHub lets them reach, as `GET
798
+ * {APPS_PATH}/:appId/github/accounts` lists them.
799
+ */
800
+ export interface GithubAccount {
801
+ installationId: number;
802
+ login: string;
803
+ type: "User" | "Organization";
804
+ avatarUrl: string;
805
+ }
806
+ /**
807
+ * A repository of an account that the person may link (they can push to
808
+ * it), as `GET {APPS_PATH}/:appId/github/accounts/:installationId/repositories`
809
+ * lists them.
810
+ */
811
+ export interface GithubRepository {
812
+ id: number;
813
+ /** `owner/name`. */
814
+ fullName: string;
815
+ private: boolean;
816
+ }
817
+ /**
818
+ * What `POST {APPS_PATH}/:appId/github/link` links: a new private
819
+ * repository named `name` on the account, or its repository `repositoryId`.
820
+ */
821
+ export type GithubLinkInput = {
822
+ installationId: number;
823
+ name: string;
824
+ } | {
825
+ installationId: number;
826
+ repositoryId: number;
827
+ };
828
+ /**
829
+ * Where the person signs in to GitHub, or installs the GitHub App on another
830
+ * account (`install`), as `POST {APPS_PATH}/:appId/github/connect` answers:
831
+ * a page to open in a popup, which ends on a page of this origin that posts
832
+ * `{ ok, error }` on the `BroadcastChannel` named `GITHUB_CHANNEL`.
833
+ */
834
+ export interface GithubConnect {
835
+ url: string;
836
+ }
837
+ /** The `BroadcastChannel` the GitHub sign-in's last page posts its outcome on. */
838
+ export declare const GITHUB_CHANNEL = "teable-github";
748
839
  /**
749
840
  * A failure of the app's own, as `GET {APPS_PATH}/:appId/failures` lists
750
841
  * them for its creators: what broke in it lately, each failure once, with
package/dist/protocol.js CHANGED
@@ -12,6 +12,8 @@ import {
12
12
  ERROR_CODES,
13
13
  ERROR_STATUS,
14
14
  FILE_NAME_HEADER,
15
+ GITHUB_CHANNEL,
16
+ GITHUB_CONFLICT_BRANCH,
15
17
  PAGES_APP_META,
16
18
  PREVIEW_QUERY,
17
19
  PROTOCOL_VERSION,
@@ -40,7 +42,7 @@ import {
40
42
  secretPlaceholder,
41
43
  signedInAsAsked,
42
44
  spaceRoleOf
43
- } from "./chunks/ZKTI2IGQ.js";
45
+ } from "./chunks/ZYCZJSHS.js";
44
46
  export {
45
47
  APPS_PATH,
46
48
  APP_COMPATIBILITY_DATE,
@@ -55,6 +57,8 @@ export {
55
57
  ERROR_CODES,
56
58
  ERROR_STATUS,
57
59
  FILE_NAME_HEADER,
60
+ GITHUB_CHANNEL,
61
+ GITHUB_CONFLICT_BRANCH,
58
62
  PAGES_APP_META,
59
63
  PREVIEW_QUERY,
60
64
  PROTOCOL_VERSION,
package/dist/schema.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  col,
4
4
  describeTables,
5
5
  schemaOf
6
- } from "./chunks/YVAP26TZ.js";
7
- import "./chunks/ZKTI2IGQ.js";
6
+ } from "./chunks/QMWZJWS3.js";
7
+ import "./chunks/ZYCZJSHS.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/OTMVSMPE.js";
4
- import "./chunks/YVAP26TZ.js";
3
+ } from "./chunks/G4M5LS7T.js";
4
+ import "./chunks/QMWZJWS3.js";
5
5
  import {
6
6
  MethodError
7
- } from "./chunks/KWMJ6RAV.js";
7
+ } from "./chunks/55YHKIYV.js";
8
8
  import {
9
9
  ERROR_STATUS
10
- } from "./chunks/ZKTI2IGQ.js";
10
+ } from "./chunks/ZYCZJSHS.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/KWMJ6RAV.js";
3
+ } from "./chunks/55YHKIYV.js";
4
4
  import {
5
5
  ERROR_STATUS
6
- } from "./chunks/ZKTI2IGQ.js";
6
+ } from "./chunks/ZYCZJSHS.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.6",
3
+ "version": "7.0.7",
4
4
  "description": "Write a Teable app as a Drizzle schema plus methods",
5
5
  "license": "MIT",
6
6
  "repository": {