@tunasand/sdk 0.11.0 → 0.12.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +6 -4
  3. package/dist/analytics.js +113 -50
  4. package/dist/app.js +98 -9
  5. package/dist/{apps-DIxAWBSZ.js → apps-BysPfMuR.js} +102 -12
  6. package/dist/{bridge-Dv4NxGZ7.js → bridge-C2Bl-OAF.js} +1 -2
  7. package/dist/bridge.js +1 -1
  8. package/dist/cli.js +2 -2
  9. package/dist/{collection-nUz1RetA.js → collection-26aglrg6.js} +20 -2
  10. package/dist/delivery.js +1 -1
  11. package/dist/{embeds-B-Dbn64k.js → embeds-DY6O5TrJ.js} +2 -2
  12. package/dist/end-users.js +29 -25
  13. package/dist/{errorLabels-aT2bnMsO.js → errorLabels-BK1NJ6Wz.js} +21 -5
  14. package/dist/i18n.js +2 -2
  15. package/dist/integrations.js +2 -2
  16. package/dist/{ja-CrY_72Tn.js → ja-B3lAaOhZ.js} +13 -11
  17. package/dist/{workflow-CUpl6hO_.js → paymentPort-p1jV44Zz.js} +57 -2
  18. package/dist/{schema-Dcg1ajnW.js → schema-Bs_BUUNv.js} +35 -7
  19. package/dist/schema.js +4 -4
  20. package/dist/types/access/src/handoff.d.ts +1 -1
  21. package/dist/types/access/src/oidc.d.ts +2 -0
  22. package/dist/types/contract/src/api/define.d.ts +165 -0
  23. package/dist/types/contract/src/app.d.ts +22 -7
  24. package/dist/types/contract/src/appChannels.d.ts +65 -27
  25. package/dist/types/contract/src/appDependencies.d.ts +22 -2
  26. package/dist/types/contract/src/appInbound.d.ts +26 -1
  27. package/dist/types/contract/src/appSecrets.d.ts +18 -0
  28. package/dist/types/contract/src/appServer.d.ts +57 -7
  29. package/dist/types/contract/src/apps.d.ts +15 -6
  30. package/dist/types/contract/src/auditActions.d.ts +2 -2
  31. package/dist/types/contract/src/auditLabels.d.ts +10 -1
  32. package/dist/types/contract/src/authorize.d.ts +1 -1
  33. package/dist/types/contract/src/bridge.d.ts +1 -1
  34. package/dist/types/contract/src/consents.d.ts +1 -6
  35. package/dist/types/contract/src/embeds.d.ts +11 -9
  36. package/dist/types/contract/src/endUsers.d.ts +3 -0
  37. package/dist/types/contract/src/errorLabels.d.ts +4 -1
  38. package/dist/types/contract/src/errorLabelsEn.d.ts +4 -1
  39. package/dist/types/contract/src/errors.d.ts +2 -2
  40. package/dist/types/contract/src/eventTraces.d.ts +0 -2
  41. package/dist/types/contract/src/hostingRpc.d.ts +21 -2
  42. package/dist/types/contract/src/import.d.ts +3 -3
  43. package/dist/types/contract/src/index.d.ts +16 -13
  44. package/dist/types/contract/src/issueLabels.d.ts +11 -3
  45. package/dist/types/contract/src/issueLabelsEn.d.ts +4 -0
  46. package/dist/types/contract/src/manage.d.ts +5 -0
  47. package/dist/types/contract/src/notices.d.ts +2 -3
  48. package/dist/types/contract/src/operationEffects.d.ts +39 -0
  49. package/dist/types/contract/src/operatorOperations.d.ts +104 -47
  50. package/dist/types/contract/src/paymentPort.d.ts +129 -0
  51. package/dist/types/contract/src/readPages.d.ts +92 -0
  52. package/dist/types/contract/src/roles.d.ts +2 -2
  53. package/dist/types/contract/src/settingProblems.d.ts +18 -1
  54. package/dist/types/contract/src/workflow.d.ts +5 -2
  55. package/dist/types/contract/src/workspaceItems.d.ts +3 -1
  56. package/dist/types/contract/src/workspacePaths.d.ts +1 -1
  57. package/dist/types/schema/src/collection.d.ts +4 -0
  58. package/dist/types/schema/src/file.d.ts +2 -0
  59. package/dist/types/schema/src/index.d.ts +3 -2
  60. package/dist/types/schema/src/indexes.d.ts +11 -0
  61. package/dist/types/schema/src/labels/en.d.ts +2 -0
  62. package/dist/types/schema/src/labels/ja.d.ts +13 -11
  63. package/dist/types/schema/src/problems.d.ts +13 -11
  64. package/dist/types/sdk/src/app.d.ts +11 -8
  65. package/dist/types/sdk/src/end-users.d.ts +12 -15
  66. package/dist/types/sdk/src/schema.d.ts +1 -1
  67. package/dist/{types-DkO2N7u2.js → types-CYnY-63C.js} +1 -1
  68. package/dist/types.js +1 -1
  69. package/dist/{typesSource-VJIxtN9b.js → typesSource-BTA9-rcB.js} +1 -1
  70. package/package.json +2 -2
@@ -1,6 +1,8 @@
1
- /** 受ける経路の宣言(name は経路の最後の区間) */
1
+ import type { ChannelMode } from './appChannels.js';
2
+ /** 受ける経路の宣言(name は経路の最後の区間、dispatch はアプリの単位の受信) */
2
3
  export type AppInboundDeclaration = Readonly<{
3
4
  name: string;
5
+ dispatch?: 'app';
4
6
  }>;
5
7
  /** 経路の名前の形 */
6
8
  export declare const APP_INBOUND_NAME: RegExp;
@@ -24,5 +26,28 @@ export type AppInboundRequest = Readonly<{
24
26
  body: Uint8Array;
25
27
  headers: Headers;
26
28
  }>;
29
+ /**
30
+ * 受けた要求の処理の結果(refused は受け付けて処理しない理由のコード)
31
+ * 直らない拒否(届け先の人や売り物がない、値が合わない、許可がない)は refused で返し、コアがログに残して受け付けを返す(送り手に再送させない)
32
+ * 一時的な失敗は例外にする(本文なしの500、送り手の再送)
33
+ */
34
+ export type AppInboundOutcome = Readonly<{
35
+ refused: string;
36
+ }> | undefined;
37
+ /** アプリの単位の受信の経路(公開の API のホストのパス。appId は同梱のアプリの名前空間) */
38
+ export declare const appDispatchPathOf: (appId: string, name: string) => string;
39
+ /** アプリの単位の受信の経路の形(1つ目は名前空間、2つ目は name) */
40
+ export declare const APP_DISPATCH_PATH: RegExp;
41
+ /** アプリの単位の受信で受けた要求(チャネルは未定) */
42
+ export type AppDispatchRequest = Readonly<{
43
+ body: Uint8Array;
44
+ headers: Headers;
45
+ }>;
46
+ /** 振り分けの結果(mode と externalKey は届け先のチャネルの外部のキー、environmentId は sandbox のイベントの届け先の環境。null は受け付けて捨てる) */
47
+ export type AppDispatched = Readonly<{
48
+ mode: ChannelMode;
49
+ externalKey: string;
50
+ environmentId: string | null;
51
+ }> | null;
27
52
  /** マニフェストのチャネルの種類の inbound の誤りの箇所(種類の宣言の中の道) */
