@tunasand/sdk 0.6.0 → 0.8.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 +116 -84
- package/README.md +209 -195
- package/dist/analytics.js +638 -2
- package/dist/app.js +230 -24
- package/dist/apps-BxnJ1RlU.js +435 -0
- package/dist/{bridge-DYAYGV7t.js → bridge-DtHw9hS6.js} +3 -3
- package/dist/bridge.js +2 -2
- package/dist/cli.js +5 -4
- package/dist/{model-pmXzGX12.js → collection-BEOxeISR.js} +49 -12
- package/dist/{customers-C_vJY2_v.js → customers-DTbL0qn6.js} +5 -3
- package/dist/customers.js +2 -2
- package/dist/{declared-C_GvPiGF.js → declared-DuNMsdXw.js} +93 -5
- package/dist/delivery.js +39 -8
- package/dist/embeds-B5V54Zur.js +34 -0
- package/dist/{errorLabels-BcyRbv_i.js → errorLabels-BgtQ_zUn.js} +277 -264
- package/dist/i18n.js +4 -4
- package/dist/ids--RF7hGyC.js +36 -0
- package/dist/integrations.js +4 -29
- package/dist/{ja-C1HEWWTQ.js → ja-CeHU0EaY.js} +3 -3
- package/dist/{ja-C6lX0CeJ.js → ja-Du6ooL6i.js} +12 -11
- package/dist/{page-E_cYgZx-.js → page-Bzrj24sJ.js} +4 -4
- package/dist/{profile-D6t1QMQh.js → profile-1em_lcxq.js} +5 -5
- package/dist/rich-text.d.ts +1 -0
- package/dist/{body.js → rich-text.js} +6 -7
- package/dist/{schema-UQJWRyfJ.js → schema-WnobuwLg.js} +136 -97
- package/dist/schema.js +346 -1
- package/dist/types/access/src/handoff.d.ts +3 -3
- package/dist/types/access/src/jwt.d.ts +1 -1
- package/dist/types/access/src/oidc.d.ts +1 -1
- package/dist/types/{cms-contract → contract}/src/apiKeys.d.ts +1 -1
- package/dist/types/{cms-contract → contract}/src/app.d.ts +8 -15
- package/dist/types/contract/src/appDefinition.d.ts +127 -0
- package/dist/types/{cms-contract → contract}/src/appDependencies.d.ts +6 -13
- package/dist/types/contract/src/appServer.d.ts +136 -0
- package/dist/types/contract/src/approvalLabels.d.ts +26 -0
- package/dist/types/contract/src/approvals.d.ts +63 -0
- package/dist/types/{cms-contract → contract}/src/apps.d.ts +72 -29
- package/dist/types/contract/src/auditActions.d.ts +18 -0
- package/dist/types/contract/src/auditLabels.d.ts +127 -0
- package/dist/types/{cms-contract → contract}/src/authorize.d.ts +22 -63
- package/dist/types/{cms-contract → contract}/src/bridge.d.ts +6 -6
- package/dist/types/{cms-contract → contract}/src/customers.d.ts +6 -6
- package/dist/types/{cms-contract → contract}/src/embeds.d.ts +13 -7
- package/dist/types/{cms-contract → contract}/src/errorLabels.d.ts +18 -16
- package/dist/types/{cms-contract → contract}/src/errorLabelsEn.d.ts +9 -7
- package/dist/types/{cms-contract → contract}/src/errors.d.ts +11 -11
- package/dist/types/{cms-contract → contract}/src/failureStatus.d.ts +4 -3
- package/dist/types/contract/src/fieldAccess.d.ts +45 -0
- package/dist/types/contract/src/fieldRules.d.ts +41 -0
- package/dist/types/{cms-contract/src/assets.d.ts → contract/src/files.d.ts} +5 -5
- package/dist/types/{cms-contract → contract}/src/functions.d.ts +3 -3
- package/dist/types/contract/src/hostingRpc.d.ts +143 -0
- package/dist/types/contract/src/hostnames.d.ts +30 -0
- package/dist/types/{cms-contract → contract}/src/identifiers.d.ts +31 -28
- package/dist/types/contract/src/ids.d.ts +104 -0
- package/dist/types/{cms-contract → contract}/src/import.d.ts +3 -3
- package/dist/types/contract/src/importLabels.d.ts +3 -0
- package/dist/types/contract/src/index.d.ts +67 -0
- package/dist/types/{cms-contract → contract}/src/issueLabels.d.ts +27 -23
- package/dist/types/{cms-contract → contract}/src/issueLabelsEn.d.ts +15 -13
- package/dist/types/contract/src/labels.d.ts +11 -0
- package/dist/types/contract/src/legacyAuditLabels.d.ts +10 -0
- package/dist/types/contract/src/livePeriods.d.ts +18 -0
- package/dist/types/contract/src/manage.d.ts +47 -0
- package/dist/types/contract/src/manageLabels.d.ts +9 -0
- package/dist/types/contract/src/mcpAuth.d.ts +139 -0
- package/dist/types/contract/src/mcpLabels.d.ts +5 -0
- package/dist/types/{cms-contract → contract}/src/migration.d.ts +1 -1
- package/dist/types/contract/src/operatorOperations.d.ts +703 -0
- package/dist/types/contract/src/operators.d.ts +33 -0
- package/dist/types/{cms-contract → contract}/src/paths.d.ts +6 -8
- package/dist/types/contract/src/pending.d.ts +4 -0
- package/dist/types/{cms-contract → contract}/src/permissions.d.ts +2 -0
- package/dist/types/contract/src/principal.d.ts +110 -0
- package/dist/types/{cms-contract → contract}/src/problems.d.ts +4 -4
- package/dist/types/contract/src/projectRole.d.ts +6 -0
- package/dist/types/{cms-contract → contract}/src/roles.d.ts +4 -3
- package/dist/types/{cms-contract → contract}/src/settingProblems.d.ts +2 -2
- package/dist/types/{cms-contract → contract}/src/settings.d.ts +2 -2
- package/dist/types/contract/src/settingsLabels.d.ts +3 -0
- package/dist/types/contract/src/slugs.d.ts +6 -0
- package/dist/types/{cms-contract → contract}/src/transfer.d.ts +3 -3
- package/dist/types/contract/src/trial.d.ts +10 -0
- package/dist/types/contract/src/versions.d.ts +9 -0
- package/dist/types/{cms-contract → contract}/src/webhooks.d.ts +33 -58
- package/dist/types/contract/src/workflow.d.ts +49 -0
- package/dist/types/contract/src/workspaceItems.d.ts +73 -0
- package/dist/types/contract/src/workspacePaths.d.ts +4 -0
- package/dist/types/{body → rich-text}/src/declared.d.ts +2 -2
- package/dist/types/{body → rich-text}/src/embed.d.ts +1 -1
- package/dist/types/{body → rich-text}/src/labels/ja.d.ts +2 -2
- package/dist/types/{body → rich-text}/src/profile.d.ts +1 -1
- package/dist/types/{model → schema}/src/audience.d.ts +11 -11
- package/dist/types/schema/src/brand.d.ts +5 -0
- package/dist/types/{model → schema}/src/capabilities.d.ts +5 -5
- package/dist/types/{model → schema}/src/changes.d.ts +6 -6
- package/dist/types/{model → schema}/src/check.d.ts +2 -2
- package/dist/types/{model/src/model.d.ts → schema/src/collection.d.ts} +25 -23
- package/dist/types/{platform/src/defaultModel.d.ts → schema/src/defaultSchema.d.ts} +4 -3
- package/dist/types/{model/src/asset.d.ts → schema/src/file.d.ts} +16 -16
- package/dist/types/{model → schema}/src/image.d.ts +3 -3
- package/dist/types/{model → schema}/src/index.d.ts +11 -10
- package/dist/types/{model → schema}/src/input.d.ts +3 -3
- package/dist/types/{model → schema}/src/integrity.d.ts +1 -1
- package/dist/types/{model → schema}/src/labels/en.d.ts +8 -7
- package/dist/types/{model → schema}/src/labels/ja.d.ts +9 -8
- package/dist/types/schema/src/legacy.d.ts +2 -0
- package/dist/types/{model → schema}/src/media.d.ts +1 -1
- package/dist/types/{model → schema}/src/mediaUrl.d.ts +5 -5
- package/dist/types/{model → schema}/src/page.d.ts +2 -2
- package/dist/types/{model → schema}/src/problems.d.ts +14 -13
- package/dist/types/{model → schema}/src/refs.d.ts +1 -1
- package/dist/types/{model → schema}/src/rules.d.ts +2 -2
- package/dist/types/{model → schema}/src/schema.d.ts +10 -10
- package/dist/types/{model → schema}/src/selfOps.d.ts +1 -1
- package/dist/types/schema/src/typesSource.d.ts +16 -0
- package/dist/types/{model → schema}/src/values.d.ts +2 -2
- package/dist/types/sdk/src/analytics.d.ts +2 -2
- package/dist/types/sdk/src/app.d.ts +44 -16
- package/dist/types/sdk/src/bridge.d.ts +12 -12
- package/dist/types/sdk/src/customers.d.ts +14 -20
- package/dist/types/sdk/src/delegation.d.ts +39 -0
- package/dist/types/sdk/src/delivery/client.d.ts +11 -10
- package/dist/types/sdk/src/delivery/fields.d.ts +2 -2
- package/dist/types/sdk/src/delivery/index.d.ts +2 -2
- package/dist/types/sdk/src/delivery/media.d.ts +17 -3
- package/dist/types/sdk/src/delivery/query.d.ts +1 -1
- package/dist/types/sdk/src/delivery/schema.d.ts +4 -4
- package/dist/types/sdk/src/delivery/values.d.ts +6 -6
- package/dist/types/sdk/src/delivery.d.ts +3 -3
- package/dist/types/sdk/src/i18n.d.ts +11 -11
- package/dist/types/sdk/src/integrations.d.ts +10 -10
- package/dist/types/sdk/src/{body.d.ts → rich-text.d.ts} +2 -2
- package/dist/types/sdk/src/schema.d.ts +5 -21
- package/dist/types/sdk/src/site.d.ts +1 -1
- package/dist/types/sdk/src/types.d.ts +21 -0
- package/dist/{schema-BPHL7Qr-.js → types-B77qvqPJ.js} +5 -4
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/{typesSource-bO0jFw1I.js → typesSource-CWybQYus.js} +58 -12
- package/package.json +12 -12
- package/dist/apps-9u4XMi7E.js +0 -114
- package/dist/body.d.ts +0 -1
- package/dist/embed-R-OvDYAw.js +0 -90
- package/dist/model.d.ts +0 -1
- package/dist/model.js +0 -345
- package/dist/types/analytics/src/index.d.ts +0 -5
- package/dist/types/analytics/src/schedule.d.ts +0 -2
- package/dist/types/analytics/src/shared.d.ts +0 -21
- package/dist/types/analytics/src/source.d.ts +0 -19
- package/dist/types/analytics/src/store.d.ts +0 -24
- package/dist/types/model/src/brand.d.ts +0 -25
- package/dist/types/model/src/legacy.d.ts +0 -2
- package/dist/types/model/src/typesSource.d.ts +0 -8
- package/dist/types/sdk/src/model.d.ts +0 -5
- /package/dist/types/{cms-contract → contract}/src/appProblems.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/consents.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/customerLabels.d.ts +0 -0
- /package/dist/types/{analytics → contract}/src/day.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/functionLabels.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/permissionLabels.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/siteArtifact.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/siteDeclaration.d.ts +0 -0
- /package/dist/types/{analytics/src/view.d.ts → contract/src/viewEvent.d.ts} +0 -0
- /package/dist/types/{cms-contract → contract}/src/views.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/webhookLabels.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/components.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/derive.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/description.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/href.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/html.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/index.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/inline.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/labels/en.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/library.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/markdown.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/normalize.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/problems.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/render.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/schema.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/standard.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/types.d.ts +0 -0
- /package/dist/types/{model → schema}/src/contact.d.ts +0 -0
- /package/dist/types/{model → schema}/src/json.d.ts +0 -0
- /package/dist/types/{model → schema}/src/screens.d.ts +0 -0
- /package/dist/types/{model → schema}/src/time.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Collection
|
|
2
|
-
import type { ActorKind } from './identifiers.js';
|
|
1
|
+
import { type Collection } from '../../schema/src/index.js';
|
|
3
2
|
import type { Permissions } from './permissions.js';
|
|
3
|
+
import { type ActingKind, type Capabilities, type PrincipalContext } from './principal.js';
|
|
4
4
|
/** 判定の操作(コレクションの操作と顧客の操作) */
|
|
5
5
|
export declare const OPERATIONS: readonly ["read", "read_drafts", "read_customers", "create", "update", "publish", "delete", "submit", "verify", "read_state", "link", "create_candidate", "issue_token", "refresh_token", "migrate_links", "read_identities", "write_grants", "update_status", "read_display_name", "read_consents", "check_consent", "write_consents", "write_suppression", "read_self", "create_self", "update_self", "delete_self"];
|
|
6
6
|
/** 判定の操作 */
|
|
@@ -11,7 +11,7 @@ export type Operation = (typeof OPERATIONS)[number];
|
|
|
11
11
|
* - published: 公開中のレコードの変更に公開の権限がない、customer_scope: 人の代わりに許さない操作
|
|
12
12
|
* - not_granted: アカウントの代わりの委ねた能力(アプリの能力、MCP の付与の範囲)にない
|
|
13
13
|
* - principal_kind: 顧客の操作の選べる主体でない(CUSTOMERS_PRINCIPALS)
|
|
14
|
-
* - not_member:
|
|
14
|
+
* - not_member: プロジェクトの管理の操作で、対象の組織のメンバーでない(存在を見せない)
|
|
15
15
|
*/
|
|
16
16
|
export declare const DENY_CAUSES: readonly ["not_permitted", "humans_only", "row_owner", "published", "customer_scope", "principal_kind", "not_granted", "not_member"];
|
|
17
17
|
/** 拒否の理由(細かい理由。応答の区別は Denial) */
|
|
@@ -20,7 +20,7 @@ export type DenyCause = (typeof DENY_CAUSES)[number];
|
|
|
20
20
|
* 拒否の応答の区別(2026-11-20、ユーザーの決定)
|
|
21
21
|
* - not_found: 主体に存在を見せないもの(人の代わりの範囲の外のコレクション、本人のものでないレコード)。見つからないと同じ応答にする
|
|
22
22
|
* - forbidden: 存在は見せてよく、権限が足りない(足りない操作 required を応答の params.required にコピーし、画面は必要なロールと頼む相手を出す)
|
|
23
|
-
* -
|
|
23
|
+
* - 所属していない組織とプロジェクトの not_found は、プロジェクトを決める入口(レジストリの引き当て、console)が返す
|
|
24
24
|
*/
|
|
25
25
|
export type Denial = 'not_found' | 'forbidden';
|
|
26
26
|
/** 判定の結果(拒否は reason に応答の区別、cause に細かい理由、forbidden は required に足りない操作) */
|
|
@@ -32,36 +32,9 @@ export type Decision = Readonly<{
|
|
|
32
32
|
cause: DenyCause;
|
|
33
33
|
required?: Readonly<{
|
|
34
34
|
operation: Operation | ManagementOperation;
|
|
35
|
-
roles?: readonly
|
|
35
|
+
roles?: readonly OrganizationRole[];
|
|
36
36
|
}>;
|
|
37
37
|
}>;
|
|
38
|
-
/** 鍵とインストールの能力(対象から操作の配列。鍵の権限と、インストールの同意した能力 capabilitiesOf) */
|
|
39
|
-
export type Capabilities = Readonly<Record<string, readonly string[]>>;
|
|
40
|
-
/**
|
|
41
|
-
* 主体の文脈(入口でコアが組み立てる。permissions はロールの表、admin は管理者のロール、capabilities は鍵とインストールの能力)
|
|
42
|
-
* - via: アカウントの代わりの経路(MCP かアプリのアカウントの資格)
|
|
43
|
-
* - consented: アプリが同意を得た能力の * を残した形(項目の見える範囲の判定でコレクションの名指しを見る)
|
|
44
|
-
* - staffCollections: MCP にスタッフの項目を出すコレクション(プロジェクトの設定、ロールの権限は広げない)
|
|
45
|
-
*/
|
|
46
|
-
export type Principal = Readonly<{
|
|
47
|
-
kind: Extract<ActorKind, 'account' | 'operator' | 'on_behalf_of_account'>;
|
|
48
|
-
permissions: Permissions;
|
|
49
|
-
admin?: boolean;
|
|
50
|
-
capabilities?: Capabilities;
|
|
51
|
-
via?: 'mcp' | 'app';
|
|
52
|
-
consented?: Capabilities;
|
|
53
|
-
staffCollections?: readonly string[];
|
|
54
|
-
}> | Readonly<{
|
|
55
|
-
kind: 'installation';
|
|
56
|
-
capabilities: Capabilities;
|
|
57
|
-
}> | CustomerPrincipal;
|
|
58
|
-
/** 人の代わりの主体(customerId は本人の ID、proof は本人の確認の方法。入口でだけ組み立て、要求の値から作らない) */
|
|
59
|
-
export type CustomerPrincipal = Readonly<{
|
|
60
|
-
kind: 'on_behalf_of_customer';
|
|
61
|
-
capabilities: Capabilities;
|
|
62
|
-
customerId: string;
|
|
63
|
-
proof: CustomerProof;
|
|
64
|
-
}>;
|
|
65
38
|
/** レコードの値(owned は主体が持ち主の行か、published は公開中の行か、self は人の代わりの本人がそのレコードの本人か) */
|
|
66
39
|
export type DecisionRow = Readonly<{
|
|
67
40
|
owned?: boolean;
|
|
@@ -69,27 +42,13 @@ export type DecisionRow = Readonly<{
|
|
|
69
42
|
self?: boolean;
|
|
70
43
|
}>;
|
|
71
44
|
/** 判定の観測(テストで全入口の経路が同じ関数を通ることを確認するフック、本番は何もしない。via は authorize か入口の判定 authorizeReach か) */
|
|
72
|
-
type DecisionObserver = (principal:
|
|
45
|
+
type DecisionObserver = (principal: ActingKind, target: string, operation: Operation, decision: Decision, via: 'authorize' | 'reach') => void;
|
|
73
46
|
/** 判定の観測を差し込む(戻り値で外す、テストだけ) */
|
|
74
47
|
export declare function observeDecisions(next: DecisionObserver): () => void;
|
|
75
48
|
/** 顧客の操作の選べる主体(#606、D3-1。表にない操作は主体で絞らない。運営者はアカウントと同じ) */
|
|
76
|
-
export declare const CUSTOMERS_PRINCIPALS: Readonly<Partial<Record<Operation, readonly
|
|
77
|
-
/** ログインしたアカウントの主体の文脈(MCP の接続とアプリのアカウントの資格はアカウントの代わり、サポートのアクセスの許可で入った運営者は運営者) */
|
|
78
|
-
export declare const principalOfUser: (user: Readonly<{
|
|
79
|
-
permissions: Permissions;
|
|
80
|
-
role?: string;
|
|
81
|
-
operator?: true;
|
|
82
|
-
app?: Readonly<{
|
|
83
|
-
capabilities: Capabilities;
|
|
84
|
-
consented?: Capabilities;
|
|
85
|
-
}>;
|
|
86
|
-
mcp?: Readonly<{
|
|
87
|
-
capabilities: Capabilities;
|
|
88
|
-
staffCollections: readonly string[];
|
|
89
|
-
}>;
|
|
90
|
-
}>) => Principal;
|
|
49
|
+
export declare const CUSTOMERS_PRINCIPALS: Readonly<Partial<Record<Operation, readonly ActingKind[]>>>;
|
|
91
50
|
/**
|
|
92
|
-
*
|
|
51
|
+
* ロールの表をアプリのアカウントの能力の範囲に絞った表(アプリのアカウントの資格の権限の表、段階は人のまま、能力にない操作は none)
|
|
93
52
|
* - 対象はロールの表と能力の対象と *。表にない対象は * の行に落ちるので、* も能力の * の範囲に絞る。設定の領域は none
|
|
94
53
|
*/
|
|
95
54
|
export declare function permissionsWithin(permissions: Permissions, capabilities: Capabilities): Permissions;
|
|
@@ -99,8 +58,8 @@ export type DecisionInput = Readonly<{
|
|
|
99
58
|
collection?: Collection;
|
|
100
59
|
}>;
|
|
101
60
|
/**
|
|
102
|
-
* プロジェクトの管理の操作(決定は tunasand#579・tunasand#717:
|
|
103
|
-
* - create_project:
|
|
61
|
+
* プロジェクトの管理の操作(決定は tunasand#579・tunasand#717: console・CLI・後の MCP の道具が同じ API を呼び、ここで判定する)
|
|
62
|
+
* - create_project: 組織にプロジェクトを作る
|
|
104
63
|
* - create_environment・copy_environment・delete_environment: 環境を作る・コピーする・削除する
|
|
105
64
|
* - promote: エイリアス(live など)の向きを切り替える、promote_schema: 環境のスキーマを live に反映する
|
|
106
65
|
* - freeze: live の書き込みを止める・戻す(切り替えの前の停止)
|
|
@@ -109,18 +68,18 @@ export type DecisionInput = Readonly<{
|
|
|
109
68
|
export declare const MANAGEMENT_OPERATIONS: readonly ["create_project", "create_environment", "copy_environment", "delete_environment", "promote", "promote_schema", "freeze", "freeze_hold", "delete_project"];
|
|
110
69
|
/** プロジェクトの管理の操作 */
|
|
111
70
|
export type ManagementOperation = (typeof MANAGEMENT_OPERATIONS)[number];
|
|
112
|
-
/**
|
|
113
|
-
export type
|
|
71
|
+
/** 組織のメンバーのロール(platform の組織のメンバー) */
|
|
72
|
+
export type OrganizationRole = 'owner' | 'member';
|
|
114
73
|
/**
|
|
115
74
|
* プロジェクトの管理の主体
|
|
116
|
-
* -
|
|
117
|
-
* - project_account
|
|
118
|
-
*
|
|
75
|
+
* - organization_member は console のログインした組織のメンバー、platform_operator は運営者のホストの API と CLI
|
|
76
|
+
* - project_account はプロジェクトのワークスペースのアカウント(permissions はロールの表で、管理の権限 manage:<チェック> を見る)
|
|
77
|
+
* 組織の owner は管理者を継いだ表
|
|
119
78
|
*/
|
|
120
79
|
export type ManagementPrincipal = Readonly<{
|
|
121
|
-
kind: '
|
|
122
|
-
|
|
123
|
-
role:
|
|
80
|
+
kind: 'organization_member';
|
|
81
|
+
organizationId: string;
|
|
82
|
+
role: OrganizationRole;
|
|
124
83
|
}> | Readonly<{
|
|
125
84
|
kind: 'platform_operator';
|
|
126
85
|
}> | Readonly<{
|
|
@@ -129,18 +88,18 @@ export type ManagementPrincipal = Readonly<{
|
|
|
129
88
|
admin: boolean;
|
|
130
89
|
permissions: Permissions;
|
|
131
90
|
}>;
|
|
132
|
-
/** プロジェクトの管理の対象(
|
|
91
|
+
/** プロジェクトの管理の対象(organizationId は作成先か、レジストリで引いたプロジェクトの組織) */
|
|
133
92
|
export type ManagementTarget = Readonly<{
|
|
134
|
-
|
|
93
|
+
organizationId: string;
|
|
135
94
|
projectId?: string;
|
|
136
95
|
}>;
|
|
137
96
|
/** 主体が対象の操作をできるか(管理の操作は管理の主体と対象で判定) */
|
|
138
97
|
export declare function authorize(principal: ManagementPrincipal, operation: ManagementOperation, target: ManagementTarget): Decision;
|
|
139
|
-
export declare function authorize(principal:
|
|
98
|
+
export declare function authorize(principal: PrincipalContext, operation: Operation, target: string, input?: DecisionInput): Decision;
|
|
140
99
|
/**
|
|
141
100
|
* 主体が対象の操作に、どれかの段階で届くか(行を読む前の入口の判定)
|
|
142
101
|
* - ロールの段階は自分のものだけと承認が必要も届くとし、レコードと承認の判定は後の authorize と workflow に任せる
|
|
143
102
|
* - 能力、アカウントだけの対象、人の代わりの範囲は authorize と同じ
|
|
144
103
|
*/
|
|
145
|
-
export declare function authorizeReach(principal:
|
|
104
|
+
export declare function authorizeReach(principal: PrincipalContext, operation: Operation, target: string, { collection }?: Pick<DecisionInput, 'collection'>): Decision;
|
|
146
105
|
export {};
|
|
@@ -6,7 +6,7 @@ export declare const BRIDGE_VERSION = 1;
|
|
|
6
6
|
/**
|
|
7
7
|
* 画面のトークン(アカウントの資格、Shopify のセッションのトークンと同じ形の JWT、設計は docs/app-screens.md の「アカウントの資格」)
|
|
8
8
|
* - 署名は HS256 で、鍵はクライアントの秘密(インストールにつなぐまでは外の画面の登録の鍵)。アプリのサーバーは手元で検証でき、API は呼べない
|
|
9
|
-
* - iss
|
|
9
|
+
* - iss はプロジェクトのワークスペースのオリジン(https://<dest>)で、製品名の定数を持たない。skewSec は検証の時計のずれの許容(秒)
|
|
10
10
|
*/
|
|
11
11
|
export declare const SESSION_TOKEN: {
|
|
12
12
|
readonly ttlSec: 60;
|
|
@@ -60,7 +60,7 @@ export type BridgeApiMethod = (typeof BRIDGE_API_METHODS)[number];
|
|
|
60
60
|
export declare const isBridgeApiPath: (v: unknown) => v is string;
|
|
61
61
|
/**
|
|
62
62
|
* 見た目のトークンの名前(実験的)
|
|
63
|
-
* -
|
|
63
|
+
* - ワークスペースの見た目の作り直しで名前と値が変わる。版で固定しないので、アプリは値がないときの既定を持つ
|
|
64
64
|
* - アプリの側では applyTheme が CSS の変数 --theme-<名前> として当てる
|
|
65
65
|
*/
|
|
66
66
|
export declare const BRIDGE_THEME_TOKENS: readonly ["accent", "text", "muted", "surface", "border", "radius", "font-family", "font-size"];
|
|
@@ -124,7 +124,7 @@ export declare const BRIDGE_DIALOG_LIMIT: {
|
|
|
124
124
|
};
|
|
125
125
|
/** ダイアログに渡す値と返す値の大きさの上限(JSON の文字数) */
|
|
126
126
|
export declare const BRIDGE_DATA_MAX = 16384;
|
|
127
|
-
/**
|
|
127
|
+
/** ワークスペースの中の行き先(URL の文字列では頼まない) */
|
|
128
128
|
export type BridgeTarget = Readonly<{
|
|
129
129
|
kind: 'list';
|
|
130
130
|
collection: string;
|
|
@@ -145,11 +145,11 @@ export type BridgeRequests = {
|
|
|
145
145
|
resize: Readonly<{
|
|
146
146
|
height: number;
|
|
147
147
|
}>;
|
|
148
|
-
/**
|
|
148
|
+
/** ワークスペースの中の遷移 */
|
|
149
149
|
navigate: Readonly<{
|
|
150
150
|
to: BridgeTarget;
|
|
151
151
|
}>;
|
|
152
|
-
/**
|
|
152
|
+
/** メニューのページとアプリの設定の中の遷移をワークスペースの URL に写す(再読み込みと共有で同じ場所が開く) */
|
|
153
153
|
history: Readonly<{
|
|
154
154
|
path: string;
|
|
155
155
|
}>;
|
|
@@ -250,7 +250,7 @@ export type BridgeEvents = {
|
|
|
250
250
|
}>;
|
|
251
251
|
/** 見た目の変更 */
|
|
252
252
|
theme: BridgeTheme;
|
|
253
|
-
/**
|
|
253
|
+
/** ワークスペースの側の遷移(戻るなど)で、メニューのページとアプリの設定の下のパスが変わった */
|
|
254
254
|
route: Readonly<{
|
|
255
255
|
path: string;
|
|
256
256
|
}>;
|
|
@@ -82,7 +82,7 @@ export declare const INVITE_CODE_PLACEHOLDER = "{code}";
|
|
|
82
82
|
* - closedRetentionDays: 退会(closed)から削除までの日数(保持の間はスタッフが戻せる、毎日の処理 customer-deletions が削除)
|
|
83
83
|
* - consentPurposes: プロジェクトが宣言する同意の目的(固定の service・marketing に足す、consents.ts)
|
|
84
84
|
*/
|
|
85
|
-
/** ログインした人がだれでも読める顧客の設定の要約(有効か、発行者の id
|
|
85
|
+
/** ログインした人がだれでも読める顧客の設定の要約(有効か、発行者の id と表示名。ワークスペースの表示の切り替え) */
|
|
86
86
|
export type CustomersConfig = Readonly<{
|
|
87
87
|
enabled: boolean;
|
|
88
88
|
providers: readonly Readonly<{
|
|
@@ -201,7 +201,7 @@ export declare const SELF_API_ERRORS: readonly ["not_found", "forbidden", "inval
|
|
|
201
201
|
export type SelfApiError = (typeof SELF_API_ERRORS)[number];
|
|
202
202
|
/** 公開のクライアントの資格の能力(契約だけ、実装は要望の後) */
|
|
203
203
|
export type PublicClientCapability = 'verify_with_proof' | 'refresh_token' | 'customer_delivery';
|
|
204
|
-
/**
|
|
204
|
+
/** ワークスペースの顧客の紐付け(provider は設定の発行者の id、設定にない発行者は null) */
|
|
205
205
|
export type CustomerIdentityView = Readonly<{
|
|
206
206
|
provider: string | null;
|
|
207
207
|
issuer: string;
|
|
@@ -223,13 +223,13 @@ export type PendingIdentityView = CustomerIdentityView & Readonly<{
|
|
|
223
223
|
linked: boolean;
|
|
224
224
|
profile: CustomerProfileView;
|
|
225
225
|
}>;
|
|
226
|
-
/**
|
|
226
|
+
/** ワークスペースの顧客のプロフィールのレコード(なければ null) */
|
|
227
227
|
export type CustomerProfileView = Readonly<{
|
|
228
228
|
collection: string;
|
|
229
229
|
id: string;
|
|
230
230
|
title: string;
|
|
231
231
|
}> | null;
|
|
232
|
-
/**
|
|
232
|
+
/** ワークスペースの顧客の一覧の1行 */
|
|
233
233
|
export type CustomerListItem = Readonly<{
|
|
234
234
|
id: string;
|
|
235
235
|
status: CustomerStatus;
|
|
@@ -238,7 +238,7 @@ export type CustomerListItem = Readonly<{
|
|
|
238
238
|
identities: readonly CustomerIdentityView[];
|
|
239
239
|
profile: CustomerProfileView;
|
|
240
240
|
}>;
|
|
241
|
-
/**
|
|
241
|
+
/** ワークスペースの顧客の権利(installationId は出どころがインストールのときだけ) */
|
|
242
242
|
export type CustomerGrantView = Readonly<{
|
|
243
243
|
id: string;
|
|
244
244
|
targetCollection: string;
|
|
@@ -249,7 +249,7 @@ export type CustomerGrantView = Readonly<{
|
|
|
249
249
|
installationId: string | null;
|
|
250
250
|
version: number;
|
|
251
251
|
}>;
|
|
252
|
-
/**
|
|
252
|
+
/** ワークスペースの顧客の詳細(targetCollections は権利の対象にできるコレクション、today は導入先の今日、profileCollection はプロフィールのコレクション) */
|
|
253
253
|
export type CustomerDetail = Readonly<{
|
|
254
254
|
customer: Readonly<{
|
|
255
255
|
id: string;
|
|
@@ -23,11 +23,12 @@ export declare const EMBED_DISPLAY_NAMES_MAX = 100;
|
|
|
23
23
|
export type EmbedDisplayNames = Readonly<{
|
|
24
24
|
names: Readonly<Record<string, string>>;
|
|
25
25
|
}>;
|
|
26
|
-
/** トークンの交換(RFC 8693)の値:
|
|
26
|
+
/** トークンの交換(RFC 8693)の値: 画面のトークンか代理の委任の主張を、アカウントの資格の API のトークンに替える(委任の主張のクライアント認証はアプリの JWT、RFC 7523) */
|
|
27
27
|
export declare const TOKEN_EXCHANGE: {
|
|
28
28
|
readonly grantType: "urn:ietf:params:oauth:grant-type:token-exchange";
|
|
29
29
|
readonly subjectTokenType: "urn:ietf:params:oauth:token-type:jwt";
|
|
30
30
|
readonly issuedTokenType: "urn:ietf:params:oauth:token-type:access_token";
|
|
31
|
+
readonly clientAssertionType: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
|
31
32
|
};
|
|
32
33
|
/** トークンの交換の成功の応答(RFC 8693の形、expires_in は秒) */
|
|
33
34
|
export type TokenExchangeResponse = Readonly<{
|
|
@@ -36,6 +37,11 @@ export type TokenExchangeResponse = Readonly<{
|
|
|
36
37
|
token_type: 'Bearer';
|
|
37
38
|
expires_in: number;
|
|
38
39
|
}>;
|
|
40
|
+
/** 代理の委任の主張のエンドポイントの応答(token は DELEGATION_TOKEN の形、expiresIn は秒) */
|
|
41
|
+
export type DelegationTokenResponse = Readonly<{
|
|
42
|
+
token: string;
|
|
43
|
+
expiresIn: number;
|
|
44
|
+
}>;
|
|
39
45
|
/** API の依頼のトークンのエンドポイントの応答(token は ACCOUNT_TOKEN の形、expiresIn は秒。host だけが持ち、iframe には渡さない) */
|
|
40
46
|
export type EmbedApiToken = Readonly<{
|
|
41
47
|
token: string;
|
|
@@ -65,7 +71,7 @@ export type ExternalScreen = Readonly<{
|
|
|
65
71
|
enabled: boolean;
|
|
66
72
|
capabilities: readonly EmbedGrantableCapability[];
|
|
67
73
|
}>;
|
|
68
|
-
/**
|
|
74
|
+
/** ワークスペースに置く外の画面(鍵なし、panel はコレクションを閲覧できるアカウント、page は管理者に返す、field は field の項目の key) */
|
|
69
75
|
export type EmbedEntry = Readonly<{
|
|
70
76
|
id: string;
|
|
71
77
|
label: string;
|
|
@@ -74,7 +80,7 @@ export type EmbedEntry = Readonly<{
|
|
|
74
80
|
field?: string;
|
|
75
81
|
}>;
|
|
76
82
|
/**
|
|
77
|
-
* 署名つきの文脈の内容(origin
|
|
83
|
+
* 署名つきの文脈の内容(origin はワークスペースのオリジン)
|
|
78
84
|
* - placement: 置き場所(この値がない文脈は panel)
|
|
79
85
|
* - type・id: panel はコレクションとレコードの ID(新規は null)、page はどちらも null
|
|
80
86
|
* - path: page とダイアログの登録の URL の下のパス(先頭の / なし、パスなしの文脈にはない)
|
|
@@ -117,15 +123,15 @@ export type EmbedContextResponse = Readonly<{
|
|
|
117
123
|
ctxNext: string | null;
|
|
118
124
|
}>;
|
|
119
125
|
/**
|
|
120
|
-
*
|
|
121
|
-
* - preview:
|
|
126
|
+
* ワークスペースの HTML の CSP の frame-src に足す送り元
|
|
127
|
+
* - preview: プロジェクトのプレビューのオリジン(なしはワークスペースの /preview)
|
|
122
128
|
* - frames: 登録した外の画面と本文の埋め込みのオリジン
|
|
123
129
|
*/
|
|
124
130
|
export type AdminFrameSources = Readonly<{
|
|
125
131
|
preview: string | null;
|
|
126
132
|
frames: readonly string[];
|
|
127
133
|
}>;
|
|
128
|
-
/**
|
|
134
|
+
/** ワークスペースの HTML の CSP の送り元の取得の経路(ログインしたアカウント、ワークスペースの Worker が HTML の応答に CSP を付けるときに呼ぶ) */
|
|
129
135
|
export declare const ADMIN_FRAME_SOURCES_PATH = "/api/embeds/frame-sources";
|
|
130
136
|
/** URL のクエリの名前(署名つきの文脈) */
|
|
131
137
|
export declare const EMBED_CONTEXT_PARAM = "ctx";
|
|
@@ -144,7 +150,7 @@ export declare const EMBED_MESSAGES: {
|
|
|
144
150
|
readonly context: "tunasand:context";
|
|
145
151
|
readonly contextRequest: "tunasand:context_request";
|
|
146
152
|
};
|
|
147
|
-
/**
|
|
153
|
+
/** 外の画面とワークスペースの間のメッセージ(context の ctx・ctxNext は URL のクエリ ctx・ctx_next と同じ値) */
|
|
148
154
|
export type EmbedMessage = Readonly<{
|
|
149
155
|
type: typeof EMBED_MESSAGES.ready;
|
|
150
156
|
}> | Readonly<{
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type Catalog, type Locale } from '../../i18n/src/index.js';
|
|
2
2
|
import { type ErrorBody, type ErrorCode, type ErrorParams, type ErrorTarget } from './errors.js';
|
|
3
3
|
export declare const ERROR_MESSAGES: {
|
|
4
|
-
/**
|
|
4
|
+
/** コアの対象の表示名(エラーの文と操作の履歴で共通、アプリの対象は AppDefinition の targets) */
|
|
5
5
|
readonly targets: {
|
|
6
6
|
readonly request: "作成の依頼";
|
|
7
7
|
readonly role: "ロール";
|
|
8
|
-
readonly
|
|
8
|
+
readonly files: "ファイル";
|
|
9
9
|
readonly record: "マスタ";
|
|
10
|
-
readonly
|
|
10
|
+
readonly file: "画像";
|
|
11
11
|
readonly mcp: "MCP";
|
|
12
12
|
readonly version: "バージョン";
|
|
13
13
|
readonly profile: "プロフィール";
|
|
14
14
|
readonly portrait: "顔の画像";
|
|
15
|
-
readonly
|
|
15
|
+
readonly standard_app: "標準の機能";
|
|
16
16
|
readonly account: "アカウント";
|
|
17
17
|
readonly comment: "コメント";
|
|
18
18
|
readonly view: "ビュー";
|
|
@@ -33,12 +33,13 @@ export declare const ERROR_MESSAGES: {
|
|
|
33
33
|
/** コードごとの文 */
|
|
34
34
|
readonly codes: {
|
|
35
35
|
readonly invalid_input: "入力に誤りがあります。内容を確かめて直してください。";
|
|
36
|
+
readonly infra_id_uuid: "ID の形が違います。UUID ではなく、英小文字と数字の26文字の ID を指定してください。";
|
|
36
37
|
readonly submit_unmet: "レビューを依頼する条件を満たしていません。各フィールドの理由を確かめて直してください。";
|
|
37
38
|
readonly publish_unmet: "公開の条件を満たしていません。各フィールドの理由を確かめて直してください。";
|
|
38
39
|
readonly save_unmet: "保存の条件を満たしていません。各フィールドの理由を確かめて直してください。";
|
|
39
40
|
readonly version_required: "元にしたバージョン(version)が必要です。画面を読み込み直してから、もう一度保存してください。";
|
|
40
41
|
readonly file_required: "画像のファイルを選んでください。";
|
|
41
|
-
readonly file_too_large: "画像は{
|
|
42
|
+
readonly file_too_large: "画像は{fileMaxMB, number}MBまでです。";
|
|
42
43
|
readonly unsupported_image: "対応していない画像の形式です(PNG・JPEG・GIF・WebP)。";
|
|
43
44
|
readonly unsupported_file: "対応していないファイルの形式です(PDF・ZIP・テキスト・CSV・Word・Excel・PowerPoint)。";
|
|
44
45
|
readonly invalid_dimensions: "画像の寸法を読み取れません。別の画像を選んでください。";
|
|
@@ -56,12 +57,12 @@ export declare const ERROR_MESSAGES: {
|
|
|
56
57
|
readonly invalid_app_token: "アプリの資格が無効です。アプリの JWT かインストールのトークンを取り直してから送ってください。";
|
|
57
58
|
readonly api_key_forbidden: "{target, select, none {API キーにこの取得の権限がありません。} other {API キーに「{target}」を取得する権限がありません。}}設定の API キーで、キーの権限を見直してください。";
|
|
58
59
|
readonly account_not_found: "{name, select, none {} other {{name}}} のアカウントがありません。管理者にアカウントの登録を依頼してください。";
|
|
59
|
-
readonly mcp_not_allowed: "MCP
|
|
60
|
+
readonly mcp_not_allowed: "MCP からは操作できません。ワークスペースから操作してください。";
|
|
60
61
|
readonly insufficient_scope: "AI の接続で許した範囲ではこの操作はできません。接続し直して{scope, select, content_publish {「公開まで」} other {必要な範囲}}を許してください。";
|
|
61
62
|
readonly admin_only: "管理者だけの操作です。必要なときは、管理者に依頼してください。";
|
|
62
63
|
readonly operator_read_only: "サポートのアクセスの許可が閲覧だけのため、変更できません。変更が要るときは、プロジェクトの管理者に許可の範囲の変更を依頼してください。";
|
|
63
64
|
readonly not_trial: "検証用のフラグのプロジェクトだけの操作です。";
|
|
64
|
-
readonly not_live: "
|
|
65
|
+
readonly not_live: "本番の環境だけでできる操作です。本番の環境のワークスペースから操作してください。";
|
|
65
66
|
readonly operator_closed: "サポートのアクセスでは変更できない操作です(アカウント、ロール、連携、アプリ、顧客の ID、許可など)。プロジェクトの管理者に依頼してください。";
|
|
66
67
|
readonly forbidden: "{target, select, none {この操作の権限がありません。} other {{target}のこの操作の権限がありません。}}必要なときは、管理者にロールの見直しを依頼してください。";
|
|
67
68
|
readonly editorial_only: "{target, select, none {対象} other {{target}}}は、公開の権限があるアカウントだけが作成できます。公開の権限があるメンバーに作成を依頼してください。";
|
|
@@ -75,7 +76,7 @@ export declare const ERROR_MESSAGES: {
|
|
|
75
76
|
readonly method_not_allowed: "この経路はこのメソッドを受け付けません。";
|
|
76
77
|
readonly customer_not_linked: "このアカウントに結び付く顧客がいません。管理者に、顧客とアカウントの結び付けを依頼してください。";
|
|
77
78
|
readonly customer_pending: "このアカウントの結び付けは、運営の確認の後に使えます。確認が終わるまでお待ちください。";
|
|
78
|
-
readonly in_use: "{by, select, uses {{count, number}件で使用中のため、削除できません。} places {{count, number}か所で使用中のため、削除できません。} outputs {{count, number}件の企画の成果物で使用中のため、削除できません。} record {{name, select, none {ほかの内容} other {{name}}}で使用中のため、削除できません。} writers {{count, number}件のレコードに結び付いているため、削除できません。} customers {{count, number}件のレコードが所属しているため、削除できません。} accounts {{count, number}件のアカウントがこのロールのため、削除できません。}
|
|
79
|
+
readonly in_use: "{by, select, uses {{count, number}件で使用中のため、削除できません。} places {{count, number}か所で使用中のため、削除できません。} outputs {{count, number}件の企画の成果物で使用中のため、削除できません。} record {{name, select, none {ほかの内容} other {{name}}}で使用中のため、削除できません。} writers {{count, number}件のレコードに結び付いているため、削除できません。} customers {{count, number}件のレコードが所属しているため、削除できません。} accounts {{count, number}件のアカウントがこのロールのため、削除できません。} app {{count, number}件の{name, select, none {アプリのデータ} other {{name}}}から参照されているため、削除できません。} other {使用中のため、削除できません。}}使っている所から外してから、もう一度削除してください。";
|
|
79
80
|
readonly duplicate_name: "同じ名前がすでにあります。別の名前を付けてください。";
|
|
80
81
|
readonly duplicate_email: "同じメールアドレスのアカウントがすでにあります。一覧のそのアカウントを編集してください。";
|
|
81
82
|
readonly duplicate_id: "この ID はすでに使用されています。別の ID を指定してください。";
|
|
@@ -125,13 +126,13 @@ export declare const ERROR_MESSAGES: {
|
|
|
125
126
|
readonly installation_state: "今のインストールの状態ではこの操作はできません。画面を読み込み直して、状態を確かめてください。";
|
|
126
127
|
readonly site_deploy: "今はサイトを上げられません。ほかのアップロードの最中か、サイトが止められているか外されています。少し待ってから上げ直し、続くときは運営者に連絡してください。";
|
|
127
128
|
readonly site_stopped_by_check: "上げた直後の確認で外れたため、サイトを止めました。直したものを上げた後、運営者に戻してもらってください。";
|
|
128
|
-
readonly
|
|
129
|
+
readonly required_app: "止められない標準の機能は、停止もアンインストールもできません。";
|
|
129
130
|
readonly app_installed: "アプリは1つのプロジェクトに1つだけインストールできます。";
|
|
130
131
|
readonly app_dependencies: "依存のアプリをそろえられません。アプリの詳細で、足りないアプリと合わないアプリを確かめてください。";
|
|
131
132
|
readonly app_reinstalled: "同じアプリを入れ直したインストールがあるため、古いインストールのデータは消せません。";
|
|
132
133
|
readonly app_managed: "アプリのインストールが管理する登録です。変更はアプリの新しいバージョンの同意で行います。";
|
|
133
134
|
readonly request_key_reused: "同じ重複を除くキーで、別の人かチャネルか目的の記録がすでにあります。別のキーで送ってください。";
|
|
134
|
-
readonly
|
|
135
|
+
readonly no_organization: "組織に属していないプロジェクトのため、招待できません。運営者に組織への所属を頼んでください。";
|
|
135
136
|
readonly schema_changed: "スキーマが変更されたため、保存できませんでした。画面を読み込み直してください。";
|
|
136
137
|
readonly customer_inactive: "この顧客は停止中か退会済みのため、操作できません。顧客の画面で状態を確かめてください。";
|
|
137
138
|
readonly self_limit: "1人あたりのレコードの数の上限に達しています。不要なレコードを削除してから作成してください。";
|
|
@@ -146,7 +147,7 @@ export declare const ERROR_MESSAGES: {
|
|
|
146
147
|
readonly not_frozen: "本番の書き込みは止まっていません。";
|
|
147
148
|
readonly approval_running: "承認した操作の実行中です。少し待ってからやり直してください。";
|
|
148
149
|
};
|
|
149
|
-
/** own_only
|
|
150
|
+
/** own_only の対象ごとの文(アプリの文は manifest の messages) */
|
|
150
151
|
readonly own: {
|
|
151
152
|
readonly profile: "自分のプロフィールだけを編集できます。";
|
|
152
153
|
readonly portrait: "自分の顔の画像だけを変更できます。";
|
|
@@ -160,6 +161,7 @@ export declare const ERROR_MESSAGES: {
|
|
|
160
161
|
/** コードごとの見出し */
|
|
161
162
|
readonly titles: {
|
|
162
163
|
readonly invalid_input: "入力エラー";
|
|
164
|
+
readonly infra_id_uuid: "入力エラー";
|
|
163
165
|
readonly submit_unmet: "レビューを依頼できません";
|
|
164
166
|
readonly publish_unmet: "公開できません";
|
|
165
167
|
readonly save_unmet: "保存できません";
|
|
@@ -242,7 +244,7 @@ export declare const TARGET_LABELS: Readonly<Record<ErrorTarget, string>>;
|
|
|
242
244
|
/** コレクションの id・マスタの種類からエラーの対象(対象の一覧になければ fallback) */
|
|
243
245
|
export declare const targetOf: (id: string, fallback: ErrorTarget) => ErrorTarget;
|
|
244
246
|
/**
|
|
245
|
-
*
|
|
247
|
+
* 対象ごとの文の追加(アプリの manifest の messages、キーは対象の id、値は ICU MessageFormat)
|
|
246
248
|
* - own: 自分のものだけを操作できるときの文
|
|
247
249
|
* - noLink: 結び付くレコードがないアカウントの文、{name} は結び付くコレクションの表示名
|
|
248
250
|
*/
|
|
@@ -250,18 +252,18 @@ export type TargetMessages = Readonly<{
|
|
|
250
252
|
own?: Readonly<Record<string, string>>;
|
|
251
253
|
noLink?: Readonly<Record<string, string>>;
|
|
252
254
|
}>;
|
|
253
|
-
/** エラーの画面の文(targets は対象の表示名、messages
|
|
255
|
+
/** エラーの画面の文(targets は対象の表示名、messages は対象ごとの文の追加、画面はアプリの対象と文とコレクションの表示名を含めた表。problems は name に入る問題の文) */
|
|
254
256
|
export declare function errorLabel(code: ErrorCode, params?: ErrorParams, targets?: Readonly<Record<string, string>>, messages?: TargetMessages, catalog?: ErrorCatalog, problems?: Readonly<Record<string, string>>, locale?: Locale): string;
|
|
255
|
-
/** 応答のエラーの英語の文(targets
|
|
257
|
+
/** 応答のエラーの英語の文(targets はコレクションの表示名、コアの対象は英語の表、アプリの対象と文は使わない) */
|
|
256
258
|
export declare const errorText: (code: ErrorCode, params?: ErrorParams, targets?: Readonly<Record<string, string>>) => string;
|
|
257
259
|
/** 応答のエラーの文をカタログから作る(対象の表示名はカタログの表、ほかの言語の画面とアプリ向け) */
|
|
258
260
|
export declare const errorMessageOf: (error: Readonly<{
|
|
259
261
|
code: ErrorCode;
|
|
260
262
|
params?: ErrorParams;
|
|
261
263
|
}>, catalog?: ErrorCatalog) => string;
|
|
262
|
-
/** プロジェクトの文脈の外(受け皿の Worker
|
|
264
|
+
/** プロジェクトの文脈の外(受け皿の Worker・レジストリ・アプリ)のエラーの本文(requestId は要求の x-request-id、message は英語の文) */
|
|
263
265
|
export declare const errorBodyFor: (code: Exclude<ErrorCode, "network_error">, requestId: string, params?: ErrorParams) => ErrorBody;
|
|
264
|
-
/**
|
|
266
|
+
/** アプリの対象ごとの文をまとめる(同じ対象はあとのアプリの文) */
|
|
265
267
|
export declare const mergeMessages: (list: readonly (TargetMessages | undefined)[]) => TargetMessages;
|
|
266
268
|
/** エラーのトーストの見出し(項目ごとの理由がすべて未入力なら必須項目のエラー、スキーマの文は「〜が未入力」で統一) */
|
|
267
269
|
export declare const errorTitle: (code: ErrorCode, issues?: readonly {
|
|
@@ -3,14 +3,14 @@ export declare const ERROR_MESSAGES_EN: {
|
|
|
3
3
|
readonly targets: {
|
|
4
4
|
readonly request: "creation request";
|
|
5
5
|
readonly role: "role";
|
|
6
|
-
readonly
|
|
6
|
+
readonly files: "file";
|
|
7
7
|
readonly record: "master";
|
|
8
|
-
readonly
|
|
8
|
+
readonly file: "image";
|
|
9
9
|
readonly mcp: "MCP";
|
|
10
10
|
readonly version: "version";
|
|
11
11
|
readonly profile: "profile";
|
|
12
12
|
readonly portrait: "portrait";
|
|
13
|
-
readonly
|
|
13
|
+
readonly standard_app: "standard feature";
|
|
14
14
|
readonly account: "account";
|
|
15
15
|
readonly comment: "comment";
|
|
16
16
|
readonly view: "view";
|
|
@@ -30,12 +30,13 @@ export declare const ERROR_MESSAGES_EN: {
|
|
|
30
30
|
};
|
|
31
31
|
readonly codes: {
|
|
32
32
|
readonly invalid_input: "The input is invalid.";
|
|
33
|
+
readonly infra_id_uuid: "Specify the 26-character ID of lowercase letters and digits, not a UUID.";
|
|
33
34
|
readonly submit_unmet: "The submission requirements are not met.";
|
|
34
35
|
readonly publish_unmet: "The publishing requirements are not met.";
|
|
35
36
|
readonly save_unmet: "The saving requirements are not met.";
|
|
36
37
|
readonly version_required: "The base version (version) is required.";
|
|
37
38
|
readonly file_required: "Choose an image file.";
|
|
38
|
-
readonly file_too_large: "Images must be at most {
|
|
39
|
+
readonly file_too_large: "Images must be at most {fileMaxMB, number} MB.";
|
|
39
40
|
readonly unsupported_image: "Unsupported image format (PNG, JPEG, GIF, WebP).";
|
|
40
41
|
readonly unsupported_file: "Unsupported file format (PDF, ZIP, text, CSV, Word, Excel, PowerPoint).";
|
|
41
42
|
readonly invalid_dimensions: "The image dimensions are invalid.";
|
|
@@ -72,7 +73,7 @@ export declare const ERROR_MESSAGES_EN: {
|
|
|
72
73
|
readonly method_not_allowed: "This path does not accept this method.";
|
|
73
74
|
readonly customer_not_linked: "No customer is linked to this account.";
|
|
74
75
|
readonly customer_pending: "The link of this account becomes usable after review by the operator.";
|
|
75
|
-
readonly in_use: "{by, select, uses {Cannot delete because it is used in {count, number} items.} places {Cannot delete because it is used in {count, number} places.} outputs {Cannot delete because it is used by {count, number} planning outputs.} record {Cannot delete because it is used by {name, select, none {other content} other {{name}}}.} writers {Cannot delete because it is linked to {count, number} records.} customers {Cannot delete because {count, number} records belong to it.} accounts {Cannot delete because {count, number} accounts have this role.}
|
|
76
|
+
readonly in_use: "{by, select, uses {Cannot delete because it is used in {count, number} items.} places {Cannot delete because it is used in {count, number} places.} outputs {Cannot delete because it is used by {count, number} planning outputs.} record {Cannot delete because it is used by {name, select, none {other content} other {{name}}}.} writers {Cannot delete because it is linked to {count, number} records.} customers {Cannot delete because {count, number} records belong to it.} accounts {Cannot delete because {count, number} accounts have this role.} app {Cannot delete because it is referenced by {count, number} {name, select, none {extension records} other {{name}}}.} other {Cannot delete because it is in use.}}";
|
|
76
77
|
readonly duplicate_name: "The same name already exists.";
|
|
77
78
|
readonly duplicate_email: "An account with the same email address already exists.";
|
|
78
79
|
readonly duplicate_id: "This ID is already in use.";
|
|
@@ -121,13 +122,13 @@ export declare const ERROR_MESSAGES_EN: {
|
|
|
121
122
|
readonly installation_state: "This operation is not possible in the current installation state.";
|
|
122
123
|
readonly site_deploy: "The site cannot be uploaded now. Another upload is in progress, or the site is stopped or removed.";
|
|
123
124
|
readonly site_stopped_by_check: "The site was stopped because the check right after the upload failed. Upload a fix and ask the operator to restore it.";
|
|
124
|
-
readonly
|
|
125
|
+
readonly required_app: "Required standard features cannot be stopped or uninstalled.";
|
|
125
126
|
readonly app_installed: "An app can be installed only once per project.";
|
|
126
127
|
readonly app_dependencies: "Cannot satisfy the app dependencies. Check the reasons in conflicts.";
|
|
127
128
|
readonly app_reinstalled: "The data of the old installation cannot be deleted because the same app has been reinstalled.";
|
|
128
129
|
readonly app_managed: "This registration is managed by an app installation. Change it by consenting to a new app version.";
|
|
129
130
|
readonly request_key_reused: "A record with another person, channel or purpose already exists for the same deduplication key.";
|
|
130
|
-
readonly
|
|
131
|
+
readonly no_organization: "Cannot invite because the project does not belong to an organization. Ask the operator to add it to an organization.";
|
|
131
132
|
readonly schema_changed: "Could not save because the schema changed. Reload the screen.";
|
|
132
133
|
readonly customer_inactive: "This customer is suspended or closed, so the operation is not possible.";
|
|
133
134
|
readonly self_limit: "The limit of records per person has been reached.";
|
|
@@ -152,6 +153,7 @@ export declare const ERROR_MESSAGES_EN: {
|
|
|
152
153
|
readonly linkedRecord: "record";
|
|
153
154
|
readonly titles: {
|
|
154
155
|
readonly invalid_input: "Input error";
|
|
156
|
+
readonly infra_id_uuid: "Input error";
|
|
155
157
|
readonly submit_unmet: "Cannot submit";
|
|
156
158
|
readonly publish_unmet: "Cannot publish";
|
|
157
159
|
readonly save_unmet: "Cannot save";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ManagementOperation, Operation,
|
|
1
|
+
import type { ManagementOperation, Operation, OrganizationRole } from './authorize.js';
|
|
2
2
|
import { FAILURE_STATUS } from './failureStatus.js';
|
|
3
|
-
/** 変更の操作で受け付ける本文の大きさ(/api、バイト数、multipart のアップロードは
|
|
3
|
+
/** 変更の操作で受け付ける本文の大きさ(/api、バイト数、multipart のアップロードは FILE_SIZE_MAX) */
|
|
4
4
|
export declare const JSON_BODY_MAX: number;
|
|
5
5
|
/** 画面の側だけのコード(通信の失敗と JSON でない応答。HTTP の状態を持たない) */
|
|
6
6
|
declare const NETWORK_ERROR = "network_error";
|
|
7
7
|
/** CMS の API のエラーのコード(状態は failureStatus.ts の表) */
|
|
8
|
-
declare const ERROR_CODES: readonly ["invalid_input", "submit_unmet", "publish_unmet", "save_unmet", "version_required", "file_required", "file_too_large", "unsupported_image", "unsupported_file", "invalid_dimensions", "https_required", "invalid_style", "login_required", "invalid_mcp_token", "mcp_signature_invalid", "invalid_account_token", "preview_token_required", "api_key_required", "invalid_api_key", "invalid_id_token", "invalid_app_token", "account_not_found", "invalid_preview_token", "api_key_forbidden", "mcp_not_allowed", "insufficient_scope", "admin_only", "operator_read_only", "operator_closed", "not_trial", "not_live", "forbidden", "editorial_only", "no_linked_record", "own_only", "not_visible", "published_admin_only", "cannot_remove_self", "cannot_change_owner", "not_found", "customer_not_linked", "customer_pending", "method_not_allowed", "in_use", "duplicate_name", "duplicate_email", "duplicate_id", "duplicate_slug", "version_conflict", "article_editing", "invalid_state", "unpublish_first", "last_admin", "exceeds_own", "reauth_required", "approval_required", "stale", "approval_closed", "already_linked", "invalid_invite", "run_done", "cursor_expired", "body_too_large", "rate_limited", "upstream_failed", "not_configured", "unavailable", "writes_paused", "environment_frozen", "job_failed", "internal_error", "network_error"];
|
|
8
|
+
declare const ERROR_CODES: readonly ["invalid_input", "submit_unmet", "publish_unmet", "save_unmet", "version_required", "file_required", "file_too_large", "unsupported_image", "unsupported_file", "invalid_dimensions", "https_required", "invalid_style", "infra_id_uuid", "login_required", "invalid_mcp_token", "mcp_signature_invalid", "invalid_account_token", "preview_token_required", "api_key_required", "invalid_api_key", "invalid_id_token", "invalid_app_token", "account_not_found", "invalid_preview_token", "api_key_forbidden", "mcp_not_allowed", "insufficient_scope", "admin_only", "operator_read_only", "operator_closed", "not_trial", "not_live", "forbidden", "editorial_only", "no_linked_record", "own_only", "not_visible", "published_admin_only", "cannot_remove_self", "cannot_change_owner", "not_found", "customer_not_linked", "customer_pending", "method_not_allowed", "in_use", "duplicate_name", "duplicate_email", "duplicate_id", "duplicate_slug", "version_conflict", "article_editing", "invalid_state", "unpublish_first", "last_admin", "exceeds_own", "reauth_required", "approval_required", "stale", "approval_closed", "already_linked", "invalid_invite", "run_done", "cursor_expired", "body_too_large", "rate_limited", "upstream_failed", "not_configured", "unavailable", "writes_paused", "environment_frozen", "job_failed", "internal_error", "network_error"];
|
|
9
9
|
/** エラーのコード */
|
|
10
10
|
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
11
11
|
/** やり直せば通りうるエラー(画面はこれだけに再試行のボタンを出す) */
|
|
@@ -17,33 +17,33 @@ export declare const ERROR_STATUS: { readonly [K in ServerErrorCode]: (typeof FA
|
|
|
17
17
|
/**
|
|
18
18
|
* コアの操作や表示の対象(not_found・own_only などの params.target)
|
|
19
19
|
* - コレクションの対象: コレクションの id、表示名はスキーマ
|
|
20
|
-
* -
|
|
20
|
+
* - アプリの対象: AppManifest の targets
|
|
21
21
|
*/
|
|
22
|
-
export type ErrorTarget = 'request' | 'role' | '
|
|
22
|
+
export type ErrorTarget = 'request' | 'role' | 'files' | 'record' | 'file' | 'mcp' | 'version' | 'profile' | 'portrait' | 'standard_app' | 'account' | 'comment' | 'view' | 'webhook' | 'external_function' | 'external_screen' | 'api_key' | 'preview' | 'trash' | 'customer' | 'customer_identity' | 'customer_grant' | 'app' | 'installation' | 'invitation' | 'environment';
|
|
23
23
|
/** 状態の不一致の理由(invalid_state) */
|
|
24
|
-
export type InvalidStateReason = 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publishing' | 'no_review' | 'not_published' | 'collection_rows' | 'restore_conflict' | 'collection_exists' | 'collection_missing' | 'not_restorable' | 'installation_state' | '
|
|
24
|
+
export type InvalidStateReason = 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publishing' | 'no_review' | 'not_published' | 'collection_rows' | 'restore_conflict' | 'collection_exists' | 'collection_missing' | 'not_restorable' | 'installation_state' | 'required_app' | 'app_installed' | 'app_dependencies' | 'app_reinstalled' | 'app_managed' | 'request_key_reused' | 'no_organization' | 'schema_changed' | 'site_deploy' | 'site_stopped_by_check' | 'customer_inactive' | 'self_limit' | 'already_live' | 'target_live' | 'target_synthetic' | 'no_changes' | 'schema_values' | 'environment_limit' | 'environment_busy' | 'unregistered_table' | 'not_frozen' | 'approval_running';
|
|
25
25
|
/**
|
|
26
26
|
* 権限の拒否で足りないもの(403 forbidden の params.required)
|
|
27
27
|
* - operation: 拒んだ操作(Operation か、プロジェクトの管理の操作 ManagementOperation)
|
|
28
|
-
* - roles:
|
|
28
|
+
* - roles: その操作を持つロール(ロールで決まる操作だけ。管理の操作は組織のロール)
|
|
29
29
|
* - capability: 足りない能力(アプリ・インストールの能力の文字列、例 `op:<コレクション>:read_customers`)
|
|
30
30
|
*/
|
|
31
31
|
export type ErrorRequired = Readonly<{
|
|
32
32
|
operation: Operation | ManagementOperation;
|
|
33
|
-
roles?: readonly (string |
|
|
33
|
+
roles?: readonly (string | OrganizationRole)[];
|
|
34
34
|
capability?: string;
|
|
35
35
|
}>;
|
|
36
36
|
/** エラーの補足の値(コードごとに使用する項目だけ) */
|
|
37
37
|
export type ErrorParams = {
|
|
38
38
|
/**
|
|
39
39
|
* 対象: not_found・own_only・forbidden・not_visible・no_linked_record・editorial_only・api_key_forbidden
|
|
40
|
-
* - 文字列:
|
|
40
|
+
* - 文字列: アプリの対象・コレクションの id
|
|
41
41
|
*/
|
|
42
42
|
target?: ErrorTarget | (string & {});
|
|
43
43
|
/** 件数: in_use */
|
|
44
44
|
count?: number;
|
|
45
45
|
/** 使用先: in_use */
|
|
46
|
-
by?: 'uses' | 'places' | 'outputs' | 'record' | 'writers' | 'customers' | 'accounts' | '
|
|
46
|
+
by?: 'uses' | 'places' | 'outputs' | 'record' | 'writers' | 'customers' | 'accounts' | 'app';
|
|
47
47
|
/**
|
|
48
48
|
* 理由: invalid_state(InvalidStateReason)、already_linked(identity は相手の ID、customer は顧客)
|
|
49
49
|
* - invalid_invite: not_found・expired・used
|
|
@@ -55,7 +55,7 @@ export type ErrorParams = {
|
|
|
55
55
|
* 名前
|
|
56
56
|
* - no_linked_record: 結び付くコレクションの表示名、account_not_found: メールアドレス
|
|
57
57
|
* - not_configured: 設定の名前、job_failed: 失敗の理由、in_use の record: 参照するコレクションと項目、
|
|
58
|
-
* in_use の
|
|
58
|
+
* in_use の app: 参照するアプリの表の表示名
|
|
59
59
|
* - invalid_state の restore_conflict: 戻すレコードとぶつかるレコードの表示名
|
|
60
60
|
*/
|
|
61
61
|
name?: string;
|