@camunda/camunda-api-zod-schemas 0.0.1
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 +28 -0
- package/dist/8.8/ad-hoc-sub-process.d.ts +2 -0
- package/dist/8.8/ad-hoc-sub-process.js +67 -0
- package/dist/8.8/authentication.d.ts +2 -0
- package/dist/8.8/authentication.js +35 -0
- package/dist/8.8/authorization.d.ts +2 -0
- package/dist/8.8/authorization.js +113 -0
- package/dist/8.8/batch-operation.d.ts +2 -0
- package/dist/8.8/batch-operation.js +96 -0
- package/dist/8.8/clock.d.ts +2 -0
- package/dist/8.8/clock.js +18 -0
- package/dist/8.8/cluster.d.ts +2 -0
- package/dist/8.8/cluster.js +36 -0
- package/dist/8.8/decision-definition.d.ts +2 -0
- package/dist/8.8/decision-definition.js +103 -0
- package/dist/8.8/decision-instance.d.ts +2 -0
- package/dist/8.8/decision-instance.js +83 -0
- package/dist/8.8/decision-requirements.d.ts +2 -0
- package/dist/8.8/decision-requirements.js +43 -0
- package/dist/8.8/document.d.ts +2 -0
- package/dist/8.8/document.js +110 -0
- package/dist/8.8/element-instance.d.ts +2 -0
- package/dist/8.8/element-instance.js +116 -0
- package/dist/8.8/group.d.ts +2 -0
- package/dist/8.8/group.js +188 -0
- package/dist/8.8/incident.d.ts +2 -0
- package/dist/8.8/incident.js +91 -0
- package/dist/8.8/index.d.ts +2 -0
- package/dist/8.8/index.js +240 -0
- package/dist/8.8/job.d.ts +2 -0
- package/dist/8.8/job.js +211 -0
- package/dist/8.8/license.d.ts +2 -0
- package/dist/8.8/license.js +16 -0
- package/dist/8.8/mapping-rule.d.ts +2 -0
- package/dist/8.8/mapping-rule.js +73 -0
- package/dist/8.8/message.d.ts +2 -0
- package/dist/8.8/message.js +45 -0
- package/dist/8.8/process-definition.d.ts +2 -0
- package/dist/8.8/process-definition.js +92 -0
- package/dist/8.8/process-instance.d.ts +2 -0
- package/dist/8.8/process-instance.js +255 -0
- package/dist/8.8/resource.d.ts +2 -0
- package/dist/8.8/resource.js +107 -0
- package/dist/8.8/role.d.ts +2 -0
- package/dist/8.8/role.js +202 -0
- package/dist/8.8/signal.d.ts +2 -0
- package/dist/8.8/signal.js +22 -0
- package/dist/8.8/tenant.d.ts +2 -0
- package/dist/8.8/tenant.js +173 -0
- package/dist/8.8/usage-metrics.d.ts +2 -0
- package/dist/8.8/usage-metrics.js +20 -0
- package/dist/8.8/user-task.d.ts +2 -0
- package/dist/8.8/user-task.js +161 -0
- package/dist/8.8/user.d.ts +2 -0
- package/dist/8.8/user.js +77 -0
- package/dist/8.8/variable.d.ts +2 -0
- package/dist/8.8/variable.js +41 -0
- package/dist/8.8.d.ts +2 -0
- package/dist/8.8.js +411 -0
- package/dist/ad-hoc-sub-process.d.ts +100 -0
- package/dist/authentication.d.ts +27 -0
- package/dist/authorization.d.ts +320 -0
- package/dist/batch-operation.d.ts +188 -0
- package/dist/clock.d.ts +10 -0
- package/dist/cluster.d.ts +78 -0
- package/dist/common.d.ts +118 -0
- package/dist/common.js +131 -0
- package/dist/decision-definition.d.ts +165 -0
- package/dist/decision-instance.d.ts +197 -0
- package/dist/decision-requirements.d.ts +64 -0
- package/dist/document.d.ts +87 -0
- package/dist/element-instance.d.ts +342 -0
- package/dist/group-role.d.ts +15 -0
- package/dist/group-role.js +15 -0
- package/dist/group.d.ts +209 -0
- package/dist/incident.d.ts +301 -0
- package/dist/index.d.ts +1025 -0
- package/dist/job.d.ts +588 -0
- package/dist/license.d.ts +12 -0
- package/dist/mapping-rule.d.ts +82 -0
- package/dist/message.d.ts +33 -0
- package/dist/process-definition.d.ts +345 -0
- package/dist/process-instance.d.ts +1306 -0
- package/dist/processes.d.ts +49 -0
- package/dist/processes.js +40 -0
- package/dist/resource.d.ts +111 -0
- package/dist/role.d.ts +207 -0
- package/dist/signal.d.ts +16 -0
- package/dist/tenant.d.ts +266 -0
- package/dist/usage-metrics.d.ts +21 -0
- package/dist/user-task.d.ts +357 -0
- package/dist/user.d.ts +91 -0
- package/dist/variable.d.ts +102 -0
- package/package.json +220 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { API_VERSION } from "../common.js";
|
|
3
|
+
const documentMetadataSchema = z.object({
|
|
4
|
+
contentType: z.string(),
|
|
5
|
+
fileName: z.string(),
|
|
6
|
+
expiresAt: z.string(),
|
|
7
|
+
size: z.number(),
|
|
8
|
+
processDefinitionId: z.string(),
|
|
9
|
+
processInstanceKey: z.string(),
|
|
10
|
+
customProperties: z.record(z.string(), z.unknown())
|
|
11
|
+
});
|
|
12
|
+
const documentReferenceSchema = z.object({
|
|
13
|
+
"camunda.document.type": z.literal("camunda"),
|
|
14
|
+
storeId: z.string(),
|
|
15
|
+
documentId: z.string(),
|
|
16
|
+
contentHash: z.string(),
|
|
17
|
+
metadata: documentMetadataSchema
|
|
18
|
+
});
|
|
19
|
+
const documentCreationFailureDetailSchema = z.object({
|
|
20
|
+
fileName: z.string(),
|
|
21
|
+
detail: z.string()
|
|
22
|
+
});
|
|
23
|
+
const createDocumentsResponseBodySchema = z.object({
|
|
24
|
+
createdDocuments: z.array(documentReferenceSchema),
|
|
25
|
+
failedDocuments: z.array(documentCreationFailureDetailSchema)
|
|
26
|
+
});
|
|
27
|
+
const documentLinkRequestBodySchema = z.object({
|
|
28
|
+
timeToLive: z.number().optional().default(36e5)
|
|
29
|
+
});
|
|
30
|
+
const documentLinkSchema = z.object({
|
|
31
|
+
url: z.string(),
|
|
32
|
+
expiresAt: z.string()
|
|
33
|
+
});
|
|
34
|
+
const createDocument = {
|
|
35
|
+
method: "POST",
|
|
36
|
+
getUrl({ storeId, documentId }) {
|
|
37
|
+
const searchParams = new URLSearchParams();
|
|
38
|
+
if (storeId) {
|
|
39
|
+
searchParams.set("storeId", storeId);
|
|
40
|
+
}
|
|
41
|
+
if (documentId) {
|
|
42
|
+
searchParams.set("documentId", documentId);
|
|
43
|
+
}
|
|
44
|
+
const query = searchParams.toString();
|
|
45
|
+
return `/${API_VERSION}/documents${query ? `?${query}` : ""}`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const createDocuments = {
|
|
49
|
+
method: "POST",
|
|
50
|
+
getUrl({ storeId } = {}) {
|
|
51
|
+
const searchParams = new URLSearchParams();
|
|
52
|
+
if (storeId) {
|
|
53
|
+
searchParams.set("storeId", storeId);
|
|
54
|
+
}
|
|
55
|
+
const query = searchParams.toString();
|
|
56
|
+
return `/${API_VERSION}/documents/batch${query ? `?${query}` : ""}`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const getDocument = {
|
|
60
|
+
method: "GET",
|
|
61
|
+
getUrl({ documentId, storeId, contentHash }) {
|
|
62
|
+
const searchParams = new URLSearchParams();
|
|
63
|
+
if (storeId) {
|
|
64
|
+
searchParams.set("storeId", storeId);
|
|
65
|
+
}
|
|
66
|
+
if (contentHash) {
|
|
67
|
+
searchParams.set("contentHash", contentHash);
|
|
68
|
+
}
|
|
69
|
+
const query = searchParams.toString();
|
|
70
|
+
return `/${API_VERSION}/documents/${documentId}${query ? `?${query}` : ""}`;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const deleteDocument = {
|
|
74
|
+
method: "DELETE",
|
|
75
|
+
getUrl({ documentId, storeId }) {
|
|
76
|
+
const searchParams = new URLSearchParams();
|
|
77
|
+
if (storeId) {
|
|
78
|
+
searchParams.set("storeId", storeId);
|
|
79
|
+
}
|
|
80
|
+
const query = searchParams.toString();
|
|
81
|
+
return `/${API_VERSION}/documents/${documentId}${query ? `?${query}` : ""}`;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const createDocumentLink = {
|
|
85
|
+
method: "POST",
|
|
86
|
+
getUrl({ documentId, storeId, contentHash }) {
|
|
87
|
+
const searchParams = new URLSearchParams();
|
|
88
|
+
if (storeId) {
|
|
89
|
+
searchParams.set("storeId", storeId);
|
|
90
|
+
}
|
|
91
|
+
if (contentHash) {
|
|
92
|
+
searchParams.set("contentHash", contentHash);
|
|
93
|
+
}
|
|
94
|
+
const query = searchParams.toString();
|
|
95
|
+
return `/${API_VERSION}/documents/${documentId}/links${query ? `?${query}` : ""}`;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
export {
|
|
99
|
+
createDocument,
|
|
100
|
+
createDocumentLink,
|
|
101
|
+
createDocuments,
|
|
102
|
+
createDocumentsResponseBodySchema,
|
|
103
|
+
deleteDocument,
|
|
104
|
+
documentCreationFailureDetailSchema,
|
|
105
|
+
documentLinkRequestBodySchema,
|
|
106
|
+
documentLinkSchema,
|
|
107
|
+
documentMetadataSchema,
|
|
108
|
+
documentReferenceSchema,
|
|
109
|
+
getDocument
|
|
110
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getEnumFilterSchema, getQueryRequestBodySchema, getQueryResponseBodySchema, API_VERSION } from "../common.js";
|
|
3
|
+
const elementInstanceStateSchema = z.enum(["ACTIVE", "COMPLETED", "TERMINATED"]);
|
|
4
|
+
const elementInstanceTypeSchema = z.enum([
|
|
5
|
+
"UNSPECIFIED",
|
|
6
|
+
"PROCESS",
|
|
7
|
+
"SUB_PROCESS",
|
|
8
|
+
"EVENT_SUB_PROCESS",
|
|
9
|
+
"AD_HOC_SUB_PROCESS",
|
|
10
|
+
"START_EVENT",
|
|
11
|
+
"INTERMEDIATE_CATCH_EVENT",
|
|
12
|
+
"INTERMEDIATE_THROW_EVENT",
|
|
13
|
+
"BOUNDARY_EVENT",
|
|
14
|
+
"END_EVENT",
|
|
15
|
+
"SERVICE_TASK",
|
|
16
|
+
"RECEIVE_TASK",
|
|
17
|
+
"USER_TASK",
|
|
18
|
+
"MANUAL_TASK",
|
|
19
|
+
"TASK",
|
|
20
|
+
"EXCLUSIVE_GATEWAY",
|
|
21
|
+
"INCLUSIVE_GATEWAY",
|
|
22
|
+
"PARALLEL_GATEWAY",
|
|
23
|
+
"EVENT_BASED_GATEWAY",
|
|
24
|
+
"SEQUENCE_FLOW",
|
|
25
|
+
"MULTI_INSTANCE_BODY",
|
|
26
|
+
"CALL_ACTIVITY",
|
|
27
|
+
"BUSINESS_RULE_TASK",
|
|
28
|
+
"SCRIPT_TASK",
|
|
29
|
+
"SEND_TASK",
|
|
30
|
+
"UNKNOWN"
|
|
31
|
+
]);
|
|
32
|
+
const elementInstanceSchema = z.object({
|
|
33
|
+
processDefinitionId: z.string(),
|
|
34
|
+
startDate: z.string(),
|
|
35
|
+
endDate: z.string().optional(),
|
|
36
|
+
elementId: z.string(),
|
|
37
|
+
elementName: z.string(),
|
|
38
|
+
type: elementInstanceTypeSchema,
|
|
39
|
+
state: elementInstanceStateSchema,
|
|
40
|
+
hasIncident: z.boolean(),
|
|
41
|
+
tenantId: z.string(),
|
|
42
|
+
elementInstanceKey: z.string(),
|
|
43
|
+
processInstanceKey: z.string(),
|
|
44
|
+
processDefinitionKey: z.string(),
|
|
45
|
+
incidentKey: z.string().optional()
|
|
46
|
+
});
|
|
47
|
+
const elementInstanceFilterSchema = z.object({
|
|
48
|
+
processDefinitionId: z.string(),
|
|
49
|
+
state: z.union([elementInstanceStateSchema, getEnumFilterSchema(elementInstanceStateSchema)]),
|
|
50
|
+
type: elementInstanceTypeSchema,
|
|
51
|
+
elementId: z.string(),
|
|
52
|
+
elementName: z.string(),
|
|
53
|
+
hasIncident: z.boolean(),
|
|
54
|
+
tenantId: z.string(),
|
|
55
|
+
elementInstanceKey: z.string(),
|
|
56
|
+
processInstanceKey: z.string(),
|
|
57
|
+
processDefinitionKey: z.string(),
|
|
58
|
+
incidentKey: z.string(),
|
|
59
|
+
scopeKey: z.string()
|
|
60
|
+
}).partial();
|
|
61
|
+
const queryElementInstancesRequestBodySchema = getQueryRequestBodySchema({
|
|
62
|
+
sortFields: [
|
|
63
|
+
"elementInstanceKey",
|
|
64
|
+
"processInstanceKey",
|
|
65
|
+
"processDefinitionKey",
|
|
66
|
+
"processDefinitionId",
|
|
67
|
+
"startDate",
|
|
68
|
+
"endDate",
|
|
69
|
+
"elementId",
|
|
70
|
+
"elementName",
|
|
71
|
+
"type",
|
|
72
|
+
"state",
|
|
73
|
+
"incidentKey",
|
|
74
|
+
"tenantId"
|
|
75
|
+
],
|
|
76
|
+
filter: elementInstanceFilterSchema
|
|
77
|
+
});
|
|
78
|
+
const queryElementInstancesResponseBodySchema = getQueryResponseBodySchema(elementInstanceSchema);
|
|
79
|
+
const queryElementInstances = {
|
|
80
|
+
method: "POST",
|
|
81
|
+
getUrl() {
|
|
82
|
+
return `/${API_VERSION}/element-instances/search`;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const getElementInstance = {
|
|
86
|
+
method: "GET",
|
|
87
|
+
getUrl(params) {
|
|
88
|
+
const { elementInstanceKey } = params;
|
|
89
|
+
return `/${API_VERSION}/element-instances/${elementInstanceKey}`;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const getElementInstanceResponseBodySchema = elementInstanceSchema;
|
|
93
|
+
const updateElementInstanceVariablesRequestBodySchema = z.object({
|
|
94
|
+
variables: z.record(z.string(), z.unknown()),
|
|
95
|
+
local: z.boolean().optional()
|
|
96
|
+
});
|
|
97
|
+
const updateElementInstanceVariables = {
|
|
98
|
+
method: "PUT",
|
|
99
|
+
getUrl(params) {
|
|
100
|
+
const { elementInstanceKey } = params;
|
|
101
|
+
return `/${API_VERSION}/element-instances/${elementInstanceKey}/variables`;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
elementInstanceFilterSchema,
|
|
106
|
+
elementInstanceSchema,
|
|
107
|
+
elementInstanceStateSchema,
|
|
108
|
+
elementInstanceTypeSchema,
|
|
109
|
+
getElementInstance,
|
|
110
|
+
getElementInstanceResponseBodySchema,
|
|
111
|
+
queryElementInstances,
|
|
112
|
+
queryElementInstancesRequestBodySchema,
|
|
113
|
+
queryElementInstancesResponseBodySchema,
|
|
114
|
+
updateElementInstanceVariables,
|
|
115
|
+
updateElementInstanceVariablesRequestBodySchema
|
|
116
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getQueryRequestBodySchema, getQueryResponseBodySchema, API_VERSION } from "../common.js";
|
|
3
|
+
import { mappingRuleSchema } from "./mapping-rule.js";
|
|
4
|
+
import { userSchema } from "./user.js";
|
|
5
|
+
import { groupSchema, roleSchema } from "../group-role.js";
|
|
6
|
+
const createGroupRequestBodySchema = groupSchema;
|
|
7
|
+
const createGroupResponseBodySchema = groupSchema;
|
|
8
|
+
const createGroup = {
|
|
9
|
+
method: "POST",
|
|
10
|
+
getUrl() {
|
|
11
|
+
return `/${API_VERSION}/groups`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const getGroup = {
|
|
15
|
+
method: "GET",
|
|
16
|
+
getUrl(params) {
|
|
17
|
+
const { groupId } = params;
|
|
18
|
+
return `/${API_VERSION}/groups/${groupId}`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const getGroupResponseBodySchema = groupSchema;
|
|
22
|
+
const updateGroupRequestBodySchema = groupSchema.pick({
|
|
23
|
+
name: true,
|
|
24
|
+
description: true
|
|
25
|
+
});
|
|
26
|
+
const updateGroupResponseBodySchema = groupSchema;
|
|
27
|
+
const updateGroup = {
|
|
28
|
+
method: "PUT",
|
|
29
|
+
getUrl(params) {
|
|
30
|
+
const { groupId } = params;
|
|
31
|
+
return `/${API_VERSION}/groups/${groupId}`;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const deleteGroup = {
|
|
35
|
+
method: "DELETE",
|
|
36
|
+
getUrl(params) {
|
|
37
|
+
const { groupId } = params;
|
|
38
|
+
return `/${API_VERSION}/groups/${groupId}`;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const queryGroupsRequestBodySchema = getQueryRequestBodySchema({
|
|
42
|
+
sortFields: ["name", "groupId"],
|
|
43
|
+
filter: groupSchema.pick({
|
|
44
|
+
groupId: true,
|
|
45
|
+
name: true
|
|
46
|
+
}).partial()
|
|
47
|
+
});
|
|
48
|
+
const queryGroupsResponseBodySchema = getQueryResponseBodySchema(groupSchema);
|
|
49
|
+
const queryGroups = {
|
|
50
|
+
method: "POST",
|
|
51
|
+
getUrl() {
|
|
52
|
+
return `/${API_VERSION}/groups/search`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const queryUsersByGroupRequestBodySchema = getQueryRequestBodySchema({
|
|
56
|
+
sortFields: ["username"],
|
|
57
|
+
filter: z.never()
|
|
58
|
+
});
|
|
59
|
+
const queryUsersByGroupResponseBodySchema = getQueryResponseBodySchema(userSchema.pick({ username: true }));
|
|
60
|
+
const queryUsersByGroup = {
|
|
61
|
+
method: "POST",
|
|
62
|
+
getUrl(params) {
|
|
63
|
+
const { groupId } = params;
|
|
64
|
+
return `/${API_VERSION}/groups/${groupId}/users/search`;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const queryClientsByGroupRequestBodySchema = getQueryRequestBodySchema({
|
|
68
|
+
sortFields: ["clientId"],
|
|
69
|
+
filter: z.never()
|
|
70
|
+
});
|
|
71
|
+
const queryClientsByGroupResponseBodySchema = getQueryResponseBodySchema(
|
|
72
|
+
z.object({
|
|
73
|
+
clientId: z.string()
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
const queryClientsByGroup = {
|
|
77
|
+
method: "POST",
|
|
78
|
+
getUrl(params) {
|
|
79
|
+
const { groupId } = params;
|
|
80
|
+
return `/${API_VERSION}/groups/${groupId}/clients/search`;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const queryRolesByGroupRequestBodySchema = getQueryRequestBodySchema({
|
|
84
|
+
sortFields: ["name", "roleId"],
|
|
85
|
+
filter: z.object({
|
|
86
|
+
roleId: z.string(),
|
|
87
|
+
name: z.string()
|
|
88
|
+
}).partial()
|
|
89
|
+
});
|
|
90
|
+
const queryRolesByGroupResponseBodySchema = getQueryResponseBodySchema(roleSchema.pick({ roleId: true, name: true }));
|
|
91
|
+
const queryRolesByGroup = {
|
|
92
|
+
method: "POST",
|
|
93
|
+
getUrl(params) {
|
|
94
|
+
const { groupId } = params;
|
|
95
|
+
return `/${API_VERSION}/groups/${groupId}/roles/search`;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const queryMappingRulesByGroupRequestBodySchema = getQueryRequestBodySchema({
|
|
99
|
+
sortFields: ["claimName", "claimValue", "name"],
|
|
100
|
+
filter: mappingRuleSchema.pick({
|
|
101
|
+
claimName: true,
|
|
102
|
+
claimValue: true,
|
|
103
|
+
name: true
|
|
104
|
+
}).partial()
|
|
105
|
+
});
|
|
106
|
+
const queryMappingRulesByGroupResponseBodySchema = getQueryResponseBodySchema(mappingRuleSchema);
|
|
107
|
+
const queryMappingRulesByGroup = {
|
|
108
|
+
method: "POST",
|
|
109
|
+
getUrl(params) {
|
|
110
|
+
const { groupId } = params;
|
|
111
|
+
return `/${API_VERSION}/groups/${groupId}/mapping-rules/search`;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const assignUserToGroup = {
|
|
115
|
+
method: "PUT",
|
|
116
|
+
getUrl(params) {
|
|
117
|
+
const { groupId, username } = params;
|
|
118
|
+
return `/${API_VERSION}/groups/${groupId}/users/${username}`;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const unassignUserFromGroup = {
|
|
122
|
+
method: "DELETE",
|
|
123
|
+
getUrl(params) {
|
|
124
|
+
const { groupId, username } = params;
|
|
125
|
+
return `/${API_VERSION}/groups/${groupId}/users/${username}`;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const assignClientToGroup = {
|
|
129
|
+
method: "PUT",
|
|
130
|
+
getUrl(params) {
|
|
131
|
+
const { groupId, clientId } = params;
|
|
132
|
+
return `/${API_VERSION}/groups/${groupId}/clients/${clientId}`;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const unassignClientFromGroup = {
|
|
136
|
+
method: "DELETE",
|
|
137
|
+
getUrl(params) {
|
|
138
|
+
const { groupId, clientId } = params;
|
|
139
|
+
return `/${API_VERSION}/groups/${groupId}/clients/${clientId}`;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const assignMappingToGroup = {
|
|
143
|
+
method: "PUT",
|
|
144
|
+
getUrl(params) {
|
|
145
|
+
const { groupId, mappingId } = params;
|
|
146
|
+
return `/${API_VERSION}/groups/${groupId}/mapping-rules/${mappingId}`;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const unassignMappingFromGroup = {
|
|
150
|
+
method: "DELETE",
|
|
151
|
+
getUrl(params) {
|
|
152
|
+
const { groupId, mappingId } = params;
|
|
153
|
+
return `/${API_VERSION}/groups/${groupId}/mapping-rules/${mappingId}`;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
export {
|
|
157
|
+
assignClientToGroup,
|
|
158
|
+
assignMappingToGroup,
|
|
159
|
+
assignUserToGroup,
|
|
160
|
+
createGroup,
|
|
161
|
+
createGroupRequestBodySchema,
|
|
162
|
+
createGroupResponseBodySchema,
|
|
163
|
+
deleteGroup,
|
|
164
|
+
getGroup,
|
|
165
|
+
getGroupResponseBodySchema,
|
|
166
|
+
groupSchema,
|
|
167
|
+
queryClientsByGroup,
|
|
168
|
+
queryClientsByGroupRequestBodySchema,
|
|
169
|
+
queryClientsByGroupResponseBodySchema,
|
|
170
|
+
queryGroups,
|
|
171
|
+
queryGroupsRequestBodySchema,
|
|
172
|
+
queryGroupsResponseBodySchema,
|
|
173
|
+
queryMappingRulesByGroup,
|
|
174
|
+
queryMappingRulesByGroupRequestBodySchema,
|
|
175
|
+
queryMappingRulesByGroupResponseBodySchema,
|
|
176
|
+
queryRolesByGroup,
|
|
177
|
+
queryRolesByGroupRequestBodySchema,
|
|
178
|
+
queryRolesByGroupResponseBodySchema,
|
|
179
|
+
queryUsersByGroup,
|
|
180
|
+
queryUsersByGroupRequestBodySchema,
|
|
181
|
+
queryUsersByGroupResponseBodySchema,
|
|
182
|
+
unassignClientFromGroup,
|
|
183
|
+
unassignMappingFromGroup,
|
|
184
|
+
unassignUserFromGroup,
|
|
185
|
+
updateGroup,
|
|
186
|
+
updateGroupRequestBodySchema,
|
|
187
|
+
updateGroupResponseBodySchema
|
|
188
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getQueryRequestBodySchema, getEnumFilterSchema, advancedDateTimeFilterSchema, getQueryResponseBodySchema, API_VERSION } from "../common.js";
|
|
3
|
+
const incidentErrorTypeSchema = z.enum([
|
|
4
|
+
"UNSPECIFIED",
|
|
5
|
+
"UNKNOWN",
|
|
6
|
+
"IO_MAPPING_ERROR",
|
|
7
|
+
"JOB_NO_RETRIES",
|
|
8
|
+
"EXECUTION_LISTENER_NO_RETRIES",
|
|
9
|
+
"TASK_LISTENER_NO_RETRIES",
|
|
10
|
+
"CONDITION_ERROR",
|
|
11
|
+
"EXTRACT_VALUE_ERROR",
|
|
12
|
+
"CALLED_ELEMENT_ERROR",
|
|
13
|
+
"UNHANDLED_ERROR_EVENT",
|
|
14
|
+
"MESSAGE_SIZE_EXCEEDED",
|
|
15
|
+
"CALLED_DECISION_ERROR",
|
|
16
|
+
"DECISION_EVALUATION_ERROR",
|
|
17
|
+
"FORM_NOT_FOUND",
|
|
18
|
+
"RESOURCE_NOT_FOUND"
|
|
19
|
+
]);
|
|
20
|
+
const incidentStateSchema = z.enum(["ACTIVE", "MIGRATED", "RESOLVED", "PENDING"]);
|
|
21
|
+
const incidentSchema = z.object({
|
|
22
|
+
processDefinitionId: z.string(),
|
|
23
|
+
errorType: incidentErrorTypeSchema,
|
|
24
|
+
errorMessage: z.string(),
|
|
25
|
+
elementId: z.string(),
|
|
26
|
+
creationTime: z.string(),
|
|
27
|
+
state: incidentStateSchema,
|
|
28
|
+
tenantId: z.string(),
|
|
29
|
+
incidentKey: z.string(),
|
|
30
|
+
processDefinitionKey: z.string(),
|
|
31
|
+
processInstanceKey: z.string(),
|
|
32
|
+
elementInstanceKey: z.string(),
|
|
33
|
+
jobKey: z.string()
|
|
34
|
+
});
|
|
35
|
+
const resolveIncident = {
|
|
36
|
+
method: "POST",
|
|
37
|
+
getUrl: ({ incidentKey }) => `/${API_VERSION}/incidents/${incidentKey}/resolution`
|
|
38
|
+
};
|
|
39
|
+
const getIncident = {
|
|
40
|
+
method: "GET",
|
|
41
|
+
getUrl: ({ incidentKey }) => `/${API_VERSION}/incidents/${incidentKey}`
|
|
42
|
+
};
|
|
43
|
+
const getIncidentResponseBodySchema = incidentSchema;
|
|
44
|
+
const queryIncidentsRequestBodySchema = getQueryRequestBodySchema({
|
|
45
|
+
sortFields: [
|
|
46
|
+
"incidentKey",
|
|
47
|
+
"processDefinitionKey",
|
|
48
|
+
"processDefinitionId",
|
|
49
|
+
"processInstanceKey",
|
|
50
|
+
"errorType",
|
|
51
|
+
"errorMessage",
|
|
52
|
+
"elementId",
|
|
53
|
+
"elementInstanceKey",
|
|
54
|
+
"creationTime",
|
|
55
|
+
"state",
|
|
56
|
+
"jobKey",
|
|
57
|
+
"tenantId"
|
|
58
|
+
],
|
|
59
|
+
filter: z.object({
|
|
60
|
+
errorType: getEnumFilterSchema(incidentErrorTypeSchema),
|
|
61
|
+
creationTime: advancedDateTimeFilterSchema,
|
|
62
|
+
state: getEnumFilterSchema(incidentStateSchema),
|
|
63
|
+
...incidentSchema.pick({
|
|
64
|
+
processDefinitionId: true,
|
|
65
|
+
errorMessage: true,
|
|
66
|
+
elementId: true,
|
|
67
|
+
tenantId: true,
|
|
68
|
+
incidentKey: true,
|
|
69
|
+
processDefinitionKey: true,
|
|
70
|
+
processInstanceKey: true,
|
|
71
|
+
elementInstanceKey: true,
|
|
72
|
+
jobKey: true
|
|
73
|
+
}).shape
|
|
74
|
+
}).partial()
|
|
75
|
+
});
|
|
76
|
+
const queryIncidentsResponseBodySchema = getQueryResponseBodySchema(incidentSchema);
|
|
77
|
+
const queryIncidents = {
|
|
78
|
+
method: "POST",
|
|
79
|
+
getUrl: () => `/${API_VERSION}/incidents/search`
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
getIncident,
|
|
83
|
+
getIncidentResponseBodySchema,
|
|
84
|
+
incidentErrorTypeSchema,
|
|
85
|
+
incidentSchema,
|
|
86
|
+
incidentStateSchema,
|
|
87
|
+
queryIncidents,
|
|
88
|
+
queryIncidentsRequestBodySchema,
|
|
89
|
+
queryIncidentsResponseBodySchema,
|
|
90
|
+
resolveIncident
|
|
91
|
+
};
|