Skip to content

Commit 6710b66

Browse files
author
naman-contentstack
committed
Merge branch 'development' into enhancement/DX-3639
2 parents 28a1940 + a7cf210 commit 6710b66

File tree

15 files changed

+6492
-1493
lines changed

15 files changed

+6492
-1493
lines changed

.talismanrc

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
fileignoreconfig:
22
- filename: package-lock.json
3-
checksum: 39e71326fd3b883372e1153b8c2cf6b408fa6afe046cbe1bcf7e117a3d5f198d
3+
checksum: a1a942a134a341af947c4c5f72dde02887feb5a58d46846527e156d47efea642
44
- filename: pnpm-lock.yaml
5-
checksum: 107e9790705c8f0ff600dafe41a5ff264c8022e196e228d73605eda64a89520d
5+
checksum: f54dd2edd773c8ba8953ffb30eec4a774ad538127956f4297215ec3f822a77f8
66
- filename: packages/contentstack-import-setup/test/unit/backup-handler.test.ts
77
checksum: 0582d62b88834554cf12951c8690a73ef3ddbb78b82d2804d994cf4148e1ef93
88
- filename: packages/contentstack-import-setup/test/config.json
@@ -109,16 +109,8 @@ fileignoreconfig:
109109
checksum: 34bdde6f85e8b60ebc73e627b315ec3886e5577102fca04c3e20c463c42eb681
110110
- filename: packages/contentstack-audit/src/modules/content-types.ts
111111
checksum: ddf7b08e6a80af09c6a7019a637c26089fb76572c7c3d079a8af244b02985f16
112-
- filename: packages/contentstack-import/test/unit/import/modules/base-class.test.ts
113-
checksum: 850383016629ed840bf12c8bea5b7640230a6e4f6af03d958d2bcbdcc740945d
114112
- filename: packages/contentstack-import/test/unit/commands/cm/stacks/import.test.ts
115-
checksum: 183feddf5ceee765a228c9c3d2759df459722fac20edce3c2fe957a7a28d790a
116-
- filename: packages/contentstack-import/test/unit/import/modules/content-types.test.ts
117-
checksum: 61fca8cda7873430d2a926c1b6d35d67f8707e0d68855e6c13c55e4be73a0ce3
118-
- filename: packages/contentstack-import/test/unit/import/modules/assets.test.ts
119-
checksum: 69d762d41c9b27f1563d2595549e581d3fcab723af3321d9db065468d0c60b79
120-
- filename: packages/contentstack-import/test/unit/import/modules/global-fields.test.ts
121-
checksum: 0de6c9c9f778d770a04da0c9927820090eb6478d9499f12a3329b580a1dc115b
122-
- filename: packages/contentstack-import/test/unit/import/modules/workflows.test.ts
123-
checksum: 42db46379556a837866dfa39bcd8cfc215a4be1b421c61a6508e8c3b958d39f9
113+
checksum: b11e57f1b824d405f86438e9e7c59183f8c59b66b42d8d16dbeaf76195a30548
114+
- filename: packages/contentstack-import/test/unit/utils/asset-helper.test.ts
115+
checksum: d45ae4939a98a7f50306408d5dc305c8513b54f5d539ddcb0e6bbbd4a97d9675
124116
version: "1.0"

package-lock.json

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

packages/contentstack-import-setup/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@types/mkdirp": "^1.0.2",
2525
"@types/mocha": "^8.2.3",
2626
"@types/node": "^14.18.63",
27-
"@types/proxyquire": "^1.3.31",
27+
"@types/rewire": "^2.5.30",
2828
"@types/tar": "^6.1.13",
2929
"@types/uuid": "^9.0.8",
3030
"@typescript-eslint/eslint-plugin": "^5.62.0",
@@ -34,7 +34,7 @@
3434
"mocha": "^10.8.2",
3535
"nyc": "^15.1.0",
3636
"oclif": "^4.17.46",
37-
"proxyquire": "^2.1.3",
37+
"rewire": "^9.0.1",
3838
"ts-node": "^10.9.2",
3939
"tsx": "^4.20.3",
4040
"typescript": "^4.9.5"

