@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
|
@@ -1,106 +1,143 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Storage endpoints — BaaS plane.
|
|
2
|
+
* Storage endpoints — BaaS plane. Per ADR-100.
|
|
3
|
+
*
|
|
4
|
+
* One resource (`uploads`) for upload sessions, one resource (`files`) for
|
|
5
|
+
* everything else. Verb suffix `:action` on `files` follows Google AIP-136.
|
|
6
|
+
*
|
|
7
|
+
* No legacy aliases. No polymorphic POSTs. Mirrors `@sylphx/sdk/storage.ts`.
|
|
3
8
|
*/
|
|
4
9
|
import { Schema } from 'effect';
|
|
5
10
|
import { defineEndpoint } from '../endpoint.js';
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
11
|
+
import { CopyFileRequest, CopyFileResult, File, ListFilesQuery, ListFilesResult, ListFileVersionsResult, RestoreFileResult, RestoreVersionResult, SignedUrlRequest, SignedUrlResult, SoftDeleteFileResult, UploadCompleteRequest, UploadCompleteResult, UploadCreateRequest, UploadCreateResult, UploadPartPresignResult, } from '../schemas/storage.js';
|
|
12
|
+
const FileIdPath = Schema.Struct({ fileId: Schema.String });
|
|
13
|
+
const UploadIdPath = Schema.Struct({ uploadId: Schema.String });
|
|
14
|
+
const UploadPartPath = Schema.Struct({
|
|
15
|
+
uploadId: Schema.String,
|
|
16
|
+
partNumber: Schema.NumberFromString,
|
|
17
|
+
});
|
|
8
18
|
const FileVersionPath = Schema.Struct({
|
|
9
|
-
|
|
19
|
+
fileId: Schema.String,
|
|
10
20
|
versionId: Schema.String,
|
|
11
21
|
});
|
|
12
22
|
export const storageEndpoints = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* This is the SDK's primary upload path (`uploadFile` / `uploadAvatar`).
|
|
18
|
-
*/
|
|
19
|
-
upload: defineEndpoint({
|
|
23
|
+
// --------------------------------------------------------------------------
|
|
24
|
+
// Upload sessions
|
|
25
|
+
// --------------------------------------------------------------------------
|
|
26
|
+
createUpload: defineEndpoint({
|
|
20
27
|
method: 'POST',
|
|
21
|
-
path: '/storage/
|
|
22
|
-
body:
|
|
23
|
-
response:
|
|
28
|
+
path: '/storage/uploads',
|
|
29
|
+
body: UploadCreateRequest,
|
|
30
|
+
response: UploadCreateResult,
|
|
24
31
|
plane: 'baas',
|
|
25
|
-
summary: '
|
|
32
|
+
summary: 'Create an upload session. Returns a single-part PUT or a multipart plan based on size.',
|
|
26
33
|
tags: ['storage'],
|
|
27
34
|
}),
|
|
28
|
-
|
|
35
|
+
abortUpload: defineEndpoint({
|
|
36
|
+
method: 'DELETE',
|
|
37
|
+
path: '/storage/uploads/:uploadId',
|
|
38
|
+
params: UploadIdPath,
|
|
39
|
+
response: Schema.Struct({}),
|
|
40
|
+
plane: 'baas',
|
|
41
|
+
summary: 'Abort an in-progress upload session and release its parts.',
|
|
42
|
+
tags: ['storage'],
|
|
43
|
+
}),
|
|
44
|
+
presignUploadPart: defineEndpoint({
|
|
29
45
|
method: 'POST',
|
|
30
|
-
path: '/storage/
|
|
31
|
-
|
|
32
|
-
response:
|
|
46
|
+
path: '/storage/uploads/:uploadId/parts/:partNumber',
|
|
47
|
+
params: UploadPartPath,
|
|
48
|
+
response: UploadPartPresignResult,
|
|
33
49
|
plane: 'baas',
|
|
34
|
-
summary: 'Mint a
|
|
50
|
+
summary: 'Mint a fresh presigned URL for a single multipart part (used to resume long pauses).',
|
|
35
51
|
tags: ['storage'],
|
|
36
52
|
}),
|
|
37
|
-
|
|
38
|
-
* Generate a time-limited signed URL for accessing a private file.
|
|
39
|
-
* Signed URLs avoid exposing permanent credentials and can be scoped
|
|
40
|
-
* to a specific user via the `userId` field.
|
|
41
|
-
*/
|
|
42
|
-
signedUrl: defineEndpoint({
|
|
53
|
+
completeUpload: defineEndpoint({
|
|
43
54
|
method: 'POST',
|
|
44
|
-
path: '/storage/
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
path: '/storage/uploads/:uploadId:complete',
|
|
56
|
+
params: UploadIdPath,
|
|
57
|
+
body: UploadCompleteRequest,
|
|
58
|
+
response: UploadCompleteResult,
|
|
47
59
|
plane: 'baas',
|
|
48
|
-
summary: '
|
|
60
|
+
summary: 'Finalise a multipart upload by submitting per-part etags.',
|
|
49
61
|
tags: ['storage'],
|
|
50
62
|
}),
|
|
51
|
-
|
|
63
|
+
// --------------------------------------------------------------------------
|
|
64
|
+
// Files resource
|
|
65
|
+
// --------------------------------------------------------------------------
|
|
66
|
+
listFiles: defineEndpoint({
|
|
52
67
|
method: 'GET',
|
|
53
68
|
path: '/storage/files',
|
|
54
69
|
query: ListFilesQuery,
|
|
55
70
|
response: ListFilesResult,
|
|
56
71
|
plane: 'baas',
|
|
57
|
-
summary: 'List files
|
|
72
|
+
summary: 'List files (cursor-paginated).',
|
|
58
73
|
tags: ['storage'],
|
|
59
74
|
}),
|
|
60
|
-
|
|
75
|
+
getFile: defineEndpoint({
|
|
61
76
|
method: 'GET',
|
|
62
|
-
path: '/storage/files/:
|
|
63
|
-
params:
|
|
64
|
-
response:
|
|
77
|
+
path: '/storage/files/:fileId',
|
|
78
|
+
params: FileIdPath,
|
|
79
|
+
response: File,
|
|
65
80
|
plane: 'baas',
|
|
66
|
-
summary: 'Get file metadata
|
|
81
|
+
summary: 'Get file metadata.',
|
|
67
82
|
tags: ['storage'],
|
|
68
83
|
}),
|
|
69
|
-
|
|
84
|
+
deleteFile: defineEndpoint({
|
|
70
85
|
method: 'DELETE',
|
|
71
|
-
path: '/storage/files/:
|
|
72
|
-
params:
|
|
73
|
-
response:
|
|
86
|
+
path: '/storage/files/:fileId',
|
|
87
|
+
params: FileIdPath,
|
|
88
|
+
response: SoftDeleteFileResult,
|
|
74
89
|
plane: 'baas',
|
|
75
|
-
summary: 'Soft-delete a
|
|
90
|
+
summary: 'Soft-delete a file. Restorable via `:restore`.',
|
|
76
91
|
tags: ['storage'],
|
|
77
92
|
}),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
response: ListFileVersionsResult,
|
|
93
|
+
restoreFile: defineEndpoint({
|
|
94
|
+
method: 'POST',
|
|
95
|
+
path: '/storage/files/:fileId:restore',
|
|
96
|
+
params: FileIdPath,
|
|
97
|
+
response: RestoreFileResult,
|
|
84
98
|
plane: 'baas',
|
|
85
|
-
summary: '
|
|
99
|
+
summary: 'Restore a soft-deleted file.',
|
|
86
100
|
tags: ['storage'],
|
|
87
101
|
}),
|
|
88
|
-
|
|
102
|
+
signFileUrl: defineEndpoint({
|
|
89
103
|
method: 'POST',
|
|
90
|
-
path: '/storage/files/:
|
|
91
|
-
params:
|
|
92
|
-
|
|
104
|
+
path: '/storage/files/:fileId:signedUrl',
|
|
105
|
+
params: FileIdPath,
|
|
106
|
+
body: SignedUrlRequest,
|
|
107
|
+
response: SignedUrlResult,
|
|
93
108
|
plane: 'baas',
|
|
94
|
-
summary: '
|
|
109
|
+
summary: 'Mint a short-lived signed download URL for a private file.',
|
|
95
110
|
tags: ['storage'],
|
|
96
111
|
}),
|
|
97
|
-
|
|
112
|
+
copyFile: defineEndpoint({
|
|
98
113
|
method: 'POST',
|
|
99
|
-
path: '/storage/files/:
|
|
100
|
-
params:
|
|
101
|
-
|
|
114
|
+
path: '/storage/files/:fileId:copy',
|
|
115
|
+
params: FileIdPath,
|
|
116
|
+
body: CopyFileRequest,
|
|
117
|
+
response: CopyFileResult,
|
|
118
|
+
plane: 'baas',
|
|
119
|
+
summary: 'Server-side copy (no client bandwidth).',
|
|
120
|
+
tags: ['storage'],
|
|
121
|
+
}),
|
|
122
|
+
// --------------------------------------------------------------------------
|
|
123
|
+
// Versions
|
|
124
|
+
// --------------------------------------------------------------------------
|
|
125
|
+
listFileVersions: defineEndpoint({
|
|
126
|
+
method: 'GET',
|
|
127
|
+
path: '/storage/files/:fileId/versions',
|
|
128
|
+
params: FileIdPath,
|
|
129
|
+
response: ListFileVersionsResult,
|
|
130
|
+
plane: 'baas',
|
|
131
|
+
summary: 'List versions of a file (newest first).',
|
|
132
|
+
tags: ['storage'],
|
|
133
|
+
}),
|
|
134
|
+
restoreFileVersion: defineEndpoint({
|
|
135
|
+
method: 'POST',
|
|
136
|
+
path: '/storage/files/:fileId/versions/:versionId:restore',
|
|
137
|
+
params: FileVersionPath,
|
|
138
|
+
response: RestoreVersionResult,
|
|
102
139
|
plane: 'baas',
|
|
103
|
-
summary: 'Restore
|
|
140
|
+
summary: 'Restore an older version as the current version (append-only history).',
|
|
104
141
|
tags: ['storage'],
|
|
105
142
|
}),
|
|
106
143
|
};
|
|
@@ -11,7 +11,7 @@ export declare const tasksEndpoints: {
|
|
|
11
11
|
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
12
12
|
available: typeof import("effect/Schema").Boolean;
|
|
13
13
|
provider: typeof import("effect/Schema").String;
|
|
14
|
-
}
|
|
14
|
+
}>, undefined>;
|
|
15
15
|
readonly list: import("../endpoint.js").Endpoint<"GET", "/tasks", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
16
16
|
projectId: typeof import("effect/Schema").String;
|
|
17
17
|
status: import("effect/Schema").optional<import("effect/Schema").Literal<["all", "pending", "queued", "running", "completed", "failed", "scheduled", "paused", "cancelled", "deleted"]>>;
|
|
@@ -43,7 +43,7 @@ export declare const tasksEndpoints: {
|
|
|
43
43
|
total: typeof import("effect/Schema").Number;
|
|
44
44
|
limit: typeof import("effect/Schema").Number;
|
|
45
45
|
offset: typeof import("effect/Schema").Number;
|
|
46
|
-
}
|
|
46
|
+
}>, undefined>;
|
|
47
47
|
readonly get: import("../endpoint.js").Endpoint<"GET", "/tasks/:jobId", import("effect/Schema").Struct<{
|
|
48
48
|
jobId: typeof import("effect/Schema").String;
|
|
49
49
|
}>, import("effect/Schema").Struct<{
|
|
@@ -70,7 +70,7 @@ export declare const tasksEndpoints: {
|
|
|
70
70
|
qstashScheduleId: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
|
|
71
71
|
createdAt: typeof import("effect/Schema").String;
|
|
72
72
|
}>;
|
|
73
|
-
}
|
|
73
|
+
}>, undefined>;
|
|
74
74
|
readonly schedule: import("../endpoint.js").Endpoint<"POST", "/tasks", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
75
75
|
projectId: typeof import("effect/Schema").String;
|
|
76
76
|
environmentId: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
@@ -88,14 +88,16 @@ export declare const tasksEndpoints: {
|
|
|
88
88
|
jobId: typeof import("effect/Schema").String;
|
|
89
89
|
messageId: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
90
90
|
scheduledFor: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
|
|
91
|
-
}
|
|
91
|
+
}>, {
|
|
92
|
+
status: 201;
|
|
93
|
+
}>;
|
|
92
94
|
readonly cancel: import("../endpoint.js").Endpoint<"POST", "/tasks/:jobId/cancel", import("effect/Schema").Struct<{
|
|
93
95
|
jobId: typeof import("effect/Schema").String;
|
|
94
96
|
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
95
97
|
projectId: typeof import("effect/Schema").String;
|
|
96
98
|
}>, import("effect/Schema").Struct<{
|
|
97
99
|
success: typeof import("effect/Schema").Boolean;
|
|
98
|
-
}
|
|
100
|
+
}>, undefined>;
|
|
99
101
|
readonly createCron: import("../endpoint.js").Endpoint<"POST", "/tasks/cron", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
100
102
|
projectId: typeof import("effect/Schema").String;
|
|
101
103
|
callbackUrl: typeof import("effect/Schema").String;
|
|
@@ -115,27 +117,29 @@ export declare const tasksEndpoints: {
|
|
|
115
117
|
scheduleId: typeof import("effect/Schema").String;
|
|
116
118
|
cron: typeof import("effect/Schema").String;
|
|
117
119
|
paused: typeof import("effect/Schema").Boolean;
|
|
118
|
-
}
|
|
120
|
+
}>, {
|
|
121
|
+
status: 201;
|
|
122
|
+
}>;
|
|
119
123
|
readonly pauseCron: import("../endpoint.js").Endpoint<"POST", "/tasks/cron/:scheduleId/pause", import("effect/Schema").Struct<{
|
|
120
124
|
scheduleId: typeof import("effect/Schema").String;
|
|
121
125
|
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
122
126
|
projectId: typeof import("effect/Schema").String;
|
|
123
127
|
}>, import("effect/Schema").Struct<{
|
|
124
128
|
success: typeof import("effect/Schema").Boolean;
|
|
125
|
-
}
|
|
129
|
+
}>, undefined>;
|
|
126
130
|
readonly resumeCron: import("../endpoint.js").Endpoint<"POST", "/tasks/cron/:scheduleId/resume", import("effect/Schema").Struct<{
|
|
127
131
|
scheduleId: typeof import("effect/Schema").String;
|
|
128
132
|
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
129
133
|
projectId: typeof import("effect/Schema").String;
|
|
130
134
|
}>, import("effect/Schema").Struct<{
|
|
131
135
|
success: typeof import("effect/Schema").Boolean;
|
|
132
|
-
}
|
|
136
|
+
}>, undefined>;
|
|
133
137
|
readonly deleteCron: import("../endpoint.js").Endpoint<"DELETE", "/tasks/cron/:scheduleId", import("effect/Schema").Struct<{
|
|
134
138
|
scheduleId: typeof import("effect/Schema").String;
|
|
135
139
|
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
136
140
|
projectId: typeof import("effect/Schema").String;
|
|
137
141
|
}>, import("effect/Schema").Struct<{
|
|
138
142
|
success: typeof import("effect/Schema").Boolean;
|
|
139
|
-
}
|
|
143
|
+
}>, undefined>;
|
|
140
144
|
};
|
|
141
145
|
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/endpoints/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/endpoints/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFjB,CAAA"}
|
package/dist/endpoints/tasks.js
CHANGED
|
@@ -39,6 +39,7 @@ export const tasksEndpoints = {
|
|
|
39
39
|
schedule: defineEndpoint({
|
|
40
40
|
method: 'POST',
|
|
41
41
|
path: '/tasks',
|
|
42
|
+
success: { status: 201 },
|
|
42
43
|
body: ScheduleTaskInput,
|
|
43
44
|
response: ScheduleTaskResult,
|
|
44
45
|
plane: 'management',
|
|
@@ -58,6 +59,7 @@ export const tasksEndpoints = {
|
|
|
58
59
|
createCron: defineEndpoint({
|
|
59
60
|
method: 'POST',
|
|
60
61
|
path: '/tasks/cron',
|
|
62
|
+
success: { status: 201 },
|
|
61
63
|
body: CreateCronTaskInput,
|
|
62
64
|
response: CreateCronTaskResult,
|
|
63
65
|
plane: 'management',
|
|
@@ -21,7 +21,7 @@ export declare const usersEndpoints: {
|
|
|
21
21
|
metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
22
22
|
createdAt: Schema.optional<typeof Schema.String>;
|
|
23
23
|
}>>;
|
|
24
|
-
}
|
|
24
|
+
}>, undefined>;
|
|
25
25
|
readonly getProfile: import("../endpoint.js").Endpoint<"GET", "/user/profile", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
26
26
|
id: Schema.brand<Schema.filter<typeof Schema.String>, "UserId">;
|
|
27
27
|
email: typeof Schema.String;
|
|
@@ -31,7 +31,7 @@ export declare const usersEndpoints: {
|
|
|
31
31
|
timezone: Schema.NullOr<typeof Schema.String>;
|
|
32
32
|
locale: Schema.NullOr<typeof Schema.String>;
|
|
33
33
|
createdAt: typeof Schema.String;
|
|
34
|
-
}
|
|
34
|
+
}>, undefined>;
|
|
35
35
|
readonly updateProfile: import("../endpoint.js").Endpoint<"PATCH", "/user/profile", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
36
36
|
name: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
37
37
|
image: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
@@ -46,22 +46,22 @@ export declare const usersEndpoints: {
|
|
|
46
46
|
timezone: Schema.NullOr<typeof Schema.String>;
|
|
47
47
|
locale: Schema.NullOr<typeof Schema.String>;
|
|
48
48
|
createdAt: typeof Schema.String;
|
|
49
|
-
}
|
|
49
|
+
}>, undefined>;
|
|
50
50
|
readonly getSecurity: import("../endpoint.js").Endpoint<"GET", "/user/security", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
51
51
|
twoFactorEnabled: typeof Schema.Boolean;
|
|
52
52
|
hasPassword: typeof Schema.Boolean;
|
|
53
53
|
emailVerified: typeof Schema.Boolean;
|
|
54
|
-
}
|
|
54
|
+
}>, undefined>;
|
|
55
55
|
readonly changePassword: import("../endpoint.js").Endpoint<"POST", "/user/password", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
56
56
|
currentPassword: typeof Schema.String;
|
|
57
57
|
newPassword: typeof Schema.String;
|
|
58
58
|
}>, Schema.Struct<{
|
|
59
59
|
success: typeof Schema.Boolean;
|
|
60
|
-
}
|
|
60
|
+
}>, undefined>;
|
|
61
61
|
readonly getConnectedAccounts: import("../endpoint.js").Endpoint<"GET", "/user/connected-accounts", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Array$<Schema.Struct<{
|
|
62
62
|
provider: typeof Schema.String;
|
|
63
63
|
connectedAt: typeof Schema.String;
|
|
64
|
-
}
|
|
64
|
+
}>>, undefined>;
|
|
65
65
|
readonly getLoginHistory: import("../endpoint.js").Endpoint<"GET", "/user/login-history", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Array$<Schema.Struct<{
|
|
66
66
|
id: typeof Schema.String;
|
|
67
67
|
ipAddress: Schema.NullOr<typeof Schema.String>;
|
|
@@ -71,7 +71,7 @@ export declare const usersEndpoints: {
|
|
|
71
71
|
device: Schema.NullOr<typeof Schema.String>;
|
|
72
72
|
success: typeof Schema.Boolean;
|
|
73
73
|
createdAt: typeof Schema.String;
|
|
74
|
-
}
|
|
74
|
+
}>>, undefined>;
|
|
75
75
|
readonly getSessions: import("../endpoint.js").Endpoint<"GET", "/user/sessions", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Array$<Schema.Struct<{
|
|
76
76
|
id: Schema.brand<Schema.filter<typeof Schema.String>, "SessionId">;
|
|
77
77
|
isCurrent: Schema.optional<typeof Schema.Boolean>;
|
|
@@ -84,20 +84,20 @@ export declare const usersEndpoints: {
|
|
|
84
84
|
city: Schema.NullOr<typeof Schema.String>;
|
|
85
85
|
lastActiveAt: typeof Schema.String;
|
|
86
86
|
createdAt: typeof Schema.String;
|
|
87
|
-
}
|
|
87
|
+
}>>, undefined>;
|
|
88
88
|
readonly revokeSession: import("../endpoint.js").Endpoint<"DELETE", "/user/sessions/:sessionId", Schema.Struct<{
|
|
89
89
|
sessionId: typeof Schema.String;
|
|
90
90
|
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
91
91
|
success: typeof Schema.Boolean;
|
|
92
|
-
}
|
|
92
|
+
}>, undefined>;
|
|
93
93
|
readonly revokeAllSessions: import("../endpoint.js").Endpoint<"POST", "/user/sessions/revoke-all", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
94
94
|
success: typeof Schema.Boolean;
|
|
95
95
|
count: typeof Schema.Number;
|
|
96
|
-
}
|
|
97
|
-
readonly exportData: import("../endpoint.js").Endpoint<"GET", "/user/export", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Record$<typeof Schema.String, typeof Schema.Unknown
|
|
96
|
+
}>, undefined>;
|
|
97
|
+
readonly exportData: import("../endpoint.js").Endpoint<"GET", "/user/export", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>, undefined>;
|
|
98
98
|
readonly deleteAccount: import("../endpoint.js").Endpoint<"DELETE", "/user/account", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
99
99
|
success: typeof Schema.Boolean;
|
|
100
100
|
deletedData: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
101
|
-
}
|
|
101
|
+
}>, undefined>;
|
|
102
102
|
};
|
|
103
103
|
//# sourceMappingURL=users.d.ts.map
|
|
@@ -29,7 +29,7 @@ export declare const webhooksEndpoints: {
|
|
|
29
29
|
updatedAt: typeof Schema.String;
|
|
30
30
|
}>>;
|
|
31
31
|
supportedEvents: Schema.Array$<typeof Schema.String>;
|
|
32
|
-
}
|
|
32
|
+
}>, undefined>;
|
|
33
33
|
readonly updateConfig: import("../endpoint.js").Endpoint<"PATCH", "/webhooks/projects/:id", Schema.Struct<{
|
|
34
34
|
id: typeof Schema.String;
|
|
35
35
|
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
@@ -41,7 +41,7 @@ export declare const webhooksEndpoints: {
|
|
|
41
41
|
webhookUrl: Schema.NullOr<typeof Schema.String>;
|
|
42
42
|
secretGenerated: typeof Schema.Boolean;
|
|
43
43
|
webhookSecretPrefix: Schema.optional<typeof Schema.String>;
|
|
44
|
-
}
|
|
44
|
+
}>, undefined>;
|
|
45
45
|
readonly listDeliveries: import("../endpoint.js").Endpoint<"GET", "/webhooks/projects/:id/deliveries", Schema.Struct<{
|
|
46
46
|
id: typeof Schema.String;
|
|
47
47
|
}>, Schema.Struct<{
|
|
@@ -67,7 +67,7 @@ export declare const webhooksEndpoints: {
|
|
|
67
67
|
total: typeof Schema.Number;
|
|
68
68
|
limit: typeof Schema.Number;
|
|
69
69
|
offset: typeof Schema.Number;
|
|
70
|
-
}
|
|
70
|
+
}>, undefined>;
|
|
71
71
|
readonly failedDeliveries: import("../endpoint.js").Endpoint<"GET", "/webhooks/projects/:id/failed", Schema.Struct<{
|
|
72
72
|
id: typeof Schema.String;
|
|
73
73
|
}>, Schema.Struct<{
|
|
@@ -83,7 +83,7 @@ export declare const webhooksEndpoints: {
|
|
|
83
83
|
failedAt: Schema.NullOr<typeof Schema.String>;
|
|
84
84
|
}>>;
|
|
85
85
|
total: typeof Schema.Number;
|
|
86
|
-
}
|
|
86
|
+
}>, undefined>;
|
|
87
87
|
readonly getDelivery: import("../endpoint.js").Endpoint<"GET", "/webhooks/:webhookId", Schema.Struct<{
|
|
88
88
|
webhookId: typeof Schema.String;
|
|
89
89
|
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
@@ -100,14 +100,14 @@ export declare const webhooksEndpoints: {
|
|
|
100
100
|
queuedAt: Schema.NullOr<typeof Schema.String>;
|
|
101
101
|
deliveredAt: Schema.NullOr<typeof Schema.String>;
|
|
102
102
|
failedAt: Schema.NullOr<typeof Schema.String>;
|
|
103
|
-
}
|
|
103
|
+
}>, undefined>;
|
|
104
104
|
readonly replayDelivery: import("../endpoint.js").Endpoint<"POST", "/webhooks/:webhookId/replay", Schema.Struct<{
|
|
105
105
|
webhookId: typeof Schema.String;
|
|
106
106
|
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
107
107
|
success: typeof Schema.Boolean;
|
|
108
108
|
newDeliveryId: Schema.NullOr<typeof Schema.String>;
|
|
109
109
|
messageId: Schema.NullOr<typeof Schema.String>;
|
|
110
|
-
}
|
|
110
|
+
}>, undefined>;
|
|
111
111
|
readonly getStats: import("../endpoint.js").Endpoint<"GET", "/webhooks/projects/:id/stats", Schema.Struct<{
|
|
112
112
|
id: typeof Schema.String;
|
|
113
113
|
}>, Schema.Struct<{
|
|
@@ -129,7 +129,7 @@ export declare const webhooksEndpoints: {
|
|
|
129
129
|
status: Schema.Literal<["pending", "queued", "delivered", "failed", "skipped"]>;
|
|
130
130
|
count: typeof Schema.Number;
|
|
131
131
|
}>>;
|
|
132
|
-
}
|
|
132
|
+
}>, undefined>;
|
|
133
133
|
readonly adminOverview: import("../endpoint.js").Endpoint<"GET", "/webhooks/admin/overview", Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
134
134
|
period: Schema.optional<Schema.Literal<["day", "week", "month"]>>;
|
|
135
135
|
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
@@ -165,7 +165,7 @@ export declare const webhooksEndpoints: {
|
|
|
165
165
|
timestamp: typeof Schema.String;
|
|
166
166
|
failedAt: Schema.NullOr<typeof Schema.String>;
|
|
167
167
|
}>>;
|
|
168
|
-
}
|
|
168
|
+
}>, undefined>;
|
|
169
169
|
readonly adminProjectDeliveries: import("../endpoint.js").Endpoint<"GET", "/webhooks/admin/projects/:projectId/deliveries", Schema.Struct<{
|
|
170
170
|
projectId: typeof Schema.String;
|
|
171
171
|
}>, Schema.Struct<{
|
|
@@ -183,7 +183,7 @@ export declare const webhooksEndpoints: {
|
|
|
183
183
|
queuedAt: Schema.NullOr<typeof Schema.String>;
|
|
184
184
|
deliveredAt: Schema.NullOr<typeof Schema.String>;
|
|
185
185
|
failedAt: Schema.NullOr<typeof Schema.String>;
|
|
186
|
-
}
|
|
186
|
+
}>>, undefined>;
|
|
187
187
|
readonly adminBulkReplay: import("../endpoint.js").Endpoint<"POST", "/webhooks/admin/bulk-replay", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
188
188
|
projectId: typeof Schema.String;
|
|
189
189
|
deliveryIds: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
@@ -196,6 +196,6 @@ export declare const webhooksEndpoints: {
|
|
|
196
196
|
deliveryId: typeof Schema.String;
|
|
197
197
|
error: typeof Schema.String;
|
|
198
198
|
}>>>;
|
|
199
|
-
}
|
|
199
|
+
}>, undefined>;
|
|
200
200
|
};
|
|
201
201
|
//# sourceMappingURL=webhooks.d.ts.map
|
package/dist/hono-app.d.ts
CHANGED
|
@@ -60,14 +60,26 @@
|
|
|
60
60
|
* @see docs/audit/2026-05-03-e2e-run/SSOT.md — E-25 (web build chronic failure)
|
|
61
61
|
*/
|
|
62
62
|
import type { Schema } from 'effect';
|
|
63
|
-
import type { Hono } from 'hono';
|
|
64
|
-
import type { Endpoint, EndpointGroup, HttpMethod } from './endpoint.js';
|
|
63
|
+
import type { Hono, ToSchema, TypedResponse } from 'hono';
|
|
64
|
+
import type { Endpoint, EndpointGroup, EndpointSuccessBody, EndpointSuccessStatus, HttpMethod } from './endpoint.js';
|
|
65
65
|
type HonoBaseSchema = import('hono').Schema;
|
|
66
66
|
/**
|
|
67
67
|
* Distribute a union into a function-parameter position then re-extract,
|
|
68
68
|
* collapsing it to an intersection. Standard TypeScript trick.
|
|
69
69
|
*/
|
|
70
70
|
type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
71
|
+
/**
|
|
72
|
+
* Materialise an inferred object/intersection into a plain mapped type.
|
|
73
|
+
*
|
|
74
|
+
* Hono's RPC client infers path keys with `S extends Record<infer K, Schema>`.
|
|
75
|
+
* Leaving the endpoint set as a raw intersection can make TypeScript infer
|
|
76
|
+
* `K` as plain `string`, degrading `hc<T>()` to `ClientRequest<string, ...>`.
|
|
77
|
+
* Re-mapping preserves the exact literal path keys before handing the schema
|
|
78
|
+
* to Hono.
|
|
79
|
+
*/
|
|
80
|
+
type Simplify<T> = {
|
|
81
|
+
[K in keyof T]: T[K];
|
|
82
|
+
} & {};
|
|
71
83
|
/**
|
|
72
84
|
* Recursively strip `readonly` from objects and arrays. Effect Schema
|
|
73
85
|
* `Type<S>` produces deeply-readonly shapes; consumer code in `apps/web`
|
|
@@ -99,6 +111,19 @@ type WritableDeep<T> = T extends Date | RegExp | ((...args: unknown[]) => unknow
|
|
|
99
111
|
* `anomaly.status → Property does not exist on type 'never'`.
|
|
100
112
|
*/
|
|
101
113
|
type SchemaType<S> = S extends Schema.Schema.AnyNoContext ? WritableDeep<Schema.Schema.Type<S>> : never;
|
|
114
|
+
type SchemaInputType<S> = S extends Schema.Schema.AnyNoContext ? Schema.Schema.Type<S> : never;
|
|
115
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
116
|
+
type IsUnknown<T> = IsAny<T> extends true ? false : unknown extends T ? (keyof T extends never ? true : false) : false;
|
|
117
|
+
type RequiredKeys<T> = T extends object ? {
|
|
118
|
+
[K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
|
|
119
|
+
}[keyof T] : never;
|
|
120
|
+
type EndpointInputTargetShape<T, Key extends 'param' | 'query' | 'json'> = IsUnknown<T> extends true ? Key extends 'json' ? {
|
|
121
|
+
json?: unknown;
|
|
122
|
+
} : {} : RequiredKeys<T> extends never ? {
|
|
123
|
+
[K in Key]?: T;
|
|
124
|
+
} : {
|
|
125
|
+
[K in Key]: T;
|
|
126
|
+
};
|
|
102
127
|
/**
|
|
103
128
|
* Strip a leading prefix from a literal string type.
|
|
104
129
|
*
|
|
@@ -119,33 +144,37 @@ type StripBase<Path extends string, BasePath extends string> = BasePath extends
|
|
|
119
144
|
* after running). Hono's `hc<T>(...)` proxy reads this shape directly to
|
|
120
145
|
* type-check the `client[path].$method(<args>)` call argument.
|
|
121
146
|
*/
|
|
122
|
-
type
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
json: SchemaType<E['body']>;
|
|
128
|
-
} : {});
|
|
147
|
+
type EndpointInputTarget<S, Key extends 'param' | 'query' | 'json'> = S extends Schema.Schema.AnyNoContext ? Schema.Schema.AnyNoContext extends S ? {} : EndpointInputTargetShape<SchemaInputType<S>, Key> : {};
|
|
148
|
+
type EndpointInput<E extends Endpoint> = EndpointInputTarget<NonNullable<E['params']>, 'param'> & EndpointInputTarget<NonNullable<E['query']>, 'query'> & EndpointInputTarget<NonNullable<E['body']>, 'json'>;
|
|
149
|
+
type EndpointHonoInput<E extends Endpoint> = {
|
|
150
|
+
in: EndpointInput<E>;
|
|
151
|
+
};
|
|
129
152
|
/**
|
|
130
153
|
* Build a single Hono Schema entry for one endpoint after BasePath stripping.
|
|
131
154
|
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* `
|
|
137
|
-
*
|
|
155
|
+
* Use Hono's public `ToSchema`/`TypedResponse` types instead of reproducing
|
|
156
|
+
* Hono's internal schema layout. This keeps the contract derivation aligned
|
|
157
|
+
* with the installed Hono version, so `hc<T>()` preserves literal path chains
|
|
158
|
+
* such as `.billing.business` and `[':id']` instead of degrading to the loose
|
|
159
|
+
* `ClientRequest<string, string, ...>` fallback.
|
|
160
|
+
*
|
|
161
|
+
* Output models the success transport from contract-owned metadata so hc<T>
|
|
162
|
+
* sees 201/202/204 and no-body responses without importing backend route
|
|
163
|
+
* implementation types.
|
|
138
164
|
*/
|
|
139
|
-
type
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
165
|
+
type EndpointSuccessValue<E extends Endpoint> = E extends {
|
|
166
|
+
readonly success?: infer Success;
|
|
167
|
+
} ? NonNullable<Success> : never;
|
|
168
|
+
type EndpointSuccessStatusOf<E extends Endpoint> = [EndpointSuccessValue<E>] extends [never] ? 200 : EndpointSuccessValue<E> extends {
|
|
169
|
+
readonly status?: infer Status;
|
|
170
|
+
} ? Status extends EndpointSuccessStatus ? Status : 200 : 200;
|
|
171
|
+
type EndpointSuccessBodyOf<E extends Endpoint> = [EndpointSuccessValue<E>] extends [never] ? EndpointSuccessStatusOf<E> extends 204 ? 'none' : 'json' : EndpointSuccessValue<E> extends {
|
|
172
|
+
readonly body?: infer Body;
|
|
173
|
+
} ? Body extends EndpointSuccessBody ? Body : EndpointSuccessStatusOf<E> extends 204 ? 'none' : 'json' : EndpointSuccessStatusOf<E> extends 204 ? 'none' : 'json';
|
|
174
|
+
type EndpointTypedResponse<E extends Endpoint> = EndpointSuccessBodyOf<E> extends 'none' ? TypedResponse<null, EndpointSuccessStatusOf<E>, 'body'> : TypedResponse<E extends {
|
|
175
|
+
readonly response: infer Response;
|
|
176
|
+
} ? SchemaType<Response> : never, EndpointSuccessStatusOf<E>, 'json'>;
|
|
177
|
+
type EndpointToHonoEntry<E extends Endpoint, BasePath extends string> = ToSchema<E['method'], StripBase<E['path'], BasePath>, EndpointHonoInput<E>, EndpointTypedResponse<E>>;
|
|
149
178
|
/**
|
|
150
179
|
* Walk every endpoint in `G`, recursively flatten nested endpoint groups,
|
|
151
180
|
* build per-endpoint Hono entries with BasePath stripped, then intersect them
|
|
@@ -162,7 +191,7 @@ type EndpointToHonoEntry<E extends Endpoint, BasePath extends string> = {
|
|
|
162
191
|
*/
|
|
163
192
|
type SchemaFromGroup<G extends EndpointGroup, BasePath extends string> = UnionToIntersection<{
|
|
164
193
|
[K in keyof G]: G[K] extends Endpoint ? EndpointToHonoEntry<G[K], BasePath> : G[K] extends EndpointGroup ? SchemaFromGroup<G[K], BasePath> : never;
|
|
165
|
-
}[keyof G]
|
|
194
|
+
}[keyof G]> extends infer S ? Simplify<S> : never;
|
|
166
195
|
/**
|
|
167
196
|
* Synthesise a Hono RPC-compatible app type from a contract endpoint group.
|
|
168
197
|
*
|
package/dist/hono-app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hono-app.d.ts","sourceRoot":"","sources":["../src/hono-app.ts"],"names":[],"mappings":"AAAA;;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