@contentstack/cli-utilities 1.4.4 → 1.4.5

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.
@@ -102,7 +102,40 @@ class AuthHandler {
102
102
  cli_ux_1.default.print('Access token fetched using auth code successfully.');
103
103
  cli_ux_1.default.print(`You can review the access permissions on the page - ${this.OAuthBaseURL}/#!/marketplace/authorized-apps`);
104
104
  res.writeHead(200, { 'Content-Type': 'text/html' });
105
- res.end(`<h1>Successfully authorized!</h1><h2>You can close this window now.</h2><p>You can review the access permissions on - <a href="${this.OAuthBaseURL}/#!/marketplace/authorized-apps" target="_blank">Authorized Apps page</a></p>`);
105
+ res.end(`<style>
106
+ body {
107
+ font-family: Arial, sans-serif;
108
+ text-align: center;
109
+ margin-top: 100px;
110
+ }
111
+
112
+ p {
113
+ color: #475161;
114
+ margin-bottom: 20px;
115
+ }
116
+ p button {
117
+ background-color: #6c5ce7;
118
+ color: #fff;
119
+ border: 1px solid transparent;
120
+ border-radius: 4px;
121
+ font-weight: 600;
122
+ line-height: 100%;
123
+ text-align: center;
124
+ min-height: 2rem;
125
+ padding: 0.3125rem 1rem;
126
+ }
127
+ </style>
128
+ <h1 style="color: #6c5ce7">Successfully authorized!</h1>
129
+ <p style="color: #475161; font-size: 16px; font-weight: 600">You can close this window now.</p>
130
+ <p>
131
+ You can review the access permissions on the
132
+ <a
133
+ style="color: #6c5ce7; text-decoration: none"
134
+ href="${this.OAuthBaseURL}/#!/marketplace/authorized-apps"
135
+ target="_blank"
136
+ >Authorized Apps page</a
137
+ >.
138
+ </p>`);
106
139
  stopServer();
107
140
  })
108
141
  .catch((error) => {
package/lib/helpers.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare const isAuthenticated: () => boolean;
2
+ export declare const doesBranchExist: (stack: any, branchName: any) => Promise<any>;
package/lib/helpers.js CHANGED
@@ -1,7 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAuthenticated = void 0;
3
+ exports.doesBranchExist = exports.isAuthenticated = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const auth_handler_1 = tslib_1.__importDefault(require("./auth-handler"));
6
6
  const isAuthenticated = () => auth_handler_1.default.isAuthenticated();
7
7
  exports.isAuthenticated = isAuthenticated;
8
+ const doesBranchExist = async (stack, branchName) => {
9
+ return stack
10
+ .branch(branchName)
11
+ .fetch()
12
+ .catch((error) => {
13
+ return error;
14
+ });
15
+ };
16
+ exports.doesBranchExist = doesBranchExist;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/cli-utilities",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "Utilities for contentstack projects",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -13,7 +13,9 @@
13
13
  "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
14
14
  "posttest": "npm run lint",
15
15
  "lint": "eslint src/**/*.ts",
16
- "format": "eslint src/**/*.ts --fix"
16
+ "format": "eslint src/**/*.ts --fix",
17
+ "test:unit": "mocha --forbid-only \"test/unit/**/*.test.ts\"",
18
+ "test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
17
19
  },
18
20
  "repository": {
19
21
  "type": "git",
@@ -75,4 +77,4 @@
75
77
  "tslib": "^1.13.0",
76
78
  "typescript": "^4.9.3"
77
79
  }
78
- }
80
+ }