@teable/app 7.0.8 → 7.0.10

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/QMKFUKJ4.js";
6
- import "../chunks/4HDG5ILC.js";
5
+ } from "../chunks/NUNZDM2R.js";
6
+ import "../chunks/VBS7QVKG.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/QMKFUKJ4.js";
7
- import "../chunks/4HDG5ILC.js";
6
+ } from "../chunks/NUNZDM2R.js";
7
+ import "../chunks/VBS7QVKG.js";
8
8
  export {
9
9
  buildServer,
10
10
  buildWorker,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_CURRENCY,
3
3
  currencyDigits
4
- } from "./4HDG5ILC.js";
4
+ } from "./VBS7QVKG.js";
5
5
 
6
6
  // src/schema.ts
7
7
  import { getTableColumns, getTableName, is } from "drizzle-orm";
@@ -5,7 +5,7 @@ import {
5
5
  PREVIEW_QUERY,
6
6
  SESSION_PATH,
7
7
  fileKeyPath
8
- } from "./4HDG5ILC.js";
8
+ } from "./VBS7QVKG.js";
9
9
 
10
10
  // src/client.ts
11
11
  var MethodError = class extends Error {
@@ -10,7 +10,7 @@ import {
10
10
  isMember,
11
11
  pagesBridge,
12
12
  spaceRoleOf
13
- } from "./4HDG5ILC.js";
13
+ } from "./VBS7QVKG.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 "./TKDXT3ZT.js";
3
+ } from "./GFYV4PFY.js";
4
4
  import {
5
5
  CAPABILITIES,
6
6
  PROTOCOL_VERSION,
7
7
  admit,
8
8
  isPageAccess
9
- } from "./4HDG5ILC.js";
9
+ } from "./VBS7QVKG.js";
10
10
 
11
11
  // src/server/errors.ts
12
12
  import { z } from "zod";
@@ -296,6 +296,7 @@ var SITE_ICON_TYPES = [
296
296
  "image/x-icon",
297
297
  "image/vnd.microsoft.icon"
298
298
  ];
299
+ var VISIT_PERIODS = [7, 30];
299
300
  var SECRET_NAME_PATTERN = "[A-Z][A-Z0-9_]{0,63}";
300
301
  var SECRET_NAME = new RegExp(`^${SECRET_NAME_PATTERN}$`);
301
302
  function secretPlaceholder(name) {
@@ -381,6 +382,7 @@ export {
381
382
  BADGE_RULES,
382
383
  SITE_LIMITS,
383
384
  SITE_ICON_TYPES,
385
+ VISIT_PERIODS,
384
386
  SECRET_NAME,
385
387
  secretPlaceholder,
386
388
  SECRET_PLACEHOLDER,
package/dist/client.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  MethodError,
3
3
  createClient
4
- } from "./chunks/ZQI6BF6U.js";
5
- import "./chunks/4HDG5ILC.js";
4
+ } from "./chunks/IECAZUW6.js";
5
+ import "./chunks/VBS7QVKG.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/4HDG5ILC.js";
13
+ } from "../chunks/VBS7QVKG.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/2W5UWORA.js";
5
- import "./chunks/TKDXT3ZT.js";
6
- import "./chunks/4HDG5ILC.js";
4
+ } from "./chunks/OAU5HBAB.js";
5
+ import "./chunks/GFYV4PFY.js";
6
+ import "./chunks/VBS7QVKG.js";
7
7
 
8
8
  // src/index.ts
9
9
  import { z } from "zod";
@@ -1011,6 +1011,40 @@ export interface AppUsage {
1011
1011
  durationMs: number;
1012
1012
  }[];
1013
1013
  }
