@camunda/ccma-shared-types 19.3.0 → 19.4.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.
|
@@ -81,7 +81,7 @@ export interface HotPatchGenerationResultDto {
|
|
|
81
81
|
appliedBefore: boolean;
|
|
82
82
|
/**
|
|
83
83
|
* Every cluster on the generation when console answered, in lower case.
|
|
84
|
-
* control-backend gives each one the new
|
|
84
|
+
* control-backend gives each one the new image.
|
|
85
85
|
*/
|
|
86
86
|
clusterIds: string[];
|
|
87
87
|
}
|
|
@@ -92,15 +92,24 @@ export interface HotPatchGenerationResultDto {
|
|
|
92
92
|
export interface HotPatchClusterRequestDto {
|
|
93
93
|
/** The patched generation that the cluster was on when the run read it. */
|
|
94
94
|
generationId: string;
|
|
95
|
+
/**
|
|
96
|
+
* The field of the request. For an image field other than `zeebe`, console
|
|
97
|
+
* writes only that image to the CR, when the CR names the generation of the
|
|
98
|
+
* database and runs the component. For `zeebe`, `unified`, or no field, it
|
|
99
|
+
* writes the full spec.
|
|
100
|
+
*/
|
|
101
|
+
field?: GenerationHotPatchField;
|
|
95
102
|
}
|
|
96
103
|
/**
|
|
97
104
|
* What a hot patch did to one cluster.
|
|
98
105
|
*
|
|
99
|
-
* - `patched`: the CR holds the new
|
|
106
|
+
* - `patched`: the CR holds the new image.
|
|
100
107
|
* - `deferred`: the cluster sleeps. Console wrote no spec, and recorded the
|
|
101
108
|
* change in `deferredSpecChange`. The next resume writes the full spec
|
|
102
109
|
* from the database, with the new image.
|
|
103
|
-
* - `skipped`: the cluster is gone,
|
|
110
|
+
* - `skipped`: the cluster is gone, it moved to another generation, the CR
|
|
111
|
+
* names another generation than the database, the CR does not run the
|
|
112
|
+
* component of the field, or the database has no image for that component.
|
|
104
113
|
* - `errored`: the spec write failed, or a pause on the CR stopped it.
|
|
105
114
|
*/
|
|
106
115
|
export type HotPatchClusterOutcome = 'patched' | 'deferred' | 'skipped' | 'errored';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/approvals/hot-patch-generations.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport {\n GENERATION_HOT_PATCH_IMAGE_KEYS,\n type GenerationHotPatchImageKey,\n} from '../types/C8ClusterComponentVersions.type.js'\n\n/**\n * The field of a hot patch for the unified `camunda/camunda` image of 8.9\n * and later. It changes `zeebe`, `operate` and `tasklist` in one write, so\n * each cluster gets the new image in one spec. A request per image field\n * restarts each cluster three times, and runs two images between the runs.\n */\nexport const HOT_PATCH_UNIFIED_FIELD = 'unified'\n\n/** The image fields that a hot patch of `unified` changes. */\nexport const HOT_PATCH_UNIFIED_IMAGE_KEYS = [\n 'zeebe',\n 'operate',\n 'tasklist',\n] as const satisfies readonly GenerationHotPatchImageKey[]\n\n/** What `field` of a hot patch can be: one image field, or `unified`. */\nexport const GENERATION_HOT_PATCH_FIELDS = [\n ...GENERATION_HOT_PATCH_IMAGE_KEYS,\n HOT_PATCH_UNIFIED_FIELD,\n] as const\n\nexport type GenerationHotPatchField =\n (typeof GENERATION_HOT_PATCH_FIELDS)[number]\n\n/** The image fields of a generation that a hot patch of `field` changes. */\nexport function hotPatchImageKeysOf(\n field: GenerationHotPatchField,\n): readonly GenerationHotPatchImageKey[] {\n return field === HOT_PATCH_UNIFIED_FIELD\n ? HOT_PATCH_UNIFIED_IMAGE_KEYS\n : [field]\n}\n\n/**\n * The flag that opens the create route of hot-patch-generations. The route\n * also needs `control.camundiApprovalFlow`.\n */\nexport const HOT_PATCH_GENERATIONS_FLAG = 'control.hotPatchGenerations'\n\n/**\n * The most generations that one request can patch.\n *\n * The bound and `HOT_PATCH_IMAGE_MAX_LENGTH` keep a request under the body\n * limit of control-backend (1 MiB): 500 generations, each with two values of\n * 500 characters, is 500 000 characters before the rest of the payload.\n */\nexport const HOT_PATCH_GENERATIONS_MAX_GENERATIONS = 500\n\n/** The longest image reference that a hot patch reads or writes. */\nexport const HOT_PATCH_IMAGE_MAX_LENGTH = 500\n\n/**\n * One generation of a request: the value that the person read, and the new\n * one.\n */\nexport interface HotPatchGenerationDto {\n id: string\n /**\n * The value of `field` that the person who asked READ. Console compares it\n * with the generation when the action runs, and changes nothing when it\n * differs.\n */\n from: string\n /** The new image reference. */\n to: string\n}\n\n/**\n * The payload of a hot-patch-generations request: ONE field, and the\n * generations whose value of that field changes.\n *\n * The field is one image field, or `unified` for the `camunda/camunda`\n * image in `zeebe`, `operate` and `tasklist`.\n */\nexport interface HotPatchGenerationsPayloadDto {\n field: GenerationHotPatchField\n generations: HotPatchGenerationDto[]\n}\n\n/**\n * The body of `PATCH api/admin/approvals/generations/:generationId/hot-patch`\n * of console-backend, without the actor envelope.\n */\nexport interface HotPatchGenerationRequestDto {\n field: GenerationHotPatchField\n from: string\n to: string\n}\n\n/**\n * The answer of\n * `PATCH api/admin/approvals/generations/:generationId/hot-patch`.\n */\nexport interface HotPatchGenerationResultDto {\n generationId: string\n name: string\n field: GenerationHotPatchField\n from: string\n to: string\n /**\n * True when the generation held `to` already, because an earlier call of\n * the same request wrote it. Console wrote nothing. This is how a lost\n * answer is retried.\n */\n appliedBefore: boolean\n /**\n * Every cluster on the generation when console answered, in lower case.\n * control-backend gives each one the new
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport {\n GENERATION_HOT_PATCH_IMAGE_KEYS,\n type GenerationHotPatchImageKey,\n} from '../types/C8ClusterComponentVersions.type.js'\n\n/**\n * The field of a hot patch for the unified `camunda/camunda` image of 8.9\n * and later. It changes `zeebe`, `operate` and `tasklist` in one write, so\n * each cluster gets the new image in one spec. A request per image field\n * restarts each cluster three times, and runs two images between the runs.\n */\nexport const HOT_PATCH_UNIFIED_FIELD = 'unified'\n\n/** The image fields that a hot patch of `unified` changes. */\nexport const HOT_PATCH_UNIFIED_IMAGE_KEYS = [\n 'zeebe',\n 'operate',\n 'tasklist',\n] as const satisfies readonly GenerationHotPatchImageKey[]\n\n/** What `field` of a hot patch can be: one image field, or `unified`. */\nexport const GENERATION_HOT_PATCH_FIELDS = [\n ...GENERATION_HOT_PATCH_IMAGE_KEYS,\n HOT_PATCH_UNIFIED_FIELD,\n] as const\n\nexport type GenerationHotPatchField =\n (typeof GENERATION_HOT_PATCH_FIELDS)[number]\n\n/** The image fields of a generation that a hot patch of `field` changes. */\nexport function hotPatchImageKeysOf(\n field: GenerationHotPatchField,\n): readonly GenerationHotPatchImageKey[] {\n return field === HOT_PATCH_UNIFIED_FIELD\n ? HOT_PATCH_UNIFIED_IMAGE_KEYS\n : [field]\n}\n\n/**\n * The flag that opens the create route of hot-patch-generations. The route\n * also needs `control.camundiApprovalFlow`.\n */\nexport const HOT_PATCH_GENERATIONS_FLAG = 'control.hotPatchGenerations'\n\n/**\n * The most generations that one request can patch.\n *\n * The bound and `HOT_PATCH_IMAGE_MAX_LENGTH` keep a request under the body\n * limit of control-backend (1 MiB): 500 generations, each with two values of\n * 500 characters, is 500 000 characters before the rest of the payload.\n */\nexport const HOT_PATCH_GENERATIONS_MAX_GENERATIONS = 500\n\n/** The longest image reference that a hot patch reads or writes. */\nexport const HOT_PATCH_IMAGE_MAX_LENGTH = 500\n\n/**\n * One generation of a request: the value that the person read, and the new\n * one.\n */\nexport interface HotPatchGenerationDto {\n id: string\n /**\n * The value of `field` that the person who asked READ. Console compares it\n * with the generation when the action runs, and changes nothing when it\n * differs.\n */\n from: string\n /** The new image reference. */\n to: string\n}\n\n/**\n * The payload of a hot-patch-generations request: ONE field, and the\n * generations whose value of that field changes.\n *\n * The field is one image field, or `unified` for the `camunda/camunda`\n * image in `zeebe`, `operate` and `tasklist`.\n */\nexport interface HotPatchGenerationsPayloadDto {\n field: GenerationHotPatchField\n generations: HotPatchGenerationDto[]\n}\n\n/**\n * The body of `PATCH api/admin/approvals/generations/:generationId/hot-patch`\n * of console-backend, without the actor envelope.\n */\nexport interface HotPatchGenerationRequestDto {\n field: GenerationHotPatchField\n from: string\n to: string\n}\n\n/**\n * The answer of\n * `PATCH api/admin/approvals/generations/:generationId/hot-patch`.\n */\nexport interface HotPatchGenerationResultDto {\n generationId: string\n name: string\n field: GenerationHotPatchField\n from: string\n to: string\n /**\n * True when the generation held `to` already, because an earlier call of\n * the same request wrote it. Console wrote nothing. This is how a lost\n * answer is retried.\n */\n appliedBefore: boolean\n /**\n * Every cluster on the generation when console answered, in lower case.\n * control-backend gives each one the new image.\n */\n clusterIds: string[]\n}\n\n/**\n * The body of `POST api/admin/approvals/clusters/:clusterId/hot-patch` of\n * console-backend, without the actor envelope.\n */\nexport interface HotPatchClusterRequestDto {\n /** The patched generation that the cluster was on when the run read it. */\n generationId: string\n /**\n * The field of the request. For an image field other than `zeebe`, console\n * writes only that image to the CR, when the CR names the generation of the\n * database and runs the component. For `zeebe`, `unified`, or no field, it\n * writes the full spec.\n */\n field?: GenerationHotPatchField\n}\n\n/**\n * What a hot patch did to one cluster.\n *\n * - `patched`: the CR holds the new image.\n * - `deferred`: the cluster sleeps. Console wrote no spec, and recorded the\n * change in `deferredSpecChange`. The next resume writes the full spec\n * from the database, with the new image.\n * - `skipped`: the cluster is gone, it moved to another generation, the CR\n * names another generation than the database, the CR does not run the\n * component of the field, or the database has no image for that component.\n * - `errored`: the spec write failed, or a pause on the CR stopped it.\n */\nexport type HotPatchClusterOutcome =\n | 'patched'\n | 'deferred'\n | 'skipped'\n | 'errored'\n\n/** The answer of `POST api/admin/approvals/clusters/:clusterId/hot-patch`. */\nexport interface HotPatchClusterResultDto {\n result: HotPatchClusterOutcome\n /** Why a cluster was skipped or errored. */\n error?: string\n}\n"],
|
|
5
5
|
"mappings": "AAMA;AAAA,EACE;AAAA,OAEK;AAQA,MAAM,0BAA0B;AAGhC,MAAM,+BAA+B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AACF;AAGO,MAAM,8BAA8B;AAAA,EACzC,GAAG;AAAA,EACH;AACF;AAMO,SAAS,oBACd,OACuC;AACvC,SAAO,UAAU,0BACb,+BACA,CAAC,KAAK;AACZ;AAMO,MAAM,6BAA6B;AASnC,MAAM,wCAAwC;AAG9C,MAAM,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED