@repoxcode/docker-registry 1.0.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/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # DockeRegistrySDK
2
+
3
+ Connect to your own Docker Registry
4
+
5
+ ---
6
+
7
+ This package is a tool to connect with the [container registry distribution](https://hub.docker.com/_/registry).
8
+
9
+ ## Get Started
10
+
11
+ If your container registry is public, you can use this library directly. If your container registry is authentication protected, the first thing to check is to make sure your Docker Engine has successfully logged into your container registry. If you have not logged in, you can do so by using the following command:
12
+
13
+ ``` powershell
14
+ $ docker login <registry_hostname>
15
+ ```
16
+
17
+ For more information, you can visit the page about [docker login](https://docs.docker.com/reference/cli/docker/login/).
18
+
19
+ ### Ping
20
+
21
+ Checking connectivity with docker container registry.
22
+
23
+ `registry.ping()`
24
+
25
+ **Example**
26
+
27
+ ``` ts
28
+ import Registry from "@repoxcode/docker-registry";
29
+
30
+ const registry = Registry({ hostname: "localhost", port: 5001 });
31
+
32
+ const isConnected = await registry.ping();
33
+ ```
34
+
35
+ ### Catalog
36
+
37
+ Get a list of catalogs in the container registry.
38
+
39
+ `registry.catalog({ n, last })`
40
+
41
+ - **optional** n: the amount of data you want to retrieve.
42
+ - **optional** last: the beginning of the data sequence you want to retrieve
43
+
44
+ **Example**
45
+
46
+ ``` ts
47
+ import Registry from "@repoxcode/docker-registry";
48
+
49
+ const registry = Registry({ hostname: "localhost", port: 5001 });
50
+
51
+ const catalog = await registry.catalog();
52
+ ```
53
+
54
+ ### Tag
55
+
56
+ Get a list of tags on a container, inside the container registry.
57
+
58
+ `registry.tag(name, { n, last })`
59
+
60
+ - name: container name.
61
+ - **optional** n: the amount of data you want to retrieve.
62
+ - **optional** last: the beginning of the data sequence you want to retrieve
63
+
64
+ **Example**
65
+
66
+ ``` ts
67
+ import Registry from "@repoxcode/docker-registry";
68
+
69
+ const registry = Registry({ hostname: "localhost", port: 5001 });
70
+
71
+ const catalog = await registry.tag();
72
+ ```
73
+
74
+ ### Manifest
75
+
76
+ Retrieving details from the data catalog inside the docker container registry.
77
+
78
+ `registry.manifest(name, reference)`
79
+
80
+ - name: container name.
81
+ - reference: container reference, you can use container tag.
82
+
83
+ **Example**
84
+
85
+ ``` ts
86
+ import Registry from "@repoxcode/docker-registry";
87
+
88
+ const registry = Registry({ hostname: "localhost", port: 5001 });
89
+
90
+ const catalog = await registry.manifest("nginx", "latest");
91
+ ```
92
+
93
+ ### Update Manifest
94
+
95
+ Retrieving details from the data catalog inside the docker container registry.
96
+
97
+ `registry.manifest(name, reference, body)`
98
+
99
+ - name: container name.
100
+ - reference: container reference, you can use container tag.
101
+ - body: the data you want to update.
102
+
103
+ **Example**
104
+
105
+ ``` ts
106
+ import Registry from "@repoxcode/docker-registry";
107
+
108
+ const registry = Registry({ hostname: "localhost", port: 5001 });
109
+
110
+ const body = {
111
+ name: "nginx-test",
112
+ }
113
+
114
+ const catalog = await registry.manifestUpdate("nginx", "latest", body);
115
+ ```
116
+
117
+ ### Delete Manifest
118
+
119
+ Remove catalog from docker container registry.
120
+
121
+ `registry.manifest(name, reference)`
122
+
123
+ - name: container name.
124
+ - reference: container reference, you can use container tag.
125
+
126
+ **Example**
127
+
128
+ ``` ts
129
+ import Registry from "@repoxcode/docker-registry";
130
+
131
+ const registry = Registry({ hostname: "localhost", port: 5001 });
132
+
133
+ const body = {
134
+ name: "nginx-test",
135
+ }
136
+
137
+ const catalog = await registry.manifestDelete("nginx", "latest");
138
+ ```
@@ -0,0 +1,43 @@
1
+ interface RegistryCatalog {
2
+ repositories: string[];
3
+ }
4
+ interface RegistryTagResponse {
5
+ name: string;
6
+ tags: string[];
7
+ }
8
+ interface RegistryManifest {
9
+ name: string;
10
+ tag: string;
11
+ fsLayers: {
12
+ [key: string]: string;
13
+ }[];
14
+ history: string;
15
+ signature: string;
16
+ }
17
+
18
+ declare class Registry {
19
+ constructor({ hostname, port }: RegistryConstructor);
20
+ private readonly version;
21
+ private readonly hostname;
22
+ private readonly port;
23
+ private createRequestOption;
24
+ ping(): Promise<void>;
25
+ tag(repository: string, query?: {
26
+ n: number;
27
+ last: number;
28
+ }): Promise<RegistryTagResponse>;
29
+ manifest(repository: string, reference: string): Promise<RegistryManifest>;
30
+ manifestUpdate(repository: string, reference: string, body: RegistryManifest): Promise<void>;
31
+ manifestDelete(repository: string, tag: string): Promise<any>;
32
+ catalog(query?: {
33
+ n: number;
34
+ last: number;
35
+ }): Promise<RegistryCatalog>;
36
+ }
37
+
38
+ type RegistryConstructor = {
39
+ hostname?: string;
40
+ port?: number;
41
+ };
42
+
43
+ export { Registry as default };
@@ -0,0 +1,43 @@
1
+ interface RegistryCatalog {
2
+ repositories: string[];
3
+ }
4
+ interface RegistryTagResponse {
5
+ name: string;
6
+ tags: string[];
7
+ }
8
+ interface RegistryManifest {
9
+ name: string;
10
+ tag: string;
11
+ fsLayers: {
12
+ [key: string]: string;
13
+ }[];
14
+ history: string;
15
+ signature: string;
16
+ }
17
+
18
+ declare class Registry {
19
+ constructor({ hostname, port }: RegistryConstructor);
20
+ private readonly version;
21
+ private readonly hostname;
22
+ private readonly port;
23
+ private createRequestOption;
24
+ ping(): Promise<void>;
25
+ tag(repository: string, query?: {
26
+ n: number;
27
+ last: number;
28
+ }): Promise<RegistryTagResponse>;
29
+ manifest(repository: string, reference: string): Promise<RegistryManifest>;
30
+ manifestUpdate(repository: string, reference: string, body: RegistryManifest): Promise<void>;
31
+ manifestDelete(repository: string, tag: string): Promise<any>;
32
+ catalog(query?: {
33
+ n: number;
34
+ last: number;
35
+ }): Promise<RegistryCatalog>;
36
+ }
37
+
38
+ type RegistryConstructor = {
39
+ hostname?: string;
40
+ port?: number;
41
+ };
42
+
43
+ export { Registry as default };
package/dist/index.js ADDED
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ var __async = (__this, __arguments, generator) => {
34
+ return new Promise((resolve, reject) => {
35
+ var fulfilled = (value) => {
36
+ try {
37
+ step(generator.next(value));
38
+ } catch (e) {
39
+ reject(e);
40
+ }
41
+ };
42
+ var rejected = (value) => {
43
+ try {
44
+ step(generator.throw(value));
45
+ } catch (e) {
46
+ reject(e);
47
+ }
48
+ };
49
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
50
+ step((generator = generator.apply(__this, __arguments)).next());
51
+ });
52
+ };
53
+
54
+ // src/index.ts
55
+ var index_exports = {};
56
+ __export(index_exports, {
57
+ default: () => index_default
58
+ });
59
+ module.exports = __toCommonJS(index_exports);
60
+
61
+ // src/utils.ts
62
+ var import_http = require("http");
63
+ var Utils = class {
64
+ static connect(options) {
65
+ return __async(this, null, function* () {
66
+ try {
67
+ const res = yield this.req(options);
68
+ return res;
69
+ } catch (error) {
70
+ throw error.message;
71
+ }
72
+ });
73
+ }
74
+ static req(options) {
75
+ return new Promise((resolve, reject) => {
76
+ let headers = {
77
+ "content-type": "application/json"
78
+ };
79
+ if (options.headers) {
80
+ headers = __spreadValues(__spreadValues({}, headers), options.headers);
81
+ }
82
+ if (options.body) {
83
+ options.body = JSON.stringify(options.body);
84
+ headers["content-length"] = Buffer.byteLength(options.body);
85
+ }
86
+ if (options.query) {
87
+ const urlParams = this.urlQuery(options.query);
88
+ options.path = `${options.path}?${urlParams}`;
89
+ }
90
+ const config = {
91
+ method: options.method,
92
+ hostname: options.hostname,
93
+ port: options.port,
94
+ path: options.path,
95
+ headers,
96
+ timeout: 6e4
97
+ };
98
+ const clientRequest = (0, import_http.request)(config, (res) => {
99
+ if (!res.statusCode || res.statusCode < 200 || res.statusCode >= 400) {
100
+ return reject(new Error("Bad response status: " + res.statusCode));
101
+ }
102
+ let body = "";
103
+ res.setEncoding("utf8");
104
+ res.on("data", (chunk) => body += chunk);
105
+ res.on("end", () => {
106
+ let responseBody;
107
+ try {
108
+ responseBody = body ? JSON.parse(body) : void 0;
109
+ } catch (error) {
110
+ return reject(error);
111
+ }
112
+ resolve(responseBody);
113
+ });
114
+ });
115
+ clientRequest.write(options.body);
116
+ clientRequest.on("error", (e) => {
117
+ reject(e);
118
+ });
119
+ clientRequest.end();
120
+ });
121
+ }
122
+ static urlQuery(params) {
123
+ return Object.entries(params != null ? params : {}).map(([key, value]) => `${key}=${JSON.stringify(value)}`).join("&");
124
+ }
125
+ };
126
+
127
+ // src/index.ts
128
+ var Registry = class {
129
+ constructor({ hostname, port }) {
130
+ this.version = "v2";
131
+ this.hostname = hostname != null ? hostname : "localhost";
132
+ this.port = port != null ? port : 5001;
133
+ if (process.env.REGISTRY_HOSTNAME) {
134
+ this.hostname = process.env.REGISTRY_HOSTNAME;
135
+ }
136
+ if (process.env.REGISTRY_PORT) {
137
+ this.port = Number(process.env.REGISTRY_PORT);
138
+ }
139
+ }
140
+ createRequestOption(param) {
141
+ var _a, _b, _c;
142
+ return {
143
+ method: param.method,
144
+ hostname: this.hostname,
145
+ port: this.port,
146
+ path: `/${this.version}/${param.path}`,
147
+ headers: (_a = param.headers) != null ? _a : {},
148
+ query: (_b = param.query) != null ? _b : {},
149
+ body: (_c = param.body) != null ? _c : {}
150
+ };
151
+ }
152
+ ping() {
153
+ return __async(this, null, function* () {
154
+ const options = this.createRequestOption({
155
+ method: "GET",
156
+ path: ""
157
+ });
158
+ return yield Utils.connect(options);
159
+ });
160
+ }
161
+ tag(repository, query) {
162
+ return __async(this, null, function* () {
163
+ const options = this.createRequestOption({
164
+ method: "GET",
165
+ path: `${repository}/tags/list`,
166
+ query
167
+ });
168
+ return yield Utils.connect(options);
169
+ });
170
+ }
171
+ manifest(repository, reference) {
172
+ return __async(this, null, function* () {
173
+ const options = this.createRequestOption({
174
+ method: "GET",
175
+ path: `${repository}/manifest/${reference}`
176
+ });
177
+ return yield Utils.connect(options);
178
+ });
179
+ }
180
+ manifestUpdate(repository, reference, body) {
181
+ return __async(this, null, function* () {
182
+ const options = this.createRequestOption({
183
+ method: "PUT",
184
+ path: `${repository}/manifest/${reference}`,
185
+ body
186
+ });
187
+ return yield Utils.connect(options);
188
+ });
189
+ }
190
+ manifestDelete(repository, tag) {
191
+ return __async(this, null, function* () {
192
+ const options = this.createRequestOption({
193
+ method: "DELETE",
194
+ path: `${repository}/manifests/${tag}`
195
+ });
196
+ return yield Utils.connect(options);
197
+ });
198
+ }
199
+ catalog(query) {
200
+ return __async(this, null, function* () {
201
+ const options = this.createRequestOption({
202
+ method: "GET",
203
+ path: "_catalog",
204
+ query
205
+ });
206
+ return yield Utils.connect(options);
207
+ });
208
+ }
209
+ };
210
+ var index_default = Registry;
211
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/utils.ts"],"sourcesContent":["import { RegistryCatalog, RegistryManifest, RegistryTagResponse } from './interfaces';\r\nimport { ConnectOptions, Utils } from './utils';\r\n\r\nclass Registry {\r\n\r\n constructor({ hostname, port }: RegistryConstructor) {\r\n\r\n this.hostname = hostname ?? 'localhost';\r\n this.port = port ?? 5001;\r\n\r\n // Get the hostname from the environment\r\n if (process.env.REGISTRY_HOSTNAME) {\r\n\r\n this.hostname = process.env.REGISTRY_HOSTNAME;\r\n\r\n }\r\n\r\n // Get the port from the environment\r\n if (process.env.REGISTRY_PORT) {\r\n\r\n this.port = Number(process.env.REGISTRY_PORT);\r\n\r\n }\r\n\r\n }\r\n\r\n private readonly version : string = 'v2';\r\n private readonly hostname : string;\r\n private readonly port : number;\r\n\r\n private createRequestOption(param: CreateRequestOption): ConnectOptions {\r\n\r\n return {\r\n method : param.method,\r\n hostname : this.hostname,\r\n port : this.port,\r\n path : `/${ this.version }/${ param.path }`,\r\n headers : param.headers ?? {},\r\n query : param.query ?? {},\r\n body : param.body ?? {}\r\n };\r\n\r\n }\r\n\r\n public async ping(): Promise<void> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'GET',\r\n path : ''\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async tag(repository: string, query?: { n : number; last : number }): Promise<RegistryTagResponse> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'GET',\r\n path : `${ repository }/tags/list`,\r\n query : query\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async manifest(repository: string, reference: string): Promise<RegistryManifest> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'GET',\r\n path : `${ repository }/manifest/${ reference }`\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async manifestUpdate(repository: string, reference: string, body: RegistryManifest): Promise<void> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'PUT',\r\n path : `${ repository }/manifest/${ reference }`,\r\n body : body\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async manifestDelete(repository: string, tag: string): Promise<any> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'DELETE',\r\n path : `${ repository }/manifests/${ tag }`\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async catalog(query?: { n : number; last : number }): Promise<RegistryCatalog> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'GET',\r\n path : '_catalog',\r\n query : query\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n}\r\n\r\nexport default Registry;\r\n\r\ntype RegistryConstructor = {\r\n hostname? : string;\r\n port? : number;\r\n};\r\n\r\ntype CreateRequestOption = {\r\n method : 'GET' | 'PUT' | 'POST' | 'DELETE' | 'HEAD';\r\n path : string;\r\n headers? : any;\r\n query? : any;\r\n body? : any;\r\n};\r\n","import { ClientRequest, OutgoingHttpHeaders, request } from 'http';\r\nimport { RequestOptions } from 'https';\r\n\r\nexport class Utils {\r\n\r\n static async connect(options: ConnectOptions): Promise<any> {\r\n\r\n try {\r\n\r\n const res = await this.req(options);\r\n\r\n return res;\r\n\r\n } catch(error: any) {\r\n\r\n throw error.message;\r\n\r\n }\r\n\r\n }\r\n\r\n private static req(options: ConnectOptions): Promise<any> {\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n let headers: OutgoingHttpHeaders = {\r\n 'content-type' : 'application/json'\r\n };\r\n\r\n if (options.headers) {\r\n\r\n headers = { ...headers, ...options.headers };\r\n\r\n }\r\n\r\n if (options.body) {\r\n\r\n options.body = JSON.stringify(options.body);\r\n headers['content-length'] = Buffer.byteLength(options.body);\r\n\r\n }\r\n\r\n if (options.query) {\r\n\r\n const urlParams = this.urlQuery(options.query);\r\n options.path = `${ options.path }?${ urlParams }`;\r\n\r\n }\r\n\r\n const config: RequestOptions = {\r\n method : options.method,\r\n hostname : options.hostname,\r\n port : options.port,\r\n path : options.path,\r\n headers : headers,\r\n timeout : 60000\r\n };\r\n\r\n const clientRequest: ClientRequest = request(config, (res) => {\r\n\r\n // reject on bad status\r\n if (!res.statusCode || res.statusCode < 200 || res.statusCode >= 400) {\r\n\r\n return reject(new Error('Bad response status: ' + res.statusCode));\r\n\r\n }\r\n\r\n // cumulate data\r\n let body: string = '';\r\n\r\n res.setEncoding('utf8');\r\n\r\n res.on('data', (chunk) => body += chunk);\r\n\r\n res.on('end', () => {\r\n\r\n let responseBody;\r\n\r\n try {\r\n\r\n responseBody = body ? JSON.parse(body) : undefined;\r\n\r\n } catch(error) {\r\n\r\n return reject(error);\r\n\r\n }\r\n\r\n resolve(responseBody);\r\n\r\n });\r\n\r\n });\r\n\r\n // Send the POST data\r\n clientRequest.write(options.body);\r\n\r\n clientRequest.on('error', (e) => {\r\n\r\n reject(e);\r\n\r\n });\r\n\r\n clientRequest.end();\r\n\r\n });\r\n\r\n }\r\n\r\n static urlQuery(params: any): string {\r\n\r\n return Object.entries(params ?? {}).map(([ key, value ]) => `${ key }=${ JSON.stringify(value) }`).join('&');\r\n\r\n }\r\n\r\n}\r\n\r\nexport type ConnectOptions = {\r\n method : string;\r\n hostname : string;\r\n port : number;\r\n path : string;\r\n headers? : any;\r\n query? : any;\r\n body? : any;\r\n};\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA4D;AAGrD,IAAM,QAAN,MAAY;AAAA,EAEjB,OAAa,QAAQ,SAAuC;AAAA;AAE1D,UAAI;AAEF,cAAM,MAAM,MAAM,KAAK,IAAI,OAAO;AAElC,eAAO;AAAA,MAET,SAAQ,OAAY;AAElB,cAAM,MAAM;AAAA,MAEd;AAAA,IAEF;AAAA;AAAA,EAEA,OAAe,IAAI,SAAuC;AAExD,WAAO,IAAI,QAAQ,CAAC,SAAS,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;AAAA;AAAA,EAEa,SAAS,YAAoB,WAA8C;AAAA;AAEtF,YAAM,UAA0B,KAAK,oBAAoB;AAAA,QACvD,QAAS;AAAA,QACT,MAAS,GAAI,UAAW,aAAc,SAAU;AAAA,MAClD,CAAC;AAED,aAAO,MAAM,MAAM,QAAQ,OAAO;AAAA,IAEpC;AAAA;AAAA,EAEa,eAAe,YAAoB,WAAmB,MAAuC;AAAA;AAExG,YAAM,UAA0B,KAAK,oBAAoB;AAAA,QACvD,QAAS;AAAA,QACT,MAAS,GAAI,UAAW,aAAc,SAAU;AAAA,QAChD;AAAA,MACF,CAAC;AAED,aAAO,MAAM,MAAM,QAAQ,OAAO;AAAA,IAEpC;AAAA;AAAA,EAEa,eAAe,YAAoB,KAA2B;AAAA;AAEzE,YAAM,UAA0B,KAAK,oBAAoB;AAAA,QACvD,QAAS;AAAA,QACT,MAAS,GAAI,UAAW,cAAe,GAAI;AAAA,MAC7C,CAAC;AAED,aAAO,MAAM,MAAM,QAAQ,OAAO;AAAA,IAEpC;AAAA;AAAA,EAEa,QAAQ,OAAiE;AAAA;AAEpF,YAAM,UAA0B,KAAK,oBAAoB;AAAA,QACvD,QAAS;AAAA,QACT,MAAS;AAAA,QACT;AAAA,MACF,CAAC;AAED,aAAO,MAAM,MAAM,QAAQ,OAAO;AAAA,IAEpC;AAAA;AAEF;AAEA,IAAO,gBAAQ;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1,191 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ var __async = (__this, __arguments, generator) => {
18
+ return new Promise((resolve, reject) => {
19
+ var fulfilled = (value) => {
20
+ try {
21
+ step(generator.next(value));
22
+ } catch (e) {
23
+ reject(e);
24
+ }
25
+ };
26
+ var rejected = (value) => {
27
+ try {
28
+ step(generator.throw(value));
29
+ } catch (e) {
30
+ reject(e);
31
+ }
32
+ };
33
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
34
+ step((generator = generator.apply(__this, __arguments)).next());
35
+ });
36
+ };
37
+
38
+ // src/utils.ts
39
+ import { request } from "http";
40
+ var Utils = class {
41
+ static connect(options) {
42
+ return __async(this, null, function* () {
43
+ try {
44
+ const res = yield this.req(options);
45
+ return res;
46
+ } catch (error) {
47
+ throw error.message;
48
+ }
49
+ });
50
+ }
51
+ static req(options) {
52
+ return new Promise((resolve, reject) => {
53
+ let headers = {
54
+ "content-type": "application/json"
55
+ };
56
+ if (options.headers) {
57
+ headers = __spreadValues(__spreadValues({}, headers), options.headers);
58
+ }
59
+ if (options.body) {
60
+ options.body = JSON.stringify(options.body);
61
+ headers["content-length"] = Buffer.byteLength(options.body);
62
+ }
63
+ if (options.query) {
64
+ const urlParams = this.urlQuery(options.query);
65
+ options.path = `${options.path}?${urlParams}`;
66
+ }
67
+ const config = {
68
+ method: options.method,
69
+ hostname: options.hostname,
70
+ port: options.port,
71
+ path: options.path,
72
+ headers,
73
+ timeout: 6e4
74
+ };
75
+ const clientRequest = request(config, (res) => {
76
+ if (!res.statusCode || res.statusCode < 200 || res.statusCode >= 400) {
77
+ return reject(new Error("Bad response status: " + res.statusCode));
78
+ }
79
+ let body = "";
80
+ res.setEncoding("utf8");
81
+ res.on("data", (chunk) => body += chunk);
82
+ res.on("end", () => {
83
+ let responseBody;
84
+ try {
85
+ responseBody = body ? JSON.parse(body) : void 0;
86
+ } catch (error) {
87
+ return reject(error);
88
+ }
89
+ resolve(responseBody);
90
+ });
91
+ });
92
+ clientRequest.write(options.body);
93
+ clientRequest.on("error", (e) => {
94
+ reject(e);
95
+ });
96
+ clientRequest.end();
97
+ });
98
+ }
99
+ static urlQuery(params) {
100
+ return Object.entries(params != null ? params : {}).map(([key, value]) => `${key}=${JSON.stringify(value)}`).join("&");
101
+ }
102
+ };
103
+
104
+ // src/index.ts
105
+ var Registry = class {
106
+ constructor({ hostname, port }) {
107
+ this.version = "v2";
108
+ this.hostname = hostname != null ? hostname : "localhost";
109
+ this.port = port != null ? port : 5001;
110
+ if (process.env.REGISTRY_HOSTNAME) {
111
+ this.hostname = process.env.REGISTRY_HOSTNAME;
112
+ }
113
+ if (process.env.REGISTRY_PORT) {
114
+ this.port = Number(process.env.REGISTRY_PORT);
115
+ }
116
+ }
117
+ createRequestOption(param) {
118
+ var _a, _b, _c;
119
+ return {
120
+ method: param.method,
121
+ hostname: this.hostname,
122
+ port: this.port,
123
+ path: `/${this.version}/${param.path}`,
124
+ headers: (_a = param.headers) != null ? _a : {},
125
+ query: (_b = param.query) != null ? _b : {},
126
+ body: (_c = param.body) != null ? _c : {}
127
+ };
128
+ }
129
+ ping() {
130
+ return __async(this, null, function* () {
131
+ const options = this.createRequestOption({
132
+ method: "GET",
133
+ path: ""
134
+ });
135
+ return yield Utils.connect(options);
136
+ });
137
+ }
138
+ tag(repository, query) {
139
+ return __async(this, null, function* () {
140
+ const options = this.createRequestOption({
141
+ method: "GET",
142
+ path: `${repository}/tags/list`,
143
+ query
144
+ });
145
+ return yield Utils.connect(options);
146
+ });
147
+ }
148
+ manifest(repository, reference) {
149
+ return __async(this, null, function* () {
150
+ const options = this.createRequestOption({
151
+ method: "GET",
152
+ path: `${repository}/manifest/${reference}`
153
+ });
154
+ return yield Utils.connect(options);
155
+ });
156
+ }
157
+ manifestUpdate(repository, reference, body) {
158
+ return __async(this, null, function* () {
159
+ const options = this.createRequestOption({
160
+ method: "PUT",
161
+ path: `${repository}/manifest/${reference}`,
162
+ body
163
+ });
164
+ return yield Utils.connect(options);
165
+ });
166
+ }
167
+ manifestDelete(repository, tag) {
168
+ return __async(this, null, function* () {
169
+ const options = this.createRequestOption({
170
+ method: "DELETE",
171
+ path: `${repository}/manifests/${tag}`
172
+ });
173
+ return yield Utils.connect(options);
174
+ });
175
+ }
176
+ catalog(query) {
177
+ return __async(this, null, function* () {
178
+ const options = this.createRequestOption({
179
+ method: "GET",
180
+ path: "_catalog",
181
+ query
182
+ });
183
+ return yield Utils.connect(options);
184
+ });
185
+ }
186
+ };
187
+ var index_default = Registry;
188
+ export {
189
+ index_default as default
190
+ };
191
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils.ts","../src/index.ts"],"sourcesContent":["import { ClientRequest, OutgoingHttpHeaders, request } from 'http';\r\nimport { RequestOptions } from 'https';\r\n\r\nexport class Utils {\r\n\r\n static async connect(options: ConnectOptions): Promise<any> {\r\n\r\n try {\r\n\r\n const res = await this.req(options);\r\n\r\n return res;\r\n\r\n } catch(error: any) {\r\n\r\n throw error.message;\r\n\r\n }\r\n\r\n }\r\n\r\n private static req(options: ConnectOptions): Promise<any> {\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n let headers: OutgoingHttpHeaders = {\r\n 'content-type' : 'application/json'\r\n };\r\n\r\n if (options.headers) {\r\n\r\n headers = { ...headers, ...options.headers };\r\n\r\n }\r\n\r\n if (options.body) {\r\n\r\n options.body = JSON.stringify(options.body);\r\n headers['content-length'] = Buffer.byteLength(options.body);\r\n\r\n }\r\n\r\n if (options.query) {\r\n\r\n const urlParams = this.urlQuery(options.query);\r\n options.path = `${ options.path }?${ urlParams }`;\r\n\r\n }\r\n\r\n const config: RequestOptions = {\r\n method : options.method,\r\n hostname : options.hostname,\r\n port : options.port,\r\n path : options.path,\r\n headers : headers,\r\n timeout : 60000\r\n };\r\n\r\n const clientRequest: ClientRequest = request(config, (res) => {\r\n\r\n // reject on bad status\r\n if (!res.statusCode || res.statusCode < 200 || res.statusCode >= 400) {\r\n\r\n return reject(new Error('Bad response status: ' + res.statusCode));\r\n\r\n }\r\n\r\n // cumulate data\r\n let body: string = '';\r\n\r\n res.setEncoding('utf8');\r\n\r\n res.on('data', (chunk) => body += chunk);\r\n\r\n res.on('end', () => {\r\n\r\n let responseBody;\r\n\r\n try {\r\n\r\n responseBody = body ? JSON.parse(body) : undefined;\r\n\r\n } catch(error) {\r\n\r\n return reject(error);\r\n\r\n }\r\n\r\n resolve(responseBody);\r\n\r\n });\r\n\r\n });\r\n\r\n // Send the POST data\r\n clientRequest.write(options.body);\r\n\r\n clientRequest.on('error', (e) => {\r\n\r\n reject(e);\r\n\r\n });\r\n\r\n clientRequest.end();\r\n\r\n });\r\n\r\n }\r\n\r\n static urlQuery(params: any): string {\r\n\r\n return Object.entries(params ?? {}).map(([ key, value ]) => `${ key }=${ JSON.stringify(value) }`).join('&');\r\n\r\n }\r\n\r\n}\r\n\r\nexport type ConnectOptions = {\r\n method : string;\r\n hostname : string;\r\n port : number;\r\n path : string;\r\n headers? : any;\r\n query? : any;\r\n body? : any;\r\n};\r\n","import { RegistryCatalog, RegistryManifest, RegistryTagResponse } from './interfaces';\r\nimport { ConnectOptions, Utils } from './utils';\r\n\r\nclass Registry {\r\n\r\n constructor({ hostname, port }: RegistryConstructor) {\r\n\r\n this.hostname = hostname ?? 'localhost';\r\n this.port = port ?? 5001;\r\n\r\n // Get the hostname from the environment\r\n if (process.env.REGISTRY_HOSTNAME) {\r\n\r\n this.hostname = process.env.REGISTRY_HOSTNAME;\r\n\r\n }\r\n\r\n // Get the port from the environment\r\n if (process.env.REGISTRY_PORT) {\r\n\r\n this.port = Number(process.env.REGISTRY_PORT);\r\n\r\n }\r\n\r\n }\r\n\r\n private readonly version : string = 'v2';\r\n private readonly hostname : string;\r\n private readonly port : number;\r\n\r\n private createRequestOption(param: CreateRequestOption): ConnectOptions {\r\n\r\n return {\r\n method : param.method,\r\n hostname : this.hostname,\r\n port : this.port,\r\n path : `/${ this.version }/${ param.path }`,\r\n headers : param.headers ?? {},\r\n query : param.query ?? {},\r\n body : param.body ?? {}\r\n };\r\n\r\n }\r\n\r\n public async ping(): Promise<void> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'GET',\r\n path : ''\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async tag(repository: string, query?: { n : number; last : number }): Promise<RegistryTagResponse> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'GET',\r\n path : `${ repository }/tags/list`,\r\n query : query\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async manifest(repository: string, reference: string): Promise<RegistryManifest> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'GET',\r\n path : `${ repository }/manifest/${ reference }`\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async manifestUpdate(repository: string, reference: string, body: RegistryManifest): Promise<void> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'PUT',\r\n path : `${ repository }/manifest/${ reference }`,\r\n body : body\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async manifestDelete(repository: string, tag: string): Promise<any> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'DELETE',\r\n path : `${ repository }/manifests/${ tag }`\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n public async catalog(query?: { n : number; last : number }): Promise<RegistryCatalog> {\r\n\r\n const options: ConnectOptions = this.createRequestOption({\r\n method : 'GET',\r\n path : '_catalog',\r\n query : query\r\n });\r\n\r\n return await Utils.connect(options);\r\n\r\n }\r\n\r\n}\r\n\r\nexport default Registry;\r\n\r\ntype RegistryConstructor = {\r\n hostname? : string;\r\n port? : number;\r\n};\r\n\r\ntype CreateRequestOption = {\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M,MAAM,QAAQ,OAAO;AAAA,IAEpC;AAAA;AAEF;AAEA,IAAO,gBAAQ;","names":[]}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@repoxcode/docker-registry",
3
+ "version": "1.0.0",
4
+ "description": "SDK to connect to your own docker registry",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsup",
13
+ "test": "test"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/repoxcodehub/node-docker-registry.git"
18
+ },
19
+ "keywords": [
20
+ "SDK",
21
+ "connect",
22
+ "docker",
23
+ "registry"
24
+ ],
25
+ "author": "catur",
26
+ "license": "ISC",
27
+ "bugs": {
28
+ "url": "https://github.com/repoxcodehub/node-docker-registry/issues"
29
+ },
30
+ "homepage": "https://github.com/repoxcodehub/node-docker-registry#readme",
31
+ "devDependencies": {
32
+ "@eslint/js": "^9.39.2",
33
+ "@stylistic/eslint-plugin": "^5.6.1",
34
+ "@types/jest": "^30.0.0",
35
+ "eslint": "^9.39.2",
36
+ "globals": "^16.5.0",
37
+ "jest": "^30.2.0",
38
+ "jiti": "^2.6.1",
39
+ "ts-jest": "^29.4.6",
40
+ "ts-node": "^10.9.2",
41
+ "tsup": "^8.5.1",
42
+ "typescript": "^5.9.3",
43
+ "typescript-eslint": "^8.50.0"
44
+ }
45
+ }