@oras-project/oci-client 0.18.0-alpha.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/LICENSE +201 -0
- package/README.md +313 -0
- package/index.d.ts +678 -0
- package/index.js +818 -0
- package/package.json +103 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,678 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Which binding artifact the generated loader actually loaded: `'native'` for
|
|
6
|
+
* a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
|
|
7
|
+
* flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
|
|
8
|
+
* can point the loader at a WASI artifact this package does not build itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* OCI Distribution client for interacting with OCI registries.
|
|
14
|
+
* Provides pull, push, and manifest operations.
|
|
15
|
+
*
|
|
16
|
+
* # Authentication
|
|
17
|
+
*
|
|
18
|
+
* Methods that accept an `auth` parameter (`pull`, `push`, `pull_image_manifest`,
|
|
19
|
+
* `pull_manifest`, `pull_manifest_raw`, `push_manifest_list`, `list_tags`,
|
|
20
|
+
* `fetch_manifest_digest`, `catalog`, `pull_image_manifest_and_list_digest`,
|
|
21
|
+
* `pull_manifest_and_config_and_list_digest`) store credentials internally via
|
|
22
|
+
* the native `store_auth_if_needed` and then use them for the request.
|
|
23
|
+
*
|
|
24
|
+
* Methods without an `auth` parameter (`pull_blob`, `pull_blob_to_file`,
|
|
25
|
+
* `push_blob`, `push_blob_from_file`, `push_manifest`, `blob_exists`,
|
|
26
|
+
* `mount_blob`, `pull_referrers`) rely on credentials already stored by
|
|
27
|
+
* a prior explicit-auth call or by [`store_auth`](OciClient::store_auth).
|
|
28
|
+
*/
|
|
29
|
+
export declare class OciClient {
|
|
30
|
+
/** Create a new OCI client with default configuration. */
|
|
31
|
+
constructor()
|
|
32
|
+
/**
|
|
33
|
+
* Create a new OCI client with custom configuration.
|
|
34
|
+
*
|
|
35
|
+
* Throws if the configuration is invalid (e.g. malformed CA certificate,
|
|
36
|
+
* bad proxy URL). This differs from the parent crate's `Client::new` which
|
|
37
|
+
* silently falls back to defaults — in Node.js there is no `tracing`
|
|
38
|
+
* subscriber to surface those warnings, so we fail explicitly instead.
|
|
39
|
+
*/
|
|
40
|
+
static withConfig(config: ClientConfig): OciClient
|
|
41
|
+
/**
|
|
42
|
+
* Explicitly release the underlying connection pool.
|
|
43
|
+
*
|
|
44
|
+
* This is **idempotent** — calling `close()` on an already-closed client
|
|
45
|
+
* is a safe no-op that returns `false`.
|
|
46
|
+
*
|
|
47
|
+
* **In-flight operations are not cancelled.** Any async method that already
|
|
48
|
+
* cloned the inner client will run to completion; only the shared pool
|
|
49
|
+
* reference held by the `OciClient` is dropped. The connection pool is
|
|
50
|
+
* fully reclaimed when the last in-flight clone finishes.
|
|
51
|
+
*
|
|
52
|
+
* After `close()`, all subsequent method calls will throw `"Client is closed"`.
|
|
53
|
+
*/
|
|
54
|
+
close(): boolean
|
|
55
|
+
/**
|
|
56
|
+
* Pull an image from the registry.
|
|
57
|
+
*
|
|
58
|
+
* Wraps native `Client::pull`.
|
|
59
|
+
*
|
|
60
|
+
* Returns ImageData containing layers (as Buffers), config, and manifest.
|
|
61
|
+
*/
|
|
62
|
+
pull(image: string, auth: RegistryAuth, acceptedMediaTypes: Array<string>): Promise<ImageData>
|
|
63
|
+
/**
|
|
64
|
+
* Push an image to the registry.
|
|
65
|
+
*
|
|
66
|
+
* Wraps native `Client::push`.
|
|
67
|
+
*
|
|
68
|
+
* Do not mutate `layers[].data` or `config.data` until this Promise settles.
|
|
69
|
+
* The Buffers are borrowed for the duration of the upload (same contract as
|
|
70
|
+
* Node `fs.write` / `socket.write`).
|
|
71
|
+
*
|
|
72
|
+
* Returns PushResponse with config and manifest URLs.
|
|
73
|
+
*/
|
|
74
|
+
push(imageRef: string, layers: Array<ImageLayer>, config: Config, auth: RegistryAuth, manifest?: ImageManifest | undefined | null): Promise<PushResponse>
|
|
75
|
+
/**
|
|
76
|
+
* Pull referrers for an artifact (OCI 1.1 Referrers API).
|
|
77
|
+
*
|
|
78
|
+
* Wraps native `Client::pull_referrers`.
|
|
79
|
+
*
|
|
80
|
+
* Returns an ImageIndex containing the referrers.
|
|
81
|
+
*/
|
|
82
|
+
pullReferrers(image: string, artifactType?: string | undefined | null): Promise<ImageIndex>
|
|
83
|
+
/**
|
|
84
|
+
* Push a manifest list (image index) to the registry.
|
|
85
|
+
*
|
|
86
|
+
* Wraps native `Client::push_manifest_list`.
|
|
87
|
+
*
|
|
88
|
+
* Returns the manifest URL.
|
|
89
|
+
*/
|
|
90
|
+
pushManifestList(reference: string, auth: RegistryAuth, manifest: ImageIndex): Promise<string>
|
|
91
|
+
/**
|
|
92
|
+
* Pull an image manifest from the registry.
|
|
93
|
+
*
|
|
94
|
+
* Wraps native `Client::pull_image_manifest`.
|
|
95
|
+
*
|
|
96
|
+
* If a multi-platform Image Index manifest is encountered, a platform-specific
|
|
97
|
+
* Image manifest will be selected using the client's default platform resolution.
|
|
98
|
+
*
|
|
99
|
+
* Returns both the manifest and its digest.
|
|
100
|
+
*/
|
|
101
|
+
pullImageManifest(image: string, auth: RegistryAuth): Promise<PullImageManifestResult>
|
|
102
|
+
/**
|
|
103
|
+
* Store authentication credentials for a registry.
|
|
104
|
+
*
|
|
105
|
+
* Wraps native `Client::store_auth_if_needed`: credentials are stored only
|
|
106
|
+
* if the registry does not already have stored auth. Once stored, all
|
|
107
|
+
* subsequent operations against the same registry (`pull_blob`, `push_blob`,
|
|
108
|
+
* `push_manifest`, etc.) will use them automatically.
|
|
109
|
+
*/
|
|
110
|
+
storeAuth(registry: string, auth: RegistryAuth): Promise<void>
|
|
111
|
+
/**
|
|
112
|
+
* Pull a manifest (either image or index) from the registry.
|
|
113
|
+
* Returns the manifest and its digest.
|
|
114
|
+
*/
|
|
115
|
+
pullManifest(image: string, auth: RegistryAuth): Promise<PullManifestResult>
|
|
116
|
+
/** Pull a manifest as raw bytes. */
|
|
117
|
+
pullManifestRaw(image: string, auth: RegistryAuth, acceptedMediaTypes: Array<string>): Promise<Buffer>
|
|
118
|
+
/**
|
|
119
|
+
* Push a manifest to the registry.
|
|
120
|
+
* Returns the manifest URL.
|
|
121
|
+
*/
|
|
122
|
+
pushManifest(image: string, manifest: Manifest): Promise<string>
|
|
123
|
+
/**
|
|
124
|
+
* Push a blob to the registry.
|
|
125
|
+
* Returns the blob digest.
|
|
126
|
+
*
|
|
127
|
+
* Do not mutate `data` until this Promise settles. The Buffer is borrowed
|
|
128
|
+
* for the duration of the upload (same contract as Node `fs.write` /
|
|
129
|
+
* `socket.write`).
|
|
130
|
+
*/
|
|
131
|
+
pushBlob(image: string, data: Buffer, digest: string): Promise<string>
|
|
132
|
+
/**
|
|
133
|
+
* Pull a blob from the registry.
|
|
134
|
+
* Returns the blob data.
|
|
135
|
+
*/
|
|
136
|
+
pullBlob(image: string, digest: string): Promise<Buffer>
|
|
137
|
+
/**
|
|
138
|
+
* Pull a blob from the registry and write it to `path`.
|
|
139
|
+
*
|
|
140
|
+
* The destination file is created or truncated. Bytes are copied from the
|
|
141
|
+
* registry socket to disk and never enter a JavaScript `Buffer`. The
|
|
142
|
+
* digest is verified when the write completes.
|
|
143
|
+
*/
|
|
144
|
+
pullBlobToFile(image: string, digest: string, path: string): Promise<undefined>
|
|
145
|
+
/**
|
|
146
|
+
* Push a blob from a file at `path`.
|
|
147
|
+
*
|
|
148
|
+
* The file is streamed to the registry. `digest` must be the SHA-256
|
|
149
|
+
* digest of the file contents (`sha256:<hex>`).
|
|
150
|
+
*/
|
|
151
|
+
pushBlobFromFile(image: string, path: string, digest: string): Promise<string>
|
|
152
|
+
/** Check if a blob exists in the registry. */
|
|
153
|
+
blobExists(image: string, digest: string): Promise<boolean>
|
|
154
|
+
/** Mount a blob from another repository. */
|
|
155
|
+
mountBlob(target: string, source: string, digest: string): Promise<undefined>
|
|
156
|
+
/** List tags for a repository. */
|
|
157
|
+
listTags(image: string, auth: RegistryAuth, n?: number | undefined | null, last?: string | undefined | null): Promise<Array<string>>
|
|
158
|
+
/** Fetch manifest digest without downloading the full manifest. */
|
|
159
|
+
fetchManifestDigest(image: string, auth: RegistryAuth): Promise<string>
|
|
160
|
+
/**
|
|
161
|
+
* List available repositories in the registry.
|
|
162
|
+
* Implements the OCI Distribution Spec catalog endpoint (`/v2/_catalog`).
|
|
163
|
+
* Supports pagination via `n` (page size) and `last` (last repo from previous page).
|
|
164
|
+
*/
|
|
165
|
+
catalog(image: string, auth: RegistryAuth, n?: number | undefined | null, last?: string | undefined | null): Promise<Array<string>>
|
|
166
|
+
/**
|
|
167
|
+
* Pull an image manifest and the parent manifest list digest from the registry.
|
|
168
|
+
*
|
|
169
|
+
* Like `pullImageManifest`, but also returns the digest of the parent
|
|
170
|
+
* manifest list/image index when the resolved manifest came from one.
|
|
171
|
+
* This is needed for signature verification on multi-arch images.
|
|
172
|
+
*/
|
|
173
|
+
pullImageManifestAndListDigest(image: string, auth: RegistryAuth): Promise<PullImageManifestAndListDigestResult>
|
|
174
|
+
/**
|
|
175
|
+
* Pull a manifest, its config, and the parent manifest list digest from the registry.
|
|
176
|
+
*
|
|
177
|
+
* Returns the image manifest, its digest, the config JSON as a string,
|
|
178
|
+
* and the parent manifest list/image index digest when applicable.
|
|
179
|
+
*/
|
|
180
|
+
pullManifestAndConfigAndListDigest(image: string, auth: RegistryAuth): Promise<PullManifestAndConfigAndListDigestResult>
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Create an anonymous authentication object. */
|
|
184
|
+
export declare function anonymousAuth(): RegistryAuth
|
|
185
|
+
|
|
186
|
+
/** Create a basic authentication object. */
|
|
187
|
+
export declare function basicAuth(username: string, password: string): RegistryAuth
|
|
188
|
+
|
|
189
|
+
/** Create a bearer token authentication object. */
|
|
190
|
+
export declare function bearerAuth(token: string): RegistryAuth
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* A x509 certificate for TLS.
|
|
194
|
+
* Wraps native `Certificate`.
|
|
195
|
+
*/
|
|
196
|
+
export interface Certificate {
|
|
197
|
+
/** Which encoding is used by the certificate */
|
|
198
|
+
encoding: CertificateEncoding
|
|
199
|
+
/** Certificate data as bytes */
|
|
200
|
+
data: Buffer
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Certificate encoding format.
|
|
205
|
+
* Wraps native `CertificateEncoding`.
|
|
206
|
+
*/
|
|
207
|
+
export enum CertificateEncoding {
|
|
208
|
+
/** DER encoded certificate */
|
|
209
|
+
Der = 'Der',
|
|
210
|
+
/** PEM encoded certificate */
|
|
211
|
+
Pem = 'Pem',
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Client configuration options.
|
|
216
|
+
* Wraps native `ClientConfig`.
|
|
217
|
+
*/
|
|
218
|
+
export interface ClientConfig {
|
|
219
|
+
/** Which protocol the client should use (default: Https) */
|
|
220
|
+
protocol?: ClientProtocol
|
|
221
|
+
/** List of registries to exclude from HTTPS (used with HttpsExcept protocol) */
|
|
222
|
+
httpsExceptRegistries?: Array<string>
|
|
223
|
+
/**
|
|
224
|
+
* **DANGER**: Accept invalid TLS certificates (default: false).
|
|
225
|
+
* Setting this to `true` disables all certificate verification, making
|
|
226
|
+
* connections vulnerable to man-in-the-middle attacks. Only use for
|
|
227
|
+
* local development or testing with self-signed certificates.
|
|
228
|
+
* Prefer `extraRootCertificates` for production self-signed setups.
|
|
229
|
+
*/
|
|
230
|
+
acceptInvalidCertificates?: boolean
|
|
231
|
+
/** Use monolithic push for pushing blobs (default: false) */
|
|
232
|
+
useMonolithicPush?: boolean
|
|
233
|
+
/** Extra root certificates to trust (for self-signed certificates) */
|
|
234
|
+
extraRootCertificates?: Array<Certificate>
|
|
235
|
+
/** Exclusive root certificates -- disables system roots and only uses these */
|
|
236
|
+
tlsCertsOnly?: Array<Certificate>
|
|
237
|
+
/** Maximum number of concurrent uploads during push (default: 16) */
|
|
238
|
+
maxConcurrentUpload?: number
|
|
239
|
+
/** Maximum number of concurrent downloads during pull (default: 16) */
|
|
240
|
+
maxConcurrentDownload?: number
|
|
241
|
+
/** Default token expiration in seconds (default: 60) */
|
|
242
|
+
defaultTokenExpirationSecs?: number
|
|
243
|
+
/** Read timeout in milliseconds */
|
|
244
|
+
readTimeoutMs?: number
|
|
245
|
+
/** Connect timeout in milliseconds */
|
|
246
|
+
connectTimeoutMs?: number
|
|
247
|
+
/** HTTPS proxy URL */
|
|
248
|
+
httpsProxy?: string
|
|
249
|
+
/** HTTP proxy URL */
|
|
250
|
+
httpProxy?: string
|
|
251
|
+
/** No proxy list (comma-separated) */
|
|
252
|
+
noProxy?: string
|
|
253
|
+
/**
|
|
254
|
+
* Platform filter for multi-platform image selection.
|
|
255
|
+
* When set, automatically selects the matching platform from Image Index manifests.
|
|
256
|
+
*/
|
|
257
|
+
platform?: PlatformFilter
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Protocol configuration for the client.
|
|
262
|
+
* Wraps native `ClientProtocol`.
|
|
263
|
+
*/
|
|
264
|
+
export enum ClientProtocol {
|
|
265
|
+
/** Use HTTP (insecure) */
|
|
266
|
+
Http = 'Http',
|
|
267
|
+
/** Use HTTPS (secure, default) */
|
|
268
|
+
Https = 'Https',
|
|
269
|
+
/** Use HTTPS except for specified registries */
|
|
270
|
+
HttpsExcept = 'HttpsExcept',
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Configuration object for an image.
|
|
275
|
+
* Wraps native `Config`.
|
|
276
|
+
*/
|
|
277
|
+
export interface Config {
|
|
278
|
+
/** The config data as raw bytes */
|
|
279
|
+
data: Buffer
|
|
280
|
+
/** The media type of this config */
|
|
281
|
+
mediaType: string
|
|
282
|
+
/** Optional annotations for this config */
|
|
283
|
+
annotations?: Record<string, string>
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** OCI Descriptor - describes a content addressable resource. */
|
|
287
|
+
export interface Descriptor {
|
|
288
|
+
/** The media type of the referenced content */
|
|
289
|
+
mediaType: string
|
|
290
|
+
/** The digest of the targeted content */
|
|
291
|
+
digest: string
|
|
292
|
+
/** The size in bytes of the targeted content */
|
|
293
|
+
size: number
|
|
294
|
+
/** Optional list of URLs from which this object may be downloaded */
|
|
295
|
+
urls?: Array<string>
|
|
296
|
+
/** Optional annotations for this descriptor */
|
|
297
|
+
annotations?: Record<string, string>
|
|
298
|
+
/** Optional artifact type when the descriptor points to an artifact */
|
|
299
|
+
artifactType?: string
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface ErrorCause {
|
|
303
|
+
type: string
|
|
304
|
+
message: string
|
|
305
|
+
debug: string
|
|
306
|
+
parsed?: any
|
|
307
|
+
cause?: ErrorCause
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export declare function fromOciError(err: unknown): OciDistributionError | ParseError
|
|
311
|
+
|
|
312
|
+
/** The mediatype for an image config (manifest) */
|
|
313
|
+
export declare const IMAGE_CONFIG_MEDIA_TYPE: string
|
|
314
|
+
|
|
315
|
+
/** The mediatype that Docker uses for image configs */
|
|
316
|
+
export declare const IMAGE_DOCKER_CONFIG_MEDIA_TYPE: string
|
|
317
|
+
|
|
318
|
+
/** The mediatype that Docker uses for a layer that is gzipped */
|
|
319
|
+
export declare const IMAGE_DOCKER_LAYER_GZIP_MEDIA_TYPE: string
|
|
320
|
+
|
|
321
|
+
/** The mediatype that Docker uses for a layer that is tarred */
|
|
322
|
+
export declare const IMAGE_DOCKER_LAYER_TAR_MEDIA_TYPE: string
|
|
323
|
+
|
|
324
|
+
/** The mediatype for a layer that is gzipped */
|
|
325
|
+
export declare const IMAGE_LAYER_GZIP_MEDIA_TYPE: string
|
|
326
|
+
|
|
327
|
+
/** The mediatype for a layer */
|
|
328
|
+
export declare const IMAGE_LAYER_MEDIA_TYPE: string
|
|
329
|
+
|
|
330
|
+
/** The mediatype for a layer that is nondistributable and gzipped */
|
|
331
|
+
export declare const IMAGE_LAYER_NONDISTRIBUTABLE_GZIP_MEDIA_TYPE: string
|
|
332
|
+
|
|
333
|
+
/** The mediatype for a layer that is nondistributable */
|
|
334
|
+
export declare const IMAGE_LAYER_NONDISTRIBUTABLE_MEDIA_TYPE: string
|
|
335
|
+
|
|
336
|
+
/** The mediatype for a Docker v2 schema 2 manifest list */
|
|
337
|
+
export declare const IMAGE_MANIFEST_LIST_MEDIA_TYPE: string
|
|
338
|
+
|
|
339
|
+
/** The mediatype for a Docker v2 schema 2 manifest */
|
|
340
|
+
export declare const IMAGE_MANIFEST_MEDIA_TYPE: string
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Data returned from pulling an image.
|
|
344
|
+
* Wraps native `ImageData`.
|
|
345
|
+
*/
|
|
346
|
+
export interface ImageData {
|
|
347
|
+
/** The layers of the image */
|
|
348
|
+
layers: Array<ImageLayer>
|
|
349
|
+
/** The digest of the image (if available) */
|
|
350
|
+
digest?: string
|
|
351
|
+
/** The configuration object of the image */
|
|
352
|
+
config: Config
|
|
353
|
+
/** The manifest (if available) */
|
|
354
|
+
manifest?: ImageManifest
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** OCI Image Index (manifest list). */
|
|
358
|
+
export interface ImageIndex {
|
|
359
|
+
/** Schema version (always 2) */
|
|
360
|
+
schemaVersion: number
|
|
361
|
+
/** Media type of this manifest */
|
|
362
|
+
mediaType?: string
|
|
363
|
+
/** List of manifests for specific platforms */
|
|
364
|
+
manifests: Array<ManifestEntry>
|
|
365
|
+
/** Artifact type */
|
|
366
|
+
artifactType?: string
|
|
367
|
+
/** Annotations */
|
|
368
|
+
annotations?: Record<string, string>
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* An image layer with data and metadata.
|
|
373
|
+
* Wraps native `ImageLayer`.
|
|
374
|
+
*/
|
|
375
|
+
export interface ImageLayer {
|
|
376
|
+
/** The layer data as raw bytes */
|
|
377
|
+
data: Buffer
|
|
378
|
+
/** The media type of this layer */
|
|
379
|
+
mediaType: string
|
|
380
|
+
/** Optional annotations for this layer */
|
|
381
|
+
annotations?: Record<string, string>
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** OCI Image Manifest. */
|
|
385
|
+
export interface ImageManifest {
|
|
386
|
+
/** Schema version (always 2) */
|
|
387
|
+
schemaVersion: number
|
|
388
|
+
/** Media type of this manifest */
|
|
389
|
+
mediaType?: string
|
|
390
|
+
/** The image configuration descriptor */
|
|
391
|
+
config: Descriptor
|
|
392
|
+
/** The image layers */
|
|
393
|
+
layers: Array<Descriptor>
|
|
394
|
+
/** Subject descriptor (for referrers) */
|
|
395
|
+
subject?: Descriptor
|
|
396
|
+
/** Artifact type */
|
|
397
|
+
artifactType?: string
|
|
398
|
+
/** Annotations */
|
|
399
|
+
annotations?: Record<string, string>
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* OCI Manifest - can be either an Image manifest or an ImageIndex.
|
|
404
|
+
* Check `manifest_type` to determine which field is populated.
|
|
405
|
+
*/
|
|
406
|
+
export interface Manifest {
|
|
407
|
+
/** The type of manifest */
|
|
408
|
+
manifestType: ManifestType
|
|
409
|
+
/** The image manifest (populated when manifest_type is Image) */
|
|
410
|
+
image?: ImageManifest
|
|
411
|
+
/** The image index (populated when manifest_type is ImageIndex) */
|
|
412
|
+
imageIndex?: ImageIndex
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** An entry in an image index manifest. */
|
|
416
|
+
export interface ManifestEntry {
|
|
417
|
+
/** Media type of the manifest */
|
|
418
|
+
mediaType: string
|
|
419
|
+
/** Digest of the manifest */
|
|
420
|
+
digest: string
|
|
421
|
+
/** Size in bytes */
|
|
422
|
+
size: number
|
|
423
|
+
/** Platform specification */
|
|
424
|
+
platform?: PlatformSpec
|
|
425
|
+
/** Annotations */
|
|
426
|
+
annotations?: Record<string, string>
|
|
427
|
+
/** Optional artifact type for referrers */
|
|
428
|
+
artifactType?: string
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/** Manifest type discriminator. */
|
|
432
|
+
export enum ManifestType {
|
|
433
|
+
/** An OCI image manifest */
|
|
434
|
+
Image = 'Image',
|
|
435
|
+
/** An OCI image index (manifest list) */
|
|
436
|
+
ImageIndex = 'ImageIndex',
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/** The mediatype for an OCI image index manifest */
|
|
440
|
+
export declare const OCI_IMAGE_INDEX_MEDIA_TYPE: string
|
|
441
|
+
|
|
442
|
+
/** The mediatype for an OCI image manifest */
|
|
443
|
+
export declare const OCI_IMAGE_MEDIA_TYPE: string
|
|
444
|
+
|
|
445
|
+
export type OciBindingError =
|
|
446
|
+
| { type: 'Distribution'; field0: OciDistributionError }
|
|
447
|
+
| { type: 'Parse'; field0: ParseError }
|
|
448
|
+
|
|
449
|
+
export type OciDistributionError =
|
|
450
|
+
| { type: 'AuthenticationFailure'; message: string; cause?: ErrorCause }
|
|
451
|
+
| { type: 'ConfigConversionError'; message: string; cause?: ErrorCause }
|
|
452
|
+
| { type: 'DigestError'; message: string; cause?: ErrorCause }
|
|
453
|
+
| { type: 'GenericError'; message: string; cause?: ErrorCause }
|
|
454
|
+
| { type: 'HeaderValueError'; message: string; cause?: ErrorCause }
|
|
455
|
+
| { type: 'ImageIndexParsingNoPlatformResolverError'; message: string; cause?: ErrorCause }
|
|
456
|
+
| { type: 'ImageManifestNotFoundError'; message: string; cause?: ErrorCause; image: string }
|
|
457
|
+
| { type: 'IncompatibleLayerMediaTypeError'; message: string; cause?: ErrorCause }
|
|
458
|
+
| { type: 'IoError'; message: string; cause?: ErrorCause }
|
|
459
|
+
| { type: 'JsonError'; message: string; cause?: ErrorCause }
|
|
460
|
+
| { type: 'ManifestEncodingError'; message: string; cause?: ErrorCause }
|
|
461
|
+
| { type: 'ManifestParsingError'; message: string; cause?: ErrorCause }
|
|
462
|
+
| { type: 'PullNoLayersError'; message: string; cause?: ErrorCause }
|
|
463
|
+
| { type: 'PushLayerNoDataError'; message: string; cause?: ErrorCause }
|
|
464
|
+
| { type: 'PushNoDataError'; message: string; cause?: ErrorCause }
|
|
465
|
+
| { type: 'RegistryError'; message: string; cause?: ErrorCause; url: string; errors: Array<OciRegistryError> }
|
|
466
|
+
| { type: 'RegistryNoDigestError'; message: string; cause?: ErrorCause }
|
|
467
|
+
| { type: 'RegistryNoLocationError'; message: string; cause?: ErrorCause }
|
|
468
|
+
| { type: 'RegistryTokenDecodeError'; message: string; cause?: ErrorCause }
|
|
469
|
+
| { type: 'RequestError'; message: string; cause?: ErrorCause }
|
|
470
|
+
| { type: 'ServerError'; message: string; cause?: ErrorCause; statusCode: number; url: string; serverMessage: string }
|
|
471
|
+
| { type: 'SpecViolationError'; message: string; cause?: ErrorCause }
|
|
472
|
+
| { type: 'UnauthorizedError'; message: string; cause?: ErrorCause; url: string }
|
|
473
|
+
| { type: 'UrlParseError'; message: string; cause?: ErrorCause }
|
|
474
|
+
| { type: 'UnsupportedMediaTypeError'; message: string; cause?: ErrorCause }
|
|
475
|
+
| { type: 'UnsupportedSchemaVersionError'; message: string; cause?: ErrorCause }
|
|
476
|
+
| { type: 'VersionedParsingError'; message: string; cause?: ErrorCause }
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Known OCI Distribution Spec error codes.
|
|
480
|
+
*
|
|
481
|
+
* Unknown registry codes are not represented here — they appear as plain
|
|
482
|
+
* strings on `OciRegistryError.code`.
|
|
483
|
+
*/
|
|
484
|
+
export enum OciErrorCode {
|
|
485
|
+
BlobUnknown = 'BlobUnknown',
|
|
486
|
+
BlobUploadInvalid = 'BlobUploadInvalid',
|
|
487
|
+
BlobUploadUnknown = 'BlobUploadUnknown',
|
|
488
|
+
DigestInvalid = 'DigestInvalid',
|
|
489
|
+
ManifestBlobUnknown = 'ManifestBlobUnknown',
|
|
490
|
+
ManifestInvalid = 'ManifestInvalid',
|
|
491
|
+
ManifestUnknown = 'ManifestUnknown',
|
|
492
|
+
ManifestUnverified = 'ManifestUnverified',
|
|
493
|
+
NameInvalid = 'NameInvalid',
|
|
494
|
+
NameUnknown = 'NameUnknown',
|
|
495
|
+
NotFound = 'NotFound',
|
|
496
|
+
SizeInvalid = 'SizeInvalid',
|
|
497
|
+
TagInvalid = 'TagInvalid',
|
|
498
|
+
Unauthorized = 'Unauthorized',
|
|
499
|
+
Denied = 'Denied',
|
|
500
|
+
Unsupported = 'Unsupported',
|
|
501
|
+
Toomanyrequests = 'Toomanyrequests',
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export interface OciRegistryError {
|
|
505
|
+
/**
|
|
506
|
+
* Known codes are the `OciErrorCode` string values; unknown registry
|
|
507
|
+
* codes are arbitrary strings. Uses `` `${OciErrorCode}` | (string & {}) ``
|
|
508
|
+
* so TypeScript expands the enum to a string-literal union (for
|
|
509
|
+
* autocomplete) without collapsing to plain `string`.
|
|
510
|
+
*/
|
|
511
|
+
code: `${OciErrorCode}` | (string & {})
|
|
512
|
+
message: string
|
|
513
|
+
detail: string
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/** Contact details of the people or organization responsible for the image (freeform string) */
|
|
517
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_AUTHORS: string
|
|
518
|
+
|
|
519
|
+
/** Digest of the image this image is based on (string) */
|
|
520
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_BASE_DIGEST: string
|
|
521
|
+
|
|
522
|
+
/** Image reference of the image this image is based on (string) */
|
|
523
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_BASE_NAME: string
|
|
524
|
+
|
|
525
|
+
/** Date and time on which the image was built (string, date-time as defined by RFC 3339) */
|
|
526
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_CREATED: string
|
|
527
|
+
|
|
528
|
+
/** Human-readable description of the software packaged in the image (string) */
|
|
529
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_DESCRIPTION: string
|
|
530
|
+
|
|
531
|
+
/** URL to get documentation on the image (string) */
|
|
532
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_DOCUMENTATION: string
|
|
533
|
+
|
|
534
|
+
/** License(s) under which contained software is distributed as an SPDX License Expression */
|
|
535
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_LICENSES: string
|
|
536
|
+
|
|
537
|
+
/** Name of the reference for a target (string) */
|
|
538
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_REF_NAME: string
|
|
539
|
+
|
|
540
|
+
/** Source control revision identifier for the packaged software */
|
|
541
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_REVISION: string
|
|
542
|
+
|
|
543
|
+
/** URL to get source code for building the image (string) */
|
|
544
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_SOURCE: string
|
|
545
|
+
|
|
546
|
+
/** Human-readable title of the image (string) */
|
|
547
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_TITLE: string
|
|
548
|
+
|
|
549
|
+
/** URL to find more information on the image (string) */
|
|
550
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_URL: string
|
|
551
|
+
|
|
552
|
+
/** Name of the distributing entity, organization or individual */
|
|
553
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_VENDOR: string
|
|
554
|
+
|
|
555
|
+
/** Version of the packaged software */
|
|
556
|
+
export declare const ORG_OPENCONTAINERS_IMAGE_VERSION: string
|
|
557
|
+
|
|
558
|
+
export type ParseError =
|
|
559
|
+
| { type: 'DigestInvalidFormat'; message: string; cause?: ErrorCause }
|
|
560
|
+
| { type: 'DigestInvalidLength'; message: string; cause?: ErrorCause }
|
|
561
|
+
| { type: 'DigestUnsupported'; message: string; cause?: ErrorCause }
|
|
562
|
+
| { type: 'NameContainsUppercase'; message: string; cause?: ErrorCause }
|
|
563
|
+
| { type: 'NameEmpty'; message: string; cause?: ErrorCause }
|
|
564
|
+
| { type: 'NameTooLong'; message: string; cause?: ErrorCause }
|
|
565
|
+
| { type: 'ReferenceInvalidFormat'; message: string; cause?: ErrorCause }
|
|
566
|
+
| { type: 'TagInvalidFormat'; message: string; cause?: ErrorCause }
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Platform filter for selecting a specific platform from multi-platform images.
|
|
570
|
+
* When set, the client will automatically select the matching platform from Image Index manifests.
|
|
571
|
+
*/
|
|
572
|
+
export interface PlatformFilter {
|
|
573
|
+
/** Operating system (e.g., "linux", "windows", "darwin") */
|
|
574
|
+
os: string
|
|
575
|
+
/** CPU architecture (e.g., "amd64", "arm64", "arm") */
|
|
576
|
+
architecture: string
|
|
577
|
+
/** Optional variant (e.g., "v7" for arm/v7) */
|
|
578
|
+
variant?: string
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/** Platform specification for an image. */
|
|
582
|
+
export interface PlatformSpec {
|
|
583
|
+
/** CPU architecture */
|
|
584
|
+
architecture: string
|
|
585
|
+
/** Operating system */
|
|
586
|
+
os: string
|
|
587
|
+
/** OS version */
|
|
588
|
+
osVersion?: string
|
|
589
|
+
/** OS features */
|
|
590
|
+
osFeatures?: Array<string>
|
|
591
|
+
/** CPU variant */
|
|
592
|
+
variant?: string
|
|
593
|
+
/** Additional features */
|
|
594
|
+
features?: Array<string>
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/** Result from pull_image_manifest_and_list_digest. */
|
|
598
|
+
export interface PullImageManifestAndListDigestResult {
|
|
599
|
+
/** The pulled image manifest */
|
|
600
|
+
manifest: ImageManifest
|
|
601
|
+
/** The digest of the manifest */
|
|
602
|
+
digest: string
|
|
603
|
+
/** The digest of the parent manifest list/image index, if the manifest was resolved from one */
|
|
604
|
+
listDigest?: string
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/** Result from pull_image_manifest containing both manifest and digest. */
|
|
608
|
+
export interface PullImageManifestResult {
|
|
609
|
+
/** The pulled image manifest */
|
|
610
|
+
manifest: ImageManifest
|
|
611
|
+
/** The digest of the manifest */
|
|
612
|
+
digest: string
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/** Result from pull_manifest_and_config_and_list_digest. */
|
|
616
|
+
export interface PullManifestAndConfigAndListDigestResult {
|
|
617
|
+
/** The pulled image manifest */
|
|
618
|
+
manifest: ImageManifest
|
|
619
|
+
/** The digest of the manifest */
|
|
620
|
+
digest: string
|
|
621
|
+
/** The config JSON as a string */
|
|
622
|
+
config: string
|
|
623
|
+
/** The digest of the parent manifest list/image index, if the manifest was resolved from one */
|
|
624
|
+
listDigest?: string
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/** Result from pull_manifest containing both manifest and digest. */
|
|
628
|
+
export interface PullManifestResult {
|
|
629
|
+
/** The pulled manifest */
|
|
630
|
+
manifest: Manifest
|
|
631
|
+
/** The digest of the manifest */
|
|
632
|
+
digest: string
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Response from pushing an image.
|
|
637
|
+
* Wraps native `PushResponse`.
|
|
638
|
+
*/
|
|
639
|
+
export interface PushResponse {
|
|
640
|
+
/** Pullable URL for the config */
|
|
641
|
+
configUrl: string
|
|
642
|
+
/** Pullable URL for the manifest */
|
|
643
|
+
manifestUrl: string
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Registry authentication configuration.
|
|
648
|
+
* Use `auth_type` to specify the authentication method.
|
|
649
|
+
*/
|
|
650
|
+
export interface RegistryAuth {
|
|
651
|
+
/** The type of authentication to use */
|
|
652
|
+
authType: RegistryAuthType
|
|
653
|
+
/** Username for Basic auth (required when auth_type is Basic) */
|
|
654
|
+
username?: string
|
|
655
|
+
/** Password for Basic auth (required when auth_type is Basic) */
|
|
656
|
+
password?: string
|
|
657
|
+
/** Token for Bearer auth (required when auth_type is Bearer) */
|
|
658
|
+
token?: string
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Authentication method for registry access.
|
|
663
|
+
* Wraps native `RegistryAuth`.
|
|
664
|
+
*/
|
|
665
|
+
export enum RegistryAuthType {
|
|
666
|
+
/** Access the registry anonymously */
|
|
667
|
+
Anonymous = 'Anonymous',
|
|
668
|
+
/** Access the registry using HTTP Basic authentication */
|
|
669
|
+
Basic = 'Basic',
|
|
670
|
+
/** Access the registry using Bearer token authentication */
|
|
671
|
+
Bearer = 'Bearer',
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/** The mediatype for a WASM image config */
|
|
675
|
+
export declare const WASM_CONFIG_MEDIA_TYPE: string
|
|
676
|
+
|
|
677
|
+
/** The mediatype for WASM layers */
|
|
678
|
+
export declare const WASM_LAYER_MEDIA_TYPE: string
|