Skip to content

Commit 6a85d93

Browse files
committed
docs: 📝 Dist folder and Docs generated
1 parent f52e87d commit 6a85d93

File tree

5 files changed

+130
-116
lines changed

5 files changed

+130
-116
lines changed

.jsdoc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"lib/stack/contentType/entry/index.js",
1717
"lib/stack/asset/index.js",
1818
"lib/stack/asset/folders/index.js",
19+
"lib/stack/branch/index.js",
20+
"lib/stack/branchAlias/index.js",
1921
"lib/stack/bulkOperation/index.js",
2022
"lib/stack/extension/index.js",
2123
"lib/stack/release/index.js",

lib/stack/branch/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function Branch (http, data = {}) {
2525
* import * as contentstack from '@contentstack/management'
2626
* const client = contentstack.client()
2727
*
28-
* client.stack({ api_key: 'api_key'}).branch('branch_name').delete()
28+
* client.stack({ api_key: 'api_key'}).branch('branch_uid').delete()
2929
* .then((response) => console.log(response.notice))
3030
*/
3131
this.delete = deleteEntity(http)
@@ -39,7 +39,7 @@ export function Branch (http, data = {}) {
3939
* import * as contentstack from '@contentstack/management'
4040
* const client = contentstack.client()
4141
*
42-
* client.stack({ api_key: 'api_key'}).branch('branch_name').fetch()
42+
* client.stack({ api_key: 'api_key'}).branch('branch_uid').fetch()
4343
* .then((branch) => console.log(branch))
4444
*
4545
*/

lib/stack/branchAlias/index.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import cloneDeep from 'lodash/cloneDeep'
22
import error from '../../core/contentstackError'
3-
import { deleteEntity, parseData } from '../../entity'
4-
import { Branch } from '../branch'
3+
import { deleteEntity, fetchAll, parseData } from '../../entity'
4+
import { Branch, BranchCollection } from '../branch'
55

66
/**
77
*
@@ -18,7 +18,7 @@ export function BranchAlias (http, data = {}) {
1818
* @description The Update BranchAlias call lets you update the name of an existing BranchAlias.
1919
* @memberof BranchAlias
2020
* @func update
21-
* @returns {Promise<BranchAlias.BranchAlias>} Promise for BranchAlias instance
21+
* @returns {Promise<Branch.Branch>} Promise for Branch instance
2222
* @example
2323
* import * as contentstack from '@contentstack/management'
2424
* const client = contentstack.client()
@@ -59,11 +59,12 @@ export function BranchAlias (http, data = {}) {
5959
* .then((response) => console.log(response.notice))
6060
*/
6161
this.delete = deleteEntity(http, true)
62+
6263
/**
6364
* @description The fetch BranchAlias call fetches BranchAlias details.
6465
* @memberof BranchAlias
6566
* @func fetch
66-
* @returns {Promise<BranchAlias.BranchAlias>} Promise for BranchAlias instance
67+
* @returns {Promise<Branch.Branch>} Promise for Branch instance
6768
* @example
6869
* import * as contentstack from '@contentstack/management'
6970
* const client = contentstack.client()
@@ -87,13 +88,24 @@ export function BranchAlias (http, data = {}) {
8788
throw error(err)
8889
}
8990
}
91+
} else {
92+
/**
93+
* @description The Get all BranchAlias request retrieves the details of all the Branch of a stack.
94+
* @memberof BranchAlias
95+
* @func fetchAll
96+
* @param {Int} limit The limit parameter will return a specific number of Branch in the output.
97+
* @param {Int} skip The skip parameter will skip a specific number of Branch in the output.
98+
* @param {Boolean}include_count To retrieve the count of Branch.
99+
* @returns {ContentstackCollection} Result collection of content of specified module.
100+
* @example
101+
* import * as contentstack from '@contentstack/management'
102+
* const client = contentstack.client()
103+
*
104+
* client.stack({ api_key: 'api_key'}).branchAlias().fetchAll()
105+
* .then((collection) => console.log(collection))
106+
*
107+
*/
108+
this.fetchAll = fetchAll(http, BranchCollection)
90109
}
91110
return this
92111
}
93-
94-
export function BranchAliasCollection (http, data) {
95-
const obj = cloneDeep(data.branch_aliases) || []
96-
return obj.map((branchAlias) => {
97-
return new BranchAlias(http, { branch_alias: branchAlias, stackHeaders: data.stackHeaders })
98-
})
99-
}

