Skip to content

Commit 31e8030

Browse files
Fixed merge conflits
1 parent 3b368fb commit 31e8030

File tree

124 files changed

+2632
-8479
lines changed

Some content is hidden

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

124 files changed

+2632
-8479
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ test-results/
2525
src/**/*.js
2626
src/**/*.js.map
2727

28+
# Compiled test artifacts (use .ts source only)
29+
test/api/**/*.js
30+
test/api/**/*.js.map
31+
2832
# Browser test bundle (generated)
2933
test/e2e/sdk-browser-bundle.js
3034
test/e2e/sdk-browser-bundle.js.map
@@ -42,4 +46,5 @@ test/docs/*.js
4246
test/docs/*.mjs
4347
test/docs/sanity-report*
4448
*.log
45-
.nx/
49+
.nx/
50+
delivery-sdk-persistence/

.talismanrc

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
fileignoreconfig:
2+
- filename: README.md
3+
checksum: b40240271f930e1c0db9bbcf78a55bf0d52d6caf0eb265eae94d1a2aecf442c5
4+
- filename: test/unit/error-messages.spec.ts
5+
checksum: 186390727b2488317c49f22955ade58b454d4c00c6b850bbb0617c30c59f8255
6+
- filename: src/common/types.ts
7+
checksum: 0466775043773ec966f10bac2eeed812274748fc275a1017ad51295dff5c58ca
8+
- filename: test/unit/contentstack.spec.ts
9+
checksum: 8f560efd9fba6e04682899eff3cc448d22c38019eac0a5ffcab35ba59f81da2c
10+
- filename: test/unit/cache.spec.ts
11+
checksum: a9bf179485c09e3821d78588a6bd2a57a70b68dd05948f7187c73d05b846b651
212
- filename: test/browser/import.spec.ts
313
checksum: 2e9a157e28b0ce71c4b6422c6b457996a2e6785a1ef591c8bb35276b3471a5d0
414
- filename: scripts/test-bundlers.js
@@ -13,21 +23,15 @@ fileignoreconfig:
1323
checksum: 6646595d48bfaec3d9de111b22b36cf0925b33e18df55b068181c0bb81c1862b
1424
- filename: test/browser/real-api-calls.spec.ts
1525
checksum: 514930cdde28cdc8b37ab054031260d5703dc8bdf777906dd5f9baa270ab7c3a
16-
- filename: package-lock.json
17-
checksum: e0a6679bfc6556fb7a8424c3f8eb0cec62f2cc871ad544f691fa064ddec30db7
1826
- filename: test/unit/utils.spec.ts
1927
checksum: a491df0a19c336ff5b18450fb23e26676a1798222100c946150e7a1b6504d953
20-
- filename: test/unit/contentstack.spec.ts
21-
checksum: d5b99c01459ab8bc597baaa9e6cc4aa91ac6d9bf78af08e1d0220d0c5db3d0b3
2228
- filename: test/unit/query-optimization-comprehensive.spec.ts
2329
checksum: f5aaf6c784d7c101a05ca513c584bbd6e95f963d1e42779f2596050d9bcbac96
24-
- filename: src/lib/entries.ts
30+
- filename: src/entries/entries.ts
2531
checksum: f6a19da15baed75062ad0cc599573ed08926e28fffe3f6e4890a0efb4d58c910
26-
- filename: src/lib/cache.ts
32+
- filename: src/cache/cache.ts
2733
checksum: d8d32089b8a4b247e4ba71c22b56cbb0a54440ebf35b102af222eb8032919f02
28-
- filename: test/unit/cache.spec.ts
29-
checksum: e96f913a466a1f4d55a422e7032fc2c06eeed5fea86cdcc86a05fbe3eba29b7a
30-
- filename: src/lib/query.ts
34+
- filename: src/query/query.ts
3135
checksum: 073c47e46755eb79d1d7e9fcaf2864296a218bf650888dd37c42480cce7df379
3236
- filename: test/api/retry-integration.spec.ts
3337
checksum: dc07b0a8111fd8e155b99f56c31ccdddd4f46c86f1b162b17d73e15dfed8e3c8
@@ -36,32 +40,26 @@ fileignoreconfig:
3640
- filename: package-lock.json
3741
checksum: 993afd503e9f5d399fac30ae230cb47538cec2c61c5364e88be72726fb723dda
3842
ignore_detectors: [ base64, filecontent ]
39-
- filename: src/lib/global-field.ts
43+
- filename: src/global-field/global-field.ts
4044
checksum: 70b9652bcba16ddc4d853ac212ad909a8ecfc76f491c55a05e4e3cdf9ce476b5
41-
- filename: src/lib/content-type.ts
45+
- filename: src/content-type/content-type.ts
4246
checksum: 1dc0fa53ae209efb67d68a01493822e9dec560799f8309329213dae69459655f
43-
- filename: src/lib/stack.ts
47+
- filename: src/stack/stack.ts
4448
checksum: 145dd6add876a771a9a6ba024f57ef2c4b46a911fe1bf3885a69cf1f6c9dd72d
45-
- filename: src/lib/entry.ts
49+
- filename: src/entries/entry.ts
4650
checksum: 1c64ccf19226873d068d6896028bfb74546c1cfd993779515bccfcc747180ca0
47-
- filename: src/lib/error-messages.ts
51+
- filename: src/common/error-messages.ts
4852
checksum: 3b960af19f3ba302522e912616b147b11d63dfe3f7ad2e0cf2de807815ee236a
49-
- filename: src/lib/global-field-query.ts
53+
- filename: src/query/global-field-query.ts
5054
checksum: 824c54061b80236380e776640e7f52f45164230bcc0ee88de302b30e9f83297f
51-
- filename: src/lib/base-query.ts
55+
- filename: src/query/base-query.ts
5256
checksum: 8d67435121581d43ba9c5f544daf30a0579b7faa7c8661000d8d37ddfc172112
5357
- filename: test/unit/base-query.spec.ts
5458
checksum: ceaceb1d65965b151edc9fc11d5a226460328b1913319994df51ca1b453cd6af
55-
- filename: src/lib/entries.ts
56-
checksum: 3ffe426234ef710d0fcfd8e41ca57f61ce6bc44298ee7dde6f4530fa3c16d2ee
57-
- filename: test/unit/error-messages.spec.ts
58-
checksum: b64be136b19890aa9e9000bac7df6eb1188828ee4b740d5c756396699716c428
5959
- filename: test/api/modular-blocks.spec.ts
6060
checksum: 1e536b0409f05f2d5c1d6e87b0ec4bda2c3fde9bc4ff331406f33464a26cff55
6161
- filename: test/unit/centralized-error-handling.spec.ts
6262
checksum: 66a5eb520414bd71da331338bfb4faa2fc9f233eadf0eb18ddd7915db6849238
63-
- filename: src/lib/query.ts
64-
checksum: f7200cb6e3b9ff681439482faaf882781dfb5f6ab6fefd4c98203ba8bf30d5e6
6563
- filename: test/api/base-query-casting.specs.ts
6664
checksum: 9185df498914e2966d78d9d216acaaa910d43cd7ac9a5e9a26e7241ac9edc9b5
6765
- filename: test/reporting/generate-unified-report.js

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
### Version: 5.1.0
2+
#### Date: Mar-02-2026
3+
Fix: Added support of asset fields in assets & entries class.
4+
5+
### Version: 5.0.1
6+
#### Date: feb-23-2026
7+
Fix: Added support of special symbols in regex method with safe pattern.
8+
9+
### Version: 5.0.0
10+
#### Date: Feb-16-2026
11+
Breaking: Cache persistence is now a separate plugin. When using a cache policy other than `IGNORE_CACHE`, you must pass `cacheOptions.persistenceStore`. Install `@contentstack/persistence-plugin` and use `new PersistenceStore({ ... })` as the store. The SDK no longer bundles persistence code or accepts `storeType` in `cacheOptions`.
12+
Enhancement: SDK defines only the `PersistenceStore` interface (getItem/setItem); full implementation lives in the plugin for a lighter core package.
13+
Fix: Sync API returns non-Axios response causing undefined data and recursive sync failure
14+
15+
### Version: 4.11.2
16+
#### Date: feb-11-2026
17+
Fix: JS core & axios version bump
18+
19+
20+
### Version: 4.11.2
21+
#### Date: feb-11-2026
22+
Fix: JS core & axios version bump
23+
24+
### Version: 4.11.1
25+
#### Date: Feb-09-2026
26+
Fix: Fix security issues
27+
128
### Version: 4.11.0
229
#### Date: Jan-19-2026
330
Enhancement: Integrated getContentstackEndpoint method of Utils SDK for endpoint selection

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The Typescript SDK can also be used to create Node.js and React native applicati
99

1010
### Prerequisite
1111

12-
You need Node.js version 4.4.7 or later installed to use the Contentstack JavaScript SDK.
12+
You need Node.js version 18 or later installed to use the Contentstack TypeScript SDK.
1313

1414
### Setup and Installation
1515

@@ -189,6 +189,35 @@ const pagedResult = await query
189189

190190
```
191191

192+
### Caching
193+
194+
To use cache policies (`CACHE_THEN_NETWORK`, `CACHE_ELSE_NETWORK`, `NETWORK_ELSE_CACHE`), you must provide a persistence store via `cacheOptions.persistenceStore`. Install the optional persistence plugin and pass a `PersistenceStore` instance:
195+
196+
```bash
197+
npm install @contentstack/persistence-plugin
198+
```
199+
200+
```typescript
201+
import contentstack, { Policy } from '@contentstack/delivery-sdk';
202+
import { PersistenceStore } from '@contentstack/persistence-plugin';
203+
204+
const stack = contentstack.stack({
205+
apiKey: 'your-api-key',
206+
deliveryToken: 'your-delivery-token',
207+
environment: 'your-environment',
208+
cacheOptions: {
209+
policy: Policy.CACHE_THEN_NETWORK,
210+
persistenceStore: new PersistenceStore({ storeType: 'localStorage', maxAge: 86400000 }),
211+
},
212+
});
213+
```
214+
215+
See [@contentstack/persistence-plugin](https://www.npmjs.com/package/@contentstack/persistence-plugin) for options (`storeType`, `maxAge`, custom storage).
216+
217+
### Development
218+
219+
When contributing or running tests from the repository, run `npm run build` before running tests. The published package includes a pre-built `dist/` directory.
220+
192221
### Helpful Links
193222

194223
- [Contentstack Website](https://www.contentstack.com)
@@ -197,7 +226,7 @@ const pagedResult = await query
197226

198227
### The MIT License (MIT)
199228

200-
Copyright © 2012-2025 [Contentstack](https://www.contentstack.com). All Rights Reserved
229+
Copyright © 2012-2026 [Contentstack](https://www.contentstack.com). All Rights Reserved
201230

202231
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
203232

config/tsconfig.cjs.json

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

config/tsconfig.decl-esm.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"emitDeclarationOnly": true,
6+
"module": "ESNext",
7+
"moduleResolution": "Bundler",
8+
"outDir": "../dist/modern",
9+
"rootDir": "../src"
10+
},
11+
"include": ["../src/**/*.ts"],
12+
"exclude": ["node_modules", "**/*.test.ts", "**/__test__"]
13+
}

config/tsconfig.esm.json

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

config/tsconfig.types.json

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

config/tsconfig.umd.json

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

config/webpack.config.js

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

0 commit comments

Comments
 (0)