Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
176d60c
fix: upgrade axios from 1.6.5 to 1.6.6
snyk-bot Feb 15, 2024
167e8b3
Merge branch 'next' into snyk-upgrade-4c53c9494c3474d7ffde53de29fde41e
harshithad0703 Feb 16, 2024
f17a8f3
Merge branch 'next' into snyk-upgrade-4c53c9494c3474d7ffde53de29fde41e
harshithad0703 Feb 16, 2024
b0365ab
Merge branch 'master' into snyk-upgrade-4c53c9494c3474d7ffde53de29fde41e
Mar 1, 2024
f6a167a
fix: resolved undefined stack in error issue
Mar 4, 2024
9ec95a9
Merge pull request #129 from contentstack/snyk-upgrade-4c53c9494c3474…
harshithad0703 Mar 18, 2024
7527d49
test: sanity test for bulk operation
harshithad0703 Mar 22, 2024
ba7d477
chore: :package: update package version and changeLog
harshithad0703 Mar 22, 2024
761636a
chore: :package: upgraded axios package to 1.6.8
harshithad0703 Mar 22, 2024
fd3dd62
Merge pull request #134 from contentstack/test/cs-43466-bulk-operatio…
harshithad0703 Mar 22, 2024
f3ea904
Merge pull request #135 from contentstack/snyk/cs-44440-upgrade-axios
harshithad0703 Mar 22, 2024
a82cc05
fix: added delete stack method
harshithad0703 Mar 26, 2024
6ea8232
chore: updated changeLog and package version
harshithad0703 Mar 26, 2024
281e8ec
chore: :package: updated internal dependencies
harshithad0703 Mar 27, 2024
896381d
Merge pull request #137 from contentstack/fix/cs-44541-stack-delete-f…
harshithad0703 Mar 27, 2024
1aa58d8
chore: :package: updated sdk version to 1.15.4 and changelog update
harshithad0703 Mar 28, 2024
37998e0
Merge pull request #138 from contentstack/fix/version-bump
harshithad0703 Mar 28, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [v1.15.4](https://github.com/contentstack/contentstack-management-javascript/tree/v1.15.4) (2024-03-28)
- Fixes and Enhancement
- delete stack implemetation and test cases
- sanity test and dependency upgrades
## [v1.15.3](https://github.com/contentstack/contentstack-management-javascript/tree/v1.15.3) (2024-02-16)
- Fix
- Fix for updating entry
Expand Down
3 changes: 2 additions & 1 deletion lib/core/concurrency-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ export function ConcurrencyQueue ({ axios, config }) {
code: 'Unauthorized',
message: 'Unable to refresh token',
name: 'Token Error',
config: queueItem.request
config: queueItem.request,
stack: (error instanceof Error) ? error.stack : null,
})
})
this.queue = []
Expand Down
19 changes: 17 additions & 2 deletions lib/stack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import cloneDeep from 'lodash/cloneDeep'
import error from '../core/contentstackError'
import { UserCollection } from '../user/index'
import { Role } from './roles/index'
import { create, query, update, fetch } from '../entity'
import { create, query, update, fetch, deleteEntity } from '../entity'
import { ContentType } from './contentType/index'
import { GlobalField } from './globalField/index'
import { DeliveryToken } from './deliveryToken/index'
Expand Down Expand Up @@ -259,7 +259,7 @@ export function Stack (http, data) {
}

/**
* @description Management Tokens are tokens that provide you with read-write access to the content of your stack.
* @description Management Tokens are tokens that provide you with read-write access to the content of your stack.
* @param {String} managementTokenUid The UID of the Management Token field you want to get details.
* @returns {ManagementToken} Instance of ManagementToken.
* @example
Expand Down Expand Up @@ -730,6 +730,21 @@ export function Stack (http, data) {
}
return new Taxonomy(http, data)
}

/**
* @description The delete stack call lets you delete the stack.
* @memberof Stack
* @func delete
* @returns {Promise<Stack.Stack>} Promise for Stack instance
* @example
* import * as contentstack from '@contentstack/management'
* const client = contentstack.client()
*
* client.stack({ api_key: 'api_key'}).delete()
* .then((stack) => console.log(stack))
*
*/
this.delete = deleteEntity(http)
} else {
/**
* @description The Create stack call creates a new stack in your Contentstack account.
Expand Down
111 changes: 43 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/management",
"version": "1.15.3",
"version": "1.15.4",
"description": "The Content Management API is used to manage the content of your Contentstack account",
"main": "./dist/node/contentstack-management.js",
"browser": "./dist/web/contentstack-management.js",
Expand Down Expand Up @@ -53,7 +53,7 @@
"license": "MIT",
"dependencies": {
"@slack/bolt": "^3.17.1",
"axios": "^1.6.5",
"axios": "^1.6.8",
"form-data": "^3.0.1",
"lodash": "^4.17.21",
"qs": "^6.11.2"
Expand Down
2 changes: 1 addition & 1 deletion sanity-report.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ console.log(`Pending Tests: ${pendingTests}`)
console.log(`Total Duration: ${durationInMinutes}m ${durationInSeconds.toFixed(2)}s`)

const slackMessage = `
*Test Summary*
*JavaScript CMA Report*
• Total Suites: *${totalSuites}*
• Total Tests: *${totalTests}*
• Passed Tests: *${passedTests}*
Expand Down
5 changes: 4 additions & 1 deletion test/sanity-check/api/asset-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path'
import { expect } from 'chai'
import { describe, it, setup } from 'mocha'
import { jsonReader, writeDownloadedFile } from '../utility/fileOperations/readwrite'
import { jsonReader, jsonWrite, writeDownloadedFile } from '../utility/fileOperations/readwrite'
import { contentstackClient } from '../utility/ContentstackClient.js'

var client = {}
Expand All @@ -25,6 +25,7 @@ describe('Assets api Test', () => {
}
makeAsset().create(asset)
.then((asset) => {
jsonWrite(asset, 'publishAsset2.json')
assetUID = asset.uid
assetURL = asset.url
expect(asset.uid).to.be.not.equal(null)
Expand Down Expand Up @@ -58,6 +59,7 @@ describe('Assets api Test', () => {
makeAsset().folder().create({ asset: { name: 'Sample Folder' } })
.then((asset) => {
folderUID = asset.uid
jsonWrite(asset, 'folder.json')
expect(asset.uid).to.be.not.equal(null)
expect(asset.name).to.be.equal('Sample Folder')
expect(asset.is_dir).to.be.equal(true)
Expand All @@ -76,6 +78,7 @@ describe('Assets api Test', () => {
}
makeAsset().create(asset)
.then((asset) => {
jsonWrite(asset, 'publishAsset1.json')
publishAssetUID = asset.uid
expect(asset.uid).to.be.not.equal(null)
expect(asset.url).to.be.not.equal(null)
Expand Down
Loading