packages/contentstack-import/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@types/mkdirp": "^1.0.2",
3333
"@types/mocha": "^8.2.3",
3434
"@types/node": "^14.18.63",
35+
"@types/rewire": "^2.5.30",
3536
"@types/tar": "^6.1.13",
3637
"@types/uuid": "^9.0.8",
3738
"@typescript-eslint/eslint-plugin": "^5.62.0",
@@ -40,6 +41,7 @@
4041
"mocha": "^10.8.2",
4142
"nyc": "^15.1.0",
4243
"oclif": "^4.17.46",
44+
"rewire": "^9.0.1",
4345
"ts-node": "^10.9.2",
4446
"typescript": "^4.9.5"
4547
},

packages/contentstack-import/test/unit/commands/cm/stacks/import.test.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('ImportCommand', () => {
2828
};
2929

3030
mockFlags = {
31-
'stack-api-key': 'test-api-key',
31+
'stack-api-key': 'test',
3232
'data-dir': '/test/data',
3333
'alias': 'test-alias',
3434
'module': 'entries',
@@ -43,7 +43,8 @@ describe('ImportCommand', () => {
4343
};
4444

4545
mockImportConfig = {
46-
apiKey: 'test-api-key',
46+
// @ts-ignore-next-line secret-detection
47+
apiKey: 'test',
4748
contentDir: '/test/data',
4849
data: '/test/data',
4950
contentVersion: 1,
@@ -56,7 +57,8 @@ describe('ImportCommand', () => {
5657
userId: 'user-123',
5758
email: 'test@example.com',
5859
sessionId: 'test-session-123',
59-
apiKey: 'test-api-key',
60+
// @ts-ignore-next-line secret-detection
61+
apiKey: 'test',
6062
orgId: 'org-123',
6163
authenticationMethod: 'Basic Auth',
6264
},
@@ -210,20 +212,20 @@ describe('ImportCommand', () => {
210212
});
211213

212214
it('should create context with all required properties', () => {
213-
const context = command['createImportContext']('test-api-key', 'Basic Auth');
215+
const context = command['createImportContext']('test', 'Basic Auth');
214216

215217
expect(context).to.have.property('command', 'cm:stacks:import');
216218
expect(context).to.have.property('module', '');
217219
expect(context).to.have.property('userId', 'user-123');
218220
expect(context).to.have.property('email', 'test@example.com');
219221
expect(context).to.have.property('sessionId', 'test-session-123');
220-
expect(context).to.have.property('apiKey', 'test-api-key');
222+
expect(context).to.have.property('apiKey', 'test');
221223
expect(context).to.have.property('orgId', 'org-123');
222224
expect(context).to.have.property('authenticationMethod', 'Basic Auth');
223225
});
224226

225227
it('should use default authentication method when not provided', () => {
226-
const context = command['createImportContext']('test-api-key');
228+
const context = command['createImportContext']('test');
227229

228230
expect(context.authenticationMethod).to.equal('Basic Auth');
229231
});
@@ -232,7 +234,7 @@ describe('ImportCommand', () => {
232234
configHandlerStub.reset();
233235
configHandlerStub.returns(undefined);
234236

235-
const context = command['createImportContext']('test-api-key', 'Management Token');
237+
const context = command['createImportContext']('test', 'Management Token');
236238

237239
expect(context.userId).to.equal('');
238240
expect(context.email).to.equal('');
@@ -241,7 +243,7 @@ describe('ImportCommand', () => {
241243
});
242244

243245
it('should use context command when available', () => {
244-
const context = command['createImportContext']('test-api-key');
246+
const context = command['createImportContext']('test');
245247

246248
expect(context.command).to.equal('cm:stacks:import');
247249
});
@@ -270,7 +272,7 @@ describe('ImportCommand', () => {
270272

271273
// Mock the interactive functions
272274
sinon.stub(interactiveModule, 'askContentDir').resolves('/test/content');
273-
sinon.stub(interactiveModule, 'askAPIKey').resolves('test-api-key');
275+
sinon.stub(interactiveModule, 'askAPIKey').resolves('test');
274276

275277
// Mock log methods by replacing them on the log object
276278
logSuccessStub = sinon.stub().callsFake(() => {});
@@ -374,7 +376,7 @@ describe('ImportCommand', () => {
374376
ModuleImporterStub = sinon.stub().returns(mockModuleImporter);
375377

376378
sinon.stub(interactiveModule, 'askContentDir').resolves('/test/content');
377-
sinon.stub(interactiveModule, 'askAPIKey').resolves('test-api-key');
379+
sinon.stub(interactiveModule, 'askAPIKey').resolves('test');
378380

379381
logSuccessStub = sinon.stub().callsFake(() => {});
380382
logInfoStub = sinon.stub().callsFake(() => {});
@@ -504,23 +506,23 @@ describe('ImportCommand', () => {
504506
it('should handle undefined context', () => {
505507
(command as any).context = undefined;
506508

507-
const context = command['createImportContext']('test-api-key');
509+
const context = command['createImportContext']('test');
508510

509511
expect(context.command).to.equal('cm:stacks:import');
510512
});
511513

512514
it('should handle context without info', () => {
513515
(command as any).context = { sessionId: 'test-session' };
514516

515-
const context = command['createImportContext']('test-api-key');
517+
const context = command['createImportContext']('test');
516518

517519
expect(context.command).to.equal('cm:stacks:import');
518520
});
519521

520522
it('should handle context without sessionId', () => {
521523
(command as any).context = { info: { command: 'test' } };
522524

523-
const context = command['createImportContext']('test-api-key');
525+
const context = command['createImportContext']('test');
524526

525527
expect(context.sessionId).to.be.undefined;
526528
});
@@ -529,7 +531,7 @@ describe('ImportCommand', () => {
529531
configHandlerStub.reset();
530532
configHandlerStub.returns(undefined);
531533

532-
const context = command['createImportContext']('test-api-key');
534+
const context = command['createImportContext']('test');
533535

534536
expect(context.userId).to.equal('');
535537
expect(context.email).to.equal('');

packages/contentstack-import/test/unit/import/modules/assets.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('ImportAssets', () => {
3434
};
3535

3636
mockImportConfig = {
37-
apiKey: 'test-api-key',
37+
apiKey: 'test',
3838
contentDir: '/test/content',
3939
data: '/test/content',
4040
contentVersion: 1,
@@ -47,7 +47,7 @@ describe('ImportAssets', () => {
4747
userId: 'user-123',
4848
email: 'test@example.com',
4949
sessionId: 'session-123',
50-
apiKey: 'test-api-key',
50+
apiKey: 'test',
5151
orgId: 'org-123',
5252
authenticationMethod: 'Basic Auth'
5353
},

packages/contentstack-import/test/unit/import/modules/base-class.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('BaseClass', () => {
8686
};
8787

8888
mockImportConfig = {
89-
apiKey: 'test-api-key',
89+
apiKey: 'test',
9090
contentDir: '/test/content',
9191
data: '/test/content',
9292
contentVersion: 1,
@@ -99,7 +99,7 @@ describe('BaseClass', () => {
9999
userId: 'user-123',
100100
email: 'test@example.com',
101101
sessionId: 'session-123',
102-
apiKey: 'test-api-key',
102+
apiKey: 'test',
103103
orgId: 'org-123',
104104
authenticationMethod: 'Management Token'
105105
},

0 commit comments

Comments
 (0)