@teable/app 7.0.2 → 7.0.3

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/N57JCM5C.js";
6
- import "../chunks/55AX7R35.js";
5
+ } from "../chunks/WOZYDEVS.js";
6
+ import "../chunks/UAHL536U.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/N57JCM5C.js";
7
- import "../chunks/55AX7R35.js";
6
+ } from "../chunks/WOZYDEVS.js";
7
+ import "../chunks/UAHL536U.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 "./55AX7R35.js";
8
+ } from "./UAHL536U.js";
9
9
 
10
10
  // src/client.ts
11
11
  var MethodError = class extends Error {
@@ -271,6 +271,16 @@ 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 BADGE_RULES = ["required", "optional", "off"];
275
+ var SITE_LIMITS = { title: 120, description: 500, iconBytes: 1024 * 1024 };
276
+ var SITE_ICON_TYPES = [
277
+ "image/png",
278
+ "image/jpeg",
279
+ "image/webp",
280
+ "image/svg+xml",
281
+ "image/x-icon",
282
+ "image/vnd.microsoft.icon"
283
+ ];
274
284
  var SECRET_NAME_PATTERN = "[A-Z][A-Z0-9_]{0,63}";
275
285
  var SECRET_NAME = new RegExp(`^${SECRET_NAME_PATTERN}$`);
276
286
  function secretPlaceholder(name) {
@@ -346,6 +356,9 @@ export {
346
356
  DEPLOY_HEADERS,
347
357
  DEPLOY_PARTS,
348
358
  PAGES_APP_META,
359
+ BADGE_RULES,
360
+ SITE_LIMITS,
361
+ SITE_ICON_TYPES,
349
362
  SECRET_NAME,
350
363
  secretPlaceholder,
351
364
  SECRET_PLACEHOLDER,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_CURRENCY,
3
3
  currencyDigits
4
- } from "./55AX7R35.js";
4
+ } from "./UAHL536U.js";
5
5
 
6
6
  // src/schema.ts
7
7
  import { getTableColumns, getTableName, is } from "drizzle-orm";
@@ -10,7 +10,7 @@ import {
10
10
  isMember,
11
11
  pagesBridge,
12
12
  spaceRoleOf
13
- } from "./55AX7R35.js";
13
+ } from "./UAHL536U.js";
14
14
 
15
15
  // src/build/index.ts
16
16
  import { existsSync, readFileSync } from "node:fs";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  describeTables
3
- } from "./2VHESBP6.js";
3
+ } from "./VUAUTXE2.js";
4
4
  import {
5
5
  CAPABILITIES,
6
6
  PROTOCOL_VERSION,
7
7
  admit,
8
8
  isPageAccess
9
- } from "./55AX7R35.js";
9
+ } from "./UAHL536U.js";
10
10
 
11
11
  // src/server/errors.ts
12
12
  import { z } from "zod";
package/dist/client.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MethodError,
3
3
  createClient
4
- } from "./chunks/HOJZKDRT.js";
5
- import "./chunks/55AX7R35.js";
4
+ } from "./chunks/C74GVJIJ.js";
5
+ import "./chunks/UAHL536U.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/55AX7R35.js";
13
+ } from "../chunks/UAHL536U.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/TSMB4OBX.js";
5
- import "./chunks/2VHESBP6.js";
6
- import "./chunks/55AX7R35.js";
4
+ } from "./chunks/WVY4PINE.js";
5
+ import "./chunks/VUAUTXE2.js";
6
+ import "./chunks/UAHL536U.js";
7
7
 
8
8
  // src/index.ts
9
9
  import { z } from "zod";
@@ -407,8 +407,9 @@ export declare const ASSETS_HEADER = "X-Teable-Assets";
407
407
  * Where the runtime answers on an app's own host before its Worker (ADR
408
408
  * 0014): `sign-in?return=<path>` (to Teable and back), `callback`,
409
409
  * `session` (`SessionResponse`) and `sign-out` (POST); for an app's accounts
410
- * (ADR 0021), `sign-in/email` and `sign-in/code` (POST, `SignInCodeRequest`).
411
- * With `${APPS_PATH}/`,
410
+ * (ADR 0021), `sign-in/email` and `sign-in/code` (POST, `SignInCodeRequest`);
411
+ * and the icon its creators set and the script of its badge (ADR 0023),
412
+ * `icon` and `badge.js`. With `${APPS_PATH}/`,
412
413
  * the app's own API there, the app's Worker never sees these paths.
413
414
  */
414
415
  export declare const SESSION_PATH = "/.teable";
@@ -750,6 +751,72 @@ export interface AppSubdomain {
750
751
  /** `https://<subdomain>.teable.uk`, or its id's host; null when it has neither. */
751
752
  url: string | null;
752
753
  }