28
53
  export declare function appInboundProblems(inbound: unknown): string[];
@@ -1,8 +1,24 @@
1
+ import type { ChannelMode } from './appChannels.js';
1
2
  /** 秘密値の宣言(key は outbound の auth.secret で指す名前) */
2
3
  export type AppSecretDeclaration = Readonly<{
3
4
  key: string;
4
5
  label: string;
5
6
  }>;
7
+ /**
8
+ * 運営の秘密値(マニフェストの operator_secrets。同梱のアプリだけが使える)
9
+ * - 値はインスタンスの運営者が環境の変数で渡し、すべてのプロジェクトで同じ。アプリには値を返さず、外への要求の auth と署名の検証にだけ使う
10
+ * - 値はモード(live と sandbox)ごとの2組。外への要求は環境の方針で組を選ぶ(live の環境は live、ほかは sandbox)
11
+ * - キーは secrets とチャネルの種類の secrets のキーと重ねない
12
+ */
13
+ export type AppOperatorSecrets = Readonly<{
14
+ /** 署名の検証(mode は使う組。キーが未宣言か値がなければ false) */
15
+ verifyHmac: (key: string, check: AppHmacCheck, mode: ChannelMode) => Promise<boolean>;
16
+ /**
17
+ * 運営の秘密値を載せる読み取りの外への要求(mode は載せる組)
18
+ * GET だけで、マニフェストの outbound の宣言のうち auth が operator_secrets のキーを指すものに当たる要求だけ。ほかは送らずに例外(EgressDenied)
19
+ */
20
+ egress: (mode: ChannelMode, input: string | URL, init?: RequestInit) => Promise<Response>;
21
+ }>;
6
22
  /** 入力した秘密値の状態(tail は末尾、値が短ければ null) */
