@ostanin/podman 0.1.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.
Files changed (142) hide show
  1. package/README.md +432 -0
  2. package/esm/_dnt.polyfills.d.ts +7 -0
  3. package/esm/_dnt.polyfills.d.ts.map +1 -0
  4. package/esm/_dnt.polyfills.js +1 -0
  5. package/esm/api/artifacts.d.ts +25 -0
  6. package/esm/api/artifacts.d.ts.map +1 -0
  7. package/esm/api/artifacts.js +89 -0
  8. package/esm/api/containers.d.ts +71 -0
  9. package/esm/api/containers.d.ts.map +1 -0
  10. package/esm/api/containers.js +234 -0
  11. package/esm/api/exec.d.ts +15 -0
  12. package/esm/api/exec.d.ts.map +1 -0
  13. package/esm/api/exec.js +45 -0
  14. package/esm/api/generate.d.ts +11 -0
  15. package/esm/api/generate.d.ts.map +1 -0
  16. package/esm/api/generate.js +24 -0
  17. package/esm/api/images.d.ts +55 -0
  18. package/esm/api/images.d.ts.map +1 -0
  19. package/esm/api/images.js +212 -0
  20. package/esm/api/kube.d.ts +13 -0
  21. package/esm/api/kube.d.ts.map +1 -0
  22. package/esm/api/kube.js +38 -0
  23. package/esm/api/manifests.d.ts +19 -0
  24. package/esm/api/manifests.d.ts.map +1 -0
  25. package/esm/api/manifests.js +60 -0
  26. package/esm/api/networks.d.ts +25 -0
  27. package/esm/api/networks.d.ts.map +1 -0
  28. package/esm/api/networks.js +95 -0
  29. package/esm/api/pods.d.ts +35 -0
  30. package/esm/api/pods.d.ts.map +1 -0
  31. package/esm/api/pods.js +120 -0
  32. package/esm/api/quadlets.d.ts +23 -0
  33. package/esm/api/quadlets.d.ts.map +1 -0
  34. package/esm/api/quadlets.js +56 -0
  35. package/esm/api/secrets.d.ts +17 -0
  36. package/esm/api/secrets.d.ts.map +1 -0
  37. package/esm/api/secrets.js +49 -0
  38. package/esm/api/system.d.ts +23 -0
  39. package/esm/api/system.d.ts.map +1 -0
  40. package/esm/api/system.js +98 -0
  41. package/esm/api/volumes.d.ts +23 -0
  42. package/esm/api/volumes.d.ts.map +1 -0
  43. package/esm/api/volumes.js +69 -0
  44. package/esm/client.d.ts +56 -0
  45. package/esm/client.d.ts.map +1 -0
  46. package/esm/client.js +63 -0
  47. package/esm/internal/query.d.ts +2 -0
  48. package/esm/internal/query.d.ts.map +1 -0
  49. package/esm/internal/query.js +24 -0
  50. package/esm/mod.d.ts +22 -0
  51. package/esm/mod.d.ts.map +1 -0
  52. package/esm/mod.js +18 -0
  53. package/esm/package.json +3 -0
  54. package/esm/ssh_transport.d.ts +14 -0
  55. package/esm/ssh_transport.d.ts.map +1 -0
  56. package/esm/ssh_transport.js +85 -0
  57. package/esm/transport.d.ts +23 -0
  58. package/esm/transport.d.ts.map +1 -0
  59. package/esm/transport.js +112 -0
  60. package/esm/transport_core.d.ts +31 -0
  61. package/esm/transport_core.d.ts.map +1 -0
  62. package/esm/transport_core.js +75 -0
  63. package/esm/types/api.d.ts +61 -0
  64. package/esm/types/api.d.ts.map +1 -0
  65. package/esm/types/api.js +5 -0
  66. package/esm/types/errors.d.ts +21 -0
  67. package/esm/types/errors.d.ts.map +1 -0
  68. package/esm/types/errors.js +47 -0
  69. package/esm/types/openapi.d.ts +19552 -0
  70. package/esm/types/openapi.d.ts.map +1 -0
  71. package/esm/types/openapi.js +5 -0
  72. package/package.json +36 -0
  73. package/script/_dnt.polyfills.d.ts +7 -0
  74. package/script/_dnt.polyfills.d.ts.map +1 -0
  75. package/script/_dnt.polyfills.js +2 -0
  76. package/script/api/artifacts.d.ts +25 -0
  77. package/script/api/artifacts.d.ts.map +1 -0
  78. package/script/api/artifacts.js +93 -0
  79. package/script/api/containers.d.ts +71 -0
  80. package/script/api/containers.d.ts.map +1 -0
  81. package/script/api/containers.js +238 -0
  82. package/script/api/exec.d.ts +15 -0
  83. package/script/api/exec.d.ts.map +1 -0
  84. package/script/api/exec.js +49 -0
  85. package/script/api/generate.d.ts +11 -0
  86. package/script/api/generate.d.ts.map +1 -0
  87. package/script/api/generate.js +28 -0
  88. package/script/api/images.d.ts +55 -0
  89. package/script/api/images.d.ts.map +1 -0
  90. package/script/api/images.js +216 -0
  91. package/script/api/kube.d.ts +13 -0
  92. package/script/api/kube.d.ts.map +1 -0
  93. package/script/api/kube.js +42 -0
  94. package/script/api/manifests.d.ts +19 -0
  95. package/script/api/manifests.d.ts.map +1 -0
  96. package/script/api/manifests.js +64 -0
  97. package/script/api/networks.d.ts +25 -0
  98. package/script/api/networks.d.ts.map +1 -0
  99. package/script/api/networks.js +99 -0
  100. package/script/api/pods.d.ts +35 -0
  101. package/script/api/pods.d.ts.map +1 -0
  102. package/script/api/pods.js +124 -0
  103. package/script/api/quadlets.d.ts +23 -0
  104. package/script/api/quadlets.d.ts.map +1 -0
  105. package/script/api/quadlets.js +60 -0
  106. package/script/api/secrets.d.ts +17 -0
  107. package/script/api/secrets.d.ts.map +1 -0
  108. package/script/api/secrets.js +53 -0
  109. package/script/api/system.d.ts +23 -0
  110. package/script/api/system.d.ts.map +1 -0
  111. package/script/api/system.js +102 -0
  112. package/script/api/volumes.d.ts +23 -0
  113. package/script/api/volumes.d.ts.map +1 -0
  114. package/script/api/volumes.js +73 -0
  115. package/script/client.d.ts +56 -0
  116. package/script/client.d.ts.map +1 -0
  117. package/script/client.js +67 -0
  118. package/script/internal/query.d.ts +2 -0
  119. package/script/internal/query.d.ts.map +1 -0
  120. package/script/internal/query.js +27 -0
  121. package/script/mod.d.ts +22 -0
  122. package/script/mod.d.ts.map +1 -0
  123. package/script/mod.js +42 -0
  124. package/script/package.json +3 -0
  125. package/script/ssh_transport.d.ts +14 -0
  126. package/script/ssh_transport.d.ts.map +1 -0
  127. package/script/ssh_transport.js +121 -0
  128. package/script/transport.d.ts +23 -0
  129. package/script/transport.d.ts.map +1 -0
  130. package/script/transport.js +149 -0
  131. package/script/transport_core.d.ts +31 -0
  132. package/script/transport_core.d.ts.map +1 -0
  133. package/script/transport_core.js +78 -0
  134. package/script/types/api.d.ts +61 -0
  135. package/script/types/api.d.ts.map +1 -0
  136. package/script/types/api.js +6 -0
  137. package/script/types/errors.d.ts +21 -0
  138. package/script/types/errors.d.ts.map +1 -0
  139. package/script/types/errors.js +54 -0
  140. package/script/types/openapi.d.ts +19552 -0
  141. package/script/types/openapi.d.ts.map +1 -0
  142. package/script/types/openapi.js +6 -0
