Skip to content

Commit 2bcb3de

Browse files
committed
Merge branch 'v5' into feat/reducing-package-size
2 parents 360ce37 + 25b85fd commit 2bcb3de

27 files changed

+5124
-406
lines changed

.github/workflows/policy-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ jobs:
4343
if [ "$license_file_found" = false ]; then
4444
echo "No license file found. Please add a license file to the repository."
4545
exit 1
46-
fi
46+
fi

.github/workflows/secrets-scan.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Secrets Scan
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
security-secrets:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: '2'
12+
ref: '${{ github.event.pull_request.head.ref }}'
13+
- run: |
14+
git reset --soft HEAD~1
15+
- name: Install Talisman
16+
run: |
17+
# Download Talisman
18+
wget https://github.com/thoughtworks/talisman/releases/download/v1.37.0/talisman_linux_amd64 -O talisman
19+
20+
# Checksum verification
21+
checksum=$(sha256sum ./talisman | awk '{print $1}')
22+
if [ "$checksum" != "8e0ae8bb7b160bf10c4fa1448beb04a32a35e63505b3dddff74a092bccaaa7e4" ]; then exit 1; fi
23+
24+
# Make it executable
25+
chmod +x talisman
26+
- name: Run talisman
27+
run: |
28+
# Run Talisman with the pre-commit hook
29+
./talisman --githook pre-commit

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@
44
.env
55
*.log
66
dist/
7-
coverage/
7+
coverage/
8+
.dccache
9+
dist/*
10+
.nx/

.talismanrc

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
fileignoreconfig:
22
- filename: src/lib/types.ts
3-
checksum: 1eb6d6ec971934d65017dae2f82d6d6ef1cd0e6bfd50f43a9b46f30182307230
3+
checksum: 35552b058b74a59a58c0deafd62c0d9b72e7c679cda803c7da3d1e55d9d4c508
4+
- filename: .github/workflows/secrets-scan.yml
5+
checksum: d79ec3f3288964f7d117b9ad319a54c0ebc152e35f69be8fde95522034fdfb2a
6+
- filename: src/lib/utils.ts
7+
checksum: d24a8d861d497776cd788ffe62cd6b24dbf5e9f695c263a0b0af6b9e1860fa77
8+
- filename: test/unit/cache.spec.ts
9+
checksum: cadf177ffc4ce8c271e8b49fd227947351afa7cade5c7cd902cda78d0f91ba5b
10+
- filename: test/unit/contentstack.spec.ts
11+
checksum: 267e4857af531bd3e5f080c3630922169a0c161355a6b185f1ee2716c5e60c45
12+
- filename: test/unit/utils.spec.ts
13+
checksum: b447bcd7d3b4ff83846dc0f492f1c7f52f80c46f341aabbf7570a16ed17d8232
14+
- filename: test/api/live-preview.spec.ts
15+
checksum: 577c1407bfd80d2e6a7717f55b02eb0b93e37050d7c985b85f2bb4bf99f430f0
16+
- filename: test/unit/query-optimization-comprehensive.spec.ts
17+
checksum: f5aaf6c784d7c101a05ca513c584bbd6e95f963d1e42779f2596050d9bcbac96
418
- filename: test/unit/image-transform.spec.ts
519
checksum: 7beabdd07bd35d620668fcd97e1a303b9cbc40170bf3008a376d75ce0895de2a
620
- filename: test/utils/mocks.ts
721
checksum: a1cb4b1890a584f1facd30f2a0974c97a66f91417022be79d00516338e244227
822
- filename: src/lib/query.ts
923
checksum: c4529069bc974d15c104303c5ae573c9341185a869c612ab07f0ee7f42e8b149
1024
- filename: package-lock.json
11-
checksum: a990bf5e52a42728ef1f85d4b005efe6c1c76e9fb8461e11d82f062cb5851e37
25+
checksum: da870e7d8b343b746fc0d65226366da0d38c520f9b232249b85f132f9b07c33f
1226
- filename: src/lib/entries.ts
1327
checksum: 1c9a58570f26d3e53526e89b404581a523d3f035234bc099fda96d144dee40f6
1428
- filename: src/lib/entry.ts
1529
checksum: 8826fe3147a2c640b0780dae02345611ed24e562562e7df7b3785cb0fa6f1f14
1630
- filename: .husky/pre-commit
1731
checksum: 5baabd7d2c391648163f9371f0e5e9484f8fb90fa2284cfc378732ec3192c193
1832
version: ""
33+

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
### Version: 4.8.0
2+
#### Date: June-30-2025
3+
Enh: Added AWS-EU support
4+
5+
### Version: 4.7.1
6+
#### Date: June-13-2025
7+
- Add encode option on find method to encode query params
8+
9+
### Version: 4.7.0
10+
#### Date: Apr-29-2025
11+
- Added return type for entry-querable method
12+
- Added support of top-level export of Stack type in @contentstack/delivery-sdk for compatibility with "moduleResolution": "Bundler".
13+
114
### Version: 4.6.1
215
#### Date: March-24-2025
316
Fix: Update imports and dependencies
@@ -29,11 +42,11 @@ Fix: removed node-localstorage
2942
#### Date: October-21-2024
3043
Fix: getData to receive params and headers both in data
3144
Enh: Node version bump
32-
Refactor: Package type changed to be module instead of CommonJS
45+
Refactor: Package type changed to be module instead of CommonJS
3346

3447
### Version: 4.3.0
3548
#### Date: Septmber-09-2024
36-
Feat: Include refernce accepts array of values
49+
Feat: Include refernce accepts array of values
3750

3851
### Version: 4.2.0
3952
#### Date: Septmber-04-2024
@@ -66,7 +79,7 @@ Custom host implementation
6679

6780
### Version: 4.0.1
6881
#### Date: May-20-2024
69-
Fixed SRE vulnerabilities
82+
Fixed SRE vulnerabilities
7083

7184
### Version: 4.0.0
7285
#### Date: April-23-2024

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/delivery-sdk",
3-
"version": "4.7.0",
3+
"version": "4.8.1",
44
"type": "module",
55
"description": "Contentstack Delivery SDK for TypeScript",
66
"homepage": "https://github.com/contentstack/contentstack-typescript",
@@ -68,7 +68,7 @@
6868
"husky-check": "npm run build && husky && chmod +x .husky/pre-commit"
6969
},
7070
"dependencies": {
71-
"@contentstack/core": "^1.2.0",
71+
"@contentstack/core": "^1.2.2",
7272
"axios": "^1.8.4",
7373
"humps": "^2.0.1"
7474
},

sanity-report.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,16 @@ console.log(`Failed Tests: ${failedTests}`);
4444
console.log(`Skipped Tests: ${skippedTests}`);
4545
console.log(`Total Duration: ${totalDurationMinutes}m ${totalDurationSeconds.toFixed(0)}s`);
4646

47+
const host = process.env.HOST || ''
48+
let region = 'AWS-NA'
49+
50+
const match = host.match(/^([^-]+(?:-[^-]+)*)-cdn/)
51+
if (match && match[1]) {
52+
region = match[1].toUpperCase()
53+
}
54+
4755
const slackMessage = `
48-
*Typescript CDA Report*
56+
*Typescript CDA Report - ${region}*
4957
• Total Suites: *${totalSuites}*
5058
• Total Tests: *${totalTests}*
5159
• Passed Tests: *${passedTests}*

src/lib/base-query.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { AxiosInstance, getData } from '@contentstack/core';
22
import { Pagination } from './pagination';
33
import { FindResponse, params } from './types';
4+
import { encodeQueryParams } from './utils';
45

56
export class BaseQuery extends Pagination {
67
_parameters: params = {}; // Params of query class ?query={}
@@ -201,11 +202,17 @@ export class BaseQuery extends Pagination {
201202
* const result = await stack.asset(asset_uid).fetch();
202203
*/
203204

204-
async find<T>(): Promise<FindResponse<T>> {
205+
async find<T>(encode: boolean = false): Promise<FindResponse<T>> {
205206
let requestParams: { [key: string]: any } = this._queryParams;
206207

207208
if (Object.keys(this._parameters).length > 0) {
208-
requestParams = { ...this._queryParams, query: { ...this._parameters } };
209+
let queryParams = { ...this._parameters };
210+
211+
if (encode) {
212+
queryParams = encodeQueryParams(queryParams);
213+
}
214+
215+
requestParams = { ...this._queryParams, query: queryParams };
209216
}
210217

211218
const getRequestOptions: any = { params: requestParams };

0 commit comments

Comments
 (0)