1014
+ /** The periods, in UTC days, that an app's visits are read for: today and the days before it. */
1015
+ export declare const VISIT_PERIODS: readonly [7, 30];
1016
+ export type VisitPeriod = (typeof VISIT_PERIODS)[number];
1017
+ /** How many visitors and page views something had: a day, a page, a source, a period. */
1018
+ export interface VisitCounts {
1019
+ /** People, each counted once a UTC day (ADR 0032). */
1020
+ visitors: number;
1021
+ /** Pages opened. */
1022
+ views: number;
1023
+ }
1024
+ /**
1025
+ * Who opened an app's live pages lately (ADR 0032), as
1026
+ * `GET {APPS_PATH}/:appId/visits?days=7|30` says it to its creators: the
1027
+ * period's UTC days from `from` to `to` (YYYY-MM-DD, both counted, today so
1028
+ * far the last), each with its visitors and page views, days without any
1029
+ * left out; the same totals for as many days just before (`before`); and
1030
+ * the period's most viewed pages and the sources most visitors came from,
1031
+ * ten at most, most first. A source is the host of the site a page was
1032
+ * opened from, "" for none: typed, a bookmark, an app.
1033
+ */
1034
+ export interface AppVisits {
1035
+ from: string;
1036
+ to: string;
1037
+ days: ({
1038
+ day: string;
1039
+ } & VisitCounts)[];
1040
+ before: VisitCounts;
1041
+ pages: ({
1042
+ path: string;
1043
+ } & VisitCounts)[];
1044
+ sources: ({
1045
+ source: string;
1046
+ } & VisitCounts)[];
1047
+ }
1014
1048
  /**
1015
1049
  * A secret of an app (ADR 0015), as `GET {APPS_PATH}/:appId/secrets` lists
1016
1050
  * them for its creators: by name, never by value. The app's code writes
package/dist/protocol.js CHANGED
@@ -26,6 +26,7 @@ import {
26
26
  SITE_ICON_TYPES,
27
27
  SITE_LIMITS,
28
28
  SPACE_ROLES,
29
+ VISIT_PERIODS,
29
30
  admit,
30
31
  callableMethods,
31
32
  checkAccess,
@@ -43,7 +44,7 @@ import {
43
44
  secretPlaceholder,
44
45
  signedInAsAsked,
45
46
  spaceRoleOf
46
- } from "./chunks/4HDG5ILC.js";
47
+ } from "./chunks/VBS7QVKG.js";
47
48
  export {
48
49
  APPS_PATH,
49
50
  APP_COMPATIBILITY_DATE,
@@ -72,6 +73,7 @@ export {
72
73
  SITE_ICON_TYPES,
73
74
  SITE_LIMITS,
74
75
  SPACE_ROLES,
76
+ VISIT_PERIODS,
75
77
  admit,
76
78
  callableMethods,
77
79
  checkAccess,
package/dist/schema.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  col,
4
4
  describeTables,
5
5
  schemaOf
6
- } from "./chunks/TKDXT3ZT.js";
7
- import "./chunks/4HDG5ILC.js";
6
+ } from "./chunks/GFYV4PFY.js";
7
+ import "./chunks/VBS7QVKG.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/2W5UWORA.js";
4
- import "./chunks/TKDXT3ZT.js";
3
+ } from "./chunks/OAU5HBAB.js";
4
+ import "./chunks/GFYV4PFY.js";
5
5
  import {
6
6
  MethodError
7
- } from "./chunks/ZQI6BF6U.js";
7
+ } from "./chunks/IECAZUW6.js";
8
8
  import {
9
9
  ERROR_STATUS
10
- } from "./chunks/4HDG5ILC.js";
10
+ } from "./chunks/VBS7QVKG.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/ZQI6BF6U.js";
3
+ } from "./chunks/IECAZUW6.js";
4
4
  import {
5
5
  ERROR_STATUS
6
- } from "./chunks/4HDG5ILC.js";
6
+ } from "./chunks/VBS7QVKG.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.8",
3
+ "version": "7.0.10",
4
4
  "description": "Write a Teable app as a Drizzle schema plus methods",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -54,8 +54,7 @@
54
54
  "bun": ">=1.2"
55
55
  },
56
56
  "publishConfig": {
57
- "access": "public",
58
- "provenance": true
57
+ "access": "public"
59
58
  },
60
59
  "dependencies": {
61
60
  "drizzle-orm": "0.45.4",