@sylphx/contract 0.3.0 → 0.5.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 +12 -0
- package/dist/endpoint.d.ts +45 -3
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/endpoint.js +9 -0
- package/dist/endpoints/admin-ai-playground.d.ts +3 -3
- package/dist/endpoints/admin-anomalies.d.ts +7 -7
- package/dist/endpoints/admin-apm.d.ts +6 -6
- package/dist/endpoints/admin-audit.d.ts +94 -58
- package/dist/endpoints/admin-audit.d.ts.map +1 -1
- package/dist/endpoints/admin-audit.js +8 -1
- package/dist/endpoints/admin-billing.d.ts +35 -24
- package/dist/endpoints/admin-billing.d.ts.map +1 -1
- package/dist/endpoints/admin-billing.js +4 -3
- package/dist/endpoints/admin-bootstrap.d.ts +1 -1
- package/dist/endpoints/admin-branch-databases.d.ts +43 -0
- package/dist/endpoints/admin-branch-databases.d.ts.map +1 -0
- package/dist/endpoints/admin-branch-databases.js +41 -0
- package/dist/endpoints/admin-broadcasts.d.ts +10 -8
- package/dist/endpoints/admin-broadcasts.d.ts.map +1 -1
- package/dist/endpoints/admin-broadcasts.js +1 -0
- package/dist/endpoints/admin-builds.d.ts +1 -1
- package/dist/endpoints/admin-config.d.ts +11 -11
- package/dist/endpoints/admin-consent.d.ts +78 -41
- package/dist/endpoints/admin-consent.d.ts.map +1 -1
- package/dist/endpoints/admin-consent.js +9 -6
- package/dist/endpoints/admin-env-services.d.ts +1 -1
- package/dist/endpoints/admin-impersonation.d.ts +9 -9
- package/dist/endpoints/admin-invitations.d.ts +9 -5
- package/dist/endpoints/admin-invitations.d.ts.map +1 -1
- package/dist/endpoints/admin-invitations.js +2 -0
- package/dist/endpoints/admin-jwt-keys.d.ts +6 -6
- package/dist/endpoints/admin-logs.d.ts +7 -7
- package/dist/endpoints/admin-plans.d.ts +6 -4
- package/dist/endpoints/admin-plans.d.ts.map +1 -1
- package/dist/endpoints/admin-plans.js +1 -0
- package/dist/endpoints/admin-project-users.d.ts +8 -8
- package/dist/endpoints/admin-projects.d.ts +11 -9
- package/dist/endpoints/admin-projects.d.ts.map +1 -1
- package/dist/endpoints/admin-projects.js +3 -2
- package/dist/endpoints/admin-quotas.d.ts +6 -6
- package/dist/endpoints/admin-rate-limits.d.ts +2 -2
- package/dist/endpoints/admin-reconcile.d.ts +1 -1
- package/dist/endpoints/admin-resources.d.ts +2 -2
- package/dist/endpoints/admin-secrets.d.ts +2 -2
- package/dist/endpoints/admin-services.d.ts +1 -1
- package/dist/endpoints/admin-tasks.d.ts +6 -6
- package/dist/endpoints/admin-tenants.d.ts +3 -1
- package/dist/endpoints/admin-tenants.d.ts.map +1 -1
- package/dist/endpoints/admin-tenants.js +1 -0
- package/dist/endpoints/admin-traces.d.ts +5 -5
- package/dist/endpoints/admin-users.d.ts +8 -8
- package/dist/endpoints/admin-webhook-signature-versions.d.ts +5 -3
- package/dist/endpoints/admin-webhook-signature-versions.d.ts.map +1 -1
- package/dist/endpoints/admin-webhook-signature-versions.js +1 -0
- package/dist/endpoints/ai-admin.d.ts +5 -5
- package/dist/endpoints/analytics-admin.d.ts +123 -38
- package/dist/endpoints/analytics-admin.d.ts.map +1 -1
- package/dist/endpoints/analytics-admin.js +17 -9
- package/dist/endpoints/analytics.d.ts +4 -4
- package/dist/endpoints/audit-chain.d.ts +1 -1
- package/dist/endpoints/audit.d.ts +1 -1
- package/dist/endpoints/auth-admin.d.ts +5 -5
- package/dist/endpoints/auth.d.ts +65 -21
- package/dist/endpoints/auth.d.ts.map +1 -1
- package/dist/endpoints/auth.js +9 -2
- package/dist/endpoints/backups.d.ts +4 -4
- package/dist/endpoints/billing-console.d.ts +16 -16
- package/dist/endpoints/billing-settings.d.ts +11 -11
- package/dist/endpoints/branch-databases.d.ts +8 -4
- package/dist/endpoints/branch-databases.d.ts.map +1 -1
- package/dist/endpoints/branch-databases.js +2 -0
- package/dist/endpoints/challenge.d.ts +5 -5
- package/dist/endpoints/ci-settings.d.ts +8 -8
- package/dist/endpoints/consent-admin.d.ts +9 -7
- package/dist/endpoints/consent-admin.d.ts.map +1 -1
- package/dist/endpoints/consent-admin.js +1 -0
- package/dist/endpoints/databases.d.ts +187 -321
- package/dist/endpoints/databases.d.ts.map +1 -1
- package/dist/endpoints/databases.js +42 -41
- package/dist/endpoints/deployments.d.ts +71 -18
- package/dist/endpoints/deployments.d.ts.map +1 -1
- package/dist/endpoints/deployments.js +9 -1
- package/dist/endpoints/domains.d.ts +33 -23
- package/dist/endpoints/domains.d.ts.map +1 -1
- package/dist/endpoints/domains.js +7 -4
- package/dist/endpoints/email-admin.d.ts +29 -23
- package/dist/endpoints/email-admin.d.ts.map +1 -1
- package/dist/endpoints/email-admin.js +3 -0
- package/dist/endpoints/email.d.ts +4 -4
- package/dist/endpoints/engagement-admin.d.ts +6 -6
- package/dist/endpoints/env-vars.d.ts +3 -3
- package/dist/endpoints/environments.d.ts +30 -27
- package/dist/endpoints/environments.d.ts.map +1 -1
- package/dist/endpoints/environments.js +3 -7
- package/dist/endpoints/experiments.d.ts +20 -18
- package/dist/endpoints/experiments.d.ts.map +1 -1
- package/dist/endpoints/experiments.js +1 -0
- package/dist/endpoints/flags-admin.d.ts +73 -9
- package/dist/endpoints/flags-admin.d.ts.map +1 -1
- package/dist/endpoints/flags-admin.js +1 -0
- package/dist/endpoints/flags.d.ts +1 -1
- package/dist/endpoints/github.d.ts +3 -3
- package/dist/endpoints/image-opt.d.ts +2 -2
- package/dist/endpoints/kv-admin.d.ts +6 -6
- package/dist/endpoints/kv.d.ts +8 -8
- package/dist/endpoints/monitoring-admin.d.ts +10 -10
- package/dist/endpoints/monitoring.d.ts +2 -2
- package/dist/endpoints/newsletter.d.ts +30 -24
- package/dist/endpoints/newsletter.d.ts.map +1 -1
- package/dist/endpoints/newsletter.js +3 -0
- package/dist/endpoints/notifications-admin.d.ts +17 -17
- package/dist/endpoints/notifications.d.ts +16 -16
- package/dist/endpoints/oidc.d.ts +6 -4
- package/dist/endpoints/oidc.d.ts.map +1 -1
- package/dist/endpoints/oidc.js +1 -0
- package/dist/endpoints/organizations.d.ts +56 -48
- package/dist/endpoints/organizations.d.ts.map +1 -1
- package/dist/endpoints/organizations.js +4 -0
- package/dist/endpoints/plans.d.ts +9 -7
- package/dist/endpoints/plans.d.ts.map +1 -1
- package/dist/endpoints/plans.js +1 -0
- package/dist/endpoints/privacy.d.ts +11 -9
- package/dist/endpoints/privacy.d.ts.map +1 -1
- package/dist/endpoints/privacy.js +1 -0
- package/dist/endpoints/project-manifest.d.ts +18 -42
- package/dist/endpoints/project-manifest.d.ts.map +1 -1
- package/dist/endpoints/projects.d.ts +7 -5
- package/dist/endpoints/projects.d.ts.map +1 -1
- package/dist/endpoints/projects.js +2 -1
- package/dist/endpoints/rate-limits.d.ts +4 -4
- package/dist/endpoints/realtime-admin.d.ts +6 -4
- package/dist/endpoints/realtime-admin.d.ts.map +1 -1
- package/dist/endpoints/realtime-admin.js +1 -0
- package/dist/endpoints/realtime.d.ts +3 -3
- package/dist/endpoints/referrals-admin.d.ts +7 -5
- package/dist/endpoints/referrals-admin.d.ts.map +1 -1
- package/dist/endpoints/referrals-admin.js +1 -0
- package/dist/endpoints/refresh.d.ts +1 -1
- package/dist/endpoints/regions.d.ts +5 -22
- package/dist/endpoints/regions.d.ts.map +1 -1
- package/dist/endpoints/regions.js +5 -27
- package/dist/endpoints/runners.d.ts +4 -4
- package/dist/endpoints/saml.d.ts +13 -11
- package/dist/endpoints/saml.d.ts.map +1 -1
- package/dist/endpoints/saml.js +1 -0
- package/dist/endpoints/search.d.ts +3 -3
- package/dist/endpoints/secrets.d.ts +9 -7
- package/dist/endpoints/secrets.d.ts.map +1 -1
- package/dist/endpoints/secrets.js +1 -0
- package/dist/endpoints/security.d.ts +28 -28
- package/dist/endpoints/service-tokens.d.ts +20 -12
- package/dist/endpoints/service-tokens.d.ts.map +1 -1
- package/dist/endpoints/service-tokens.js +4 -0
- package/dist/endpoints/session-replay.d.ts +4 -4
- package/dist/endpoints/storage-admin.d.ts +14 -10
- package/dist/endpoints/storage-admin.d.ts.map +1 -1
- package/dist/endpoints/storage-admin.js +3 -1
- package/dist/endpoints/storage.d.ts +189 -131
- package/dist/endpoints/storage.d.ts.map +1 -1
- package/dist/endpoints/storage.js +96 -59
- package/dist/endpoints/tasks.d.ts +13 -9
- package/dist/endpoints/tasks.d.ts.map +1 -1
- package/dist/endpoints/tasks.js +2 -0
- package/dist/endpoints/users.d.ts +12 -12
- package/dist/endpoints/webhooks.d.ts +10 -10
- package/dist/hono-app.d.ts +55 -26
- package/dist/hono-app.d.ts.map +1 -1
- package/dist/index.d.ts +1720 -1209
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/schemas/admin-audit.d.ts +50 -0
- package/dist/schemas/admin-audit.d.ts.map +1 -1
- package/dist/schemas/admin-audit.js +43 -0
- package/dist/schemas/admin-billing.d.ts +19 -5
- package/dist/schemas/admin-billing.d.ts.map +1 -1
- package/dist/schemas/admin-billing.js +16 -5
- package/dist/schemas/admin-branch-databases.d.ts +34 -0
- package/dist/schemas/admin-branch-databases.d.ts.map +1 -0
- package/dist/schemas/admin-branch-databases.js +33 -0
- package/dist/schemas/admin-broadcasts.d.ts +6 -6
- package/dist/schemas/admin-broadcasts.d.ts.map +1 -1
- package/dist/schemas/admin-broadcasts.js +1 -1
- package/dist/schemas/admin-consent.d.ts +90 -6
- package/dist/schemas/admin-consent.d.ts.map +1 -1
- package/dist/schemas/admin-consent.js +50 -3
- package/dist/schemas/analytics-admin.d.ts +99 -9
- package/dist/schemas/analytics-admin.d.ts.map +1 -1
- package/dist/schemas/analytics-admin.js +70 -0
- package/dist/schemas/auth.d.ts +54 -0
- package/dist/schemas/auth.d.ts.map +1 -1
- package/dist/schemas/auth.js +22 -0
- package/dist/schemas/database.d.ts +1 -0
- package/dist/schemas/database.d.ts.map +1 -1
- package/dist/schemas/database.js +1 -0
- package/dist/schemas/deployment.d.ts +53 -0
- package/dist/schemas/deployment.d.ts.map +1 -1
- package/dist/schemas/deployment.js +53 -1
- package/dist/schemas/experiments.d.ts +13 -33
- package/dist/schemas/experiments.d.ts.map +1 -1
- package/dist/schemas/experiments.js +5 -4
- package/dist/schemas/flags-admin.d.ts +115 -19
- package/dist/schemas/flags-admin.d.ts.map +1 -1
- package/dist/schemas/flags-admin.js +28 -8
- package/dist/schemas/ids.d.ts +2 -0
- package/dist/schemas/ids.d.ts.map +1 -1
- package/dist/schemas/ids.js +1 -0
- package/dist/schemas/project-manifest.d.ts +16 -70
- package/dist/schemas/project-manifest.d.ts.map +1 -1
- package/dist/schemas/project-manifest.js +0 -21
- package/dist/schemas/project.d.ts +3 -3
- package/dist/schemas/project.d.ts.map +1 -1
- package/dist/schemas/project.js +2 -2
- package/dist/schemas/region.d.ts +4 -52
- package/dist/schemas/region.d.ts.map +1 -1
- package/dist/schemas/region.js +4 -46
- package/dist/schemas/resources.d.ts +55 -4
- package/dist/schemas/resources.d.ts.map +1 -1
- package/dist/schemas/resources.js +52 -1
- package/dist/schemas/storage.d.ts +259 -198
- package/dist/schemas/storage.d.ts.map +1 -1
- package/dist/schemas/storage.js +159 -140
- package/package.json +1 -1
- package/dist/endpoints/edge-deployments.d.ts +0 -92
- package/dist/endpoints/edge-deployments.d.ts.map +0 -1
- package/dist/endpoints/edge-deployments.js +0 -58
- package/dist/schemas/edge-deployments.d.ts +0 -140
- package/dist/schemas/edge-deployments.d.ts.map +0 -1
- package/dist/schemas/edge-deployments.js +0 -87
package/dist/schemas/storage.js
CHANGED
|
@@ -1,174 +1,193 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Storage — BaaS plane
|
|
3
|
-
* S3 convention. Mirrors `@sylphx/sdk/storage.ts`.
|
|
2
|
+
* Storage — BaaS plane object storage. Per ADR-100.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* Wire is one resource (`uploads`) plus the existing `files` resource. No
|
|
5
|
+
* polymorphic POSTs, no vendor-namespaced wire envelopes, no historical
|
|
6
|
+
* field aliases. Every endpoint has exactly one request and one response
|
|
7
|
+
* schema.
|
|
8
|
+
*
|
|
9
|
+
* Storage backends (B2, R2) are abstracted by `apps/storage-gateway`. The
|
|
10
|
+
* BaaS handler returns presigned URLs against `storage.sylphx.com`; the
|
|
11
|
+
* client uploads bytes there directly. Mid-flow tenant subdomain hops are
|
|
12
|
+
* forbidden (ADR-083.1).
|
|
11
13
|
*/
|
|
12
14
|
import { Schema } from 'effect';
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Branded identifiers
|
|
17
|
+
// ============================================================================
|
|
13
18
|
export const FileId = Schema.String.pipe(Schema.brand('FileId'));
|
|
19
|
+
export const UploadId = Schema.String.pipe(Schema.brand('UploadId'));
|
|
20
|
+
export const FileVersionId = Schema.String.pipe(Schema.brand('FileVersionId'));
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// Enumerations
|
|
23
|
+
// ============================================================================
|
|
24
|
+
export const FileVisibility = Schema.Literal('public', 'private');
|
|
25
|
+
export const SignedUrlDisposition = Schema.Literal('attachment', 'inline');
|
|
26
|
+
/** Method discriminator on the upload-create response. */
|
|
27
|
+
export const UploadMethod = Schema.Literal('PUT', 'MULTIPART');
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Core types
|
|
30
|
+
// ============================================================================
|
|
14
31
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* - SDK `FileInfo` interface: `{ id, url, name, size, contentType,
|
|
18
|
-
* isPrivate, createdAt }`
|
|
19
|
-
* - Generated OpenAPI `FileInfo` / `GetFileResponse`: `{ id, filename,
|
|
20
|
-
* path, url, mimeType, size, metadata, createdAt }`
|
|
21
|
-
* - Previous contract shape: `{ id, key, size, contentType, url?,
|
|
22
|
-
* uploadedAt }`
|
|
23
|
-
*
|
|
24
|
-
* Every historical field is preserved as optional so older and newer
|
|
25
|
-
* clients can both parse server responses. `id` and `size` are the only
|
|
26
|
-
* guaranteed-present fields across all three shapes.
|
|
32
|
+
* Canonical file metadata. Single shape — no aliases, no nullable hacks
|
|
33
|
+
* for legacy callers. ADR-100 §2.6.
|
|
27
34
|
*/
|
|
28
|
-
export const
|
|
29
|
-
id:
|
|
35
|
+
export const File = Schema.Struct({
|
|
36
|
+
id: FileId,
|
|
37
|
+
filename: Schema.String,
|
|
38
|
+
contentType: Schema.String,
|
|
30
39
|
size: Schema.Number,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
createdAt: Schema.
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
checksumSha256: Schema.String,
|
|
41
|
+
etag: Schema.String,
|
|
42
|
+
visibility: FileVisibility,
|
|
43
|
+
folder: Schema.NullOr(Schema.String),
|
|
44
|
+
metadata: Schema.Record({ key: Schema.String, value: Schema.Unknown }),
|
|
45
|
+
/** Public URL when `visibility === 'public'`; `null` otherwise. Use `:signedUrl` for private files. */
|
|
46
|
+
url: Schema.NullOr(Schema.String),
|
|
47
|
+
isDeleted: Schema.Boolean,
|
|
48
|
+
createdAt: Schema.DateFromString,
|
|
49
|
+
updatedAt: Schema.DateFromString,
|
|
50
|
+
});
|
|
51
|
+
export const FileVersion = Schema.Struct({
|
|
52
|
+
id: FileVersionId,
|
|
53
|
+
fileId: FileId,
|
|
54
|
+
versionNumber: Schema.Number,
|
|
55
|
+
size: Schema.Number,
|
|
56
|
+
contentType: Schema.String,
|
|
57
|
+
checksumSha256: Schema.String,
|
|
58
|
+
etag: Schema.String,
|
|
59
|
+
createdAt: Schema.DateFromString,
|
|
60
|
+
createdBy: Schema.NullOr(Schema.String),
|
|
61
|
+
isCurrent: Schema.Boolean,
|
|
62
|
+
});
|
|
63
|
+
// ============================================================================
|
|
64
|
+
// Upload session — POST /v1/storage/uploads
|
|
65
|
+
// ============================================================================
|
|
66
|
+
export const UploadCreateRequest = Schema.Struct({
|
|
67
|
+
filename: Schema.String.pipe(Schema.minLength(1)),
|
|
68
|
+
contentType: Schema.String.pipe(Schema.minLength(1)),
|
|
69
|
+
size: Schema.Number.pipe(Schema.greaterThanOrEqualTo(0)),
|
|
70
|
+
folder: Schema.optional(Schema.String),
|
|
71
|
+
visibility: Schema.optional(FileVisibility),
|
|
72
|
+
metadata: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Unknown })),
|
|
73
|
+
/** Pre-computed SHA-256 (hex); verified server-side on `:complete` (multipart) or after PUT (single). */
|
|
74
|
+
checksumSha256: Schema.optional(Schema.String),
|
|
75
|
+
/** S3-style precondition; if `'*'`, fail when a file already exists at (folder, filename). */
|
|
76
|
+
ifNoneMatch: Schema.optional(Schema.Literal('*')),
|
|
77
|
+
});
|
|
78
|
+
export const UploadPart = Schema.Struct({
|
|
79
|
+
partNumber: Schema.Number.pipe(Schema.greaterThanOrEqualTo(1)),
|
|
80
|
+
url: Schema.String,
|
|
81
|
+
expiresAt: Schema.DateFromString,
|
|
53
82
|
});
|
|
54
83
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
84
|
+
* Single-part response — the request body fits in one PUT. Client uploads
|
|
85
|
+
* the whole blob to `url` with the supplied `headers`, captures the `ETag`
|
|
86
|
+
* response header, then calls `:complete` with `parts: [{partNumber: 1,
|
|
87
|
+
* etag}]` to finalise. The `:complete` step is non-optional even for
|
|
88
|
+
* single-part uploads because it is what writes the file row to the
|
|
89
|
+
* database and consumes quota — without it the storage object is
|
|
90
|
+
* orphaned and reclaimed by the multipart-aborts sweeper after
|
|
91
|
+
* `expiresAt`.
|
|
59
92
|
*/
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
type: Schema.optional(Schema.Literal('file', 'avatar')),
|
|
68
|
-
/** User ID (required for `type: 'avatar'`). */
|
|
69
|
-
userId: Schema.optional(Schema.String),
|
|
70
|
-
/** Arbitrary caller-attached metadata persisted alongside the blob. */
|
|
71
|
-
metadata: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Unknown })),
|
|
93
|
+
export const UploadCreateSinglePartResult = Schema.Struct({
|
|
94
|
+
method: Schema.Literal('PUT'),
|
|
95
|
+
uploadId: UploadId,
|
|
96
|
+
fileId: FileId,
|
|
97
|
+
url: Schema.String,
|
|
98
|
+
headers: Schema.Record({ key: Schema.String, value: Schema.String }),
|
|
99
|
+
expiresAt: Schema.DateFromString,
|
|
72
100
|
});
|
|
73
101
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* `{ uploadEndpoint, clientPayload, instructions, ... }` shape.
|
|
102
|
+
* Multipart response — client PUTs each part to its presigned URL, then
|
|
103
|
+
* calls `POST /uploads/{uploadId}:complete` with the per-part etags.
|
|
77
104
|
*/
|
|
78
|
-
export const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
export const UploadCreateMultipartResult = Schema.Struct({
|
|
106
|
+
method: Schema.Literal('MULTIPART'),
|
|
107
|
+
uploadId: UploadId,
|
|
108
|
+
fileId: FileId,
|
|
109
|
+
partSize: Schema.Number,
|
|
110
|
+
partCount: Schema.Number,
|
|
111
|
+
parts: Schema.Array(UploadPart),
|
|
112
|
+
expiresAt: Schema.DateFromString,
|
|
113
|
+
});
|
|
114
|
+
/**
|
|
115
|
+
* Discriminated union on `method`. SDK narrows via the literal; downstream
|
|
116
|
+
* code never has to inspect optional fields.
|
|
117
|
+
*/
|
|
118
|
+
export const UploadCreateResult = Schema.Union(UploadCreateSinglePartResult, UploadCreateMultipartResult);
|
|
119
|
+
// ============================================================================
|
|
120
|
+
// Multipart support
|
|
121
|
+
// ============================================================================
|
|
122
|
+
/** Refresh a single part presigned URL — used when an upload pauses past `expiresAt`. */
|
|
123
|
+
export const UploadPartPresignResult = Schema.Struct({
|
|
124
|
+
url: Schema.String,
|
|
125
|
+
expiresAt: Schema.DateFromString,
|
|
126
|
+
});
|
|
127
|
+
export const UploadCompletePart = Schema.Struct({
|
|
128
|
+
partNumber: Schema.Number.pipe(Schema.greaterThanOrEqualTo(1)),
|
|
129
|
+
etag: Schema.String.pipe(Schema.minLength(1)),
|
|
102
130
|
});
|
|
103
|
-
export const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
131
|
+
export const UploadCompleteRequest = Schema.Struct({
|
|
132
|
+
parts: Schema.Array(UploadCompletePart),
|
|
133
|
+
});
|
|
134
|
+
export const UploadCompleteResult = Schema.Struct({
|
|
135
|
+
fileId: FileId,
|
|
136
|
+
url: Schema.NullOr(Schema.String),
|
|
137
|
+
size: Schema.Number,
|
|
138
|
+
etag: Schema.String,
|
|
139
|
+
checksumSha256: Schema.String,
|
|
107
140
|
});
|
|
141
|
+
// ============================================================================
|
|
142
|
+
// Files resource
|
|
143
|
+
// ============================================================================
|
|
108
144
|
export const ListFilesQuery = Schema.Struct({
|
|
109
|
-
|
|
110
|
-
limit: Schema.optional(Schema.String),
|
|
145
|
+
folder: Schema.optional(Schema.String),
|
|
111
146
|
cursor: Schema.optional(Schema.String),
|
|
147
|
+
/** Page size; clamped server-side to [1, 100]; default 25. */
|
|
148
|
+
limit: Schema.optional(Schema.Number),
|
|
149
|
+
includeDeleted: Schema.optional(Schema.Boolean),
|
|
112
150
|
});
|
|
113
151
|
export const ListFilesResult = Schema.Struct({
|
|
114
|
-
files: Schema.Array(
|
|
152
|
+
files: Schema.Array(File),
|
|
115
153
|
nextCursor: Schema.NullOr(Schema.String),
|
|
116
|
-
/** True if there are more files beyond this page. */
|
|
117
|
-
hasMore: Schema.optional(Schema.Boolean),
|
|
118
154
|
});
|
|
119
|
-
export const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
disposition: Schema.optional(
|
|
130
|
-
/** Restrict URL
|
|
155
|
+
export const SoftDeleteFileResult = Schema.Struct({
|
|
156
|
+
id: FileId,
|
|
157
|
+
isDeleted: Schema.Literal(true),
|
|
158
|
+
});
|
|
159
|
+
export const RestoreFileResult = File;
|
|
160
|
+
// ============================================================================
|
|
161
|
+
// Signed URLs
|
|
162
|
+
// ============================================================================
|
|
163
|
+
export const SignedUrlRequest = Schema.Struct({
|
|
164
|
+
expiresIn: Schema.optional(Schema.Number.pipe(Schema.greaterThanOrEqualTo(1))),
|
|
165
|
+
disposition: Schema.optional(SignedUrlDisposition),
|
|
166
|
+
/** Restrict the signed URL to a specific authenticated user (claim baked into the signature). */
|
|
131
167
|
userId: Schema.optional(Schema.String),
|
|
132
168
|
});
|
|
133
169
|
export const SignedUrlResult = Schema.Struct({
|
|
134
170
|
url: Schema.String,
|
|
135
|
-
expiresAt: Schema.
|
|
136
|
-
file:
|
|
137
|
-
id: Schema.String,
|
|
138
|
-
filename: Schema.String,
|
|
139
|
-
mimeType: Schema.String,
|
|
140
|
-
sizeBytes: Schema.Number,
|
|
141
|
-
isPrivate: Schema.Boolean,
|
|
142
|
-
}),
|
|
171
|
+
expiresAt: Schema.DateFromString,
|
|
172
|
+
file: File,
|
|
143
173
|
});
|
|
144
174
|
// ============================================================================
|
|
145
|
-
//
|
|
175
|
+
// Copy
|
|
146
176
|
// ============================================================================
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
*/
|
|
153
|
-
export const StorageFileVersion = Schema.Struct({
|
|
154
|
-
id: Schema.String,
|
|
155
|
-
fileId: Schema.String,
|
|
156
|
-
versionNumber: Schema.Number,
|
|
157
|
-
sizeBytes: Schema.Number,
|
|
158
|
-
contentType: Schema.NullOr(Schema.String),
|
|
159
|
-
checksumSha256: Schema.NullOr(Schema.String),
|
|
160
|
-
createdAt: Schema.String,
|
|
161
|
-
createdBy: Schema.NullOr(Schema.String),
|
|
162
|
-
isCurrent: Schema.Boolean,
|
|
177
|
+
export const CopyFileRequest = Schema.Struct({
|
|
178
|
+
folder: Schema.optional(Schema.String),
|
|
179
|
+
filename: Schema.optional(Schema.String),
|
|
180
|
+
visibility: Schema.optional(FileVisibility),
|
|
181
|
+
metadata: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Unknown })),
|
|
163
182
|
});
|
|
183
|
+
export const CopyFileResult = File;
|
|
184
|
+
// ============================================================================
|
|
185
|
+
// Versions
|
|
186
|
+
// ============================================================================
|
|
164
187
|
export const ListFileVersionsResult = Schema.Struct({
|
|
165
|
-
versions: Schema.Array(
|
|
188
|
+
versions: Schema.Array(FileVersion),
|
|
166
189
|
});
|
|
167
190
|
export const RestoreVersionResult = Schema.Struct({
|
|
168
|
-
|
|
169
|
-
version:
|
|
170
|
-
});
|
|
171
|
-
export const RestoreFileResult = Schema.Struct({
|
|
172
|
-
success: Schema.Literal(true),
|
|
173
|
-
file: FileInfo,
|
|
191
|
+
file: File,
|
|
192
|
+
version: FileVersion,
|
|
174
193
|
});
|
package/package.json
CHANGED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Edge Deployment endpoints — customer edge Workers, Management plane.
|
|
3
|
-
*
|
|
4
|
-
* Mount: `/projects/:id/edge-deployments` (see
|
|
5
|
-
* `apps/api/src/server/platform/routes/edge-deployments.ts`). Scaffold stage:
|
|
6
|
-
* handlers accept the upload and log "CF Workers API integration pending".
|
|
7
|
-
*
|
|
8
|
-
* Design reference: `docs/design/edge-functions-isr-image-opt.md` § 3.1 + § 6.
|
|
9
|
-
*/
|
|
10
|
-
import { Schema } from 'effect';
|
|
11
|
-
export declare const edgeDeploymentsEndpoints: {
|
|
12
|
-
readonly create: import("../endpoint.js").Endpoint<"POST", "/projects/:id/edge-deployments", Schema.Struct<{
|
|
13
|
-
id: typeof Schema.String;
|
|
14
|
-
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
15
|
-
environmentId: typeof Schema.String;
|
|
16
|
-
bundle: typeof Schema.String;
|
|
17
|
-
routes: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
18
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
19
|
-
path: Schema.filter<typeof Schema.String>;
|
|
20
|
-
}>>>;
|
|
21
|
-
label: Schema.optional<typeof Schema.String>;
|
|
22
|
-
}>, Schema.Struct<{
|
|
23
|
-
deployment: Schema.Struct<{
|
|
24
|
-
id: typeof Schema.String;
|
|
25
|
-
projectId: typeof Schema.String;
|
|
26
|
-
environmentId: typeof Schema.String;
|
|
27
|
-
workerName: typeof Schema.String;
|
|
28
|
-
version: typeof Schema.String;
|
|
29
|
-
routes: Schema.Array$<Schema.Struct<{
|
|
30
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
31
|
-
path: Schema.filter<typeof Schema.String>;
|
|
32
|
-
}>>;
|
|
33
|
-
status: Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>;
|
|
34
|
-
error: Schema.NullOr<typeof Schema.String>;
|
|
35
|
-
bundleSizeBytes: typeof Schema.Number;
|
|
36
|
-
deployedBy: typeof Schema.String;
|
|
37
|
-
deployedAt: typeof Schema.String;
|
|
38
|
-
}>;
|
|
39
|
-
}>>;
|
|
40
|
-
readonly list: import("../endpoint.js").Endpoint<"GET", "/projects/:id/edge-deployments", Schema.Struct<{
|
|
41
|
-
id: typeof Schema.String;
|
|
42
|
-
}>, Schema.Struct<{
|
|
43
|
-
environmentId: Schema.optional<typeof Schema.String>;
|
|
44
|
-
status: Schema.optional<Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>>;
|
|
45
|
-
limit: Schema.optional<typeof Schema.String>;
|
|
46
|
-
offset: Schema.optional<typeof Schema.String>;
|
|
47
|
-
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
48
|
-
deployments: Schema.Array$<Schema.Struct<{
|
|
49
|
-
id: typeof Schema.String;
|
|
50
|
-
projectId: typeof Schema.String;
|
|
51
|
-
environmentId: typeof Schema.String;
|
|
52
|
-
workerName: typeof Schema.String;
|
|
53
|
-
version: typeof Schema.String;
|
|
54
|
-
routes: Schema.Array$<Schema.Struct<{
|
|
55
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
56
|
-
path: Schema.filter<typeof Schema.String>;
|
|
57
|
-
}>>;
|
|
58
|
-
status: Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>;
|
|
59
|
-
error: Schema.NullOr<typeof Schema.String>;
|
|
60
|
-
bundleSizeBytes: typeof Schema.Number;
|
|
61
|
-
deployedBy: typeof Schema.String;
|
|
62
|
-
deployedAt: typeof Schema.String;
|
|
63
|
-
}>>;
|
|
64
|
-
total: typeof Schema.Number;
|
|
65
|
-
}>>;
|
|
66
|
-
readonly get: import("../endpoint.js").Endpoint<"GET", "/projects/:id/edge-deployments/:deploymentId", Schema.Struct<{
|
|
67
|
-
id: typeof Schema.String;
|
|
68
|
-
deploymentId: typeof Schema.String;
|
|
69
|
-
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
70
|
-
id: typeof Schema.String;
|
|
71
|
-
projectId: typeof Schema.String;
|
|
72
|
-
environmentId: typeof Schema.String;
|
|
73
|
-
workerName: typeof Schema.String;
|
|
74
|
-
version: typeof Schema.String;
|
|
75
|
-
routes: Schema.Array$<Schema.Struct<{
|
|
76
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
77
|
-
path: Schema.filter<typeof Schema.String>;
|
|
78
|
-
}>>;
|
|
79
|
-
status: Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>;
|
|
80
|
-
error: Schema.NullOr<typeof Schema.String>;
|
|
81
|
-
bundleSizeBytes: typeof Schema.Number;
|
|
82
|
-
deployedBy: typeof Schema.String;
|
|
83
|
-
deployedAt: typeof Schema.String;
|
|
84
|
-
}>>;
|
|
85
|
-
readonly delete: import("../endpoint.js").Endpoint<"DELETE", "/projects/:id/edge-deployments/:deploymentId", Schema.Struct<{
|
|
86
|
-
id: typeof Schema.String;
|
|
87
|
-
deploymentId: typeof Schema.String;
|
|
88
|
-
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
89
|
-
deleted: typeof Schema.Boolean;
|
|
90
|
-
}>>;
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=edge-deployments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-deployments.d.ts","sourceRoot":"","sources":["../../src/endpoints/edge-deployments.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAiB/B,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC3B,CAAA"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Edge Deployment endpoints — customer edge Workers, Management plane.
|
|
3
|
-
*
|
|
4
|
-
* Mount: `/projects/:id/edge-deployments` (see
|
|
5
|
-
* `apps/api/src/server/platform/routes/edge-deployments.ts`). Scaffold stage:
|
|
6
|
-
* handlers accept the upload and log "CF Workers API integration pending".
|
|
7
|
-
*
|
|
8
|
-
* Design reference: `docs/design/edge-functions-isr-image-opt.md` § 3.1 + § 6.
|
|
9
|
-
*/
|
|
10
|
-
import { Schema } from 'effect';
|
|
11
|
-
import { defineEndpoint } from '../endpoint.js';
|
|
12
|
-
import { CreateEdgeDeploymentInput, CreateEdgeDeploymentResult, DeleteEdgeDeploymentResult, EdgeDeployment, ListEdgeDeploymentsQuery, ListEdgeDeploymentsResult, } from '../schemas/edge-deployments.js';
|
|
13
|
-
const ProjectPath = Schema.Struct({ id: Schema.String });
|
|
14
|
-
const ProjectAndDeploymentPath = Schema.Struct({
|
|
15
|
-
id: Schema.String,
|
|
16
|
-
deploymentId: Schema.String,
|
|
17
|
-
});
|
|
18
|
-
export const edgeDeploymentsEndpoints = {
|
|
19
|
-
create: defineEndpoint({
|
|
20
|
-
method: 'POST',
|
|
21
|
-
path: '/projects/:id/edge-deployments',
|
|
22
|
-
params: ProjectPath,
|
|
23
|
-
body: CreateEdgeDeploymentInput,
|
|
24
|
-
response: CreateEdgeDeploymentResult,
|
|
25
|
-
plane: 'management',
|
|
26
|
-
summary: 'Upload a bundled edge Worker and record the deployment',
|
|
27
|
-
description: "Accepts a base64-encoded ESM bundle from `sylphx edge deploy`. The Platform API records the deployment row and forwards to the Cloudflare Workers Platform API on the caller's behalf.",
|
|
28
|
-
tags: ['edge-deployments'],
|
|
29
|
-
}),
|
|
30
|
-
list: defineEndpoint({
|
|
31
|
-
method: 'GET',
|
|
32
|
-
path: '/projects/:id/edge-deployments',
|
|
33
|
-
params: ProjectPath,
|
|
34
|
-
query: ListEdgeDeploymentsQuery,
|
|
35
|
-
response: ListEdgeDeploymentsResult,
|
|
36
|
-
plane: 'management',
|
|
37
|
-
summary: 'List edge deployments for a project',
|
|
38
|
-
tags: ['edge-deployments'],
|
|
39
|
-
}),
|
|
40
|
-
get: defineEndpoint({
|
|
41
|
-
method: 'GET',
|
|
42
|
-
path: '/projects/:id/edge-deployments/:deploymentId',
|
|
43
|
-
params: ProjectAndDeploymentPath,
|
|
44
|
-
response: EdgeDeployment,
|
|
45
|
-
plane: 'management',
|
|
46
|
-
summary: 'Get a single edge deployment by id',
|
|
47
|
-
tags: ['edge-deployments'],
|
|
48
|
-
}),
|
|
49
|
-
delete: defineEndpoint({
|
|
50
|
-
method: 'DELETE',
|
|
51
|
-
path: '/projects/:id/edge-deployments/:deploymentId',
|
|
52
|
-
params: ProjectAndDeploymentPath,
|
|
53
|
-
response: DeleteEdgeDeploymentResult,
|
|
54
|
-
plane: 'management',
|
|
55
|
-
summary: 'Retire an edge deployment (removes the Worker script on Cloudflare once integrated)',
|
|
56
|
-
tags: ['edge-deployments'],
|
|
57
|
-
}),
|
|
58
|
-
};
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Edge Deployments — customer code that runs on Cloudflare Workers at the
|
|
3
|
-
* edge. Part of the P1 gap #10 design (`docs/design/edge-functions-isr-image-opt.md`).
|
|
4
|
-
*
|
|
5
|
-
* Plane: `management` — customers call `POST /projects/:id/edge-deployments`
|
|
6
|
-
* via the CLI (`sylphx edge deploy`) to upload a pre-bundled ESM script. The
|
|
7
|
-
* Platform API then speaks to Cloudflare's Workers Platform API on their
|
|
8
|
-
* behalf (credentials never touch the customer machine, per § 8 of the design).
|
|
9
|
-
*
|
|
10
|
-
* The wire shapes are intentionally minimal for the scaffold step. When the
|
|
11
|
-
* real Cloudflare integration lands, `CreateEdgeDeploymentInput` will grow
|
|
12
|
-
* bindings / secrets / dispatch-namespace hints — but every new field must
|
|
13
|
-
* pass through this contract (ADR-084 Rule 1).
|
|
14
|
-
*/
|
|
15
|
-
import { Schema } from 'effect';
|
|
16
|
-
/** Lifecycle of a single edge-deployment row. Mirrors `edge_deployments.state` in the design doc (§ 5). */
|
|
17
|
-
export declare const EdgeDeploymentStatus: Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>;
|
|
18
|
-
export type EdgeDeploymentStatus = typeof EdgeDeploymentStatus.Type;
|
|
19
|
-
/** A single HTTP method + path combo the worker handles (e.g. GET /api/hello). */
|
|
20
|
-
export declare const EdgeRoute: Schema.Struct<{
|
|
21
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
22
|
-
path: Schema.filter<typeof Schema.String>;
|
|
23
|
-
}>;
|
|
24
|
-
export type EdgeRoute = typeof EdgeRoute.Type;
|
|
25
|
-
/** Single deployment record. Mirrors the `edge_deployments` table in the design doc. */
|
|
26
|
-
export declare const EdgeDeployment: Schema.Struct<{
|
|
27
|
-
/** TypeID `edge_xxx`. */
|
|
28
|
-
id: typeof Schema.String;
|
|
29
|
-
/** TypeID `proj_xxx`. */
|
|
30
|
-
projectId: typeof Schema.String;
|
|
31
|
-
/** TypeID `env_xxx`. */
|
|
32
|
-
environmentId: typeof Schema.String;
|
|
33
|
-
/** Cloudflare dispatch namespace + script id (e.g. `sylphx-prod/proj_abc-v3`). */
|
|
34
|
-
workerName: typeof Schema.String;
|
|
35
|
-
/** Cloudflare script tag — opaque per upload, used for rollback. */
|
|
36
|
-
version: typeof Schema.String;
|
|
37
|
-
/** Every URL pattern the deployment claims. */
|
|
38
|
-
routes: Schema.Array$<Schema.Struct<{
|
|
39
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
40
|
-
path: Schema.filter<typeof Schema.String>;
|
|
41
|
-
}>>;
|
|
42
|
-
status: Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>;
|
|
43
|
-
/** Populated only when `status === 'failed'`. */
|
|
44
|
-
error: Schema.NullOr<typeof Schema.String>;
|
|
45
|
-
/** Byte size of the uploaded bundle — useful for quota displays. */
|
|
46
|
-
bundleSizeBytes: typeof Schema.Number;
|
|
47
|
-
/** TypeID `user_xxx` of the operator who triggered the deploy. */
|
|
48
|
-
deployedBy: typeof Schema.String;
|
|
49
|
-
deployedAt: typeof Schema.String;
|
|
50
|
-
}>;
|
|
51
|
-
export type EdgeDeployment = typeof EdgeDeployment.Type;
|
|
52
|
-
/**
|
|
53
|
-
* Create-deployment body. The `bundle` field carries the raw ESM script as
|
|
54
|
-
* a base64 string — matches the CLI's `bundle → base64 → POST` flow. For
|
|
55
|
-
* larger bundles (> 1 MB) a follow-up multipart endpoint will land; scope
|
|
56
|
-
* for the scaffold is the small-bundle path only.
|
|
57
|
-
*/
|
|
58
|
-
export declare const CreateEdgeDeploymentInput: Schema.Struct<{
|
|
59
|
-
/** Target environment for the deployment (dev / preview / production). */
|
|
60
|
-
environmentId: typeof Schema.String;
|
|
61
|
-
/** Base64-encoded ESM worker bundle. */
|
|
62
|
-
bundle: typeof Schema.String;
|
|
63
|
-
/** Optional route hints; server can also infer from the bundle on deploy. */
|
|
64
|
-
routes: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
65
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
66
|
-
path: Schema.filter<typeof Schema.String>;
|
|
67
|
-
}>>>;
|
|
68
|
-
/** Human label surfaced in the Console deploy list. */
|
|
69
|
-
label: Schema.optional<typeof Schema.String>;
|
|
70
|
-
}>;
|
|
71
|
-
export type CreateEdgeDeploymentInput = typeof CreateEdgeDeploymentInput.Type;
|
|
72
|
-
export declare const CreateEdgeDeploymentResult: Schema.Struct<{
|
|
73
|
-
deployment: Schema.Struct<{
|
|
74
|
-
/** TypeID `edge_xxx`. */
|
|
75
|
-
id: typeof Schema.String;
|
|
76
|
-
/** TypeID `proj_xxx`. */
|
|
77
|
-
projectId: typeof Schema.String;
|
|
78
|
-
/** TypeID `env_xxx`. */
|
|
79
|
-
environmentId: typeof Schema.String;
|
|
80
|
-
/** Cloudflare dispatch namespace + script id (e.g. `sylphx-prod/proj_abc-v3`). */
|
|
81
|
-
workerName: typeof Schema.String;
|
|
82
|
-
/** Cloudflare script tag — opaque per upload, used for rollback. */
|
|
83
|
-
version: typeof Schema.String;
|
|
84
|
-
/** Every URL pattern the deployment claims. */
|
|
85
|
-
routes: Schema.Array$<Schema.Struct<{
|
|
86
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
87
|
-
path: Schema.filter<typeof Schema.String>;
|
|
88
|
-
}>>;
|
|
89
|
-
status: Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>;
|
|
90
|
-
/** Populated only when `status === 'failed'`. */
|
|
91
|
-
error: Schema.NullOr<typeof Schema.String>;
|
|
92
|
-
/** Byte size of the uploaded bundle — useful for quota displays. */
|
|
93
|
-
bundleSizeBytes: typeof Schema.Number;
|
|
94
|
-
/** TypeID `user_xxx` of the operator who triggered the deploy. */
|
|
95
|
-
deployedBy: typeof Schema.String;
|
|
96
|
-
deployedAt: typeof Schema.String;
|
|
97
|
-
}>;
|
|
98
|
-
}>;
|
|
99
|
-
export type CreateEdgeDeploymentResult = typeof CreateEdgeDeploymentResult.Type;
|
|
100
|
-
export declare const ListEdgeDeploymentsResult: Schema.Struct<{
|
|
101
|
-
deployments: Schema.Array$<Schema.Struct<{
|
|
102
|
-
/** TypeID `edge_xxx`. */
|
|
103
|
-
id: typeof Schema.String;
|
|
104
|
-
/** TypeID `proj_xxx`. */
|
|
105
|
-
projectId: typeof Schema.String;
|
|
106
|
-
/** TypeID `env_xxx`. */
|
|
107
|
-
environmentId: typeof Schema.String;
|
|
108
|
-
/** Cloudflare dispatch namespace + script id (e.g. `sylphx-prod/proj_abc-v3`). */
|
|
109
|
-
workerName: typeof Schema.String;
|
|
110
|
-
/** Cloudflare script tag — opaque per upload, used for rollback. */
|
|
111
|
-
version: typeof Schema.String;
|
|
112
|
-
/** Every URL pattern the deployment claims. */
|
|
113
|
-
routes: Schema.Array$<Schema.Struct<{
|
|
114
|
-
method: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "*"]>;
|
|
115
|
-
path: Schema.filter<typeof Schema.String>;
|
|
116
|
-
}>>;
|
|
117
|
-
status: Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>;
|
|
118
|
-
/** Populated only when `status === 'failed'`. */
|
|
119
|
-
error: Schema.NullOr<typeof Schema.String>;
|
|
120
|
-
/** Byte size of the uploaded bundle — useful for quota displays. */
|
|
121
|
-
bundleSizeBytes: typeof Schema.Number;
|
|
122
|
-
/** TypeID `user_xxx` of the operator who triggered the deploy. */
|
|
123
|
-
deployedBy: typeof Schema.String;
|
|
124
|
-
deployedAt: typeof Schema.String;
|
|
125
|
-
}>>;
|
|
126
|
-
total: typeof Schema.Number;
|
|
127
|
-
}>;
|
|
128
|
-
export type ListEdgeDeploymentsResult = typeof ListEdgeDeploymentsResult.Type;
|
|
129
|
-
export declare const DeleteEdgeDeploymentResult: Schema.Struct<{
|
|
130
|
-
deleted: typeof Schema.Boolean;
|
|
131
|
-
}>;
|
|
132
|
-
export type DeleteEdgeDeploymentResult = typeof DeleteEdgeDeploymentResult.Type;
|
|
133
|
-
export declare const ListEdgeDeploymentsQuery: Schema.Struct<{
|
|
134
|
-
environmentId: Schema.optional<typeof Schema.String>;
|
|
135
|
-
status: Schema.optional<Schema.Literal<["pending", "deploying", "active", "failed", "retired"]>>;
|
|
136
|
-
limit: Schema.optional<typeof Schema.String>;
|
|
137
|
-
offset: Schema.optional<typeof Schema.String>;
|
|
138
|
-
}>;
|
|
139
|
-
export type ListEdgeDeploymentsQuery = typeof ListEdgeDeploymentsQuery.Type;
|
|
140
|
-
//# sourceMappingURL=edge-deployments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-deployments.d.ts","sourceRoot":"","sources":["../../src/schemas/edge-deployments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAI/B,2GAA2G;AAC3G,eAAO,MAAM,oBAAoB,yEAMhC,CAAA;AACD,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAA;AAInE,kFAAkF;AAClF,eAAO,MAAM,SAAS;;;EAGpB,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAI7C,wFAAwF;AACxF,eAAO,MAAM,cAAc;IAC1B,yBAAyB;;IAEzB,yBAAyB;;IAEzB,wBAAwB;;IAExB,kFAAkF;;IAElF,oEAAoE;;IAEpE,+CAA+C;;;;;;IAG/C,iDAAiD;;IAEjD,oEAAoE;;IAEpE,kEAAkE;;;EAGjE,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAIvD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;IACrC,0EAA0E;;IAE1E,wCAAwC;;IAExC,6EAA6E;;;;;IAE7E,uDAAuD;;EAEtD,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC,IAAI,CAAA;AAI7E,eAAO,MAAM,0BAA0B;;QA7CtC,yBAAyB;;QAEzB,yBAAyB;;QAEzB,wBAAwB;;QAExB,kFAAkF;;QAElF,oEAAoE;;QAEpE,+CAA+C;;;;;;QAG/C,iDAAiD;;QAEjD,oEAAoE;;QAEpE,kEAAkE;;;;EA8BjE,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAC,IAAI,CAAA;AAE/E,eAAO,MAAM,yBAAyB;;QAlDrC,yBAAyB;;QAEzB,yBAAyB;;QAEzB,wBAAwB;;QAExB,kFAAkF;;QAElF,oEAAoE;;QAEpE,+CAA+C;;;;;;QAG/C,iDAAiD;;QAEjD,oEAAoE;;QAEpE,kEAAkE;;;;;EAoCjE,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC,IAAI,CAAA;AAE7E,eAAO,MAAM,0BAA0B;;EAErC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAC,IAAI,CAAA;AAI/E,eAAO,MAAM,wBAAwB;;;;;EAKnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,IAAI,CAAA"}
|