Skip to content

Commit a81d173

Browse files
committed
Fixed Doc string
1 parent a505458 commit a81d173

File tree

7 files changed

+35
-41
lines changed

7 files changed

+35
-41
lines changed

src/lib/asset-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class AssetQuery extends BaseQuery {
135135
* import contentstack from '@contentstack/delivery-sdk'
136136
*
137137
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
138-
* const result = await stack.asset().query().where('fieldUid', queryOperators, 'value').find();
138+
* const result = await stack.asset().query().where('fieldUid', QueryOperation.EQUALS, 'value').find();
139139
*/
140140
query() {
141141
return new Query(this._client, this._parameters, this._queryParams);

src/lib/base-query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class BaseQuery extends Pagination {
5151
* const query = stack.contentType("contentTypeUid").entry().query();
5252
* const result = await query.orderByAscending("field_uid").find()
5353
* // OR
54-
* const asset = await stack.asset().orderByAscending().find()
54+
* const asset = await stack.asset().orderByAscending("field_uid").find()
5555
*
5656
* @returns {Query}
5757
*/
@@ -72,7 +72,7 @@ export class BaseQuery extends Pagination {
7272
* const query = stack.contentType("contentTypeUid").entry().query();
7373
* const result = await query.orderByDescending("field_uid").find()
7474
* // OR
75-
* const asset = await stack.asset().orderByDescending().find()
75+
* const asset = await stack.asset().orderByDescending("field_uid").find()
7676
*
7777
* @returns {Query}
7878
*/
@@ -91,7 +91,7 @@ export class BaseQuery extends Pagination {
9191
*
9292
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
9393
* const query = stack.contentType("contentTypeUid").entry().query();
94-
* const result = await query.limit("limit_value").find()
94+
* const result = await query.limit(10).find()
9595
* // OR
9696
* const asset = await stack.asset().limit(5).find()
9797
*
@@ -112,7 +112,7 @@ export class BaseQuery extends Pagination {
112112
*
113113
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
114114
* const query = stack.contentType("contentTypeUid").entry().query();
115-
* const result = await query.skip("skip_value").find()
115+
* const result = await query.skip(10).find()
116116
* // OR
117117
* const asset = await stack.asset().skip(5).find()
118118
*

src/lib/contentstack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let version = '{{VERSION}}';
3030
* policy: Policy.CACHE_THEN_NETWORK,
3131
* storeType: 'localStorage'
3232
* }
33-
* }
33+
* });
3434
*/
3535
// eslint-disable-next-line @typescript-eslint/naming-convention
3636
export function stack(config: StackConfig): StackClass {

src/lib/entries.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ export class Entries extends BaseQuery {
137137
* import contentstack from '@contentstack/delivery-sdk'
138138
*
139139
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
140-
* const query = stack.contentType("contentTypeUid").entry().includeReference("brand")
141-
* const res = await query.find()
140+
* const entries = stack.contentType("contentTypeUid").entry().includeReference("brand")
141+
* const result = await entries.find()
142142
*
143143
* @param {string} referenceFieldUid - UID of the reference field to include.
144144
* @returns {Entries} - Returns the Entries instance for chaining.
@@ -165,8 +165,8 @@ export class Entries extends BaseQuery {
165165
* import contentstack from '@contentstack/delivery-sdk'
166166
*
167167
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
168-
* const query = stack.contentType("contentTypeUid").entry().includeReferenceContentTypeUID()
169-
* const res = await query.find()
168+
* const entries = stack.contentType("contentTypeUid").entry().includeReferenceContentTypeUID()
169+
* const result = await entries.find()
170170
*
171171
* @returns {Entries} - Returns the Entries instance for chaining.
172172
*/
@@ -184,8 +184,8 @@ export class Entries extends BaseQuery {
184184
* import contentstack from '@contentstack/delivery-sdk'
185185
*
186186
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
187-
* const query = stack.contentType("contentTypeUid").entry().includeSchema()
188-
* const res = await query.find()
187+
* const entries = stack.contentType("contentTypeUid").entry().includeSchema()
188+
* const result = await entries.find()
189189
*
190190
* @returns {Entries} - Returns the Entries instance for chaining.
191191
*/
@@ -248,7 +248,7 @@ export class Entries extends BaseQuery {
248248
* import contentstack from '@contentstack/delivery-sdk'
249249
*
250250
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
251-
* const result = await stack.contentType("contentTypeUid").entry().query();
251+
* const query = stack.contentType("contentTypeUid").entry().query();
252252
*/
253253
query(queryObj?: { [key: string]: any }) {
254254
if (queryObj) return new Query(this._client, this._parameters, this._queryParams, this._variants, this._contentTypeUid, queryObj);

src/lib/entry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class Entry {
100100
* import contentstack from '@contentstack/delivery-sdk'
101101
*
102102
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
103-
* const query = stack.contentType("contentTypeUid").entry(entry_uid).includeReference("brand").fetch()
103+
* const result = await stack.contentType("contentTypeUid").entry(entry_uid).includeReference("brand").fetch()
104104
*
105105
* @param {string} referenceFieldUid - UID of the reference field to include.
106106
* @returns {Entry} - Returns the Entry instance for chaining.

src/lib/query.ts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class Query extends BaseQuery {
5757
* const query = stack.contentType("contentTypeUid").entry().query();
5858
* const result = await query.where("field_UID", QueryOperation.IS_LESS_THAN, ["field1", "field2"]).find()
5959
* // OR
60-
* const asset = await stack.asset().where("field_UID", QueryOperation.IS_LESS_THAN, ["field1", "field2"]).find()
60+
* const asset = await stack.asset().query().where("field_UID", QueryOperation.IS_LESS_THAN, ["field1", "field2"]).find()
6161
* @example
6262
* import contentstack from '@contentstack/delivery-sdk'
6363
*
@@ -128,7 +128,7 @@ export class Query extends BaseQuery {
128128
* const query = stack.contentType("contentTypeUid").entry().query();
129129
* const subQuery = stack.contentType("referencedContentTypeUid").entry().query().where("title", QueryOperation.EQUALS, "value");
130130
* query.whereIn("brand", subQuery)
131-
* const res = await query.find()
131+
* const result = await query.find()
132132
*
133133
* @param {string} referenceUid - UID of the reference field to query.
134134
* @param {Query} queryInstance - The Query instance to include in the where clause.
@@ -156,7 +156,7 @@ export class Query extends BaseQuery {
156156
* const query = stack.contentType("contentTypeUid").entry().query();
157157
* const subQuery = stack.contentType("referencedContentTypeUid").entry().query().where("title", QueryOperation.EQUALS, "value");
158158
* query.whereNotIn("brand", subQuery)
159-
* const res = await query.find()
159+
* const result = await query.find()
160160
*
161161
* @param {string} referenceUid - UID of the reference field to query.
162162
* @param {Query} queryInstance - The Query instance to include in the where clause.
@@ -184,7 +184,7 @@ export class Query extends BaseQuery {
184184
* const subQuery1 = stack.contentType("contentType2Uid").entry().query().where("price", QueryOperation.IS_LESS_THAN, 90);
185185
* const subQuery2 = stack.contentType("contentType3Uid").entry().query().where("discount", QueryOperation.INCLUDES, [20, 45]);
186186
* query.queryOperator(QueryOperator.AND, subQuery1, subQuery2)
187-
* const res = await query.find()
187+
* const result = await query.find()
188188
*
189189
* @param {QueryOperator} queryType - The type of query operator to apply.
190190
* @param {...Query[]} queryObjects - The Query instances to apply the query to.
@@ -214,7 +214,7 @@ export class Query extends BaseQuery {
214214
* const assetQuery = stack.asset().query();
215215
* const assetResult = assetQuery.getQuery()
216216
*
217-
* @returns {Query}
217+
* @returns {{ [key: string]: any }} The raw query object
218218
*/
219219
getQuery(): { [key: string]: any } {
220220
return this._parameters;
@@ -333,7 +333,7 @@ export class Query extends BaseQuery {
333333
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
334334
* const query1 = stack.contentType('contenttype_uid').entry().query().containedIn('fieldUID', ['value']);
335335
* const query2 = stack.contentType('contenttype_uid').entry().query().where('fieldUID', QueryOperation.EQUALS, 'value2');
336-
* const query = await stack.contentType('contenttype_uid').entry().query().or(query1, query2).find();
336+
* const result = await stack.contentType('contenttype_uid').entry().query().or(query1, query2).find();
337337
*
338338
* @returns {Query}
339339
*/
@@ -357,7 +357,7 @@ export class Query extends BaseQuery {
357357
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
358358
* const query1 = stack.contentType('contenttype_uid').entry().query().containedIn('fieldUID', ['value']);
359359
* const query2 = stack.contentType('contenttype_uid').entry().query().where('fieldUID', QueryOperation.EQUALS, 'value2');
360-
* const query = await stack.contentType('contenttype_uid').entry().query().and(query1, query2).find();
360+
* const result = await stack.contentType('contenttype_uid').entry().query().and(query1, query2).find();
361361
*
362362
* @returns {Query}
363363
*/
@@ -380,7 +380,7 @@ export class Query extends BaseQuery {
380380
* import contentstack from '@contentstack/delivery-sdk'
381381
*
382382
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
383-
* const query = await stack.contentType('contenttype_uid').entry().query().equalTo('fieldUid', 'value').find();
383+
* const result = await stack.contentType('contenttype_uid').entry().query().equalTo('fieldUid', 'value').find();
384384
*
385385
* @returns {Query}
386386
*/
@@ -407,7 +407,7 @@ export class Query extends BaseQuery {
407407
* import contentstack from '@contentstack/delivery-sdk'
408408
*
409409
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
410-
* const query = await stack.contentType('contenttype_uid').entry().query().notEqualTo('fieldUid', 'value').find();
410+
* const result = await stack.contentType('contenttype_uid').entry().query().notEqualTo('fieldUid', 'value').find();
411411
*
412412
* @returns {Query}
413413
*/
@@ -434,8 +434,8 @@ export class Query extends BaseQuery {
434434
* import contentstack from '@contentstack/delivery-sdk'
435435
*
436436
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
437-
* const query = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
438-
* const entryQuery = await stack.contentType('contenttype_uid').entry().query().referenceIn('reference_uid', query).find();
437+
* const subQuery = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
438+
* const result = await stack.contentType('contenttype_uid').entry().query().referenceIn('reference_uid', subQuery).find();
439439
*
440440
* @returns {Query}
441441
*/
@@ -458,8 +458,8 @@ export class Query extends BaseQuery {
458458
* import contentstack from '@contentstack/delivery-sdk'
459459
*
460460
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
461-
* const query = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
462-
* const entryQuery = await stack.contentType('contenttype_uid').entry().query().referenceNotIn('reference_uid', query).find();
461+
* const subQuery = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
462+
* const result = await stack.contentType('contenttype_uid').entry().query().referenceNotIn('reference_uid', subQuery).find();
463463
*
464464
* @returns {Query}
465465
*/
@@ -481,8 +481,7 @@ export class Query extends BaseQuery {
481481
* import contentstack from '@contentstack/delivery-sdk'
482482
*
483483
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
484-
* const query = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
485-
* const entryQuery = await stack.contentType('contenttype_uid').entry().query().tags(['tag1']).find();
484+
* const result = await stack.contentType('contenttype_uid').entry().query().tags(['tag1']).find();
486485
*
487486
* @returns {Query}
488487
*/
@@ -504,8 +503,7 @@ export class Query extends BaseQuery {
504503
* import contentstack from '@contentstack/delivery-sdk'
505504
*
506505
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
507-
* const query = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
508-
* const entryQuery = await stack.contentType('contenttype_uid').entry().query().search('key').find();
506+
* const result = await stack.contentType('contenttype_uid').entry().query().search('key').find();
509507
*
510508
* @returns {Query}
511509
*/
@@ -528,8 +526,7 @@ export class Query extends BaseQuery {
528526
* import contentstack from '@contentstack/delivery-sdk'
529527
*
530528
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
531-
* const query = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
532-
* const entryQuery = await stack.contentType('contenttype_uid').entry().query().lessThan('fieldUid', 'value').find();
529+
* const result = await stack.contentType('contenttype_uid').entry().query().lessThan('fieldUid', 100).find();
533530
*
534531
* @returns {Query}
535532
*/
@@ -557,8 +554,7 @@ export class Query extends BaseQuery {
557554
* import contentstack from '@contentstack/delivery-sdk'
558555
*
559556
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
560-
* const query = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
561-
* const entryQuery = await stack.contentType('contenttype_uid').entry().query().lessThanOrEqualTo('fieldUid', 'value').find();
557+
* const result = await stack.contentType('contenttype_uid').entry().query().lessThanOrEqualTo('fieldUid', 100).find();
562558
*
563559
* @returns {Query}
564560
*/
@@ -585,8 +581,7 @@ export class Query extends BaseQuery {
585581
* import contentstack from '@contentstack/delivery-sdk'
586582
*
587583
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
588-
* const query = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
589-
* const entryQuery = await stack.contentType('contenttype_uid').entry().query().greaterThan('fieldUid', 'value').find();
584+
* const result = await stack.contentType('contenttype_uid').entry().query().greaterThan('fieldUid', 100).find();
590585
*
591586
* @returns {Query}
592587
*/
@@ -613,8 +608,7 @@ export class Query extends BaseQuery {
613608
* import contentstack from '@contentstack/delivery-sdk'
614609
*
615610
* const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
616-
* const query = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');
617-
* const entryQuery = await stack.contentType('contenttype_uid').entry().query().greaterThanOrEqualTo('fieldUid', 'value').find();
611+
* const result = await stack.contentType('contenttype_uid').entry().query().greaterThanOrEqualTo('fieldUid', 100).find();
618612
*
619613
* @returns {Query}
620614
*/

src/lib/stack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export class Stack {
246246
* @method setDebug
247247
* @memberof Stack
248248
* @description Sets the debug option
249-
* @param {Number} debug - Debug value
249+
* @param {boolean} debug - Debug value
250250
* @return {Stack}
251251
* @instance
252252
* */
@@ -257,7 +257,7 @@ export class Stack {
257257

258258
/**
259259
* @method setHost
260-
* @memberOf Stack
260+
* @memberof Stack
261261
* @description Sets the host based on cloud region
262262
* @param {String} cloudRegion - Cloud region (e.g., 'aws_na', 'aws_eu')
263263
* @param {String} host - Optional custom host

0 commit comments

Comments
 (0)