@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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmflow/cli",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "description": "An awesome Git Flow",
5
5
  "author": "camfou",
6
6
  "license": "MIT",
@@ -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
- body: {
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.body && options.headers?.["Content-Type"] === "application/json") {
36
- options.body = JSON.stringify(options.body);
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);
@@ -49,7 +49,7 @@ describe("triggerDirectusFlow", () => {
49
49
  Authorization: "Bearer token-abc",
50
50
  "Content-Type": "application/json"
51
51
  }),
52
- body: expectedBody
52
+ data: expectedBody
53
53
  })
54
54
  );
55
55
  });
@@ -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
- body: {
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.body && opts.headers?.["Content-Type"] === "application/json") {
12
- opts.body = JSON.stringify(opts.body);
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
- expect.stringContaining("/test-endpoint"),
40
- expect.objectContaining({
41
- callee: "JIRA",
42
- method: "post",
43
- params: { key: "value" },
44
- headers: expect.objectContaining({
45
- Authorization: expect.stringContaining("Basic ")
46
- }),
47
- retries: 3,
48
- retryDelay: expect.any(Function)
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