@teable/app 7.0.3 → 7.0.4

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/WOZYDEVS.js";
6
- import "../chunks/UAHL536U.js";
5
+ } from "../chunks/UDRXJPLD.js";
6
+ import "../chunks/N6PYNICH.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/WOZYDEVS.js";
7
- import "../chunks/UAHL536U.js";
6
+ } from "../chunks/UDRXJPLD.js";
7
+ import "../chunks/N6PYNICH.js";
8
8
  export {
9
9
  buildServer,
10
10
  buildWorker,
@@ -271,6 +271,13 @@ 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 DOMAIN_NAME = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
275
+ function normalizeDomain(input) {
276
+ return input.trim().toLowerCase().replace(/^https?:\/\//, "").replace(/\/+$/, "").replace(/\.$/, "");
277
+ }
278
+ function isDomainName(domain) {
279
+ return domain.length <= 253 && DOMAIN_NAME.test(domain);
280
+ }
274
281
  var BADGE_RULES = ["required", "optional", "off"];
275
282
  var SITE_LIMITS = { title: 120, description: 500, iconBytes: 1024 * 1024 };
276
283
  var SITE_ICON_TYPES = [
@@ -356,6 +363,8 @@ export {
356
363
  DEPLOY_HEADERS,
357
364
  DEPLOY_PARTS,
358
365
  PAGES_APP_META,
366
+ normalizeDomain,
367
+ isDomainName,
359
368
  BADGE_RULES,
360
369
  SITE_LIMITS,
361
370
  SITE_ICON_TYPES,
@@ -5,7 +5,7 @@ import {
5
5
  PREVIEW_QUERY,
6
6
  SESSION_PATH,
7
7
  fileKeyPath
8
- } from "./UAHL536U.js";
8
+ } from "./N6PYNICH.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 "./VUAUTXE2.js";
3
+ } from "./QNWCYG6K.js";
4
4
  import {
5
5
  CAPABILITIES,
6
6
  PROTOCOL_VERSION,
7
7
  admit,
8
8
  isPageAccess
9
- } from "./UAHL536U.js";
9
+ } from "./N6PYNICH.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 "./UAHL536U.js";
4
+ } from "./N6PYNICH.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 "./UAHL536U.js";
13
+ } from "./N6PYNICH.js";
14
14
 
15
15
  // src/build/index.ts
16
16
  import { existsSync, readFileSync } from "node:fs";
package/dist/client.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MethodError,
3
3
  createClient
4
- } from "./chunks/C74GVJIJ.js";
5
- import "./chunks/UAHL536U.js";
4
+ } from "./chunks/OXDV76VZ.js";
5
+ import "./chunks/N6PYNICH.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/UAHL536U.js";
13
+ } from "../chunks/N6PYNICH.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/WVY4PINE.js";
5
- import "./chunks/VUAUTXE2.js";
6
- import "./chunks/UAHL536U.js";
4
+ } from "./chunks/QHPLAVFD.js";
5
+ import "./chunks/QNWCYG6K.js";
6
+ import "./chunks/N6PYNICH.js";
7
7
 
8
8
  // src/index.ts
9
9
  import { z } from "zod";
@@ -751,6 +751,45 @@ export interface AppSubdomain {
751
751
  /** `https://<subdomain>.teable.uk`, or its id's host; null when it has neither. */
752
752
  url: string | null;
753
753
  }
