@tunasand/sdk 0.8.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 (221) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/README.md +165 -144
  3. package/dist/analytics.js +183 -109
  4. package/dist/app.js +276 -166
  5. package/dist/apps-BysPfMuR.js +408 -0
  6. package/dist/astro-image.d.ts +1 -0
  7. package/dist/astro-image.js +33 -0
  8. package/dist/astro-server-Bwau8F6d.js +99 -0
  9. package/dist/astro-server.d.ts +1 -0
  10. package/dist/astro-server.js +1 -0
  11. package/dist/astro.d.ts +1 -0
  12. package/dist/astro.js +306 -0
  13. package/dist/bridge-C2Bl-OAF.js +80 -0
  14. package/dist/bridge.js +1 -13
  15. package/dist/build-file-DNi0PHC5.js +31 -0
  16. package/dist/cli.js +6212 -8
  17. package/dist/{client-Derrexwr.js → client-C8STAw9T.js} +43 -24
  18. package/dist/code-N8pBUDbq.js +30 -0
  19. package/dist/code.d.ts +1 -0
  20. package/dist/code.js +1 -0
  21. package/dist/collection-26aglrg6.js +282 -0
  22. package/dist/{declared-DuNMsdXw.js → declared-CE4a61qb.js} +35 -35
  23. package/dist/delivery.js +121 -114
  24. package/dist/dev-operations-Tutwi1On.js +46 -0
  25. package/dist/dev.js +9 -16
  26. package/dist/embeds-DY6O5TrJ.js +29 -0
  27. package/dist/end-users.d.ts +1 -0
  28. package/dist/end-users.js +189 -0
  29. package/dist/endUsers-DODfjnv1.js +77 -0
  30. package/dist/{errorLabels-BgtQ_zUn.js → errorLabels-BK1NJ6Wz.js} +374 -238
  31. package/dist/i18n.js +4 -4
  32. package/dist/ids-DmtIoqBX.js +109 -0
  33. package/dist/integrations.js +95 -24
  34. package/dist/{ja-Du6ooL6i.js → ja-B3lAaOhZ.js} +91 -45
  35. package/dist/{ja-CeHU0EaY.js → ja-axQPxMJ-.js} +3 -3
  36. package/dist/operations-CIB99rIY.js +95 -0
  37. package/dist/operations.d.ts +1 -0
  38. package/dist/operations.js +1 -0
  39. package/dist/{page-Bzrj24sJ.js → page-yo1cw1kW.js} +1 -1
  40. package/dist/paymentPort-p1jV44Zz.js +203 -0
  41. package/dist/preview.js +8 -1
  42. package/dist/{profile-1em_lcxq.js → profile-DBsXLvvI.js} +48 -48
  43. package/dist/rich-text.js +16 -16
  44. package/dist/{schema-WnobuwLg.js → schema-Bs_BUUNv.js} +526 -265
  45. package/dist/schema.js +66 -88
  46. package/dist/types/access/src/handoff.d.ts +19 -14
  47. package/dist/types/access/src/index.d.ts +2 -2
  48. package/dist/types/access/src/jws.d.ts +41 -0
  49. package/dist/types/access/src/oidc.d.ts +12 -2
  50. package/dist/types/access/src/signed.d.ts +0 -2
  51. package/dist/types/adapter-cloudflare/src/eventLog/viewSchema.d.ts +11 -0
  52. package/dist/types/contract/src/accountProfile.d.ts +7 -0
  53. package/dist/types/contract/src/api/define.d.ts +165 -0
  54. package/dist/types/contract/src/apiKeys.d.ts +6 -2
  55. package/dist/types/contract/src/app.d.ts +32 -7
  56. package/dist/types/contract/src/appChannels.d.ts +152 -0
  57. package/dist/types/contract/src/appDefinition.d.ts +11 -5
  58. package/dist/types/contract/src/appDependencies.d.ts +107 -24
  59. package/dist/types/contract/src/appIdentities.d.ts +21 -0
  60. package/dist/types/contract/src/appInbound.d.ts +53 -0
  61. package/dist/types/contract/src/appMail.d.ts +106 -0
  62. package/dist/types/contract/src/appSecrets.d.ts +63 -0
  63. package/dist/types/contract/src/appServer.d.ts +460 -45
  64. package/dist/types/contract/src/approvals.d.ts +1 -1
  65. package/dist/types/contract/src/apps.d.ts +126 -60
  66. package/dist/types/contract/src/auditActions.d.ts +2 -2
  67. package/dist/types/contract/src/auditLabels.d.ts +120 -15
  68. package/dist/types/contract/src/authorize.d.ts +42 -14
  69. package/dist/types/contract/src/bridge.d.ts +35 -36
  70. package/dist/types/contract/src/consents.d.ts +29 -27
  71. package/dist/types/contract/src/deletion.d.ts +18 -0
  72. package/dist/types/contract/src/embeds.d.ts +26 -90
  73. package/dist/types/contract/src/{customerLabels.d.ts → endUserLabels.d.ts} +6 -9
  74. package/dist/types/contract/src/endUsers.d.ts +244 -0
  75. package/dist/types/contract/src/errorLabels.d.ts +67 -37
  76. package/dist/types/contract/src/errorLabelsEn.d.ts +50 -33
  77. package/dist/types/contract/src/errors.d.ts +28 -16
  78. package/dist/types/contract/src/eventSchemas.d.ts +70 -0
  79. package/dist/types/contract/src/eventTraces.d.ts +41 -0
  80. package/dist/types/contract/src/failureStatus.d.ts +14 -22
  81. package/dist/types/contract/src/fieldAccess.d.ts +8 -8
  82. package/dist/types/contract/src/formLabels.d.ts +3 -0
  83. package/dist/types/contract/src/forms.d.ts +4 -0
  84. package/dist/types/contract/src/grants.d.ts +26 -0
  85. package/dist/types/contract/src/headers.d.ts +5 -0
  86. package/dist/types/contract/src/hostingRpc.d.ts +44 -19
  87. package/dist/types/contract/src/identifiers.d.ts +45 -17
  88. package/dist/types/contract/src/ids.d.ts +18 -10
  89. package/dist/types/contract/src/import.d.ts +17 -16
  90. package/dist/types/contract/src/index.d.ts +57 -29
  91. package/dist/types/contract/src/integrationGraph.d.ts +83 -0
  92. package/dist/types/contract/src/issueLabels.d.ts +121 -81
  93. package/dist/types/contract/src/issueLabelsEn.d.ts +61 -41
  94. package/dist/types/contract/src/manage.d.ts +16 -7
  95. package/dist/types/contract/src/manageLabels.d.ts +2 -0
  96. package/dist/types/contract/src/manifestText.d.ts +66 -0
  97. package/dist/types/contract/src/messagePort.d.ts +208 -0
  98. package/dist/types/contract/src/migration.d.ts +2 -2
  99. package/dist/types/contract/src/notices.d.ts +37 -0
  100. package/dist/types/contract/src/operationEffects.d.ts +39 -0
  101. package/dist/types/contract/src/operatorOperations.d.ts +104 -110
  102. package/dist/types/contract/src/outbound.d.ts +29 -0
  103. package/dist/types/contract/src/paths.d.ts +13 -0
  104. package/dist/types/contract/src/paymentPort.d.ts +129 -0
  105. package/dist/types/contract/src/pending.d.ts +2 -0
  106. package/dist/types/contract/src/permissions.d.ts +7 -11
  107. package/dist/types/contract/src/perspective.d.ts +26 -0
  108. package/dist/types/contract/src/powers.d.ts +5 -0
  109. package/dist/types/contract/src/principal.d.ts +127 -56
  110. package/dist/types/contract/src/readPages.d.ts +92 -0
  111. package/dist/types/contract/src/recordLabels.d.ts +6 -0
  112. package/dist/types/contract/src/roles.d.ts +7 -4
  113. package/dist/types/contract/src/ruleLabels.d.ts +16 -0
  114. package/dist/types/contract/src/ruleProblems.d.ts +16 -0
  115. package/dist/types/contract/src/schemaLabels.d.ts +8 -0
  116. package/dist/types/contract/src/settingProblems.d.ts +18 -1
  117. package/dist/types/contract/src/settings.d.ts +5 -7
  118. package/dist/types/contract/src/siteDeclaration.d.ts +7 -7
  119. package/dist/types/contract/src/siteIndex.d.ts +76 -0
  120. package/dist/types/contract/src/transfer.d.ts +1 -1
  121. package/dist/types/contract/src/trial.d.ts +4 -1
  122. package/dist/types/contract/src/versions.d.ts +1 -3
  123. package/dist/types/contract/src/viewEvent.d.ts +0 -9
  124. package/dist/types/contract/src/webhooks.d.ts +24 -3
  125. package/dist/types/contract/src/workflow.d.ts +16 -19
  126. package/dist/types/contract/src/workspaceItems.d.ts +23 -7
  127. package/dist/types/contract/src/workspacePaths.d.ts +1 -1
  128. package/dist/types/rich-text/src/html.d.ts +1 -1
  129. package/dist/types/rich-text/src/index.d.ts +8 -7
  130. package/dist/types/rich-text/src/labels/en.d.ts +1 -1
  131. package/dist/types/rich-text/src/labels/ja.d.ts +2 -2
  132. package/dist/types/rich-text/src/library.d.ts +1 -1
  133. package/dist/types/rich-text/src/media.d.ts +2 -0
  134. package/dist/types/rich-text/src/normalize.d.ts +1 -1
  135. package/dist/types/rich-text/src/problems.d.ts +5 -5
  136. package/dist/types/rich-text/src/profile.d.ts +10 -10
  137. package/dist/types/rich-text/src/render.d.ts +1 -1
  138. package/dist/types/rich-text/src/schema.d.ts +2 -2
  139. package/dist/types/rich-text/src/standard.d.ts +4 -4
  140. package/dist/types/rich-text/src/types.d.ts +2 -2
  141. package/dist/types/schema/src/audience.d.ts +1 -3
  142. package/dist/types/schema/src/capabilities.d.ts +18 -27
  143. package/dist/types/schema/src/changes.d.ts +3 -1
  144. package/dist/types/schema/src/collection.d.ts +142 -111
  145. package/dist/types/schema/src/defaultSchema.d.ts +8 -2
  146. package/dist/types/schema/src/fieldIds.d.ts +18 -0
  147. package/dist/types/schema/src/file.d.ts +24 -11
  148. package/dist/types/schema/src/fileRefs.d.ts +14 -0
  149. package/dist/types/schema/src/fileSignature.d.ts +20 -0
  150. package/dist/types/schema/src/filesCollection.d.ts +7 -0
  151. package/dist/types/schema/src/forms.d.ts +43 -0
  152. package/dist/types/schema/src/imageMetadata.d.ts +9 -0
  153. package/dist/types/schema/src/index.d.ts +19 -10
  154. package/dist/types/schema/src/indexes.d.ts +11 -0
  155. package/dist/types/schema/src/input.d.ts +1 -1
  156. package/dist/types/schema/src/integrity.d.ts +8 -7
  157. package/dist/types/schema/src/kinds.d.ts +26 -0
  158. package/dist/types/schema/src/labels/en.d.ts +89 -46
  159. package/dist/types/schema/src/labels/ja.d.ts +92 -46
  160. package/dist/types/schema/src/mediaUrl.d.ts +26 -33
  161. package/dist/types/schema/src/page.d.ts +4 -4
  162. package/dist/types/schema/src/problems.d.ts +85 -42
  163. package/dist/types/schema/src/refs.d.ts +0 -9
  164. package/dist/types/schema/src/schema.d.ts +17 -12
  165. package/dist/types/schema/src/selfOps.d.ts +20 -19
  166. package/dist/types/schema/src/traits.d.ts +28 -0
  167. package/dist/types/schema/src/typesSource.d.ts +1 -1
  168. package/dist/types/schema/src/values.d.ts +5 -2
  169. package/dist/types/schema/src/widening.d.ts +3 -0
  170. package/dist/types/sdk/src/analytics.d.ts +2 -1
  171. package/dist/types/sdk/src/app.d.ts +43 -14
  172. package/dist/types/sdk/src/astro-image.d.ts +19 -0
  173. package/dist/types/sdk/src/astro-response.d.ts +6 -0
  174. package/dist/types/sdk/src/astro-server.d.ts +16 -0
  175. package/dist/types/sdk/src/astro.d.ts +19 -0
  176. package/dist/types/sdk/src/bridge.d.ts +2 -4
  177. package/dist/types/sdk/src/code.d.ts +61 -0
  178. package/dist/types/sdk/src/delegation.d.ts +13 -3
  179. package/dist/types/sdk/src/delivery/changes.d.ts +4 -4
  180. package/dist/types/sdk/src/delivery/client.d.ts +33 -22
  181. package/dist/types/sdk/src/delivery/fields.d.ts +3 -3
  182. package/dist/types/sdk/src/delivery/index.d.ts +3 -3
  183. package/dist/types/sdk/src/delivery/media.d.ts +5 -8
  184. package/dist/types/sdk/src/delivery/query.d.ts +15 -11
  185. package/dist/types/sdk/src/delivery/schema.d.ts +1 -1
  186. package/dist/types/sdk/src/delivery/values.d.ts +10 -14
  187. package/dist/types/sdk/src/delivery.d.ts +2 -2
  188. package/dist/types/sdk/src/dev-operations.d.ts +20 -0
  189. package/dist/types/sdk/src/dev.d.ts +6 -5
  190. package/dist/types/sdk/src/end-users.d.ts +187 -0
  191. package/dist/types/sdk/src/i18n.d.ts +2 -2
  192. package/dist/types/sdk/src/integrations.d.ts +14 -21
  193. package/dist/types/sdk/src/operations.d.ts +17 -0
  194. package/dist/types/sdk/src/preview.d.ts +2 -1
  195. package/dist/types/sdk/src/rich-text.d.ts +2 -2
  196. package/dist/types/sdk/src/schema.d.ts +1 -1
  197. package/dist/types/sdk/src/site/artifact.d.ts +64 -0
  198. package/dist/types/sdk/src/site/build-file.d.ts +30 -0
  199. package/dist/types/sdk/src/site/check-code.d.ts +14 -0
  200. package/dist/types/sdk/src/site/check-text.d.ts +19 -0
  201. package/dist/types/sdk/src/site/cli.d.ts +52 -0
  202. package/dist/types/sdk/src/site/content-type.d.ts +2 -0
  203. package/dist/types/sdk/src/site/labels.d.ts +14 -0
  204. package/dist/types/sdk/src/types.d.ts +1 -1
  205. package/dist/{types-B77qvqPJ.js → types-CYnY-63C.js} +5 -6
  206. package/dist/types.js +1 -1
  207. package/dist/{typesSource-CWybQYus.js → typesSource-BTA9-rcB.js} +17 -15
  208. package/package.json +32 -6
  209. package/dist/apps-BxnJ1RlU.js +0 -435
  210. package/dist/bridge-DtHw9hS6.js +0 -74
  211. package/dist/collection-BEOxeISR.js +0 -189
  212. package/dist/customers-DTbL0qn6.js +0 -86
  213. package/dist/customers.d.ts +0 -1
  214. package/dist/customers.js +0 -185
  215. package/dist/embeds-B5V54Zur.js +0 -34
  216. package/dist/ids--RF7hGyC.js +0 -36
  217. package/dist/src-sazhzYui.js +0 -71
  218. package/dist/types/contract/src/customers.d.ts +0 -266
  219. package/dist/types/schema/src/legacy.d.ts +0 -2
  220. package/dist/types/schema/src/media.d.ts +0 -5
  221. package/dist/types/sdk/src/customers.d.ts +0 -184
