Skip to content

Commit babff65

Browse files
author
naman-contentstack
committed
Merge branch 'development' into fix/DX-8587
2 parents 0f5d4c3 + c0d0aba commit babff65

93 files changed

Lines changed: 3690 additions & 4844 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/issues-jira.yml

Lines changed: 104 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,117 @@ name: Create Jira Ticket for Github Issue
22

33
on:
44
issues:
5-
types: [opened]
5+
types: [opened, reopened]
66

77
jobs:
88
issue-jira:
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Create Jira Issue
12+
id: create_jira
13+
uses: actions/github-script@v9
14+
with:
15+
script: |
16+
const baseUrl = process.env.JIRA_BASE_URL;
17+
const userEmail = process.env.JIRA_USER_EMAIL;
18+
const jiraToken = process.env.JIRA_API_TOKEN;
19+
const jiraProject = process.env.JIRA_PROJECT;
20+
const jiraIssueType = process.env.JIRA_ISSUE_TYPE;
21+
const jiraFields = JSON.parse(process.env.ISSUES_JIRA_FIELDS);
22+
23+
let requestBody = JSON.stringify({
24+
fields: {
25+
...jiraFields,
26+
"project": {
27+
"key": jiraProject
28+
},
29+
"issuetype": {
30+
"name": jiraIssueType
31+
},
32+
"summary": "Github | Issue | ${{ github.event.repository.name }} | ${{ github.event.issue.title }}",
33+
"description": {
34+
"version": 1,
35+
"type": "doc",
36+
"content": [
37+
{
38+
"type": "paragraph",
39+
"content": [
40+
{
41+
"type": "text",
42+
"text": "Github Issue",
43+
"marks": [
44+
{
45+
"type": "strong"
46+
}
47+
]
48+
},
49+
{
50+
"type": "text",
51+
"text": ": "
52+
},
53+
{
54+
"type": "text",
55+
"text": "${{ github.event.issue.html_url }}",
56+
"marks": [
57+
{
58+
"type": "link",
59+
"attrs": {
60+
"href": "${{ github.event.issue.html_url }}"
61+
}
62+
}
63+
]
64+
}
65+
]
66+
},
67+
{
68+
"type": "paragraph",
69+
"content": [
70+
{
71+
"type": "text",
72+
"text": "Description",
73+
"marks": [
74+
{
75+
"type": "strong"
76+
}
77+
]
78+
},
79+
{
80+
"type": "text",
81+
"text": ":"
82+
}
83+
]
84+
},
85+
{
86+
"type": "codeBlock",
87+
"content": [
88+
{
89+
"type": "text",
90+
"text": `${{ github.event.issue.body }}`
91+
}
92+
]
93+
}
94+
]
95+
}
96+
}
97+
});
1198
12-
- name: Login to Jira
13-
uses: atlassian/gajira-login@master
99+
const response = await fetch(`${baseUrl}/rest/api/3/issue`, {
100+
method: 'POST',
101+
headers: {
102+
'Content-Type': 'application/json',
103+
'Authorization': `Basic ${btoa(userEmail + ":" + jiraToken)}`
104+
},
105+
body: requestBody
106+
});
107+
if (!response.ok) {
108+
throw new Error(`JIRA API error! Status: ${response.status}`);
109+
}
110+
const data = await response.json();
111+
console.log('Jira Issue Created:', data.key);
14112
env:
15113
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
16114
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
17115
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
18-
19-
- name: Create Jira Issue
20-
id: create_jira
21-
uses: atlassian/gajira-create@master
22-
with:
23-
project: ${{ secrets.JIRA_PROJECT }}
24-
issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
25-
summary: Github | Issue | ${{ github.event.repository.name }} | ${{ github.event.issue.title }}
26-
description: |
27-
*GitHub Issue:* ${{ github.event.issue.html_url }}
28-
29-
*Description:*
30-
${{ github.event.issue.body }}
31-
fields: "${{ secrets.ISSUES_JIRA_FIELDS }}"
116+
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
117+
JIRA_ISSUE_TYPE: ${{ secrets.JIRA_ISSUE_TYPE }}
118+
ISSUES_JIRA_FIELDS: "${{ secrets.ISSUES_JIRA_FIELDS }}"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"pnpm": "^10.28.0"
77
},
88
"engines": {
9-
"node": ">=18.0.0"
9+
"node": ">=22.0.0"
1010
},
1111
"private": true,
1212
"scripts": {

packages/contentstack-apps-cli/.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/contentstack-apps-cli/.eslintrc

Lines changed: 0 additions & 42 deletions
This file was deleted.

packages/contentstack-apps-cli/README.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
> **Source of truth:** [cli-plugins](https://github.com/contentstack/cli-plugins)`packages/contentstack-apps-cli` (v1 line: `v1-dev` / `v1-beta`)
2-
> Migrated from [contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli). See [APPS-CLI-MIGRATION.md](../../APPS-CLI-MIGRATION.md).
3-
4-
<!-- Insert Nodejs CI here -->
5-
<!-- Insert Apps CLI version here -->
6-
71
# @contentstack/apps-cli
82

93
Contentstack lets you develop apps in your organization using the Developer Hub portal. With the Apps CLI plugin, Contentstack CLI allows you to perform the CRUD operations on your app in Developer Hub and then use the app in your organization or stack by installing or uninstalling your app as required.
@@ -23,8 +17,8 @@ This plugin requires you to be authenticated using [csdx auth:login](https://www
2317
$ npm install -g @contentstack/apps-cli
2418
$ csdx COMMAND
2519
running command...
26-
$ csdx (--version|-v)
27-
@contentstack/apps-cli/1.6.1 darwin-arm64 node-v18.20.2
20+
$ csdx (--version)
21+
@contentstack/apps-cli/1.6.1 darwin-arm64 node-v22.21.1
2822
$ csdx --help [COMMAND]
2923
USAGE
3024
$ csdx COMMAND
@@ -74,7 +68,7 @@ EXAMPLES
7468
$ csdx app:update
7569
```
7670

77-
_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/index.ts)_
71+
_See code: [src/commands/app/index.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/index.ts)_
7872

7973
## `csdx app:create`
8074

@@ -114,7 +108,7 @@ EXAMPLES
114108
$ csdx app:create --name App-4 --app-type organization --org <UID> --boilerplate <Ecommerce App Boilerplate>
115109
```
116110

117-
_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/create.ts)_
111+
_See code: [src/commands/app/create.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/create.ts)_
118112

119113
## `csdx app:delete`
120114

@@ -136,10 +130,10 @@ EXAMPLES
136130
137131
$ csdx app:delete --app-uid <value>
138132
139-
$ csdx app:delete --app-uid <value> --org <value> -d ./boilerplate
133+
$ csdx app:delete --app-uid <value> --org <value>
140134
```
141135

142-
_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/delete.ts)_
136+
_See code: [src/commands/app/delete.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/delete.ts)_
143137

144138
## `csdx app:deploy`
145139

@@ -177,7 +171,7 @@ EXAMPLES
177171
$ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <hosting-with-launch> --launch-project <new> --config <config-path>
178172
```
179173

180-
_See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/deploy.ts)_
174+
_See code: [src/commands/app/deploy.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/deploy.ts)_
181175

182176
## `csdx app:get`
183177

@@ -207,7 +201,7 @@ EXAMPLES
207201
$ csdx app:get --org <value> --app-uid <value> --app-type organization
208202
```
209203

210-
_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/get.ts)_
204+
_See code: [src/commands/app/get.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/get.ts)_
211205

212206
## `csdx app:install`
213207

@@ -233,7 +227,7 @@ EXAMPLES
233227
$ csdx app:install --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
234228
```
235229

236-
_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/install.ts)_
230+
_See code: [src/commands/app/install.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/install.ts)_
237231

