Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0e5105b
Merge pull request #226 from contentstack/staging
cs-raj Dec 5, 2024
2411594
fix: customBackOff fix
Dec 12, 2024
3fba7cf
add items to bulk operation and corresponding tests
harshithad0703 Dec 13, 2024
d96c4ac
implementation, api and unit test case for fetch by job status
harshithad0703 Dec 17, 2024
bec711e
Merge pull request #229 from contentstack/feat/dx-1591-bulk-operation…
harshithad0703 Dec 17, 2024
ee7f925
Merge pull request #233 from contentstack/feat/dx-1592-fetch-job-status
harshithad0703 Dec 17, 2024
de267b4
update items implementation,api and unit test cases and types support
harshithad0703 Dec 20, 2024
5079d20
move items from release implementation, unit & api test cases, types …
harshithad0703 Dec 20, 2024
aa9e1d5
removed console log
harshithad0703 Dec 21, 2024
c5a6170
Merge pull request #235 from contentstack/feat/dx-1594-update-move-items
harshithad0703 Dec 21, 2024
21854fc
Merge pull request #228 from contentstack/fix/DX-1409
netrajpatel Jan 6, 2025
23b262f
updated doc changes
harshithad0703 Jan 8, 2025
97247f5
updated add and delete items implementation according to release v2
harshithad0703 Jan 8, 2025
ea0fd04
added unit and api test cases
harshithad0703 Jan 8, 2025
22c3d07
added types support for add and delete
harshithad0703 Jan 8, 2025
d445bad
Merge pull request #236 from contentstack/feat/dx-1595-add-delete-items
harshithad0703 Jan 8, 2025
f73f540
Merge pull request #237 from contentstack/development
harshithad0703 Jan 9, 2025
9bdc7d3
Merge pull request #238 from contentstack/feat/release-2.0
harshithad0703 Jan 9, 2025
1c4a4b9
version bump to 1.19.0
harshithad0703 Jan 9, 2025
481b4c3
Merge pull request #239 from contentstack/fix/version-bump-1.19.0
harshithad0703 Jan 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated doc changes
  • Loading branch information
harshithad0703 committed Jan 8, 2025
commit 23b262f6b37fdb3f5af9fe3de4f392daf3a4313e
49 changes: 49 additions & 0 deletions lib/stack/bulkOperation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ export function BulkOperation (http, data = {}) {
this.stackHeaders = data.stackHeaders
this.urlPath = `/bulk`

/**
* The addItems request allows you to add multiple items to a release in bulk.
* @memberof BulkOperation
* @func addItems
* @returns {Promise<Object>} Response Object.
* @param {Object} params.data - The data containing the items to be added to the release.
* @param {String} [params.bulk_version] - The bulk version.
* @example
* const itemsData = {
* items: [
* {
* uid: '{{entry_uid}}',
* content_type: '{{content_type_uid}}'
* }
* ]
* }
* client.stack({ api_key: 'api_key'}).bulkOperation().addItems({ data: itemsData })
* .then((response) => { console.log(response) })
*/
this.addItems = async ({ data, bulk_version = "" }) => {
this.urlPath = `/bulk/release/items`;
const headers = {
Expand All @@ -27,6 +46,25 @@ export function BulkOperation (http, data = {}) {
}
};

/**
* The updateItems request allows you to update multiple items in a release in bulk.
* @memberof BulkOperation
* @func updateItems
* @returns {Promise<Object>} Response Object.
* @param {Object} params.data - The data containing the items to be updated in the release.
* @param {String} [params.bulk_version] - The bulk version.
* @example
* const itemsData = {
* items: [
* {
* uid: '{{entry_uid}}',
* content_type: '{{content_type_uid}}'
* }
* ]
* }
* client.stack({ api_key: 'api_key'}).bulkOperation().updateItems({ data: itemsData })
* .then((response) => { console.log(response) })
*/
this.updateItems = async ({ data, bulk_version = "" }) => {
this.urlPath = `/bulk/release/update_items`;
const headers = {
Expand All @@ -45,6 +83,17 @@ export function BulkOperation (http, data = {}) {
}
};

/**
* The jobStatus request allows you to check the status of a bulk job.
* @memberof BulkOperation
* @func jobStatus
* @returns {Promise<Object>} Response Object.
* @param {String} params.job_id - The ID of the job.
* @param {String} [params.bulk_version] - The bulk version.
* @example
* client.stack({ api_key: 'api_key'}).bulkOperation().jobStatus({ job_id: 'job_id' })
* .then((response) => { console.log(response) })
*/
this.jobStatus = async ({ job_id, bulk_version = "" }) => {
this.urlPath = `/bulk/jobs/${job_id}`;
const headers = {
Expand Down