@@ -28,23 +28,25 @@ export function BulkOperation (http, data = {}) {
2828 * client.stack({ api_key: 'api_key'}).bulkOperation().addItems({ data: itemsData })
2929 * .then((response) => { console.log(response) })
3030 */
31- this . addItems = async ( { data, bulk_version = "" } ) => {
32- this . urlPath = `/bulk/release/items` ;
31+ // eslint-disable-next-line camelcase
32+ this . addItems = async ( { data, bulk_version = '' } ) => {
33+ this . urlPath = `/bulk/release/items`
3334 const headers = {
3435 headers : {
35- ...cloneDeep ( this . stackHeaders ) ,
36- } ,
37- } ;
38- if ( bulk_version ) headers . headers . bulk_version = bulk_version ;
36+ ...cloneDeep ( this . stackHeaders )
37+ }
38+ }
39+ // eslint-disable-next-line camelcase
40+ if ( bulk_version ) headers . headers . bulk_version = bulk_version
3941 try {
40- const response = await http . post ( this . urlPath , data , headers ) ;
42+ const response = await http . post ( this . urlPath , data , headers )
4143 if ( response . data ) {
42- return response . data ;
44+ return response . data
4345 }
4446 } catch ( error ) {
45- console . error ( error ) ;
47+ console . error ( error )
4648 }
47- } ;
49+ }
4850
4951 /**
5052 * The updateItems request allows you to update multiple items in a release in bulk.
@@ -65,23 +67,25 @@ export function BulkOperation (http, data = {}) {
6567 * client.stack({ api_key: 'api_key'}).bulkOperation().updateItems({ data: itemsData })
6668 * .then((response) => { console.log(response) })
6769 */
68- this . updateItems = async ( { data, bulk_version = "" } ) => {
69- this . urlPath = `/bulk/release/update_items` ;
70+ // eslint-disable-next-line camelcase
71+ this . updateItems = async ( { data, bulk_version = '' } ) => {
72+ this . urlPath = `/bulk/release/update_items`
7073 const headers = {
7174 headers : {
72- ...cloneDeep ( this . stackHeaders ) ,
73- } ,
74- } ;
75- if ( bulk_version ) headers . headers . bulk_version = bulk_version ;
75+ ...cloneDeep ( this . stackHeaders )
76+ }
77+ }
78+ // eslint-disable-next-line camelcase
79+ if ( bulk_version ) headers . headers . bulk_version = bulk_version
7680 try {
77- const response = await http . put ( this . urlPath , data , headers ) ;
81+ const response = await http . put ( this . urlPath , data , headers )
7882 if ( response . data ) {
79- return response . data ;
83+ return response . data
8084 }
8185 } catch ( error ) {
82- console . error ( error ) ;
86+ console . error ( error )
8387 }
84- } ;
88+ }
8589
8690 /**
8791 * The jobStatus request allows you to check the status of a bulk job.
@@ -94,23 +98,26 @@ export function BulkOperation (http, data = {}) {
9498 * client.stack({ api_key: 'api_key'}).bulkOperation().jobStatus({ job_id: 'job_id' })
9599 * .then((response) => { console.log(response) })
96100 */
97- this . jobStatus = async ( { job_id, bulk_version = "" } ) => {
98- this . urlPath = `/bulk/jobs/${ job_id } ` ;
101+ // eslint-disable-next-line camelcase
102+ this . jobStatus = async ( { job_id, bulk_version = '' } ) => {
103+ // eslint-disable-next-line camelcase
104+ this . urlPath = `/bulk/jobs/${ job_id } `
99105 const headers = {
100106 headers : {
101- ...cloneDeep ( this . stackHeaders ) ,
102- } ,
103- } ;
104- if ( bulk_version ) headers . headers . bulk_version = bulk_version ;
107+ ...cloneDeep ( this . stackHeaders )
108+ }
109+ }
110+ // eslint-disable-next-line camelcase
111+ if ( bulk_version ) headers . headers . bulk_version = bulk_version
105112 try {
106- const response = await http . get ( this . urlPath , headers ) ;
113+ const response = await http . get ( this . urlPath , headers )
107114 if ( response . data ) {
108- return response . data ;
115+ return response . data
109116 }
110117 } catch ( error ) {
111- console . error ( error ) ;
118+ console . error ( error )
112119 }
113- } ;
120+ }
114121
115122 /**
116123 * The Publish entries and assets in bulk request allows you to publish multiple entries and assets at the same time.
@@ -172,6 +179,7 @@ export function BulkOperation (http, data = {}) {
172179 * .then((response) => { console.log(response.notice) })
173180 *
174181 */
182+ // eslint-disable-next-line camelcase
175183 this . publish = async ( { details, skip_workflow_stage = false , approvals = false , is_nested = false , api_version = '' } ) => {
176184 var httpBody = { }
177185 if ( details ) {
@@ -182,19 +190,23 @@ export function BulkOperation (http, data = {}) {
182190 ...cloneDeep ( this . stackHeaders )
183191 }
184192 }
193+ // eslint-disable-next-line camelcase
185194 if ( is_nested ) {
186195 headers . params = {
187196 nested : true ,
188197 event_type : 'bulk'
189198 }
190199 }
200+ // eslint-disable-next-line camelcase
191201 if ( skip_workflow_stage ) {
202+ // eslint-disable-next-line camelcase
192203 headers . headers . skip_workflow_stage_check = skip_workflow_stage
193204 }
194205 if ( approvals ) {
195206 headers . headers . approvals = approvals
196207 }
197208
209+ // eslint-disable-next-line camelcase
198210 if ( api_version ) headers . headers . api_version = api_version
199211
200212 return publishUnpublish ( http , '/bulk/publish' , httpBody , headers )
@@ -259,7 +271,8 @@ export function BulkOperation (http, data = {}) {
259271 * client.stack({ api_key: 'api_key'}).bulkOperation().unpublish({ details: publishDetails, is_nested: true })
260272 * .then((response) => { console.log(response.notice) })
261273 */
262- this . unpublish = async ( { details, skip_workflow_stage = false , approvals = false , is_nested = false , api_version = '' } ) => {
274+ // eslint-disable-next-line camelcase
275+ this . unpublish = async ( { details, skip_workflow_stage = false , approvals = false , is_nested = false , api_version = '' } ) => {
263276 var httpBody = { }
264277 if ( details ) {
265278 httpBody = cloneDeep ( details )
@@ -269,18 +282,22 @@ export function BulkOperation (http, data = {}) {
269282 ...cloneDeep ( this . stackHeaders )
270283 }
271284 }
285+ // eslint-disable-next-line camelcase
272286 if ( is_nested ) {
273287 headers . params = {
274288 nested : true ,
275289 event_type : 'bulk'
276290 }
277291 }
292+ // eslint-disable-next-line camelcase
278293 if ( skip_workflow_stage ) {
294+ // eslint-disable-next-line camelcase
279295 headers . headers . skip_workflow_stage_check = skip_workflow_stage
280296 }
281297 if ( approvals ) {
282298 headers . headers . approvals = approvals
283299 }
300+ // eslint-disable-next-line camelcase
284301 if ( api_version ) headers . headers . api_version = api_version
285302 return publishUnpublish ( http , '/bulk/unpublish' , httpBody , headers )
286303 }
0 commit comments