@teable/app 7.0.6 → 7.0.8
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.js +2 -2
- package/dist/chunks/{OTMVSMPE.js → 2W5UWORA.js} +2 -2
- package/dist/chunks/{ZKTI2IGQ.js → 4HDG5ILC.js} +6 -0
- package/dist/chunks/{AZZIO5NR.js → QMKFUKJ4.js} +1 -1
- package/dist/chunks/{YVAP26TZ.js → TKDXT3ZT.js} +1 -1
- package/dist/chunks/{KWMJ6RAV.js → ZQI6BF6U.js} +1 -1
- package/dist/client.js +2 -2
- package/dist/dev/host.js +1 -1
- package/dist/index.js +3 -3
- package/dist/protocol.d.ts +111 -0
- package/dist/protocol.js +7 -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.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
describeTables
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./TKDXT3ZT.js";
|
|
4
4
|
import {
|
|
5
5
|
CAPABILITIES,
|
|
6
6
|
PROTOCOL_VERSION,
|
|
7
7
|
admit,
|
|
8
8
|
isPageAccess
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./4HDG5ILC.js";
|
|
10
10
|
|
|
11
11
|
// src/server/errors.ts
|
|
12
12
|
import { z } from "zod";
|
|
@@ -263,6 +263,7 @@ var BRIDGE = String.raw`function (window, origins) {
|
|
|
263
263
|
}`;
|
|
264
264
|
var APPS_PATH = "/api/v4/apps";
|
|
265
265
|
var FILE_NAME_HEADER = "X-File-Name";
|
|
266
|
+
var MAX_FILE_BYTES = 100 * 1024 * 1024;
|
|
266
267
|
var PREVIEW_QUERY = "preview";
|
|
267
268
|
function fileKeyPath(key) {
|
|
268
269
|
const slash = key.indexOf("/");
|
|
@@ -276,6 +277,8 @@ function isSecretFile(path) {
|
|
|
276
277
|
const name = path.slice(path.lastIndexOf("/") + 1);
|
|
277
278
|
return SECRET_FILE_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
278
279
|
}
|
|
280
|
+
var GITHUB_CONFLICT_BRANCH = "teable-sync";
|
|
281
|
+
var GITHUB_CHANNEL = "teable-github";
|
|
279
282
|
var DOMAIN_NAME = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
|
|
280
283
|
function normalizeDomain(input) {
|
|
281
284
|
return input.trim().toLowerCase().replace(/^https?:\/\//, "").replace(/\/+$/, "").replace(/\.$/, "");
|
|
@@ -363,6 +366,7 @@ export {
|
|
|
363
366
|
pagesBridge,
|
|
364
367
|
APPS_PATH,
|
|
365
368
|
FILE_NAME_HEADER,
|
|
369
|
+
MAX_FILE_BYTES,
|
|
366
370
|
PREVIEW_QUERY,
|
|
367
371
|
fileKeyPath,
|
|
368
372
|
DEPLOY_HEADERS,
|
|
@@ -370,6 +374,8 @@ export {
|
|
|
370
374
|
PAGES_APP_META,
|
|
371
375
|
SECRET_FILE_PREFIXES,
|
|
372
376
|
isSecretFile,
|
|
377
|
+
GITHUB_CONFLICT_BRANCH,
|
|
378
|
+
GITHUB_CHANNEL,
|
|
373
379
|
normalizeDomain,
|
|
374
380
|
isDomainName,
|
|
375
381
|
BADGE_RULES,
|
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/2W5UWORA.js";
|
|
5
|
+
import "./chunks/TKDXT3ZT.js";
|
|
6
|
+
import "./chunks/4HDG5ILC.js";
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
import { z } from "zod";
|
package/dist/protocol.d.ts
CHANGED
|
@@ -589,6 +589,26 @@ export type RealtimeMessage = {
|
|
|
589
589
|
export declare const APPS_PATH = "/api/v4/apps";
|
|
590
590
|
/** The header that names an uploaded file (URI-encoded); the body is its bytes. */
|
|
591
591
|
export declare const FILE_NAME_HEADER = "X-File-Name";
|
|
592
|
+
/** At most this many bytes a file of an app (100 MiB), however it is stored: uploaded, or by a task. */
|
|
593
|
+
export declare const MAX_FILE_BYTES: number;
|
|
594
|
+
/**
|
|
595
|
+
* An app's files, for those who may publish it (ADR 0010): `GET
|
|
596
|
+
* {APPS_PATH}/:appId/files` lists a page of them, a thousand at most
|
|
597
|
+
* (`?limit=` asks for fewer), and the next page after `?cursor=`, the one
|
|
598
|
+
* the last page gave. `DELETE {APPS_PATH}/:appId/files/:id/:name` deletes
|
|
599
|
+
* one: nothing opens it after, the app's rows and its public links
|
|
600
|
+
* included. The preview and the live version share them (ADR 0022).
|
|
601
|
+
*/
|
|
602
|
+
export interface AppFiles {
|
|
603
|
+
/** In the order they are stored in, by key, which is no order people know: sort them to show them. */
|
|
604
|
+
files: AppFile[];
|
|
605
|
+
/** Where the next page starts; null after the last. */
|
|
606
|
+
cursor: string | null;
|
|
607
|
+
}
|
|
608
|
+
/** A file of an app: what its rows keep of it, and when it was uploaded (epoch milliseconds). */
|
|
609
|
+
export interface AppFile extends Attachment {
|
|
610
|
+
uploadedAt: number;
|
|
611
|
+
}
|
|
592
612
|
/**
|
|
593
613
|
* The query parameter, set to `1`, by which a request on the platform's
|
|
594
614
|
* hosts names the app's preview (ADR 0022): the builder's views call it so,
|
|
@@ -745,6 +765,97 @@ export interface AppCodeFile {
|
|
|
745
765
|
export declare const SECRET_FILE_PREFIXES: readonly [".env", ".dev.vars"];
|
|
746
766
|
/** Whether the file at `path` (separated by `/`) is where secrets are kept. */
|
|
747
767
|
export declare function isSecretFile(path: string): boolean;
|
|
768
|
+
/**
|
|
769
|
+
* How an app's GitHub sync stands (ADR 0031): `syncing` while a sync waits
|
|
770
|
+
* or runs; `active` while the repository's branch and the app's `main` hold
|
|
771
|
+
* the same commit; `conflict` while both moved, the app's `main` waiting on
|
|
772
|
+
* the repository's `teable-sync` branch for someone to merge it; `paused`
|
|
773
|
+
* while the GitHub App cannot reach the repository; `error` after a sync
|
|
774
|
+
* failed.
|
|
775
|
+
*/
|
|
776
|
+
export type GithubSyncStatus = "syncing" | "active" | "paused" | "conflict" | "error";
|
|
777
|
+
/**
|
|
778
|
+
* The branch of a linked repository where the app's `main` waits while it
|
|
779
|
+
* and the repository's branch both moved (`conflict`), for someone to merge
|
|
780
|
+
* it on GitHub. GitHub sync forces no other branch.
|
|
781
|
+
*/
|
|
782
|
+
export declare const GITHUB_CONFLICT_BRANCH = "teable-sync";
|
|
783
|
+
/** The GitHub repository an app's code is synced with (ADR 0031). */
|
|
784
|
+
export interface GithubLink {
|
|
785
|
+
/** `owner/name`. */
|
|
786
|
+
repository: string;
|
|
787
|
+
/** Its page on GitHub. */
|
|
788
|
+
url: string;
|
|
789
|
+
/** Its branch that moves with the app's `main`. */
|
|
790
|
+
branch: string;
|
|
791
|
+
status: GithubSyncStatus;
|
|
792
|
+
/** Why it is paused, in conflict or failed, in GitHub's words where they are its; null otherwise. */
|
|
793
|
+
message: string | null;
|
|
794
|
+
/** When both last held the same commit (epoch milliseconds); null before. */
|
|
795
|
+
syncedAt: number | null;
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* The app's GitHub sync (ADR 0031), as `GET {APPS_PATH}/:appId/github`
|
|
799
|
+
* answers those who may publish the app.
|
|
800
|
+
*/
|
|
801
|
+
export interface AppGithub {
|
|
802
|
+
/** Whether this platform has a GitHub App: without one, nothing links. */
|
|
803
|
+
configured: boolean;
|
|
804
|
+
/** Whether the space's plan includes GitHub sync (Business and above). */
|
|
805
|
+
allowed: boolean;
|
|
806
|
+
link: GithubLink | null;
|
|
807
|
+
/**
|
|
808
|
+
* The GitHub user the person signed in as, through the GitHub App, to
|
|
809
|
+
* link a repository; null before, and once that sign-in ran out (8 hours).
|
|
810
|
+
*/
|
|
811
|
+
user: {
|
|
812
|
+
login: string;
|
|
813
|
+
} | null;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* A GitHub account the person may link a repository of: one the GitHub App
|
|
817
|
+
* is installed on that GitHub lets them reach, as `GET
|
|
818
|
+
* {APPS_PATH}/:appId/github/accounts` lists them.
|
|
819
|
+
*/
|
|
820
|
+
export interface GithubAccount {
|
|
821
|
+
installationId: number;
|
|
822
|
+
login: string;
|
|
823
|
+
type: "User" | "Organization";
|
|
824
|
+
avatarUrl: string;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* A repository of an account that the person may link (they can push to
|
|
828
|
+
* it), as `GET {APPS_PATH}/:appId/github/accounts/:installationId/repositories`
|
|
829
|
+
* lists them.
|
|
830
|
+
*/
|
|
831
|
+
export interface GithubRepository {
|
|
832
|
+
id: number;
|
|
833
|
+
/** `owner/name`. */
|
|
834
|
+
fullName: string;
|
|
835
|
+
private: boolean;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* What `POST {APPS_PATH}/:appId/github/link` links: a new private
|
|
839
|
+
* repository named `name` on the account, or its repository `repositoryId`.
|
|
840
|
+
*/
|
|
841
|
+
export type GithubLinkInput = {
|
|
842
|
+
installationId: number;
|
|
843
|
+
name: string;
|
|
844
|
+
} | {
|
|
845
|
+
installationId: number;
|
|
846
|
+
repositoryId: number;
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* Where the person signs in to GitHub, or installs the GitHub App on another
|
|
850
|
+
* account (`install`), as `POST {APPS_PATH}/:appId/github/connect` answers:
|
|
851
|
+
* a page to open in a popup, which ends on a page of this origin that posts
|
|
852
|
+
* `{ ok, error }` on the `BroadcastChannel` named `GITHUB_CHANNEL`.
|
|
853
|
+
*/
|
|
854
|
+
export interface GithubConnect {
|
|
855
|
+
url: string;
|
|
856
|
+
}
|
|
857
|
+
/** The `BroadcastChannel` the GitHub sign-in's last page posts its outcome on. */
|
|
858
|
+
export declare const GITHUB_CHANNEL = "teable-github";
|
|
748
859
|
/**
|
|
749
860
|
* A failure of the app's own, as `GET {APPS_PATH}/:appId/failures` lists
|
|
750
861
|
* them for its creators: what broke in it lately, each failure once, with
|
package/dist/protocol.js
CHANGED
|
@@ -12,6 +12,9 @@ import {
|
|
|
12
12
|
ERROR_CODES,
|
|
13
13
|
ERROR_STATUS,
|
|
14
14
|
FILE_NAME_HEADER,
|
|
15
|
+
GITHUB_CHANNEL,
|
|
16
|
+
GITHUB_CONFLICT_BRANCH,
|
|
17
|
+
MAX_FILE_BYTES,
|
|
15
18
|
PAGES_APP_META,
|
|
16
19
|
PREVIEW_QUERY,
|
|
17
20
|
PROTOCOL_VERSION,
|
|
@@ -40,7 +43,7 @@ import {
|
|
|
40
43
|
secretPlaceholder,
|
|
41
44
|
signedInAsAsked,
|
|
42
45
|
spaceRoleOf
|
|
43
|
-
} from "./chunks/
|
|
46
|
+
} from "./chunks/4HDG5ILC.js";
|
|
44
47
|
export {
|
|
45
48
|
APPS_PATH,
|
|
46
49
|
APP_COMPATIBILITY_DATE,
|
|
@@ -55,6 +58,9 @@ export {
|
|
|
55
58
|
ERROR_CODES,
|
|
56
59
|
ERROR_STATUS,
|
|
57
60
|
FILE_NAME_HEADER,
|
|
61
|
+
GITHUB_CHANNEL,
|
|
62
|
+
GITHUB_CONFLICT_BRANCH,
|
|
63
|
+
MAX_FILE_BYTES,
|
|
58
64
|
PAGES_APP_META,
|
|
59
65
|
PREVIEW_QUERY,
|
|
60
66
|
PROTOCOL_VERSION,
|
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/2W5UWORA.js";
|
|
4
|
+
import "./chunks/TKDXT3ZT.js";
|
|
5
5
|
import {
|
|
6
6
|
MethodError
|
|
7
|
-
} from "./chunks/
|
|
7
|
+
} from "./chunks/ZQI6BF6U.js";
|
|
8
8
|
import {
|
|
9
9
|
ERROR_STATUS
|
|
10
|
-
} from "./chunks/
|
|
10
|
+
} from "./chunks/4HDG5ILC.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