754
+ /**
755
+ * A DNS record people add at their DNS provider for an app's own domain
756
+ * (ADR 0024): its name within their zone (`@` for its root).
757
+ */
758
+ export interface DomainRecord {
759
+ type: "CNAME";
760
+ name: string;
761
+ value: string;
762
+ }
763
+ /**
764
+ * A domain as people type it, as the runtime takes it for an app's own
765
+ * (ADR 0024), and as the old platform did: trimmed, in lower case, without
766
+ * scheme, trailing slashes or a trailing dot.
767
+ */
768
+ export declare function normalizeDomain(input: string): string;
769
+ /** Whether `domain`, normalized, is a host name of two labels or more, 253 characters at most, ending in letters. */
770
+ export declare function isDomainName(domain: string): boolean;
771
+ /**
772
+ * An app's own domain (ADR 0024), as `{APPS_PATH}/:appId/domain` says it
773
+ * to its creators: the domain they bound, or null; `pending` until
774
+ * Cloudflare has validated it and issued its certificate, then `active`,
775
+ * while its pages are there; the record to add for it; and why it is not
776
+ * active yet, in Cloudflare's words. The space's plan decides whether the
777
+ * app may have one, and when a lapsed plan's domain is released.
778
+ */
779
+ export interface AppDomain {
780
+ domain: string | null;
781
+ status: "pending" | "active" | null;
782
+ records: DomainRecord[];
783
+ problem: string | null;
784
+ /** When Cloudflare was last asked about it (epoch milliseconds); null before. */
785
+ checkedAt: number | null;
786
+ /** Whether the space's plan includes own domains (Business and above). */
787
+ allowed: boolean;
788
+ /** When the domain is released, the plan no longer including it (epoch milliseconds); null while it does. */
789
+ releasesAt: number | null;
790
+ /** Where its pages are now: the domain while it is active, else its subdomain or its id's host. */
791
+ url: string | null;
792
+ }
754
793
  /**
755
794
  * Whether an app's pages show the "Build with Teable" badge (ADR 0023), as
756
795
  * the old platform decides from its space's plan: always (`required`),
package/dist/protocol.js CHANGED
@@ -27,16 +27,18 @@ import {
27
27
  checkAccess,
28
28
  currencyDigits,
29
29
  fileKeyPath,
30
+ isDomainName,
30
31
  isExposed,
31
32
  isMember,
32
33
  isPageAccess,
34
+ normalizeDomain,
33
35
  pagesBridge,
34
36
  roleAsAsked,
35
37
  rolesBelow,
36
38
  secretPlaceholder,
37
39
  signedInAsAsked,
38
40
  spaceRoleOf
39
- } from "./chunks/UAHL536U.js";
41
+ } from "./chunks/N6PYNICH.js";
40
42
  export {
41
43
  APPS_PATH,
42
44
  APP_COMPATIBILITY_DATE,
@@ -66,9 +68,11 @@ export {
66
68
  checkAccess,
67
69
  currencyDigits,
68
70
  fileKeyPath,
71
+ isDomainName,
69
72
  isExposed,
70
73
  isMember,
71
74
  isPageAccess,
75
+ normalizeDomain,
72
76
  pagesBridge,
73
77
  roleAsAsked,
74
78
  rolesBelow,
package/dist/schema.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  col,
4
4
  describeTables,
5
5
  schemaOf
6
- } from "./chunks/VUAUTXE2.js";
7
- import "./chunks/UAHL536U.js";
6
+ } from "./chunks/QNWCYG6K.js";
7
+ import "./chunks/N6PYNICH.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/WVY4PINE.js";
4
- import "./chunks/VUAUTXE2.js";
3
+ } from "./chunks/QHPLAVFD.js";
4
+ import "./chunks/QNWCYG6K.js";
5
5
  import {
6
6
  MethodError
7
- } from "./chunks/C74GVJIJ.js";
7
+ } from "./chunks/OXDV76VZ.js";
8
8
  import {
9
9
  ERROR_STATUS
10
- } from "./chunks/UAHL536U.js";
10
+ } from "./chunks/N6PYNICH.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/C74GVJIJ.js";
3
+ } from "./chunks/OXDV76VZ.js";
4
4
  import {
5
5
  ERROR_STATUS
6
- } from "./chunks/UAHL536U.js";
6
+ } from "./chunks/N6PYNICH.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.3",
3
+ "version": "7.0.4",
4
4
  "description": "Write a Teable app as a Drizzle schema plus methods",
5
5
  "license": "MIT",
6
6
  "repository": {