@spacefast/common 0.0.2
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/README.md +42 -0
- package/dist/brand.d.ts +15 -0
- package/dist/brand.js +24 -0
- package/dist/config/domains.d.ts +30 -0
- package/dist/config/domains.js +75 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +3 -0
- package/dist/contracts/abuse.d.ts +93 -0
- package/dist/contracts/abuse.js +50 -0
- package/dist/contracts/access.d.ts +409 -0
- package/dist/contracts/access.js +396 -0
- package/dist/contracts/account.d.ts +28 -0
- package/dist/contracts/account.js +54 -0
- package/dist/contracts/activity.d.ts +118 -0
- package/dist/contracts/activity.js +180 -0
- package/dist/contracts/analytics.d.ts +56 -0
- package/dist/contracts/analytics.js +91 -0
- package/dist/contracts/annotations.d.ts +327 -0
- package/dist/contracts/annotations.js +234 -0
- package/dist/contracts/api-keys.d.ts +517 -0
- package/dist/contracts/api-keys.js +235 -0
- package/dist/contracts/archives.d.ts +332 -0
- package/dist/contracts/archives.js +120 -0
- package/dist/contracts/auth.d.ts +86 -0
- package/dist/contracts/auth.js +82 -0
- package/dist/contracts/beta.d.ts +106 -0
- package/dist/contracts/beta.js +104 -0
- package/dist/contracts/billing.d.ts +328 -0
- package/dist/contracts/billing.js +203 -0
- package/dist/contracts/builds.d.ts +504 -0
- package/dist/contracts/builds.js +248 -0
- package/dist/contracts/channels.d.ts +49 -0
- package/dist/contracts/channels.js +51 -0
- package/dist/contracts/common.d.ts +238 -0
- package/dist/contracts/common.js +175 -0
- package/dist/contracts/deployments.d.ts +574 -0
- package/dist/contracts/deployments.js +97 -0
- package/dist/contracts/device-auth.d.ts +194 -0
- package/dist/contracts/device-auth.js +162 -0
- package/dist/contracts/domains.d.ts +6115 -0
- package/dist/contracts/domains.js +1435 -0
- package/dist/contracts/enums.d.ts +196 -0
- package/dist/contracts/enums.js +211 -0
- package/dist/contracts/error-code-meta.d.ts +1560 -0
- package/dist/contracts/error-code-meta.js +400 -0
- package/dist/contracts/error-codes.d.ts +13 -0
- package/dist/contracts/error-codes.js +416 -0
- package/dist/contracts/events.d.ts +398 -0
- package/dist/contracts/events.js +320 -0
- package/dist/contracts/fast-domain-search.d.ts +19 -0
- package/dist/contracts/fast-domain-search.js +22 -0
- package/dist/contracts/features.d.ts +240 -0
- package/dist/contracts/features.js +406 -0
- package/dist/contracts/git.d.ts +288 -0
- package/dist/contracts/git.js +116 -0
- package/dist/contracts/ids.d.ts +35 -0
- package/dist/contracts/ids.js +45 -0
- package/dist/contracts/intercom.d.ts +6 -0
- package/dist/contracts/intercom.js +5 -0
- package/dist/contracts/internal.d.ts +103 -0
- package/dist/contracts/internal.js +92 -0
- package/dist/contracts/mcp.d.ts +788 -0
- package/dist/contracts/mcp.js +161 -0
- package/dist/contracts/me.d.ts +81 -0
- package/dist/contracts/me.js +104 -0
- package/dist/contracts/oauth-resources.d.ts +30 -0
- package/dist/contracts/oauth-resources.js +61 -0
- package/dist/contracts/operations.d.ts +54 -0
- package/dist/contracts/operations.js +14 -0
- package/dist/contracts/plan-policy.d.ts +85 -0
- package/dist/contracts/plan-policy.js +75 -0
- package/dist/contracts/platform.d.ts +359 -0
- package/dist/contracts/platform.js +216 -0
- package/dist/contracts/push-new.d.ts +156 -0
- package/dist/contracts/push-new.js +52 -0
- package/dist/contracts/quotas.d.ts +16 -0
- package/dist/contracts/quotas.js +36 -0
- package/dist/contracts/repository-connections.d.ts +231 -0
- package/dist/contracts/repository-connections.js +106 -0
- package/dist/contracts/resources.d.ts +529 -0
- package/dist/contracts/resources.js +209 -0
- package/dist/contracts/routes.d.ts +45 -0
- package/dist/contracts/routes.js +31 -0
- package/dist/contracts/runtime-api.d.ts +449 -0
- package/dist/contracts/runtime-api.js +513 -0
- package/dist/contracts/sites.d.ts +393 -0
- package/dist/contracts/sites.js +121 -0
- package/dist/contracts/slugs.d.ts +31 -0
- package/dist/contracts/slugs.js +47 -0
- package/dist/contracts/space-config.d.ts +216 -0
- package/dist/contracts/space-config.js +237 -0
- package/dist/contracts/space-theme.d.ts +25 -0
- package/dist/contracts/space-theme.js +49 -0
- package/dist/contracts/spaces.d.ts +2760 -0
- package/dist/contracts/spaces.js +589 -0
- package/dist/contracts/superadmin-activity.d.ts +205 -0
- package/dist/contracts/superadmin-activity.js +107 -0
- package/dist/contracts/superadmin-emails.d.ts +212 -0
- package/dist/contracts/superadmin-emails.js +112 -0
- package/dist/contracts/superadmin-queues.d.ts +414 -0
- package/dist/contracts/superadmin-queues.js +202 -0
- package/dist/contracts/superadmin-runtime.d.ts +27 -0
- package/dist/contracts/superadmin-runtime.js +38 -0
- package/dist/contracts/superadmin-spaces.d.ts +429 -0
- package/dist/contracts/superadmin-spaces.js +82 -0
- package/dist/contracts/superadmin-tenants.d.ts +180 -0
- package/dist/contracts/superadmin-tenants.js +117 -0
- package/dist/contracts/superadmin.d.ts +654 -0
- package/dist/contracts/superadmin.js +309 -0
- package/dist/contracts/tags.d.ts +1140 -0
- package/dist/contracts/tags.js +1050 -0
- package/dist/contracts/teams.d.ts +233 -0
- package/dist/contracts/teams.js +174 -0
- package/dist/contracts/telemetry.d.ts +2 -0
- package/dist/contracts/telemetry.js +1 -0
- package/dist/contracts/transfers.d.ts +105 -0
- package/dist/contracts/transfers.js +48 -0
- package/dist/contracts/variables.d.ts +189 -0
- package/dist/contracts/variables.js +82 -0
- package/dist/contracts/webhooks.d.ts +159 -0
- package/dist/contracts/webhooks.js +59 -0
- package/dist/contracts/zero.d.ts +1538 -0
- package/dist/contracts/zero.js +755 -0
- package/dist/docs/agent-prose.d.ts +35 -0
- package/dist/docs/agent-prose.js +153 -0
- package/dist/docs/agent-setup.d.ts +6 -0
- package/dist/docs/agent-setup.js +164 -0
- package/dist/docs/agent-solutions.d.ts +110 -0
- package/dist/docs/agent-solutions.js +181 -0
- package/dist/docs/error-docs.d.ts +12 -0
- package/dist/docs/error-docs.js +1601 -0
- package/dist/docs/skill-distribution.d.ts +12 -0
- package/dist/docs/skill-distribution.js +18 -0
- package/dist/domain-exploration.d.ts +108 -0
- package/dist/domain-exploration.js +488 -0
- package/dist/domain-normalize.d.ts +1 -0
- package/dist/domain-normalize.js +14 -0
- package/dist/domain-zones.d.ts +1 -0
- package/dist/domain-zones.js +5272 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/access-policy.d.ts +39 -0
- package/dist/utils/access-policy.js +232 -0
- package/dist/utils/api.d.ts +4 -0
- package/dist/utils/api.js +13 -0
- package/dist/utils/auth-redirect.d.ts +1 -0
- package/dist/utils/auth-redirect.js +48 -0
- package/dist/utils/auth.d.ts +5 -0
- package/dist/utils/auth.js +13 -0
- package/dist/utils/build-settings.d.ts +49 -0
- package/dist/utils/build-settings.js +366 -0
- package/dist/utils/claim-token.d.ts +1 -0
- package/dist/utils/claim-token.js +9 -0
- package/dist/utils/collections.d.ts +1 -0
- package/dist/utils/collections.js +5 -0
- package/dist/utils/concurrency.d.ts +1 -0
- package/dist/utils/concurrency.js +18 -0
- package/dist/utils/content-type.d.ts +10 -0
- package/dist/utils/content-type.js +145 -0
- package/dist/utils/error-display.d.ts +7 -0
- package/dist/utils/error-display.js +42 -0
- package/dist/utils/error.d.ts +1 -0
- package/dist/utils/error.js +3 -0
- package/dist/utils/generate-space-name.d.ts +14 -0
- package/dist/utils/generate-space-name.js +95 -0
- package/dist/utils/git-repository.d.ts +5 -0
- package/dist/utils/git-repository.js +99 -0
- package/dist/utils/guards.d.ts +1 -0
- package/dist/utils/guards.js +3 -0
- package/dist/utils/publish-detection.d.ts +10 -0
- package/dist/utils/publish-detection.js +118 -0
- package/dist/utils/publish-policy.d.ts +69 -0
- package/dist/utils/publish-policy.js +429 -0
- package/dist/utils/query-client.d.ts +7 -0
- package/dist/utils/query-client.js +21 -0
- package/dist/utils/query-keys.d.ts +75 -0
- package/dist/utils/query-keys.js +78 -0
- package/dist/utils/runtime-paths.d.ts +7 -0
- package/dist/utils/runtime-paths.js +28 -0
- package/dist/utils/runtime-upload.d.ts +19 -0
- package/dist/utils/runtime-upload.js +27 -0
- package/dist/utils/slug.d.ts +5 -0
- package/dist/utils/slug.js +13 -0
- package/dist/utils/space-config.d.ts +75 -0
- package/dist/utils/space-config.js +415 -0
- package/dist/utils/space-theme.d.ts +16 -0
- package/dist/utils/space-theme.js +89 -0
- package/dist/utils/static-runtime-policy.d.ts +17 -0
- package/dist/utils/static-runtime-policy.js +103 -0
- package/dist/utils/upload-session.d.ts +34 -0
- package/dist/utils/upload-session.js +69 -0
- package/dist/utils/urls.d.ts +2 -0
- package/dist/utils/urls.js +7 -0
- package/dist/utils/version-path.d.ts +6 -0
- package/dist/utils/version-path.js +51 -0
- package/dist/utils/wpcom-auth-redirects.d.ts +14 -0
- package/dist/utils/wpcom-auth-redirects.js +49 -0
- package/dist/utils/zero-realtime-signature.d.ts +12 -0
- package/dist/utils/zero-realtime-signature.js +45 -0
- package/dist/vocabulary.d.ts +230 -0
- package/dist/vocabulary.js +218 -0
- package/package.json +58 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const pushNewSessionStatusSchema: z.ZodEnum<{
|
|
3
|
+
live: "live";
|
|
4
|
+
failed: "failed";
|
|
5
|
+
expired: "expired";
|
|
6
|
+
building: "building";
|
|
7
|
+
waiting_for_push: "waiting_for_push";
|
|
8
|
+
waiting_for_upload: "waiting_for_upload";
|
|
9
|
+
publishing: "publishing";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const pushNewSourceKindSchema: z.ZodEnum<{
|
|
12
|
+
direct_upload: "direct_upload";
|
|
13
|
+
git: "git";
|
|
14
|
+
}>;
|
|
15
|
+
export declare const pushNewUploadModeSchema: z.ZodEnum<{
|
|
16
|
+
static_publish: "static_publish";
|
|
17
|
+
source_archive_build: "source_archive_build";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const PushNewSessionSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
status: z.ZodEnum<{
|
|
22
|
+
live: "live";
|
|
23
|
+
failed: "failed";
|
|
24
|
+
expired: "expired";
|
|
25
|
+
building: "building";
|
|
26
|
+
waiting_for_push: "waiting_for_push";
|
|
27
|
+
waiting_for_upload: "waiting_for_upload";
|
|
28
|
+
publishing: "publishing";
|
|
29
|
+
}>;
|
|
30
|
+
sourceKind: z.ZodEnum<{
|
|
31
|
+
direct_upload: "direct_upload";
|
|
32
|
+
git: "git";
|
|
33
|
+
}>;
|
|
34
|
+
uploadMode: z.ZodNullable<z.ZodEnum<{
|
|
35
|
+
static_publish: "static_publish";
|
|
36
|
+
source_archive_build: "source_archive_build";
|
|
37
|
+
}>>;
|
|
38
|
+
slug: z.ZodString;
|
|
39
|
+
spaceSlug: z.ZodString;
|
|
40
|
+
spaceId: z.ZodString;
|
|
41
|
+
repositoryConnectionId: z.ZodNullable<z.ZodString>;
|
|
42
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
43
|
+
repositoryFullName: z.ZodNullable<z.ZodString>;
|
|
44
|
+
branch: z.ZodString;
|
|
45
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
46
|
+
commitSha: z.ZodNullable<z.ZodString>;
|
|
47
|
+
buildId: z.ZodNullable<z.ZodString>;
|
|
48
|
+
publishOperationId: z.ZodNullable<z.ZodString>;
|
|
49
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
50
|
+
reusedVersionId: z.ZodNullable<z.ZodString>;
|
|
51
|
+
webhookDeliveryId: z.ZodNullable<z.ZodString>;
|
|
52
|
+
liveUrl: z.ZodString;
|
|
53
|
+
sessionUrl: z.ZodString;
|
|
54
|
+
logsUrl: z.ZodNullable<z.ZodString>;
|
|
55
|
+
claimUrl: z.ZodString;
|
|
56
|
+
remoteUrl: z.ZodNullable<z.ZodString>;
|
|
57
|
+
remoteExpiresAt: z.ZodNullable<z.ZodString>;
|
|
58
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
59
|
+
errorMessage: z.ZodNullable<z.ZodString>;
|
|
60
|
+
expiresAt: z.ZodString;
|
|
61
|
+
createdAt: z.ZodString;
|
|
62
|
+
updatedAt: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export declare const PushNewCreateSessionResponseSchema: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
status: z.ZodEnum<{
|
|
67
|
+
live: "live";
|
|
68
|
+
failed: "failed";
|
|
69
|
+
expired: "expired";
|
|
70
|
+
building: "building";
|
|
71
|
+
waiting_for_push: "waiting_for_push";
|
|
72
|
+
waiting_for_upload: "waiting_for_upload";
|
|
73
|
+
publishing: "publishing";
|
|
74
|
+
}>;
|
|
75
|
+
sourceKind: z.ZodEnum<{
|
|
76
|
+
direct_upload: "direct_upload";
|
|
77
|
+
git: "git";
|
|
78
|
+
}>;
|
|
79
|
+
uploadMode: z.ZodNullable<z.ZodEnum<{
|
|
80
|
+
static_publish: "static_publish";
|
|
81
|
+
source_archive_build: "source_archive_build";
|
|
82
|
+
}>>;
|
|
83
|
+
slug: z.ZodString;
|
|
84
|
+
spaceSlug: z.ZodString;
|
|
85
|
+
spaceId: z.ZodString;
|
|
86
|
+
repositoryConnectionId: z.ZodNullable<z.ZodString>;
|
|
87
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
88
|
+
repositoryFullName: z.ZodNullable<z.ZodString>;
|
|
89
|
+
branch: z.ZodString;
|
|
90
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
91
|
+
commitSha: z.ZodNullable<z.ZodString>;
|
|
92
|
+
buildId: z.ZodNullable<z.ZodString>;
|
|
93
|
+
publishOperationId: z.ZodNullable<z.ZodString>;
|
|
94
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
95
|
+
reusedVersionId: z.ZodNullable<z.ZodString>;
|
|
96
|
+
webhookDeliveryId: z.ZodNullable<z.ZodString>;
|
|
97
|
+
liveUrl: z.ZodString;
|
|
98
|
+
sessionUrl: z.ZodString;
|
|
99
|
+
logsUrl: z.ZodNullable<z.ZodString>;
|
|
100
|
+
claimUrl: z.ZodString;
|
|
101
|
+
remoteUrl: z.ZodNullable<z.ZodString>;
|
|
102
|
+
remoteExpiresAt: z.ZodNullable<z.ZodString>;
|
|
103
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
104
|
+
errorMessage: z.ZodNullable<z.ZodString>;
|
|
105
|
+
expiresAt: z.ZodString;
|
|
106
|
+
createdAt: z.ZodString;
|
|
107
|
+
updatedAt: z.ZodString;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
export declare const PushNewStatusResponseSchema: z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
status: z.ZodEnum<{
|
|
112
|
+
live: "live";
|
|
113
|
+
failed: "failed";
|
|
114
|
+
expired: "expired";
|
|
115
|
+
building: "building";
|
|
116
|
+
waiting_for_push: "waiting_for_push";
|
|
117
|
+
waiting_for_upload: "waiting_for_upload";
|
|
118
|
+
publishing: "publishing";
|
|
119
|
+
}>;
|
|
120
|
+
expiresAt: z.ZodString;
|
|
121
|
+
createdAt: z.ZodString;
|
|
122
|
+
spaceId: z.ZodString;
|
|
123
|
+
updatedAt: z.ZodString;
|
|
124
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
125
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
126
|
+
spaceSlug: z.ZodString;
|
|
127
|
+
branch: z.ZodString;
|
|
128
|
+
commitSha: z.ZodNullable<z.ZodString>;
|
|
129
|
+
repositoryFullName: z.ZodNullable<z.ZodString>;
|
|
130
|
+
slug: z.ZodString;
|
|
131
|
+
liveUrl: z.ZodString;
|
|
132
|
+
buildId: z.ZodNullable<z.ZodString>;
|
|
133
|
+
claimUrl: z.ZodString;
|
|
134
|
+
repositoryConnectionId: z.ZodNullable<z.ZodString>;
|
|
135
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
136
|
+
reusedVersionId: z.ZodNullable<z.ZodString>;
|
|
137
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
138
|
+
sourceKind: z.ZodEnum<{
|
|
139
|
+
direct_upload: "direct_upload";
|
|
140
|
+
git: "git";
|
|
141
|
+
}>;
|
|
142
|
+
remoteExpiresAt: z.ZodNullable<z.ZodString>;
|
|
143
|
+
uploadMode: z.ZodNullable<z.ZodEnum<{
|
|
144
|
+
static_publish: "static_publish";
|
|
145
|
+
source_archive_build: "source_archive_build";
|
|
146
|
+
}>>;
|
|
147
|
+
publishOperationId: z.ZodNullable<z.ZodString>;
|
|
148
|
+
webhookDeliveryId: z.ZodNullable<z.ZodString>;
|
|
149
|
+
sessionUrl: z.ZodString;
|
|
150
|
+
logsUrl: z.ZodNullable<z.ZodString>;
|
|
151
|
+
errorMessage: z.ZodNullable<z.ZodString>;
|
|
152
|
+
remoteUrl: z.ZodNullable<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
export type PushNewSessionStatus = z.infer<typeof pushNewSessionStatusSchema>;
|
|
155
|
+
export type PushNewSourceKind = z.infer<typeof pushNewSourceKindSchema>;
|
|
156
|
+
export type PushNewSession = z.infer<typeof PushNewSessionSchema>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const pushNewSessionStatusSchema = z.enum([
|
|
3
|
+
"waiting_for_push",
|
|
4
|
+
"waiting_for_upload",
|
|
5
|
+
"publishing",
|
|
6
|
+
"building",
|
|
7
|
+
"live",
|
|
8
|
+
"failed",
|
|
9
|
+
"expired",
|
|
10
|
+
]);
|
|
11
|
+
export const pushNewSourceKindSchema = z.enum(["git", "direct_upload"]);
|
|
12
|
+
export const pushNewUploadModeSchema = z.enum(["static_publish", "source_archive_build"]);
|
|
13
|
+
const nullableDateTime = z.string().datetime().nullable();
|
|
14
|
+
export const PushNewSessionSchema = z.object({
|
|
15
|
+
id: z.string().describe("push.new session id (`psh_...`)."),
|
|
16
|
+
status: pushNewSessionStatusSchema,
|
|
17
|
+
sourceKind: pushNewSourceKindSchema,
|
|
18
|
+
uploadMode: pushNewUploadModeSchema.nullable(),
|
|
19
|
+
slug: z.string().describe("Bearer session slug."),
|
|
20
|
+
spaceSlug: z.string(),
|
|
21
|
+
spaceId: z.string(),
|
|
22
|
+
repositoryConnectionId: z.string().nullable(),
|
|
23
|
+
repositoryId: z.string().nullable(),
|
|
24
|
+
repositoryFullName: z.string().nullable(),
|
|
25
|
+
branch: z.string(),
|
|
26
|
+
ref: z.string().nullable(),
|
|
27
|
+
commitSha: z.string().nullable(),
|
|
28
|
+
buildId: z.string().nullable(),
|
|
29
|
+
publishOperationId: z.string().nullable(),
|
|
30
|
+
versionId: z.string().nullable(),
|
|
31
|
+
reusedVersionId: z.string().nullable(),
|
|
32
|
+
webhookDeliveryId: z.string().nullable(),
|
|
33
|
+
liveUrl: z.string().url(),
|
|
34
|
+
sessionUrl: z.string().url(),
|
|
35
|
+
logsUrl: z.string().url().nullable(),
|
|
36
|
+
claimUrl: z.string().url(),
|
|
37
|
+
remoteUrl: z.string().url().nullable(),
|
|
38
|
+
remoteExpiresAt: nullableDateTime,
|
|
39
|
+
errorCode: z.string().nullable(),
|
|
40
|
+
errorMessage: z.string().nullable(),
|
|
41
|
+
expiresAt: z.string().datetime(),
|
|
42
|
+
createdAt: z.string().datetime(),
|
|
43
|
+
updatedAt: z.string().datetime(),
|
|
44
|
+
});
|
|
45
|
+
export const PushNewCreateSessionResponseSchema = PushNewSessionSchema;
|
|
46
|
+
export const PushNewStatusResponseSchema = PushNewSessionSchema.omit({ remoteUrl: true }).extend({
|
|
47
|
+
remoteUrl: z
|
|
48
|
+
.string()
|
|
49
|
+
.url()
|
|
50
|
+
.nullable()
|
|
51
|
+
.describe("Returned only while the write remote is usable."),
|
|
52
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const WORST_CASE_QUOTAS: {
|
|
2
|
+
readonly maxArtifactBytes: number;
|
|
3
|
+
readonly maxInlinePublishBodyBytes: number;
|
|
4
|
+
readonly maxVersionsPerFreeSpace: 200;
|
|
5
|
+
readonly maxEgressBytesPerSpacePerDay: number;
|
|
6
|
+
readonly maxPublishesPerIpPerHour: 20;
|
|
7
|
+
readonly maxClaimedFreeSpacesPerAccount: 50;
|
|
8
|
+
readonly maxWebhookDeliveriesPerTenantPerHour: 10000;
|
|
9
|
+
};
|
|
10
|
+
export type WorstCaseQuotaName = keyof typeof WORST_CASE_QUOTAS;
|
|
11
|
+
export declare const ANONYMOUS_PUBLISH_CAPS: {
|
|
12
|
+
readonly maxFileBytes: number;
|
|
13
|
+
readonly maxInlineBodyBytes: number;
|
|
14
|
+
readonly maxFilesPerVersion: 1000;
|
|
15
|
+
readonly maxPublishesPerIpPerHour: 20;
|
|
16
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Crude worst-case quotas (internal-docs/platform.md "Abuse Posture"): hard,
|
|
2
|
+
// launch-day abuse controls that exist independently of plan limits. One named
|
|
3
|
+
// raise-only table — raising a limit later is a tweet, lowering one is a
|
|
4
|
+
// betrayal. Enforcement points live in the control plane and reference these
|
|
5
|
+
// names; every trip emits activity/ops events so thresholds are tuned from data.
|
|
6
|
+
export const WORST_CASE_QUOTAS = {
|
|
7
|
+
// Per-version artifact ceiling (sum of file bytes; enforced at manifest intake).
|
|
8
|
+
maxArtifactBytes: 2 * 1024 * 1024 * 1024,
|
|
9
|
+
// Inline one-shot publish body cap (compressed archive bytes).
|
|
10
|
+
maxInlinePublishBodyBytes: 128 * 1024 * 1024,
|
|
11
|
+
// Versions a free/anonymous space may accumulate before old ones must go.
|
|
12
|
+
maxVersionsPerFreeSpace: 200,
|
|
13
|
+
// Daily egress per space before the per-space kill switch engages.
|
|
14
|
+
maxEgressBytesPerSpacePerDay: 100 * 1024 * 1024 * 1024,
|
|
15
|
+
// Anonymous publish/space-create attempts per IP per hour.
|
|
16
|
+
maxPublishesPerIpPerHour: 20,
|
|
17
|
+
// Spaces an account may claim out of the anonymous flow.
|
|
18
|
+
maxClaimedFreeSpacesPerAccount: 50,
|
|
19
|
+
// Webhook deliveries a tenant's endpoints may receive per hour; deliveries
|
|
20
|
+
// over budget are recorded failed (never silently dropped) and never queued.
|
|
21
|
+
maxWebhookDeliveriesPerTenantPerHour: 10_000,
|
|
22
|
+
};
|
|
23
|
+
// Anonymous-tier safety caps (internal-docs/platform.md "Abuse Posture"):
|
|
24
|
+
// LIVE launch values, anonymous <= Free on every axis. These protect the
|
|
25
|
+
// platform and are not soft plan seams; plan policy can only raise them.
|
|
26
|
+
export const ANONYMOUS_PUBLISH_CAPS = {
|
|
27
|
+
// Per-file ceiling (= Free plan maxFileBytes).
|
|
28
|
+
maxFileBytes: 50 * 1024 * 1024,
|
|
29
|
+
// Inline one-shot publish body cap; tighter than the absolute
|
|
30
|
+
// maxInlinePublishBodyBytes ceiling above.
|
|
31
|
+
maxInlineBodyBytes: 100 * 1024 * 1024,
|
|
32
|
+
// Files per version for anonymous publishes.
|
|
33
|
+
maxFilesPerVersion: 1000,
|
|
34
|
+
// Anonymous publish/space-create attempts per IP per hour.
|
|
35
|
+
maxPublishesPerIpPerHour: WORST_CASE_QUOTAS.maxPublishesPerIpPerHour,
|
|
36
|
+
};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const repositoryConnectionTypeSchema: z.ZodEnum<{
|
|
3
|
+
hosted: "hosted";
|
|
4
|
+
connected: "connected";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const repositoryConnectionSyncStatusSchema: z.ZodEnum<{
|
|
7
|
+
failed: "failed";
|
|
8
|
+
ready: "ready";
|
|
9
|
+
idle: "idle";
|
|
10
|
+
syncing: "syncing";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const RepositoryConnectionSchema: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
spaceId: z.ZodString;
|
|
15
|
+
provider: z.ZodEnum<{
|
|
16
|
+
github: "github";
|
|
17
|
+
gitlab: "gitlab";
|
|
18
|
+
bitbucket: "bitbucket";
|
|
19
|
+
generic: "generic";
|
|
20
|
+
}>;
|
|
21
|
+
connectionType: z.ZodEnum<{
|
|
22
|
+
hosted: "hosted";
|
|
23
|
+
connected: "connected";
|
|
24
|
+
}>;
|
|
25
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
26
|
+
repositoryName: z.ZodString;
|
|
27
|
+
repositoryFullName: z.ZodString;
|
|
28
|
+
defaultBranch: z.ZodString;
|
|
29
|
+
productionBranch: z.ZodString;
|
|
30
|
+
credentialConfigured: z.ZodBoolean;
|
|
31
|
+
autoDeployProduction: z.ZodBoolean;
|
|
32
|
+
autoDeployPreviews: z.ZodBoolean;
|
|
33
|
+
buildSettings: z.ZodObject<{
|
|
34
|
+
rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
installCommand: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
buildCommand: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
outputDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
ignoredBuildCommand: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
frameworkPreset: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
platformPreset: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
allowUnsupportedPlatformFeatures: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
timeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
syncStatus: z.ZodEnum<{
|
|
46
|
+
failed: "failed";
|
|
47
|
+
ready: "ready";
|
|
48
|
+
idle: "idle";
|
|
49
|
+
syncing: "syncing";
|
|
50
|
+
}>;
|
|
51
|
+
lastSyncedAt: z.ZodNullable<z.ZodString>;
|
|
52
|
+
lastSyncError: z.ZodNullable<z.ZodString>;
|
|
53
|
+
syncRunId: z.ZodNullable<z.ZodString>;
|
|
54
|
+
connectedUserId: z.ZodNullable<z.ZodString>;
|
|
55
|
+
createdAt: z.ZodString;
|
|
56
|
+
updatedAt: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export declare const repositoryConnectionCreateSchema: z.ZodObject<{
|
|
59
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
60
|
+
github: "github";
|
|
61
|
+
gitlab: "gitlab";
|
|
62
|
+
bitbucket: "bitbucket";
|
|
63
|
+
generic: "generic";
|
|
64
|
+
}>>;
|
|
65
|
+
connectionType: z.ZodDefault<z.ZodEnum<{
|
|
66
|
+
hosted: "hosted";
|
|
67
|
+
connected: "connected";
|
|
68
|
+
}>>;
|
|
69
|
+
repositoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
repositoryName: z.ZodOptional<z.ZodString>;
|
|
71
|
+
repositoryFullName: z.ZodString;
|
|
72
|
+
defaultBranch: z.ZodDefault<z.ZodString>;
|
|
73
|
+
productionBranch: z.ZodOptional<z.ZodString>;
|
|
74
|
+
cloneUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
upstreamUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
installationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
credential: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
autoDeployProduction: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
autoDeployPreviews: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
buildSettings: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
rootDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
82
|
+
installDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
83
|
+
installCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
84
|
+
buildCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
85
|
+
outputDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
86
|
+
ignoredBuildCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
87
|
+
frameworkPreset: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
88
|
+
platformPreset: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
89
|
+
allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
90
|
+
timeoutSeconds: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export declare const repositoryConnectionPatchSchema: z.ZodObject<{
|
|
94
|
+
connectionType: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
hosted: "hosted";
|
|
96
|
+
connected: "connected";
|
|
97
|
+
}>>;
|
|
98
|
+
productionBranch: z.ZodOptional<z.ZodString>;
|
|
99
|
+
cloneUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
upstreamUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
credential: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
|
+
autoDeployProduction: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
autoDeployPreviews: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
buildSettings: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
rootDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
106
|
+
installDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
107
|
+
installCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
108
|
+
buildCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
109
|
+
outputDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
110
|
+
ignoredBuildCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
111
|
+
frameworkPreset: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
112
|
+
platformPreset: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
113
|
+
allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
114
|
+
timeoutSeconds: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
export declare const repositoryImportRemoteSchema: z.ZodObject<{
|
|
118
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
119
|
+
github: "github";
|
|
120
|
+
gitlab: "gitlab";
|
|
121
|
+
bitbucket: "bitbucket";
|
|
122
|
+
generic: "generic";
|
|
123
|
+
}>>;
|
|
124
|
+
repositoryFullName: z.ZodString;
|
|
125
|
+
repositoryId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
repositoryName: z.ZodOptional<z.ZodString>;
|
|
127
|
+
defaultBranch: z.ZodDefault<z.ZodString>;
|
|
128
|
+
productionBranch: z.ZodOptional<z.ZodString>;
|
|
129
|
+
cloneUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
buildSettings: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
rootDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
132
|
+
installDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
133
|
+
installCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
134
|
+
buildCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
135
|
+
outputDirectory: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
136
|
+
ignoredBuildCommand: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
137
|
+
frameworkPreset: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
138
|
+
platformPreset: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
139
|
+
allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
140
|
+
timeoutSeconds: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
autoDeployProduction: z.ZodDefault<z.ZodBoolean>;
|
|
143
|
+
autoDeployPreviews: z.ZodDefault<z.ZodBoolean>;
|
|
144
|
+
credential: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
+
installationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
146
|
+
upstreamUrl: z.ZodString;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
export declare const repositoryWebhookDeliveryStatusSchema: z.ZodEnum<{
|
|
149
|
+
failed: "failed";
|
|
150
|
+
ignored: "ignored";
|
|
151
|
+
received: "received";
|
|
152
|
+
processing: "processing";
|
|
153
|
+
processed: "processed";
|
|
154
|
+
}>;
|
|
155
|
+
export declare const RepositoryWebhookDeliverySchema: z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
receiver: z.ZodString;
|
|
158
|
+
deliveryId: z.ZodString;
|
|
159
|
+
repositoryConnectionId: z.ZodNullable<z.ZodString>;
|
|
160
|
+
matchedConnectionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
161
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
162
|
+
eventName: z.ZodString;
|
|
163
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
164
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
165
|
+
syncRunId: z.ZodNullable<z.ZodString>;
|
|
166
|
+
status: z.ZodEnum<{
|
|
167
|
+
failed: "failed";
|
|
168
|
+
ignored: "ignored";
|
|
169
|
+
received: "received";
|
|
170
|
+
processing: "processing";
|
|
171
|
+
processed: "processed";
|
|
172
|
+
}>;
|
|
173
|
+
statusMessage: z.ZodNullable<z.ZodString>;
|
|
174
|
+
queuedBuildIds: z.ZodArray<z.ZodString>;
|
|
175
|
+
retiredVersionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
176
|
+
rawBodySha256: z.ZodNullable<z.ZodString>;
|
|
177
|
+
createdAt: z.ZodString;
|
|
178
|
+
updatedAt: z.ZodString;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
export declare const repositoryWebhookDeliveryListQuerySchema: z.ZodObject<{
|
|
181
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
182
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
183
|
+
connectionType: z.ZodOptional<z.ZodEnum<{
|
|
184
|
+
hosted: "hosted";
|
|
185
|
+
connected: "connected";
|
|
186
|
+
}>>;
|
|
187
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
188
|
+
failed: "failed";
|
|
189
|
+
ignored: "ignored";
|
|
190
|
+
received: "received";
|
|
191
|
+
processing: "processing";
|
|
192
|
+
processed: "processed";
|
|
193
|
+
}>>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
export declare const repositoryWebhookDeliveryListResponseSchema: z.ZodObject<{
|
|
196
|
+
data: z.ZodArray<z.ZodObject<{
|
|
197
|
+
id: z.ZodString;
|
|
198
|
+
receiver: z.ZodString;
|
|
199
|
+
deliveryId: z.ZodString;
|
|
200
|
+
repositoryConnectionId: z.ZodNullable<z.ZodString>;
|
|
201
|
+
matchedConnectionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
202
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
203
|
+
eventName: z.ZodString;
|
|
204
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
205
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
206
|
+
syncRunId: z.ZodNullable<z.ZodString>;
|
|
207
|
+
status: z.ZodEnum<{
|
|
208
|
+
failed: "failed";
|
|
209
|
+
ignored: "ignored";
|
|
210
|
+
received: "received";
|
|
211
|
+
processing: "processing";
|
|
212
|
+
processed: "processed";
|
|
213
|
+
}>;
|
|
214
|
+
statusMessage: z.ZodNullable<z.ZodString>;
|
|
215
|
+
queuedBuildIds: z.ZodArray<z.ZodString>;
|
|
216
|
+
retiredVersionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
217
|
+
rawBodySha256: z.ZodNullable<z.ZodString>;
|
|
218
|
+
createdAt: z.ZodString;
|
|
219
|
+
updatedAt: z.ZodString;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
pagination: z.ZodObject<{
|
|
222
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
223
|
+
hasMore: z.ZodBoolean;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
export type RepositoryConnection = z.infer<typeof RepositoryConnectionSchema>;
|
|
227
|
+
export type RepositoryConnectionCreate = z.infer<typeof repositoryConnectionCreateSchema>;
|
|
228
|
+
export type RepositoryConnectionPatch = z.infer<typeof repositoryConnectionPatchSchema>;
|
|
229
|
+
export type RepositoryImportRemote = z.infer<typeof repositoryImportRemoteSchema>;
|
|
230
|
+
export type RepositoryConnectionType = z.infer<typeof repositoryConnectionTypeSchema>;
|
|
231
|
+
export type RepositoryWebhookDelivery = z.infer<typeof RepositoryWebhookDeliverySchema>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BuildSettingsSchema } from "./builds.js";
|
|
3
|
+
import { CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
|
|
4
|
+
import { gitProvider } from "./enums.js";
|
|
5
|
+
// Two connection types only:
|
|
6
|
+
// - `connected`: external git host + webhook (formerly `remote`).
|
|
7
|
+
// - `hosted`: Stattic-hosted signed remote (formerly `push`).
|
|
8
|
+
// Importing an existing remote is an action (see `repositoryImportRemoteSchema`),
|
|
9
|
+
// not a connection type, so `import` is intentionally absent from this union.
|
|
10
|
+
export const repositoryConnectionTypeSchema = z.enum(["connected", "hosted"]);
|
|
11
|
+
export const repositoryConnectionSyncStatusSchema = z.enum(["idle", "syncing", "ready", "failed"]);
|
|
12
|
+
export const RepositoryConnectionSchema = z.object({
|
|
13
|
+
id: z.string().describe("Repository connection id (`rpc_`)."),
|
|
14
|
+
spaceId: z.string(),
|
|
15
|
+
provider: gitProvider.describe("Git host family for the repository connection."),
|
|
16
|
+
connectionType: repositoryConnectionTypeSchema,
|
|
17
|
+
repositoryId: z.string().nullable(),
|
|
18
|
+
repositoryName: z.string(),
|
|
19
|
+
repositoryFullName: z.string(),
|
|
20
|
+
defaultBranch: z.string(),
|
|
21
|
+
productionBranch: z.string(),
|
|
22
|
+
credentialConfigured: z.boolean(),
|
|
23
|
+
autoDeployProduction: z.boolean(),
|
|
24
|
+
autoDeployPreviews: z.boolean(),
|
|
25
|
+
buildSettings: BuildSettingsSchema,
|
|
26
|
+
syncStatus: repositoryConnectionSyncStatusSchema,
|
|
27
|
+
lastSyncedAt: z.string().datetime().nullable(),
|
|
28
|
+
lastSyncError: z.string().nullable(),
|
|
29
|
+
syncRunId: z.string().nullable(),
|
|
30
|
+
connectedUserId: z.string().nullable(),
|
|
31
|
+
createdAt: z.string().datetime(),
|
|
32
|
+
updatedAt: z.string().datetime(),
|
|
33
|
+
});
|
|
34
|
+
export const repositoryConnectionCreateSchema = z.object({
|
|
35
|
+
provider: gitProvider.default("github"),
|
|
36
|
+
connectionType: repositoryConnectionTypeSchema.default("connected"),
|
|
37
|
+
repositoryId: z.string().trim().min(1).nullable().optional(),
|
|
38
|
+
repositoryName: z.string().trim().min(1).optional(),
|
|
39
|
+
repositoryFullName: z.string().trim().min(1),
|
|
40
|
+
defaultBranch: z.string().trim().min(1).default("main"),
|
|
41
|
+
productionBranch: z.string().trim().min(1).optional(),
|
|
42
|
+
cloneUrl: z.string().trim().min(1).nullable().optional(),
|
|
43
|
+
upstreamUrl: z.string().trim().min(1).nullable().optional(),
|
|
44
|
+
installationId: z
|
|
45
|
+
.string()
|
|
46
|
+
.trim()
|
|
47
|
+
.min(1)
|
|
48
|
+
.nullable()
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Repository app installation id."),
|
|
51
|
+
credential: z.string().trim().min(1).nullable().optional(),
|
|
52
|
+
autoDeployProduction: z.boolean().default(true),
|
|
53
|
+
autoDeployPreviews: z.boolean().default(true),
|
|
54
|
+
buildSettings: BuildSettingsSchema.partial().optional(),
|
|
55
|
+
});
|
|
56
|
+
export const repositoryConnectionPatchSchema = z.object({
|
|
57
|
+
connectionType: repositoryConnectionTypeSchema.optional(),
|
|
58
|
+
productionBranch: z.string().trim().min(1).optional(),
|
|
59
|
+
cloneUrl: z.string().trim().min(1).nullable().optional(),
|
|
60
|
+
upstreamUrl: z.string().trim().min(1).nullable().optional(),
|
|
61
|
+
credential: z.string().trim().min(1).nullable().optional(),
|
|
62
|
+
autoDeployProduction: z.boolean().optional(),
|
|
63
|
+
autoDeployPreviews: z.boolean().optional(),
|
|
64
|
+
buildSettings: BuildSettingsSchema.partial().optional(),
|
|
65
|
+
});
|
|
66
|
+
// Importing an existing external remote is an action/flag, not a connection
|
|
67
|
+
// type. It produces a `connected` connection seeded from an upstream remote.
|
|
68
|
+
export const repositoryImportRemoteSchema = repositoryConnectionCreateSchema
|
|
69
|
+
.extend({
|
|
70
|
+
upstreamUrl: z.string().trim().min(1),
|
|
71
|
+
})
|
|
72
|
+
.omit({ connectionType: true });
|
|
73
|
+
export const repositoryWebhookDeliveryStatusSchema = z.enum([
|
|
74
|
+
"received",
|
|
75
|
+
"processing",
|
|
76
|
+
"processed",
|
|
77
|
+
"ignored",
|
|
78
|
+
"failed",
|
|
79
|
+
]);
|
|
80
|
+
export const RepositoryWebhookDeliverySchema = z.object({
|
|
81
|
+
id: z.string(),
|
|
82
|
+
receiver: z.string().describe("Webhook receiver that accepted the repository event."),
|
|
83
|
+
deliveryId: z.string().describe("Stable delivery id from the repository event source."),
|
|
84
|
+
repositoryConnectionId: z.string().nullable(),
|
|
85
|
+
matchedConnectionIds: z.array(z.string()).default([]),
|
|
86
|
+
repositoryId: z.string().nullable(),
|
|
87
|
+
eventName: z.string(),
|
|
88
|
+
ref: z.string().nullable(),
|
|
89
|
+
commit: z.string().nullable(),
|
|
90
|
+
syncRunId: z.string().nullable(),
|
|
91
|
+
status: repositoryWebhookDeliveryStatusSchema,
|
|
92
|
+
statusMessage: z.string().nullable(),
|
|
93
|
+
queuedBuildIds: z.array(z.string()),
|
|
94
|
+
retiredVersionIds: z.array(z.string()).default([]),
|
|
95
|
+
rawBodySha256: z.string().nullable(),
|
|
96
|
+
createdAt: z.string().datetime(),
|
|
97
|
+
updatedAt: z.string().datetime(),
|
|
98
|
+
});
|
|
99
|
+
export const repositoryWebhookDeliveryListQuerySchema = cursorListQuerySchema.extend({
|
|
100
|
+
connectionType: repositoryConnectionTypeSchema.optional(),
|
|
101
|
+
status: repositoryWebhookDeliveryStatusSchema.optional(),
|
|
102
|
+
});
|
|
103
|
+
export const repositoryWebhookDeliveryListResponseSchema = z.object({
|
|
104
|
+
data: z.array(RepositoryWebhookDeliverySchema),
|
|
105
|
+
pagination: CursorPaginationSchema,
|
|
106
|
+
});
|