@cmflow/cli 3.1.4 → 3.1.6
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/.yarn/install-state.gz +0 -0
- package/package.json +1 -1
- package/src/common/back/directus/directus-flow.js +3 -3
- package/src/common/back/directus/directus-flow.test.js +1 -1
- package/src/common/back/jira/jira-releases.js +1 -8
- package/src/common/back/jira/jira-request.js +2 -2
- package/src/common/back/jira/jira-request.spec.js +14 -14
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ export async function triggerDirectusFlow(projectId, versions, opts = {}) {
|
|
|
23
23
|
Authorization: `Bearer ${DIRECTUS_ACCESS_TOKEN}`,
|
|
24
24
|
"Content-Type": "application/json"
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
data: {
|
|
27
27
|
projectId,
|
|
28
28
|
versions
|
|
29
29
|
},
|
|
@@ -32,8 +32,8 @@ export async function triggerDirectusFlow(projectId, versions, opts = {}) {
|
|
|
32
32
|
...opts
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
if (options.
|
|
36
|
-
options.
|
|
35
|
+
if (options.data && options.headers?.["Content-Type"] === "application/json") {
|
|
36
|
+
options.data = JSON.stringify(options.data);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
return httpRequest(endpoint, options);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jiraRequest } from "./jira-request.js";
|
|
2
|
-
import { jiraSearch } from "./jira-search.js";
|
|
3
2
|
|
|
4
3
|
export async function getJiraReleases(projectId) {
|
|
5
4
|
const endpoint = `/rest/api/3/project/${projectId}/versions?expand`;
|
|
@@ -21,7 +20,7 @@ export async function updateJiraRelease(release) {
|
|
|
21
20
|
"Content-Type": "application/json",
|
|
22
21
|
Accept: "application/json"
|
|
23
22
|
},
|
|
24
|
-
|
|
23
|
+
data: {
|
|
25
24
|
id: release.id,
|
|
26
25
|
description: release.description,
|
|
27
26
|
name: release.name,
|
|
@@ -35,9 +34,3 @@ export async function updateJiraRelease(release) {
|
|
|
35
34
|
console.log(`Error while updating jira release ${release.id}`, er);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
export async function getJiraVersionRelatedIssues(projectId, tagVersion) {
|
|
40
|
-
return jiraSearch(`project = "${projectId}" AND fixVersion="${tagVersion}" ORDER BY created DESC`, {
|
|
41
|
-
fields: ["summary", "issuetype", "status", "assignee", "reporter", "created", "updated"]
|
|
42
|
-
});
|
|
43
|
-
}
|
|
@@ -8,8 +8,8 @@ export async function jiraRequest(endpoint, opts = {}) {
|
|
|
8
8
|
const jiraUrl = `${JIRA_API}${endpoint}`;
|
|
9
9
|
const auth = Buffer.from(`${JIRA_EMAIL}:${JIRA_TOKEN}`).toString("base64");
|
|
10
10
|
|
|
11
|
-
if (opts.
|
|
12
|
-
opts.
|
|
11
|
+
if (opts.data && opts.headers?.["Content-Type"] === "application/json") {
|
|
12
|
+
opts.data = JSON.stringify(opts.data);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
return httpRequest(jiraUrl, {
|
|
@@ -32,22 +32,22 @@ describe("jiraRequest", () => {
|
|
|
32
32
|
|
|
33
33
|
const result = await jiraRequest("/test-endpoint", {
|
|
34
34
|
method: "post",
|
|
35
|
-
params: { key: "value" }
|
|
35
|
+
params: { key: "value" },
|
|
36
|
+
headers: { "Content-Type": "application/json" },
|
|
37
|
+
data: { key: "value" }
|
|
36
38
|
});
|
|
37
39
|
|
|
38
|
-
expect(httpRequest).toHaveBeenCalledWith(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
50
|
-
);
|
|
40
|
+
expect(httpRequest).toHaveBeenCalledWith(expect.stringContaining("/test-endpoint"), {
|
|
41
|
+
callee: "JIRA",
|
|
42
|
+
method: "post",
|
|
43
|
+
params: { key: "value" },
|
|
44
|
+
data: JSON.stringify({ key: "value" }),
|
|
45
|
+
headers: expect.objectContaining({
|
|
46
|
+
Authorization: expect.stringContaining("Basic ")
|
|
47
|
+
}),
|
|
48
|
+
retries: 3,
|
|
49
|
+
retryDelay: expect.any(Function)
|
|
50
|
+
});
|
|
51
51
|
expect(result).toEqual(mockResponse);
|
|
52
52
|
});
|
|
53
53
|
|