Skip to content

Commit 366ce00

Browse files
authored
Merge pull request #153 from contentstack/development
DX | 24-03-2025 | Release
2 parents 130d53f + 7d5913d commit 366ce00

File tree

11 files changed

+70
-62
lines changed

11 files changed

+70
-62
lines changed

.talismanrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
fileignoreconfig:
22
- filename: package-lock.json
3-
checksum: 14aa4a8464718071ee723fc67f0f77748e41818f949a5b9b688da24cf1dd8bf0
3+
checksum: ffe61fb2806dc761b2f8e560b3d27aa58ae2fe2bdf5a48f68d80ee0fb74ffdb6
4+
- filename: src/lib/types.ts
5+
checksum: 1eb6d6ec971934d65017dae2f82d6d6ef1cd0e6bfd50f43a9b46f30182307230
46
- filename: test/unit/image-transform.spec.ts
57
checksum: 7beabdd07bd35d620668fcd97e1a303b9cbc40170bf3008a376d75ce0895de2a
68
- filename: test/utils/mocks.ts

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### Version: 4.6.1
2+
#### Date: March-24-2025
3+
Fix: Update imports and dependencies
4+
Fix: Unit test cases
5+
16
### Version: 4.6.0
27
#### Date: March-10-2025
38
Enh: Added GCP-EU support

package-lock.json

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

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/delivery-sdk",
3-
"version": "4.6.0",
3+
"version": "4.6.1",
44
"type": "module",
55
"license": "MIT",
66
"main": "./dist/legacy/index.cjs",
@@ -35,11 +35,8 @@
3535
"dependencies": {
3636
"@contentstack/core": "^1.2.0",
3737
"@contentstack/utils": "^1.3.19",
38-
"@types/humps": "^2.0.6",
3938
"axios": "^1.8.2",
40-
"dotenv": "^16.4.7",
41-
"humps": "^2.0.1",
42-
"path-browserify": "^1.0.1"
39+
"humps": "^2.0.1"
4340
},
4441
"files": [
4542
"dist",
@@ -48,16 +45,19 @@
4845
],
4946
"devDependencies": {
5047
"@nrwl/jest": "^17.3.2",
48+
"@types/humps": "^2.0.6",
5149
"@types/jest": "^29.5.14",
5250
"@types/node-localstorage": "^1.3.3",
5351
"axios-mock-adapter": "^1.22.0",
5452
"babel-jest": "^29.7.0",
53+
"dotenv": "^16.4.7",
5554
"esbuild-plugin-file-path-extensions": "^2.1.4",
5655
"ignore-loader": "^0.1.2",
5756
"jest": "^29.7.0",
5857
"jest-environment-jsdom": "^29.7.0",
5958
"jest-html-reporters": "^3.1.7",
6059
"jest-junit": "^16.0.0",
60+
"path-browserify": "^1.0.1",
6161
"ts-jest": "^29.2.6",
6262
"ts-loader": "^9.5.2",
6363
"ts-node": "^10.9.2",

src/lib/base-query.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { AxiosInstance, getData } from '@contentstack/core';
22
import { Pagination } from './pagination';
3-
import { FindResponse } from './types';
4-
import { params } from './internal-types';
3+
import { FindResponse, params } from './types';
54

65
export class BaseQuery extends Pagination {
76
_parameters: params = {}; // Params of query class ?query={}

src/lib/internal-types.ts

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

src/lib/pagination.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { PaginationObj } from './types';
2-
import { queryParams } from './internal-types';
1+
import { PaginationObj, queryParams } from './types';
32

43
export class Pagination {
54
_queryParams: queryParams = {};

src/lib/query.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { AxiosInstance } from '@contentstack/core';
22
import { BaseQuery } from './base-query';
3-
import { BaseQueryParameters, QueryOperation, QueryOperator, TaxonomyQueryOperation } from './types';
4-
import { params, queryParams } from './internal-types';
3+
import { BaseQueryParameters, QueryOperation, QueryOperator, TaxonomyQueryOperation, params, queryParams } from './types';
54

65
export class Query extends BaseQuery {
76
private _contentTypeUid?: string;

src/lib/synchronization.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import humps from 'humps';
55

66
export async function synchronization(client: AxiosInstance, params: SyncStack | SyncType = {}, recursive = false) {
77
const config: AxiosRequestConfig = { params };
8+
const SYNC_URL = '/stacks/sync';
9+
810
if (!('paginationToken' in params || 'syncToken' in params)) {
911
// for every config except sync and pagination token
1012
config.params = { ...params, init: true };
@@ -15,13 +17,13 @@ export async function synchronization(client: AxiosInstance, params: SyncStack |
1517
config.params = { ...config.params, type: type.join(',') };
1618
}
1719

18-
let response: AxiosResponse = await getData(client, '/sync', { params: humps.decamelizeKeys(config) });
20+
let response: AxiosResponse = await getData(client, SYNC_URL, { params: humps.decamelizeKeys(config.params) });
1921
const data = response.data;
2022

2123
while (recursive && 'pagination_token' in response.data) {
2224
const recResponse: AxiosResponse = await getData(
2325
client,
24-
'/sync',
26+
SYNC_URL,
2527
humps.decamelizeKeys({ paginationToken: data.pagination_token })
2628
);
2729
recResponse.data.items = { ...response.data.items, ...recResponse.data.items };

src/lib/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
import { HttpClientParams } from '@contentstack/core';
33
import { PersistanceStoreOptions, StorageType } from '../persistance';
44

5+
// Internal Types
6+
export type params = {
7+
[key: string]: any
8+
}
9+
10+
export type queryParams = {
11+
[key: string]: string | boolean | number | string[]
12+
}
13+
14+
// External Types
515
export enum Region {
616
US = 'us',
717
EU = 'eu',

0 commit comments

Comments
 (0)