238232
## `csdx app:reinstall`
239233

@@ -259,7 +253,7 @@ EXAMPLES
259253
$ csdx app:reinstall --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
260254
```
261255

262-
_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/reinstall.ts)_
256+
_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/reinstall.ts)_
263257

264258
## `csdx app:uninstall`
265259

@@ -286,7 +280,7 @@ EXAMPLES
286280
$ csdx app:uninstall --org <UID> --app-uid <APP-UID-1> --installation-uid <INSTALLATION-UID-1>
287281
```
288282

289-
_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/uninstall.ts)_
283+
_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/uninstall.ts)_
290284

291285
## `csdx app:update`
292286

@@ -297,7 +291,7 @@ USAGE
297291
$ csdx app:update [--org <value>] [--app-manifest <value>]
298292
299293
FLAGS
300-
--app-manifest=<value> Path to the app manifest.json file:
294+
--app-manifest=<value> Path to the app manifest.json file.
301295
--org=<value> Provide the organization UID to fetch the app details for the operation.
302296
303297
DESCRIPTION
@@ -309,5 +303,5 @@ EXAMPLES
309303
$ csdx app:update --app-manifest ./boilerplate/manifest.json
310304
```
311305

312-
_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/update.ts)_
306+
_See code: [src/commands/app/update.ts](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-apps-cli/src/commands/app/update.ts)_
313307
<!-- commandsstop -->
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import tseslint from 'typescript-eslint';
2+
import globals from 'globals';
3+
4+
export default [
5+
...tseslint.configs.recommended,
6+
{
7+
ignores: [
8+
'lib/**/*',
9+
'test/**/*',
10+
'dist/**/*',
11+
],
12+
},
13+
{
14+
languageOptions: {
15+
parser: tseslint.parser,
16+
parserOptions: {
17+
project: './tsconfig.json',
18+
},
19+
sourceType: 'module',
20+
globals: {
21+
...globals.node,
22+
},
23+
},
24+
plugins: {
25+
'@typescript-eslint': tseslint.plugin,
26+
},
27+
rules: {
28+
'@typescript-eslint/no-unused-vars': [
29+
'error',
30+
{
31+
args: 'none',
32+
},
33+
],
34+
'@typescript-eslint/prefer-namespace-keyword': 'error',
35+
quotes: 'off',
36+
semi: 'off',
37+
'@typescript-eslint/no-redeclare': 'off',
38+
eqeqeq: ['error', 'smart'],
39+
'id-match': 'error',
40+
'no-eval': 'error',
41+
'no-var': 'error',
42+
'@typescript-eslint/no-explicit-any': 'off',
43+
'@typescript-eslint/no-require-imports': 'off',
44+
'prefer-const': 'error',
45+
},
46+
},
47+
];

0 commit comments

Comments
 (0)