Skip to content

Commit 400d51d

Browse files
feat: update schema
1 parent 8be63b6 commit 400d51d

File tree

5 files changed

+65
-14
lines changed

5 files changed

+65
-14
lines changed

.changeset/pink-jokes-look.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-09-25T01:44:40.308Z
25+
- Last change: 2024-11-05T01:42:23.466Z
2626
- Source URL: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json

packages/compose/index.d.ts

+12-10
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export type DefinitionsGenericResources = {
9494
};
9595
}[];
9696
export type DefinitionsDevices = {
97-
capabilities?: ListOfStrings;
97+
capabilities: ListOfStrings;
9898
count?: string | number;
9999
device_ids?: ListOfStrings;
100100
driver?: string;
@@ -148,15 +148,7 @@ export type Deployment = {
148148
max_replicas_per_node?: number | string;
149149
};
150150
} | 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[];
151+
export type ExtraHosts = {} | string[];
160152
export type ServiceConfigOrSecret = (
161153
| string
162154
| {
@@ -174,6 +166,7 @@ export type EnvFile =
174166
| string
175167
| {
176168
path: string;
169+
format?: string;
177170
required?: boolean | string;
178171
}
179172
)[];
@@ -513,6 +506,8 @@ export interface DefinitionsService {
513506
app_protocol?: string;
514507
}
515508
)[];
509+
post_start?: DefinitionsServiceHook[];
510+
pre_stop?: DefinitionsServiceHook[];
516511
privileged?: boolean | string;
517512
profiles?: ListOfStrings;
518513
pull_policy?: "always" | "never" | "if_not_present" | "build" | "missing";
@@ -591,6 +586,13 @@ export interface DefinitionsHealthcheck {
591586
start_period?: string;
592587
start_interval?: string;
593588
}
589+
export interface DefinitionsServiceHook {
590+
command?: Command;
591+
user?: string;
592+
privileged?: boolean | string;
593+
working_dir?: string;
594+
environment?: ListOrDict;
595+
}
594596
export interface PropertiesNetworks {
595597
[k: string]: DefinitionsNetwork;
596598
}

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-09-25T01:44:40.308Z"
17+
"lastChangeDate": "2024-11-05T01:42:23.466Z"
1818
},
1919
"homepage": "https://github.com/swordev/json-types/tree/main/packages/compose",
2020
"bugs": {

packages/compose/schema.json

+46-2
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,18 @@
715715
},
716716
"uniqueItems": true
717717
},
718+
"post_start": {
719+
"type": "array",
720+
"items": {
721+
"$ref": "#/definitions/service_hook"
722+
}
723+
},
724+
"pre_stop": {
725+
"type": "array",
726+
"items": {
727+
"$ref": "#/definitions/service_hook"
728+
}
729+
},
718730
"privileged": {
719731
"type": [
720732
"boolean",
@@ -1247,7 +1259,10 @@
12471259
"$ref": "#/definitions/list_or_dict"
12481260
}
12491261
},
1250-
"additionalProperties": false
1262+
"additionalProperties": false,
1263+
"required": [
1264+
"capabilities"
1265+
]
12511266
}
12521267
},
12531268
"include": {
@@ -1526,6 +1541,31 @@
15261541
}
15271542
]
15281543
},
1544+
"service_hook": {
1545+
"id": "#/definitions/service_hook",
1546+
"type": "object",
1547+
"properties": {
1548+
"command": {
1549+
"$ref": "#/definitions/command"
1550+
},
1551+
"user": {
1552+
"type": "string"
1553+
},
1554+
"privileged": {
1555+
"type": [
1556+
"boolean",
1557+
"string"
1558+
]
1559+
},
1560+
"working_dir": {
1561+
"type": "string"
1562+
},
1563+
"environment": {
1564+
"$ref": "#/definitions/list_or_dict"
1565+
}
1566+
},
1567+
"additionalProperties": false
1568+
},
15291569
"env_file": {
15301570
"oneOf": [
15311571
{
@@ -1545,6 +1585,9 @@
15451585
"path": {
15461586
"type": "string"
15471587
},
1588+
"format": {
1589+
"type": "string"
1590+
},
15481591
"required": {
15491592
"type": [
15501593
"boolean",
@@ -1614,7 +1657,8 @@
16141657
"string",
16151658
"array"
16161659
]
1617-
}
1660+
},
1661+
"uniqueItems": false
16181662
},
16191663
"additionalProperties": false
16201664
},

0 commit comments

Comments
 (0)