Skip to content

Commit 6ea16cb

Browse files
Merge pull request #2363 from contentstack/development
staging PR
2 parents e60106c + 016fc8c commit 6ea16cb

File tree

142 files changed

+8050
-2392
lines changed

Some content is hidden

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

142 files changed

+8050
-2392
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ jobs:
173173
if: ${{env.release_releaseAll == 'true' || env.release_plugins_clone == 'true'}}
174174
working-directory: ./packages/contentstack-clone
175175
run: npm install
176+
- name: Compiling Clone
177+
if: ${{ steps.clone-installation.conclusion == 'success' }}
178+
working-directory: ./packages/contentstack-clone
179+
run: npm run prepack
176180
- name: Publishing clone
177181
uses: JS-DevTools/npm-publish@v3
178182
if: ${{ steps.clone-installation.conclusion == 'success' }}
@@ -226,6 +230,10 @@ jobs:
226230
if: ${{env.release_releaseAll == 'true' || env.release_plugins_migration == 'true'}}
227231
working-directory: ./packages/contentstack-migration
228232
run: npm install
233+
- name: Compiling Migration
234+
if: ${{ steps.migration-installation.conclusion == 'success' }}
235+
working-directory: ./packages/contentstack-migration
236+
run: npm run prepack
229237
- name: Publishing migration
230238
uses: JS-DevTools/npm-publish@v3
231239
if: ${{ steps.migration-installation.conclusion == 'success' }}

.talismanrc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fileignoreconfig:
2-
- filename: packages/contentstack-export-to-csv/src/types/index.ts
3-
checksum: 28c19efb0c13969d40df964f86fa6de444316e320801f19dee7392df7a36851d
4-
- filename: package-lock.json
5-
checksum: faa364dac78a89d142916b71b5ceba7fdc80acbf8dc71f15dfb38d622c9dc664
2+
- filename: package-lock.json
3+
checksum: 20001b2b16e2ab8cc8a3ccc30cebb5093c5c63f58e5b5fe64889d260a8d4cc56
4+
- filename: pnpm-lock.yaml
5+
checksum: c2982bbd478bd9aabcc12bc162d2a76e2635d70023674a677dea996a8671e9ab
66
version: '1.0'

package-lock.json

Lines changed: 620 additions & 561 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-audit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"dependencies": {
2121
"@contentstack/cli-command": "~1.7.2",
22-
"@contentstack/cli-utilities": "~1.17.0",
22+
"@contentstack/cli-utilities": "~1.17.1",
2323
"@oclif/core": "^4.3.0",
2424
"@oclif/plugin-help": "^6.2.28",
2525
"@oclif/plugin-plugins": "^5.4.54",
@@ -85,4 +85,4 @@
8585
"keywords": [
8686
"oclif"
8787
]
88-
}
88+
}

packages/contentstack-auth/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-auth",
33
"description": "Contentstack CLI plugin for authentication activities",
4-
"version": "1.7.2",
4+
"version": "1.7.3",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@contentstack/cli-command": "~1.7.2",
26-
"@contentstack/cli-utilities": "~1.17.0",
26+
"@contentstack/cli-utilities": "~1.17.1",
2727
"@oclif/core": "^4.3.0",
2828
"@oclif/plugin-help": "^6.2.28",
2929
"otplib": "^12.0.1"
@@ -81,4 +81,4 @@
8181
}
8282
},
8383
"repository": "contentstack/cli"
84-
}
84+
}

packages/contentstack-auth/src/utils/auth-handler.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -182,36 +182,6 @@ class AuthHandler {
182182
}
183183
});
184184
}
185-
186-
/**
187-
* Validate token
188-
* @param {string} authtoken
189-
* @returns {Promise} Promise object returns response object from Contentstack
190-
*/
191-
async validateAuthtoken(authtoken: string): Promise<object> {
192-
log.debug('Starting token validation.', { module: 'auth-handler', hasAuthToken: !!authtoken });
193-
194-
return new Promise((resolve, reject) => {
195-
if (authtoken) {
196-
log.debug('Making token validation API call.', { module: 'auth-handler' });
197-
198-
this._client
199-
.getUser()
200-
.then((user: object) => {
201-
log.debug('Token validation successful.', { module: 'auth-handler', user });
202-
resolve(user);
203-
})
204-
.catch((error: Error) => {
205-
log.debug('Token validation failed.', { module: 'auth-handler', error: error.message });
206-
cliux.print('CLI_AUTH_TOKEN_VALIDATION_FAILED', { color: 'yellow' });
207-
reject(error);
208-
});
209-
} else {
210-
log.debug('Token validation failed: no auth token provided.', { module: 'auth-handler' });
211-
reject(new Error(messageHandler.parse('CLI_AUTH_TOKEN_VALIDATION_NO_TOKEN')));
212-
}
213-
});
214-
}
215185
}
216186

