@contentstack/delivery-sdk 5.1.1 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var core = require('@contentstack/core');
3
+ var baseQuery = require('./base-query.cjs');
4
4
 
5
- var __defProp = Object.defineProperty;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
- class ContentTypeQuery {
5
+ class ContentTypeQuery extends baseQuery.BaseQuery {
9
6
  constructor(client) {
10
- __publicField(this, "_client");
11
- __publicField(this, "_urlPath");
12
- __publicField(this, "_queryParams", {});
7
+ super();
13
8
  this._client = client;
14
9
  this._urlPath = "/content_types";
15
10
  }
@@ -29,22 +24,6 @@ class ContentTypeQuery {
29
24
  this._queryParams.include_global_field_schema = "true";
30
25
  return this;
31
26
  }
32
- /**
33
- * @method find
34
- * @memberof ContentTypeQuery
35
- * @description Fetches all contentTypes of the stack
36
- * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types
37
- * @example
38
- * import contentstack from '@contentstack/delivery-sdk'
39
- *
40
- * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
41
- * const contentTypeQuery = stack.contentType();
42
- * const result = await contentTypeQuery.find();
43
- */
44
- async find() {
45
- const response = await core.getData(this._client, this._urlPath, { params: this._queryParams });
46
- return response;
47
- }
48
27
  }
49
28
 
50
29
  exports.ContentTypeQuery = ContentTypeQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"contenttype-query.cjs","sources":["../../../src/query/contenttype-query.ts"],"sourcesContent":["import { AxiosInstance, getData } from '@contentstack/core';\nimport { FindResponse } from '../common/types';\n\nexport class ContentTypeQuery {\n private _client: AxiosInstance;\n private _urlPath: string;\n _queryParams: { [key: string]: string | number } = {};\n\n constructor(client: AxiosInstance) {\n this._client = client;\n this._urlPath = '/content_types';\n }\n /**\n * @method includeGlobalFieldSchema\n * @memberof ContentTypeQuery\n * @description Includes the global field schema in the content type response\n * @returns {ContentTypeQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.includeGlobalFieldSchema().find();\n */\n includeGlobalFieldSchema(): this {\n this._queryParams.include_global_field_schema = 'true';\n\n return this;\n }\n /**\n * @method find\n * @memberof ContentTypeQuery\n * @description Fetches all contentTypes of the stack\n * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.find();\n */\n async find<T>(): Promise<FindResponse<T>> {\n const response = await getData(this._client, this._urlPath, { params: this._queryParams });\n\n return response as FindResponse<T>;\n }\n}\n"],"names":["getData"],"mappings":";;;;;;;AAGO,MAAM,gBAAiB,CAAA;AAAA,EAK5B,YAAY,MAAuB,EAAA;AAJnC,IAAQ,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACR,IAAQ,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA,CAAA;AACR,IAAA,aAAA,CAAA,IAAA,EAAA,cAAA,EAAmD,EAAC,CAAA,CAAA;AAGlD,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,gBAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,wBAAiC,GAAA;AAC/B,IAAA,IAAA,CAAK,aAAa,2BAA8B,GAAA,MAAA,CAAA;AAEhD,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,IAAoC,GAAA;AACxC,IAAM,MAAA,QAAA,GAAW,MAAMA,YAAA,CAAQ,IAAK,CAAA,OAAA,EAAS,IAAK,CAAA,QAAA,EAAU,EAAE,MAAA,EAAQ,IAAK,CAAA,YAAA,EAAc,CAAA,CAAA;AAEzF,IAAO,OAAA,QAAA,CAAA;AAAA,GACT;AACF;;;;"}
