@scaffoldly/rowdy 0.0.2-1-beta.20251013194655.d582c11 → 0.0.2-1-beta.20251015120925.faf3b02

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +54 -11
  2. package/dist/index.js +798 -398
  3. package/package.json +3 -1
package/dist/index.d.ts CHANGED
@@ -132,6 +132,7 @@ declare abstract class HttpProxy<P extends Pipeline> extends Proxy<P, HttpRespon
132
132
  declare class HttpHeaders implements ILoggable {
133
133
  private headers;
134
134
  private constructor();
135
+ get userAgent(): string;
135
136
  proxy(): HttpHeaders;
136
137
  static from(obj: Record<string, string | string[]>): HttpHeaders;
137
138
  static fromAxios(axiosHeaders: Partial<AxiosHeaders | AxiosResponseHeaders>): HttpHeaders;
@@ -166,7 +167,7 @@ declare abstract class HttpResponse implements ILoggable {
166
167
  }
167
168
 
168
169
  type ApiVersion = 'rowdy.run/v1alpha1';
169
- type ApiKind = 'Routes' | 'Health' | 'Hello' | 'NotFound';
170
+ type ApiKind = 'Routes' | 'NotFound' | Health$1['kind'] | Image['kind'];
170
171
  type ApiSchema<Spec, Status> = {
171
172
  apiVersion: ApiVersion;
172
173
  kind: ApiKind;
@@ -175,35 +176,77 @@ type ApiSchema<Spec, Status> = {
175
176
  };
176
177
  type ApiResponseStatus = {
177
178
  code: number;
178
- headers: {
179
+ headers?: {
179
180
  [key: string]: string | string[];
180
181
  };
182
+ reason?: string;
181
183
  };
182
184
  type Health$1 = {
185
+ kind: 'Health';
183
186
  req: never;
184
187
  opts: never;
185
188
  res: {
186
189
  healthy: boolean;
187
190
  };
188
191
  };
189
- type Hello = {
192
+ type Ref<T extends string> = Partial<{
193
+ mediaType: T;
194
+ size: number;
195
+ digest: string;
196
+ }>;
197
+ type Config = Ref<'application/vnd.oci.image.config.v1+json'>;
198
+ type Layer = Ref<'application/vnd.oci.image.layer.v1.tar+gzip' | 'application/vnd.oci.image.layer.v1.tar'>;
199
+ type Manifest = Ref<'application/vnd.oci.image.manifest.v1+json'> & Partial<{
200
+ platform: Partial<{
201
+ architecture: string;
202
+ os: string;
203
+ }>;
204
+ }>;
205
+ type ImageManifest = Partial<{
206
+ schemaVersion: number;
207
+ mediaType: 'application/vnd.oci.image.manifest.v1+json';
208
+ config: Config;
209
+ layers: Layer[];
210
+ }>;
211
+ type IndexManifest = Partial<{
212
+ schemaVersion: number;
213
+ mediaType: 'application/vnd.oci.image.index.v1+json';
214
+ manifests: Manifest[];
215
+ }>;
216
+ type Image = {
217
+ kind: 'Image';
190
218
  req: {
191
- to: string;
219
+ image: string | string[];
192
220
  };
193
221
  opts: {
194
- enthusiastic?: boolean;
222
+ authorization?: string | undefined;
195
223
  };
196
- res: {
197
- to: string;
224
+ res: ApiResponseStatus & {
225
+ registry: string;
226
+ namespace: string;
227
+ name: string;
228
+ reference: string;
229
+ tags: string[];
230
+ index: IndexManifest;
231
+ images: Record<string, ImageManifest>;
232
+ blobs: (Ref<string> & {
233
+ platform: string;
234
+ url: string;
235
+ })[];
198
236
  };
199
237
  };
200
238
  declare class Api {
239
+ private log;
240
+ private proxy?;
241
+ private axios;
242
+ constructor(log?: Logger);
201
243
  private routes;
202
- constructor();
244
+ withProxy(proxy: HttpProxy<Pipeline>): this;
203
245
  health(): Observable<ApiSchema<Health$1['res'], ApiResponseStatus>>;
204
- hello(req: Hello['req'], opts?: Hello['opts']): Observable<ApiSchema<Hello['res'], ApiResponseStatus>>;
205
- handle<P extends Pipeline>(proxy: HttpProxy<P>): Observable<ApiSchema<unknown, ApiResponseStatus>>;
246
+ image(req: Image['req'], opts?: Image['opts']): Observable<ApiSchema<Image['req'], Image['res']>>;
247
+ handle(): Observable<ApiSchema<unknown, ApiResponseStatus>>;
206
248
  private handler;
249
+ private notFound;
207
250
  }
208
251
 
209
252
  type RoutePaths = {
@@ -273,4 +316,4 @@ declare class Routes implements IRoutes, ILoggable {
273
316
 
274
317
  declare const ABORT: AbortController;
275
318
 
276
- export { ABORT, Api, Routes, URI };
319
+ export { ABORT, Api, Logger, Routes, URI };