217187
export default new AuthHandler();
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export { default as authHandler } from './auth-handler';
22
export { default as mfaHandler } from './mfa-handler';
33
export * as interactive from './interactive';
4-
export * as tokenValidation from './tokens-validation';

packages/contentstack-auth/src/utils/mfa-handler.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -104,32 +104,6 @@ class MFAHandler {
104104
}
105105
}
106106

107-
/**
108-
* Gets MFA code through manual user input
109-
* @returns Promise<string> The MFA code
110-
* @throws Error if code format is invalid
111-
*/
112-
async getManualMFACode(): Promise<string> {
113-
try {
114-
const code = await askOTP();
115-
if (!/^\d{6}$/.test(code)) {
116-
throw new Error(messageHandler.parse('CLI_AUTH_MFA_INVALID_CODE'));
117-
}
118-
return code;
119-
} catch (error) {
120-
log.debug('Failed to get MFA code', { module: 'mfa-handler', error });
121-
throw error;
122-
}
123-
}
124-
125-
/**
126-
* Validates an MFA code format
127-
* @param code The MFA code to validate
128-
* @returns boolean True if valid, false otherwise
129-
*/
130-
isValidMFACode(code: string): boolean {
131-
return /^\d{6}$/.test(code);
132-
}
133107
}
134108

135109
export default new MFAHandler();

packages/contentstack-auth/src/utils/tokens-validation.ts

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

packages/contentstack-auth/test/unit/commands/tokens-add.test.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { expect } from 'chai';
22
import * as sinon from 'sinon';
33
import { configHandler, cliux } from '@contentstack/cli-utilities';
44
import TokensAddCommand from '../../../src/commands/auth/tokens/add';
5-
import { tokenValidation } from '../../../src/utils';
65
import { stub, assert } from 'sinon';
76
import { config as dotenvConfig } from 'dotenv';
87
import nock from 'nock';
@@ -31,8 +30,6 @@ function resetConfig() {
3130
config.delete(`${configKeyTokens}.newToken`);
3231
}
3332
describe('Tokens Add Command', () => {
34-
let apiKeyValidationStub: sinon.SinonStub;
35-
let environmentTokenValidationStub: sinon.SinonStub;
3633
let printStub: sinon.SinonStub;
3734
const validAPIKey = conf.validAPIKey;
3835
const validDeliveryToken = '***REMOVED***';
@@ -43,28 +40,9 @@ describe('Tokens Add Command', () => {
4340
resetConfig();
4441
if ((cliux.print as any).restore) (cliux.print as any).restore();
4542
printStub = stub(cliux, 'print');
46-
apiKeyValidationStub = sinon
47-
.stub(tokenValidation, 'validateAPIKey')
48-
.callsFake(function (client: any, apiKey: string): Promise<any> {
49-
if (apiKey === validAPIKey) {
50-
return Promise.resolve({ valid: true, message: 'success' });
51-
}
52-
return Promise.resolve({ valid: false, message: 'failed' });
53-
});
54-
55-
environmentTokenValidationStub = sinon
56-
.stub(tokenValidation, 'validateEnvironment')
57-
.callsFake(function (client: any, apiKey: string, environment): Promise<any> {
58-
if (environment === validEnvironment) {
59-
return Promise.resolve({ valid: true, message: 'success' });
60-
}
61-
return Promise.resolve({ valid: false, message: 'failed' });
62-
});
6343
});
6444

6545
after(() => {
66-
apiKeyValidationStub.restore();
67-
environmentTokenValidationStub.restore();
6846
printStub.restore();
6947
resetConfig();
7048
});

0 commit comments

Comments
 (0)