@tunasand/sdk 0.8.0 → 0.11.0
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/CHANGELOG.md +121 -0
- package/README.md +162 -143
- package/dist/analytics.js +76 -65
- package/dist/app.js +184 -163
- package/dist/apps-DIxAWBSZ.js +318 -0
- package/dist/astro-image.d.ts +1 -0
- package/dist/astro-image.js +33 -0
- package/dist/astro-server-Bwau8F6d.js +99 -0
- package/dist/astro-server.d.ts +1 -0
- package/dist/astro-server.js +1 -0
- package/dist/astro.d.ts +1 -0
- package/dist/astro.js +306 -0
- package/dist/bridge-Dv4NxGZ7.js +81 -0
- package/dist/bridge.js +1 -13
- package/dist/build-file-DNi0PHC5.js +31 -0
- package/dist/cli.js +6212 -8
- package/dist/{client-Derrexwr.js → client-C8STAw9T.js} +43 -24
- package/dist/code-N8pBUDbq.js +30 -0
- package/dist/code.d.ts +1 -0
- package/dist/code.js +1 -0
- package/dist/collection-nUz1RetA.js +264 -0
- package/dist/{declared-DuNMsdXw.js → declared-CE4a61qb.js} +35 -35
- package/dist/delivery.js +121 -114
- package/dist/dev-operations-Tutwi1On.js +46 -0
- package/dist/dev.js +9 -16
- package/dist/embeds-B-Dbn64k.js +29 -0
- package/dist/end-users.d.ts +1 -0
- package/dist/end-users.js +185 -0
- package/dist/endUsers-DODfjnv1.js +77 -0
- package/dist/{errorLabels-BgtQ_zUn.js → errorLabels-aT2bnMsO.js} +355 -235
- package/dist/i18n.js +4 -4
- package/dist/ids-DmtIoqBX.js +109 -0
- package/dist/integrations.js +95 -24
- package/dist/{ja-Du6ooL6i.js → ja-CrY_72Tn.js} +88 -44
- package/dist/{ja-CeHU0EaY.js → ja-axQPxMJ-.js} +3 -3
- package/dist/operations-CIB99rIY.js +95 -0
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +1 -0
- package/dist/{page-Bzrj24sJ.js → page-yo1cw1kW.js} +1 -1
- package/dist/preview.js +8 -1
- package/dist/{profile-1em_lcxq.js → profile-DBsXLvvI.js} +48 -48
- package/dist/rich-text.js +16 -16
- package/dist/{schema-WnobuwLg.js → schema-Dcg1ajnW.js} +496 -263
- package/dist/schema.js +66 -88
- package/dist/types/access/src/handoff.d.ts +19 -14
- package/dist/types/access/src/index.d.ts +2 -2
- package/dist/types/access/src/jws.d.ts +41 -0
- package/dist/types/access/src/oidc.d.ts +10 -2
- package/dist/types/access/src/signed.d.ts +0 -2
- package/dist/types/adapter-cloudflare/src/eventLog/viewSchema.d.ts +11 -0
- package/dist/types/contract/src/accountProfile.d.ts +7 -0
- package/dist/types/contract/src/apiKeys.d.ts +6 -2
- package/dist/types/contract/src/app.d.ts +15 -5
- package/dist/types/contract/src/appChannels.d.ts +114 -0
- package/dist/types/contract/src/appDefinition.d.ts +11 -5
- package/dist/types/contract/src/appDependencies.d.ts +87 -24
- package/dist/types/contract/src/appIdentities.d.ts +21 -0
- package/dist/types/contract/src/appInbound.d.ts +28 -0
- package/dist/types/contract/src/appMail.d.ts +106 -0
- package/dist/types/contract/src/appSecrets.d.ts +45 -0
- package/dist/types/contract/src/appServer.d.ts +408 -43
- package/dist/types/contract/src/approvals.d.ts +1 -1
- package/dist/types/contract/src/apps.d.ts +112 -55
- package/dist/types/contract/src/auditActions.d.ts +2 -2
- package/dist/types/contract/src/auditLabels.d.ts +111 -15
- package/dist/types/contract/src/authorize.d.ts +42 -14
- package/dist/types/contract/src/bridge.d.ts +34 -35
- package/dist/types/contract/src/consents.d.ts +32 -25
- package/dist/types/contract/src/deletion.d.ts +18 -0
- package/dist/types/contract/src/embeds.d.ts +16 -82
- package/dist/types/contract/src/{customerLabels.d.ts → endUserLabels.d.ts} +6 -9
- package/dist/types/contract/src/endUsers.d.ts +241 -0
- package/dist/types/contract/src/errorLabels.d.ts +63 -36
- package/dist/types/contract/src/errorLabelsEn.d.ts +46 -32
- package/dist/types/contract/src/errors.d.ts +28 -16
- package/dist/types/contract/src/eventSchemas.d.ts +70 -0
- package/dist/types/contract/src/eventTraces.d.ts +43 -0
- package/dist/types/contract/src/failureStatus.d.ts +14 -22
- package/dist/types/contract/src/fieldAccess.d.ts +8 -8
- package/dist/types/contract/src/formLabels.d.ts +3 -0
- package/dist/types/contract/src/forms.d.ts +4 -0
- package/dist/types/contract/src/grants.d.ts +26 -0
- package/dist/types/contract/src/headers.d.ts +5 -0
- package/dist/types/contract/src/hostingRpc.d.ts +23 -17
- package/dist/types/contract/src/identifiers.d.ts +45 -17
- package/dist/types/contract/src/ids.d.ts +18 -10
- package/dist/types/contract/src/import.d.ts +17 -16
- package/dist/types/contract/src/index.d.ts +52 -27
- package/dist/types/contract/src/integrationGraph.d.ts +83 -0
- package/dist/types/contract/src/issueLabels.d.ts +113 -81
- package/dist/types/contract/src/issueLabelsEn.d.ts +57 -41
- package/dist/types/contract/src/manage.d.ts +11 -7
- package/dist/types/contract/src/manageLabels.d.ts +2 -0
- package/dist/types/contract/src/manifestText.d.ts +66 -0
- package/dist/types/contract/src/messagePort.d.ts +208 -0
- package/dist/types/contract/src/migration.d.ts +2 -2
- package/dist/types/contract/src/notices.d.ts +38 -0
- package/dist/types/contract/src/operatorOperations.d.ts +0 -63
- package/dist/types/contract/src/outbound.d.ts +29 -0
- package/dist/types/contract/src/paths.d.ts +13 -0
- package/dist/types/contract/src/pending.d.ts +2 -0
- package/dist/types/contract/src/permissions.d.ts +7 -11
- package/dist/types/contract/src/perspective.d.ts +26 -0
- package/dist/types/contract/src/powers.d.ts +5 -0
- package/dist/types/contract/src/principal.d.ts +127 -56
- package/dist/types/contract/src/recordLabels.d.ts +6 -0
- package/dist/types/contract/src/roles.d.ts +7 -4
- package/dist/types/contract/src/ruleLabels.d.ts +16 -0
- package/dist/types/contract/src/ruleProblems.d.ts +16 -0
- package/dist/types/contract/src/schemaLabels.d.ts +8 -0
- package/dist/types/contract/src/settingProblems.d.ts +1 -1
- package/dist/types/contract/src/settings.d.ts +5 -7
- package/dist/types/contract/src/siteDeclaration.d.ts +7 -7
- package/dist/types/contract/src/siteIndex.d.ts +76 -0
- package/dist/types/contract/src/transfer.d.ts +1 -1
- package/dist/types/contract/src/trial.d.ts +4 -1
- package/dist/types/contract/src/versions.d.ts +1 -3
- package/dist/types/contract/src/viewEvent.d.ts +0 -9
- package/dist/types/contract/src/webhooks.d.ts +24 -3
- package/dist/types/contract/src/workflow.d.ts +13 -19
- package/dist/types/contract/src/workspaceItems.d.ts +20 -6
- package/dist/types/rich-text/src/html.d.ts +1 -1
- package/dist/types/rich-text/src/index.d.ts +8 -7
- package/dist/types/rich-text/src/labels/en.d.ts +1 -1
- package/dist/types/rich-text/src/labels/ja.d.ts +2 -2
- package/dist/types/rich-text/src/library.d.ts +1 -1
- package/dist/types/rich-text/src/media.d.ts +2 -0
- package/dist/types/rich-text/src/normalize.d.ts +1 -1
- package/dist/types/rich-text/src/problems.d.ts +5 -5
- package/dist/types/rich-text/src/profile.d.ts +10 -10
- package/dist/types/rich-text/src/render.d.ts +1 -1
- package/dist/types/rich-text/src/schema.d.ts +2 -2
- package/dist/types/rich-text/src/standard.d.ts +4 -4
- package/dist/types/rich-text/src/types.d.ts +2 -2
- package/dist/types/schema/src/audience.d.ts +1 -3
- package/dist/types/schema/src/capabilities.d.ts +18 -27
- package/dist/types/schema/src/changes.d.ts +3 -1
- package/dist/types/schema/src/collection.d.ts +138 -111
- package/dist/types/schema/src/defaultSchema.d.ts +8 -2
- package/dist/types/schema/src/fieldIds.d.ts +18 -0
- package/dist/types/schema/src/file.d.ts +22 -11
- package/dist/types/schema/src/fileRefs.d.ts +14 -0
- package/dist/types/schema/src/fileSignature.d.ts +20 -0
- package/dist/types/schema/src/filesCollection.d.ts +7 -0
- package/dist/types/schema/src/forms.d.ts +43 -0
- package/dist/types/schema/src/imageMetadata.d.ts +9 -0
- package/dist/types/schema/src/index.d.ts +18 -10
- package/dist/types/schema/src/input.d.ts +1 -1
- package/dist/types/schema/src/integrity.d.ts +8 -7
- package/dist/types/schema/src/kinds.d.ts +26 -0
- package/dist/types/schema/src/labels/en.d.ts +87 -46
- package/dist/types/schema/src/labels/ja.d.ts +89 -45
- package/dist/types/schema/src/mediaUrl.d.ts +26 -33
- package/dist/types/schema/src/page.d.ts +4 -4
- package/dist/types/schema/src/problems.d.ts +82 -41
- package/dist/types/schema/src/refs.d.ts +0 -9
- package/dist/types/schema/src/schema.d.ts +17 -12
- package/dist/types/schema/src/selfOps.d.ts +20 -19
- package/dist/types/schema/src/traits.d.ts +28 -0
- package/dist/types/schema/src/typesSource.d.ts +1 -1
- package/dist/types/schema/src/values.d.ts +5 -2
- package/dist/types/schema/src/widening.d.ts +3 -0
- package/dist/types/sdk/src/analytics.d.ts +2 -1
- package/dist/types/sdk/src/app.d.ts +40 -14
- package/dist/types/sdk/src/astro-image.d.ts +19 -0
- package/dist/types/sdk/src/astro-response.d.ts +6 -0
- package/dist/types/sdk/src/astro-server.d.ts +16 -0
- package/dist/types/sdk/src/astro.d.ts +19 -0
- package/dist/types/sdk/src/bridge.d.ts +2 -4
- package/dist/types/sdk/src/code.d.ts +61 -0
- package/dist/types/sdk/src/delegation.d.ts +13 -3
- package/dist/types/sdk/src/delivery/changes.d.ts +4 -4
- package/dist/types/sdk/src/delivery/client.d.ts +33 -22
- package/dist/types/sdk/src/delivery/fields.d.ts +3 -3
- package/dist/types/sdk/src/delivery/index.d.ts +3 -3
- package/dist/types/sdk/src/delivery/media.d.ts +5 -8
- package/dist/types/sdk/src/delivery/query.d.ts +15 -11
- package/dist/types/sdk/src/delivery/schema.d.ts +1 -1
- package/dist/types/sdk/src/delivery/values.d.ts +10 -14
- package/dist/types/sdk/src/delivery.d.ts +2 -2
- package/dist/types/sdk/src/dev-operations.d.ts +20 -0
- package/dist/types/sdk/src/dev.d.ts +6 -5
- package/dist/types/sdk/src/end-users.d.ts +190 -0
- package/dist/types/sdk/src/i18n.d.ts +2 -2
- package/dist/types/sdk/src/integrations.d.ts +14 -21
- package/dist/types/sdk/src/operations.d.ts +17 -0
- package/dist/types/sdk/src/preview.d.ts +2 -1
- package/dist/types/sdk/src/rich-text.d.ts +2 -2
- package/dist/types/sdk/src/schema.d.ts +1 -1
- package/dist/types/sdk/src/site/artifact.d.ts +64 -0
- package/dist/types/sdk/src/site/build-file.d.ts +30 -0
- package/dist/types/sdk/src/site/check-code.d.ts +14 -0
- package/dist/types/sdk/src/site/check-text.d.ts +19 -0
- package/dist/types/sdk/src/site/cli.d.ts +52 -0
- package/dist/types/sdk/src/site/content-type.d.ts +2 -0
- package/dist/types/sdk/src/site/labels.d.ts +14 -0
- package/dist/types/sdk/src/types.d.ts +1 -1
- package/dist/{types-B77qvqPJ.js → types-DkO2N7u2.js} +5 -6
- package/dist/types.js +1 -1
- package/dist/{typesSource-CWybQYus.js → typesSource-VJIxtN9b.js} +17 -15
- package/dist/workflow-CUpl6hO_.js +148 -0
- package/package.json +32 -6
- package/dist/apps-BxnJ1RlU.js +0 -435
- package/dist/bridge-DtHw9hS6.js +0 -74
- package/dist/collection-BEOxeISR.js +0 -189
- package/dist/customers-DTbL0qn6.js +0 -86
- package/dist/customers.d.ts +0 -1
- package/dist/customers.js +0 -185
- package/dist/embeds-B5V54Zur.js +0 -34
- package/dist/ids--RF7hGyC.js +0 -36
- package/dist/src-sazhzYui.js +0 -71
- package/dist/types/contract/src/customers.d.ts +0 -266
- package/dist/types/schema/src/legacy.d.ts +0 -2
- package/dist/types/schema/src/media.d.ts +0 -5
- package/dist/types/sdk/src/customers.d.ts +0 -184
|
@@ -373,30 +373,6 @@ export declare const OPERATOR_OPERATIONS: readonly [{
|
|
|
373
373
|
};
|
|
374
374
|
readonly when: "notLive";
|
|
375
375
|
readonly available: true;
|
|
376
|
-
}, {
|
|
377
|
-
readonly id: "schema-plan";
|
|
378
|
-
readonly cli: "schema-plan";
|
|
379
|
-
readonly method: "POST";
|
|
380
|
-
readonly path: "/projects/{project}/schema-plan";
|
|
381
|
-
readonly level: "read";
|
|
382
|
-
readonly place: {
|
|
383
|
-
readonly screen: "project";
|
|
384
|
-
readonly tab: OperatorProjectTab;
|
|
385
|
-
};
|
|
386
|
-
readonly when: "notLive";
|
|
387
|
-
readonly available: true;
|
|
388
|
-
}, {
|
|
389
|
-
readonly id: "schema-commit";
|
|
390
|
-
readonly cli: "schema-commit";
|
|
391
|
-
readonly method: "POST";
|
|
392
|
-
readonly path: "/projects/{project}/schema-commit";
|
|
393
|
-
readonly level: "heavy";
|
|
394
|
-
readonly place: {
|
|
395
|
-
readonly screen: "project";
|
|
396
|
-
readonly tab: OperatorProjectTab;
|
|
397
|
-
};
|
|
398
|
-
readonly when: "notLive";
|
|
399
|
-
readonly available: true;
|
|
400
376
|
}, {
|
|
401
377
|
readonly id: "prune";
|
|
402
378
|
readonly cli: "prune";
|
|
@@ -410,45 +386,6 @@ export declare const OPERATOR_OPERATIONS: readonly [{
|
|
|
410
386
|
readonly environment: true;
|
|
411
387
|
readonly dryRun: true;
|
|
412
388
|
readonly available: true;
|
|
413
|
-
}, {
|
|
414
|
-
readonly id: "account-moves";
|
|
415
|
-
readonly cli: "account-moves";
|
|
416
|
-
readonly method: "POST";
|
|
417
|
-
readonly path: "/projects/{project}/account-moves";
|
|
418
|
-
readonly level: "irreversible";
|
|
419
|
-
readonly place: {
|
|
420
|
-
readonly screen: "project";
|
|
421
|
-
readonly tab: OperatorProjectTab;
|
|
422
|
-
};
|
|
423
|
-
readonly environment: true;
|
|
424
|
-
readonly dryRun: true;
|
|
425
|
-
readonly available: true;
|
|
426
|
-
}, {
|
|
427
|
-
readonly id: "installation-moves";
|
|
428
|
-
readonly cli: "installation-moves";
|
|
429
|
-
readonly method: "POST";
|
|
430
|
-
readonly path: "/projects/{project}/installation-moves";
|
|
431
|
-
readonly level: "irreversible";
|
|
432
|
-
readonly place: {
|
|
433
|
-
readonly screen: "project";
|
|
434
|
-
readonly tab: OperatorProjectTab;
|
|
435
|
-
};
|
|
436
|
-
readonly environment: true;
|
|
437
|
-
readonly dryRun: true;
|
|
438
|
-
readonly available: true;
|
|
439
|
-
}, {
|
|
440
|
-
readonly id: "standard-app-moves";
|
|
441
|
-
readonly cli: "standard-app-moves";
|
|
442
|
-
readonly method: "POST";
|
|
443
|
-
readonly path: "/projects/{project}/standard-app-moves";
|
|
444
|
-
readonly level: "irreversible";
|
|
445
|
-
readonly place: {
|
|
446
|
-
readonly screen: "project";
|
|
447
|
-
readonly tab: OperatorProjectTab;
|
|
448
|
-
};
|
|
449
|
-
readonly environment: true;
|
|
450
|
-
readonly dryRun: true;
|
|
451
|
-
readonly available: true;
|
|
452
389
|
}, {
|
|
453
390
|
readonly id: "backups";
|
|
454
391
|
readonly cli: "backups";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** 外への要求のメソッド */
|
|
2
|
+
export declare const APP_OUTBOUND_METHODS: readonly ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"];
|
|
3
|
+
export type AppOutboundMethod = (typeof APP_OUTBOUND_METHODS)[number];
|
|
4
|
+
/**
|
|
5
|
+
* 外への要求に秘密値を載せる指定
|
|
6
|
+
* - secret: アプリの秘密値のキー、header: 載せるヘッダーの名前(小文字)、scheme: 値の前に空白で付ける語(Bearer など)
|
|
7
|
+
*/
|
|
8
|
+
export type AppOutboundAuth = Readonly<{
|
|
9
|
+
secret: string;
|
|
10
|
+
header: string;
|
|
11
|
+
scheme?: string;
|
|
12
|
+
}>;
|
|
13
|
+
/** 外への要求の宣言(origin は https のオリジン、path は / から始まる経路の前方一致) */
|
|
14
|
+
export type AppOutbound = Readonly<{
|
|
15
|
+
origin: string;
|
|
16
|
+
method: AppOutboundMethod;
|
|
17
|
+
path: string;
|
|
18
|
+
auth?: AppOutboundAuth;
|
|
19
|
+
}>;
|
|
20
|
+
/** 宣言の上限(経路の字数) */
|
|
21
|
+
export declare const APP_OUTBOUND_LIMITS: {
|
|
22
|
+
readonly pathMaxChars: 200;
|
|
23
|
+
};
|
|
24
|
+
/** 宣言の1件の誤りの箇所(なければ null) */
|
|
25
|
+
export declare function outboundProblem(input: unknown): string | null;
|
|
26
|
+
/** 宣言の能力の要素 */
|
|
27
|
+
export declare const outboundCapabilityOf: (o: AppOutbound) => string;
|
|
28
|
+
/** 要求に当たる宣言(https でポートの指定なし、資格を含まない URL だけ。なければ null) */
|
|
29
|
+
export declare function outboundFor(declared: readonly AppOutbound[], method: string, url: URL): AppOutbound | null;
|
|
@@ -19,3 +19,16 @@ export declare function envPathOf(pathname: string): Readonly<{
|
|
|
19
19
|
export declare function withEnvPrefix(path: string, opened: string): string;
|
|
20
20
|
/** サーバーが受け持つパスか(パスの頭と一致、または頭の下、運営者の経路を含む。環境を選ぶ頭の下は運営者の経路を除く) */
|
|
21
21
|
export declare const isServerPath: (pathname: string) => boolean;
|
|
22
|
+
/** プロジェクトの公開の API のホスト名(publicHost はカンマ区切りの先頭が正) */
|
|
23
|
+
export declare const publicApiHostOf: (publicHost: string, projectId: string) => string;
|
|
24
|
+
/** 公開の API のホスト名のプロジェクトの ID(公開の API のホストでなければ null。publicHost はカンマ区切り) */
|
|
25
|
+
export declare function projectOfPublicHost(hostname: string, publicHost: string | undefined): string | null;
|
|
26
|
+
/** 公開の API の基点のパス */
|
|
27
|
+
export declare const PUBLIC_API_BASE = "/v1";
|
|
28
|
+
/** 公開の API の環境を選ぶ段(/v1/environments/<環境の ID>/…、省略は本番) */
|
|
29
|
+
export declare const PUBLIC_ENV_SEGMENT = "/environments";
|
|
30
|
+
/** 公開の API のパスの分解(environment は環境の段の値で省略は null、path は環境の段を除いたパス。/v1 の外は null) */
|
|
31
|
+
export declare function publicApiPathOf(pathname: string): Readonly<{
|
|
32
|
+
environment: string | null;
|
|
33
|
+
path: string;
|
|
34
|
+
}> | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Subject } from './principal.js';
|
|
2
2
|
/** 操作 */
|
|
3
3
|
export declare const ACTIONS: readonly ["read", "create", "update", "publish", "delete"];
|
|
4
4
|
/** 操作 */
|
|
@@ -15,13 +15,12 @@ export type Permissions = Readonly<Record<string, Readonly<Partial<Record<Action
|
|
|
15
15
|
export declare const ANY_TARGET = "*";
|
|
16
16
|
/** 権限の表の和(対象と操作ごとに、LEVELS の並びで先の段階。付与ごとのロールの実効の権限) */
|
|
17
17
|
export declare function permissionsUnion(tables: readonly Permissions[]): Permissions;
|
|
18
|
-
type Holder = Pick<User, 'permissions'> & Partial<Pick<User, 'role' | 'operator' | 'app' | 'mcp'>>;
|
|
19
18
|
/** 対象と操作の段階 */
|
|
20
|
-
export declare const levelOf: (user:
|
|
19
|
+
export declare const levelOf: (user: Subject, target: string, action: Action) => Level;
|
|
21
20
|
/** 対象の操作に、どれかの段階(自分のものだけ、承認が必要を含む)で届くか(レコードを読む前の入口の判定、判定は authorizeReach) */
|
|
22
|
-
export declare const reaches: (user:
|
|
21
|
+
export declare const reaches: (user: Subject, target: string, action: Action) => boolean;
|
|
23
22
|
/** 操作できるか(owned は自分が持ち主の行か、承認が必要は不可。判定は判定の関数 authorize) */
|
|
24
|
-
export declare const allows: (user:
|
|
23
|
+
export declare const allows: (user: Subject, target: string, action: Action, owned?: boolean) => boolean;
|
|
25
24
|
/**
|
|
26
25
|
* 非公開のコレクション(個人の情報を持つコレクション)の権限: 表にない操作に既定の '*' を当てない
|
|
27
26
|
* - closed: すべての操作を不可にする(MCP からの要求、AI に個人の情報を渡さない)
|
|
@@ -34,9 +33,9 @@ export type RowAccess = Readonly<{
|
|
|
34
33
|
published: boolean;
|
|
35
34
|
}>;
|
|
36
35
|
/** レコードを閲覧できるか */
|
|
37
|
-
export declare const canReadRow: (user:
|
|
36
|
+
export declare const canReadRow: (user: Subject, target: string, row: RowAccess) => boolean;
|
|
38
37
|
/** レコードを変更・削除できるか(公開中のレコードは公開の権限も必要) */
|
|
39
|
-
export declare const canChangeRow: (user:
|
|
38
|
+
export declare const canChangeRow: (user: Subject, target: string, action: "update" | "delete", row: RowAccess) => boolean;
|
|
40
39
|
/**
|
|
41
40
|
* 権限の表の検査(不正な値は理由の文の配列)
|
|
42
41
|
* - targets: 対象の id('*' は常に可)
|
|
@@ -51,15 +50,13 @@ export type AccountLink = Readonly<{
|
|
|
51
50
|
collection: string | null;
|
|
52
51
|
owners: Readonly<Record<string, string>>;
|
|
53
52
|
}>;
|
|
54
|
-
type Owner = Pick<User, 'id' | 'recordId' | 'link'>;
|
|
55
53
|
/**
|
|
56
54
|
* レコードの持ち主か
|
|
57
55
|
* - 持ち主の項目がある対象: 項目の値に、アカウントが結び付くレコードを含む
|
|
58
56
|
* - 結び付くコレクションのレコード: 結び付くレコードそのもの
|
|
59
57
|
* - ほかの対象: 作成したアカウント(レコードの created_by、アカウントの ID)
|
|
60
58
|
*/
|
|
61
|
-
export declare const ownsRow: (user:
|
|
62
|
-
type Subject = Pick<User, 'permissions' | 'id' | 'recordId' | 'link'>;
|
|
59
|
+
export declare const ownsRow: (user: Subject, target: string, row: Readonly<Record<string, unknown>>) => boolean;
|
|
63
60
|
/** 権限の判定で使用するレコードの値(レコードのまま、持ち主の項目を含む) */
|
|
64
61
|
export type ContentAccess = Readonly<Record<string, unknown>> & Readonly<{
|
|
65
62
|
status: string;
|
|
@@ -76,4 +73,3 @@ export declare const canPublishContent: (user: Subject, target: string, a: Conte
|
|
|
76
73
|
export declare const canSubmitContent: (user: Subject, target: string, a: ContentAccess) => boolean;
|
|
77
74
|
/** レコードを削除できるか */
|
|
78
75
|
export declare const canDeleteContent: (user: Subject, target: string, a: ContentAccess) => boolean;
|
|
79
|
-
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配信 API の読む版の選択(クエリ)
|
|
3
|
+
* - perspective: published(既定、公開中の版)か latest(公開していない編集を含む最新の版)
|
|
4
|
+
* - revision: 1件の経路だけ、変更の履歴の ID の版
|
|
5
|
+
* - at: 指定の時刻(今以後)に公開中になる版(公開中に、その時刻までに当たる予約を重ねる)
|
|
6
|
+
* - published 以外は未公開の読み取りの権限(read_drafts)が要る
|
|
7
|
+
*/
|
|
8
|
+
export declare const PERSPECTIVES: readonly ["published", "latest"];
|
|
9
|
+
export type PerspectiveName = (typeof PERSPECTIVES)[number];
|
|
10
|
+
/** 読む版の選択のクエリの名前 */
|
|
11
|
+
export declare const PERSPECTIVE_QUERY: {
|
|
12
|
+
readonly perspective: "perspective";
|
|
13
|
+
readonly revision: "revision";
|
|
14
|
+
readonly at: "at";
|
|
15
|
+
};
|
|
16
|
+
/** 管理の API と画面の読み取りのトークン(collections はコレクションの id、* はすべて。tail は末尾だけ) */
|
|
17
|
+
export type ReadToken = Readonly<{
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
collections: readonly string[];
|
|
21
|
+
tail: string;
|
|
22
|
+
expiresAt: string;
|
|
23
|
+
createdBy: string | null;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
revokedAt: string | null;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Capabilities, PrincipalContext } from './principal.js';
|
|
2
|
+
/** 主体の権限を超える能力(<対象>:<操作>。管理者は超えない。知らない操作は、管理者のほかは超えるとする) */
|
|
3
|
+
export declare function capabilitiesBeyond(principal: PrincipalContext, capabilities: Capabilities): string[];
|
|
4
|
+
/** 別名を含む鍵の操作のすべてが、判定の操作に展開できるか(操作を足したときの検査) */
|
|
5
|
+
export declare const unknownKeyOperations: () => string[];
|
|
@@ -1,110 +1,181 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EndUserProof } from '../../schema/src/index.js';
|
|
2
2
|
import type { ActorKind, AuditVia } from './identifiers.js';
|
|
3
|
+
import type { Ceiling } from './grants.js';
|
|
3
4
|
import type { InfraId } from './ids.js';
|
|
4
|
-
import type { Permissions } from './permissions.js';
|
|
5
|
+
import type { AccountLink, Permissions } from './permissions.js';
|
|
5
6
|
/** アカウントの種類(レジストリの accounts.kind) */
|
|
6
7
|
export declare const ACCOUNT_KINDS: readonly ["person", "agent", "app"];
|
|
7
8
|
/** アカウントの種類 */
|
|
8
9
|
export type AccountKind = (typeof ACCOUNT_KINDS)[number];
|
|
9
10
|
/** 鍵とアプリのアカウントの能力(対象から操作の配列) */
|
|
10
11
|
export type Capabilities = Readonly<Record<string, readonly string[]>>;
|
|
11
|
-
/**
|
|
12
|
-
export type
|
|
12
|
+
/** 人とエージェントのアカウント(recordId は結び付くレコード、link は結び付きの設定、support はサポートのアクセスの許可の ID) */
|
|
13
|
+
export type PersonAccount = Readonly<{
|
|
13
14
|
kind: Exclude<AccountKind, 'app'>;
|
|
14
15
|
id: string;
|
|
15
|
-
|
|
16
|
+
email: string;
|
|
17
|
+
role: string;
|
|
18
|
+
roleLabel: string;
|
|
19
|
+
recordId: string | null;
|
|
20
|
+
link: AccountLink;
|
|
21
|
+
support: string | null;
|
|
22
|
+
}>;
|
|
23
|
+
/** アプリのアカウント(インストール済みアプリと1対1) */
|
|
24
|
+
export type AppAccount = Readonly<{
|
|
16
25
|
kind: 'app';
|
|
17
|
-
installationId: InfraId<'installation'
|
|
26
|
+
installationId: InfraId<'installation'>;
|
|
18
27
|
}>;
|
|
19
|
-
/**
|
|
28
|
+
/** インストール済みアプリに属さない資格(API キー、読み取りのトークン、プレビューのチケット。id は資格の ID) */
|
|
29
|
+
export type CredentialAccount = Readonly<{
|
|
30
|
+
kind: 'credential';
|
|
31
|
+
id: string;
|
|
32
|
+
}>;
|
|
33
|
+
/** 処理ごとに宣言した主体(id は処理の名前) */
|
|
34
|
+
export type ProcessAccount = Readonly<{
|
|
35
|
+
kind: 'process';
|
|
36
|
+
id: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** 主体のアカウント */
|
|
39
|
+
export type PrincipalAccount = PersonAccount | AppAccount | CredentialAccount | ProcessAccount;
|
|
40
|
+
/** 委任の付与(ロール、ロールの権限の表、その付与と親の付与の上限) */
|
|
41
|
+
export type DelegatedGrant = Readonly<{
|
|
42
|
+
role: string;
|
|
43
|
+
permissions: Permissions;
|
|
44
|
+
ceilings: readonly Ceiling[];
|
|
45
|
+
}>;
|
|
46
|
+
/** ロールの表の実効の権限(permissions と admin は直接の付与だけ。delegated は委任の付与で、委任を認める操作の判定だけが使う) */
|
|
20
47
|
export type RoleEffective = Readonly<{
|
|
21
48
|
form: 'roles';
|
|
22
49
|
permissions: Permissions;
|
|
23
50
|
admin: boolean;
|
|
51
|
+
delegated: readonly DelegatedGrant[];
|
|
24
52
|
}>;
|
|
25
53
|
/** 能力の実効の権限 */
|
|
26
54
|
export type CapabilityEffective = Readonly<{
|
|
27
55
|
form: 'capabilities';
|
|
28
56
|
capabilities: Capabilities;
|
|
29
57
|
}>;
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
* - app: アプリのアカウントの資格。consented は同意の記録の能力で * を残した形(項目の見える範囲の判定でコレクションの名指しを見る)
|
|
33
|
-
* - mcp_client: MCP の接続。staffCollections は MCP にスタッフの項目を出すコレクション(プロジェクトの設定、ロールの権限は広げない)
|
|
34
|
-
*/
|
|
35
|
-
export type AccountDelegation = Readonly<{
|
|
58
|
+
/** アプリのアカウントの資格の代理(consented は同意の記録の能力で * を残した形、項目の見える範囲の判定でコレクションの名指しを見る。withheld は閲覧を外した対象) */
|
|
59
|
+
export type AppDelegation = Readonly<{
|
|
36
60
|
kind: 'app';
|
|
61
|
+
client: string;
|
|
37
62
|
installationId: InfraId<'installation'>;
|
|
38
63
|
capabilities: Capabilities;
|
|
39
64
|
consented: Capabilities;
|
|
40
|
-
|
|
65
|
+
withheld: readonly string[];
|
|
66
|
+
}>;
|
|
67
|
+
/** MCP の接続の代理(rolePermissions は範囲で絞る前のロールの表、staffCollections は MCP にスタッフの項目を出すコレクション) */
|
|
68
|
+
export type McpDelegation = Readonly<{
|
|
41
69
|
kind: 'mcp_client';
|
|
70
|
+
grant: string;
|
|
71
|
+
client: string;
|
|
42
72
|
capabilities: Capabilities;
|
|
73
|
+
rolePermissions: Permissions;
|
|
43
74
|
staffCollections: readonly string[];
|
|
44
75
|
}>;
|
|
45
|
-
/**
|
|
46
|
-
export type
|
|
47
|
-
|
|
76
|
+
/** アカウントの代理(委ねた能力でロールの表を狭める) */
|
|
77
|
+
export type AccountDelegation = AppDelegation | McpDelegation;
|
|
78
|
+
/** エンドユーザーの代理(endUserId は本人の ID、proof は本人の確認の方法。名前と形は tunasand#812) */
|
|
79
|
+
export type EndUserPrincipal = Readonly<{
|
|
80
|
+
kind: 'on_behalf_of_end_user';
|
|
48
81
|
capabilities: Capabilities;
|
|
49
|
-
|
|
50
|
-
proof:
|
|
82
|
+
endUserId: string;
|
|
83
|
+
proof: EndUserProof;
|
|
51
84
|
}>;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
85
|
+
declare class Seal {
|
|
86
|
+
#private;
|
|
87
|
+
}
|
|
88
|
+
/** 人とエージェントの主体の形 */
|
|
89
|
+
export type PersonShape = Readonly<{
|
|
90
|
+
account: PersonAccount;
|
|
57
91
|
effective: RoleEffective;
|
|
58
92
|
chain: readonly [] | readonly [AccountDelegation];
|
|
59
|
-
via: AuditVia
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
93
|
+
via: AuditVia;
|
|
94
|
+
}>;
|
|
95
|
+
/** 能力を持つ主体の形 */
|
|
96
|
+
export type CapabilityShape = Readonly<{
|
|
97
|
+
account: AppAccount | CredentialAccount | ProcessAccount;
|
|
64
98
|
effective: CapabilityEffective;
|
|
65
|
-
chain: readonly [] | readonly [
|
|
99
|
+
chain: readonly [] | readonly [EndUserPrincipal];
|
|
66
100
|
via: AuditVia | null;
|
|
67
101
|
}>;
|
|
102
|
+
/** 人とエージェントの主体の文脈 */
|
|
103
|
+
export type PersonPrincipal = Seal & PersonShape;
|
|
104
|
+
/** 能力の主体の文脈(インストール済みアプリ、資格、処理) */
|
|
105
|
+
export type CapabilityPrincipal = Seal & CapabilityShape;
|
|
68
106
|
/** アプリのアカウントの主体の文脈 */
|
|
69
|
-
export type AppPrincipal =
|
|
70
|
-
|
|
107
|
+
export type AppPrincipal = CapabilityPrincipal & Readonly<{
|
|
108
|
+
account: AppAccount;
|
|
71
109
|
}>;
|
|
72
|
-
/**
|
|
73
|
-
export type
|
|
74
|
-
|
|
110
|
+
/** 処理の主体の文脈 */
|
|
111
|
+
export type ProcessPrincipal = CapabilityPrincipal & Readonly<{
|
|
112
|
+
account: ProcessAccount;
|
|
113
|
+
chain: readonly [];
|
|
114
|
+
via: null;
|
|
75
115
|
}>;
|
|
76
|
-
/**
|
|
77
|
-
export type
|
|
78
|
-
|
|
79
|
-
|
|
116
|
+
/** エンドユーザーの代理の主体の文脈 */
|
|
117
|
+
export type EndUserContext = CapabilityPrincipal & Readonly<{
|
|
118
|
+
chain: readonly [EndUserPrincipal];
|
|
119
|
+
}>;
|
|
120
|
+
/** 主体の文脈(ロールの表を持つのは人とエージェント、ほかは能力を持つ) */
|
|
121
|
+
export type PrincipalContext = PersonPrincipal | CapabilityPrincipal;
|
|
122
|
+
/** 封じる前の主体の形(判定の関数の内側とカーネルの principal だけが使う) */
|
|
123
|
+
export type PrincipalShape = PersonShape | CapabilityShape;
|
|
124
|
+
/** 判定で主体を絞る種類(操作の記録の主体の種類の値。installation は資格とアプリのアカウントの操作) */
|
|
125
|
+
export type ActingKind = Extract<ActorKind, 'account' | 'installation' | 'on_behalf_of_account' | 'on_behalf_of_end_user' | 'system'>;
|
|
126
|
+
/** 判定で主体を絞る種類(エンドユーザーの操作の選べる主体と、判定の観測) */
|
|
127
|
+
export declare const actingKindOf: (principal: PrincipalShape) => ActingKind;
|
|
80
128
|
/** 主体の文脈のアカウントの代理(なければ null) */
|
|
81
|
-
export declare const accountDelegationOf: (principal:
|
|
82
|
-
/**
|
|
83
|
-
export declare const
|
|
84
|
-
/**
|
|
85
|
-
export declare const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
|
|
129
|
+
export declare const accountDelegationOf: (principal: PrincipalShape) => AccountDelegation | null;
|
|
130
|
+
/** 主体の文脈のアプリの代理(なければ null) */
|
|
131
|
+
export declare const appDelegationOf: (principal: PrincipalShape) => AppDelegation | null;
|
|
132
|
+
/** 主体の文脈の MCP の接続の代理(なければ null) */
|
|
133
|
+
export declare const mcpDelegationOf: (principal: PrincipalShape) => McpDelegation | null;
|
|
134
|
+
/** 主体の文脈のエンドユーザーの代理(なければ null) */
|
|
135
|
+
export declare const endUserOf: (principal: PrincipalShape) => EndUserPrincipal | null;
|
|
136
|
+
/** 人とエージェントのアカウント(ほかの主体は null) */
|
|
137
|
+
/** 人の主体か(ロールの権限の表を持つ主体) */
|
|
138
|
+
export declare const isPersonPrincipal: (principal: PrincipalContext) => principal is PersonPrincipal;
|
|
139
|
+
export declare const personOf: (principal: PrincipalShape) => PersonAccount | null;
|
|
140
|
+
/** 主体のインストール済みアプリ(アプリのアカウントと、アプリの代理。なければ null) */
|
|
141
|
+
export declare const installationOf: (principal: PrincipalShape) => InfraId<"installation"> | null;
|
|
142
|
+
/** 主体の ID(本人の代理は本人、ほかはアカウント) */
|
|
143
|
+
export declare const principalIdOf: (principal: PrincipalShape) => string;
|
|
144
|
+
/** 持ち主の判定に使うアカウントの値(結び付くレコードを持つのは人とエージェントだけ) */
|
|
145
|
+
export declare const ownerOf: (subject: PrincipalShape | AccountView) => Readonly<{
|
|
146
|
+
id: string;
|
|
147
|
+
recordId: string | null;
|
|
148
|
+
link: AccountLink;
|
|
149
|
+
}>;
|
|
150
|
+
/** 画面が持つアカウントの値(/api/me の形。表示の判定だけに使い、サーバーの判定の主体にしない) */
|
|
151
|
+
export type AccountView = Readonly<{
|
|
91
152
|
id?: string;
|
|
92
|
-
permissions
|
|
153
|
+
permissions?: Permissions;
|
|
93
154
|
role?: string;
|
|
155
|
+
recordId?: string | null;
|
|
156
|
+
link?: AccountLink;
|
|
157
|
+
operator?: true;
|
|
94
158
|
app?: Readonly<{
|
|
159
|
+
client?: string;
|
|
95
160
|
installation: InfraId<'installation'>;
|
|
96
161
|
capabilities: Capabilities;
|
|
97
162
|
consented?: Capabilities;
|
|
163
|
+
withheld?: readonly string[];
|
|
98
164
|
}>;
|
|
99
165
|
mcp?: Readonly<{
|
|
166
|
+
grant?: string;
|
|
167
|
+
client?: string;
|
|
100
168
|
capabilities: Capabilities;
|
|
169
|
+
rolePermissions?: Permissions;
|
|
101
170
|
staffCollections: readonly string[];
|
|
102
171
|
}>;
|
|
103
172
|
}>;
|
|
104
|
-
/**
|
|
105
|
-
export
|
|
106
|
-
/**
|
|
107
|
-
export declare
|
|
108
|
-
/**
|
|
109
|
-
export declare const
|
|
173
|
+
/** 判定の主体(サーバーは封じた主体の文脈、画面はアカウントの値) */
|
|
174
|
+
export type Subject = PrincipalContext | AccountView;
|
|
175
|
+
/** 判定の主体の形(画面の値は代理を含めて同じ形にする) */
|
|
176
|
+
export declare function shapeOf(subject: Subject): PrincipalShape;
|
|
177
|
+
/** 主体のロールの ID(人とエージェントでなければ空の文字) */
|
|
178
|
+
export declare const roleOf: (principal: PrincipalShape) => string;
|
|
179
|
+
/** 主体のメールアドレス(人とエージェントでなければ空の文字) */
|
|
180
|
+
export declare const emailOf: (principal: PrincipalShape) => string;
|
|
110
181
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const RECORD_LABELS: {
|
|
2
|
+
readonly transitionNotAllowed: (from: string | null, to: string) => string;
|
|
3
|
+
readonly uniqueTaken: (labels: readonly string[]) => string;
|
|
4
|
+
readonly uniqueDuplicates: (collection: string, labels: readonly string[], count: number) => string;
|
|
5
|
+
readonly useAt: (collection: string, labels: readonly string[]) => string;
|
|
6
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Capabilities, type Subject } from './principal.js';
|
|
2
2
|
import type { InfraId } from './ids.js';
|
|
3
3
|
import { type AccountLink, type Permissions } from './permissions.js';
|
|
4
4
|
/** 管理者のロールの ID */
|
|
@@ -33,9 +33,8 @@ export type Role = Readonly<{
|
|
|
33
33
|
export type User = Readonly<{
|
|
34
34
|
id: string;
|
|
35
35
|
email: string;
|
|
36
|
-
role: string;
|
|
37
36
|
roleLabel: string;
|
|
38
|
-
|
|
37
|
+
can: Readonly<Record<string, boolean>>;
|
|
39
38
|
recordId: string | null;
|
|
40
39
|
link: AccountLink;
|
|
41
40
|
operator?: true;
|
|
@@ -54,5 +53,9 @@ export type User = Readonly<{
|
|
|
54
53
|
staffCollections: readonly string[];
|
|
55
54
|
}>;
|
|
56
55
|
}>;
|
|
56
|
+
/** 管理の領域 admin だけを条件にする操作の ID(/api/me の can でこの操作を見て、管理の領域を扱えるかを決める) */
|
|
57
|
+
export declare const ADMIN_AREA_OPERATION = "job.run";
|
|
58
|
+
/** ロールの表示の確認で、確かめるロールの ID を送るヘッダー(画面のログインの GET だけ。主体をそのロールの権限の表に替える) */
|
|
59
|
+
export declare const VIEW_AS_HEADER = "tunasand-view-as";
|
|
57
60
|
/** 設定を扱える(管理者のロールの)アカウントか */
|
|
58
|
-
export declare const isAdmin: (
|
|
61
|
+
export declare const isAdmin: (subject: Subject) => boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const CORE_RULE_LABELS: {
|
|
2
|
+
readonly requiredFields: "提出で必須の項目";
|
|
3
|
+
readonly citedSources: "注の参考資料";
|
|
4
|
+
readonly imageAlt: "画像の代替テキスト";
|
|
5
|
+
readonly pendingMasters: "承認待ちのマスタ";
|
|
6
|
+
readonly pageFields: "ページの公開で必須の項目";
|
|
7
|
+
};
|
|
8
|
+
export declare const FILE_SYNTAX_EXAMPLE = "file/<\u753B\u50CF\u306E ID>";
|
|
9
|
+
export declare const PREVIEW_LABELS: {
|
|
10
|
+
readonly noTicketKey: "プレビューのチケットの鍵(SECRETS_KEY)が未設定";
|
|
11
|
+
readonly ogFailed: (status: number) => string;
|
|
12
|
+
readonly noOg: "OG 画像のないコレクション";
|
|
13
|
+
readonly noPage: "サイトのページがないコレクション";
|
|
14
|
+
readonly noTarget: "プレビューするコレクションと ID の指定がない";
|
|
15
|
+
readonly renderFailed: (status: number) => string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const RULE_PROBLEMS: {
|
|
2
|
+
readonly referenceMissing: (field: string, id: string) => string;
|
|
3
|
+
readonly referenceAfterCreate: (field: string) => string;
|
|
4
|
+
readonly referenceUnmatched: (field: string, id: string) => string;
|
|
5
|
+
readonly pendingMasters: (labels: readonly string[]) => string;
|
|
6
|
+
readonly uncitedSources: (collection: string, count: number) => string;
|
|
7
|
+
readonly imagesWithoutAlt: (count: number) => string;
|
|
8
|
+
readonly pageFieldRequired: (field: string) => string;
|
|
9
|
+
readonly referencedPageFields: (target: string, fields: readonly string[]) => string;
|
|
10
|
+
readonly fixedValue: (target: string, collection: string, field: string, option: string) => string;
|
|
11
|
+
readonly blockProps: (index: number, problem: string) => string;
|
|
12
|
+
readonly richTextFieldMissing: (collection: string, field: string) => string;
|
|
13
|
+
};
|
|
14
|
+
export declare const RULE_ISSUES: {
|
|
15
|
+
readonly dateTime: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SCHEMA_LABELS: {
|
|
2
|
+
readonly firstNote: "最初のバージョン(コードの定義)";
|
|
3
|
+
readonly deleteCollection: (label: string) => string;
|
|
4
|
+
readonly restoreCollection: (label: string) => string;
|
|
5
|
+
readonly appCollections: (label: string) => string;
|
|
6
|
+
readonly appData: (label: string) => string;
|
|
7
|
+
readonly promoted: (environmentLabel: string) => string;
|
|
8
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ParamValue } from '../../i18n/src/index.js';
|
|
2
2
|
/** アプリの設定値の問題のコード */
|
|
3
|
-
export declare const SETTING_PROBLEMS: readonly ["text", "integer_min", "boolean", "text_list", "choice", "duplicate", "required", "shape"];
|
|
3
|
+
export declare const SETTING_PROBLEMS: readonly ["text", "integer_min", "integer_max", "boolean", "text_list", "choice", "duplicate", "required", "shape"];
|
|
4
4
|
export type SettingProblemCode = (typeof SETTING_PROBLEMS)[number];
|
|
5
5
|
/** アプリの設定値の問題(key は設定値のキー、params は文に差し込む値) */
|
|
6
6
|
export declare class SettingProblem extends Error {
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Subject } from './principal.js';
|
|
2
2
|
/**
|
|
3
3
|
* 設定の領域
|
|
4
4
|
* - general: 一般、content: コレクション・メニュー・画像サイズ、apps: インストール済みアプリと標準の機能
|
|
5
|
-
* - integrations: 連携・プレビューとデプロイ、data: インポート・エクスポート、
|
|
5
|
+
* - integrations: 連携・プレビューとデプロイ、data: インポート・エクスポート、endUsers: エンドユーザーの設定
|
|
6
6
|
*/
|
|
7
|
-
export declare const SETTINGS_AREAS: readonly ["general", "content", "apps", "integrations", "data", "
|
|
7
|
+
export declare const SETTINGS_AREAS: readonly ["general", "content", "apps", "integrations", "data", "end_users"];
|
|
8
8
|
/** 設定の領域 */
|
|
9
9
|
export type SettingsArea = (typeof SETTINGS_AREAS)[number];
|
|
10
10
|
/** 権限の表での設定の領域の id */
|
|
11
11
|
export declare const settingsTarget: (area: SettingsArea) => string;
|
|
12
12
|
/** 権限の表の対象が設定の領域か */
|
|
13
13
|
export declare const isSettingsTarget: (id: string) => boolean;
|
|
14
|
-
type Holder = Pick<User, 'role' | 'permissions'> & Partial<Pick<User, 'mcp' | 'operator' | 'app'>>;
|
|
15
14
|
/** 設定の領域を扱えるか(判定は authorize。管理者は可、ほかは対象の更新が可のときだけ、人の代わりとアプリは不可) */
|
|
16
|
-
export declare const canManageSettings: (user:
|
|
15
|
+
export declare const canManageSettings: (user: Subject, area: SettingsArea) => boolean;
|
|
17
16
|
/** 扱える設定の領域(空は設定の層を開けない) */
|
|
18
|
-
export declare const managedAreasOf: (user:
|
|
19
|
-
export {};
|
|
17
|
+
export declare const managedAreasOf: (user: Subject) => readonly SettingsArea[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** サイトの資源の種類(
|
|
2
|
-
export declare const SITE_RESOURCE_KINDS: readonly ["
|
|
1
|
+
/** サイトの資源の種類(SQL のデータベースとオブジェクトの保存先) */
|
|
2
|
+
export declare const SITE_RESOURCE_KINDS: readonly ["database", "storage"];
|
|
3
3
|
export type SiteResourceKind = (typeof SITE_RESOURCE_KINDS)[number];
|
|
4
4
|
/** 宣言の上限(資源の数、Cron の式の数と1つの式の文字数) */
|
|
5
5
|
export declare const SITE_DECLARATION_LIMITS: {
|
|
@@ -7,7 +7,7 @@ export declare const SITE_DECLARATION_LIMITS: {
|
|
|
7
7
|
readonly crons: 5;
|
|
8
8
|
readonly cronLength: 64;
|
|
9
9
|
};
|
|
10
|
-
/** bind
|
|
10
|
+
/** bind の名前の形と長さ(保存先の名前の上限の63文字に、接頭辞と持ち主のハッシュと合わせて収まる長さ) */
|
|
11
11
|
export declare const SITE_BINDING_NAME: {
|
|
12
12
|
readonly pattern: RegExp;
|
|
13
13
|
readonly maxLength: 32;
|
|
@@ -16,14 +16,14 @@ export declare const SITE_BINDING_NAME: {
|
|
|
16
16
|
export declare const SITE_ASSETS_BINDING: "ASSETS";
|
|
17
17
|
/** 能力の要素の頭 */
|
|
18
18
|
export declare const SITE_CAPABILITY_PREFIXES: {
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
19
|
+
readonly database: "site_database:";
|
|
20
|
+
readonly storage: "site_storage:";
|
|
21
21
|
readonly cron: "site_cron:";
|
|
22
22
|
};
|
|
23
23
|
/** マニフェストの `hosting` の宣言の形(`true` は資源も Cron もない宣言) */
|
|
24
24
|
export type SiteHostingManifest = Readonly<{
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
database?: readonly string[];
|
|
26
|
+
storage?: readonly string[];
|
|
27
27
|
crons?: readonly string[];
|
|
28
28
|
}>;
|
|
29
29
|
/** 資源の宣言の1つ */
|