7
23
  export type AppSecretState = Readonly<{
8
24
  key: string;
@@ -43,3 +59,5 @@ export declare const APP_SECRET_DECLARATION_LIMITS: {
43
59
  * - outbound の auth.secret は secrets で宣言したキーか、channelKeys(チャネルの種類の秘密値のキー)でなければならない
44
60
  */
45
61
  export declare function appSecretsProblems(secrets: unknown, outbound: unknown, channelKeys?: readonly string[]): string[];
62
+ /** 秘密値の宣言のキー(形の壊れた要素は除く) */
63
+ export declare const appSecretKeysOf: (secrets: unknown) => string[];
@@ -1,13 +1,16 @@
1
1
  import type { Collection, CollectionSchema } from '../../schema/src/index.js';
2
- import type { AppRoute, AppRouteMethod } from './app.js';
2
+ import type { ApiRoute, ListSpec } from './api/define.js';
3
+ import type { AppContext, AppRoute, AppRouteMethod } from './app.js';
4
+ import type { AppNotice, NOTICES_PORT } from './notices.js';
3
5
  import type { ERROR_STATUS, ErrorParams, IssueInput } from './errors.js';
4
6
  import type { AppDefinition, AppSetupContext } from './appDefinition.js';
5
7
  import type { ConsentState } from './consents.js';
6
8
  import type { EndUserStatus } from './endUsers.js';
7
9
  import type { AppChannel, AppChannelsPort } from './appChannels.js';
8
- import type { AppHmacCheck } from './appSecrets.js';
9
- import type { AppInboundRequest } from './appInbound.js';
10
+ import type { AppHmacCheck, AppOperatorSecrets } from './appSecrets.js';
11
+ import type { AppDispatched, AppDispatchRequest, AppInboundOutcome, AppInboundRequest } from './appInbound.js';
10
12
  import type { AppInboundMail, AppMailPort } from './appMail.js';
13
+ import type { PAYMENT_PORT, PaymentCheckout, PaymentCheckoutRequest, PaymentPortalRequest, PurchaseReflection, ReflectionResult, SubscriptionReflection } from './paymentPort.js';
11
14
  import type { MESSAGE_PORT, MESSAGE_RECEIVED, MessageProviderResult, MessageReceived, MessageReceivedInput, MessageSendRequest, MessageSendResult } from './messagePort.js';
12
15
  declare const APP_SCOPE: unique symbol;
13
16
  /** 呼び出しのプロジェクトの文脈(中身はコアだけが読む) */
@@ -48,10 +51,12 @@ export type AppJob = Readonly<{
48
51
  frequent?: boolean;
49
52
  }>;
50
53
  /** 保存前の検査の引数(values は検査済みの入力にフィールドの宣言と前のアプリの補正を適用した値、id は作成なら null) */
54
+ /** 保存前の検査の引数(live は保存するコレクションのゴミ箱の外のレコードの数で、件数の記録から読む) */
51
55
  export type SaveCheckContext = Readonly<{
52
56
  scope: AppScope;
53
57
  values: Readonly<Record<string, unknown>>;
54
58
  id: string | null;
59
+ live: () => Promise<number>;
55
60
  }>;
56
61
  /** 保存前の検査の結果(values は補正した値、problems は拒否の理由) */
57
62
  export type SaveCheckResult = Readonly<{
@@ -59,7 +64,7 @@ export type SaveCheckResult = Readonly<{
59
64
  }> | Readonly<{
60
65
  problems: readonly Problem[];
61
66
  }>;
62
- /** コレクションの保存前の検査(collection はコレクションの id) */
67
+ /** コレクションの保存前の検査(collection はマニフェストのコレクションの名前) */
63
68
  export type SaveCheck = Readonly<{
64
69
  collection: string;
65
70
  check: (ctx: SaveCheckContext) => Promise<SaveCheckResult> | SaveCheckResult;
@@ -85,10 +90,16 @@ export declare const appDeliveryPathOf: (namespace: string, path: `/${string}`)
85
90
  export declare const APP_INBOUND_SEGMENT = "/inbound";
86
91
  /** アプリの公開の API の経路が予約の区間の下か */
87
92
  export declare const isReservedAppDeliveryPath: (path: string) => boolean;
88
- /** 公開の API の経路(path はアプリの名前空間 /v1/apps/<名前空間> からの経路、ログインなし。鍵の判定はすべてのコレクションの read) */
93
+ /**
94
+ * 公開の API の経路(path はアプリの名前空間 /v1/apps/<名前空間> からの経路、ログインなし。鍵の判定はすべてのコレクションの read)
95
+ * - summary・response・list はマスタの経路の宣言と同じ意味
96
+ */
89
97
  export type AppDeliveryRoute = Readonly<{
90
98
  method: AppRouteMethod;
91
99
  path: `/${string}`;
100
+ summary: string;
101
+ response: ApiRoute['response'];
102
+ list?: ListSpec;
92
103
  handle: (request: Request, ctx: AppDeliveryContext) => Promise<Response>;
93
104
  }>;
94
105
  /** 集計の作り直しの広さ(recent は直近の期間、full は元のデータが残る全体) */
@@ -129,9 +140,14 @@ export type AppServerParts = Readonly<{
129
140
  /** 提供するポートの処理(マニフェストの provides で route を持たないポート) */
130
141
  provides?: Readonly<{
131
142
  [MESSAGE_PORT]?: AppMessageProvider;
143
+ [PAYMENT_PORT]?: AppPaymentProvider;
144
+ [NOTICES_PORT]?: AppNoticesProvider;
132
145
  }>;
133
- /** 外のサービスから受ける経路の処理(キーはマニフェストの inbound の name。主体はインストール済みアプリ自身、例外は送り手の再送) */
134
- inbound?: Readonly<Record<string, (scope: AppScope, request: AppInboundRequest) => Promise<void>>>;
146
+ /**
147
+ * 外のサービスから受ける経路の処理(キーはマニフェストの inbound の name。主体はインストール済みアプリ自身)
148
+ * 例外は送り手の再送、直らない拒否は AppInboundOutcome の refused
149
+ */
150
+ inbound?: Readonly<Record<string, (scope: AppScope, request: AppInboundRequest) => Promise<AppInboundOutcome | void>>>;
135
151
  /** 受けたメールの処理(マニフェストで mail.inbound を宣言したアプリだけ。mail.channelId は受けたチャネル。主体はインストール済みアプリ自身、例外は送り手の再送) */
136
152
  inboundMail?: (scope: AppScope, mail: AppInboundMail) => Promise<void>;
137
153
  /** 受けるポートのイベント(マニフェストの uses で宣言したポートのもの) */
@@ -141,6 +157,8 @@ export type AppServerParts = Readonly<{
141
157
  /** マニフェストのコレクションのレコードの作成、保存、削除、復元の確定の後に知るフック(AppSavedContext。失敗は送り直すので、何度呼ばれても同じ結果にする) */
142
158
  afterSave?: (ctx: AppSavedContext) => Promise<void>;
143
159
  }>;
160
+ /** 通知のポートの提供者(見ている人の文脈で呼ばれ、params は空。失敗と遅さは、ほかの提供者に及ぼさず欠けたことになる) */
161
+ export type AppNoticesProvider = (ctx: AppContext) => Promise<readonly AppNotice[]>;
144
162
  /**
145
163
  * 確定の後のフックの引数
146
164
  * - collection: マニフェストのコレクションの名前(records が受ける名前)。宣言のコレクション(作ったものと当てたもの)の保存だけが届く
@@ -161,6 +179,29 @@ export type AppSavedContext = Readonly<{
161
179
  export type AppMessageProvider = Readonly<{
162
180
  send: (scope: AppScope, request: MessageSendRequest, channel: AppChannel | null) => Promise<MessageProviderResult>;
163
181
  }>;
182
+ /**
183
+ * 決済のポートのプロバイダーの処理(コアがオファー、価格、購入者を確かめた後に呼ぶ)
184
+ * - checkout: 支払いの画面の URL を作る。外部の価格は request.price.lookupKey で対応づけ、なければ作る
185
+ * - portal: 購入者の顧客の支払いの画面(解約、支払い方法、領収書)の URL を作る
186
+ * - channel: 依頼の決済のチャネル(依頼の channelId のチャネルか、プロバイダーの決済の種類の既定のチャネル)
187
+ * - 外部のサービスの一時的な失敗は例外
188
+ */
189
+ export type AppPaymentProvider = Readonly<{
190
+ checkout: (scope: AppScope, request: PaymentCheckoutRequest, channel: AppChannel) => Promise<PaymentCheckout>;
191
+ portal: (scope: AppScope, request: PaymentPortalRequest, channel: AppChannel) => Promise<Readonly<{
192
+ url: string;
193
+ }>>;
194
+ }>;
195
+ /**
196
+ * 決済の結果の反映の口(決済のポートのプロバイダーだけ。paymentPort.ts)
197
+ * - 主体はインストール済みアプリ自身で、許可はマニフェストの能力 `@end_users` の `write_entitlements`
198
+ * - channelId はこのインストールに結んだ、決済の能力のあるチャネルだけ(ほかは app_channel_undeclared)
199
+ * - 拒否は AppPortError
200
+ */
201
+ export type AppPaymentsPort = Readonly<{
202
+ reflectPurchase: (scope: AppScope, reflection: PurchaseReflection) => Promise<AppPortResult<ReflectionResult>>;
203
+ reflectSubscription: (scope: AppScope, reflection: SubscriptionReflection) => Promise<AppPortResult<ReflectionResult>>;
204
+ }>;
164
205
  /** アプリ用の状態の置き場の上限(キーの字数、値の JSON の UTF-8 のバイト数、インストールごとのキーの数) */
165
206
  export declare const APP_STATE_LIMITS: {
166
207
  readonly keyMaxChars: 200;
@@ -181,6 +222,7 @@ export type AppHoldTarget = Readonly<{
181
222
  /**
182
223
  * アプリ用の状態の置き場(インストール済みアプリごとのキーと値。個人情報を入れない、業務のデータは宣言のコレクションに置く)
183
224
  * - 値は JSON にできる値。get はないキーで null
225
+ * - getMany は複数のキーの値を1回で読む(ないキーは null。キーの数は keysMax まで、超えると invalid_input で target は keys)
184
226
  * - 空か長いキーと大きい値は invalid_input(target は key か value)
185
227
  * - キーの数の上限は invalid_state(reason は app_state_keys_full)
186
228
  * - hold と release はレコードの占有。経路を呼んだ人の操作として、その人が更新できるレコードだけを占有する
@@ -188,6 +230,7 @@ export type AppHoldTarget = Readonly<{
188
230
  */
189
231
  export type AppStatePort = Readonly<{
190
232
  get: (scope: AppScope, key: string) => Promise<AppPortResult<unknown>>;
233
+ getMany: (scope: AppScope, keys: readonly string[]) => Promise<AppPortResult<Readonly<Record<string, unknown>>>>;
191
234
  set: (scope: AppScope, key: string, value: unknown) => Promise<AppPortResult<void>>;
192
235
  delete: (scope: AppScope, key: string) => Promise<AppPortResult<void>>;
193
236
  hold: (scope: AppScope, target: AppHoldTarget) => Promise<AppPortResult<Readonly<{
@@ -484,6 +527,8 @@ export type AppServerContext<S> = AppSetupContext<S> & Readonly<{
484
527
  records: AppRecordsPort;
485
528
  files: AppFilesPort;
486
529
  endUsers: AppEndUsersPort;
530
+ /** 決済の結果の反映(AppPaymentsPort) */
531
+ payments: AppPaymentsPort;
487
532
  events: AppEventsPort;
488
533
  collections: (scope: AppScope, name: string) => Promise<AppCollectionTarget | null>;
489
534
  resolveSlugs: (scope: AppScope, collection: string, slugs: readonly string[]) => Promise<ResolvedSlugs | null>;
@@ -497,5 +542,10 @@ export type AppServerContext<S> = AppSetupContext<S> & Readonly<{
497
542
  export type AppServer<S = unknown> = Readonly<{
498
543
  app: AppDefinition<S>;
499
544
  create(ctx: AppServerContext<S>): AppServerParts;
545
+ /**
546
+ * アプリの単位の受信の振り分け(キーは dispatch: 'app' の inbound の name。同梱のアプリだけ)
547
+ * プロジェクトの文脈の外で呼ぶので create の外に置く。署名の検証は operator の秘密値で行う
548
+ */
549
+ inboundDispatch?: Readonly<Record<string, (request: AppDispatchRequest, operator: AppOperatorSecrets) => Promise<AppDispatched>>>;
500
550
  }>;
501
551
  export {};
@@ -78,8 +78,10 @@ export type AppUiRequires = 'admin' | Readonly<{
78
78
  * - field: `record.field` の項目の key
79
79
  * - label: ワークスペースの見出し(一覧の列の見出しなど、なしはマニフェストの label)。APP_UI_LABEL_MAX 文字まで
80
80
  * key が要る(表示の文字列の塊の項目は `<slot>:<key>`)
81
- * - page だけ: requires は表示に要る権限、badge はメニューの件数を返すアプリの経路(GET で `{ count }`、要求者の権限で判定)、
82
- * menu が false はメニューに出さない経路だけの画面、rail は ID つきの経路でメニューを縮める編集の画面
81
+ * - page だけ: requires は表示に要る権限、badge はメニューの件数(route はアプリの経路で GET で `{ count }`、要求者の権限で判定、
82
+ * unhandled は宣言 form の対応済みでない送信の数を、本体がレコードの件数の経路で数える)、
83
+ * menu が false はメニューに出さない経路だけの画面、rail は ID つきの経路で上の帯を出さない編集の画面(自分の見出しの帯を持つ)、
84
+ * detail は ID つきの経路が詳細の画面(左の列を折り畳む。rail は常に詳細の画面)
83
85
  * - settings だけ: area はページを開ける設定の領域
84
86
  */
85
87
  export type AppUi = Readonly<{
@@ -91,13 +93,18 @@ export type AppUi = Readonly<{
91
93
  label?: string;
92
94
  icon?: AppUiIcon;
93
95
  requires?: AppUiRequires;
94
- badge?: Readonly<{
95
- route: `/api/${string}`;
96
- }>;
96
+ badge?: AppUiBadge;
97
97
  menu?: boolean;
98
98
  rail?: boolean;
99
+ detail?: boolean;
99
100
  area?: SettingsArea;
100
101
  }>;
102
+ /** メニューの件数の出所 */
103
+ export type AppUiBadge = Readonly<{
104
+ route: `/api/${string}`;
105
+ }> | Readonly<{
106
+ unhandled: 'form';
107
+ }>;
101
108
  /** 権限の対象(id は役割の表の識別子) */
102
109
  export type PermissionTarget = Readonly<{
103
110
  id: string;
@@ -129,6 +136,7 @@ export declare const appToolPrefixOf: (namespace: string) => string;
129
136
  * - destinations: Tunasand からアプリへの送信の宛先のオリジン(https)
130
137
  * - outbound: アプリのサーバーの側からの外への要求の宣言(outbound.ts)
131
138
  * - secrets: 管理者が入力する秘密値の宣言(appSecrets.ts)。outbound の auth はここで宣言したキーだけを指す
139
+ * - operator_secrets: 運営の秘密値の宣言(同梱のアプリだけが使える。appSecrets.ts の AppOperatorSecrets)。outbound の auth も指せる
132
140
  * - events: 受ける Webhook のイベントの名前
133
141
  * - mail: メールの送信と受信(appMail.ts。能力の要素は mail:send と mail:inbound)
134
142
  * - channel_kinds: アプリが定義するチャネルの種類(能力、アドレスの形、チャネルごとの設定と秘密値、外のサービスから受ける経路、
@@ -162,6 +170,7 @@ export type AppManifest = Readonly<{
162
170
  destinations?: readonly string[];
163
171
  outbound?: readonly AppOutbound[];
164
172
  secrets?: readonly AppSecretDeclaration[];
173
+ operator_secrets?: readonly AppSecretDeclaration[];
165
174
  events?: readonly string[];
166
175
  mail?: AppMailDeclaration;
167
176
  channel_kinds?: readonly AppChannelKind[];
@@ -256,7 +265,7 @@ export declare const APP_SETTINGS_TARGETS: readonly [string, string, string];
256
265
  export declare function appManifestProblems(input: unknown, namespace: string | null): AppManifestProblem[];
257
266
  export declare const APP_MANIFEST_VERSION = 1;
258
267
  /** マニフェストの項目(登録はこれ以外の項目を拒否する) */
259
- export declare const APP_MANIFEST_KEYS: readonly ["manifest_version", "label", "kind", "description", "targets", "audit_actions", "messages", "problems", "en", "permissions", "connections", "emits", "capabilities", "destinations", "outbound", "secrets", "channel_kinds", "events", "mail", "ui", "tools", "own_site", "hosting", "deletion_url", "major", "requires", "uses", "provides", "collections", "settings", "price"];
268
+ export declare const APP_MANIFEST_KEYS: readonly ["manifest_version", "label", "kind", "description", "targets", "audit_actions", "messages", "problems", "en", "permissions", "connections", "emits", "capabilities", "destinations", "outbound", "secrets", "operator_secrets", "channel_kinds", "events", "mail", "ui", "tools", "own_site", "hosting", "deletion_url", "major", "requires", "uses", "provides", "collections", "settings", "price"];
260
269
  /**
261
270
  * 登録するバージョンのマニフェストの検査(appManifestProblems に、登録のときだけの決まりを足す)
262
271
  * - 個人の情報の能力を求めるのに削除のエンドポイントがなければ deletion_url の required(登録済みのバージョンは読むときに拒まない)
@@ -1,7 +1,7 @@
1
- export declare const AUDIT_ACTION_CODES: readonly ["record.create", "record.update", "record.patch", "record.delete", "record.deleteLinked", "record.submit", "record.reject", "record.publish", "record.unpublish", "record.setVisibility", "record.publishScheduled", "record.discardSchedule", "record.discardDraft", "record.setSources", "record.setRefs", "source.create", "source.update", "source.delete", "record.changeStatus", "record.hold", "record.releaseHold", "record.read", "record.clearHolds", "form.submit", "endUserRecord.create", "endUserRecord.update", "endUserRecord.delete", "master.create", "master.update", "master.delete", "singleton.update", "integration.create", "integration.update", "integration.delete", "integration.rotateSecret", "integration.revokePreviousSecret", "account.changeLogin", "account.changePortrait", "account.removePortrait", "account.changeRole", "account.updateProfile", "account.linkRecord", "accountLink.update", "request.create", "request.approve", "request.reject", "role.create", "role.update", "role.delete", "invitation.create", "invitation.cancel", "member.ownerJoined", "member.ownerAdded", "member.ownerChanged", "member.ownerRemoved", "supportAccess.grant", "supportAccess.enter", "supportAccess.revoke", "project.create", "project.revokeAccess", "project.rename", "general.update", "project.changeSlug", "environment.create", "environment.copy", "environment.copyRetainStarted", "environment.delete", "environment.promote", "environment.promoteSchema", "environment.freeze", "environment.unfreeze", "mcpConnection.approve", "mcpConnection.remove", "mcpConnection.removeAll", "mcpConnection.drop", "mcpConnection.revokeAll", "mcpConnection.prune", "mcpConnection.adopt", "mcpRequest.create", "mcpRequest.open", "mcpRequest.deny", "mcpCode.use", "mcpToken.issue", "mcpToken.refresh", "mcpGrace.use", "mcpGrant.touch", "mcpClient.register", "secrets.reseal", "mcpInternalFields.update", "schema.update", "screens.update", "view.create", "view.update", "view.delete", "view.import", "collection.delete", "file.upload", "file.import", "file.edit", "file.delete", "file.deleteMany", "file.restoreMany", "file.publishMany", "file.publishReferenced", "file.unpublishMany", "trash.restore", "trash.restoreCollection", "trash.restoreBundle", "trash.pruneBundles", "trash.pruneRecords", "job.run", "standardApp.update", "appState.set", "appState.delete", "standardApp.install", "standardApp.mapCollections", "standardApp.revertInstall", "content.import", "transferPlan.update", "preview.rotateSecret", "preview.revokePreviousSecret", "mediaSigning.create", "apiKey.create", "apiKey.update", "apiKey.revoke", "apiKey.rotate", "apiKey.delete", "readToken.issue", "readToken.revoke", "mailDomain.add", "mailDomain.check", "mailDomain.remove", "app.register", "app.publish", "app.updateKeys", "app.install", "app.consent", "app.updateVersion", "app.setAutoUpdate", "app.changeState", "app.uninstall", "app.deleteData", "app.emitEvent", "files.alignMarkers", "app.setSecret", "app.deleteSecret", "channel.create", "channel.update", "channel.remove", "channel.setSecret", "channel.deleteSecret", "channel.pruneSecrets", "site.deployStart", "site.deployResult", "deployment.place", "deployment.activate", "end_user.create", "end_user.changeStatus", "end_user.delete", "end_user.erase", "end_user.link", "end_user.linkByInvite", "end_user.ensure", "end_user.purgeInvites", "inbox.markRead", "standardApp.provision", "readToken.prune", "webhook.recordDeliveries", "webhook.queueDeliveries", "webhook.claimRetries", "webhook.pruneDeliveries", "import.createOriginKey", "domain.request", "domain.verify", "domain.remove", "domain.set_slug", "approval.request", "approval.cancel", "approval.approve", "approval.reject", "approval.settle", "app.planInstall", "import.pruneOriginals", "import.saveOriginals", "import.recordRun", "end_user.confirmLink", "end_user.unlink", "entitlement.create", "entitlement.change", "entitlement.end", "end_user.import", "end_user.importOne", "end_user.invite", "end_user.updateSettings", "end_user.recordConsent", "end_user.recordBlock", "suppression.add", "operator.restore", "operator.import", "operator.prune", "operator.emergency", "operator.trialSession", "operator.deleteTrial", "operator.deleteProject", "operator.trialHostname", "operator.importApiKeys", "operator.copyMembers", "operator.createApiKey", "operator.resealSecrets", "operator.registerApp", "operator.publishApp", "operator.setAppKeys", "operator.setStandardApp", "operator.removeStandardApp"];
1
+ export declare const AUDIT_ACTION_CODES: readonly ["record.create", "record.update", "record.patch", "record.delete", "record.deleteLinked", "record.submit", "record.reject", "record.publish", "record.unpublish", "record.setVisibility", "record.publishScheduled", "record.discardSchedule", "record.discardDraft", "record.setSources", "record.setRefs", "source.create", "source.update", "source.delete", "record.changeStatus", "record.hold", "record.releaseHold", "record.read", "record.clearHolds", "form.submit", "endUserRecord.create", "endUserRecord.update", "endUserRecord.delete", "master.create", "master.update", "master.delete", "singleton.update", "integration.create", "integration.update", "integration.delete", "integration.rotateSecret", "integration.revokePreviousSecret", "account.changeLogin", "account.changePortrait", "account.removePortrait", "account.changeRole", "account.updateProfile", "account.linkRecord", "accountLink.update", "request.create", "request.approve", "request.reject", "role.create", "role.update", "role.delete", "invitation.create", "invitation.cancel", "member.ownerJoined", "member.ownerAdded", "member.ownerChanged", "member.ownerRemoved", "supportAccess.grant", "supportAccess.enter", "supportAccess.revoke", "project.create", "project.revokeAccess", "project.rename", "general.update", "project.changeSlug", "environment.create", "environment.copy", "environment.copyRetainStarted", "environment.delete", "environment.promote", "environment.promoteSchema", "environment.freeze", "environment.unfreeze", "mcpConnection.approve", "mcpConnection.remove", "mcpConnection.removeAll", "mcpConnection.drop", "mcpConnection.revokeAll", "mcpConnection.prune", "mcpConnection.adopt", "mcpRequest.create", "mcpRequest.open", "mcpRequest.deny", "mcpCode.use", "mcpToken.issue", "mcpToken.refresh", "mcpGrace.use", "mcpGrant.touch", "mcpClient.register", "secrets.reseal", "mcpInternalFields.update", "schema.update", "screens.update", "view.create", "view.update", "view.delete", "view.import", "collection.delete", "file.upload", "file.import", "file.edit", "file.delete", "file.deleteMany", "file.restoreMany", "file.publishMany", "file.publishReferenced", "file.unpublishMany", "trash.restore", "trash.restoreCollection", "trash.restoreBundle", "trash.pruneBundles", "trash.pruneRecords", "job.run", "standardApp.update", "appState.set", "appState.delete", "standardApp.install", "standardApp.mapCollections", "standardApp.revertInstall", "content.import", "transferPlan.update", "preview.rotateSecret", "preview.revokePreviousSecret", "mediaSigning.create", "apiKey.create", "apiKey.update", "apiKey.revoke", "apiKey.rotate", "apiKey.delete", "readToken.issue", "readToken.revoke", "mailDomain.add", "mailDomain.check", "mailDomain.remove", "app.register", "app.publish", "app.updateKeys", "app.install", "app.consent", "app.updateVersion", "app.setAutoUpdate", "app.changeState", "app.uninstall", "app.deleteData", "app.emitEvent", "files.alignMarkers", "app.setSecret", "app.deleteSecret", "channel.create", "channel.update", "channel.remove", "channel.setSecret", "channel.deleteSecret", "channel.pruneSecrets", "site.deployStart", "site.deployResult", "deployment.place", "deployment.activate", "end_user.create", "end_user.changeStatus", "end_user.delete", "end_user.erase", "end_user.link", "end_user.linkByInvite", "end_user.ensure", "end_user.purgeInvites", "inbox.markRead", "standardApp.provision", "readToken.prune", "webhook.recordDeliveries", "webhook.queueDeliveries", "webhook.claimRetries", "webhook.pruneDeliveries", "import.createOriginKey", "domain.request", "domain.verify", "domain.remove", "domain.set_slug", "approval.request", "approval.cancel", "approval.approve", "approval.reject", "approval.settle", "app.planInstall", "import.pruneOriginals", "payment.pruneEvents", "import.saveOriginals", "import.recordRun", "end_user.confirmLink", "end_user.unlink", "entitlement.create", "entitlement.change", "entitlement.end", "offer.create", "offer.update", "offer.archive", "price.create", "price.archive", "purchase.reflect", "subscription.reflect", "end_user.import", "end_user.importOne", "end_user.invite", "end_user.updateSettings", "end_user.recordConsent", "end_user.recordBlock", "suppression.add", "operator.restore", "operator.import", "operator.prune", "operator.emergency", "operator.trialSession", "operator.deleteTrial", "operator.deleteProject", "operator.trialHostname", "operator.importApiKeys", "operator.copyMembers", "operator.createApiKey", "operator.setChannelKey", "operator.resealSecrets", "operator.registerApp", "operator.publishApp", "operator.setAppKeys", "operator.setStandardApp", "operator.removeStandardApp"];
2
2
  export type AuditActionCode = (typeof AUDIT_ACTION_CODES)[number];
3
3
  /** 旧い文の接尾辞で移さない対象の種類(コレクションの id でない対象。連携の登録は表で移す) */
4
- export declare const NON_COLLECTION_TARGETS: readonly ["request", "role", "account", "invitation", "support_access", "project", "environment", "mcp_connection", "schema", "screens", "record", "file", "singleton", "job", "standard_app", "trash", "calendar", "settings", "preview", "media_signing", "api_key", "read_token", "mail_domain", "app", "installation", "end_user", "end_user_identity", "entitlement", "end_user_import", "suppression", "webhook", "external_function", "external_screen", "contact", "art-guide"];
4
+ export declare const NON_COLLECTION_TARGETS: readonly ["request", "role", "account", "invitation", "support_access", "project", "environment", "mcp_connection", "schema", "screens", "record", "file", "singleton", "job", "standard_app", "trash", "calendar", "settings", "preview", "media_signing", "api_key", "read_token", "mail_domain", "app", "installation", "end_user", "end_user_identity", "entitlement", "offer", "price", "purchase", "subscription", "end_user_import", "suppression", "webhook", "external_function", "external_screen", "contact", "art-guide"];
5
5
  /** 操作の履歴の行の、操作と対象の部分 */
6
6
  export type AuditActionRow = Readonly<{
7
7
  action: string;
@@ -117,7 +117,7 @@ export declare const AUDIT_ACTION_MESSAGES: {
117
117
  readonly 'appState.set': "アプリ用の状態を保存";
118
118
  readonly 'appState.delete': "アプリ用の状態を削除";
119
119
  readonly 'standardApp.install': "標準の機能をインストール";
120
- readonly 'standardApp.mapCollections': "標準の機能のコレクションの当て先を選択";
120
+ readonly 'standardApp.mapCollections': "標準の機能のコレクションを選択";
121
121
  readonly 'standardApp.revertInstall': "標準の機能のインストールを取り消し";
122
122
  readonly 'content.import': "コンテンツを一括でインポート";
123
123
  readonly 'transferPlan.update': "移行の計画を更新";
@@ -183,6 +183,7 @@ export declare const AUDIT_ACTION_MESSAGES: {
183
183
  readonly 'approval.settle': "承認した申請の実行の結果を記録";
184
184
  readonly 'app.planInstall': "アプリのインストールの計画を保存";
185
185
  readonly 'import.pruneOriginals': "期間を過ぎた取り込みの元の HTML を削除";
186
+ readonly 'payment.pruneEvents': "期間を過ぎた反映した決済のイベントを削除";
186
187
  readonly 'import.saveOriginals': "取り込みの元の HTML を保存";
187
188
  readonly 'import.recordRun': "取り込みの実行の完了を記録";
188
189
  readonly 'end_user.confirmLink': "エンドユーザーの紐付けを確認して有効に";
@@ -190,6 +191,13 @@ export declare const AUDIT_ACTION_MESSAGES: {
190
191
  readonly 'entitlement.create': "エンドユーザーの権利を付与";
191
192
  readonly 'entitlement.change': "エンドユーザーの権利の期間を変更";
192
193
  readonly 'entitlement.end': "エンドユーザーの権利を終了";
194
+ readonly 'offer.create': "オファーを作成";
195
+ readonly 'offer.update': "オファーを変更";
196
+ readonly 'offer.archive': "オファーを停止";
197
+ readonly 'price.create': "価格を作成";
198
+ readonly 'price.archive': "価格を停止";
199
+ readonly 'purchase.reflect': "決済の購入を反映";
200
+ readonly 'subscription.reflect': "決済の購読を反映";
193
201
  readonly 'end_user.import': "エンドユーザーをインポート";
194
202
  readonly 'end_user.importOne': "エンドユーザーを1人インポート";
195
203
  readonly 'end_user.invite': "エンドユーザーの招待を発行";
@@ -208,6 +216,7 @@ export declare const AUDIT_ACTION_MESSAGES: {
208
216
  readonly 'operator.importApiKeys': "運営者が環境の API キーをプロジェクトへコピーした";
209
217
  readonly 'operator.copyMembers': "運営者が別のプロジェクトのメンバーとロールをコピーした";
210
218
  readonly 'operator.createApiKey': "運営者が配信用の API キーを作成した";
219
+ readonly 'operator.setChannelKey': "運営者がチャネルの外部のアカウントのキーを設定した";
211
220
  readonly 'operator.resealSecrets': "運営者が改名の前の形の秘密の値を封印し直した";
212
221
  readonly 'operator.registerApp': "運営者がアプリを登録した";
213
222
  readonly 'operator.publishApp': "運営者がアプリの新しいバージョンを公開した";
@@ -2,7 +2,7 @@ import { type Collection } from '../../schema/src/index.js';
2
2
  import type { Action, Permissions } from './permissions.js';
3
3
  import { type ActingKind, type Capabilities, type PrincipalContext, type Subject } from './principal.js';
4
4
  /** 判定の操作(コレクションの操作とエンドユーザーの操作) */
5
- export declare const OPERATIONS: readonly ["read", "read_drafts", "read_entitled", "create", "update", "publish", "delete", "submit", "verify", "read_state", "link", "ensure", "issue_token", "refresh_token", "migrate_links", "read_identities", "write_entitlements", "update_status", "read_display_name", "read_consents", "check_consent", "write_consents", "write_suppression", "read_self", "create_self", "update_self", "delete_self"];
5
+ export declare const OPERATIONS: readonly ["read", "read_drafts", "read_entitled", "create", "update", "publish", "delete", "submit", "verify", "read_state", "link", "ensure", "issue_token", "refresh_token", "migrate_links", "read_identities", "write_entitlements", "update_status", "read_display_name", "read_consents", "check_consent", "write_consents", "write_suppression", "purchase", "read_self", "create_self", "update_self", "delete_self"];
6
6
  /** 判定の操作 */
7
7
  export type Operation = (typeof OPERATIONS)[number];
8
8
  /**
@@ -59,7 +59,7 @@ export declare const BRIDGE_TEXT_MAX = 200;
59
59
  /** 深いリンクのパスの長さの上限 */
60
60
  export declare const EMBED_PATH_MAX = 512;
61
61
  /** API の依頼(サーバーのないアプリ)のメソッド */
62
- export declare const BRIDGE_API_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE"];
62
+ export declare const BRIDGE_API_METHODS: readonly ["GET", "POST", "PATCH", "DELETE"];
63
63
  /** API の依頼のメソッド */
64
64
  export type BridgeApiMethod = (typeof BRIDGE_API_METHODS)[number];
65
65
  /**
@@ -67,12 +67,7 @@ export type EndUserApiConsent = Readonly<{
67
67
  }>;
68
68
  /** 同意の記録をエンドユーザーの API の形に */
69
69
  export declare const consentWire: (r: ConsentRecord) => EndUserApiConsent;
70
- /** エンドユーザーの API の同意の一覧(POST /end-users/consents:query) */
71
- export type EndUserApiConsents = Readonly<{
72
- consents: readonly EndUserApiConsent[];
73
- blocked: readonly ConsentChannel[];
74
- }>;
75
- /** エンドユーザーの API の同意の記録の結果(POST /end-users/consents、replayed は重複を除くキーの再送で記録しなかった) */
70
+ /** 同意の記録の結果(replayed は重複を除くキーの再送で記録しなかった) */
76
71
  export type EndUserApiConsentResult = Readonly<{
77
72
  consent: EndUserApiConsent;
78
73
  replayed: boolean;
@@ -31,7 +31,7 @@ export declare const TOKEN_EXCHANGE: {
31
31
  readonly subjectTokenType: "urn:ietf:params:oauth:token-type:jwt";
32
32
  readonly issuedTokenType: "urn:ietf:params:oauth:token-type:access_token";
33
33
  readonly clientAssertionType: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
34
- readonly path: "/api/embeds/token";
34
+ readonly path: "/v1/embeds/token";
35
35
  };
36
36
  /** トークンの交換の成功の応答(RFC 8693の形、expires_in は秒) */
37
37
  export type TokenExchangeResponse = Readonly<{
@@ -92,14 +92,16 @@ export declare const isPagePlacement: (p: EmbedPlacement) => boolean;
92
92
  export type EmbedContextResponse = Readonly<{
93
93
  src: string;
94
94
  }>;
95
+ /** 外の画面の一覧の置き場所(/api/embeds の filter[slot]。frame はワークスペースの HTML の CSP の frame-src に足す送り元) */
96
+ export declare const EMBED_LIST_SLOTS: readonly ["panel", "action", "field", "column", "page", "settings", "frame"];
97
+ export type EmbedListSlot = (typeof EMBED_LIST_SLOTS)[number];
95
98
  /**
96
- * ワークスペースの HTML の CSP の frame-src に足す送り元
97
- * - preview: プロジェクトのプレビューのオリジン(なしはワークスペースの /preview)
98
- * - frames: 登録した外の画面と本文の埋め込みのオリジン
99
+ * ワークスペースの HTML の CSP の frame-src に足す送り元の1件(id はオリジン)
100
+ * - preview: プロジェクトのプレビューのオリジン(なしはワークスペースの /preview)。ほかは登録した外の画面と本文の埋め込みのオリジン
99
101
  */
100
- export type AdminFrameSources = Readonly<{
101
- preview: string | null;
102
- frames: readonly string[];
102
+ export type AdminFrameSource = Readonly<{
103
+ id: string;
104
+ preview: boolean;
103
105
  }>;
104
- /** ワークスペースの HTML の CSP の送り元の取得の経路(ログインしたアカウント、ワークスペースの Worker が HTML の応答に CSP を付けるときに呼ぶ) */
105
- export declare const ADMIN_FRAME_SOURCES_PATH = "/api/embeds/frame-sources";
106
+ /** ワークスペースの HTML の CSP の送り元の取得の経路(ログインしたアカウント、ワークスペースの Worker が HTML の応答に CSP を付けるときに呼ぶ。1ページで全件) */
107
+ export declare const ADMIN_FRAME_SOURCES_PATH = "/api/embeds?filter[slot]=frame&limit=100";
@@ -214,6 +214,9 @@ export type EndUserListItem = Readonly<{
214
214
  version: number;
215
215
  createdAt: string;
216
216
  identities: readonly EndUserIdentityView[];
217
+ _meta?: Readonly<{
218
+ deleted_at: string;
219
+ }>;
217
220
  }>;
218
221
  /** ワークスペースのエンドユーザーの権利(installationId は出どころがインストールのときだけ) */
219
222
  export type EndUserEntitlementView = Readonly<{
@@ -28,6 +28,8 @@ export declare const ERROR_MESSAGES: {
28
28
  readonly end_user: "エンドユーザー";
29
29
  readonly end_user_identity: "エンドユーザーの結び付け";
30
30
  readonly entitlement: "エンドユーザーの権利";
31
+ readonly offer: "オファー";
32
+ readonly price: "価格";
31
33
  readonly app: "アプリ";
32
34
  readonly installation: "インストール";
33
35
  readonly invitation: "招待";
@@ -90,7 +92,7 @@ export declare const ERROR_MESSAGES: {
90
92
  readonly still_published: "公開中のレコードは、非公開にしてから削除してください。";
91
93
  readonly last_admin: "最後の管理者は、外すことも管理者のロールから降ろすこともできません。先にほかの人を管理者にしてください。";
92
94
  readonly exceeds_own: "自分のロールより広い権限は付けられません。広い権限が要るときは、管理者に依頼してください。";
93
- readonly reauth_required: "承認の前に、もう一度ログインしてください。";
95
+ readonly reauth_required: "この操作の前に、もう一度ログインしてください。";
94
96
  readonly approval_required: "本番に届く変更のため、申請と承認が必要です。申請を出し、組織の管理者の承認を待ってください。";
95
97
  readonly stale: "申請の後に内容が変わりました。もう一度申請してください。";
96
98
  readonly approval_closed: "この申請はもう承認できません(反映済み、却下、取り下げ、期限切れのいずれか)。必要なときは、もう一度申請してください。";
@@ -152,6 +154,7 @@ export declare const ERROR_MESSAGES: {
152
154
  readonly no_changes: "本番との差がありません。";
153
155
  readonly schema_values: "値のある項目を消す変更を含むため、反映できません。本番で値を移してからやり直してください。";
154
156
  readonly environment_limit: "環境の数がプランの上限に達しています。不要な環境を削除してから作成してください。";
157
+ readonly collection_size_limit: "件数が上限に達しています。不要なものを削除してから作成してください。";
155
158
  readonly environment_busy: "この環境はほかの操作の途中です。少し待ってからやり直してください。";
156
159
  readonly unregistered_table: "個人の情報の扱いが決まっていない表があるため、コピーできません。運営者に連絡してください。";
157
160
  readonly not_frozen: "本番の書き込みは止まっていません。";
@@ -26,6 +26,8 @@ export declare const ERROR_MESSAGES_EN: {
26
26
  readonly end_user: "end user";
27
27
  readonly end_user_identity: "end user identity";
28
28
  readonly entitlement: "end user entitlement";
29
+ readonly offer: "offer";
30
+ readonly price: "price";
29
31
  readonly app: "app";
30
32
  readonly installation: "installation";
31
33
  readonly invitation: "invitation";
@@ -87,7 +89,7 @@ export declare const ERROR_MESSAGES_EN: {
87
89
  readonly still_published: "Unpublish published records before deleting them.";
88
90
  readonly last_admin: "The last administrator cannot be removed or demoted from the administrator role.";
89
91
  readonly exceeds_own: "You cannot grant permissions wider than your own role.";
90
- readonly reauth_required: "Log in again before approving.";
92
+ readonly reauth_required: "Log in again before this operation.";
91
93
  readonly approval_required: "This change reaches production, so it needs a request and approval.";
92
94
  readonly stale: "The content changed after the request. Request again.";
93
95
  readonly approval_closed: "This request can no longer be approved (applied, rejected, withdrawn or expired).";
@@ -148,6 +150,7 @@ export declare const ERROR_MESSAGES_EN: {
148
150
  readonly no_changes: "There are no differences from live.";
149
151
  readonly schema_values: "Cannot apply because the changes remove fields with values. Move the values in live and try again.";
150
152
  readonly environment_limit: "The number of environments has reached the plan limit.";
153
+ readonly collection_size_limit: "The number of items has reached the limit.";
151
154
  readonly environment_busy: "This environment is in the middle of another operation. Wait a moment and try again.";
152
155
  readonly unregistered_table: "Cannot copy because some tables have no decided handling of personal information.";
153
156
  readonly not_frozen: "Writes to live are not stopped.";
@@ -19,9 +19,9 @@ export declare const ERROR_STATUS: { readonly [K in ServerErrorCode]: (typeof FA
19
19
  * - コレクションの対象: コレクションの id、表示名はスキーマ
20
20
  * - アプリの対象: AppManifest の targets
21
21
  */
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' | 'read_token' | 'mail_domain' | 'channel' | 'channel_address' | 'trash' | 'end_user' | 'end_user_identity' | 'entitlement' | 'app' | 'installation' | 'invitation' | 'environment';
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' | 'read_token' | 'mail_domain' | 'channel' | 'channel_address' | 'trash' | 'end_user' | 'end_user_identity' | 'entitlement' | 'offer' | 'price' | 'app' | 'installation' | 'invitation' | 'environment';
23
23
  /** 状態の不一致の理由(invalid_state) */
24
- export type InvalidStateReason = 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'requester_unauthorized' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publication' | 'no_review' | 'not_published' | 'collection_rows' | 'restore_conflict' | 'restore_target_trashed' | 'collection_exists' | 'collection_missing' | 'not_restorable' | 'installation_state' | 'required_app' | 'app_installed' | 'app_dependencies' | 'app_required_by' | 'app_reinstalled' | 'app_managed' | 'request_key_reused' | 'no_organization' | 'schema_changed' | 'site_deploy' | 'site_check_failed' | 'deployment_stale' | 'deployment_not_ready' | 'deployment_consent' | 'end_user_inactive' | 'self_limit' | 'already_live' | 'target_live' | 'target_synthetic' | 'target_anonymized' | 'no_changes' | 'schema_values' | 'environment_limit' | 'environment_busy' | 'unregistered_table' | 'not_frozen' | 'approval_running' | 'aggregate_read_only' | 'not_aggregate' | 'condition_unmet' | 'app_state_keys_full';
24
+ export type InvalidStateReason = 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'requester_unauthorized' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publication' | 'no_review' | 'not_published' | 'collection_rows' | 'restore_conflict' | 'restore_target_trashed' | 'collection_exists' | 'collection_missing' | 'not_restorable' | 'installation_state' | 'required_app' | 'app_installed' | 'app_dependencies' | 'app_required_by' | 'app_reinstalled' | 'app_managed' | 'request_key_reused' | 'no_organization' | 'schema_changed' | 'site_deploy' | 'site_check_failed' | 'deployment_stale' | 'deployment_not_ready' | 'deployment_consent' | 'end_user_inactive' | 'self_limit' | 'already_live' | 'target_live' | 'target_synthetic' | 'target_anonymized' | 'no_changes' | 'schema_values' | 'environment_limit' | 'collection_size_limit' | 'environment_busy' | 'unregistered_table' | 'not_frozen' | 'approval_running' | 'aggregate_read_only' | 'not_aggregate' | 'condition_unmet' | 'app_state_keys_full';
25
25
  /**
26
26
  * 権限の拒否で足りないもの(403 forbidden の params.required)
27
27
  * - operation: 拒んだ操作(Operation か、プロジェクトの管理の操作 ManagementOperation)
@@ -38,6 +38,4 @@ export type DeliverySummaryRow = Readonly<{
38
38
  }>;
39
39
  export declare const EVENT_TRACE_LIMITS: {
40
40
  readonly periodDaysMax: 30;
41
- readonly tracesMax: 50;
42
- readonly tracesDefault: 20;
43
41
  };
@@ -94,48 +94,60 @@ export type HostingRpc = {
94
94
  [M in Exclude<HostingRpcMethod, keyof TypedMethods>]: (input: unknown) => Promise<unknown>;
95
95
  } & TypedMethods;
96
96
  /**
97
- * 運営者の操作ごとの RPC のメソッドと、入力の欄(どれも空でない文字列)
98
- * method が null の操作はコアのドメインが受ける(tunasand-hosting へは syncHostnames でコピーする)
97
+ * 運営者の操作ごとの RPC のメソッド、経路の操作の名前(verb)、入力の欄(どれも空でない文字列)
98
+ * - 経路: サイトの操作は運営者の API の `/projects/{projectId}/sites/{assignmentId}:<verb>`
99
+ * 知らせの確認は `/hosting/alerts/{id}:<verb>`。残りの欄は本文
100
+ * - method が null の操作はコアのドメインが受ける(tunasand-hosting へは syncHostnames でコピーする)
99
101
  */
100
102
  export declare const HOSTING_OPERATIONS: {
101
103
  readonly stop: {
102
104
  readonly method: "stopSite";
105
+ readonly verb: "stop";
103
106
  readonly fields: readonly ["projectId", "assignmentId", "reason"];
104
107
  };
105
108
  readonly resume: {
106
109
  readonly method: "resumeSite";
110
+ readonly verb: "resume";
107
111
  readonly fields: readonly ["projectId", "assignmentId"];
108
112
  };
109
113
  readonly reattach: {
110
114
  readonly method: "reattachResources";
115
+ readonly verb: "reattach";
111
116
  readonly fields: readonly ["projectId", "assignmentId"];
112
117
  };
113
118
  readonly purge: {
114
119
  readonly method: "purgeSiteResources";
120
+ readonly verb: "purge";
115
121
  readonly fields: readonly ["projectId", "assignmentId"];
116
122
  };
117
123
  readonly hostname_request: {
118
124
  readonly method: null;
125
+ readonly verb: "request-hostname";
119
126
  readonly fields: readonly ["projectId", "assignmentId", "hostname"];
120
127
  };
121
128
  readonly hostname_verify: {
122
129
  readonly method: null;
130
+ readonly verb: "verify-hostname";
123
131
  readonly fields: readonly ["projectId", "assignmentId", "hostname"];
124
132
  };
125
133
  readonly hostname_status: {
126
134
  readonly method: null;
135
+ readonly verb: "check-hostname";
127
136
  readonly fields: readonly ["projectId", "assignmentId", "hostname"];
128
137
  };
129
138
  readonly hostname_remove: {
130
139
  readonly method: null;
140
+ readonly verb: "remove-hostname";
131
141
  readonly fields: readonly ["projectId", "assignmentId", "hostname"];
132
142
  };
133
143
  readonly trial_hostname: {
134
144
  readonly method: null;
145
+ readonly verb: "set-trial-hostname";
135
146
  readonly fields: readonly ["projectId", "assignmentId", "name"];
136
147
  };
137
148
  readonly ack: {
138
149
  readonly method: "acknowledgeAlert";
150
+ readonly verb: "acknowledge";
139
151
  readonly fields: readonly ["id"];
140
152
  };
141
153
  };
@@ -146,4 +158,11 @@ export declare function hostingOperationInput(action: unknown, body: Readonly<Re
146
158
  action: HostingAction;
147
159
  input: Readonly<Record<string, string>>;
148
160
  }> | null;
161
+ /** 運営者の操作の要求(運営者の API の /api を除いたパスと本文。欄の値は呼ぶ側が揃える) */
162
+ export declare function hostingOperationRequest(action: HostingAction, values: Readonly<Record<string, string>>): Readonly<{
163
+ path: string;
164
+ body: Readonly<Record<string, string>>;
165
+ }>;
166
+ /** 運営者の API のパス(/api を除く)の操作(ホスティングの操作の経路でなければ null) */
167
+ export declare function hostingActionOfPath(pathname: string): HostingAction | null;
149
168
  export {};