@scaffoldly/rowdy 0.0.2-1-beta.20251013194655.d582c11 → 0.0.2-1-beta.20251015122625.2dde806

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 +55 -11
  2. package/dist/index.js +802 -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,78 @@ 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
+ annotations: Record<string, string>;
197
+ }>;
198
+ type Config = Ref<'application/vnd.oci.image.config.v1+json'>;
199
+ type Layer = Ref<'application/vnd.oci.image.layer.v1.tar+gzip' | 'application/vnd.oci.image.layer.v1.tar'>;
200
+ type Manifest = Ref<'application/vnd.oci.image.manifest.v1+json'> & Partial<{
201
+ platform: Partial<{
202
+ architecture: string;
203
+ os: string;
204
+ }>;
205
+ }>;
206
+ type ImageManifest = Partial<{
207
+ schemaVersion: number;
208
+ mediaType: 'application/vnd.oci.image.manifest.v1+json';
209
+ config: Config;
210
+ layers: Layer[];
211
+ }>;
212
+ type IndexManifest = Partial<{
213
+ schemaVersion: number;
214
+ mediaType: 'application/vnd.oci.image.index.v1+json';
215
+ manifests: Manifest[];
216
+ }>;
217
+ type Image = {
218
+ kind: 'Image';
190
219
  req: {
191
- to: string;
220
+ image: string | string[];
192
221
  };
193
222
  opts: {
194
- enthusiastic?: boolean;
223
+ authorization?: string | undefined;
195
224
  };
196
- res: {
197
- to: string;
225
+ res: ApiResponseStatus & {
226
+ registry: string;
227
+ namespace: string;
228
+ name: string;
229
+ reference: string;
230
+ tags: string[];
231
+ index: IndexManifest;
232
+ images: Record<string, ImageManifest>;
233
+ blobs: (Ref<string> & {
234
+ platform: string;
235
+ url: string;
236
+ })[];
198
237
  };
199
238
  };
200
239
  declare class Api {
240
+ private log;
241
+ private proxy?;
242
+ private axios;
243
+ constructor(log?: Logger);
201
244
  private routes;
202
- constructor();
245
+ withProxy(proxy: HttpProxy<Pipeline>): this;
203
246
  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>>;
247
+ image(req: Image['req'], opts?: Image['opts']): Observable<ApiSchema<Image['req'], Image['res']>>;
248
+ handle(): Observable<ApiSchema<unknown, ApiResponseStatus>>;
206
249
  private handler;
250
+ private notFound;
207
251
  }
208
252
 
209
253
  type RoutePaths = {
@@ -273,4 +317,4 @@ declare class Routes implements IRoutes, ILoggable {
273
317
 
274
318
  declare const ABORT: AbortController;
275
319
 
276
- export { ABORT, Api, Routes, URI };
320
+ export { ABORT, Api, Logger, Routes, URI };