@teable/app 6.1.1 → 6.1.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 +2 -2
- package/dist/build/index.js +2 -2
- package/dist/chunks/{V7ENYEWD.js → H3YCXVRL.js} +1 -1
- package/dist/chunks/{APGIRZ24.js → O6KEZ2KL.js} +2 -2
- package/dist/chunks/{WKI563UT.js → RJHLCJUX.js} +12 -0
- package/dist/chunks/{A27ZPYPU.js → TDLQQFGT.js} +1 -1
- package/dist/chunks/{NOOZYN7X.js → TN5GZDH5.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 +66 -0
- package/dist/protocol.js +9 -3
- 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 "./TN5GZDH5.js";
|
|
4
4
|
import {
|
|
5
5
|
CAPABILITIES,
|
|
6
6
|
PROTOCOL_VERSION,
|
|
7
7
|
admit,
|
|
8
8
|
isPageAccess
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./RJHLCJUX.js";
|
|
10
10
|
|
|
11
11
|
// src/server/errors.ts
|
|
12
12
|
import { z } from "zod";
|
|
@@ -78,6 +78,15 @@ function fileKeyPath(key) {
|
|
|
78
78
|
var DEPLOY_HEADERS = { commit: "X-Teable-Commit", message: "X-Teable-Message" };
|
|
79
79
|
var DEPLOY_PARTS = { server: "server", worker: "worker", pages: "pages" };
|
|
80
80
|
var PAGES_APP_META = "teable-app";
|
|
81
|
+
var SECRET_NAME_PATTERN = "[A-Z][A-Z0-9_]{0,63}";
|
|
82
|
+
var SECRET_NAME = new RegExp(`^${SECRET_NAME_PATTERN}$`);
|
|
83
|
+
function secretPlaceholder(name) {
|
|
84
|
+
return `{{secret:${name}}}`;
|
|
85
|
+
}
|
|
86
|
+
var SECRET_PLACEHOLDER = new RegExp(
|
|
87
|
+
`(?:\\{\\{|%7[Bb]%7[Bb])secret(?::|%3[Aa])(${SECRET_NAME_PATTERN})(?:\\}\\}|%7[Dd]%7[Dd])`,
|
|
88
|
+
"g"
|
|
89
|
+
);
|
|
81
90
|
function checkAccess(caller, access) {
|
|
82
91
|
if (caller.kind === "system") return null;
|
|
83
92
|
if (access === "internal") return "FORBIDDEN";
|
|
@@ -126,6 +135,9 @@ export {
|
|
|
126
135
|
DEPLOY_HEADERS,
|
|
127
136
|
DEPLOY_PARTS,
|
|
128
137
|
PAGES_APP_META,
|
|
138
|
+
SECRET_NAME,
|
|
139
|
+
secretPlaceholder,
|
|
140
|
+
SECRET_PLACEHOLDER,
|
|
129
141
|
checkAccess,
|
|
130
142
|
admit,
|
|
131
143
|
isMember,
|
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/O6KEZ2KL.js";
|
|
5
|
+
import "./chunks/TN5GZDH5.js";
|
|
6
|
+
import "./chunks/RJHLCJUX.js";
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
import { z } from "zod";
|
package/dist/protocol.d.ts
CHANGED
|
@@ -509,6 +509,72 @@ export interface VersionInfo {
|
|
|
509
509
|
/** Whether it is the version that serves the app now. */
|
|
510
510
|
live: boolean;
|
|
511
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* A failure of the app's own, as `GET {APPS_PATH}/:appId/failures` lists
|
|
514
|
+
* them for its creators: what broke in it lately, each failure once, with
|
|
515
|
+
* how often and when last, the latest first. What the app refused (below
|
|
516
|
+
* HTTP 500) is not one: the app did as it was written to.
|
|
517
|
+
*/
|
|
518
|
+
export interface AppFailure {
|
|
519
|
+
/**
|
|
520
|
+
* What failed: a call of one of its methods, a run of one of its tasks, the
|
|
521
|
+
* app starting to run them (`wake`: it could not start, or crashed under
|
|
522
|
+
* them), or its pages' own Worker.
|
|
523
|
+
*/
|
|
524
|
+
kind: "call" | "task" | "wake" | "worker";
|
|
525
|
+
/** The method called, or the task run; null for the others. */
|
|
526
|
+
method: string | null;
|
|
527
|
+
code: ErrorCode;
|
|
528
|
+
message: string;
|
|
529
|
+
/** How many times it failed so, the first time and the last (epoch milliseconds). */
|
|
530
|
+
count: number;
|
|
531
|
+
firstAt: number;
|
|
532
|
+
lastAt: number;
|
|
533
|
+
/** The version that was live the last time; null before the first. */
|
|
534
|
+
version: number | null;
|
|
535
|
+
/** A task's last failure: its attempt, and whether the task gave up then. */
|
|
536
|
+
attempt: number | null;
|
|
537
|
+
dead: boolean | null;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* A secret of an app (ADR 0015), as `GET {APPS_PATH}/:appId/secrets` lists
|
|
541
|
+
* them for its creators: by name, never by value. The app's code writes
|
|
542
|
+
* `{{secret:<name>}}` where the value goes in a request it sends out, and the
|
|
543
|
+
* runtime fills it in as the request leaves, for the hosts the secret may go
|
|
544
|
+
* to. Every secret the live version's code writes is listed, set or not.
|
|
545
|
+
*/
|
|
546
|
+
export interface AppSecret {
|
|
547
|
+
name: string;
|
|
548
|
+
/** Whether it has a value. */
|
|
549
|
+
set: boolean;
|
|
550
|
+
/** Whether the live version's code writes it. */
|
|
551
|
+
used: boolean;
|
|
552
|
+
/** The only hosts it may be sent to (`*.example.com`: any below it); null: any host. */
|
|
553
|
+
hosts: string[] | null;
|
|
554
|
+
/** When it was last set (epoch milliseconds), and by whom; null while it has no value. */
|
|
555
|
+
updatedAt: number | null;
|
|
556
|
+
updatedBy: string | null;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* What `PUT {APPS_PATH}/:appId/secrets/:name` takes: a new value, the hosts
|
|
560
|
+
* it may be sent to, or both; either left out stays as it was. A new secret
|
|
561
|
+
* needs a value, and an empty list of hosts is any host.
|
|
562
|
+
*/
|
|
563
|
+
export interface SecretInput {
|
|
564
|
+
value?: string;
|
|
565
|
+
hosts?: string[] | null;
|
|
566
|
+
}
|
|
567
|
+
/** A secret's name: a capital letter, then capitals, digits and `_`, as `STRIPE_KEY`. */
|
|
568
|
+
export declare const SECRET_NAME: RegExp;
|
|
569
|
+
/** Where a secret's value goes in a request the app sends out, as its code writes it. */
|
|
570
|
+
export declare function secretPlaceholder(name: string): string;
|
|
571
|
+
/**
|
|
572
|
+
* A secret's placeholder as it reaches the runtime: as written, or
|
|
573
|
+
* percent-encoded where a URL's path or a form encoded it
|
|
574
|
+
* (`%7B%7Bsecret%3ANAME%7D%7D`). The name is its first group. Global, for
|
|
575
|
+
* `replace` and `matchAll`.
|
|
576
|
+
*/
|
|
577
|
+
export declare const SECRET_PLACEHOLDER: RegExp;
|
|
512
578
|
/**
|
|
513
579
|
* The one access rule: may this caller invoke a method with this access level?
|
|
514
580
|
* Returns the error code to report, or null when the call is allowed.
|
package/dist/protocol.js
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
FILE_NAME_HEADER,
|
|
13
13
|
PAGES_APP_META,
|
|
14
14
|
PROTOCOL_VERSION,
|
|
15
|
+
SECRET_NAME,
|
|
16
|
+
SECRET_PLACEHOLDER,
|
|
15
17
|
SESSION_PATH,
|
|
16
18
|
SPACE_ROLES,
|
|
17
19
|
admit,
|
|
@@ -21,8 +23,9 @@ import {
|
|
|
21
23
|
fileKeyPath,
|
|
22
24
|
isExposed,
|
|
23
25
|
isMember,
|
|
24
|
-
isPageAccess
|
|
25
|
-
|
|
26
|
+
isPageAccess,
|
|
27
|
+
secretPlaceholder
|
|
28
|
+
} from "./chunks/RJHLCJUX.js";
|
|
26
29
|
export {
|
|
27
30
|
APPS_PATH,
|
|
28
31
|
APP_COMPATIBILITY_DATE,
|
|
@@ -37,6 +40,8 @@ export {
|
|
|
37
40
|
FILE_NAME_HEADER,
|
|
38
41
|
PAGES_APP_META,
|
|
39
42
|
PROTOCOL_VERSION,
|
|
43
|
+
SECRET_NAME,
|
|
44
|
+
SECRET_PLACEHOLDER,
|
|
40
45
|
SESSION_PATH,
|
|
41
46
|
SPACE_ROLES,
|
|
42
47
|
admit,
|
|
@@ -46,5 +51,6 @@ export {
|
|
|
46
51
|
fileKeyPath,
|
|
47
52
|
isExposed,
|
|
48
53
|
isMember,
|
|
49
|
-
isPageAccess
|
|
54
|
+
isPageAccess,
|
|
55
|
+
secretPlaceholder
|
|
50
56
|
};
|
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/O6KEZ2KL.js";
|
|
4
|
+
import "./chunks/TN5GZDH5.js";
|
|
5
5
|
import {
|
|
6
6
|
MethodError
|
|
7
|
-
} from "./chunks/
|
|
7
|
+
} from "./chunks/TDLQQFGT.js";
|
|
8
8
|
import {
|
|
9
9
|
ERROR_STATUS
|
|
10
|
-
} from "./chunks/
|
|
10
|
+
} from "./chunks/RJHLCJUX.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