754
+ /**
755
+ * Whether an app's pages show the "Build with Teable" badge (ADR 0023), as
756
+ * the old platform decides from its space's plan: always (`required`),
757
+ * unless its creators hide it (`optional`), or never (`off`).
758
+ */
759
+ export type BadgeRule = "required" | "optional" | "off";
760
+ /** What a badge rule may be. */
761
+ export declare const BADGE_RULES: readonly ["required", "optional", "off"];
762
+ /**
763
+ * An app's site info (ADR 0023), as `GET {APPS_PATH}/:appId/site` says it
764
+ * to its creators: the title, description and icon the runtime puts in its
765
+ * pages' head over what their code says, each null to leave the pages'
766
+ * own; and its badge.
767
+ */
768
+ export interface AppSite {
769
+ title: string | null;
770
+ description: string | null;
771
+ /** The icon, as a `data:` URL; null: the pages' own. */
772
+ icon: string | null;
773
+ badge: {
774
+ rule: BadgeRule;
775
+ /** Whether its creators hid it, which counts only where the rule is `optional`. */
776
+ hidden: boolean;
777
+ /** Whether the pages show it. */
778
+ shown: boolean;
779
+ };
780
+ }
781
+ /**
782
+ * What `PUT {APPS_PATH}/:appId/site` takes: any of these, the rest staying
783
+ * as they are. An empty title or description is null; an icon is its type
784
+ * (`SITE_ICON_TYPES`) and its bytes in base64.
785
+ */
786
+ export interface SiteInput {
787
+ title?: string | null;
788
+ description?: string | null;
789
+ icon?: {
790
+ type: string;
791
+ content: string;
792
+ } | null;
793
+ hideBadge?: boolean;
794
+ }
795
+ /** How long a site's title and description may be, in characters, and its icon, in bytes. */
796
+ export declare const SITE_LIMITS: {
797
+ readonly title: 120;
798
+ readonly description: 500;
799
+ readonly iconBytes: number;
800
+ };
801
+ /** The types an app's icon may be. */
802
+ export declare const SITE_ICON_TYPES: readonly ["image/png", "image/jpeg", "image/webp", "image/svg+xml", "image/x-icon", "image/vnd.microsoft.icon"];
803
+ /**
804
+ * An app's usage (ADR 0006), as `GET {APPS_PATH}/:appId/usage` says it to
805
+ * its creators: per UTC day and kind, the calls its methods ran (`call`),
806
+ * its task runs (`task`) and the requests it sent out (`http`), with how
807
+ * long they took, from `from` to `to` (YYYY-MM-DD, both counted). Days
808
+ * without use are left out.
809
+ */
810
+ export interface AppUsage {
811
+ from: string;
812
+ to: string;
813
+ days: {
814
+ day: string;
815
+ kind: "call" | "task" | "http";
816
+ quantity: number;
817
+ durationMs: number;
818
+ }[];
819
+ }
753
820
  /**
754
821
  * A secret of an app (ADR 0015), as `GET {APPS_PATH}/:appId/secrets` lists
755
822
  * them for its creators: by name, never by value. The app's code writes
package/dist/protocol.js CHANGED
@@ -2,6 +2,7 @@ import {
2
2
  APPS_PATH,
3
3
  APP_COMPATIBILITY_DATE,
4
4
  ASSETS_HEADER,
5
+ BADGE_RULES,
5
6
  BRIDGE_PATH,
6
7
  CAPABILITIES,
7
8
  DEFAULT_CURRENCY,
@@ -18,6 +19,8 @@ import {
18
19
  SECRET_PLACEHOLDER,
19
20
  SESSION_PATH,
20
21
  SIGN_IN_ACCOUNTS,
22
+ SITE_ICON_TYPES,
23
+ SITE_LIMITS,
21
24
  SPACE_ROLES,
22
25
  admit,
23
26
  callableMethods,
@@ -33,11 +36,12 @@ import {
33
36
  secretPlaceholder,
34
37
  signedInAsAsked,
35
38
  spaceRoleOf
36
- } from "./chunks/55AX7R35.js";
39
+ } from "./chunks/UAHL536U.js";
37
40
  export {
38
41
  APPS_PATH,
39
42
  APP_COMPATIBILITY_DATE,
40
43
  ASSETS_HEADER,
44
+ BADGE_RULES,
41
45
  BRIDGE_PATH,
42
46
  CAPABILITIES,
43
47
  DEFAULT_CURRENCY,
@@ -54,6 +58,8 @@ export {
54
58
  SECRET_PLACEHOLDER,
55
59
  SESSION_PATH,
56
60
  SIGN_IN_ACCOUNTS,
61
+ SITE_ICON_TYPES,
62
+ SITE_LIMITS,
57
63
  SPACE_ROLES,
58
64
  admit,
59
65
  callableMethods,
package/dist/schema.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  col,
4
4
  describeTables,
5
5
  schemaOf
6
- } from "./chunks/2VHESBP6.js";
7
- import "./chunks/55AX7R35.js";
6
+ } from "./chunks/VUAUTXE2.js";
7
+ import "./chunks/UAHL536U.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/TSMB4OBX.js";
4
- import "./chunks/2VHESBP6.js";
3
+ } from "./chunks/WVY4PINE.js";
4
+ import "./chunks/VUAUTXE2.js";
5
5
  import {
6
6
  MethodError
7
- } from "./chunks/HOJZKDRT.js";
7
+ } from "./chunks/C74GVJIJ.js";
8
8
  import {
9
9
  ERROR_STATUS
10
- } from "./chunks/55AX7R35.js";
10
+ } from "./chunks/UAHL536U.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/HOJZKDRT.js";
3
+ } from "./chunks/C74GVJIJ.js";
4
4
  import {
5
5
  ERROR_STATUS
6
- } from "./chunks/55AX7R35.js";
6
+ } from "./chunks/UAHL536U.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.2",
3
+ "version": "7.0.3",
4
4
  "description": "Write a Teable app as a Drizzle schema plus methods",
5
5
  "license": "MIT",
6
6
  "repository": {