@@ -28,23 +28,25 @@ export function BulkOperation (http, data = {}) {
28
28
* client.stack({ api_key: 'api_key'}).bulkOperation().addItems({ data: itemsData })
29
29
* .then((response) => { console.log(response) })
30
30
*/
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`
33
34
const headers = {
34
35
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
39
41
try {
40
- const response = await http . post ( this . urlPath , data , headers ) ;
42
+ const response = await http . post ( this . urlPath , data , headers )
41
43
if ( response . data ) {
42
- return response . data ;
44
+ return response . data
43
45
}
44
46
} catch ( error ) {
45
- console . error ( error ) ;
47
+ console . error ( error )
46
48
}
47
- } ;
49
+ }
48
50
49
51
/**
50
52
* The updateItems request allows you to update multiple items in a release in bulk.
@@ -65,23 +67,25 @@ export function BulkOperation (http, data = {}) {
65
67
* client.stack({ api_key: 'api_key'}).bulkOperation().updateItems({ data: itemsData })
66
68
* .then((response) => { console.log(response) })
67
69
*/
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`
70
73
const headers = {
71
74
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
76
80
try {
77
- const response = await http . put ( this . urlPath , data , headers ) ;
81
+ const response = await http . put ( this . urlPath , data , headers )
78
82
if ( response . data ) {
79
- return response . data ;
83
+ return response . data
80
84
}
81
85
} catch ( error ) {
82
- console . error ( error ) ;
86
+ console . error ( error )
83
87
}
84
- } ;
88
+ }
85
89
86
90
/**
87
91
* The jobStatus request allows you to check the status of a bulk job.
@@ -94,23 +98,26 @@ export function BulkOperation (http, data = {}) {
94
98
* client.stack({ api_key: 'api_key'}).bulkOperation().jobStatus({ job_id: 'job_id' })
95
99
* .then((response) => { console.log(response) })
96
100
*/
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 } `
99
105
const headers = {
100
106
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
105
112
try {
106
- const response = await http . get ( this . urlPath , headers ) ;
113
+ const response = await http . get ( this . urlPath , headers )
107
114
if ( response . data ) {
108
- return response . data ;
115
+ return response . data
109
116
}
110
117
} catch ( error ) {
111
- console . error ( error ) ;
118
+ console . error ( error )
112
119
}
113
- } ;
120
+ }
114
121
115
122
/**
116
123
* 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 = {}) {
172
179
* .then((response) => { console.log(response.notice) })
173
180
*
174
181
*/
182
+ // eslint-disable-next-line camelcase
175
183
this . publish = async ( { details, skip_workflow_stage = false , approvals = false , is_nested = false , api_version = '' } ) => {
176
184
var httpBody = { }
177
185
if ( details ) {
@@ -182,19 +190,23 @@ export function BulkOperation (http, data = {}) {
182
190
...cloneDeep ( this . stackHeaders )
183
191
}
184
192
}
193
+ // eslint-disable-next-line camelcase
185
194
if ( is_nested ) {
186
195
headers . params = {
187
196
nested : true ,
188
197
event_type : 'bulk'
189
198
}
190
199
}
200
+ // eslint-disable-next-line camelcase
191
201
if ( skip_workflow_stage ) {
202
+ // eslint-disable-next-line camelcase
192
203
headers . headers . skip_workflow_stage_check = skip_workflow_stage
193
204
}
194
205
if ( approvals ) {
195
206
headers . headers . approvals = approvals
196
207
}
197
208
209
+ // eslint-disable-next-line camelcase
198
210
if ( api_version ) headers . headers . api_version = api_version
199
211
200
212
return publishUnpublish ( http , '/bulk/publish' , httpBody , headers )
@@ -259,7 +271,8 @@ export function BulkOperation (http, data = {}) {
259
271
* client.stack({ api_key: 'api_key'}).bulkOperation().unpublish({ details: publishDetails, is_nested: true })
260
272
* .then((response) => { console.log(response.notice) })
261
273
*/
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 = '' } ) => {
263
276
var httpBody = { }
264
277
if ( details ) {
265
278
httpBody = cloneDeep ( details )
@@ -269,18 +282,22 @@ export function BulkOperation (http, data = {}) {
269
282
...cloneDeep ( this . stackHeaders )
270
283
}
271
284
}
285
+ // eslint-disable-next-line camelcase
272
286
if ( is_nested ) {
273
287
headers . params = {
274
288
nested : true ,
275
289
event_type : 'bulk'
276
290
}
277
291
}
292
+ // eslint-disable-next-line camelcase
278
293
if ( skip_workflow_stage ) {
294
+ // eslint-disable-next-line camelcase
279
295
headers . headers . skip_workflow_stage_check = skip_workflow_stage
280
296
}
281
297
if ( approvals ) {
282
298
headers . headers . approvals = approvals
283
299
}
300
+ // eslint-disable-next-line camelcase
284
301
if ( api_version ) headers . headers . api_version = api_version
285
302
return publishUnpublish ( http , '/bulk/unpublish' , httpBody , headers )
286
303
}
0 commit comments