@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.
Files changed (186) hide show
  1. package/CHANGELOG.md +116 -84
  2. package/README.md +209 -195
  3. package/dist/analytics.js +638 -2
  4. package/dist/app.js +230 -24
  5. package/dist/apps-BxnJ1RlU.js +435 -0
  6. package/dist/{bridge-DYAYGV7t.js → bridge-DtHw9hS6.js} +3 -3
  7. package/dist/bridge.js +2 -2
  8. package/dist/cli.js +5 -4
  9. package/dist/{model-pmXzGX12.js → collection-BEOxeISR.js} +49 -12
  10. package/dist/{customers-C_vJY2_v.js → customers-DTbL0qn6.js} +5 -3
  11. package/dist/customers.js +2 -2
  12. package/dist/{declared-C_GvPiGF.js → declared-DuNMsdXw.js} +93 -5
  13. package/dist/delivery.js +39 -8
  14. package/dist/embeds-B5V54Zur.js +34 -0
  15. package/dist/{errorLabels-BcyRbv_i.js → errorLabels-BgtQ_zUn.js} +277 -264
  16. package/dist/i18n.js +4 -4
  17. package/dist/ids--RF7hGyC.js +36 -0
  18. package/dist/integrations.js +4 -29
  19. package/dist/{ja-C1HEWWTQ.js → ja-CeHU0EaY.js} +3 -3
  20. package/dist/{ja-C6lX0CeJ.js → ja-Du6ooL6i.js} +12 -11
  21. package/dist/{page-E_cYgZx-.js → page-Bzrj24sJ.js} +4 -4
  22. package/dist/{profile-D6t1QMQh.js → profile-1em_lcxq.js} +5 -5
  23. package/dist/rich-text.d.ts +1 -0
  24. package/dist/{body.js → rich-text.js} +6 -7
  25. package/dist/{schema-UQJWRyfJ.js → schema-WnobuwLg.js} +136 -97
  26. package/dist/schema.js +346 -1
  27. package/dist/types/access/src/handoff.d.ts +3 -3
  28. package/dist/types/access/src/jwt.d.ts +1 -1
  29. package/dist/types/access/src/oidc.d.ts +1 -1
  30. package/dist/types/{cms-contract → contract}/src/apiKeys.d.ts +1 -1
  31. package/dist/types/{cms-contract → contract}/src/app.d.ts +8 -15
  32. package/dist/types/contract/src/appDefinition.d.ts +127 -0
  33. package/dist/types/{cms-contract → contract}/src/appDependencies.d.ts +6 -13
  34. package/dist/types/contract/src/appServer.d.ts +136 -0
  35. package/dist/types/contract/src/approvalLabels.d.ts +26 -0
  36. package/dist/types/contract/src/approvals.d.ts +63 -0
  37. package/dist/types/{cms-contract → contract}/src/apps.d.ts +72 -29
  38. package/dist/types/contract/src/auditActions.d.ts +18 -0
  39. package/dist/types/contract/src/auditLabels.d.ts +127 -0
  40. package/dist/types/{cms-contract → contract}/src/authorize.d.ts +22 -63
  41. package/dist/types/{cms-contract → contract}/src/bridge.d.ts +6 -6
  42. package/dist/types/{cms-contract → contract}/src/customers.d.ts +6 -6
  43. package/dist/types/{cms-contract → contract}/src/embeds.d.ts +13 -7
  44. package/dist/types/{cms-contract → contract}/src/errorLabels.d.ts +18 -16
  45. package/dist/types/{cms-contract → contract}/src/errorLabelsEn.d.ts +9 -7
  46. package/dist/types/{cms-contract → contract}/src/errors.d.ts +11 -11
  47. package/dist/types/{cms-contract → contract}/src/failureStatus.d.ts +4 -3
  48. package/dist/types/contract/src/fieldAccess.d.ts +45 -0
  49. package/dist/types/contract/src/fieldRules.d.ts +41 -0
  50. package/dist/types/{cms-contract/src/assets.d.ts → contract/src/files.d.ts} +5 -5
  51. package/dist/types/{cms-contract → contract}/src/functions.d.ts +3 -3
  52. package/dist/types/contract/src/hostingRpc.d.ts +143 -0
  53. package/dist/types/contract/src/hostnames.d.ts +30 -0
  54. package/dist/types/{cms-contract → contract}/src/identifiers.d.ts +31 -28
  55. package/dist/types/contract/src/ids.d.ts +104 -0
  56. package/dist/types/{cms-contract → contract}/src/import.d.ts +3 -3
  57. package/dist/types/contract/src/importLabels.d.ts +3 -0
  58. package/dist/types/contract/src/index.d.ts +67 -0
  59. package/dist/types/{cms-contract → contract}/src/issueLabels.d.ts +27 -23
  60. package/dist/types/{cms-contract → contract}/src/issueLabelsEn.d.ts +15 -13
  61. package/dist/types/contract/src/labels.d.ts +11 -0
  62. package/dist/types/contract/src/legacyAuditLabels.d.ts +10 -0
  63. package/dist/types/contract/src/livePeriods.d.ts +18 -0
  64. package/dist/types/contract/src/manage.d.ts +47 -0
  65. package/dist/types/contract/src/manageLabels.d.ts +9 -0
  66. package/dist/types/contract/src/mcpAuth.d.ts +139 -0
  67. package/dist/types/contract/src/mcpLabels.d.ts +5 -0
  68. package/dist/types/{cms-contract → contract}/src/migration.d.ts +1 -1
  69. package/dist/types/contract/src/operatorOperations.d.ts +703 -0
  70. package/dist/types/contract/src/operators.d.ts +33 -0
  71. package/dist/types/{cms-contract → contract}/src/paths.d.ts +6 -8
  72. package/dist/types/contract/src/pending.d.ts +4 -0
  73. package/dist/types/{cms-contract → contract}/src/permissions.d.ts +2 -0
  74. package/dist/types/contract/src/principal.d.ts +110 -0
  75. package/dist/types/{cms-contract → contract}/src/problems.d.ts +4 -4
  76. package/dist/types/contract/src/projectRole.d.ts +6 -0
  77. package/dist/types/{cms-contract → contract}/src/roles.d.ts +4 -3
  78. package/dist/types/{cms-contract → contract}/src/settingProblems.d.ts +2 -2
  79. package/dist/types/{cms-contract → contract}/src/settings.d.ts +2 -2
  80. package/dist/types/contract/src/settingsLabels.d.ts +3 -0
  81. package/dist/types/contract/src/slugs.d.ts +6 -0
  82. package/dist/types/{cms-contract → contract}/src/transfer.d.ts +3 -3
  83. package/dist/types/contract/src/trial.d.ts +10 -0
  84. package/dist/types/contract/src/versions.d.ts +9 -0
  85. package/dist/types/{cms-contract → contract}/src/webhooks.d.ts +33 -58
  86. package/dist/types/contract/src/workflow.d.ts +49 -0
  87. package/dist/types/contract/src/workspaceItems.d.ts +73 -0
  88. package/dist/types/contract/src/workspacePaths.d.ts +4 -0
  89. package/dist/types/{body → rich-text}/src/declared.d.ts +2 -2
  90. package/dist/types/{body → rich-text}/src/embed.d.ts +1 -1
  91. package/dist/types/{body → rich-text}/src/labels/ja.d.ts +2 -2
  92. package/dist/types/{body → rich-text}/src/profile.d.ts +1 -1
  93. package/dist/types/{model → schema}/src/audience.d.ts +11 -11
  94. package/dist/types/schema/src/brand.d.ts +5 -0
  95. package/dist/types/{model → schema}/src/capabilities.d.ts +5 -5
  96. package/dist/types/{model → schema}/src/changes.d.ts +6 -6
  97. package/dist/types/{model → schema}/src/check.d.ts +2 -2
  98. package/dist/types/{model/src/model.d.ts → schema/src/collection.d.ts} +25 -23
  99. package/dist/types/{platform/src/defaultModel.d.ts → schema/src/defaultSchema.d.ts} +4 -3
  100. package/dist/types/{model/src/asset.d.ts → schema/src/file.d.ts} +16 -16
  101. package/dist/types/{model → schema}/src/image.d.ts +3 -3
  102. package/dist/types/{model → schema}/src/index.d.ts +11 -10
  103. package/dist/types/{model → schema}/src/input.d.ts +3 -3
  104. package/dist/types/{model → schema}/src/integrity.d.ts +1 -1
  105. package/dist/types/{model → schema}/src/labels/en.d.ts +8 -7
  106. package/dist/types/{model → schema}/src/labels/ja.d.ts +9 -8
  107. package/dist/types/schema/src/legacy.d.ts +2 -0
  108. package/dist/types/{model → schema}/src/media.d.ts +1 -1
  109. package/dist/types/{model → schema}/src/mediaUrl.d.ts +5 -5
  110. package/dist/types/{model → schema}/src/page.d.ts +2 -2
  111. package/dist/types/{model → schema}/src/problems.d.ts +14 -13
  112. package/dist/types/{model → schema}/src/refs.d.ts +1 -1
  113. package/dist/types/{model → schema}/src/rules.d.ts +2 -2
  114. package/dist/types/{model → schema}/src/schema.d.ts +10 -10
  115. package/dist/types/{model → schema}/src/selfOps.d.ts +1 -1
  116. package/dist/types/schema/src/typesSource.d.ts +16 -0
  117. package/dist/types/{model → schema}/src/values.d.ts +2 -2
  118. package/dist/types/sdk/src/analytics.d.ts +2 -2
  119. package/dist/types/sdk/src/app.d.ts +44 -16
  120. package/dist/types/sdk/src/bridge.d.ts +12 -12
  121. package/dist/types/sdk/src/customers.d.ts +14 -20
  122. package/dist/types/sdk/src/delegation.d.ts +39 -0
  123. package/dist/types/sdk/src/delivery/client.d.ts +11 -10
  124. package/dist/types/sdk/src/delivery/fields.d.ts +2 -2
  125. package/dist/types/sdk/src/delivery/index.d.ts +2 -2
  126. package/dist/types/sdk/src/delivery/media.d.ts +17 -3
  127. package/dist/types/sdk/src/delivery/query.d.ts +1 -1
  128. package/dist/types/sdk/src/delivery/schema.d.ts +4 -4
  129. package/dist/types/sdk/src/delivery/values.d.ts +6 -6
  130. package/dist/types/sdk/src/delivery.d.ts +3 -3
  131. package/dist/types/sdk/src/i18n.d.ts +11 -11
  132. package/dist/types/sdk/src/integrations.d.ts +10 -10
  133. package/dist/types/sdk/src/{body.d.ts → rich-text.d.ts} +2 -2
  134. package/dist/types/sdk/src/schema.d.ts +5 -21
  135. package/dist/types/sdk/src/site.d.ts +1 -1
  136. package/dist/types/sdk/src/types.d.ts +21 -0
  137. package/dist/{schema-BPHL7Qr-.js → types-B77qvqPJ.js} +5 -4
  138. package/dist/types.d.ts +1 -0
  139. package/dist/types.js +1 -0
  140. package/dist/{typesSource-bO0jFw1I.js → typesSource-CWybQYus.js} +58 -12
  141. package/package.json +12 -12
  142. package/dist/apps-9u4XMi7E.js +0 -114
  143. package/dist/body.d.ts +0 -1
  144. package/dist/embed-R-OvDYAw.js +0 -90
  145. package/dist/model.d.ts +0 -1
  146. package/dist/model.js +0 -345
  147. package/dist/types/analytics/src/index.d.ts +0 -5
  148. package/dist/types/analytics/src/schedule.d.ts +0 -2
  149. package/dist/types/analytics/src/shared.d.ts +0 -21
  150. package/dist/types/analytics/src/source.d.ts +0 -19
  151. package/dist/types/analytics/src/store.d.ts +0 -24
  152. package/dist/types/model/src/brand.d.ts +0 -25
  153. package/dist/types/model/src/legacy.d.ts +0 -2
  154. package/dist/types/model/src/typesSource.d.ts +0 -8
  155. package/dist/types/sdk/src/model.d.ts +0 -5
  156. /package/dist/types/{cms-contract → contract}/src/appProblems.d.ts +0 -0
  157. /package/dist/types/{cms-contract → contract}/src/consents.d.ts +0 -0
  158. /package/dist/types/{cms-contract → contract}/src/customerLabels.d.ts +0 -0
  159. /package/dist/types/{analytics → contract}/src/day.d.ts +0 -0
  160. /package/dist/types/{cms-contract → contract}/src/functionLabels.d.ts +0 -0
  161. /package/dist/types/{cms-contract → contract}/src/permissionLabels.d.ts +0 -0
  162. /package/dist/types/{cms-contract → contract}/src/siteArtifact.d.ts +0 -0
  163. /package/dist/types/{cms-contract → contract}/src/siteDeclaration.d.ts +0 -0
  164. /package/dist/types/{analytics/src/view.d.ts → contract/src/viewEvent.d.ts} +0 -0
  165. /package/dist/types/{cms-contract → contract}/src/views.d.ts +0 -0
  166. /package/dist/types/{cms-contract → contract}/src/webhookLabels.d.ts +0 -0
  167. /package/dist/types/{body → rich-text}/src/components.d.ts +0 -0
  168. /package/dist/types/{body → rich-text}/src/derive.d.ts +0 -0
  169. /package/dist/types/{body → rich-text}/src/description.d.ts +0 -0
  170. /package/dist/types/{body → rich-text}/src/href.d.ts +0 -0
  171. /package/dist/types/{body → rich-text}/src/html.d.ts +0 -0
  172. /package/dist/types/{body → rich-text}/src/index.d.ts +0 -0
  173. /package/dist/types/{body → rich-text}/src/inline.d.ts +0 -0
  174. /package/dist/types/{body → rich-text}/src/labels/en.d.ts +0 -0
  175. /package/dist/types/{body → rich-text}/src/library.d.ts +0 -0
  176. /package/dist/types/{body → rich-text}/src/markdown.d.ts +0 -0
  177. /package/dist/types/{body → rich-text}/src/normalize.d.ts +0 -0
  178. /package/dist/types/{body → rich-text}/src/problems.d.ts +0 -0
  179. /package/dist/types/{body → rich-text}/src/render.d.ts +0 -0
  180. /package/dist/types/{body → rich-text}/src/schema.d.ts +0 -0
  181. /package/dist/types/{body → rich-text}/src/standard.d.ts +0 -0
  182. /package/dist/types/{body → rich-text}/src/types.d.ts +0 -0
  183. /package/dist/types/{model → schema}/src/contact.d.ts +0 -0
  184. /package/dist/types/{model → schema}/src/json.d.ts +0 -0
  185. /package/dist/types/{model → schema}/src/screens.d.ts +0 -0
  186. /package/dist/types/{model → schema}/src/time.d.ts +0 -0
