docker-composer 3.1.13 → 4.0.3

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 CHANGED
@@ -4,7 +4,7 @@ Generate Docker Compose descriptor from a JSON document.
4
4
 
5
5
  ![Node.js CI](https://github.com/tudvari/docker-composer/workflows/Node.js%20CI/badge.svg)
6
6
  [![npm version](https://badge.fury.io/js/docker-composer.svg)](https://badge.fury.io/js/docker-composer)
7
-
7
+ [![CodeQL](https://github.com/tudvari/docker-composer/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/tudvari/docker-composer/actions/workflows/codeql-analysis.yml)
8
8
  ## About the package
9
9
 
10
10
  The reason behind this package is support the Docker Compose descriptor generation from Javascript. You are able to use all Docker Compose keyword to describe your containers and services.
@@ -14,13 +14,7 @@ Docker Compose Reference is [HERE](https://docs.docker.com/compose/compose-file/
14
14
 
15
15
  ### Changes of the Latest Release
16
16
 
17
- ## Version 3.1.13 (23.10.2020)
18
- - Maintenance release, dependency updates
19
-
20
- ## Version 3.1.12 (17.10.2020)
21
- - Maintenance release, dependency updates
22
-
23
- ## Version 3.1.11 (11.10.2020)
17
+ ## Version 4.0.3 (18.01.2022)
24
18
  - Maintenance release, dependency updates
25
19
 
26
20
  You can find all Release Notes [HERE](https://github.com/tudvari/docker-composer/blob/master/ReleaseNotes.md).
package/ReleaseNotes.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release Notes
2
2
 
3
+ ## Version 4.0.3 (18.01.2022)
4
+ - Maintenance release, dependency updates
5
+
6
+ ## Version 4.0.2 (27.09.2021)
7
+ - Maintenance release, dependency updates
8
+
9
+ ## Version 4.0.1 (31.03.2021)
10
+ - Maintenance release, dependency updates
11
+
12
+ ## Version 4.0.0 (31.12.2020)
13
+ - Typescript type definitions
14
+
3
15
  ## Version 3.1.13 (23.10.2020)
4
16
  - Maintenance release, dependency updates
5
17
 
package/index.d.ts ADDED
@@ -0,0 +1,270 @@
1
+ export type DefinitionsDeployment = {
2
+ mode?: string;
3
+ replicas?: number;
4
+ labels?: Labels;
5
+ update_config?: {
6
+ parallelism?: number;
7
+ delay?: string;
8
+ failure_action?: string;
9
+ monitor?: string;
10
+ max_failure_ratio?: number;
11
+ };
12
+ resources?: {
13
+ limits?: DefinitionsResource;
14
+ reservations?: DefinitionsResource;
15
+ };
16
+ restart_policy?: {
17
+ condition?: string;
18
+ delay?: string;
19
+ max_attempts?: number;
20
+ window?: string;
21
+ };
22
+ placement?: {
23
+ constraints?: string[];
24
+ };
25
+ } & ({
26
+ mode?: string;
27
+ replicas?: number;
28
+ labels?: Labels;
29
+ update_config?: {
30
+ parallelism?: number;
31
+ delay?: string;
32
+ failure_action?: string;
33
+ monitor?: string;
34
+ max_failure_ratio?: number;
35
+ };
36
+ resources?: {
37
+ limits?: DefinitionsResource;
38
+ reservations?: DefinitionsResource;
39
+ };
40
+ restart_policy?: {
41
+ condition?: string;
42
+ delay?: string;
43
+ max_attempts?: number;
44
+ window?: string;
45
+ };
46
+ placement?: {
47
+ constraints?: string[];
48
+ };
49
+ } | null);
50
+ export type Labels =
51
+ | {
52
+ /**
53
+ * This interface was referenced by `undefined`'s JSON-Schema definition
54
+ * via the `patternProperty` ".+".
55
+ */
56
+ [k: string]: string;
57
+ }
58
+ | string[];
59
+ export type ListOrDict =
60
+ | {
61
+ /**
62
+ * This interface was referenced by `undefined`'s JSON-Schema definition
63
+ * via the `patternProperty` ".+".
64
+ */
65
+ [k: string]: string | number | null;
66
+ }
67
+ | string[];
68
+ export type ListOfStrings = string[];
69
+ export type StringOrList = string | ListOfStrings;
70
+ /**
71
+ * This interface was referenced by `PropertiesNetworks`'s JSON-Schema definition
72
+ * via the `patternProperty` "^[a-zA-Z0-9._-]+$".
73
+ */
74
+ export type DefinitionsNetwork = {
75
+ driver?: string;
76
+ driver_opts?: {
77
+ /**
78
+ * This interface was referenced by `undefined`'s JSON-Schema definition
79
+ * via the `patternProperty` "^.+$".
80
+ */
81
+ [k: string]: string | number;
82
+ };
83
+ ipam?: {
84
+ driver?: string;
85
+ config?: {
86
+ subnet?: string;
87
+ }[];
88
+ };
89
+ external?:
90
+ | boolean
91
+ | {
92
+ name?: string;
93
+ };
94
+ internal?: boolean;
95
+ labels?: Labels;
96
+ } & ({
97
+ driver?: string;
98
+ driver_opts?: {
99
+ /**
100
+ * This interface was referenced by `undefined`'s JSON-Schema definition
101
+ * via the `patternProperty` "^.+$".
102
+ */
103
+ [k: string]: string | number;
104
+ };
105
+ ipam?: {
106
+ driver?: string;
107
+ config?: {
108
+ subnet?: string;
109
+ }[];
110
+ };
111
+ external?:
112
+ | boolean
113
+ | {
114
+ name?: string;
115
+ };
116
+ internal?: boolean;
117
+ labels?: Labels;
118
+ } | null);
119
+ /**
120
+ * This interface was referenced by `PropertiesVolumes`'s JSON-Schema definition
121
+ * via the `patternProperty` "^[a-zA-Z0-9._-]+$".
122
+ */
123
+ export type DefinitionsVolume = {
124
+ driver?: string;
125
+ driver_opts?: {
126
+ /**
127
+ * This interface was referenced by `undefined`'s JSON-Schema definition
128
+ * via the `patternProperty` "^.+$".
129
+ */
130
+ [k: string]: string | number;
131
+ };
132
+ external?:
133
+ | boolean
134
+ | {
135
+ name?: string;
136
+ };
137
+ labels?: Labels;
138
+ } & ({
139
+ driver?: string;
140
+ driver_opts?: {
141
+ /**
142
+ * This interface was referenced by `undefined`'s JSON-Schema definition
143
+ * via the `patternProperty` "^.+$".
144
+ */
145
+ [k: string]: string | number;
146
+ };
147
+ external?:
148
+ | boolean
149
+ | {
150
+ name?: string;
151
+ };
152
+ labels?: Labels;
153
+ } | null);
154
+
155
+ export interface ConfigSchemaV30Json {
156
+ version: string;
157
+ services?: PropertiesServices;
158
+ networks?: PropertiesNetworks;
159
+ volumes?: PropertiesVolumes;
160
+ }
161
+ export interface PropertiesServices {
162
+ [k: string]: DefinitionsService;
163
+ }
164
+ /**
165
+ * This interface was referenced by `PropertiesServices`'s JSON-Schema definition
166
+ * via the `patternProperty` "^[a-zA-Z0-9._-]+$".
167
+ */
168
+ export interface DefinitionsService {
169
+ deploy?: DefinitionsDeployment;
170
+ build?:
171
+ | string
172
+ | {
173
+ context?: string;
174
+ dockerfile?: string;
175
+ args?: ListOrDict;
176
+ };
177
+ cap_add?: string[];
178
+ cap_drop?: string[];
179
+ cgroup_parent?: string;
180
+ command?: string | string[];
181
+ container_name?: string;
182
+ depends_on?: ListOfStrings;
183
+ devices?: string[];
184
+ dns?: StringOrList;
185
+ dns_search?: StringOrList;
186
+ domainname?: string;
187
+ entrypoint?: string | string[];
188
+ env_file?: StringOrList;
189
+ environment?: ListOrDict;
190
+ expose?: (string | number)[];
191
+ external_links?: string[];
192
+ extra_hosts?: ListOrDict;
193
+ healthcheck?: DefinitionsHealthcheck;
194
+ hostname?: string;
195
+ image?: string;
196
+ ipc?: string;
197
+ labels?: Labels;
198
+ links?: string[];
199
+ logging?: {
200
+ driver?: string;
201
+ options?: {
202
+ /**
203
+ * This interface was referenced by `undefined`'s JSON-Schema definition
204
+ * via the `patternProperty` "^.+$".
205
+ */
206
+ [k: string]: string | number | null;
207
+ };
208
+ };
209
+ mac_address?: string;
210
+ network_mode?: string;
211
+ networks?:
212
+ | ListOfStrings
213
+ | {
214
+ /**
215
+ * This interface was referenced by `undefined`'s JSON-Schema definition
216
+ * via the `patternProperty` "^[a-zA-Z0-9._-]+$".
217
+ */
218
+ [k: string]: {
219
+ aliases?: ListOfStrings;
220
+ ipv4_address?: string;
221
+ ipv6_address?: string;
222
+ } | null;
223
+ };
224
+ pid?: string | null;
225
+ ports?: (string | number)[];
226
+ privileged?: boolean;
227
+ read_only?: boolean;
228
+ restart?: string;
229
+ security_opt?: string[];
230
+ shm_size?: number | string;
231
+ sysctls?: ListOrDict;
232
+ stdin_open?: boolean;
233
+ stop_grace_period?: string;
234
+ stop_signal?: string;
235
+ tmpfs?: StringOrList;
236
+ tty?: boolean;
237
+ ulimits?: {
238
+ /**
239
+ * This interface was referenced by `undefined`'s JSON-Schema definition
240
+ * via the `patternProperty` "^[a-z]+$".
241
+ */
242
+ [k: string]:
243
+ | number
244
+ | {
245
+ hard: number;
246
+ soft: number;
247
+ };
248
+ };
249
+ user?: string;
250
+ userns_mode?: string;
251
+ volumes?: string[];
252
+ working_dir?: string;
253
+ }
254
+ export interface DefinitionsResource {
255
+ cpus?: string;
256
+ memory?: string;
257
+ }
258
+ export interface DefinitionsHealthcheck {
259
+ disable?: boolean;
260
+ interval?: string;
261
+ retries?: number;
262
+ test?: string | string[];
263
+ timeout?: string;
264
+ }
265
+ export interface PropertiesNetworks {
266
+ [k: string]: DefinitionsNetwork;
267
+ }
268
+ export interface PropertiesVolumes {
269
+ [k: string]: DefinitionsVolume;
270
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "docker-composer",
3
- "version": "3.1.13",
3
+ "version": "4.0.3",
4
4
  "description": "NodeJS module for generating docker-compose.yml from a json document.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "./node_modules/mocha/bin/mocha *Test.js",
8
- "coverage": "nyc npm run test"
8
+ "coverage": "nyc npm run test",
9
+ "generate-ts-types": "./node_modules/gulp-cli/bin/gulp.js"
9
10
  },
10
11
  "keywords": [
11
12
  "gulp",
@@ -34,12 +35,18 @@
34
35
  "jsonschema": "^1.4.0"
35
36
  },
36
37
  "devDependencies": {
38
+ "ansi-regex": "^6.0.1",
37
39
  "atob": ">=2.1.2",
38
- "eslint": "7.11.0",
39
- "js-yaml": "^3.14.0",
40
+ "copy-props": "^2.0.5",
41
+ "eslint": "8.7.0",
42
+ "gulp": "^4.0.2",
43
+ "gulp-cli": "^2.3.0",
44
+ "js-yaml": "^4.0.0",
45
+ "json-schema-to-typescript": "^10.1.4",
40
46
  "mixin-deep": ">=2.0.1",
41
- "mocha": "8.2.0",
47
+ "mocha": "9.1.4",
42
48
  "nyc": "^15.1.0",
49
+ "set-value": "^4.0.1",
43
50
  "should": "13.2.3"
44
51
  },
45
52
  "nyc": {