Skip to content

Commit bdfc491

Browse files
committed
Plugin Definition and Cache issue resolve
1 parent 5ea25b0 commit bdfc491

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

index.d.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for contentstack 3.12.2
1+
// Type definitions for contentstack v3.12.2 and above
22
// Project: https://www.contentstack.com/
33
// Definitions by: Contentstack <https://github.com/contentstack>
44
import { EntryEmbedable, Option, RenderOption } from '@contentstack/utils'
@@ -52,8 +52,8 @@ export interface Config {
5252
region?: Region;
5353
branch?: string;
5454
live_preview?: LivePreview;
55-
fetchOptions?: FetchOptions;
5655
plugins?: ContentstackPlugin[];
56+
fetchOptions?: FetchOptions;
5757
}
5858
// Stack Config
5959
export interface StackConfig {
@@ -64,7 +64,7 @@ export interface StackConfig {
6464
}
6565

6666
// ContentTypeCollection
67-
export interface ContentTypeCollection{
67+
export interface ContentTypeCollection {
6868
content_types: Array<any>
6969
count?: number
7070
}
@@ -97,8 +97,13 @@ export interface FetchOptions {
9797

9898
//Plugins
9999
export interface ContentstackPlugin {
100-
onRequest(stack: Stack, request:any): void;
101-
onResponse(stack: Stack, request: {url:string, headers: object}, response: any, data: any): any;
100+
onRequest(stack: Stack, request: ContentstackPlugin): void;
101+
onResponse(stack: Stack, request: ContentstackPlugin, response: any, data: any): any;
102+
}
103+
104+
export interface ContentstackRequest {
105+
url: string;
106+
headers: object;
102107
}
103108

104109
// Stack

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "contentstack",
3-
"version": "3.15.5",
3+
"version": "3.16.0",
44
"description": "Contentstack Javascript SDK",
55
"homepage": "https://www.contentstack.com/",
66
"author": {
@@ -11,7 +11,7 @@
1111
"browser": "dist/web/contentstack.js",
1212
"react-native": "dist/react-native/contentstack.js",
1313
"types": "./index.d.ts",
14-
"_id": "contentstack@3.15.5",
14+
"_id": "contentstack@3.16.0",
1515
"scripts": {
1616
"test": "npm run test:e2e && npm run test:typescript",
1717
"test:e2e": "tape test/index.js | tap-html --out ./tap-html.html",
@@ -55,11 +55,11 @@
5555
],
5656
"dist": {
5757
"shasum": "a328ed07240476a26b31a23261355dc929e1da63",
58-
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.15.5.tgz"
58+
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.16.0.tgz"
5959
},
6060
"license": "MIT",
6161
"directories": {},
62-
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.15.5.tgz",
62+
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.16.0.tgz",
6363
"_npmOperationalInternal": {
6464
"host": "packages-18-east.internal.npmjs.com",
6565
"tmp": "tmp/contentstack-3.15.0.tgz_1477830884275_0.9869455888401717"

src/core/lib/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ export function sendRequest(queryObject, options) {
347347
if (err || !_data) {
348348
callback(true, resolve, reject);
349349
} else {
350+
const originalData = JSON.parse(JSON.stringify(_data));
350351
try {
351352

352353
const doesQueryRequestForReferences =
@@ -390,7 +391,7 @@ export function sendRequest(queryObject, options) {
390391

391392
await self.provider.set(
392393
hashQuery,
393-
_data,
394+
originalData,
394395
function (err) {
395396
try {
396397

src/core/modules/entry.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,6 @@ export default class Entry {
271271
return this;
272272
}
273273

274-
/**
275-
* @method includeOwner
276-
* @memberOf Entry
277-
* @description Includes the owner details of the entry/entries
278-
* @example stack.ContentType(contentType_uid).Entry(entry_uid).includeOwner().fetch()
279-
* @returns {Entry}
280-
* @instance
281-
*/
282274
includeOwner() {
283275
this._query['include_owner'] = true;
284276
return this;

0 commit comments

Comments
 (0)