Skip to content

Commit 491e6e1

Browse files
Merge pull request #194 from contentstack/development
07-07-2025 | Staging
2 parents ca4cea3 + 4e25119 commit 491e6e1

14 files changed

+868
-618
lines changed

.talismanrc

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
fileignoreconfig:
2-
- filename: .github/workflows/secrets-scan.yml
3-
ignore_detectors:
4-
- filecontent
5-
- filename: src/lib/types.ts
6-
checksum: 1eb6d6ec971934d65017dae2f82d6d6ef1cd0e6bfd50f43a9b46f30182307230
7-
- filename: test/unit/image-transform.spec.ts
8-
checksum: 7beabdd07bd35d620668fcd97e1a303b9cbc40170bf3008a376d75ce0895de2a
9-
- filename: test/utils/mocks.ts
10-
checksum: a1cb4b1890a584f1facd30f2a0974c97a66f91417022be79d00516338e244227
11-
- filename: src/lib/query.ts
12-
checksum: c4529069bc974d15c104303c5ae573c9341185a869c612ab07f0ee7f42e8b149
13-
- filename: package-lock.json
14-
checksum: f9c5af529a2c4c6576d67bd6c25dc6c3088ddedf2482757d382953f2d4521995
15-
- filename: src/lib/entries.ts
16-
checksum: 1c9a58570f26d3e53526e89b404581a523d3f035234bc099fda96d144dee40f6
17-
- filename: src/lib/entry.ts
18-
checksum: 8826fe3147a2c640b0780dae02345611ed24e562562e7df7b3785cb0fa6f1f14
19-
- filename: .husky/pre-commit
20-
checksum: 5baabd7d2c391648163f9371f0e5e9484f8fb90fa2284cfc378732ec3192c193
21-
- filename: test/api/live-preview.spec.ts
22-
checksum: 34f8b01b1e3804023f71768f9c6a67860f192abd70eb22c7d2260d3a80d9e500
23-
version: ""
24-
fileignoreconfig:
25-
- filename: package-lock.json
26-
checksum: be08fac0b5e580b7dd66f5dc2b2f7bdefeef89b98ce60df1fe31ad33adb96172
27-
version: "1.0"
2+
- filename: test/unit/persistance/local-storage.spec.ts
3+
checksum: da6638b676c34274279d80539983a5dfcf5e729ec65d6a535d7939b6ba7c9b58
4+
- filename: test/unit/cache.spec.ts
5+
checksum: cadf177ffc4ce8c271e8b49fd227947351afa7cade5c7cd902cda78d0f91ba5b
6+
- filename: test/unit/persistance/preference-store.spec.ts
7+
checksum: 0f3457f8ea8b149c5de1d6585c78eb4cea0d2ac00ca69cdc294c44fe29ea3c11
8+
- filename: test/unit/contentstack.spec.ts
9+
checksum: 267e4857af531bd3e5f080c3630922169a0c161355a6b185f1ee2716c5e60c45
10+
- filename: test/unit/utils.spec.ts
11+
checksum: b447bcd7d3b4ff83846dc0f492f1c7f52f80c46f341aabbf7570a16ed17d8232
12+
- filename: src/lib/types.ts
13+
checksum: a5e87bfe625b8cef8714545c07cfbe3ea05b07c8cb495fef532c610b37d82140
14+
- filename: test/unit/persistance/preference-store.spec.ts
15+
checksum: 5d31522fb28b95b0b243b8f3d8499dcf4c5c80c0ea24f895802a724136985e37
16+
- filename: test/api/live-preview.spec.ts
17+
checksum: 42b72f54a8c51fc9f98c6044a78d1435388972522763af6bf36f066ff2dc555c
18+
version: "1.0"

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### Version: 4.8.0
2+
#### Date: June-30-2025
3+
Enh: Added AWS-EU support
4+
15
### Version: 4.7.1
26
#### Date: June-13-2025
37
- Add encode option on find method to encode query params
@@ -38,11 +42,11 @@ Fix: removed node-localstorage
3842
#### Date: October-21-2024
3943
Fix: getData to receive params and headers both in data
4044
Enh: Node version bump
41-
Refactor: Package type changed to be module instead of CommonJS
45+
Refactor: Package type changed to be module instead of CommonJS
4246

4347
### Version: 4.3.0
4448
#### Date: Septmber-09-2024
45-
Feat: Include refernce accepts array of values
49+
Feat: Include refernce accepts array of values
4650

4751
### Version: 4.2.0
4852
#### Date: Septmber-04-2024
@@ -75,7 +79,7 @@ Custom host implementation
7579

7680
### Version: 4.0.1
7781
#### Date: May-20-2024
78-
Fixed SRE vulnerabilities
82+
Fixed SRE vulnerabilities
7983

