Skip to content

Commit 1327cf0

Browse files
feat: update schema
1 parent 343a440 commit 1327cf0

File tree

5 files changed

+78
-16
lines changed

5 files changed

+78
-16
lines changed

.changeset/popular-schools-help.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@json-types/compose": minor
3+
---
4+
5+
Update schema

packages/compose/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ import schema from "@json-types/compose/schema.json";
2222

2323
TypeScript types generated automatically every night and published when there are changes.
2424

25-
- Last change: 2024-08-08T01:26:47.711Z
25+
- Last change: 2024-09-25T01:44:40.308Z
2626
- Source URL: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json

packages/compose/index.d.ts

+19-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export type DefinitionsDevelopment = {
2121
action: "rebuild" | "sync" | "sync+restart";
2222
target?: string;
2323
}[];
24-
[k: string]: unknown;
2524
} & Development;
2625
export type Development = {
2726
watch?: {
@@ -30,7 +29,6 @@ export type Development = {
3029
action: "rebuild" | "sync" | "sync+restart";
3130
target?: string;
3231
}[];
33-
[k: string]: unknown;
3432
} | null;
3533
export type DefinitionsDeployment = {
3634
mode?: string;
@@ -150,6 +148,15 @@ export type Deployment = {
150148
max_replicas_per_node?: number | string;
151149
};
152150
} | null;
151+
export type ExtraHosts =
152+
| {
153+
/**
154+
* This interface was referenced by `undefined`'s JSON-Schema definition
155+
* via the `patternProperty` ".+".
156+
*/
157+
[k: string]: string | unknown[];
158+
}
159+
| string[];
153160
export type ServiceConfigOrSecret = (
154161
| string
155162
| {
@@ -365,7 +372,7 @@ export interface DefinitionsService {
365372
pull?: boolean | string;
366373
target?: string;
367374
shm_size?: number | string;
368-
extra_hosts?: ListOrDict;
375+
extra_hosts?: ExtraHosts;
369376
isolation?: string;
370377
privileged?: boolean | string;
371378
secrets?: ServiceConfigOrSecret;
@@ -416,7 +423,14 @@ export interface DefinitionsService {
416423
};
417424
};
418425
device_cgroup_rules?: ListOfStrings;
419-
devices?: string[];
426+
devices?: (
427+
| string
428+
| {
429+
source: string;
430+
target?: string;
431+
permissions?: string;
432+
}
433+
)[];
420434
dns?: StringOrList;
421435
dns_opt?: string[];
422436
dns_search?: StringOrList;
@@ -432,7 +446,7 @@ export interface DefinitionsService {
432446
file?: string;
433447
};
434448
external_links?: string[];
435-
extra_hosts?: ListOrDict;
449+
extra_hosts?: ExtraHosts;
436450
group_add?: (string | number)[];
437451
healthcheck?: DefinitionsHealthcheck;
438452
hostname?: string;

packages/compose/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"compose-spec"
1515
],
1616
"x-json-types": {
17-
"lastChangeDate": "2024-08-08T01:26:47.711Z"
17+
"lastChangeDate": "2024-09-25T01:44:40.308Z"
1818
},
1919
"homepage": "https://github.com/swordev/json-types/tree/main/packages/compose",
2020
"bugs": {

packages/compose/schema.json

+52-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"include": {
1717
"type": "array",
1818
"items": {
19-
"type": "object",
2019
"$ref": "#/definitions/include"
2120
},
2221
"description": "compose sub-projects to be included."
@@ -164,7 +163,7 @@
164163
]
165164
},
166165
"extra_hosts": {
167-
"$ref": "#/definitions/list_or_dict"
166+
"$ref": "#/definitions/extra_hosts"
168167
},
169168
"isolation": {
170169
"type": "string"
@@ -396,9 +395,30 @@
396395
"devices": {
397396
"type": "array",
398397
"items": {
399-
"type": "string"
400-
},
401-
"uniqueItems": true
398+
"oneOf": [
399+
{
400+
"type": "string"
401+
},
402+
{
403+
"type": "object",
404+
"required": [
405+
"source"
406+
],
407+
"properties": {
408+
"source": {
409+
"type": "string"
410+
},
411+
"target": {
412+
"type": "string"
413+
},
414+
"permissions": {
415+
"type": "string"
416+
}
417+
},
418+
"additionalProperties": false
419+
}
420+
]
421+
}
402422
},
403423
"dns": {
404424
"$ref": "#/definitions/string_or_list"
@@ -466,7 +486,7 @@
466486
"uniqueItems": true
467487
},
468488
"extra_hosts": {
469-
"$ref": "#/definitions/list_or_dict"
489+
"$ref": "#/definitions/extra_hosts"
470490
},
471491
"group_add": {
472492
"type": "array",
@@ -980,10 +1000,10 @@
9801000
}
9811001
},
9821002
"additionalProperties": false
983-
},
984-
"additionalProperties": false
1003+
}
9851004
}
986-
}
1005+
},
1006+
"additionalProperties": false
9871007
},
9881008
"deployment": {
9891009
"id": "#/definitions/deployment",
@@ -1584,6 +1604,29 @@
15841604
}
15851605
]
15861606
},
1607+
"extra_hosts": {
1608+
"oneOf": [
1609+
{
1610+
"type": "object",
1611+
"patternProperties": {
1612+
".+": {
1613+
"type": [
1614+
"string",
1615+
"array"
1616+
]
1617+
}
1618+
},
1619+
"additionalProperties": false
1620+
},
1621+
{
1622+
"type": "array",
1623+
"items": {
1624+
"type": "string"
1625+
},
1626+
"uniqueItems": true
1627+
}
1628+
]
1629+
},
15871630
"blkio_limit": {
15881631
"type": "object",
15891632
"properties": {

0 commit comments

Comments
 (0)