Skip to content

Commit 2b830fb

Browse files
tea-artistteable-bot
andauthored
[sync] feat(api): optimize API panel for AI and advanced developers (#941) (#2361)
Synced from teableio/teable-ee@42a0e67 Co-authored-by: teable-bot <[email protected]>
1 parent 07d476d commit 2b830fb

File tree

15 files changed

+1236
-211
lines changed

15 files changed

+1236
-211
lines changed

apps/nestjs-backend/src/features/auth/guard/permission.guard.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,21 +229,13 @@ export class PermissionGuard {
229229
const isAnonymous = this.isAnonymous();
230230
// anonymous user permission check
231231
if (isAnonymous) {
232-
if (!allowAnonymousType) {
233-
throw new UnauthorizedException();
232+
if (allowAnonymousType === AllowAnonymousType.PUBLIC) {
233+
return await this.templatePermissionCheck(context);
234234
}
235-
switch (allowAnonymousType) {
236-
case AllowAnonymousType.PUBLIC:
237-
return await this.templatePermissionCheck(context);
238-
case AllowAnonymousType.RESOURCE:
239-
throw new UnauthorizedException(
240-
'Anonymous resource permission check failed, template header is required'
241-
);
242-
case AllowAnonymousType.USER:
243-
return true;
244-
default:
245-
throw new UnauthorizedException('Invalid allow anonymous type');
235+
if (allowAnonymousType === AllowAnonymousType.USER) {
236+
return true;
246237
}
238+
throw new UnauthorizedException();
247239
}
248240

249241
// normal permission check

apps/nestjs-backend/src/types/i18n.generated.ts

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,20 @@ export type I18nTranslations = {
11551155
"createNewToken": string;
11561156
"showPagination": string;
11571157
"addSort": string;
1158+
"tabs": {
1159+
"apiBuilder": string;
1160+
"aiContext": string;
1161+
};
1162+
"aiContext": {
1163+
"title": string;
1164+
"description": string;
1165+
"selectTableFirst": string;
1166+
"fullContext": string;
1167+
"compactContext": string;
1168+
"copyToClipboard": string;
1169+
"copied": string;
1170+
"compactDescription": string;
1171+
};
11581172
"only10Records": string;
11591173
};
11601174
"oauth": {
@@ -2760,8 +2774,6 @@ export type I18nTranslations = {
27602774
"addIntegration": string;
27612775
"ai": string;
27622776
};
2763-
"collaborators": string;
2764-
"more": string;
27652777
"aiSetting": {
27662778
"title": string;
27672779
"description": string;
@@ -2814,7 +2826,8 @@ export type I18nTranslations = {
28142826
"select": string;
28152827
"descriptionPlaceholder": string;
28162828
"titlePlaceholder": string;
2817-
"toBeFilled": string;
2829+
"toBeFilledTitle": string;
2830+
"toBeFilledDescription": string;
28182831
};
28192832
"publishToCommunity": string;
28202833
"publish": string;
@@ -2841,6 +2854,8 @@ export type I18nTranslations = {
28412854
"publishSuccessDescription": string;
28422855
"shareWith": string;
28432856
};
2857+
"collaborators": string;
2858+
"more": string;
28442859
};
28452860
"system": {
28462861
"notFound": {
@@ -2894,6 +2909,27 @@ export type I18nTranslations = {
28942909
"label": string;
28952910
"restfulApi": string;
28962911
"databaseConnection": string;
2912+
"title": string;
2913+
"aiContext": string;
2914+
"advanced": string;
2915+
"generatingToken": string;
2916+
"aiContextTitle": string;
2917+
"aiContextDescriptionNoToken": string;
2918+
"aiContextDescriptionWithToken": string;
2919+
"generateToken": string;
2920+
"confirmTitle": string;
2921+
"confirmDescription": string;
2922+
"scopeRead": string;
2923+
"scopeCreate": string;
2924+
"scopeUpdate": string;
2925+
"scopeDelete": string;
2926+
"confirmExpiry": string;
2927+
"confirmButton": string;
2928+
"tokenInfo": string;
2929+
"copied": string;
2930+
"copyToClipboard": string;
2931+
"advancedDesc": string;
2932+
"openAdvanced": string;
28972933
};
28982934
"personalView": {
28992935
"personal": string;

0 commit comments

Comments
 (0)