Skip to content

Commit cfebd80

Browse files
committed
Documentation update
1 parent 05a82cb commit cfebd80

18 files changed

Lines changed: 104 additions & 104 deletions

File tree

lib/contentstackClient.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export default function contentstackClient ({ http }) {
6060
* @description Get Stack instance. A stack is a space that stores the content of a project.
6161
* @memberof ContentstackClient
6262
* @func stack
63-
* @param {String} apiKey - Stack API Key
64-
* @param {String} managementToken - Stack API Key
63+
* @param {String} api_key - Stack API Key
64+
* @param {String} management_token - Stack API Key
6565
* @returns {Stack} Instance of Stack
6666
*
6767
* @example
@@ -75,14 +75,14 @@ export default function contentstackClient ({ http }) {
7575
* import * as contentstack from '@contentstack/management'
7676
* const client = contentstack.client()
7777
*
78-
* client.stack('api_key').fetch()
78+
* client.stack({ api_key: 'api_key'}).fetch()
7979
* .then((stack) => console.log(stack))
8080
*
8181
* @example
8282
* import * as contentstack from '@contentstack/management'
8383
* const client = contentstack.client()
8484
*
85-
* client.stack('api_key', 'management_token').fetch()
85+
* client.stack({ api_key: 'api_key', management_token: 'management_token' }).fetch()
8686
* .then((stack) => console.log(stack))
8787
*
8888
*/

lib/organization/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function Organization (http, data) {
7575
* import * as contentstack from '@contentstack/management'
7676
* const client = contentstack.client()
7777
*
78-
* client.stack('api_key').transferOwnership('emailId')
78+
* client.stack({ api_key: 'api_key'}).transferOwnership('emailId')
7979
* .then((notice) => console.log(notice))
8080
*
8181
*/

lib/query/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function Query (http, urlPath, param, stackHeaders = null, wrappe
5656
* import * as contentstack from '@contentstack/management'
5757
* const client = contentstack.client()
5858
*
59-
* client.stack('api_key').query({ query: { title: 'Stack name' } }).count()
59+
* client.stack({ api_key: 'api_key'}).query({ query: { title: 'Stack name' } }).count()
6060
* .then((response) => console.log(response))
6161
*
6262
*/

lib/stack/asset/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function Asset (http, data = {}) {
3636
* import * as contentstack from '@contentstack/management'
3737
* const client = contentstack.client()
3838
*
39-
* client.stack('api_key').asset('uid').fetch()
39+
* client.stack({ api_key: 'api_key'}).asset('uid').fetch()
4040
* .then((asset) => {
4141
* asset.title = 'My New asset'
4242
* asset.description = 'Asset description'
@@ -56,7 +56,7 @@ export function Asset (http, data = {}) {
5656
* import * as contentstack from '@contentstack/management'
5757
* const client = contentstack.client()
5858
*
59-
* client.stack('api_key').asset('uid').delete()
59+
* client.stack({ api_key: 'api_key'}).asset('uid').delete()
6060
* .then((notice) => console.log(notice))
6161
*/
6262
this.delete = deleteEntity(http)
@@ -70,7 +70,7 @@ export function Asset (http, data = {}) {
7070
* import * as contentstack from '@contentstack/management'
7171
* const client = contentstack.client()
7272
*
73-
* client.stack('api_key').asset('uid').fetch()
73+
* client.stack({ api_key: 'api_key'}).asset('uid').fetch()
7474
* .then((asset) => console.log(asset))
7575
*
7676
*/
@@ -89,7 +89,7 @@ export function Asset (http, data = {}) {
8989
* upload: 'path/to/file.png',
9090
* }
9191
*
92-
* client.stack('api_key').asset('uid').replace(asset)
92+
* client.stack({ api_key: 'api_key'}).asset('uid').replace(asset)
9393
* .then((asset) => console.log(asset))
9494
*
9595
*/
@@ -123,7 +123,7 @@ export function Asset (http, data = {}) {
123123
* ]
124124
* }
125125
*
126-
* client.stack('api_key').asset('uid').publish({ publishDetails: asset, version: 1, scheduledAt: "2019-02-08T18:30:00.000Z"})
126+
* client.stack({ api_key: 'api_key'}).asset('uid').publish({ publishDetails: asset, version: 1, scheduledAt: "2019-02-08T18:30:00.000Z"})
127127
* .then((notice) => console.log(notice))
128128
*
129129
*/
@@ -147,7 +147,7 @@ export function Asset (http, data = {}) {
147147
* ]
148148
* }
149149
*
150-
* client.stack('api_key').asset('uid').unpublish({ publishDetails: asset, version: 1, scheduledAt: "2019-02-08T18:30:00.000Z"})
150+
* client.stack({ api_key: 'api_key'}).asset('uid').unpublish({ publishDetails: asset, version: 1, scheduledAt: "2019-02-08T18:30:00.000Z"})
151151
* .then((notice) => console.log(notice))
152152
*
153153
*/
@@ -184,7 +184,7 @@ export function Asset (http, data = {}) {
184184
* description: 'Desc'
185185
* }
186186
*
187-
* client.stack('api_key').asset().create(asset)
187+
* client.stack({ api_key: 'api_key'}).asset().create(asset)
188188
* .then((asset) => console.log(asset))
189189
*/
190190
this.create = async function (data, params) {

lib/stack/bulkOperation/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function BulkOperation (http, data = {}) {
3939
* '{{env_name}}/env_uid}}'
4040
* ]
4141
* }
42-
* client.stack('api_key').publish({ details: publishDetails })
42+
* client.stack({ api_key: 'api_key'}).publish({ details: publishDetails })
4343
* .then((notice) => { console.log(notice) })
4444
*
4545
*/
@@ -93,7 +93,7 @@ export function BulkOperation (http, data = {}) {
9393
* '{{env_name}}/env_uid}}'
9494
* ]
9595
* }
96-
* client.stack('api_key').unpublish({ details: publishDetails })
96+
* client.stack({ api_key: 'api_key'}).unpublish({ details: publishDetails })
9797
* .then((notice) => { console.log(notice) })
9898
*
9999
*/
@@ -138,7 +138,7 @@ export function BulkOperation (http, data = {}) {
138138
* uid: '{{uid}}'
139139
* }]
140140
* }
141-
* client.stack('api_key').delete({ details: publishDetails })
141+
* client.stack({ api_key: 'api_key'}).delete({ details: publishDetails })
142142
* .then((notice) => { console.log(notice) })
143143
*
144144
*/

lib/stack/contentType/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function ContentType (http, data = {}) {
2929
* import * as contentstack from '@contentstack/management'
3030
* const client = contentstack.client()
3131
*
32-
* client.stack('api_key').contentType('content_type_uid').fetch()
32+
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').fetch()
3333
* .then((contentType) => {
3434
* contentType.title = 'My New Content Type'
3535
* contentType.description = 'Content Type description'
@@ -49,7 +49,7 @@ export function ContentType (http, data = {}) {
4949
* import * as contentstack from '@contentstack/management'
5050
* const client = contentstack.client()
5151
*
52-
* client.stack('api_key').contentType('content_type_uid').delete()
52+
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').delete()
5353
* .then((notice) => console.log(notice))
5454
*/
5555
this.delete = deleteEntity(http)
@@ -64,7 +64,7 @@ export function ContentType (http, data = {}) {
6464
* import * as contentstack from '@contentstack/management'
6565
* const client = contentstack.client()
6666
*
67-
* client.stack('api_key').contentType('content_type_uid').fetch()
67+
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').fetch()
6868
* .then((contentType) => console.log(contentType))
6969
*
7070
*/
@@ -78,7 +78,7 @@ export function ContentType (http, data = {}) {
7878
* import * as contentstack from '@contentstack/management'
7979
* const client = contentstack.client()
8080
*
81-
* client.stack('api_key').contentType('content_type_uid').entry('entry_uid').fetch()
81+
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('entry_uid').fetch()
8282
* .then((contentType) => console.log(contentType))
8383
*/
8484
this.entry = (uid = null) => {
@@ -116,7 +116,7 @@ export function ContentType (http, data = {}) {
116116
* import * as contentstack from '@contentstack/management'
117117
* const client = contentstack.client()
118118
*
119-
* client.stack('api_key').contentType().query({ query: { name: 'Content Type Name' } }).find()
119+
* client.stack({ api_key: 'api_key'}).contentType().query({ query: { name: 'Content Type Name' } }).find()
120120
* .then((contentTypes) => console.log(contentTypes))
121121
*/
122122
this.query = query({ http: http, wrapperCollection: ContentTypeCollection })

lib/stack/deliveryToken/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function DeliveryToken (http, data = {}) {
1818
* import * as contentstack from '@contentstack/management'
1919
* const client = contentstack.client()
2020
*
21-
* client.stack('api_key').deliveryToken('delivery_token_uid').fetch()
21+
* client.stack({ api_key: 'api_key'}).deliveryToken('delivery_token_uid').fetch()
2222
* .then((deliveryToken) => {
2323
* deliveryToken.title = 'My New Content Type'
2424
* deliveryToken.description = 'Content Type description'
@@ -38,7 +38,7 @@ export function DeliveryToken (http, data = {}) {
3838
* import * as contentstack from '@contentstack/management'
3939
* const client = contentstack.client()
4040
*
41-
* client.stack('api_key').deliveryToken('delivery_token_uid').delete()
41+
* client.stack({ api_key: 'api_key'}).deliveryToken('delivery_token_uid').delete()
4242
* .then((notice) => console.log(notice))
4343
*/
4444
this.delete = deleteEntity(http)
@@ -52,7 +52,7 @@ export function DeliveryToken (http, data = {}) {
5252
* import * as contentstack from '@contentstack/management'
5353
* const client = contentstack.client()
5454
*
55-
* client.stack('api_key').deliveryToken('delivery_token_uid').fetch()
55+
* client.stack({ api_key: 'api_key'}).deliveryToken('delivery_token_uid').fetch()
5656
* .then((deliveryToken) => console.log(deliveryToken))
5757
*
5858
*/

lib/stack/environment/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function Environment (http, data = {}) {
1616
* import * as contentstack from '@contentstack/management'
1717
* const client = contentstack.client()
1818
*
19-
* client.stack('api_key').environment('uid').fetch()
19+
* client.stack({ api_key: 'api_key'}).environment('uid').fetch()
2020
* .then((environment) => {
2121
* environment.title = 'My New Content Type'
2222
* environment.description = 'Content Type description'
@@ -36,7 +36,7 @@ export function Environment (http, data = {}) {
3636
* import * as contentstack from '@contentstack/management'
3737
* const client = contentstack.client()
3838
*
39-
* client.stack('api_key').environment('uid').delete()
39+
* client.stack({ api_key: 'api_key'}).environment('uid').delete()
4040
* .then((notice) => console.log(notice))
4141
*/
4242
this.delete = deleteEntity(http)
@@ -50,7 +50,7 @@ export function Environment (http, data = {}) {
5050
* import * as contentstack from '@contentstack/management'
5151
* const client = contentstack.client()
5252
*
53-
* client.stack('api_key').environment('uid').fetch()
53+
* client.stack({ api_key: 'api_key'}).environment('uid').fetch()
5454
* .then((environment) => console.log(environment))
5555
*
5656
*/
@@ -80,7 +80,7 @@ export function Environment (http, data = {}) {
8080
* ],
8181
* deploy_content: true
8282
* }
83-
* client.stack('api_key').environment().create({ environment })
83+
* client.stack({ api_key: 'api_key'}).environment().create({ environment })
8484
* .then((environment) => console.log(environment))
8585
*/
8686
this.create = create({ http: http })
@@ -95,7 +95,7 @@ export function Environment (http, data = {}) {
9595
* import * as contentstack from '@contentstack/management'
9696
* const client = contentstack.client()
9797
*
98-
* client.stack('api_key').environment().query({ query: { name: 'Environment Name' } }).find()
98+
* client.stack({ api_key: 'api_key'}).environment().query({ query: { name: 'Environment Name' } }).find()
9999
* .then((globalFields) => console.log(globalFields))
100100
*/
101101
this.query = query({ http: http, wrapperCollection: EnvironmentCollection })

lib/stack/extension/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function Extension (http, data) {
2323
* import * as contentstack from '@contentstack/management'
2424
* const client = contentstack.client()
2525
*
26-
* client.stack('api_key').extension('extension_uid').fetch()
26+
* client.stack({ api_key: 'api_key'}).extension('extension_uid').fetch()
2727
* .then((extension) => {
2828
* extension.title = 'My Extension Type'
2929
* return extension.update()
@@ -42,7 +42,7 @@ export function Extension (http, data) {
4242
* import * as contentstack from '@contentstack/management'
4343
* const client = contentstack.client()
4444
*
45-
* client.stack('api_key').extension('extension_uid').delete()
45+
* client.stack({ api_key: 'api_key'}).extension('extension_uid').delete()
4646
* .then((notice) => console.log(notice))
4747
*/
4848
this.delete = deleteEntity(http)
@@ -56,7 +56,7 @@ export function Extension (http, data) {
5656
* import * as contentstack from '@contentstack/management'
5757
* const client = contentstack.client()
5858
*
59-
* client.stack('api_key').extension('extension_uid').fetch()
59+
* client.stack({ api_key: 'api_key'}).extension('extension_uid').fetch()
6060
* .then((extension) => console.log(extension))
6161
*
6262
*/
@@ -86,7 +86,7 @@ export function Extension (http, data) {
8686
* type: 'Type of extenstion you want to create widget/dashboard/field'
8787
* }
8888
*
89-
* client.stack('api_key').extension().upload(extension)
89+
* client.stack({ api_key: 'api_key'}).extension().upload(extension)
9090
* .then((extension) => console.log(extension))
9191
*/
9292
this.upload = async function (data, params) {

lib/stack/globalField/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function GlobalField (http, data = {}) {
2525
* import * as contentstack from '@contentstack/management'
2626
* const client = contentstack.client()
2727
*
28-
* client.stack('api_key').globalField('global_field_uid').fetch()
28+
* client.stack({ api_key: 'api_key'}).globalField('global_field_uid').fetch()
2929
* .then((globalField) => {
3030
* globalField.title = 'My New Content Type'
3131
* globalField.description = 'Content Type description'
@@ -45,7 +45,7 @@ export function GlobalField (http, data = {}) {
4545
* import * as contentstack from '@contentstack/management'
4646
* const client = contentstack.client()
4747
*
48-
* client.stack('api_key').globalField('global_field_uid').delete()
48+
* client.stack({ api_key: 'api_key'}).globalField('global_field_uid').delete()
4949
* .then((notice) => console.log(notice))
5050
*/
5151
this.delete = deleteEntity(http)
@@ -59,7 +59,7 @@ export function GlobalField (http, data = {}) {
5959
* import * as contentstack from '@contentstack/management'
6060
* const client = contentstack.client()
6161
*
62-
* client.stack('api_key').globalField('global_field_uid').fetch()
62+
* client.stack({ api_key: 'api_key'}).globalField('global_field_uid').fetch()
6363
* .then((globalField) => console.log(globalField))
6464
*
6565
*/
@@ -115,7 +115,7 @@ export function GlobalField (http, data = {}) {
115115
* const data = {
116116
* global_field: 'path/to/file.png',
117117
* }
118-
* client.stack('api_key').globalField().import(data)
118+
* client.stack({ api_key: 'api_key'}).globalField().import(data)
119119
* .then((globalField) => console.log(globalField))
120120
*
121121
*/

0 commit comments

Comments
 (0)