lib/stack/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export function Stack (http, data) {
194194
* client.stack({ api_key: 'api_key'}).branch().create()
195195
* .then((branch) => console.log(branch))
196196
*
197-
* client.stack({ api_key: 'api_key' }).branch('branch').fetch()
197+
* client.stack({ api_key: 'api_key' }).branch('branch_uid').fetch()
198198
* .then((branch) => console.log(branch))
199199
*
200200
*/
@@ -218,7 +218,7 @@ export function Stack (http, data) {
218218
* client.stack({ api_key: 'api_key'}).branchAlias().create()
219219
* .then((branch) => console.log(branch))
220220
*
221-
* client.stack({ api_key: 'api_key' }).branchAlias('branch_uid').fetch()
221+
* client.stack({ api_key: 'api_key' }).branchAlias('branch_alias_uid').fetch()
222222
* .then((branch) => console.log(branch))
223223
*
224224
*/

lib/stack/workflow/index.js

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -178,113 +178,113 @@ export function Workflow (http, data = {}) {
178178
}
179179
}
180180
/**
181-
* @description The Create a Workflow request allows you to create a Workflow.
182-
* @memberof Workflow
183-
* @func create
184-
* @returns {Promise<Workflow.Workflow>} Promise for Workflow instance
185-
*
186-
* @example
187-
* import * as contentstack from '@contentstack/management'
188-
* const client = contentstack.client()
189-
*
190-
* const workflow = {
191-
*"workflow_stages": [
192-
* {
193-
* "color": "#2196f3",
194-
* "SYS_ACL": {
195-
* "roles": {
196-
* "uids": []
197-
* },
198-
* "users": {
199-
* "uids": [
200-
* "$all"
201-
* ]
202-
* },
203-
* "others": {}
204-
* },
205-
* "next_available_stages": [
206-
* "$all"
207-
* ],
208-
* "allStages": true,
209-
* "allUsers": true,
210-
* "specificStages": false,
211-
* "specificUsers": false,
212-
* "entry_lock": "$none", //assign any one of the assign any one of the ($none/$others/$all)
213-
* "name": "Review"
214-
* },
215-
* {
216-
* "color": "#74ba76",
217-
* "SYS_ACL": {
218-
* "roles": {
219-
* "uids": []
220-
* },
221-
* "users": {
222-
* "uids": [
223-
* "$all"
224-
* ]
225-
* },
226-
* "others": {}
227-
* },
228-
* "allStages": true,
229-
* "allUsers": true,
230-
* "specificStages": false,
231-
* "specificUsers": false,
232-
* "next_available_stages": [
233-
* "$all"
234-
* ],
235-
* "entry_lock": "$none",
236-
* "name": "Complete"
237-
* }
238-
* ],
239-
* "admin_users": {
240-
* "users": []
241-
* },
242-
* "name": "Workflow Name",
243-
* "enabled": true,
244-
* "content_types": [
245-
* "$all"
246-
* ]
247-
* }
248-
* client.stack().workflow().create({ workflow })
249-
* .then((workflow) => console.log(workflow))
250-
*/
181+
* @description The Create a Workflow request allows you to create a Workflow.
182+
* @memberof Workflow
183+
* @func create
184+
* @returns {Promise<Workflow.Workflow>} Promise for Workflow instance
185+
*
186+
* @example
187+
* import * as contentstack from '@contentstack/management'
188+
* const client = contentstack.client()
189+
*
190+
* const workflow = {
191+
*"workflow_stages": [
192+
* {
193+
* "color": "#2196f3",
194+
* "SYS_ACL": {
195+
* "roles": {
196+
* "uids": []
197+
* },
198+
* "users": {
199+
* "uids": [
200+
* "$all"
201+
* ]
202+
* },
203+
* "others": {}
204+
* },
205+
* "next_available_stages": [
206+
* "$all"
207+
* ],
208+
* "allStages": true,
209+
* "allUsers": true,
210+
* "specificStages": false,
211+
* "specificUsers": false,
212+
* "entry_lock": "$none", //assign any one of the assign any one of the ($none/$others/$all)
213+
* "name": "Review"
214+
* },
215+
* {
216+
* "color": "#74ba76",
217+
* "SYS_ACL": {
218+
* "roles": {
219+
* "uids": []
220+
* },
221+
* "users": {
222+
* "uids": [
223+
* "$all"
224+
* ]
225+
* },
226+
* "others": {}
227+
* },
228+
* "allStages": true,
229+
* "allUsers": true,
230+
* "specificStages": false,
231+
* "specificUsers": false,
232+
* "next_available_stages": [
233+
* "$all"
234+
* ],
235+
* "entry_lock": "$none",
236+
* "name": "Complete"
237+
* }
238+
* ],
239+
* "admin_users": {
240+
* "users": []
241+
* },
242+
* "name": "Workflow Name",
243+
* "enabled": true,
244+
* "content_types": [
245+
* "$all"
246+
* ]
247+
* }
248+
* client.stack().workflow().create({ workflow })
249+
* .then((workflow) => console.log(workflow))
250+
*/
251251
this.create = create({ http: http })
252252

253253
/**
254-
* @description The Get all Workflows request retrieves the details of all the Workflows of a stack.
255-
* @memberof Workflow
256-
* @func fetchAll
257-
* @param {Int} limit The limit parameter will return a specific number of Workflows in the output.
258-
* @param {Int} skip The skip parameter will skip a specific number of Workflows in the output.
259-
* @param {Boolean}include_count To retrieve the count of Workflows.
260-
* @returns {ContentstackCollection} Result collection of content of specified module.
261-
* @example
262-
* import * as contentstack from '@contentstack/management'
263-
* const client = contentstack.client()
264-
*
265-
* client.stack({ api_key: 'api_key'}).workflow().fetchAll()
266-
* .then((collection) => console.log(collection))
267-
*
268-
*/
254+
* @description The Get all Workflows request retrieves the details of all the Workflows of a stack.
255+
* @memberof Workflow
256+
* @func fetchAll
257+
* @param {Int} limit The limit parameter will return a specific number of Workflows in the output.
258+
* @param {Int} skip The skip parameter will skip a specific number of Workflows in the output.
259+
* @param {Boolean}include_count To retrieve the count of Workflows.
260+
* @returns {ContentstackCollection} Result collection of content of specified module.
261+
* @example
262+
* import * as contentstack from '@contentstack/management'
263+
* const client = contentstack.client()
264+
*
265+
* client.stack({ api_key: 'api_key'}).workflow().fetchAll()
266+
* .then((collection) => console.log(collection))
267+
*
268+
*/
269269
this.fetchAll = fetchAll(http, WorkflowCollection)
270270

271271
/**
272-
* @description The Publish rule allow you to create, fetch, delete, update the publish rules.
273-
* @memberof Workflow
274-
* @func publishRule
275-
* @param {Int} ruleUid The UID of the Publish rules you want to get details.
276-
* @returns {PublishRules} Instace of PublishRules.
277-
* @example
278-
* import * as contentstack from '@contentstack/management'
279-
* const client = contentstack.client()
280-
*
281-
* client.stack({ api_key: 'api_key'}).workflow().publishRule().fetchAll()
282-
* .then((collection) => console.log(collection))
283-
*
284-
* client.stack({ api_key: 'api_key'}).workflow().publishRule('rule_uid').fetch()
285-
* .then((publishrule) => console.log(publishrule))
286-
*
287-
*/
272+
* @description The Publish rule allow you to create, fetch, delete, update the publish rules.
273+
* @memberof Workflow
274+
* @func publishRule
275+
* @param {Int} ruleUid The UID of the Publish rules you want to get details.
276+
* @returns {PublishRules} Instace of PublishRules.
277+
* @example
278+
* import * as contentstack from '@contentstack/management'
279+
* const client = contentstack.client()
280+
*
281+
* client.stack({ api_key: 'api_key'}).workflow().publishRule().fetchAll()
282+
* .then((collection) => console.log(collection))
283+
*
284+
* client.stack({ api_key: 'api_key'}).workflow().publishRule('rule_uid').fetch()
285+
* .then((publishrule) => console.log(publishrule))
286+
*
287+
*/
288288
this.publishRule = (ruleUid = null) => {
289289
const publishInfo = { stackHeaders: this.stackHeaders }
290290
if (ruleUid) {

0 commit comments

Comments
 (0)