1
+ {"version":3,"file":"contenttype-query.cjs","sources":["../../../src/query/contenttype-query.ts"],"sourcesContent":["import { BaseQuery } from './base-query';\nimport { AxiosInstance } from '@contentstack/core';\n\nexport class ContentTypeQuery extends BaseQuery {\n constructor(client: AxiosInstance) {\n super();\n this._client = client;\n this._urlPath = '/content_types';\n }\n\n /**\n * @method includeGlobalFieldSchema\n * @memberof ContentTypeQuery\n * @description Includes the global field schema in the content type response\n * @returns {ContentTypeQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.includeGlobalFieldSchema().find();\n */\n includeGlobalFieldSchema(): this {\n this._queryParams.include_global_field_schema = 'true';\n\n return this;\n }\n}\n"],"names":["BaseQuery"],"mappings":";;;;AAGO,MAAM,yBAAyBA,mBAAU,CAAA;AAAA,EAC9C,YAAY,MAAuB,EAAA;AACjC,IAAM,KAAA,EAAA,CAAA;AACN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,gBAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,wBAAiC,GAAA;AAC/B,IAAA,IAAA,CAAK,aAAa,2BAA8B,GAAA,MAAA,CAAA;AAEhD,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACF;;;;"}
@@ -1,13 +1,8 @@
1
- import { getData } from '@contentstack/core';
1
+ import { BaseQuery } from './base-query.js';
2
2
 