package/dist/analytics.js CHANGED
@@ -1,5 +1,641 @@
1
+ import "./errorLabels-BgtQ_zUn.js";
2
+ import "./apps-BxnJ1RlU.js";
3
+ import "./embeds-B5V54Zur.js";
4
+ import "./customers-DTbL0qn6.js";
1
5
  import { defineEventSchema, isBotUserAgent } from "@ryusenkei/web/analytics";
2
- // ../analytics/src/day.ts
6
+ // ../contract/src/hostingRpc.ts
7
+ const SITE_REF = ["projectId", "assignmentId"];
8
+ /**
9
+ * 運営者の操作ごとの RPC のメソッドと、入力の欄(どれも空でない文字列)
10
+ * method が null の操作はコアのドメインが受ける(tunasand-hosting へは syncHostnames でコピーする)
11
+ */
12
+ const HOSTING_OPERATIONS = {
13
+ stop: {
14
+ method: "stopSite",
15
+ fields: [...SITE_REF, "reason"]
16
+ },
17
+ resume: {
18
+ method: "resumeSite",
19
+ fields: SITE_REF
20
+ },
21
+ reattach: {
22
+ method: "reattachResources",
23
+ fields: SITE_REF
24
+ },
25
+ purge: {
26
+ method: "purgeSiteResources",
27
+ fields: SITE_REF
28
+ },
29
+ hostname_request: {
30
+ method: null,
31
+ fields: [...SITE_REF, "hostname"]
32
+ },
33
+ hostname_verify: {
34
+ method: null,
35
+ fields: [...SITE_REF, "hostname"]
36
+ },
37
+ hostname_status: {
38
+ method: null,
39
+ fields: [...SITE_REF, "hostname"]
40
+ },
41
+ hostname_remove: {
42
+ method: null,
43
+ fields: [...SITE_REF, "hostname"]
44
+ },
45
+ trial_hostname: {
46
+ method: null,
47
+ fields: [...SITE_REF, "name"]
48
+ },
49
+ ack: {
50
+ method: "acknowledgeAlert",
51
+ fields: ["id"]
52
+ }
53
+ };
54
+ Object.keys(HOSTING_OPERATIONS);
55
+ // ../contract/src/legacyAuditLabels.ts
56
+ /** 連携の登録の旧い文の対象の名前(target_type ごと) */
57
+ const LEGACY_REGISTRATION_NAMES = {
58
+ webhook: "Webhook ",
59
+ external_function: "外部関数",
60
+ external_screen: "外の画面"
61
+ };
62
+ const LEGACY_REGISTRATION_SUFFIXES = [
63
+ ["を追加", "integration.create"],
64
+ ["を変更", "integration.update"],
65
+ ["を削除", "integration.delete"],
66
+ ["の署名の鍵を再発行", "integration.rotateSecret"],
67
+ ["の古い署名の鍵を失効", "integration.revokePreviousSecret"]
68
+ ];
69
+ ({ ...Object.fromEntries(Object.values(LEGACY_REGISTRATION_NAMES).flatMap((name) => LEGACY_REGISTRATION_SUFFIXES.map(([suffix, code]) => [`${name}${suffix}`, code]))) });
70
+ // ../contract/src/operatorOperations.ts
71
+ const ov = { screen: "overview" };
72
+ const tab = (t) => ({
73
+ screen: "project",
74
+ tab: t
75
+ });
76
+ /** 操作の全部 */
77
+ const OPERATOR_OPERATIONS = [
78
+ {
79
+ id: "health",
80
+ cli: "health",
81
+ method: "GET",
82
+ path: "/health",
83
+ level: "read",
84
+ place: { screen: "monitoring" },
85
+ available: true
86
+ },
87
+ {
88
+ id: "secrets",
89
+ cli: "secrets",
90
+ method: "GET",
91
+ path: "/secrets",
92
+ level: "read",
93
+ place: { screen: "maintenance" },
94
+ available: true
95
+ },
96
+ {
97
+ id: "migrate",
98
+ cli: "migrate",
99
+ method: "POST",
100
+ path: "/migrate",
101
+ level: "reversible",
102
+ place: { screen: "maintenance" },
103
+ available: true
104
+ },
105
+ {
106
+ id: "session",
107
+ cli: "session",
108
+ method: "GET",
109
+ path: "/session",
110
+ level: "read",
111
+ place: { screen: "account" },
112
+ available: true
113
+ },
114
+ {
115
+ id: "paused",
116
+ cli: "paused",
117
+ method: "GET",
118
+ path: "/paused",
119
+ level: "read",
120
+ place: { screen: "maintenance" },
121
+ available: true
122
+ },
123
+ {
124
+ id: "pause",
125
+ cli: "pause",
126
+ method: "POST",
127
+ path: "/pause",
128
+ level: "heavy",
129
+ place: { screen: "maintenance" },
130
+ available: true
131
+ },
132
+ {
133
+ id: "resume",
134
+ cli: "resume",
135
+ method: "POST",
136
+ path: "/resume",
137
+ level: "reversible",
138
+ place: { screen: "maintenance" },
139
+ available: true
140
+ },
141
+ {
142
+ id: "projects",
143
+ cli: "projects",
144
+ method: "GET",
145
+ path: "/projects",
146
+ level: "read",
147
+ place: { screen: "projects" },
148
+ available: true
149
+ },
150
+ {
151
+ id: "create",
152
+ cli: "create",
153
+ method: "POST",
154
+ path: "/projects",
155
+ level: "reversible",
156
+ place: { screen: "projects" },
157
+ available: true
158
+ },
159
+ {
160
+ id: "hosting",
161
+ cli: "hosting",
162
+ method: "POST",
163
+ path: "/hosting",
164
+ level: "heavy",
165
+ place: { screen: "hosting" },
166
+ available: true
167
+ },
168
+ {
169
+ id: "history",
170
+ cli: "history",
171
+ method: "GET",
172
+ path: "/history",
173
+ level: "read",
174
+ place: { screen: "history" },
175
+ available: true
176
+ },
177
+ {
178
+ id: "standard-apps",
179
+ cli: "standard-apps",
180
+ method: "GET",
181
+ path: "/standard-apps",
182
+ level: "read",
183
+ place: { screen: "apps" },
184
+ available: true
185
+ },
186
+ {
187
+ id: "standard-app-set",
188
+ cli: "standard-app-set",
189
+ method: "POST",
190
+ path: "/standard-apps/{app}",
191
+ level: "heavy",
192
+ place: { screen: "apps" },
193
+ available: true
194
+ },
195
+ {
196
+ id: "standard-app-remove",
197
+ cli: "standard-app-remove",
198
+ method: "POST",
199
+ path: "/standard-apps/{app}/remove",
200
+ level: "heavy",
201
+ place: { screen: "apps" },
202
+ available: true
203
+ },
204
+ {
205
+ id: "apps",
206
+ cli: "apps",
207
+ method: "GET",
208
+ path: "/apps",
209
+ level: "read",
210
+ place: { screen: "apps" },
211
+ available: true
212
+ },
213
+ {
214
+ id: "app-register",
215
+ cli: "app-register",
216
+ method: "POST",
217
+ path: "/apps/{app}",
218
+ level: "heavy",
219
+ place: { screen: "apps" },
220
+ available: true
221
+ },
222
+ {
223
+ id: "app-publish",
224
+ cli: "app-publish",
225
+ method: "POST",
226
+ path: "/apps/{app}/versions",
227
+ level: "heavy",
228
+ place: { screen: "apps" },
229
+ available: true
230
+ },
231
+ {
232
+ id: "app-keys",
233
+ cli: "app-keys",
234
+ method: "POST",
235
+ path: "/apps/{app}/keys",
236
+ level: "heavy",
237
+ place: { screen: "apps" },
238
+ available: true
239
+ },
240
+ {
241
+ id: "registry-backups",
242
+ cli: "backups",
243
+ method: "GET",
244
+ path: "/backups?registry",
245
+ level: "read",
246
+ place: { screen: "maintenance" },
247
+ available: true
248
+ },
249
+ {
250
+ id: "registry-backup",
251
+ cli: "backup",
252
+ method: "POST",
253
+ path: "/backups/registry",
254
+ level: "reversible",
255
+ place: { screen: "maintenance" },
256
+ available: true
257
+ },
258
+ {
259
+ id: "registry-download",
260
+ cli: "backup:download",
261
+ method: "GET",
262
+ path: "/backups/download?registry",
263
+ level: "read",
264
+ place: { screen: "maintenance" },
265
+ available: true
266
+ },
267
+ {
268
+ id: "project",
269
+ cli: "project",
270
+ method: "GET",
271
+ path: "/projects/{project}",
272
+ level: "read",
273
+ place: tab("overview"),
274
+ available: true
275
+ },
276
+ {
277
+ id: "sites",
278
+ method: "GET",
279
+ path: "/projects/{project}/sites",
280
+ level: "read",
281
+ place: tab("hosts"),
282
+ available: true
283
+ },
284
+ {
285
+ id: "project-history",
286
+ cli: "history",
287
+ method: "GET",
288
+ path: "/history?project={project}",
289
+ level: "read",
290
+ place: tab("overview"),
291
+ available: true
292
+ },
293
+ {
294
+ id: "delete-project",
295
+ cli: "delete-project",
296
+ method: "POST",
297
+ path: "/projects/{project}/delete-project",
298
+ level: "irreversible",
299
+ place: tab("overview"),
300
+ available: true
301
+ },
302
+ {
303
+ id: "delete-trial",
304
+ cli: "delete-trial",
305
+ method: "POST",
306
+ path: "/projects/{project}/delete-trial",
307
+ level: "irreversible",
308
+ place: tab("overview"),
309
+ when: "trial",
310
+ available: true
311
+ },
312
+ {
313
+ id: "create-env",
314
+ cli: "create-env",
315
+ method: "POST",
316
+ path: "/projects/{project}/environments",
317
+ level: "reversible",
318
+ place: tab("environments"),
319
+ available: true
320
+ },
321
+ {
322
+ id: "copy-env",
323
+ cli: "copy-env",
324
+ method: "POST",
325
+ path: "/projects/{project}/copy-environment",
326
+ level: "heavy",
327
+ place: tab("environments"),
328
+ available: true
329
+ },
330
+ {
331
+ id: "delete-env",
332
+ cli: "delete-env",
333
+ method: "POST",
334
+ path: "/projects/{project}/delete-environment",
335
+ level: "irreversible",
336
+ place: tab("environments"),
337
+ when: "notLive",
338
+ available: true
339
+ },
340
+ {
341
+ id: "freeze",
342
+ cli: "freeze",
343
+ method: "POST",
344
+ path: "/projects/{project}/freeze",
345
+ level: "heavy",
346
+ place: tab("environments"),
347
+ available: true
348
+ },
349
+ {
350
+ id: "unfreeze",
351
+ cli: "unfreeze",
352
+ method: "POST",
353
+ path: "/projects/{project}/unfreeze",
354
+ level: "reversible",
355
+ place: tab("environments"),
356
+ available: true
357
+ },
358
+ {
359
+ id: "promote-plan",
360
+ cli: "promote-plan",
361
+ method: "POST",
362
+ path: "/projects/{project}/promote-plan",
363
+ level: "read",
364
+ place: tab("environments"),
365
+ when: "notLive",
366
+ available: true
367
+ },
368
+ {
369
+ id: "promote-commit",
370
+ cli: "promote-commit",
371
+ method: "POST",
372
+ path: "/projects/{project}/promote-commit",
373
+ level: "heavy",
374
+ place: tab("environments"),
375
+ when: "notLive",
376
+ available: true
377
+ },
378
+ {
379
+ id: "schema-plan",
380
+ cli: "schema-plan",
381
+ method: "POST",
382
+ path: "/projects/{project}/schema-plan",
383
+ level: "read",
384
+ place: tab("environments"),
385
+ when: "notLive",
386
+ available: true
387
+ },
388
+ {
389
+ id: "schema-commit",
390
+ cli: "schema-commit",
391
+ method: "POST",
392
+ path: "/projects/{project}/schema-commit",
393
+ level: "heavy",
394
+ place: tab("environments"),
395
+ when: "notLive",
396
+ available: true
397
+ },
398
+ {
399
+ id: "prune",
400
+ cli: "prune",
401
+ method: "POST",
402
+ path: "/projects/{project}/prune",
403
+ level: "irreversible",
404
+ place: tab("environments"),
405
+ environment: true,
406
+ dryRun: true,
407
+ available: true
408
+ },
409
+ {
410
+ id: "account-moves",
411
+ cli: "account-moves",
412
+ method: "POST",
413
+ path: "/projects/{project}/account-moves",
414
+ level: "irreversible",
415
+ place: tab("environments"),
416
+ environment: true,
417
+ dryRun: true,
418
+ available: true
419
+ },
420
+ {
421
+ id: "installation-moves",
422
+ cli: "installation-moves",
423
+ method: "POST",
424
+ path: "/projects/{project}/installation-moves",
425
+ level: "irreversible",
426
+ place: tab("environments"),
427
+ environment: true,
428
+ dryRun: true,
429
+ available: true
430
+ },
431
+ {
432
+ id: "standard-app-moves",
433
+ cli: "standard-app-moves",
434
+ method: "POST",
435
+ path: "/projects/{project}/standard-app-moves",
436
+ level: "irreversible",
437
+ place: tab("environments"),
438
+ environment: true,
439
+ dryRun: true,
440
+ available: true
441
+ },
442
+ {
443
+ id: "backups",
444
+ cli: "backups",
445
+ method: "GET",
446
+ path: "/backups?project={project}",
447
+ level: "read",
448
+ place: tab("backups"),
449
+ environment: true,
450
+ available: true
451
+ },
452
+ {
453
+ id: "download",
454
+ cli: "backup:download",
455
+ method: "GET",
456
+ path: "/backups/download?project={project}",
457
+ level: "read",
458
+ place: tab("backups"),
459
+ environment: true,
460
+ available: true
461
+ },
462
+ {
463
+ id: "backup",
464
+ cli: "backup",
465
+ method: "POST",
466
+ path: "/projects/{project}/backup",
467
+ level: "reversible",
468
+ place: tab("backups"),
469
+ environment: true,
470
+ available: true
471
+ },
472
+ {
473
+ id: "restore",
474
+ cli: "restore",
475
+ method: "POST",
476
+ path: "/projects/{project}/restore",
477
+ level: "irreversible",
478
+ place: tab("backups"),
479
+ environment: true,
480
+ dryRun: true,
481
+ available: true
482
+ },
483
+ {
484
+ id: "import",
485
+ cli: "import",
486
+ method: "POST",
487
+ path: "/projects/{project}/import",
488
+ level: "irreversible",
489
+ place: tab("backups"),
490
+ environment: true,
491
+ dryRun: true,
492
+ available: true
493
+ },
494
+ {
495
+ id: "switch-host",
496
+ cli: "switch-host",
497
+ method: "POST",
498
+ path: "/projects/{project}/hosts",
499
+ level: "heavy",
500
+ place: tab("hosts"),
501
+ available: true
502
+ },
503
+ {
504
+ id: "set-host",
505
+ cli: "set-host",
506
+ method: "POST",
507
+ path: "/projects/{project}/hosts",
508
+ level: "heavy",
509
+ place: tab("hosts"),
510
+ available: true
511
+ },
512
+ {
513
+ id: "remove-alias",
514
+ cli: "remove-alias",
515
+ method: "POST",
516
+ path: "/projects/{project}/hosts",
517
+ level: "heavy",
518
+ place: tab("hosts"),
519
+ available: true
520
+ },
521
+ {
522
+ id: "emergency",
523
+ cli: "emergency",
524
+ method: "POST",
525
+ path: "/projects/{project}/emergency",
526
+ level: "heavy",
527
+ place: tab("access"),
528
+ available: true
529
+ },
530
+ {
531
+ id: "revoke-grants",
532
+ cli: "revoke-grants",
533
+ method: "POST",
534
+ path: "/projects/{project}/revoke-grants",
535
+ level: "reversible",
536
+ place: tab("access"),
537
+ environment: true,
538
+ available: true
539
+ },
540
+ {
541
+ id: "api-key-create",
542
+ cli: "api-key-create",
543
+ method: "POST",
544
+ path: "/projects/{project}/api-key-create",
545
+ level: "heavy",
546
+ secret: true,
547
+ place: tab("access"),
548
+ available: true
549
+ },
550
+ {
551
+ id: "test-integration",
552
+ cli: "test-integration",
553
+ method: "POST",
554
+ path: "/projects/{project}/integrations/{registration}/test",
555
+ level: "reversible",
556
+ place: tab("access"),
557
+ available: true
558
+ },
559
+ {
560
+ id: "trial-session",
561
+ cli: "trial-session",
562
+ method: "POST",
563
+ path: "/projects/{project}/trial-session",
564
+ level: "reversible",
565
+ secret: true,
566
+ place: tab("trial"),
567
+ when: "trial",
568
+ environment: true,
569
+ available: true
570
+ },
571
+ {
572
+ id: "organization-create",
573
+ level: "reversible",
574
+ place: { screen: "organizations" },
575
+ available: false
576
+ },
577
+ {
578
+ id: "organization-approve",
579
+ level: "reversible",
580
+ place: { screen: "organizations" },
581
+ available: false
582
+ },
583
+ {
584
+ id: "organization-reject",
585
+ level: "reversible",
586
+ place: { screen: "organizations" },
587
+ available: false
588
+ },
589
+ {
590
+ id: "organization-suspend",
591
+ level: "heavy",
592
+ place: { screen: "organization" },
593
+ available: false
594
+ },
595
+ {
596
+ id: "account-search",
597
+ level: "read",
598
+ place: ov,
599
+ available: false
600
+ },
601
+ {
602
+ id: "app-verify",
603
+ level: "reversible",
604
+ place: { screen: "apps" },
605
+ available: false
606
+ },
607
+ {
608
+ id: "app-unverify",
609
+ level: "reversible",
610
+ place: { screen: "apps" },
611
+ available: false
612
+ },
613
+ {
614
+ id: "app-suspend",
615
+ level: "heavy",
616
+ place: { screen: "apps" },
617
+ available: false
618
+ },
619
+ {
620
+ id: "feature-flags",
621
+ level: "reversible",
622
+ place: { screen: "maintenance" },
623
+ available: false
624
+ },
625
+ {
626
+ id: "history-export",
627
+ level: "read",
628
+ place: { screen: "history" },
629
+ available: false
630
+ }
631
+ ];
632
+ new Map(OPERATOR_OPERATIONS.map((o) => [o.id, o]));
633
+ const patternOf = (path) => new RegExp(`^${path.split("?")[0].replace(/\{\w+\}/g, "[^/]+")}$`);
634
+ OPERATOR_OPERATIONS.flatMap((o) => "path" in o && o.method === "POST" ? [{
635
+ op: o,
636
+ pattern: patternOf(o.path)
637
+ }] : []);
638
+ // ../contract/src/day.ts
3
639
  /** 時間帯 timeZone での日付(YYYY-MM-DD、例: timeZone は Asia/Tokyo) */
4
640
  const dayIn = (timeZone, at = /* @__PURE__ */ new Date()) => new Intl.DateTimeFormat("en-CA", {
5
641
  timeZone,
@@ -7,7 +643,7 @@ const dayIn = (timeZone, at = /* @__PURE__ */ new Date()) => new Intl.DateTimeFo
7
643
  month: "2-digit",
8
644
  day: "2-digit"
9
645
  }).format(at);
10
- // ../analytics/src/view.ts
646
+ // ../contract/src/viewEvent.ts
11
647
  /** 位置で持つ記録先の列の順 */
12
648
  const VIEW_COLUMNS = [
13
649
  "kind",