@package-broker/shared 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +242 -102
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +85 -2
- package/dist/schemas/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAG5B,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAE5B,sBAAsB;AACtB,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,134 +1,274 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const credentialTypeSchema: z.ZodEnum<
|
|
3
|
-
|
|
1
|
+
import { z } from '@hono/zod-openapi';
|
|
2
|
+
export declare const credentialTypeSchema: z.ZodEnum<{
|
|
3
|
+
http_basic: "http_basic";
|
|
4
|
+
github_token: "github_token";
|
|
5
|
+
gitlab_token: "gitlab_token";
|
|
6
|
+
bitbucket_app_password: "bitbucket_app_password";
|
|
7
|
+
bitbucket_api_token: "bitbucket_api_token";
|
|
8
|
+
bitbucket_api_key: "bitbucket_api_key";
|
|
9
|
+
bitbucket_server_pat: "bitbucket_server_pat";
|
|
10
|
+
bearer_token: "bearer_token";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const vcsTypeSchema: z.ZodEnum<{
|
|
13
|
+
git: "git";
|
|
14
|
+
composer: "composer";
|
|
15
|
+
artifact: "artifact";
|
|
16
|
+
}>;
|
|
4
17
|
export declare const createRepositorySchema: z.ZodObject<{
|
|
5
18
|
url: z.ZodString;
|
|
6
|
-
vcs_type: z.ZodEnum<
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
vcs_type: z.ZodEnum<{
|
|
20
|
+
git: "git";
|
|
21
|
+
composer: "composer";
|
|
22
|
+
artifact: "artifact";
|
|
23
|
+
}>;
|
|
24
|
+
credential_type: z.ZodEnum<{
|
|
25
|
+
http_basic: "http_basic";
|
|
26
|
+
github_token: "github_token";
|
|
27
|
+
gitlab_token: "gitlab_token";
|
|
28
|
+
bitbucket_app_password: "bitbucket_app_password";
|
|
29
|
+
bitbucket_api_token: "bitbucket_api_token";
|
|
30
|
+
bitbucket_api_key: "bitbucket_api_key";
|
|
31
|
+
bitbucket_server_pat: "bitbucket_server_pat";
|
|
32
|
+
bearer_token: "bearer_token";
|
|
33
|
+
}>;
|
|
34
|
+
auth_credentials: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
9
35
|
composer_json_path: z.ZodOptional<z.ZodString>;
|
|
10
36
|
package_filter: z.ZodOptional<z.ZodString>;
|
|
11
|
-
},
|
|
12
|
-
url: string;
|
|
13
|
-
vcs_type: "git" | "composer" | "artifact";
|
|
14
|
-
credential_type: "http_basic" | "github_token" | "gitlab_token" | "bitbucket_app_password" | "bitbucket_api_token" | "bitbucket_api_key" | "bitbucket_server_pat" | "bearer_token";
|
|
15
|
-
auth_credentials: Record<string, string>;
|
|
16
|
-
composer_json_path?: string | undefined;
|
|
17
|
-
package_filter?: string | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
url: string;
|
|
20
|
-
vcs_type: "git" | "composer" | "artifact";
|
|
21
|
-
credential_type: "http_basic" | "github_token" | "gitlab_token" | "bitbucket_app_password" | "bitbucket_api_token" | "bitbucket_api_key" | "bitbucket_server_pat" | "bearer_token";
|
|
22
|
-
auth_credentials: Record<string, string>;
|
|
23
|
-
composer_json_path?: string | undefined;
|
|
24
|
-
package_filter?: string | undefined;
|
|
25
|
-
}>;
|
|
37
|
+
}, z.core.$strip>;
|
|
26
38
|
export declare const updateRepositorySchema: z.ZodObject<{
|
|
27
39
|
url: z.ZodOptional<z.ZodString>;
|
|
28
|
-
vcs_type: z.ZodOptional<z.ZodEnum<
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
vcs_type: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
git: "git";
|
|
42
|
+
composer: "composer";
|
|
43
|
+
artifact: "artifact";
|
|
44
|
+
}>>;
|
|
45
|
+
credential_type: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
http_basic: "http_basic";
|
|
47
|
+
github_token: "github_token";
|
|
48
|
+
gitlab_token: "gitlab_token";
|
|
49
|
+
bitbucket_app_password: "bitbucket_app_password";
|
|
50
|
+
bitbucket_api_token: "bitbucket_api_token";
|
|
51
|
+
bitbucket_api_key: "bitbucket_api_key";
|
|
52
|
+
bitbucket_server_pat: "bitbucket_server_pat";
|
|
53
|
+
bearer_token: "bearer_token";
|
|
54
|
+
}>>;
|
|
55
|
+
auth_credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
31
56
|
composer_json_path: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
32
57
|
package_filter: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
33
|
-
},
|
|
34
|
-
url?: string | undefined;
|
|
35
|
-
vcs_type?: "git" | "composer" | "artifact" | undefined;
|
|
36
|
-
credential_type?: "http_basic" | "github_token" | "gitlab_token" | "bitbucket_app_password" | "bitbucket_api_token" | "bitbucket_api_key" | "bitbucket_server_pat" | "bearer_token" | undefined;
|
|
37
|
-
auth_credentials?: Record<string, string> | undefined;
|
|
38
|
-
composer_json_path?: string | undefined;
|
|
39
|
-
package_filter?: string | undefined;
|
|
40
|
-
}, {
|
|
41
|
-
url?: string | undefined;
|
|
42
|
-
vcs_type?: "git" | "composer" | "artifact" | undefined;
|
|
43
|
-
credential_type?: "http_basic" | "github_token" | "gitlab_token" | "bitbucket_app_password" | "bitbucket_api_token" | "bitbucket_api_key" | "bitbucket_server_pat" | "bearer_token" | undefined;
|
|
44
|
-
auth_credentials?: Record<string, string> | undefined;
|
|
45
|
-
composer_json_path?: string | undefined;
|
|
46
|
-
package_filter?: string | undefined;
|
|
47
|
-
}>;
|
|
58
|
+
}, z.core.$strip>;
|
|
48
59
|
export declare const repositoryResponseSchema: z.ZodObject<{
|
|
49
60
|
id: z.ZodString;
|
|
50
61
|
url: z.ZodString;
|
|
51
|
-
vcs_type: z.ZodEnum<
|
|
52
|
-
|
|
62
|
+
vcs_type: z.ZodEnum<{
|
|
63
|
+
git: "git";
|
|
64
|
+
composer: "composer";
|
|
65
|
+
artifact: "artifact";
|
|
66
|
+
}>;
|
|
67
|
+
credential_type: z.ZodEnum<{
|
|
68
|
+
http_basic: "http_basic";
|
|
69
|
+
github_token: "github_token";
|
|
70
|
+
gitlab_token: "gitlab_token";
|
|
71
|
+
bitbucket_app_password: "bitbucket_app_password";
|
|
72
|
+
bitbucket_api_token: "bitbucket_api_token";
|
|
73
|
+
bitbucket_api_key: "bitbucket_api_key";
|
|
74
|
+
bitbucket_server_pat: "bitbucket_server_pat";
|
|
75
|
+
bearer_token: "bearer_token";
|
|
76
|
+
}>;
|
|
53
77
|
composer_json_path: z.ZodNullable<z.ZodString>;
|
|
54
78
|
package_filter: z.ZodNullable<z.ZodString>;
|
|
55
|
-
status: z.ZodEnum<
|
|
79
|
+
status: z.ZodEnum<{
|
|
80
|
+
error: "error";
|
|
81
|
+
pending: "pending";
|
|
82
|
+
active: "active";
|
|
83
|
+
syncing: "syncing";
|
|
84
|
+
}>;
|
|
56
85
|
error_message: z.ZodNullable<z.ZodString>;
|
|
57
86
|
last_synced_at: z.ZodNullable<z.ZodNumber>;
|
|
58
87
|
created_at: z.ZodNumber;
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
status: "pending" | "active" | "error" | "syncing";
|
|
64
|
-
composer_json_path: string | null;
|
|
65
|
-
package_filter: string | null;
|
|
66
|
-
id: string;
|
|
67
|
-
error_message: string | null;
|
|
68
|
-
last_synced_at: number | null;
|
|
69
|
-
created_at: number;
|
|
70
|
-
}, {
|
|
71
|
-
url: string;
|
|
72
|
-
vcs_type: "git" | "composer" | "artifact";
|
|
73
|
-
credential_type: "http_basic" | "github_token" | "gitlab_token" | "bitbucket_app_password" | "bitbucket_api_token" | "bitbucket_api_key" | "bitbucket_server_pat" | "bearer_token";
|
|
74
|
-
status: "pending" | "active" | "error" | "syncing";
|
|
75
|
-
composer_json_path: string | null;
|
|
76
|
-
package_filter: string | null;
|
|
77
|
-
id: string;
|
|
78
|
-
error_message: string | null;
|
|
79
|
-
last_synced_at: number | null;
|
|
80
|
-
created_at: number;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
export declare const tokenPermissionsSchema: z.ZodEnum<{
|
|
90
|
+
readonly: "readonly";
|
|
91
|
+
write: "write";
|
|
81
92
|
}>;
|
|
82
|
-
export declare const tokenPermissionsSchema: z.ZodEnum<["readonly", "write"]>;
|
|
83
93
|
export declare const createTokenSchema: z.ZodObject<{
|
|
84
94
|
description: z.ZodString;
|
|
85
|
-
permissions: z.ZodDefault<z.ZodEnum<
|
|
95
|
+
permissions: z.ZodDefault<z.ZodEnum<{
|
|
96
|
+
readonly: "readonly";
|
|
97
|
+
write: "write";
|
|
98
|
+
}>>;
|
|
86
99
|
rate_limit_max: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
87
100
|
expires_at: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
},
|
|
89
|
-
description: string;
|
|
90
|
-
permissions: "readonly" | "write";
|
|
91
|
-
rate_limit_max: number | null;
|
|
92
|
-
expires_at?: number | undefined;
|
|
93
|
-
}, {
|
|
94
|
-
description: string;
|
|
95
|
-
permissions?: "readonly" | "write" | undefined;
|
|
96
|
-
rate_limit_max?: number | null | undefined;
|
|
97
|
-
expires_at?: number | undefined;
|
|
98
|
-
}>;
|
|
101
|
+
}, z.core.$strip>;
|
|
99
102
|
export declare const updateTokenSchema: z.ZodObject<{
|
|
100
103
|
description: z.ZodOptional<z.ZodString>;
|
|
101
104
|
rate_limit_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
102
|
-
},
|
|
103
|
-
description?: string | undefined;
|
|
104
|
-
rate_limit_max?: number | null | undefined;
|
|
105
|
-
}, {
|
|
106
|
-
description?: string | undefined;
|
|
107
|
-
rate_limit_max?: number | null | undefined;
|
|
108
|
-
}>;
|
|
105
|
+
}, z.core.$strip>;
|
|
109
106
|
export declare const tokenResponseSchema: z.ZodObject<{
|
|
110
107
|
id: z.ZodString;
|
|
111
108
|
description: z.ZodString;
|
|
112
|
-
permissions: z.ZodEnum<
|
|
109
|
+
permissions: z.ZodEnum<{
|
|
110
|
+
readonly: "readonly";
|
|
111
|
+
write: "write";
|
|
112
|
+
}>;
|
|
113
113
|
rate_limit_max: z.ZodNullable<z.ZodNumber>;
|
|
114
114
|
created_at: z.ZodNumber;
|
|
115
115
|
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
116
116
|
last_used_at: z.ZodNullable<z.ZodNumber>;
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export declare const loginRequestSchema: z.ZodObject<{
|
|
119
|
+
email: z.ZodString;
|
|
120
|
+
password: z.ZodString;
|
|
121
|
+
code: z.ZodOptional<z.ZodString>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
export declare const loginResponseSchema: z.ZodObject<{
|
|
124
|
+
token: z.ZodString;
|
|
125
|
+
user: z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
email: z.ZodString;
|
|
128
|
+
role: z.ZodEnum<{
|
|
129
|
+
admin: "admin";
|
|
130
|
+
viewer: "viewer";
|
|
131
|
+
}>;
|
|
132
|
+
two_factor_enabled: z.ZodBoolean;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
export declare const userResponseSchema: z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
email: z.ZodString;
|
|
138
|
+
role: z.ZodEnum<{
|
|
139
|
+
admin: "admin";
|
|
140
|
+
viewer: "viewer";
|
|
141
|
+
}>;
|
|
142
|
+
two_factor_enabled: z.ZodBoolean;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export declare const userListResponseSchema: z.ZodObject<{
|
|
145
|
+
users: z.ZodArray<z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
email: z.ZodString;
|
|
148
|
+
role: z.ZodEnum<{
|
|
149
|
+
admin: "admin";
|
|
150
|
+
viewer: "viewer";
|
|
151
|
+
}>;
|
|
152
|
+
two_factor_enabled: z.ZodBoolean;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export declare const createUserRequestSchema: z.ZodObject<{
|
|
156
|
+
email: z.ZodString;
|
|
157
|
+
password: z.ZodOptional<z.ZodString>;
|
|
158
|
+
role: z.ZodDefault<z.ZodEnum<{
|
|
159
|
+
admin: "admin";
|
|
160
|
+
viewer: "viewer";
|
|
161
|
+
}>>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export declare const createUserResponseSchema: z.ZodObject<{
|
|
164
|
+
message: z.ZodString;
|
|
165
|
+
user: z.ZodObject<{
|
|
166
|
+
id: z.ZodString;
|
|
167
|
+
email: z.ZodString;
|
|
168
|
+
role: z.ZodEnum<{
|
|
169
|
+
admin: "admin";
|
|
170
|
+
viewer: "viewer";
|
|
171
|
+
}>;
|
|
172
|
+
two_factor_enabled: z.ZodBoolean;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
export declare const errorResponseSchema: z.ZodObject<{
|
|
176
|
+
error: z.ZodString;
|
|
177
|
+
message: z.ZodOptional<z.ZodString>;
|
|
178
|
+
code: z.ZodOptional<z.ZodString>;
|
|
179
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
export declare const healthResponseSchema: z.ZodObject<{
|
|
182
|
+
status: z.ZodString;
|
|
183
|
+
timestamp: z.ZodNumber;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
export declare const statsResponseSchema: z.ZodObject<{
|
|
186
|
+
active_repos: z.ZodNumber;
|
|
187
|
+
cached_packages: z.ZodNumber;
|
|
188
|
+
total_downloads: z.ZodNumber;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
export declare const settingsResponseSchema: z.ZodObject<{
|
|
191
|
+
kv_available: z.ZodBoolean;
|
|
192
|
+
packagist_mirroring_enabled: z.ZodBoolean;
|
|
193
|
+
package_caching_enabled: z.ZodBoolean;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
export declare const updatePackagistMirroringRequestSchema: z.ZodObject<{
|
|
196
|
+
enabled: z.ZodBoolean;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
export declare const packageResponseSchema: z.ZodObject<{
|
|
199
|
+
id: z.ZodString;
|
|
200
|
+
name: z.ZodString;
|
|
201
|
+
version: z.ZodString;
|
|
202
|
+
repo_id: z.ZodString;
|
|
203
|
+
dist_url: z.ZodNullable<z.ZodString>;
|
|
204
|
+
source_dist_url: z.ZodNullable<z.ZodString>;
|
|
205
|
+
released_at: z.ZodNullable<z.ZodNumber>;
|
|
206
|
+
created_at: z.ZodNumber;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
export declare const packageListResponseSchema: z.ZodArray<z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
version: z.ZodString;
|
|
212
|
+
repo_id: z.ZodString;
|
|
213
|
+
dist_url: z.ZodNullable<z.ZodString>;
|
|
214
|
+
source_dist_url: z.ZodNullable<z.ZodString>;
|
|
215
|
+
released_at: z.ZodNullable<z.ZodNumber>;
|
|
216
|
+
created_at: z.ZodNumber;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
export declare const packageWithVersionsResponseSchema: z.ZodObject<{
|
|
219
|
+
name: z.ZodString;
|
|
220
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
221
|
+
id: z.ZodString;
|
|
222
|
+
name: z.ZodString;
|
|
223
|
+
version: z.ZodString;
|
|
224
|
+
repo_id: z.ZodString;
|
|
225
|
+
dist_url: z.ZodNullable<z.ZodString>;
|
|
226
|
+
source_dist_url: z.ZodNullable<z.ZodString>;
|
|
227
|
+
released_at: z.ZodNullable<z.ZodNumber>;
|
|
228
|
+
created_at: z.ZodNumber;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
export declare const tokenCreationResponseSchema: z.ZodObject<{
|
|
232
|
+
id: z.ZodString;
|
|
233
|
+
description: z.ZodString;
|
|
234
|
+
permissions: z.ZodEnum<{
|
|
235
|
+
readonly: "readonly";
|
|
236
|
+
write: "write";
|
|
237
|
+
}>;
|
|
238
|
+
rate_limit_max: z.ZodNullable<z.ZodNumber>;
|
|
239
|
+
created_at: z.ZodNumber;
|
|
240
|
+
expires_at: z.ZodNullable<z.ZodNumber>;
|
|
241
|
+
last_used_at: z.ZodNullable<z.ZodNumber>;
|
|
242
|
+
token: z.ZodString;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
export declare const repositoryListResponseSchema: z.ZodArray<z.ZodObject<{
|
|
245
|
+
id: z.ZodString;
|
|
246
|
+
url: z.ZodString;
|
|
247
|
+
vcs_type: z.ZodEnum<{
|
|
248
|
+
git: "git";
|
|
249
|
+
composer: "composer";
|
|
250
|
+
artifact: "artifact";
|
|
251
|
+
}>;
|
|
252
|
+
credential_type: z.ZodEnum<{
|
|
253
|
+
http_basic: "http_basic";
|
|
254
|
+
github_token: "github_token";
|
|
255
|
+
gitlab_token: "gitlab_token";
|
|
256
|
+
bitbucket_app_password: "bitbucket_app_password";
|
|
257
|
+
bitbucket_api_token: "bitbucket_api_token";
|
|
258
|
+
bitbucket_api_key: "bitbucket_api_key";
|
|
259
|
+
bitbucket_server_pat: "bitbucket_server_pat";
|
|
260
|
+
bearer_token: "bearer_token";
|
|
261
|
+
}>;
|
|
262
|
+
composer_json_path: z.ZodNullable<z.ZodString>;
|
|
263
|
+
package_filter: z.ZodNullable<z.ZodString>;
|
|
264
|
+
status: z.ZodEnum<{
|
|
265
|
+
error: "error";
|
|
266
|
+
pending: "pending";
|
|
267
|
+
active: "active";
|
|
268
|
+
syncing: "syncing";
|
|
269
|
+
}>;
|
|
270
|
+
error_message: z.ZodNullable<z.ZodString>;
|
|
271
|
+
last_synced_at: z.ZodNullable<z.ZodNumber>;
|
|
272
|
+
created_at: z.ZodNumber;
|
|
273
|
+
}, z.core.$strip>>;
|
|
134
274
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,eAAO,MAAM,oBAAoB;;;;;;;;;EAS/B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;EAA0C,CAAC;AAGrE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;iBAWjC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;iBAAmC,CAAC;AAEvE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWnC,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;EAAgC,CAAC;AAEpE,eAAO,MAAM,iBAAiB;;;;;;;;iBAK5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;iBAQ9B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;iBAQ9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;iBAK7B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;iBAEjC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;iBAIlC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;iBAGnC,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;iBAK9B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AAEH,eAAO,MAAM,qCAAqC;;iBAEhD,CAAC;AAGH,eAAO,MAAM,qBAAqB;;;;;;;;;iBAShC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;kBAAiC,CAAC;AAExE,eAAO,MAAM,iCAAiC;;;;;;;;;;;;iBAG5C,CAAC;AAGH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;iBAEtC,CAAC;AAGH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAoC,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Zod schemas for validation
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import { z } from '@hono/zod-openapi';
|
|
3
3
|
export const credentialTypeSchema = z.enum([
|
|
4
4
|
'http_basic',
|
|
5
5
|
'github_token',
|
|
@@ -16,7 +16,8 @@ export const createRepositorySchema = z.object({
|
|
|
16
16
|
url: z.string().url('Invalid repository URL'),
|
|
17
17
|
vcs_type: vcsTypeSchema,
|
|
18
18
|
credential_type: credentialTypeSchema,
|
|
19
|
-
|
|
19
|
+
// Zod v4 requires both key and value schemas
|
|
20
|
+
auth_credentials: z.record(z.string(), z.string()).refine((fields) => Object.keys(fields).length > 0, 'At least one credential field is required'),
|
|
20
21
|
composer_json_path: z.string().optional(),
|
|
21
22
|
package_filter: z.string().optional(), // Comma-separated list of packages to sync
|
|
22
23
|
});
|
|
@@ -54,4 +55,86 @@ export const tokenResponseSchema = z.object({
|
|
|
54
55
|
expires_at: z.number().nullable(),
|
|
55
56
|
last_used_at: z.number().nullable(),
|
|
56
57
|
});
|
|
58
|
+
// Auth schemas
|
|
59
|
+
export const loginRequestSchema = z.object({
|
|
60
|
+
email: z.string().email('Invalid email address'),
|
|
61
|
+
password: z.string().min(1, 'Password is required'),
|
|
62
|
+
code: z.string().optional(), // 2FA code
|
|
63
|
+
});
|
|
64
|
+
export const loginResponseSchema = z.object({
|
|
65
|
+
token: z.string(),
|
|
66
|
+
user: z.object({
|
|
67
|
+
id: z.string(),
|
|
68
|
+
email: z.string(),
|
|
69
|
+
role: z.enum(['admin', 'viewer']),
|
|
70
|
+
two_factor_enabled: z.boolean(),
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
export const userResponseSchema = z.object({
|
|
74
|
+
id: z.string(),
|
|
75
|
+
email: z.string(),
|
|
76
|
+
role: z.enum(['admin', 'viewer']),
|
|
77
|
+
two_factor_enabled: z.boolean(),
|
|
78
|
+
});
|
|
79
|
+
export const userListResponseSchema = z.object({
|
|
80
|
+
users: z.array(userResponseSchema),
|
|
81
|
+
});
|
|
82
|
+
export const createUserRequestSchema = z.object({
|
|
83
|
+
email: z.string().email('Invalid email address'),
|
|
84
|
+
password: z.string().optional(),
|
|
85
|
+
role: z.enum(['admin', 'viewer']).default('viewer'),
|
|
86
|
+
});
|
|
87
|
+
export const createUserResponseSchema = z.object({
|
|
88
|
+
message: z.string(),
|
|
89
|
+
user: userResponseSchema,
|
|
90
|
+
});
|
|
91
|
+
// Error response schema
|
|
92
|
+
export const errorResponseSchema = z.object({
|
|
93
|
+
error: z.string(),
|
|
94
|
+
message: z.string().optional(),
|
|
95
|
+
code: z.string().optional(),
|
|
96
|
+
requestId: z.string().optional(),
|
|
97
|
+
});
|
|
98
|
+
// Health check response
|
|
99
|
+
export const healthResponseSchema = z.object({
|
|
100
|
+
status: z.string(),
|
|
101
|
+
timestamp: z.number(),
|
|
102
|
+
});
|
|
103
|
+
// Stats response
|
|
104
|
+
export const statsResponseSchema = z.object({
|
|
105
|
+
active_repos: z.number(),
|
|
106
|
+
cached_packages: z.number(),
|
|
107
|
+
total_downloads: z.number(),
|
|
108
|
+
});
|
|
109
|
+
// Settings response
|
|
110
|
+
export const settingsResponseSchema = z.object({
|
|
111
|
+
kv_available: z.boolean(),
|
|
112
|
+
packagist_mirroring_enabled: z.boolean(),
|
|
113
|
+
package_caching_enabled: z.boolean(),
|
|
114
|
+
});
|
|
115
|
+
export const updatePackagistMirroringRequestSchema = z.object({
|
|
116
|
+
enabled: z.boolean(),
|
|
117
|
+
});
|
|
118
|
+
// Package schemas
|
|
119
|
+
export const packageResponseSchema = z.object({
|
|
120
|
+
id: z.string(),
|
|
121
|
+
name: z.string(),
|
|
122
|
+
version: z.string(),
|
|
123
|
+
repo_id: z.string(),
|
|
124
|
+
dist_url: z.string().nullable(),
|
|
125
|
+
source_dist_url: z.string().nullable(),
|
|
126
|
+
released_at: z.number().nullable(),
|
|
127
|
+
created_at: z.number(),
|
|
128
|
+
});
|
|
129
|
+
export const packageListResponseSchema = z.array(packageResponseSchema);
|
|
130
|
+
export const packageWithVersionsResponseSchema = z.object({
|
|
131
|
+
name: z.string(),
|
|
132
|
+
versions: z.array(packageResponseSchema),
|
|
133
|
+
});
|
|
134
|
+
// Token creation response (includes token only once)
|
|
135
|
+
export const tokenCreationResponseSchema = tokenResponseSchema.extend({
|
|
136
|
+
token: z.string(), // Only returned on creation
|
|
137
|
+
});
|
|
138
|
+
// Repository list response
|
|
139
|
+
export const repositoryListResponseSchema = z.array(repositoryResponseSchema);
|
|
57
140
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,YAAY;IACZ,cAAc;IAC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AC,qBAAqB,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;CACzC,CAAC,CAAC;AAEH,qDAAqD;AACrD,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,MAAM,CAAC;IACpE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,4BAA4B;CAChD,CAAC,CAAC;AAEH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@package-broker/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"prepublishOnly": "npm run clean && npm run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"zod": "^
|
|
27
|
+
"@hono/zod-openapi": "^1.2.0",
|
|
28
|
+
"zod": "^4.0.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"typescript": "^5.3.3"
|