@@ -0,0 +1,39 @@
1
+ /** 元に戻せるか: undo は元に戻す操作がある、trash はゴミ箱から復元できる(ゴミ箱のないコレクションでは戻せない)、none は戻せない */
2
+ export declare const REVERSALS: readonly ["undo", "trash", "none"];
3
+ export type Reversal = (typeof REVERSALS)[number];
4
+ /** 影響の範囲: one は1件、many は複数、whole は環境かプロジェクトの全体 */
5
+ export declare const REACHES: readonly ["one", "many", "whole"];
6
+ export type Reach = (typeof REACHES)[number];
7
+ /** 外部への影響: site は公開中のサイトが変わる、credential は外部のシステムが持つ認証情報が無効になる、send は外部へ送信する */
8
+ export declare const EXTERNAL_EFFECTS: readonly ["site", "credential", "send"];
9
+ export type ExternalEffect = (typeof EXTERNAL_EFFECTS)[number];
10
+ /** 操作の事実(access は人、アプリ、資格、エンドユーザーの権限か認証情報を変えるか) */
11
+ export type OperationEffect = Readonly<{
12
+ reversal: Reversal;
13
+ reach: Reach;
14
+ external: readonly ExternalEffect[];
15
+ access: boolean;
16
+ }>;
17
+ /** 呼び出しの事実(count は対象の件数、trash は対象のコレクションがゴミ箱を持つか) */
18
+ export type Invocation = Readonly<{
19
+ count?: number;
20
+ trash?: boolean;
21
+ }>;
22
+ /** 操作の重さ(light は確認なし、medium は確認のダイアログ、heavy は対象の名前の入力) */
23
+ export declare const CONFIRM_WEIGHTS: readonly ["light", "medium", "heavy"];
24
+ export type ConfirmWeight = (typeof CONFIRM_WEIGHTS)[number];
25
+ /**
26
+ * 事実から操作の重さを導く
27
+ * - 戻せない操作は、影響が1件を越えるか、外部のシステムが持つ認証情報を無効にするとき heavy、ほかは medium
28
+ * - 戻せる操作は、元に戻す操作があり、1件で、外部と権限に関わらないとき light、ほかは medium
29
+ */
30
+ export declare function weightOf(effect: OperationEffect, invocation?: Invocation): ConfirmWeight;
31
+ /** 画面が操作の ID で引く確認の事実(GET /api/me の operations。recentLogin はサーバーが直近のログインを求める操作で、重さと別の宣言) */
32
+ export type OperationConfirm = Readonly<{
33
+ effect: OperationEffect;
34
+ recentLogin: boolean;
35
+ }>;
36
+ /** 直近のログインとみなす本人の確認からの秒数(authentication が recent_login の操作と、console の大事な操作) */
37
+ export declare const RECENT_LOGIN_WINDOW_SEC: number;
38
+ /** 直近のログインか(signedInAt は本人の確認の時刻のミリ秒、now はミリ秒) */
39
+ export declare const recentlySignedIn: (signedInAt: number | null | undefined, now: number) => boolean;
@@ -12,7 +12,7 @@ export type OperatorWhen = 'trial' | 'legacy' | 'notLive';
12
12
  export type OperatorOperation = Readonly<{
13
13
  id: string;
14
14
  cli?: string;
15
- method?: 'GET' | 'POST';
15
+ method?: 'GET' | 'POST' | 'DELETE';
16
16
  path?: string;
17
17
  level: OperatorLevel;
18
18
  secret?: boolean;
@@ -39,24 +39,46 @@ export declare const OPERATOR_OPERATIONS: readonly [{
39
39
  };
40
40
  readonly available: true;
41
41
  }, {
42
- readonly id: "secrets";
43
- readonly cli: "secrets";
42
+ readonly id: "migrate";
43
+ readonly cli: "migrate";
44
+ readonly method: "POST";
45
+ readonly path: "/registry:migrate";
46
+ readonly level: "reversible";
47
+ readonly place: {
48
+ readonly screen: "maintenance";
49
+ };
50
+ readonly available: true;
51
+ }, {
52
+ readonly id: "one-time-targets";
44
53
  readonly method: "GET";
45
- readonly path: "/secrets";
54
+ readonly path: "/one-time";
46
55
  readonly level: "read";
47
56
  readonly place: {
48
57
  readonly screen: "maintenance";
49
58
  };
50
59
  readonly available: true;
51
60
  }, {
52
- readonly id: "migrate";
53
- readonly cli: "migrate";
61
+ readonly id: "one-time";
54
62
  readonly method: "POST";
55
- readonly path: "/migrate";
63
+ readonly path: "/projects/{project}:run-one-time";
56
64
  readonly level: "reversible";
57
65
  readonly place: {
58
- readonly screen: "maintenance";
66
+ readonly screen: "project";
67
+ readonly tab: OperatorProjectTab;
68
+ };
69
+ readonly environment: true;
70
+ readonly available: true;
71
+ }, {
72
+ readonly id: "secrets";
73
+ readonly cli: "secrets";
74
+ readonly method: "GET";
75
+ readonly path: "/projects/{project}/secrets";
76
+ readonly level: "read";
77
+ readonly place: {
78
+ readonly screen: "project";
79
+ readonly tab: OperatorProjectTab;
59
80
  };
81
+ readonly environment: true;
60
82
  readonly available: true;
61
83
  }, {
62
84
  readonly id: "session";
@@ -72,7 +94,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
72
94
  readonly id: "paused";
73
95
  readonly cli: "paused";
74
96
  readonly method: "GET";
75
- readonly path: "/paused";
97
+ readonly path: "/registry";
76
98
  readonly level: "read";
77
99
  readonly place: {
78
100
  readonly screen: "maintenance";
@@ -82,7 +104,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
82
104
  readonly id: "pause";
83
105
  readonly cli: "pause";
84
106
  readonly method: "POST";
85
- readonly path: "/pause";
107
+ readonly path: "/registry:pause";
86
108
  readonly level: "heavy";
87
109
  readonly place: {
88
110
  readonly screen: "maintenance";
@@ -92,7 +114,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
92
114
  readonly id: "resume";
93
115
  readonly cli: "resume";
94
116
  readonly method: "POST";
95
- readonly path: "/resume";
117
+ readonly path: "/registry:resume";
96
118
  readonly level: "reversible";
97
119
  readonly place: {
98
120
  readonly screen: "maintenance";
@@ -108,6 +130,25 @@ export declare const OPERATOR_OPERATIONS: readonly [{
108
130
  readonly screen: "projects";
109
131
  };
110
132
  readonly available: true;
133
+ }, {
134
+ readonly id: "organizations";
135
+ readonly cli: "organizations";
136
+ readonly method: "GET";
137
+ readonly path: "/organizations";
138
+ readonly level: "read";
139
+ readonly place: {
140
+ readonly screen: "organizations";
141
+ };
142
+ readonly available: true;
143
+ }, {
144
+ readonly id: "organization-sync";
145
+ readonly method: "POST";
146
+ readonly path: "/organizations:sync";
147
+ readonly level: "read";
148
+ readonly place: {
149
+ readonly screen: "organizations";
150
+ };
151
+ readonly available: true;
111
152
  }, {
112
153
  readonly id: "create";
113
154
  readonly cli: "create";
@@ -121,8 +162,6 @@ export declare const OPERATOR_OPERATIONS: readonly [{
121
162
  }, {
122
163
  readonly id: "hosting";
123
164
  readonly cli: "hosting";
124
- readonly method: "POST";
125
- readonly path: "/hosting";
126
165
  readonly level: "heavy";
127
166
  readonly place: {
128
167
  readonly screen: "hosting";
@@ -148,6 +187,15 @@ export declare const OPERATOR_OPERATIONS: readonly [{
148
187
  readonly screen: "apps";
149
188
  };
150
189
  readonly available: true;
190
+ }, {
191
+ readonly id: "standard-app-candidates";
192
+ readonly method: "GET";
193
+ readonly path: "/standard-app-candidates";
194
+ readonly level: "read";
195
+ readonly place: {
196
+ readonly screen: "apps";
197
+ };
198
+ readonly available: true;
151
199
  }, {
152
200
  readonly id: "standard-app-set";
153
201
  readonly cli: "standard-app-set";
@@ -161,8 +209,8 @@ export declare const OPERATOR_OPERATIONS: readonly [{
161
209
  }, {
162
210
  readonly id: "standard-app-remove";
163
211
  readonly cli: "standard-app-remove";
164
- readonly method: "POST";
165
- readonly path: "/standard-apps/{app}/remove";
212
+ readonly method: "DELETE";
213
+ readonly path: "/standard-apps/{app}";
166
214
  readonly level: "heavy";
167
215
  readonly place: {
168
216
  readonly screen: "apps";
@@ -202,7 +250,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
202
250
  readonly id: "app-keys";
203
251
  readonly cli: "app-keys";
204
252
  readonly method: "POST";
205
- readonly path: "/apps/{app}/keys";
253
+ readonly path: "/apps/{app}:set-keys";
206
254
  readonly level: "heavy";
207
255
  readonly place: {
208
256
  readonly screen: "apps";
@@ -222,7 +270,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
222
270
  readonly id: "registry-backup";
223
271
  readonly cli: "backup";
224
272
  readonly method: "POST";
225
- readonly path: "/backups/registry";
273
+ readonly path: "/backups:registry";
226
274
  readonly level: "reversible";
227
275
  readonly place: {
228
276
  readonly screen: "maintenance";
@@ -232,7 +280,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
232
280
  readonly id: "registry-download";
233
281
  readonly cli: "backup:download";
234
282
  readonly method: "GET";
235
- readonly path: "/backups/download?registry";
283
+ readonly path: "/backups/{backup}:download?registry";
236
284
  readonly level: "read";
237
285
  readonly place: {
238
286
  readonly screen: "maintenance";
@@ -273,8 +321,8 @@ export declare const OPERATOR_OPERATIONS: readonly [{
273
321
  }, {
274
322
  readonly id: "delete-project";
275
323
  readonly cli: "delete-project";
276
- readonly method: "POST";
277
- readonly path: "/projects/{project}/delete-project";
324
+ readonly method: "DELETE";
325
+ readonly path: "/projects/{project}";
278
326
  readonly level: "irreversible";
279
327
  readonly place: {
280
328
  readonly screen: "project";
@@ -284,8 +332,8 @@ export declare const OPERATOR_OPERATIONS: readonly [{
284
332
  }, {
285
333
  readonly id: "delete-trial";
286
334
  readonly cli: "delete-trial";
287
- readonly method: "POST";
288
- readonly path: "/projects/{project}/delete-trial";
335
+ readonly method: "DELETE";
336
+ readonly path: "/projects/{project}";
289
337
  readonly level: "irreversible";
290
338
  readonly place: {
291
339
  readonly screen: "project";
@@ -308,7 +356,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
308
356
  readonly id: "copy-env";
309
357
  readonly cli: "copy-env";
310
358
  readonly method: "POST";
311
- readonly path: "/projects/{project}/copy-environment";
359
+ readonly path: "/projects/{project}/environments:copy";
312
360
  readonly level: "heavy";
313
361
  readonly place: {
314
362
  readonly screen: "project";
@@ -318,8 +366,8 @@ export declare const OPERATOR_OPERATIONS: readonly [{
318
366
  }, {
319
367
  readonly id: "delete-env";
320
368
  readonly cli: "delete-env";
321
- readonly method: "POST";
322
- readonly path: "/projects/{project}/delete-environment";
369
+ readonly method: "DELETE";
370
+ readonly path: "/projects/{project}/environments/{environment}";
323
371
  readonly level: "irreversible";
324
372
  readonly place: {
325
373
  readonly screen: "project";
@@ -331,7 +379,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
331
379
  readonly id: "freeze";
332
380
  readonly cli: "freeze";
333
381
  readonly method: "POST";
334
- readonly path: "/projects/{project}/freeze";
382
+ readonly path: "/projects/{project}:freeze";
335
383
  readonly level: "heavy";
336
384
  readonly place: {
337
385
  readonly screen: "project";
@@ -342,7 +390,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
342
390
  readonly id: "unfreeze";
343
391
  readonly cli: "unfreeze";
344
392
  readonly method: "POST";
345
- readonly path: "/projects/{project}/unfreeze";
393
+ readonly path: "/projects/{project}:unfreeze";
346
394
  readonly level: "reversible";
347
395
  readonly place: {
348
396
  readonly screen: "project";
@@ -353,7 +401,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
353
401
  readonly id: "promote-plan";
354
402
  readonly cli: "promote-plan";
355
403
  readonly method: "POST";
356
- readonly path: "/projects/{project}/promote-plan";
404
+ readonly path: "/projects/{project}:plan-promotion";
357
405
  readonly level: "read";
358
406
  readonly place: {
359
407
  readonly screen: "project";
@@ -365,31 +413,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
365
413
  readonly id: "promote-commit";
366
414
  readonly cli: "promote-commit";
367
415
  readonly method: "POST";
368
- readonly path: "/projects/{project}/promote-commit";
369
- readonly level: "heavy";
370
- readonly place: {
371
- readonly screen: "project";
372
- readonly tab: OperatorProjectTab;
373
- };
374
- readonly when: "notLive";
375
- readonly available: true;
376
- }, {
377
- readonly id: "schema-plan";
378
- readonly cli: "schema-plan";
379
- readonly method: "POST";
380
- readonly path: "/projects/{project}/schema-plan";
381
- readonly level: "read";
382
- readonly place: {
383
- readonly screen: "project";
384
- readonly tab: OperatorProjectTab;
385
- };
386
- readonly when: "notLive";
387
- readonly available: true;
388
- }, {
389
- readonly id: "schema-commit";
390
- readonly cli: "schema-commit";
391
- readonly method: "POST";
392
- readonly path: "/projects/{project}/schema-commit";
416
+ readonly path: "/projects/{project}:promote";
393
417
  readonly level: "heavy";
394
418
  readonly place: {
395
419
  readonly screen: "project";
@@ -401,46 +425,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
401
425
  readonly id: "prune";
402
426
  readonly cli: "prune";
403
427
  readonly method: "POST";
404
- readonly path: "/projects/{project}/prune";
405
- readonly level: "irreversible";
406
- readonly place: {
407
- readonly screen: "project";
408
- readonly tab: OperatorProjectTab;
409
- };
410
- readonly environment: true;
411
- readonly dryRun: true;
412
- readonly available: true;
413
- }, {
414
- readonly id: "account-moves";
415
- readonly cli: "account-moves";
416
- readonly method: "POST";
417
- readonly path: "/projects/{project}/account-moves";
418
- readonly level: "irreversible";
419
- readonly place: {
420
- readonly screen: "project";
421
- readonly tab: OperatorProjectTab;
422
- };
423
- readonly environment: true;
424
- readonly dryRun: true;
425
- readonly available: true;
426
- }, {
427
- readonly id: "installation-moves";
428
- readonly cli: "installation-moves";
429
- readonly method: "POST";
430
- readonly path: "/projects/{project}/installation-moves";
431
- readonly level: "irreversible";
432
- readonly place: {
433
- readonly screen: "project";
434
- readonly tab: OperatorProjectTab;
435
- };
436
- readonly environment: true;
437
- readonly dryRun: true;
438
- readonly available: true;
439
- }, {
440
- readonly id: "standard-app-moves";
441
- readonly cli: "standard-app-moves";
442
- readonly method: "POST";
443
- readonly path: "/projects/{project}/standard-app-moves";
428
+ readonly path: "/projects/{project}:prune";
444
429
  readonly level: "irreversible";
445
430
  readonly place: {
446
431
  readonly screen: "project";
@@ -465,7 +450,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
465
450
  readonly id: "download";
466
451
  readonly cli: "backup:download";
467
452
  readonly method: "GET";
468
- readonly path: "/backups/download?project={project}";
453
+ readonly path: "/backups/{backup}:download?project={project}";
469
454
  readonly level: "read";
470
455
  readonly place: {
471
456
  readonly screen: "project";
@@ -477,7 +462,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
477
462
  readonly id: "backup";
478
463
  readonly cli: "backup";
479
464
  readonly method: "POST";
480
- readonly path: "/projects/{project}/backup";
465
+ readonly path: "/projects/{project}:backup";
481
466
  readonly level: "reversible";
482
467
  readonly place: {
483
468
  readonly screen: "project";
@@ -489,7 +474,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
489
474
  readonly id: "restore";
490
475
  readonly cli: "restore";
491
476
  readonly method: "POST";
492
- readonly path: "/projects/{project}/restore";
477
+ readonly path: "/projects/{project}:restore";
493
478
  readonly level: "irreversible";
494
479
  readonly place: {
495
480
  readonly screen: "project";
@@ -502,7 +487,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
502
487
  readonly id: "import";
503
488
  readonly cli: "import";
504
489
  readonly method: "POST";
505
- readonly path: "/projects/{project}/import";
490
+ readonly path: "/projects/{project}:import";
506
491
  readonly level: "irreversible";
507
492
  readonly place: {
508
493
  readonly screen: "project";
@@ -515,7 +500,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
515
500
  readonly id: "switch-host";
516
501
  readonly cli: "switch-host";
517
502
  readonly method: "POST";
518
- readonly path: "/projects/{project}/hosts";
503
+ readonly path: "/projects/{project}/hosts:switch";
519
504
  readonly level: "heavy";
520
505
  readonly place: {
521
506
  readonly screen: "project";
@@ -526,7 +511,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
526
511
  readonly id: "set-host";
527
512
  readonly cli: "set-host";
528
513
  readonly method: "POST";
529
- readonly path: "/projects/{project}/hosts";
514
+ readonly path: "/projects/{project}/hosts:replace";
530
515
  readonly level: "heavy";
531
516
  readonly place: {
532
517
  readonly screen: "project";
@@ -537,7 +522,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
537
522
  readonly id: "remove-alias";
538
523
  readonly cli: "remove-alias";
539
524
  readonly method: "POST";
540
- readonly path: "/projects/{project}/hosts";
525
+ readonly path: "/projects/{project}/hosts:remove-alias";
541
526
  readonly level: "heavy";
542
527
  readonly place: {
543
528
  readonly screen: "project";
@@ -548,7 +533,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
548
533
  readonly id: "emergency";
549
534
  readonly cli: "emergency";
550
535
  readonly method: "POST";
551
- readonly path: "/projects/{project}/emergency";
536
+ readonly path: "/projects/{project}:emergency";
552
537
  readonly level: "heavy";
553
538
  readonly place: {
554
539
  readonly screen: "project";
@@ -559,7 +544,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
559
544
  readonly id: "revoke-grants";
560
545
  readonly cli: "revoke-grants";
561
546
  readonly method: "POST";
562
- readonly path: "/projects/{project}/revoke-grants";
547
+ readonly path: "/projects/{project}:revoke-grants";
563
548
  readonly level: "reversible";
564
549
  readonly place: {
565
550
  readonly screen: "project";
@@ -571,7 +556,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
571
556
  readonly id: "api-key-create";
572
557
  readonly cli: "api-key-create";
573
558
  readonly method: "POST";
574
- readonly path: "/projects/{project}/api-key-create";
559
+ readonly path: "/projects/{project}/api-keys";
575
560
  readonly level: "heavy";
576
561
  readonly secret: true;
577
562
  readonly place: {
@@ -579,11 +564,22 @@ export declare const OPERATOR_OPERATIONS: readonly [{
579
564
  readonly tab: OperatorProjectTab;
580
565
  };
581
566
  readonly available: true;
567
+ }, {
568
+ readonly id: "channel-key";
569
+ readonly cli: "channel-key";
570
+ readonly method: "POST";
571
+ readonly path: "/projects/{project}:issue-channel-key";
572
+ readonly level: "heavy";
573
+ readonly place: {
574
+ readonly screen: "project";
575
+ readonly tab: OperatorProjectTab;
576
+ };
577
+ readonly available: true;
582
578
  }, {
583
579
  readonly id: "test-integration";
584
580
  readonly cli: "test-integration";
585
581
  readonly method: "POST";
586
- readonly path: "/projects/{project}/integrations/{registration}/test";
582
+ readonly path: "/projects/{project}/integrations/{registration}:test";
587
583
  readonly level: "reversible";
588
584
  readonly place: {
589
585
  readonly screen: "project";
@@ -594,7 +590,7 @@ export declare const OPERATOR_OPERATIONS: readonly [{
594
590
  readonly id: "trial-session";
595
591
  readonly cli: "trial-session";
596
592
  readonly method: "POST";
597
- readonly path: "/projects/{project}/trial-session";
593
+ readonly path: "/projects/{project}:start-trial-session";
598
594
  readonly level: "reversible";
599
595
  readonly secret: true;
600
596
  readonly place: {
@@ -677,8 +673,6 @@ export declare const OPERATOR_OPERATIONS: readonly [{
677
673
  }];
678
674
  /** 操作の ID */
679
675
  export type OperatorOperationId = (typeof OPERATOR_OPERATIONS)[number]['id'];
680
- /** 本文に固定で足す値(ホスト名の操作の mode) */
681
- export declare const OPERATOR_FIXED_BODY: Readonly<Partial<Record<OperatorOperationId, Readonly<Record<string, unknown>>>>>;
682
676
  /** ホスティングするサイトの操作の段(purge はサイトの削除、stop と reattach は直近のログイン、ほかは確かめない) */
683
677
  export declare const HOSTING_LEVELS: {
684
678
  readonly stop: "heavy";
@@ -697,7 +691,7 @@ export declare const operatorOperation: (id: OperatorOperationId) => OperatorOpe
697
691
  /** 直近のログインを確かめる段か */
698
692
  export declare const needsRecentLogin: (level: OperatorLevel) => boolean;
699
693
  /**
700
- * 変更の要求(POST、/api を外したパス)の段(表にない経路は null)
701
- * - 同じ経路の操作(ホスト名の3つ)は同じ段。hosting は本文の action ごと(不明な action は heavy)
694
+ * 変更の要求(POST と DELETE、/api を外したパス)の段(表にない経路は null)
695
+ * - 同じ経路の操作(プロジェクトの削除の2つ)は同じ段。ホスティングの操作は経路の操作ごと(HOSTING_LEVELS)
702
696
  */
703
- export declare function levelOfRequest(pathname: string, body: Readonly<Record<string, unknown>> | null): OperatorLevel | null;
697
+ export declare function levelOfRequest(method: string, pathname: string, body: Readonly<Record<string, unknown>> | null): OperatorLevel | null;
@@ -0,0 +1,29 @@
1
+ /** 外への要求のメソッド */
2
+ export declare const APP_OUTBOUND_METHODS: readonly ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"];
3
+ export type AppOutboundMethod = (typeof APP_OUTBOUND_METHODS)[number];
4
+ /**
5
+ * 外への要求に秘密値を載せる指定
6
+ * - secret: アプリの秘密値のキー、header: 載せるヘッダーの名前(小文字)、scheme: 値の前に空白で付ける語(Bearer など)
7
+ */
8
+ export type AppOutboundAuth = Readonly<{
9
+ secret: string;
10
+ header: string;
11
+ scheme?: string;
12
+ }>;
13
+ /** 外への要求の宣言(origin は https のオリジン、path は / から始まる経路の前方一致) */
14
+ export type AppOutbound = Readonly<{
15
+ origin: string;
16
+ method: AppOutboundMethod;
17
+ path: string;
18
+ auth?: AppOutboundAuth;
19
+ }>;
20
+ /** 宣言の上限(経路の字数) */
21
+ export declare const APP_OUTBOUND_LIMITS: {
22
+ readonly pathMaxChars: 200;
23
+ };
24
+ /** 宣言の1件の誤りの箇所(なければ null) */
25
+ export declare function outboundProblem(input: unknown): string | null;
26
+ /** 宣言の能力の要素 */
27
+ export declare const outboundCapabilityOf: (o: AppOutbound) => string;
28
+ /** 要求に当たる宣言(https でポートの指定なし、資格を含まない URL だけ。なければ null) */
29
+ export declare function outboundFor(declared: readonly AppOutbound[], method: string, url: URL): AppOutbound | null;
@@ -19,3 +19,16 @@ export declare function envPathOf(pathname: string): Readonly<{
19
19
  export declare function withEnvPrefix(path: string, opened: string): string;
20
20
  /** サーバーが受け持つパスか(パスの頭と一致、または頭の下、運営者の経路を含む。環境を選ぶ頭の下は運営者の経路を除く) */
21
21
  export declare const isServerPath: (pathname: string) => boolean;
22
+ /** プロジェクトの公開の API のホスト名(publicHost はカンマ区切りの先頭が正) */
23
+ export declare const publicApiHostOf: (publicHost: string, projectId: string) => string;
24
+ /** 公開の API のホスト名のプロジェクトの ID(公開の API のホストでなければ null。publicHost はカンマ区切り) */
25
+ export declare function projectOfPublicHost(hostname: string, publicHost: string | undefined): string | null;
26
+ /** 公開の API の基点のパス */
27
+ export declare const PUBLIC_API_BASE = "/v1";
28
+ /** 公開の API の環境を選ぶ段(/v1/environments/<環境の ID>/…、省略は本番) */
29
+ export declare const PUBLIC_ENV_SEGMENT = "/environments";
30
+ /** 公開の API のパスの分解(environment は環境の段の値で省略は null、path は環境の段を除いたパス。/v1 の外は null) */
31
+ export declare function publicApiPathOf(pathname: string): Readonly<{
32
+ environment: string | null;
33
+ path: string;
34
+ }> | null;
@@ -0,0 +1,129 @@
1
+ import { z } from 'zod';
2
+ import type { ChannelMode } from './appChannels.js';
3
+ /** ポートの id */
4
+ export declare const PAYMENT_PORT: "tunasand:payment@1";
5
+ /** 価格の種類(one_time: 買い切り、recurring: 継続) */
6
+ export declare const PRICE_KINDS: readonly ["one_time", "recurring"];
7
+ export type PriceKind = (typeof PRICE_KINDS)[number];
8
+ /** 継続の周期 */
9
+ export declare const PRICE_INTERVALS: readonly ["month", "year"];
10
+ export type PriceInterval = (typeof PRICE_INTERVALS)[number];
11
+ /** 通貨(ISO 4217の小文字。金額は通貨の最小の単位の整数) */
12
+ export declare const PRICE_CURRENCIES: readonly ["jpy", "usd"];
13
+ export type PriceCurrency = (typeof PRICE_CURRENCIES)[number];
14
+ /** 購入の状態 */
15
+ export declare const PURCHASE_STATUSES: readonly ["paid", "refunded"];
16
+ export type PurchaseStatus = (typeof PURCHASE_STATUSES)[number];
17
+ /** 購読の状態(外部の決済のサービスの購読の状態の語) */
18
+ export declare const SUBSCRIPTION_STATUSES: readonly ["incomplete", "incomplete_expired", "trialing", "active", "past_due", "unpaid", "paused", "canceled"];
19
+ export type SubscriptionStatus = (typeof SUBSCRIPTION_STATUSES)[number];
20
+ /** 権利が続く購読の状態(past_due は外部のサービスの再試行の間、期間の終わりまで続ける) */
21
+ export declare const ENTITLING_SUBSCRIPTION_STATUSES: readonly ["trialing", "active", "past_due"];
22
+ /** 上限(名前の字数、金額、外部の ID とイベントの ID の字数、URL の字数、冪等キーの字数) */
23
+ export declare const PAYMENT_LIMITS: {
24
+ readonly nameMaxChars: 200;
25
+ readonly amountMax: 99999999;
26
+ readonly refMaxChars: 255;
27
+ readonly urlMaxChars: 2000;
28
+ readonly idempotencyKeyMaxChars: 128;
29
+ };
30
+ /** オファー(target は購入で付く権利の対象のレコード) */
31
+ export type OfferView = Readonly<{
32
+ id: string;
33
+ name: string;
34
+ targetCollection: string;
35
+ targetId: string;
36
+ state: 'active' | 'archived';
37
+ version: number;
38
+ }>;
39
+ /** 価格(lookupKey はプロバイダーが外部の価格と対応づけるキーで、価格を作り直すまで変わらない) */
40
+ export type PriceView = Readonly<{
41
+ id: string;
42
+ offerId: string;
43
+ kind: PriceKind;
44
+ amount: number;
45
+ currency: PriceCurrency;
46
+ interval: PriceInterval | null;
47
+ state: 'active' | 'archived';
48
+ lookupKey: string;
49
+ }>;
50
+ /** 価格の lookup_key(`<オファーの ID>.<価格の ID>`。価格は作った後に金額と周期を変えない) */
51
+ export declare const priceLookupKeyOf: (offerId: string, priceId: string) => string;
52
+ /**
53
+ * 申し込みの依頼(コアからプロバイダーへ。endUserId は購入者で、権利の保持者も同じ人)
54
+ * environmentId は申し込みの環境で、プロバイダーは外部のサービスのメタデータに入れ、sandbox の受信の届け先に返す
55
+ * mode はチャネルの外部のキーのモード(live の方針の環境だけ live)
56
+ */
57
+ export type PaymentCheckoutRequest = Readonly<{
58
+ channelId: string;
59
+ mode: ChannelMode;
60
+ environmentId: string;
61
+ offer: OfferView;
62
+ price: PriceView;
63
+ endUserId: string;
64
+ successUrl: string;
65
+ cancelUrl: string;
66
+ idempotencyKey: string;
67
+ }>;
68
+ /** 申し込みの結果(url は支払いの画面、expiresAt は ISO 8601) */
69
+ export type PaymentCheckout = Readonly<{
70
+ url: string;
71
+ expiresAt: string;
72
+ }>;
73
+ /** 顧客の支払いの画面の依頼 */
74
+ export type PaymentPortalRequest = Readonly<{
75
+ channelId: string;
76
+ mode: ChannelMode;
77
+ endUserId: string;
78
+ returnUrl: string;
79
+ }>;
80
+ /** 申し込みと支払いの画面の戻り先の URL(https だけ) */
81
+ export declare const paymentUrl: z.ZodString;
82
+ /** 購入の反映(買い切りの価格の支払い) */
83
+ export declare const purchaseReflection: z.ZodObject<{
84
+ eventId: z.ZodString;
85
+ channelId: z.ZodString;
86
+ providerRef: z.ZodString;
87
+ offerId: z.ZodString;
88
+ priceId: z.ZodString;
89
+ endUserId: z.ZodString;
90
+ observedAt: z.ZodISODateTime;
91
+ status: z.ZodEnum<{
92
+ paid: "paid";
93
+ refunded: "refunded";
94
+ }>;
95
+ amount: z.ZodNumber;
96
+ currency: z.ZodEnum<{
97
+ jpy: "jpy";
98
+ usd: "usd";
99
+ }>;
100
+ }, z.core.$strict>;
101
+ export type PurchaseReflection = z.infer<typeof purchaseReflection>;
102
+ /** 購読の反映(継続の価格。currentPeriodEnd は ISO 8601) */
103
+ export declare const subscriptionReflection: z.ZodObject<{
104
+ eventId: z.ZodString;
105
+ channelId: z.ZodString;
106
+ providerRef: z.ZodString;
107
+ offerId: z.ZodString;
108
+ priceId: z.ZodString;
109
+ endUserId: z.ZodString;
110
+ observedAt: z.ZodISODateTime;
111
+ status: z.ZodEnum<{
112
+ canceled: "canceled";
113
+ active: "active";
114
+ incomplete: "incomplete";
115
+ incomplete_expired: "incomplete_expired";
116
+ trialing: "trialing";
117
+ past_due: "past_due";
118
+ unpaid: "unpaid";
119
+ paused: "paused";
120
+ }>;
121
+ currentPeriodEnd: z.ZodISODateTime;
122
+ cancelAtPeriodEnd: z.ZodBoolean;
123
+ }, z.core.$strict>;
124
+ export type SubscriptionReflection = z.infer<typeof subscriptionReflection>;
125
+ /** 反映の結果(applied: 状態を変えた、duplicate: 同じイベントを反映済み、stale: 取得の時刻が反映済みの状態より古い) */
126
+ export type ReflectionResult = Readonly<{
127
+ outcome: 'applied' | 'duplicate' | 'stale';
128
+ id: string | null;
129
+ }>;