@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.
- package/CHANGELOG.md +137 -0
- package/README.md +165 -144
- package/dist/analytics.js +183 -109
- package/dist/app.js +276 -166
- package/dist/apps-BysPfMuR.js +408 -0
- package/dist/astro-image.d.ts +1 -0
- package/dist/astro-image.js +33 -0
- package/dist/astro-server-Bwau8F6d.js +99 -0
- package/dist/astro-server.d.ts +1 -0
- package/dist/astro-server.js +1 -0
- package/dist/astro.d.ts +1 -0
- package/dist/astro.js +306 -0
- package/dist/bridge-C2Bl-OAF.js +80 -0
- package/dist/bridge.js +1 -13
- package/dist/build-file-DNi0PHC5.js +31 -0
- package/dist/cli.js +6212 -8
- package/dist/{client-Derrexwr.js → client-C8STAw9T.js} +43 -24
- package/dist/code-N8pBUDbq.js +30 -0
- package/dist/code.d.ts +1 -0
- package/dist/code.js +1 -0
- package/dist/collection-26aglrg6.js +282 -0
- package/dist/{declared-DuNMsdXw.js → declared-CE4a61qb.js} +35 -35
- package/dist/delivery.js +121 -114
- package/dist/dev-operations-Tutwi1On.js +46 -0
- package/dist/dev.js +9 -16
- package/dist/embeds-DY6O5TrJ.js +29 -0
- package/dist/end-users.d.ts +1 -0
- package/dist/end-users.js +189 -0
- package/dist/endUsers-DODfjnv1.js +77 -0
- package/dist/{errorLabels-BgtQ_zUn.js → errorLabels-BK1NJ6Wz.js} +374 -238
- package/dist/i18n.js +4 -4
- package/dist/ids-DmtIoqBX.js +109 -0
- package/dist/integrations.js +95 -24
- package/dist/{ja-Du6ooL6i.js → ja-B3lAaOhZ.js} +91 -45
- package/dist/{ja-CeHU0EaY.js → ja-axQPxMJ-.js} +3 -3
- package/dist/operations-CIB99rIY.js +95 -0
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +1 -0
- package/dist/{page-Bzrj24sJ.js → page-yo1cw1kW.js} +1 -1
- package/dist/paymentPort-p1jV44Zz.js +203 -0
- package/dist/preview.js +8 -1
- package/dist/{profile-1em_lcxq.js → profile-DBsXLvvI.js} +48 -48
- package/dist/rich-text.js +16 -16
- package/dist/{schema-WnobuwLg.js → schema-Bs_BUUNv.js} +526 -265
- package/dist/schema.js +66 -88
- package/dist/types/access/src/handoff.d.ts +19 -14
- package/dist/types/access/src/index.d.ts +2 -2
- package/dist/types/access/src/jws.d.ts +41 -0
- package/dist/types/access/src/oidc.d.ts +12 -2
- package/dist/types/access/src/signed.d.ts +0 -2
- package/dist/types/adapter-cloudflare/src/eventLog/viewSchema.d.ts +11 -0
- package/dist/types/contract/src/accountProfile.d.ts +7 -0
- package/dist/types/contract/src/api/define.d.ts +165 -0
- package/dist/types/contract/src/apiKeys.d.ts +6 -2
- package/dist/types/contract/src/app.d.ts +32 -7
- package/dist/types/contract/src/appChannels.d.ts +152 -0
- package/dist/types/contract/src/appDefinition.d.ts +11 -5
- package/dist/types/contract/src/appDependencies.d.ts +107 -24
- package/dist/types/contract/src/appIdentities.d.ts +21 -0
- package/dist/types/contract/src/appInbound.d.ts +53 -0
- package/dist/types/contract/src/appMail.d.ts +106 -0
- package/dist/types/contract/src/appSecrets.d.ts +63 -0
- package/dist/types/contract/src/appServer.d.ts +460 -45
- package/dist/types/contract/src/approvals.d.ts +1 -1
- package/dist/types/contract/src/apps.d.ts +126 -60
- package/dist/types/contract/src/auditActions.d.ts +2 -2
- package/dist/types/contract/src/auditLabels.d.ts +120 -15
- package/dist/types/contract/src/authorize.d.ts +42 -14
- package/dist/types/contract/src/bridge.d.ts +35 -36
- package/dist/types/contract/src/consents.d.ts +29 -27
- package/dist/types/contract/src/deletion.d.ts +18 -0
- package/dist/types/contract/src/embeds.d.ts +26 -90
- package/dist/types/contract/src/{customerLabels.d.ts → endUserLabels.d.ts} +6 -9
- package/dist/types/contract/src/endUsers.d.ts +244 -0
- package/dist/types/contract/src/errorLabels.d.ts +67 -37
- package/dist/types/contract/src/errorLabelsEn.d.ts +50 -33
- package/dist/types/contract/src/errors.d.ts +28 -16
- package/dist/types/contract/src/eventSchemas.d.ts +70 -0
- package/dist/types/contract/src/eventTraces.d.ts +41 -0
- package/dist/types/contract/src/failureStatus.d.ts +14 -22
- package/dist/types/contract/src/fieldAccess.d.ts +8 -8
- package/dist/types/contract/src/formLabels.d.ts +3 -0
- package/dist/types/contract/src/forms.d.ts +4 -0
- package/dist/types/contract/src/grants.d.ts +26 -0
- package/dist/types/contract/src/headers.d.ts +5 -0
- package/dist/types/contract/src/hostingRpc.d.ts +44 -19
- package/dist/types/contract/src/identifiers.d.ts +45 -17
- package/dist/types/contract/src/ids.d.ts +18 -10
- package/dist/types/contract/src/import.d.ts +17 -16
- package/dist/types/contract/src/index.d.ts +57 -29
- package/dist/types/contract/src/integrationGraph.d.ts +83 -0
- package/dist/types/contract/src/issueLabels.d.ts +121 -81
- package/dist/types/contract/src/issueLabelsEn.d.ts +61 -41
- package/dist/types/contract/src/manage.d.ts +16 -7
- package/dist/types/contract/src/manageLabels.d.ts +2 -0
- package/dist/types/contract/src/manifestText.d.ts +66 -0
- package/dist/types/contract/src/messagePort.d.ts +208 -0
- package/dist/types/contract/src/migration.d.ts +2 -2
- package/dist/types/contract/src/notices.d.ts +37 -0
- package/dist/types/contract/src/operationEffects.d.ts +39 -0
- package/dist/types/contract/src/operatorOperations.d.ts +104 -110
- package/dist/types/contract/src/outbound.d.ts +29 -0
- package/dist/types/contract/src/paths.d.ts +13 -0
- package/dist/types/contract/src/paymentPort.d.ts +129 -0
- package/dist/types/contract/src/pending.d.ts +2 -0
- package/dist/types/contract/src/permissions.d.ts +7 -11
- package/dist/types/contract/src/perspective.d.ts +26 -0
- package/dist/types/contract/src/powers.d.ts +5 -0
- package/dist/types/contract/src/principal.d.ts +127 -56
- package/dist/types/contract/src/readPages.d.ts +92 -0
- package/dist/types/contract/src/recordLabels.d.ts +6 -0
- package/dist/types/contract/src/roles.d.ts +7 -4
- package/dist/types/contract/src/ruleLabels.d.ts +16 -0
- package/dist/types/contract/src/ruleProblems.d.ts +16 -0
- package/dist/types/contract/src/schemaLabels.d.ts +8 -0
- package/dist/types/contract/src/settingProblems.d.ts +18 -1
- package/dist/types/contract/src/settings.d.ts +5 -7
- package/dist/types/contract/src/siteDeclaration.d.ts +7 -7
- package/dist/types/contract/src/siteIndex.d.ts +76 -0
- package/dist/types/contract/src/transfer.d.ts +1 -1
- package/dist/types/contract/src/trial.d.ts +4 -1
- package/dist/types/contract/src/versions.d.ts +1 -3
- package/dist/types/contract/src/viewEvent.d.ts +0 -9
- package/dist/types/contract/src/webhooks.d.ts +24 -3
- package/dist/types/contract/src/workflow.d.ts +16 -19
- package/dist/types/contract/src/workspaceItems.d.ts +23 -7
- package/dist/types/contract/src/workspacePaths.d.ts +1 -1
- package/dist/types/rich-text/src/html.d.ts +1 -1
- package/dist/types/rich-text/src/index.d.ts +8 -7
- package/dist/types/rich-text/src/labels/en.d.ts +1 -1
- package/dist/types/rich-text/src/labels/ja.d.ts +2 -2
- package/dist/types/rich-text/src/library.d.ts +1 -1
- package/dist/types/rich-text/src/media.d.ts +2 -0
- package/dist/types/rich-text/src/normalize.d.ts +1 -1
- package/dist/types/rich-text/src/problems.d.ts +5 -5
- package/dist/types/rich-text/src/profile.d.ts +10 -10
- package/dist/types/rich-text/src/render.d.ts +1 -1
- package/dist/types/rich-text/src/schema.d.ts +2 -2
- package/dist/types/rich-text/src/standard.d.ts +4 -4
- package/dist/types/rich-text/src/types.d.ts +2 -2
- package/dist/types/schema/src/audience.d.ts +1 -3
- package/dist/types/schema/src/capabilities.d.ts +18 -27
- package/dist/types/schema/src/changes.d.ts +3 -1
- package/dist/types/schema/src/collection.d.ts +142 -111
- package/dist/types/schema/src/defaultSchema.d.ts +8 -2
- package/dist/types/schema/src/fieldIds.d.ts +18 -0
- package/dist/types/schema/src/file.d.ts +24 -11
- package/dist/types/schema/src/fileRefs.d.ts +14 -0
- package/dist/types/schema/src/fileSignature.d.ts +20 -0
- package/dist/types/schema/src/filesCollection.d.ts +7 -0
- package/dist/types/schema/src/forms.d.ts +43 -0
- package/dist/types/schema/src/imageMetadata.d.ts +9 -0
- package/dist/types/schema/src/index.d.ts +19 -10
- package/dist/types/schema/src/indexes.d.ts +11 -0
- package/dist/types/schema/src/input.d.ts +1 -1
- package/dist/types/schema/src/integrity.d.ts +8 -7
- package/dist/types/schema/src/kinds.d.ts +26 -0
- package/dist/types/schema/src/labels/en.d.ts +89 -46
- package/dist/types/schema/src/labels/ja.d.ts +92 -46
- package/dist/types/schema/src/mediaUrl.d.ts +26 -33
- package/dist/types/schema/src/page.d.ts +4 -4
- package/dist/types/schema/src/problems.d.ts +85 -42
- package/dist/types/schema/src/refs.d.ts +0 -9
- package/dist/types/schema/src/schema.d.ts +17 -12
- package/dist/types/schema/src/selfOps.d.ts +20 -19
- package/dist/types/schema/src/traits.d.ts +28 -0
- package/dist/types/schema/src/typesSource.d.ts +1 -1
- package/dist/types/schema/src/values.d.ts +5 -2
- package/dist/types/schema/src/widening.d.ts +3 -0
- package/dist/types/sdk/src/analytics.d.ts +2 -1
- package/dist/types/sdk/src/app.d.ts +43 -14
- package/dist/types/sdk/src/astro-image.d.ts +19 -0
- package/dist/types/sdk/src/astro-response.d.ts +6 -0
- package/dist/types/sdk/src/astro-server.d.ts +16 -0
- package/dist/types/sdk/src/astro.d.ts +19 -0
- package/dist/types/sdk/src/bridge.d.ts +2 -4
- package/dist/types/sdk/src/code.d.ts +61 -0
- package/dist/types/sdk/src/delegation.d.ts +13 -3
- package/dist/types/sdk/src/delivery/changes.d.ts +4 -4
- package/dist/types/sdk/src/delivery/client.d.ts +33 -22
- package/dist/types/sdk/src/delivery/fields.d.ts +3 -3
- package/dist/types/sdk/src/delivery/index.d.ts +3 -3
- package/dist/types/sdk/src/delivery/media.d.ts +5 -8
- package/dist/types/sdk/src/delivery/query.d.ts +15 -11
- package/dist/types/sdk/src/delivery/schema.d.ts +1 -1
- package/dist/types/sdk/src/delivery/values.d.ts +10 -14
- package/dist/types/sdk/src/delivery.d.ts +2 -2
- package/dist/types/sdk/src/dev-operations.d.ts +20 -0
- package/dist/types/sdk/src/dev.d.ts +6 -5
- package/dist/types/sdk/src/end-users.d.ts +187 -0
- package/dist/types/sdk/src/i18n.d.ts +2 -2
- package/dist/types/sdk/src/integrations.d.ts +14 -21
- package/dist/types/sdk/src/operations.d.ts +17 -0
- package/dist/types/sdk/src/preview.d.ts +2 -1
- package/dist/types/sdk/src/rich-text.d.ts +2 -2
- package/dist/types/sdk/src/schema.d.ts +1 -1
- package/dist/types/sdk/src/site/artifact.d.ts +64 -0
- package/dist/types/sdk/src/site/build-file.d.ts +30 -0
- package/dist/types/sdk/src/site/check-code.d.ts +14 -0
- package/dist/types/sdk/src/site/check-text.d.ts +19 -0
- package/dist/types/sdk/src/site/cli.d.ts +52 -0
- package/dist/types/sdk/src/site/content-type.d.ts +2 -0
- package/dist/types/sdk/src/site/labels.d.ts +14 -0
- package/dist/types/sdk/src/types.d.ts +1 -1
- package/dist/{types-B77qvqPJ.js → types-CYnY-63C.js} +5 -6
- package/dist/types.js +1 -1
- package/dist/{typesSource-CWybQYus.js → typesSource-BTA9-rcB.js} +17 -15
- package/package.json +32 -6
- package/dist/apps-BxnJ1RlU.js +0 -435
- package/dist/bridge-DtHw9hS6.js +0 -74
- package/dist/collection-BEOxeISR.js +0 -189
- package/dist/customers-DTbL0qn6.js +0 -86
- package/dist/customers.d.ts +0 -1
- package/dist/customers.js +0 -185
- package/dist/embeds-B5V54Zur.js +0 -34
- package/dist/ids--RF7hGyC.js +0 -36
- package/dist/src-sazhzYui.js +0 -71
- package/dist/types/contract/src/customers.d.ts +0 -266
- package/dist/types/schema/src/legacy.d.ts +0 -2
- package/dist/types/schema/src/media.d.ts +0 -5
- package/dist/types/sdk/src/customers.d.ts +0 -184
package/dist/analytics.js
CHANGED
|
@@ -1,53 +1,88 @@
|
|
|
1
|
-
import "./errorLabels-
|
|
2
|
-
import "./apps-
|
|
3
|
-
import "./embeds-
|
|
4
|
-
import "./
|
|
1
|
+
import "./errorLabels-BK1NJ6Wz.js";
|
|
2
|
+
import { f as ACTOR_KINDS } from "./apps-BysPfMuR.js";
|
|
3
|
+
import "./embeds-DY6O5TrJ.js";
|
|
4
|
+
import "./bridge-C2Bl-OAF.js";
|
|
5
|
+
import { a as END_USER_STATUSES, i as END_USER_EVENTS } from "./endUsers-DODfjnv1.js";
|
|
6
|
+
import { m as IMPORT_EVENTS } from "./paymentPort-p1jV44Zz.js";
|
|
7
|
+
import { l as schemaProblemText } from "./schema-Bs_BUUNv.js";
|
|
8
|
+
import { z } from "zod";
|
|
5
9
|
import { defineEventSchema, isBotUserAgent } from "@ryusenkei/web/analytics";
|
|
10
|
+
// ../contract/src/webhooks.ts
|
|
11
|
+
/** 送れる操作(公開・非公開と、データの変更の作成・更新・削除) */
|
|
12
|
+
const WEBHOOK_ACTIONS = [
|
|
13
|
+
"published",
|
|
14
|
+
"unpublished",
|
|
15
|
+
"created",
|
|
16
|
+
"updated",
|
|
17
|
+
"deleted"
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* インストールのイベント(購読によらず送る)
|
|
21
|
+
* - deleted: アンインストールの最後の知らせ。そのインストールの Webhook(止めた後も、このイベントだけ)と、アプリの削除のエンドポイントへ
|
|
22
|
+
*/
|
|
23
|
+
const INSTALLATION_EVENTS = { deleted: "installation.deleted" };
|
|
24
|
+
/** レコードのイベントの短い名前 */
|
|
25
|
+
const webhookRecordTypeOf = (action) => `record.${action}`;
|
|
26
|
+
// ../contract/src/forms.ts
|
|
27
|
+
/** フォームのイベント(送信の値を持たない薄い本文) */
|
|
28
|
+
const FORM_EVENTS = { submitted: "form.submitted" };
|
|
6
29
|
// ../contract/src/hostingRpc.ts
|
|
7
30
|
const SITE_REF = ["projectId", "assignmentId"];
|
|
8
31
|
/**
|
|
9
|
-
* 運営者の操作ごとの RPC
|
|
10
|
-
*
|
|
32
|
+
* 運営者の操作ごとの RPC のメソッド、経路の操作の名前(verb)、入力の欄(どれも空でない文字列)
|
|
33
|
+
* - 経路: サイトの操作は運営者の API の `/projects/{projectId}/sites/{assignmentId}:<verb>`
|
|
34
|
+
* 知らせの確認は `/hosting/alerts/{id}:<verb>`。残りの欄は本文
|
|
35
|
+
* - method が null の操作はコアのドメインが受ける(tunasand-hosting へは syncHostnames でコピーする)
|
|
11
36
|
*/
|
|
12
37
|
const HOSTING_OPERATIONS = {
|
|
13
38
|
stop: {
|
|
14
39
|
method: "stopSite",
|
|
40
|
+
verb: "stop",
|
|
15
41
|
fields: [...SITE_REF, "reason"]
|
|
16
42
|
},
|
|
17
43
|
resume: {
|
|
18
44
|
method: "resumeSite",
|
|
45
|
+
verb: "resume",
|
|
19
46
|
fields: SITE_REF
|
|
20
47
|
},
|
|
21
48
|
reattach: {
|
|
22
49
|
method: "reattachResources",
|
|
50
|
+
verb: "reattach",
|
|
23
51
|
fields: SITE_REF
|
|
24
52
|
},
|
|
25
53
|
purge: {
|
|
26
54
|
method: "purgeSiteResources",
|
|
55
|
+
verb: "purge",
|
|
27
56
|
fields: SITE_REF
|
|
28
57
|
},
|
|
29
58
|
hostname_request: {
|
|
30
59
|
method: null,
|
|
60
|
+
verb: "request-hostname",
|
|
31
61
|
fields: [...SITE_REF, "hostname"]
|
|
32
62
|
},
|
|
33
63
|
hostname_verify: {
|
|
34
64
|
method: null,
|
|
65
|
+
verb: "verify-hostname",
|
|
35
66
|
fields: [...SITE_REF, "hostname"]
|
|
36
67
|
},
|
|
37
68
|
hostname_status: {
|
|
38
69
|
method: null,
|
|
70
|
+
verb: "check-hostname",
|
|
39
71
|
fields: [...SITE_REF, "hostname"]
|
|
40
72
|
},
|
|
41
73
|
hostname_remove: {
|
|
42
74
|
method: null,
|
|
75
|
+
verb: "remove-hostname",
|
|
43
76
|
fields: [...SITE_REF, "hostname"]
|
|
44
77
|
},
|
|
45
78
|
trial_hostname: {
|
|
46
79
|
method: null,
|
|
80
|
+
verb: "set-trial-hostname",
|
|
47
81
|
fields: [...SITE_REF, "name"]
|
|
48
82
|
},
|
|
49
83
|
ack: {
|
|
50
84
|
method: "acknowledgeAlert",
|
|
85
|
+
verb: "acknowledge",
|
|
51
86
|
fields: ["id"]
|
|
52
87
|
}
|
|
53
88
|
};
|
|
@@ -85,21 +120,39 @@ const OPERATOR_OPERATIONS = [
|
|
|
85
120
|
available: true
|
|
86
121
|
},
|
|
87
122
|
{
|
|
88
|
-
id: "
|
|
89
|
-
cli: "
|
|
123
|
+
id: "migrate",
|
|
124
|
+
cli: "migrate",
|
|
125
|
+
method: "POST",
|
|
126
|
+
path: "/registry:migrate",
|
|
127
|
+
level: "reversible",
|
|
128
|
+
place: { screen: "maintenance" },
|
|
129
|
+
available: true
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "one-time-targets",
|
|
90
133
|
method: "GET",
|
|
91
|
-
path: "/
|
|
134
|
+
path: "/one-time",
|
|
92
135
|
level: "read",
|
|
93
136
|
place: { screen: "maintenance" },
|
|
94
137
|
available: true
|
|
95
138
|
},
|
|
96
139
|
{
|
|
97
|
-
id: "
|
|
98
|
-
cli: "migrate",
|
|
140
|
+
id: "one-time",
|
|
99
141
|
method: "POST",
|
|
100
|
-
path: "/
|
|
142
|
+
path: "/projects/{project}:run-one-time",
|
|
101
143
|
level: "reversible",
|
|
102
|
-
place:
|
|
144
|
+
place: tab("environments"),
|
|
145
|
+
environment: true,
|
|
146
|
+
available: true
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: "secrets",
|
|
150
|
+
cli: "secrets",
|
|
151
|
+
method: "GET",
|
|
152
|
+
path: "/projects/{project}/secrets",
|
|
153
|
+
level: "read",
|
|
154
|
+
place: tab("environments"),
|
|
155
|
+
environment: true,
|
|
103
156
|
available: true
|
|
104
157
|
},
|
|
105
158
|
{
|
|
@@ -115,7 +168,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
115
168
|
id: "paused",
|
|
116
169
|
cli: "paused",
|
|
117
170
|
method: "GET",
|
|
118
|
-
path: "/
|
|
171
|
+
path: "/registry",
|
|
119
172
|
level: "read",
|
|
120
173
|
place: { screen: "maintenance" },
|
|
121
174
|
available: true
|
|
@@ -124,7 +177,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
124
177
|
id: "pause",
|
|
125
178
|
cli: "pause",
|
|
126
179
|
method: "POST",
|
|
127
|
-
path: "/pause",
|
|
180
|
+
path: "/registry:pause",
|
|
128
181
|
level: "heavy",
|
|
129
182
|
place: { screen: "maintenance" },
|
|
130
183
|
available: true
|
|
@@ -133,7 +186,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
133
186
|
id: "resume",
|
|
134
187
|
cli: "resume",
|
|
135
188
|
method: "POST",
|
|
136
|
-
path: "/resume",
|
|
189
|
+
path: "/registry:resume",
|
|
137
190
|
level: "reversible",
|
|
138
191
|
place: { screen: "maintenance" },
|
|
139
192
|
available: true
|
|
@@ -147,6 +200,23 @@ const OPERATOR_OPERATIONS = [
|
|
|
147
200
|
place: { screen: "projects" },
|
|
148
201
|
available: true
|
|
149
202
|
},
|
|
203
|
+
{
|
|
204
|
+
id: "organizations",
|
|
205
|
+
cli: "organizations",
|
|
206
|
+
method: "GET",
|
|
207
|
+
path: "/organizations",
|
|
208
|
+
level: "read",
|
|
209
|
+
place: { screen: "organizations" },
|
|
210
|
+
available: true
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: "organization-sync",
|
|
214
|
+
method: "POST",
|
|
215
|
+
path: "/organizations:sync",
|
|
216
|
+
level: "read",
|
|
217
|
+
place: { screen: "organizations" },
|
|
218
|
+
available: true
|
|
219
|
+
},
|
|
150
220
|
{
|
|
151
221
|
id: "create",
|
|
152
222
|
cli: "create",
|
|
@@ -159,8 +229,6 @@ const OPERATOR_OPERATIONS = [
|
|
|
159
229
|
{
|
|
160
230
|
id: "hosting",
|
|
161
231
|
cli: "hosting",
|
|
162
|
-
method: "POST",
|
|
163
|
-
path: "/hosting",
|
|
164
232
|
level: "heavy",
|
|
165
233
|
place: { screen: "hosting" },
|
|
166
234
|
available: true
|
|
@@ -183,6 +251,14 @@ const OPERATOR_OPERATIONS = [
|
|
|
183
251
|
place: { screen: "apps" },
|
|
184
252
|
available: true
|
|
185
253
|
},
|
|
254
|
+
{
|
|
255
|
+
id: "standard-app-candidates",
|
|
256
|
+
method: "GET",
|
|
257
|
+
path: "/standard-app-candidates",
|
|
258
|
+
level: "read",
|
|
259
|
+
place: { screen: "apps" },
|
|
260
|
+
available: true
|
|
261
|
+
},
|
|
186
262
|
{
|
|
187
263
|
id: "standard-app-set",
|
|
188
264
|
cli: "standard-app-set",
|
|
@@ -195,8 +271,8 @@ const OPERATOR_OPERATIONS = [
|
|
|
195
271
|
{
|
|
196
272
|
id: "standard-app-remove",
|
|
197
273
|
cli: "standard-app-remove",
|
|
198
|
-
method: "
|
|
199
|
-
path: "/standard-apps/{app}
|
|
274
|
+
method: "DELETE",
|
|
275
|
+
path: "/standard-apps/{app}",
|
|
200
276
|
level: "heavy",
|
|
201
277
|
place: { screen: "apps" },
|
|
202
278
|
available: true
|
|
@@ -232,7 +308,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
232
308
|
id: "app-keys",
|
|
233
309
|
cli: "app-keys",
|
|
234
310
|
method: "POST",
|
|
235
|
-
path: "/apps/{app}
|
|
311
|
+
path: "/apps/{app}:set-keys",
|
|
236
312
|
level: "heavy",
|
|
237
313
|
place: { screen: "apps" },
|
|
238
314
|
available: true
|
|
@@ -250,7 +326,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
250
326
|
id: "registry-backup",
|
|
251
327
|
cli: "backup",
|
|
252
328
|
method: "POST",
|
|
253
|
-
path: "/backups
|
|
329
|
+
path: "/backups:registry",
|
|
254
330
|
level: "reversible",
|
|
255
331
|
place: { screen: "maintenance" },
|
|
256
332
|
available: true
|
|
@@ -259,7 +335,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
259
335
|
id: "registry-download",
|
|
260
336
|
cli: "backup:download",
|
|
261
337
|
method: "GET",
|
|
262
|
-
path: "/backups/download?registry",
|
|
338
|
+
path: "/backups/{backup}:download?registry",
|
|
263
339
|
level: "read",
|
|
264
340
|
place: { screen: "maintenance" },
|
|
265
341
|
available: true
|
|
@@ -293,8 +369,8 @@ const OPERATOR_OPERATIONS = [
|
|
|
293
369
|
{
|
|
294
370
|
id: "delete-project",
|
|
295
371
|
cli: "delete-project",
|
|
296
|
-
method: "
|
|
297
|
-
path: "/projects/{project}
|
|
372
|
+
method: "DELETE",
|
|
373
|
+
path: "/projects/{project}",
|
|
298
374
|
level: "irreversible",
|
|
299
375
|
place: tab("overview"),
|
|
300
376
|
available: true
|
|
@@ -302,8 +378,8 @@ const OPERATOR_OPERATIONS = [
|
|
|
302
378
|
{
|
|
303
379
|
id: "delete-trial",
|
|
304
380
|
cli: "delete-trial",
|
|
305
|
-
method: "
|
|
306
|
-
path: "/projects/{project}
|
|
381
|
+
method: "DELETE",
|
|
382
|
+
path: "/projects/{project}",
|
|
307
383
|
level: "irreversible",
|
|
308
384
|
place: tab("overview"),
|
|
309
385
|
when: "trial",
|
|
@@ -322,7 +398,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
322
398
|
id: "copy-env",
|
|
323
399
|
cli: "copy-env",
|
|
324
400
|
method: "POST",
|
|
325
|
-
path: "/projects/{project}/copy
|
|
401
|
+
path: "/projects/{project}/environments:copy",
|
|
326
402
|
level: "heavy",
|
|
327
403
|
place: tab("environments"),
|
|
328
404
|
available: true
|
|
@@ -330,8 +406,8 @@ const OPERATOR_OPERATIONS = [
|
|
|
330
406
|
{
|
|
331
407
|
id: "delete-env",
|
|
332
408
|
cli: "delete-env",
|
|
333
|
-
method: "
|
|
334
|
-
path: "/projects/{project}/
|
|
409
|
+
method: "DELETE",
|
|
410
|
+
path: "/projects/{project}/environments/{environment}",
|
|
335
411
|
level: "irreversible",
|
|
336
412
|
place: tab("environments"),
|
|
337
413
|
when: "notLive",
|
|
@@ -341,7 +417,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
341
417
|
id: "freeze",
|
|
342
418
|
cli: "freeze",
|
|
343
419
|
method: "POST",
|
|
344
|
-
path: "/projects/{project}
|
|
420
|
+
path: "/projects/{project}:freeze",
|
|
345
421
|
level: "heavy",
|
|
346
422
|
place: tab("environments"),
|
|
347
423
|
available: true
|
|
@@ -350,7 +426,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
350
426
|
id: "unfreeze",
|
|
351
427
|
cli: "unfreeze",
|
|
352
428
|
method: "POST",
|
|
353
|
-
path: "/projects/{project}
|
|
429
|
+
path: "/projects/{project}:unfreeze",
|
|
354
430
|
level: "reversible",
|
|
355
431
|
place: tab("environments"),
|
|
356
432
|
available: true
|
|
@@ -359,7 +435,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
359
435
|
id: "promote-plan",
|
|
360
436
|
cli: "promote-plan",
|
|
361
437
|
method: "POST",
|
|
362
|
-
path: "/projects/{project}
|
|
438
|
+
path: "/projects/{project}:plan-promotion",
|
|
363
439
|
level: "read",
|
|
364
440
|
place: tab("environments"),
|
|
365
441
|
when: "notLive",
|
|
@@ -369,27 +445,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
369
445
|
id: "promote-commit",
|
|
370
446
|
cli: "promote-commit",
|
|
371
447
|
method: "POST",
|
|
372
|
-
path: "/projects/{project}
|
|
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",
|
|
448
|
+
path: "/projects/{project}:promote",
|
|
393
449
|
level: "heavy",
|
|
394
450
|
place: tab("environments"),
|
|
395
451
|
when: "notLive",
|
|
@@ -399,40 +455,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
399
455
|
id: "prune",
|
|
400
456
|
cli: "prune",
|
|
401
457
|
method: "POST",
|
|
402
|
-
path: "/projects/{project}
|
|
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",
|
|
458
|
+
path: "/projects/{project}:prune",
|
|
436
459
|
level: "irreversible",
|
|
437
460
|
place: tab("environments"),
|
|
438
461
|
environment: true,
|
|
@@ -453,7 +476,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
453
476
|
id: "download",
|
|
454
477
|
cli: "backup:download",
|
|
455
478
|
method: "GET",
|
|
456
|
-
path: "/backups/download?project={project}",
|
|
479
|
+
path: "/backups/{backup}:download?project={project}",
|
|
457
480
|
level: "read",
|
|
458
481
|
place: tab("backups"),
|
|
459
482
|
environment: true,
|
|
@@ -463,7 +486,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
463
486
|
id: "backup",
|
|
464
487
|
cli: "backup",
|
|
465
488
|
method: "POST",
|
|
466
|
-
path: "/projects/{project}
|
|
489
|
+
path: "/projects/{project}:backup",
|
|
467
490
|
level: "reversible",
|
|
468
491
|
place: tab("backups"),
|
|
469
492
|
environment: true,
|
|
@@ -473,7 +496,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
473
496
|
id: "restore",
|
|
474
497
|
cli: "restore",
|
|
475
498
|
method: "POST",
|
|
476
|
-
path: "/projects/{project}
|
|
499
|
+
path: "/projects/{project}:restore",
|
|
477
500
|
level: "irreversible",
|
|
478
501
|
place: tab("backups"),
|
|
479
502
|
environment: true,
|
|
@@ -484,7 +507,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
484
507
|
id: "import",
|
|
485
508
|
cli: "import",
|
|
486
509
|
method: "POST",
|
|
487
|
-
path: "/projects/{project}
|
|
510
|
+
path: "/projects/{project}:import",
|
|
488
511
|
level: "irreversible",
|
|
489
512
|
place: tab("backups"),
|
|
490
513
|
environment: true,
|
|
@@ -495,7 +518,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
495
518
|
id: "switch-host",
|
|
496
519
|
cli: "switch-host",
|
|
497
520
|
method: "POST",
|
|
498
|
-
path: "/projects/{project}/hosts",
|
|
521
|
+
path: "/projects/{project}/hosts:switch",
|
|
499
522
|
level: "heavy",
|
|
500
523
|
place: tab("hosts"),
|
|
501
524
|
available: true
|
|
@@ -504,7 +527,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
504
527
|
id: "set-host",
|
|
505
528
|
cli: "set-host",
|
|
506
529
|
method: "POST",
|
|
507
|
-
path: "/projects/{project}/hosts",
|
|
530
|
+
path: "/projects/{project}/hosts:replace",
|
|
508
531
|
level: "heavy",
|
|
509
532
|
place: tab("hosts"),
|
|
510
533
|
available: true
|
|
@@ -513,7 +536,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
513
536
|
id: "remove-alias",
|
|
514
537
|
cli: "remove-alias",
|
|
515
538
|
method: "POST",
|
|
516
|
-
path: "/projects/{project}/hosts",
|
|
539
|
+
path: "/projects/{project}/hosts:remove-alias",
|
|
517
540
|
level: "heavy",
|
|
518
541
|
place: tab("hosts"),
|
|
519
542
|
available: true
|
|
@@ -522,7 +545,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
522
545
|
id: "emergency",
|
|
523
546
|
cli: "emergency",
|
|
524
547
|
method: "POST",
|
|
525
|
-
path: "/projects/{project}
|
|
548
|
+
path: "/projects/{project}:emergency",
|
|
526
549
|
level: "heavy",
|
|
527
550
|
place: tab("access"),
|
|
528
551
|
available: true
|
|
@@ -531,7 +554,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
531
554
|
id: "revoke-grants",
|
|
532
555
|
cli: "revoke-grants",
|
|
533
556
|
method: "POST",
|
|
534
|
-
path: "/projects/{project}
|
|
557
|
+
path: "/projects/{project}:revoke-grants",
|
|
535
558
|
level: "reversible",
|
|
536
559
|
place: tab("access"),
|
|
537
560
|
environment: true,
|
|
@@ -541,17 +564,26 @@ const OPERATOR_OPERATIONS = [
|
|
|
541
564
|
id: "api-key-create",
|
|
542
565
|
cli: "api-key-create",
|
|
543
566
|
method: "POST",
|
|
544
|
-
path: "/projects/{project}/api-
|
|
567
|
+
path: "/projects/{project}/api-keys",
|
|
545
568
|
level: "heavy",
|
|
546
569
|
secret: true,
|
|
547
570
|
place: tab("access"),
|
|
548
571
|
available: true
|
|
549
572
|
},
|
|
573
|
+
{
|
|
574
|
+
id: "channel-key",
|
|
575
|
+
cli: "channel-key",
|
|
576
|
+
method: "POST",
|
|
577
|
+
path: "/projects/{project}:issue-channel-key",
|
|
578
|
+
level: "heavy",
|
|
579
|
+
place: tab("access"),
|
|
580
|
+
available: true
|
|
581
|
+
},
|
|
550
582
|
{
|
|
551
583
|
id: "test-integration",
|
|
552
584
|
cli: "test-integration",
|
|
553
585
|
method: "POST",
|
|
554
|
-
path: "/projects/{project}/integrations/{registration}
|
|
586
|
+
path: "/projects/{project}/integrations/{registration}:test",
|
|
555
587
|
level: "reversible",
|
|
556
588
|
place: tab("access"),
|
|
557
589
|
available: true
|
|
@@ -560,7 +592,7 @@ const OPERATOR_OPERATIONS = [
|
|
|
560
592
|
id: "trial-session",
|
|
561
593
|
cli: "trial-session",
|
|
562
594
|
method: "POST",
|
|
563
|
-
path: "/projects/{project}
|
|
595
|
+
path: "/projects/{project}:start-trial-session",
|
|
564
596
|
level: "reversible",
|
|
565
597
|
secret: true,
|
|
566
598
|
place: tab("trial"),
|
|
@@ -631,8 +663,9 @@ const OPERATOR_OPERATIONS = [
|
|
|
631
663
|
];
|
|
632
664
|
new Map(OPERATOR_OPERATIONS.map((o) => [o.id, o]));
|
|
633
665
|
const patternOf = (path) => new RegExp(`^${path.split("?")[0].replace(/\{\w+\}/g, "[^/]+")}$`);
|
|
634
|
-
OPERATOR_OPERATIONS.flatMap((o) => "path" in o && o.method
|
|
666
|
+
OPERATOR_OPERATIONS.flatMap((o) => "path" in o && o.method !== "GET" ? [{
|
|
635
667
|
op: o,
|
|
668
|
+
method: o.method,
|
|
636
669
|
pattern: patternOf(o.path)
|
|
637
670
|
}] : []);
|
|
638
671
|
// ../contract/src/day.ts
|
|
@@ -653,14 +686,6 @@ const VIEW_COLUMNS = [
|
|
|
653
686
|
"event",
|
|
654
687
|
"project"
|
|
655
688
|
];
|
|
656
|
-
/**
|
|
657
|
-
* 閲覧のイベントの形(toolkit の analyticsEngineRecorder・analyticsEngineCounts に渡す)
|
|
658
|
-
* - index: プロジェクト、指定なしは種類(Analytics Engine は index ごとに標本を抽出するため、共有のデータセットで小さなプロジェクトの記録が間引かれないように)
|
|
659
|
-
*/
|
|
660
|
-
const VIEW_SCHEMA = defineEventSchema({
|
|
661
|
-
blobs: VIEW_COLUMNS,
|
|
662
|
-
index: (view) => view.project ?? view.kind ?? ""
|
|
663
|
-
});
|
|
664
689
|
/** 閲覧のイベント(対象: GET で応答が200の HTML・ボット以外、ほかは null) */
|
|
665
690
|
function viewOf(request, response, { classify, timeZone, project }) {
|
|
666
691
|
if (request.method !== "GET" || response.status !== 200) return null;
|
|
@@ -676,4 +701,53 @@ function viewOf(request, response, { classify, timeZone, project }) {
|
|
|
676
701
|
...project !== void 0 && { project }
|
|
677
702
|
};
|
|
678
703
|
}
|
|
704
|
+
schemaProblemText("date_time_invalid");
|
|
705
|
+
// ../contract/src/eventSchemas.ts
|
|
706
|
+
const id = z.string();
|
|
707
|
+
const ref = z.object({ id });
|
|
708
|
+
/** レコードのイベントの data(record.<操作> と form.submitted。説明は WebhookRecordData) */
|
|
709
|
+
const RECORD_EVENT_DATA = z.object({
|
|
710
|
+
environment: id,
|
|
711
|
+
collection: z.object({
|
|
712
|
+
id,
|
|
713
|
+
slug: z.string().nullable()
|
|
714
|
+
}),
|
|
715
|
+
record: z.object({
|
|
716
|
+
id,
|
|
717
|
+
slug: z.string(),
|
|
718
|
+
previous_slug: z.string().optional()
|
|
719
|
+
})
|
|
720
|
+
});
|
|
721
|
+
z.object({
|
|
722
|
+
environment: id,
|
|
723
|
+
collection: ref,
|
|
724
|
+
record: ref,
|
|
725
|
+
actor: z.object({ kind: z.enum(ACTOR_KINDS) })
|
|
726
|
+
});
|
|
727
|
+
z.object({
|
|
728
|
+
end_user_id: id,
|
|
729
|
+
from: z.enum(END_USER_STATUSES).nullable(),
|
|
730
|
+
to: z.enum(END_USER_STATUSES).nullable()
|
|
731
|
+
});
|
|
732
|
+
z.object({
|
|
733
|
+
run_id: id,
|
|
734
|
+
source: z.string(),
|
|
735
|
+
rows: z.record(z.string(), z.number().int())
|
|
736
|
+
});
|
|
737
|
+
z.object({
|
|
738
|
+
installation_id: id,
|
|
739
|
+
app_id: z.string().nullable()
|
|
740
|
+
});
|
|
741
|
+
({ ...Object.fromEntries(WEBHOOK_ACTIONS.map((action) => [webhookRecordTypeOf(action), RECORD_EVENT_DATA])) }), FORM_EVENTS.submitted, END_USER_EVENTS.statusChanged, END_USER_EVENTS.deleted, IMPORT_EVENTS.completed, INSTALLATION_EVENTS.deleted;
|
|
742
|
+
// ../adapter-cloudflare/src/eventLog/viewSchema.ts
|
|
743
|
+
/**
|
|
744
|
+
* 閲覧のイベントの Analytics Engine の形(toolkit の analyticsEngineRecorder・analyticsEngineCounts に渡す)
|
|
745
|
+
* - blobs: VIEW_COLUMNS の順に blob1〜blob6
|
|
746
|
+
* - index: プロジェクト、指定なしは種類(Analytics Engine は index ごとに標本を抽出するため、共有のデータセットで小さなプロジェクトの記録が間引かれないように)
|
|
747
|
+
* - 公開の SDK の analytics がサイトの記録の側に同じ値を公開する
|
|
748
|
+
*/
|
|
749
|
+
const VIEW_SCHEMA = defineEventSchema({
|
|
750
|
+
blobs: VIEW_COLUMNS,
|
|
751
|
+
index: (view) => view.project ?? view.kind ?? ""
|
|
752
|
+
});
|
|
679
753
|
export { VIEW_COLUMNS, VIEW_SCHEMA, viewOf };
|