@@ -0,0 +1,55 @@
1
+ import type { Transport } from "../transport.js";
2
+ import type { ContainerChange, ImageBuildQuery, ImageRemoveAllQuery, ImageCommitQuery, ImageChangesQuery, ImageExportQuery, ImageHistory, ImageImportQuery, ImageInspect, ImageListQuery, ImageLoadReport, ImagePruneQuery, ImagePruneReport, ImagePullQuery, ImagePushQuery, ImageRemoveQuery, ImageRemoveReport, ImageScpQuery, ImageSearchQuery, ImageSearchResult, ImageSummary, ImageTreeQuery, ScpReport, ImageTreeReport, LibpodImagesPullReport, LocalBuildQuery, LocalImagesQuery } from "../types/api.js";
3
+ export declare class ImagesApi {
4
+ #private;
5
+ constructor(transport: Transport);
6
+ /** List images, optionally filtered by the given query. */
7
+ list(query?: ImageListQuery): Promise<ImageSummary[]>;
8
+ /** Inspect an image. Returns `null` if the image is not found. */
9
+ inspect(nameOrId: string): Promise<ImageInspect | null>;
10
+ /** Pull an image from a registry. */
11
+ pull(query: ImagePullQuery): Promise<LibpodImagesPullReport>;
12
+ /** Remove an image. Returns a report of untagged and deleted layers. */
13
+ remove(nameOrId: string, query?: ImageRemoveQuery): Promise<ImageRemoveReport>;
14
+ /** Add a repository tag to an image. */
15
+ tag(nameOrId: string, repo: string, tag?: string): Promise<void>;
16
+ /** Remove a repository tag from an image. */
17
+ untag(nameOrId: string, repo: string, tag?: string): Promise<void>;
18
+ /** Search registries for images matching the given query. */
19
+ search(query: ImageSearchQuery): Promise<ImageSearchResult[]>;
20
+ /** Return the history of an image's layers. */
21
+ history(nameOrId: string): Promise<ImageHistory[]>;
22
+ /** Push an image to a registry. */
23
+ push(nameOrId: string, query?: ImagePushQuery): Promise<void>;
24
+ /** Import an image from a tar archive stream. Returns the new image ID. */
25
+ import(body: ReadableStream<Uint8Array>, query?: ImageImportQuery): Promise<string>;
26
+ /** Export an image as a tar archive stream. */
27
+ export(nameOrId: string): Promise<ReadableStream<Uint8Array>>;
28
+ /** Remove unused images. Returns a list of pruned images. */
29
+ prune(query?: ImagePruneQuery): Promise<ImagePruneReport[]>;
30
+ /** Build an image from a build context tar stream. Returns the build output stream. */
31
+ build(body: ReadableStream<Uint8Array>, query?: ImageBuildQuery): Promise<ReadableStream<Uint8Array>>;
32
+ /** Check if an image exists. Returns `true` on 204, `false` otherwise. */
33
+ exists(nameOrId: string): Promise<boolean>;
34
+ /** Create a new image from a container's changes. */
35
+ commit(query: ImageCommitQuery): Promise<void>;
36
+ /** Load images from a tar archive. */
37
+ load(body: ReadableStream<Uint8Array>): Promise<ImageLoadReport>;
38
+ /** Get a tree representation of an image's layers. */
39
+ tree(nameOrId: string, query?: ImageTreeQuery): Promise<ImageTreeReport>;
40
+ /** List filesystem changes in an image. */
41
+ changes(nameOrId: string, query?: ImageChangesQuery): Promise<ContainerChange[]>;
42
+ /** Resolve a short image name to a full reference. */
43
+ resolve(nameOrId: string): Promise<string>;
44
+ /** Export multiple images as a single tar archive stream. */
45
+ exportMultiple(query?: ImageExportQuery): Promise<ReadableStream<Uint8Array>>;
46
+ /** Remove one or more images. */
47
+ removeAll(query?: ImageRemoveAllQuery): Promise<ImageRemoveReport>;
48
+ /** Copy an image between hosts via SCP. */
49
+ scp(nameOrId: string, query?: ImageScpQuery): Promise<ScpReport>;
50
+ /** Load an image from a file path on the Podman server's filesystem. */
51
+ loadLocal(query: LocalImagesQuery): Promise<ImageLoadReport>;
52
+ /** Build an image from a local directory on the Podman server's filesystem. Returns the build output stream. */
53
+ buildLocal(query: LocalBuildQuery): Promise<ReadableStream<Uint8Array>>;
54
+ }
55
+ //# sourceMappingURL=images.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/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AO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOhD,6DAA6D;IACvD,cAAc,CAClB,KAAK,CAAC,EAAE,gBAAgB,GACvB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAKtC,iCAAiC;IAC3B,SAAS,CAAC,KAAK,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOxE,2CAA2C;IACrC,GAAG,CACP,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,aAAa,GACpB,OAAO,CAAC,SAAS,CAAC;IAOrB,wEAAwE;IAClE,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAOlE,gHAAgH;IAC1G,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;CAS9E"}
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImagesApi = void 0;
4
+ const errors_js_1 = require("../types/errors.js");
5
+ const query_js_1 = require("../internal/query.js");
6
+ class ImagesApi {
7
+ #t;
8
+ constructor(transport) {
9
+ this.#t = transport;
10
+ }
11
+ /** List images, optionally filtered by the given query. */
12
+ async list(query) {
13
+ const path = `/images/json${(0, query_js_1.buildQuery)(query)}`;
14
+ const { status, json } = await this.#t.request("GET", path);
15
+ if (status !== 200)
16
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
17
+ return (json ?? []);
18
+ }
19
+ /** Inspect an image. Returns `null` if the image is not found. */
20
+ async inspect(nameOrId) {
21
+ const path = `/images/${encodeURIComponent(nameOrId)}/json`;
22
+ const { status, json } = await this.#t.request("GET", path);
23
+ if (status === 404)
24
+ return null;
25
+ if (status !== 200)
26
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
27
+ return json;
28
+ }
29
+ /** Pull an image from a registry. */
30
+ async pull(query) {
31
+ const path = `/images/pull${(0, query_js_1.buildQuery)(query)}`;
32
+ const headers = {};
33
+ const authHeader = this.#t.getAuthHeader();
34
+ if (authHeader)
35
+ headers["X-Registry-Auth"] = authHeader;
36
+ const res = await this.#t.requestRaw("POST", path, undefined, headers);
37
+ if (res.status !== 200)
38
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
39
+ return (await res.json());
40
+ }
41
+ /** Remove an image. Returns a report of untagged and deleted layers. */
42
+ async remove(nameOrId, query) {
43
+ const path = `/images/${encodeURIComponent(nameOrId)}${(0, query_js_1.buildQuery)(query)}`;
44
+ const { status, json } = await this.#t.request("DELETE", path);
45
+ if (status !== 200)
46
+ throw (0, errors_js_1.createPodmanError)(status, json, "DELETE", path);
47
+ return json;
48
+ }
49
+ /** Add a repository tag to an image. */
50
+ async tag(nameOrId, repo, tag) {
51
+ const path = `/images/${encodeURIComponent(nameOrId)}/tag${(0, query_js_1.buildQuery)({ repo, tag })}`;
52
+ const { status, json } = await this.#t.request("POST", path);
53
+ if (status !== 201)
54
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
55
+ }
56
+ /** Remove a repository tag from an image. */
57
+ async untag(nameOrId, repo, tag) {
58
+ const path = `/images/${encodeURIComponent(nameOrId)}/untag${(0, query_js_1.buildQuery)({ repo, tag })}`;
59
+ const { status, json } = await this.#t.request("POST", path);
60
+ if (status !== 201)
61
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
62
+ }
63
+ /** Search registries for images matching the given query. */
64
+ async search(query) {
65
+ const path = `/images/search${(0, query_js_1.buildQuery)(query)}`;
66
+ const { status, json } = await this.#t.request("GET", path);
67
+ if (status !== 200)
68
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
69
+ return (json ?? []);
70
+ }
71
+ /** Return the history of an image's layers. */
72
+ async history(nameOrId) {
73
+ const path = `/images/${encodeURIComponent(nameOrId)}/history`;
74
+ const { status, json } = await this.#t.request("GET", path);
75
+ if (status !== 200)
76
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
77
+ return (json ?? []);
78
+ }
79
+ /** Push an image to a registry. */
80
+ async push(nameOrId, query) {
81
+ const path = `/images/${encodeURIComponent(nameOrId)}/push${(0, query_js_1.buildQuery)(query)}`;
82
+ const headers = {};
83
+ const authHeader = this.#t.getAuthHeader();
84
+ if (authHeader)
85
+ headers["X-Registry-Auth"] = authHeader;
86
+ const res = await this.#t.requestRaw("POST", path, undefined, headers);
87
+ if (res.status !== 200)
88
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
89
+ await res.body?.cancel();
90
+ }
91
+ /** Import an image from a tar archive stream. Returns the new image ID. */
92
+ async import(body, query) {
93
+ const path = `/images/import${(0, query_js_1.buildQuery)(query)}`;
94
+ const res = await this.#t.requestRaw("POST", path, body, {
95
+ "Content-Type": "application/x-tar",
96
+ });
97
+ if (res.status !== 200)
98
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
99
+ const result = await res.json();
100
+ return result.Id;
101
+ }
102
+ /** Export an image as a tar archive stream. */
103
+ async export(nameOrId) {
104
+ const path = `/images/${encodeURIComponent(nameOrId)}/get`;
105
+ return await this.#t.requestStream("GET", path);
106
+ }
107
+ /** Remove unused images. Returns a list of pruned images. */
108
+ async prune(query) {
109
+ const path = `/images/prune${(0, query_js_1.buildQuery)(query)}`;
110
+ const { status, json } = await this.#t.request("POST", path);
111
+ if (status !== 200)
112
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
113
+ return (json ?? []);
114
+ }
115
+ /** Build an image from a build context tar stream. Returns the build output stream. */
116
+ async build(body, query) {
117
+ const path = `/build${(0, query_js_1.buildQuery)(query)}`;
118
+ const res = await this.#t.requestRaw("POST", path, body, {
119
+ "Content-Type": "application/x-tar",
120
+ });
121
+ if (res.status >= 400)
122
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
123
+ if (!res.body) {
124
+ throw new Error("No response body for build");
125
+ }
126
+ return res.body;
127
+ }
128
+ /** Check if an image exists. Returns `true` on 204, `false` otherwise. */
129
+ async exists(nameOrId) {
130
+ const path = `/images/${encodeURIComponent(nameOrId)}/exists`;
131
+ const { status } = await this.#t.request("GET", path);
132
+ return status === 204;
133
+ }
134
+ /** Create a new image from a container's changes. */
135
+ async commit(query) {
136
+ const path = `/commit${(0, query_js_1.buildQuery)(query)}`;
137
+ const { status, json } = await this.#t.request("POST", path);
138
+ if (status !== 201)
139
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
140
+ }
141
+ /** Load images from a tar archive. */
142
+ async load(body) {
143
+ const path = "/images/load";
144
+ const res = await this.#t.requestRaw("POST", path, body, {
145
+ "Content-Type": "application/x-tar",
146
+ });
147
+ if (res.status !== 200)
148
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
149
+ return (await res.json());
150
+ }
151
+ /** Get a tree representation of an image's layers. */
152
+ async tree(nameOrId, query) {
153
+ const path = `/images/${encodeURIComponent(nameOrId)}/tree${(0, query_js_1.buildQuery)(query)}`;
154
+ const { status, json } = await this.#t.request("GET", path);
155
+ if (status !== 200)
156
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
157
+ return json;
158
+ }
159
+ /** List filesystem changes in an image. */
160
+ async changes(nameOrId, query) {
161
+ const path = `/images/${encodeURIComponent(nameOrId)}/changes${(0, query_js_1.buildQuery)(query)}`;
162
+ const { status, json } = await this.#t.request("GET", path);
163
+ if (status !== 200)
164
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
165
+ return (json ?? []);
166
+ }
167
+ /** Resolve a short image name to a full reference. */
168
+ async resolve(nameOrId) {
169
+ const path = `/images/${encodeURIComponent(nameOrId)}/resolve`;
170
+ const { status, json } = await this.#t.request("GET", path);
171
+ if (status !== 200)
172
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
173
+ return json;
174
+ }
175
+ /** Export multiple images as a single tar archive stream. */
176
+ async exportMultiple(query) {
177
+ const path = `/images/export${(0, query_js_1.buildQuery)(query)}`;
178
+ return await this.#t.requestStream("GET", path);
179
+ }
180
+ /** Remove one or more images. */
181
+ async removeAll(query) {
182
+ const path = `/images${(0, query_js_1.buildQuery)(query)}`;
183
+ const { status, json } = await this.#t.request("DELETE", path);
184
+ if (status !== 200)
185
+ throw (0, errors_js_1.createPodmanError)(status, json, "DELETE", path);
186
+ return json;
187
+ }
188
+ /** Copy an image between hosts via SCP. */
189
+ async scp(nameOrId, query) {
190
+ const path = `/images/scp/${encodeURIComponent(nameOrId)}${(0, query_js_1.buildQuery)(query)}`;
191
+ const { status, json } = await this.#t.request("POST", path);
192
+ if (status !== 200)
193
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
194
+ return json;
195
+ }
196
+ /** Load an image from a file path on the Podman server's filesystem. */
197
+ async loadLocal(query) {
198
+ const path = `/local/images/load${(0, query_js_1.buildQuery)(query)}`;
199
+ const { status, json } = await this.#t.request("POST", path);
200
+ if (status !== 200)
201
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
202
+ return json;
203
+ }
204
+ /** Build an image from a local directory on the Podman server's filesystem. Returns the build output stream. */
205
+ async buildLocal(query) {
206
+ const path = `/local/build${(0, query_js_1.buildQuery)(query)}`;
207
+ const res = await this.#t.requestRaw("POST", path);
208
+ if (res.status >= 400)
209
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
210
+ if (!res.body) {
211
+ throw new Error("No response body for build");
212
+ }
213
+ return res.body;
214
+ }
215
+ }
216
+ exports.ImagesApi = ImagesApi;
@@ -0,0 +1,13 @@
1
+ import type { Transport } from "../transport.js";
2
+ import type { KubeApplyQuery, PlayKubeDownQuery, PlayKubeQuery, PlayKubeReport } from "../types/api.js";
3
+ export declare class KubeApi {
4
+ #private;
5
+ constructor(transport: Transport);
6
+ /** Play a Kubernetes YAML file. Body can be YAML string or tar stream. */
7
+ play(body: ReadableStream<Uint8Array> | string, query?: PlayKubeQuery): Promise<PlayKubeReport>;
8
+ /** Tear down pods/resources created by play kube. */
9
+ down(query?: PlayKubeDownQuery): Promise<PlayKubeReport>;
10
+ /** Apply Kubernetes YAML to the Podman system. */
11
+ apply(body: ReadableStream<Uint8Array> | string, query?: KubeApplyQuery): Promise<string>;
12
+ }
13
+ //# sourceMappingURL=kube.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kube.d.ts","sourceRoot":"","sources":["../../src/api/kube.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,qBAAa,OAAO;;gBAEN,SAAS,EAAE,SAAS;IAIhC,0EAA0E;IACpE,IAAI,CACR,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,EACzC,KAAK,CAAC,EAAE,aAAa,GACpB,OAAO,CAAC,cAAc,CAAC;IAW1B,qDAAqD;IAC/C,IAAI,CAAC,KAAK,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAO9D,kDAAkD;IAC5C,KAAK,CACT,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,EACzC,KAAK,CAAC,EAAE,cAAc,GACrB,OAAO,CAAC,MAAM,CAAC;CAUnB"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KubeApi = void 0;
4
+ const errors_js_1 = require("../types/errors.js");
5
+ const query_js_1 = require("../internal/query.js");
6
+ class KubeApi {
7
+ #t;
8
+ constructor(transport) {
9
+ this.#t = transport;
10
+ }
11
+ /** Play a Kubernetes YAML file. Body can be YAML string or tar stream. */
12
+ async play(body, query) {
13
+ const path = `/play/kube${(0, query_js_1.buildQuery)(query)}`;
14
+ const contentType = typeof body === "string" ? "application/x-yaml" : "application/x-tar";
15
+ const res = await this.#t.requestRaw("POST", path, body, {
16
+ "Content-Type": contentType,
17
+ });
18
+ if (res.status !== 200)
19
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
20
+ return (await res.json());
21
+ }
22
+ /** Tear down pods/resources created by play kube. */
23
+ async down(query) {
24
+ const path = `/play/kube${(0, query_js_1.buildQuery)(query)}`;
25
+ const { status, json } = await this.#t.request("DELETE", path);
26
+ if (status !== 200)
27
+ throw (0, errors_js_1.createPodmanError)(status, json, "DELETE", path);
28
+ return json;
29
+ }
30
+ /** Apply Kubernetes YAML to the Podman system. */
31
+ async apply(body, query) {
32
+ const path = `/kube/apply${(0, query_js_1.buildQuery)(query)}`;
33
+ const contentType = typeof body === "string" ? "application/x-yaml" : "application/x-tar";
34
+ const res = await this.#t.requestRaw("POST", path, body, {
35
+ "Content-Type": contentType,
36
+ });
37
+ if (res.status !== 200)
38
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
39
+ return await res.json();
40
+ }
41
+ }
42
+ exports.KubeApi = KubeApi;
@@ -0,0 +1,19 @@
1
+ import type { Transport } from "../transport.js";
2
+ import type { IDResponse, ImageRemoveReport, ManifestCreateQuery, ManifestRemoveQuery, ManifestInspectQuery, ManifestModifyOptions, ManifestModifyQuery, ManifestModifyReport, ManifestPushQuery, Schema2ListPublic } from "../types/api.js";
3
+ export declare class ManifestsApi {
4
+ #private;
5
+ constructor(transport: Transport);
6
+ /** Create a manifest list. */
7
+ create(name: string, query: ManifestCreateQuery, opts?: ManifestModifyOptions): Promise<IDResponse>;
8
+ /** Inspect a manifest list. Returns null if not found. */
9
+ inspect(nameOrId: string, query?: ManifestInspectQuery): Promise<Schema2ListPublic | null>;
10
+ /** Check if a manifest list exists. */
11
+ exists(nameOrId: string): Promise<boolean>;
12
+ /** Modify a manifest list (add/remove/annotate). */
13
+ modify(nameOrId: string, opts: ManifestModifyOptions, query?: ManifestModifyQuery): Promise<ManifestModifyReport>;
14
+ /** Delete a manifest list. */
15
+ remove(nameOrId: string, query?: ManifestRemoveQuery): Promise<ImageRemoveReport>;
16
+ /** Push a manifest list to a registry. */
17
+ push(nameOrId: string, destination: string, query?: ManifestPushQuery): Promise<IDResponse>;
18
+ }
19
+ //# sourceMappingURL=manifests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../../src/api/manifests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAGzB,qBAAa,YAAY;;gBAEX,SAAS,EAAE,SAAS;IAIhC,8BAA8B;IACxB,MAAM,CACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,mBAAmB,EAC1B,IAAI,CAAC,EAAE,qBAAqB,GAC3B,OAAO,CAAC,UAAU,CAAC;IAOtB,0DAA0D;IACpD,OAAO,CACX,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,oBAAoB,GAC3B,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAQpC,uCAAuC;IACjC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMhD,oDAAoD;IAC9C,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,qBAAqB,EAC3B,KAAK,CAAC,EAAE,mBAAmB,GAC1B,OAAO,CAAC,oBAAoB,CAAC;IAOhC,8BAA8B;IACxB,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,mBAAmB,GAC1B,OAAO,CAAC,iBAAiB,CAAC;IAO7B,0CAA0C;IACpC,IAAI,CACR,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,UAAU,CAAC;CASvB"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ManifestsApi = void 0;
4
+ const errors_js_1 = require("../types/errors.js");
5
+ const query_js_1 = require("../internal/query.js");
6
+ class ManifestsApi {
7
+ #t;
8
+ constructor(transport) {
9
+ this.#t = transport;
10
+ }
11
+ /** Create a manifest list. */
12
+ async create(name, query, opts) {
13
+ const path = `/manifests/${encodeURIComponent(name)}${(0, query_js_1.buildQuery)(query)}`;
14
+ const { status, json } = await this.#t.request("POST", path, opts);
15
+ if (status !== 200 && status !== 201)
16
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
17
+ return json;
18
+ }
19
+ /** Inspect a manifest list. Returns null if not found. */
20
+ async inspect(nameOrId, query) {
21
+ const path = `/manifests/${encodeURIComponent(nameOrId)}/json${(0, query_js_1.buildQuery)(query)}`;
22
+ const { status, json } = await this.#t.request("GET", path);
23
+ if (status === 404)
24
+ return null;
25
+ if (status !== 200)
26
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
27
+ return json;
28
+ }
29
+ /** Check if a manifest list exists. */
30
+ async exists(nameOrId) {
31
+ const path = `/manifests/${encodeURIComponent(nameOrId)}/exists`;
32
+ const { status } = await this.#t.request("GET", path);
33
+ return status === 204;
34
+ }
35
+ /** Modify a manifest list (add/remove/annotate). */
36
+ async modify(nameOrId, opts, query) {
37
+ const path = `/manifests/${encodeURIComponent(nameOrId)}${(0, query_js_1.buildQuery)(query)}`;
38
+ const { status, json } = await this.#t.request("PUT", path, opts);
39
+ if (status !== 200)
40
+ throw (0, errors_js_1.createPodmanError)(status, json, "PUT", path);
41
+ return json;
42
+ }
43
+ /** Delete a manifest list. */
44
+ async remove(nameOrId, query) {
45
+ const path = `/manifests/${encodeURIComponent(nameOrId)}${(0, query_js_1.buildQuery)(query)}`;
46
+ const { status, json } = await this.#t.request("DELETE", path);
47
+ if (status !== 200)
48
+ throw (0, errors_js_1.createPodmanError)(status, json, "DELETE", path);
49
+ return json;
50
+ }
51
+ /** Push a manifest list to a registry. */
52
+ async push(nameOrId, destination, query) {
53
+ const path = `/manifests/${encodeURIComponent(nameOrId)}/push/${encodeURIComponent(destination)}${(0, query_js_1.buildQuery)(query)}`;
54
+ const headers = {};
55
+ const authHeader = this.#t.getAuthHeader();
56
+ if (authHeader)
57
+ headers["X-Registry-Auth"] = authHeader;
58
+ const res = await this.#t.requestRaw("POST", path, undefined, headers);
59
+ if (res.status !== 200)
60
+ await (0, errors_js_1.throwRawError)(res, "POST", path);
61
+ return (await res.json());
62
+ }
63
+ }
64
+ exports.ManifestsApi = ManifestsApi;
@@ -0,0 +1,25 @@
1
+ import type { Transport } from "../transport.js";
2
+ import type { Network, NetworkConnectOptions, NetworkCreateOptions, NetworkDisconnectOptions, NetworkListQuery, NetworkPruneQuery, NetworkPruneReport, NetworkUpdateOptions } from "../types/api.js";
3
+ export declare class NetworksApi {
4
+ #private;
5
+ constructor(transport: Transport);
6
+ /** Create a new network. */
7
+ create(opts: NetworkCreateOptions): Promise<Network>;
8
+ /** Inspect a network. Returns `null` if the network is not found. */
9
+ inspect(nameOrId: string): Promise<Network | null>;
10
+ /** List networks, optionally filtered by the given query. */
11
+ list(query?: NetworkListQuery): Promise<Network[]>;
12
+ /** Remove a network. */
13
+ remove(nameOrId: string): Promise<void>;
14
+ /** Check if a network exists. Returns `true` on 204, `false` otherwise. */
15
+ exists(nameOrId: string): Promise<boolean>;
16
+ /** Update an existing network (e.g. add/remove DNS servers). Requires Podman 5.0+. */
17
+ update(nameOrId: string, opts: NetworkUpdateOptions): Promise<void>;
18
+ /** Connect a container to a network. */
19
+ connect(nameOrId: string, opts: NetworkConnectOptions): Promise<void>;
20
+ /** Disconnect a container from a network. */
21
+ disconnect(nameOrId: string, opts: NetworkDisconnectOptions): Promise<void>;
22
+ /** Remove unused networks. Returns a list of pruned networks. */
23
+ prune(query?: NetworkPruneQuery): Promise<NetworkPruneReport[]>;
24
+ }
25
+ //# sourceMappingURL=networks.d.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
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NetworksApi = void 0;
4
+ const errors_js_1 = require("../types/errors.js");
5
+ const query_js_1 = require("../internal/query.js");
6
+ class NetworksApi {
7
+ #t;
8
+ constructor(transport) {
9
+ this.#t = transport;
10
+ }
11
+ /** Create a new network. */
12
+ async create(opts) {
13
+ const path = "/networks/create";
14
+ const { status, json } = await this.#t.request("POST", path, opts);
15
+ if (status !== 200)
16
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
17
+ return json;
18
+ }
19
+ /** Inspect a network. Returns `null` if the network is not found. */
20
+ async inspect(nameOrId) {
21
+ const path = `/networks/${encodeURIComponent(nameOrId)}`;
22
+ const { status, json } = await this.#t.request("GET", path);
23
+ if (status === 404)
24
+ return null;
25
+ if (status !== 200)
26
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
27
+ return json;
28
+ }
29
+ /** List networks, optionally filtered by the given query. */
30
+ async list(query) {
31
+ const path = `/networks/json${(0, query_js_1.buildQuery)(query)}`;
32
+ const { status, json } = await this.#t.request("GET", path);
33
+ if (status !== 200)
34
+ throw (0, errors_js_1.createPodmanError)(status, json, "GET", path);
35
+ return (json ?? []);
36
+ }
37
+ /** Remove a network. */
38
+ async remove(nameOrId) {
39
+ const path = `/networks/${encodeURIComponent(nameOrId)}`;
40
+ const { status, json } = await this.#t.request("DELETE", path);
41
+ if (status !== 200 && status !== 204) {
42
+ throw (0, errors_js_1.createPodmanError)(status, json, "DELETE", path);
43
+ }
44
+ }
45
+ /** Check if a network exists. Returns `true` on 204, `false` otherwise. */
46
+ async exists(nameOrId) {
47
+ const path = `/networks/${encodeURIComponent(nameOrId)}/exists`;
48
+ const { status } = await this.#t.request("GET", path);
49
+ return status === 204;
50
+ }
51
+ /** Update an existing network (e.g. add/remove DNS servers). Requires Podman 5.0+. */
52
+ async update(nameOrId, opts) {
53
+ const path = `/networks/${encodeURIComponent(nameOrId)}/update`;
54
+ const { status, json } = await this.#t.request("POST", path, opts);
55
+ if (status !== 200)
56
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
57
+ }
58
+ /** Connect a container to a network. */
59
+ async connect(nameOrId, opts) {
60
+ const path = `/networks/${encodeURIComponent(nameOrId)}/connect`;
61
+ const res = await this.#t.requestRaw("POST", path, JSON.stringify(opts), {
62
+ "Content-Type": "application/json",
63
+ });
64
+ if (res.status !== 200) {
65
+ const text = await res.text();
66
+ let json = null;
67
+ try {
68
+ json = JSON.parse(text);
69
+ }
70
+ catch { /* plain text */ }
71
+ throw (0, errors_js_1.createPodmanError)(res.status, json, "POST", path);
72
+ }
73
+ }
74
+ /** Disconnect a container from a network. */
75
+ async disconnect(nameOrId, opts) {
76
+ const path = `/networks/${encodeURIComponent(nameOrId)}/disconnect`;
77
+ const res = await this.#t.requestRaw("POST", path, JSON.stringify(opts), {
78
+ "Content-Type": "application/json",
79
+ });
80
+ if (res.status !== 200) {
81
+ const text = await res.text();
82
+ let json = null;
83
+ try {
84
+ json = JSON.parse(text);
85
+ }
86
+ catch { /* plain text */ }
87
+ throw (0, errors_js_1.createPodmanError)(res.status, json, "POST", path);
88
+ }
89
+ }
90
+ /** Remove unused networks. Returns a list of pruned networks. */
91
+ async prune(query) {
92
+ const path = `/networks/prune${(0, query_js_1.buildQuery)(query)}`;
93
+ const { status, json } = await this.#t.request("POST", path);
94
+ if (status !== 200)
95
+ throw (0, errors_js_1.createPodmanError)(status, json, "POST", path);
96
+ return (json ?? []);
97
+ }
98
+ }
99
+ exports.NetworksApi = NetworksApi;
@@ -0,0 +1,35 @@
1
+ import type { Transport } from "../transport.js";
2
+ import type { IDResponse, InspectPodData, ListPodsReport, PodRemoveQuery, PodKillQuery, PodKillReport, PodListQuery, PodPauseReport, PodPruneReport, PodRestartReport, PodRmReport, PodSpecGenerator, PodStartReport, PodStatsQuery, PodStatsReport, PodStopQuery, PodStopReport, PodTopOKBody, PodTopQuery, PodUnpauseReport } from "../types/api.js";
3
+ export declare class PodsApi {
4
+ #private;
5
+ constructor(transport: Transport);
6
+ /** Create a new pod from the given spec. */
7
+ create(spec: PodSpecGenerator): Promise<IDResponse>;
8
+ /** Inspect a pod. Returns `null` if the pod is not found. */
9
+ inspect(nameOrId: string): Promise<InspectPodData | null>;
10
+ /** List pods, optionally filtered by the given query. */
11
+ list(query?: PodListQuery): Promise<ListPodsReport[]>;
12
+ /** Remove a pod and optionally its containers. */
13
+ remove(nameOrId: string, query?: PodRemoveQuery): Promise<PodRmReport>;
14
+ /** Start all containers in a pod. */
15
+ start(nameOrId: string): Promise<PodStartReport>;
16
+ /** Stop all containers in a pod with an optional timeout. */
17
+ stop(nameOrId: string, query?: PodStopQuery): Promise<PodStopReport>;
18
+ /** Restart all containers in a pod. */
19
+ restart(nameOrId: string): Promise<PodRestartReport>;
20
+ /** Send a signal to all containers in a pod. */
21
+ kill(nameOrId: string, query?: PodKillQuery): Promise<PodKillReport>;
22
+ /** Pause all containers in a pod. */
23
+ pause(nameOrId: string): Promise<PodPauseReport>;
24
+ /** Unpause all containers in a pod. */
25
+ unpause(nameOrId: string): Promise<PodUnpauseReport>;
26
+ /** List processes running in the pod's containers. */
27
+ top(nameOrId: string, query?: PodTopQuery): Promise<PodTopOKBody>;
28
+ /** Check if a pod exists. Returns `true` on 204, `false` otherwise. */
29
+ exists(nameOrId: string): Promise<boolean>;
30
+ /** Get resource usage statistics for the pod's containers. */
31
+ stats(query?: PodStatsQuery): Promise<PodStatsReport[]>;
32
+ /** Remove all stopped pods. */
33
+ prune(): Promise<PodPruneReport>;
34
+ }
35
+ //# sourceMappingURL=pods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pods.d.ts","sourceRoot":"","sources":["../../src/api/pods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAA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