3
- var __defProp = Object.defineProperty;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
- class ContentTypeQuery {
3
+ class ContentTypeQuery extends BaseQuery {
7
4
  constructor(client) {
8
- __publicField(this, "_client");
9
- __publicField(this, "_urlPath");
10
- __publicField(this, "_queryParams", {});
5
+ super();
11
6
  this._client = client;
12
7
  this._urlPath = "/content_types";
13
8
  }
@@ -27,22 +22,6 @@ class ContentTypeQuery {
27
22
  this._queryParams.include_global_field_schema = "true";
28
23
  return this;
29
24
  }
30
- /**
31
- * @method find
32
- * @memberof ContentTypeQuery
33
- * @description Fetches all contentTypes of the stack
34
- * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types
35
- * @example
36
- * import contentstack from '@contentstack/delivery-sdk'
37
- *
38
- * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
39
- * const contentTypeQuery = stack.contentType();
40
- * const result = await contentTypeQuery.find();
41
- */
42
- async find() {
43
- const response = await getData(this._client, this._urlPath, { params: this._queryParams });
44
- return response;
45
- }
46
25
  }
47
26
 
48
27
  export { ContentTypeQuery };
@@ -1 +1 @@
1
- {"version":3,"file":"contenttype-query.js","sources":["../../../src/query/contenttype-query.ts"],"sourcesContent":["import { AxiosInstance, getData } from '@contentstack/core';\nimport { FindResponse } from '../common/types';\n\nexport class ContentTypeQuery {\n private _client: AxiosInstance;\n private _urlPath: string;\n _queryParams: { [key: string]: string | number } = {};\n\n constructor(client: AxiosInstance) {\n this._client = client;\n this._urlPath = '/content_types';\n }\n /**\n * @method includeGlobalFieldSchema\n * @memberof ContentTypeQuery\n * @description Includes the global field schema in the content type response\n * @returns {ContentTypeQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.includeGlobalFieldSchema().find();\n */\n includeGlobalFieldSchema(): this {\n this._queryParams.include_global_field_schema = 'true';\n\n return this;\n }\n /**\n * @method find\n * @memberof ContentTypeQuery\n * @description Fetches all contentTypes of the stack\n * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.find();\n */\n async find<T>(): Promise<FindResponse<T>> {\n const response = await getData(this._client, this._urlPath, { params: this._queryParams });\n\n return response as FindResponse<T>;\n }\n}\n"],"names":[],"mappings":";;;;;AAGO,MAAM,gBAAiB,CAAA;AAAA,EAK5B,YAAY,MAAuB,EAAA;AAJnC,IAAQ,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACR,IAAQ,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA,CAAA;AACR,IAAA,aAAA,CAAA,IAAA,EAAA,cAAA,EAAmD,EAAC,CAAA,CAAA;AAGlD,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,gBAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,wBAAiC,GAAA;AAC/B,IAAA,IAAA,CAAK,aAAa,2BAA8B,GAAA,MAAA,CAAA;AAEhD,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,IAAoC,GAAA;AACxC,IAAM,MAAA,QAAA,GAAW,MAAM,OAAA,CAAQ,IAAK,CAAA,OAAA,EAAS,IAAK,CAAA,QAAA,EAAU,EAAE,MAAA,EAAQ,IAAK,CAAA,YAAA,EAAc,CAAA,CAAA;AAEzF,IAAO,OAAA,QAAA,CAAA;AAAA,GACT;AACF;;;;"}
1
+ {"version":3,"file":"contenttype-query.js","sources":["../../../src/query/contenttype-query.ts"],"sourcesContent":["import { BaseQuery } from './base-query';\nimport { AxiosInstance } from '@contentstack/core';\n\nexport class ContentTypeQuery extends BaseQuery {\n constructor(client: AxiosInstance) {\n super();\n this._client = client;\n this._urlPath = '/content_types';\n }\n\n /**\n * @method includeGlobalFieldSchema\n * @memberof ContentTypeQuery\n * @description Includes the global field schema in the content type response\n * @returns {ContentTypeQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.includeGlobalFieldSchema().find();\n */\n includeGlobalFieldSchema(): this {\n this._queryParams.include_global_field_schema = 'true';\n\n return this;\n }\n}\n"],"names":[],"mappings":";;AAGO,MAAM,yBAAyB,SAAU,CAAA;AAAA,EAC9C,YAAY,MAAuB,EAAA;AACjC,IAAM,KAAA,EAAA,CAAA;AACN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,gBAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,wBAAiC,GAAA;AAC/B,IAAA,IAAA,CAAK,aAAa,2BAA8B,GAAA,MAAA,CAAA;AAEhD,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACF;;;;"}
@@ -1,12 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var core = require('@contentstack/core');
3
+ var baseQuery = require('./base-query.cjs');
4
4
 
5
- class ContentTypeQuery {
6
- _client;
7
- _urlPath;
8
- _queryParams = {};
5
+ class ContentTypeQuery extends baseQuery.BaseQuery {
9
6
  constructor(client) {
7
+ super();
10
8
  this._client = client;
11
9
  this._urlPath = "/content_types";
12
10
  }
@@ -26,22 +24,6 @@ class ContentTypeQuery {
26
24
  this._queryParams.include_global_field_schema = "true";
27
25
  return this;
28
26
  }
29
- /**
30
- * @method find
31
- * @memberof ContentTypeQuery
32
- * @description Fetches all contentTypes of the stack
33
- * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types
34
- * @example
35
- * import contentstack from '@contentstack/delivery-sdk'
36
- *
37
- * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
38
- * const contentTypeQuery = stack.contentType();
39
- * const result = await contentTypeQuery.find();
40
- */
41
- async find() {
42
- const response = await core.getData(this._client, this._urlPath, { params: this._queryParams });
43
- return response;
44
- }
45
27
  }
46
28
 
47
29
  exports.ContentTypeQuery = ContentTypeQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"contenttype-query.cjs","sources":["../../../src/query/contenttype-query.ts"],"sourcesContent":["import { AxiosInstance, getData } from '@contentstack/core';\nimport { FindResponse } from '../common/types';\n\nexport class ContentTypeQuery {\n private _client: AxiosInstance;\n private _urlPath: string;\n _queryParams: { [key: string]: string | number } = {};\n\n constructor(client: AxiosInstance) {\n this._client = client;\n this._urlPath = '/content_types';\n }\n /**\n * @method includeGlobalFieldSchema\n * @memberof ContentTypeQuery\n * @description Includes the global field schema in the content type response\n * @returns {ContentTypeQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.includeGlobalFieldSchema().find();\n */\n includeGlobalFieldSchema(): this {\n this._queryParams.include_global_field_schema = 'true';\n\n return this;\n }\n /**\n * @method find\n * @memberof ContentTypeQuery\n * @description Fetches all contentTypes of the stack\n * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.find();\n */\n async find<T>(): Promise<FindResponse<T>> {\n const response = await getData(this._client, this._urlPath, { params: this._queryParams });\n\n return response as FindResponse<T>;\n }\n}\n"],"names":["getData"],"mappings":";;;;AAGO,MAAM,gBAAiB,CAAA;AAAA,EACpB,OAAA,CAAA;AAAA,EACA,QAAA,CAAA;AAAA,EACR,eAAmD,EAAC,CAAA;AAAA,EAEpD,YAAY,MAAuB,EAAA;AACjC,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,gBAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,wBAAiC,GAAA;AAC/B,IAAA,IAAA,CAAK,aAAa,2BAA8B,GAAA,MAAA,CAAA;AAEhD,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,IAAoC,GAAA;AACxC,IAAM,MAAA,QAAA,GAAW,MAAMA,YAAA,CAAQ,IAAK,CAAA,OAAA,EAAS,IAAK,CAAA,QAAA,EAAU,EAAE,MAAA,EAAQ,IAAK,CAAA,YAAA,EAAc,CAAA,CAAA;AAEzF,IAAO,OAAA,QAAA,CAAA;AAAA,GACT;AACF;;;;"}
1
+ {"version":3,"file":"contenttype-query.cjs","sources":["../../../src/query/contenttype-query.ts"],"sourcesContent":["import { BaseQuery } from './base-query';\nimport { AxiosInstance } from '@contentstack/core';\n\nexport class ContentTypeQuery extends BaseQuery {\n constructor(client: AxiosInstance) {\n super();\n this._client = client;\n this._urlPath = '/content_types';\n }\n\n /**\n * @method includeGlobalFieldSchema\n * @memberof ContentTypeQuery\n * @description Includes the global field schema in the content type response\n * @returns {ContentTypeQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.includeGlobalFieldSchema().find();\n */\n includeGlobalFieldSchema(): this {\n this._queryParams.include_global_field_schema = 'true';\n\n return this;\n }\n}\n"],"names":["BaseQuery"],"mappings":";;;;AAGO,MAAM,yBAAyBA,mBAAU,CAAA;AAAA,EAC9C,YAAY,MAAuB,EAAA;AACjC,IAAM,KAAA,EAAA,CAAA;AACN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,gBAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,wBAAiC,GAAA;AAC/B,IAAA,IAAA,CAAK,aAAa,2BAA8B,GAAA,MAAA,CAAA;AAEhD,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACF;;;;"}
@@ -1,11 +1,6 @@
1
+ import { BaseQuery } from './base-query';
1
2
  import { AxiosInstance } from '@contentstack/core';
2
- import { FindResponse } from '../common/types';
3
- export declare class ContentTypeQuery {
4
- private _client;
5
- private _urlPath;
6
- _queryParams: {
7
- [key: string]: string | number;
8
- };
3
+ export declare class ContentTypeQuery extends BaseQuery {
9
4
  constructor(client: AxiosInstance);
10
5
  /**
11
6
  * @method includeGlobalFieldSchema
@@ -20,18 +15,5 @@ export declare class ContentTypeQuery {
20
15
  * const result = await contentTypeQuery.includeGlobalFieldSchema().find();
21
16
  */
22
17
  includeGlobalFieldSchema(): this;
23
- /**
24
- * @method find
25
- * @memberof ContentTypeQuery
26
- * @description Fetches all contentTypes of the stack
27
- * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types
28
- * @example
29
- * import contentstack from '@contentstack/delivery-sdk'
30
- *
31
- * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
32
- * const contentTypeQuery = stack.contentType();
33
- * const result = await contentTypeQuery.find();
34
- */
35
- find<T>(): Promise<FindResponse<T>>;
36
18
  }
37
19
  //# sourceMappingURL=contenttype-query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contenttype-query.d.ts","sourceRoot":"","sources":["../../../src/query/contenttype-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAW,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,QAAQ,CAAS;IACzB,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,CAAM;gBAE1C,MAAM,EAAE,aAAa;IAIjC;;;;;;;;;;;OAWG;IACH,wBAAwB,IAAI,IAAI;IAKhC;;;;;;;;;;;OAWG;IACG,IAAI,CAAC,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAK1C"}
1
+ {"version":3,"file":"contenttype-query.d.ts","sourceRoot":"","sources":["../../../src/query/contenttype-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAa,gBAAiB,SAAQ,SAAS;gBACjC,MAAM,EAAE,aAAa;IAMjC;;;;;;;;;;;OAWG;IACH,wBAAwB,IAAI,IAAI;CAKjC"}
@@ -1,10 +1,8 @@
1
- import { getData } from '@contentstack/core';
1
+ import { BaseQuery } from './base-query.js';
2
2
 
3
- class ContentTypeQuery {
4
- _client;
5
- _urlPath;
6
- _queryParams = {};
3
+ class ContentTypeQuery extends BaseQuery {
7
4
  constructor(client) {
5
+ super();
8
6
  this._client = client;
9
7
  this._urlPath = "/content_types";
10
8
  }
@@ -24,22 +22,6 @@ class ContentTypeQuery {
24
22
  this._queryParams.include_global_field_schema = "true";
25
23
  return this;
26
24
  }
27
- /**
28
- * @method find
29
- * @memberof ContentTypeQuery
30
- * @description Fetches all contentTypes of the stack
31
- * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types
32
- * @example
33
- * import contentstack from '@contentstack/delivery-sdk'
34
- *
35
- * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
36
- * const contentTypeQuery = stack.contentType();
37
- * const result = await contentTypeQuery.find();
38
- */
39
- async find() {
40
- const response = await getData(this._client, this._urlPath, { params: this._queryParams });
41
- return response;
42
- }
43
25
  }
44
26
 
45
27
  export { ContentTypeQuery };
@@ -1 +1 @@
1
- {"version":3,"file":"contenttype-query.js","sources":["../../../src/query/contenttype-query.ts"],"sourcesContent":["import { AxiosInstance, getData } from '@contentstack/core';\nimport { FindResponse } from '../common/types';\n\nexport class ContentTypeQuery {\n private _client: AxiosInstance;\n private _urlPath: string;\n _queryParams: { [key: string]: string | number } = {};\n\n constructor(client: AxiosInstance) {\n this._client = client;\n this._urlPath = '/content_types';\n }\n /**\n * @method includeGlobalFieldSchema\n * @memberof ContentTypeQuery\n * @description Includes the global field schema in the content type response\n * @returns {ContentTypeQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.includeGlobalFieldSchema().find();\n */\n includeGlobalFieldSchema(): this {\n this._queryParams.include_global_field_schema = 'true';\n\n return this;\n }\n /**\n * @method find\n * @memberof ContentTypeQuery\n * @description Fetches all contentTypes of the stack\n * @returns {Promise<FindResponse<T>>} Promise that resolves to the find response containing content types\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.find();\n */\n async find<T>(): Promise<FindResponse<T>> {\n const response = await getData(this._client, this._urlPath, { params: this._queryParams });\n\n return response as FindResponse<T>;\n }\n}\n"],"names":[],"mappings":";;AAGO,MAAM,gBAAiB,CAAA;AAAA,EACpB,OAAA,CAAA;AAAA,EACA,QAAA,CAAA;AAAA,EACR,eAAmD,EAAC,CAAA;AAAA,EAEpD,YAAY,MAAuB,EAAA;AACjC,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,gBAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,wBAAiC,GAAA;AAC/B,IAAA,IAAA,CAAK,aAAa,2BAA8B,GAAA,MAAA,CAAA;AAEhD,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,IAAoC,GAAA;AACxC,IAAM,MAAA,QAAA,GAAW,MAAM,OAAA,CAAQ,IAAK,CAAA,OAAA,EAAS,IAAK,CAAA,QAAA,EAAU,EAAE,MAAA,EAAQ,IAAK,CAAA,YAAA,EAAc,CAAA,CAAA;AAEzF,IAAO,OAAA,QAAA,CAAA;AAAA,GACT;AACF;;;;"}
1
+ {"version":3,"file":"contenttype-query.js","sources":["../../../src/query/contenttype-query.ts"],"sourcesContent":["import { BaseQuery } from './base-query';\nimport { AxiosInstance } from '@contentstack/core';\n\nexport class ContentTypeQuery extends BaseQuery {\n constructor(client: AxiosInstance) {\n super();\n this._client = client;\n this._urlPath = '/content_types';\n }\n\n /**\n * @method includeGlobalFieldSchema\n * @memberof ContentTypeQuery\n * @description Includes the global field schema in the content type response\n * @returns {ContentTypeQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const contentTypeQuery = stack.contentType();\n * const result = await contentTypeQuery.includeGlobalFieldSchema().find();\n */\n includeGlobalFieldSchema(): this {\n this._queryParams.include_global_field_schema = 'true';\n\n return this;\n }\n}\n"],"names":[],"mappings":";;AAGO,MAAM,yBAAyB,SAAU,CAAA;AAAA,EAC9C,YAAY,MAAuB,EAAA;AACjC,IAAM,KAAA,EAAA,CAAA;AACN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,gBAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,wBAAiC,GAAA;AAC/B,IAAA,IAAA,CAAK,aAAa,2BAA8B,GAAA,MAAA,CAAA;AAEhD,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/delivery-sdk",
3
- "version": "5.1.1",
3
+ "version": "5.2.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -47,9 +47,9 @@
47
47
  "prerelease": "npm run test:all && npm run validate:all"
48
48
  },
49
49
  "dependencies": {
50
- "@contentstack/core": "^1.3.10",
51
- "@contentstack/utils": "^1.7.0",
52
- "axios": "^1.13.5",
50
+ "@contentstack/core": "^1.3.11",
51
+ "@contentstack/utils": "^1.8.0",
52
+ "axios": "^1.15.0",
53
53
  "humps": "^2.0.1"
54
54
  },
55
55
  "files": [
@@ -58,8 +58,8 @@
58
58
  "README.md"
59
59
  ],
60
60
  "devDependencies": {
61
- "@playwright/test": "^1.57.0",
62
- "@slack/bolt": "^4.4.0",
61
+ "@playwright/test": "^1.58.2",
62
+ "@slack/bolt": "^4.6.0",
63
63
  "@types/humps": "^2.0.6",
64
64
  "@types/jest": "^29.5.14",
65
65
  "@types/node-localstorage": "^1.3.3",
@@ -67,9 +67,9 @@
67
67
  "babel-jest": "^29.7.0",
68
68
  "dotenv": "^16.6.1",
69
69
  "@rollup/plugin-commonjs": "^27.0.0",
70
- "@rollup/plugin-node-resolve": "^15.0.0",
71
- "@rollup/plugin-replace": "^5.0.2",
72
- "rollup": "^3.29.0",
70
+ "@rollup/plugin-node-resolve": "^15.3.1",
71
+ "@rollup/plugin-replace": "^5.0.7",
72
+ "rollup": "^3.30.0",
73
73
  "rollup-plugin-esbuild": "^5.0.0",
74
74
  "http-server": "^14.1.1",
75
75
  "husky": "^9.1.7",
@@ -78,8 +78,8 @@
78
78
  "jest-html-reporter": "^3.10.2",
79
79
  "jest-html-reporters": "^3.1.7",
80
80
  "jest-junit": "^16.0.0",
81
- "ts-jest": "^29.2.6",
82
- "typescript": "~5.7.2",
81
+ "ts-jest": "^29.4.6",
82
+ "typescript": "~5.7.3",
83
83
  "ts-node": "^10.9.2"
84
84
  },
85
85
  "homepage": "https://github.com/contentstack/contentstack-typescript"