8084
### Version: 4.0.0
8185
#### Date: April-23-2024

jest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable */
22
export default {
3-
displayName: 'contentstack-delivery',
4-
preset: './jest.preset.js',
3+
displayName: "contentstack-delivery",
4+
preset: "./jest.preset.js",
55
transform: {
66
"^.+\\.[tj]s$": [
77
"ts-jest",

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/delivery-sdk",
3-
"version": "4.7.1",
3+
"version": "4.8.0",
44
"type": "module",
55
"license": "MIT",
66
"main": "./dist/legacy/index.cjs",

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/types.ts

Lines changed: 80 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
/* eslint-disable @cspell/spellchecker */
2-
import { HttpClientParams } from '@contentstack/core';
3-
import { PersistanceStoreOptions, StorageType } from '../persistance';
2+
import { HttpClientParams } from "@contentstack/core";
3+
import { PersistanceStoreOptions, StorageType } from "../persistance";
44

55
// Internal Types
66
export type params = {
7-
[key: string]: any
8-
}
7+
[key: string]: any;
8+
};
99

10-
export type queryParams = {
11-
[key: string]: string | boolean | number | string[]
12-
}
10+
export type queryParams = {
11+
[key: string]: string | boolean | number | string[];
12+
};
1313

1414
// External Types
1515
export enum Region {
16-
US = 'us',
17-
EU = 'eu',
18-
AZURE_NA = 'azure-na',
19-
AZURE_EU = 'azure-eu',
20-
GCP_NA = 'gcp-na',
21-
GCP_EU = 'gcp-eu',
16+
US = "us",
17+
EU = "eu",
18+
AU = "au",
19+
AZURE_NA = "azure-na",
20+
AZURE_EU = "azure-eu",
21+
GCP_NA = "gcp-na",
22+
GCP_EU = "gcp-eu",
2223
}
2324
export interface StackConfig extends HttpClientParams {
2425
host?: string;
@@ -42,24 +43,24 @@ export interface CacheOptions extends PersistanceStoreOptions {
4243
}
4344

4445
export enum Policy {
45-
IGNORE_CACHE = 'IGNORE_CACHE',
46-
CACHE_THEN_NETWORK = 'CACHE_THEN_NETWORK',
47-
CACHE_ELSE_NETWORK = 'CACHE_ELSE_NETWORK',
48-
NETWORK_ELSE_CACHE = 'NETWORK_ELSE_CACHE',
46+
IGNORE_CACHE = "IGNORE_CACHE",
47+
CACHE_THEN_NETWORK = "CACHE_THEN_NETWORK",
48+
CACHE_ELSE_NETWORK = "CACHE_ELSE_NETWORK",
49+
NETWORK_ELSE_CACHE = "NETWORK_ELSE_CACHE",
4950
}
5051

5152
export interface SyncStack {
5253
paginationToken?: string;
5354
syncToken?: string;
5455
}
5556
export enum PublishType {
56-
ENTRY_PUBLISHED = 'entry_published',
57-
ENTRY_UNPUBLISHED = 'entry_unpublished',
58-
ENTRY_DELETED = 'entry_deleted',
59-
ASSET_PUBLISHED = 'asset_published',
60-
ASSET_UNPUBLISHED = 'asset_unpublished',
61-
ASSET_DELETED = 'asset_deleted',
62-
CONTENT_TYPE_DELETED = 'content_type_deleted',
57+
ENTRY_PUBLISHED = "entry_published",
58+
ENTRY_UNPUBLISHED = "entry_unpublished",
59+
ENTRY_DELETED = "entry_deleted",
60+
ASSET_PUBLISHED = "asset_published",
61+
ASSET_UNPUBLISHED = "asset_unpublished",
62+
ASSET_DELETED = "asset_deleted",
63+
CONTENT_TYPE_DELETED = "content_type_deleted",
6364
}
6465
export interface SyncType {
6566
environment?: string;
@@ -71,25 +72,25 @@ export interface SyncType {
7172
export type TransformData = { [key: string]: string | string[] };
7273

7374
export enum Format {
74-
GIF = 'gif',
75-
PNG = 'png',
76-
JPG = 'jpg',
77-
PJPG = 'pjpg',
78-
WEBP = 'webp',
79-
WEBPLL = 'webpll',
80-
WEBPLY = 'webply',
75+
GIF = "gif",
76+
PNG = "png",
77+
JPG = "jpg",
78+
PJPG = "pjpg",
79+
WEBP = "webp",
80+
WEBPLL = "webpll",
81+
WEBPLY = "webply",
8182
}
8283

8384
export enum CropBy {
84-
DEFAULT = 'default',
85-
ASPECTRATIO = 'aspectRatio',
86-
REGION = 'region',
87-
OFFSET = 'offset',
85+
DEFAULT = "default",
86+
ASPECTRATIO = "aspectRatio",
87+
REGION = "region",
88+
OFFSET = "offset",
8889
}
8990

9091
export enum FitBy {
91-
BOUNDS = 'bounds',
92-
CROP = 'crop',
92+
BOUNDS = "bounds",
93+
CROP = "crop",
9394
}
9495

9596
export enum Orientation {
@@ -104,53 +105,53 @@ export enum Orientation {
104105
}
105106

106107
export enum OverlayAlign {
107-
TOP = 'top',
108-
BOTTOM = 'bottom',
109-
LEFT = 'left',
110-
RIGHT = 'right',
111-
MIDDLE = 'middle',
112-
CENTER = 'center',
108+
TOP = "top",
109+
BOTTOM = "bottom",
110+
LEFT = "left",
111+
RIGHT = "right",
112+
MIDDLE = "middle",
113+
CENTER = "center",
113114
}
114115

115116
export enum OverlayRepeat {
116-
X = 'x',
117-
Y = 'y',
118-
BOTH = 'both',
117+
X = "x",
118+
Y = "y",
119+
BOTH = "both",
119120
}
120121

121122
export enum ResizeFilter {
122-
NEAREST = 'nearest',
123-
BILINEAR = 'bilinear',
124-
BICUBIC = 'bicubic',
125-
LANCZOS2 = 'lanczos2',
126-
LANCZOS3 = 'lanczos3',
123+
NEAREST = "nearest",
124+
BILINEAR = "bilinear",
125+
BICUBIC = "bicubic",
126+
LANCZOS2 = "lanczos2",
127+
LANCZOS3 = "lanczos3",
127128
}
128129

129130
export enum CanvasBy {
130-
DEFAULT = 'default',
131-
ASPECTRATIO = 'aspectRatio',
132-
REGION = 'region',
133-
OFFSET = 'offset',
131+
DEFAULT = "default",
132+
ASPECTRATIO = "aspectRatio",
133+
REGION = "region",
134+
OFFSET = "offset",
134135
}
135136

136137
export enum QueryOperation {
137-
EQUALS = '',
138-
NOT_EQUALS = '$ne',
139-
INCLUDES = '$in',
140-
EXCLUDES = '$nin',
141-
IS_LESS_THAN = '$lt',
142-
IS_LESS_THAN_OR_EQUAL = '$lte',
143-
IS_GREATER_THAN = '$gt',
144-
IS_GREATER_THAN_OR_EQUAL = '$gte',
145-
EXISTS = '$exists',
146-
MATCHES = '$regex',
138+
EQUALS = "",
139+
NOT_EQUALS = "$ne",
140+
INCLUDES = "$in",
141+
EXCLUDES = "$nin",
142+
IS_LESS_THAN = "$lt",
143+
IS_LESS_THAN_OR_EQUAL = "$lte",
144+
IS_GREATER_THAN = "$gt",
145+
IS_GREATER_THAN_OR_EQUAL = "$gte",
146+
EXISTS = "$exists",
147+
MATCHES = "$regex",
147148
}
148149

149150
export enum TaxonomyQueryOperation {
150-
ABOVE = '$above',
151-
BELOW = '$below',
152-
EQ_ABOVE = '$eq_above',
153-
EQ_BELOW = '$eq_below'
151+
ABOVE = "$above",
152+
BELOW = "$below",
153+
EQ_ABOVE = "$eq_above",
154+
EQ_BELOW = "$eq_below",
154155
}
155156

156157
export type BaseQueryParameters = {
@@ -162,8 +163,8 @@ export type BaseQueryParameters = {
162163
};
163164

164165
export enum QueryOperator {
165-
AND = '$and',
166-
OR = '$or',
166+
AND = "$and",
167+
OR = "$or",
167168
}
168169

169170
export type PaginationObj = {
@@ -267,18 +268,18 @@ export interface FindResponse<T> {
267268
content_types?: T[];
268269
assets?: T[];
269270
global_fields?: T[];
270-
count?: number
271+
count?: number;
271272
}
272273

273274
export interface LivePreviewQuery {
274-
live_preview: string
275+
live_preview: string;
275276
include_applied_variants?: boolean;
276-
contentTypeUid?: string
277-
content_type_uid?: string
278-
entry_uid?: string
277+
contentTypeUid?: string;
278+
content_type_uid?: string;
279+
entry_uid?: string;
279280
entryUid?: any;
280-
preview_timestamp?: string
281-
release_id?: string
281+
preview_timestamp?: string;
282+
release_id?: string;
282283
}
283284

284285
export type LivePreview = {
@@ -290,4 +291,4 @@ export type LivePreview = {
290291
enable: boolean;
291292
management_token?: string;
292293
preview_token?: string;
293-
}
294+
};

0 commit comments

Comments
 (0)