Skip to content

Commit ee0ce4e

Browse files
Added released version and removed duplicate code
1 parent 3772aff commit ee0ce4e

File tree

5 files changed

+8
-30
lines changed

5 files changed

+8
-30
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## [v1.19.2](https://github.com/contentstack/contentstack-management-javascript/tree/v1.19.2) (2025-01-27)
3+
- Enhancement
4+
- Added support for nested global fields.
25
## [v1.18.4](https://github.com/contentstack/contentstack-management-javascript/tree/v1.18.4) (2024-11-22)
36
- Enhancement
47
- Added support for response headers.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/management",
3-
"version": "1.19.0",
3+
"version": "1.19.2",
44
"description": "The Content Management API is used to manage the content of your Contentstack account",
55
"main": "./dist/node/contentstack-management.js",
66
"browser": "./dist/web/contentstack-management.js",

test/sanity-check/api/globalfield-test.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,6 @@ describe("Global Field api Test", () => {
130130
.catch(done);
131131
});
132132

133-
it("should get all nested global fields from Query", (done) => {
134-
makeGlobalField({ api_version: '3.2' })
135-
.query()
136-
.find()
137-
.then((collection) => {
138-
collection.items.forEach((globalField) => {
139-
expect(globalField.uid).to.be.not.equal(null);
140-
expect(globalField.title).to.be.equal("Upload");
141-
});
142-
done();
143-
})
144-
.catch(done);
145-
});
146-
147133
it("should get all nested global fields from Query", (done) => {
148134
makeGlobalField({ api_version: '3.2' })
149135
.query()
@@ -152,7 +138,6 @@ describe("Global Field api Test", () => {
152138
collection.items.forEach((globalField) => {
153139
expect(globalField.uid).to.be.not.equal(null);
154140
expect(globalField.title).to.be.not.equal(null);
155-
expect(globalField.schema).to.be.not.equal(null);
156141
});
157142
done();
158143
})
@@ -172,18 +157,6 @@ describe("Global Field api Test", () => {
172157
});
173158
});
174159

175-
it('should create nested global field', done => {
176-
makeGlobalField({ api_version: '3.2' }).create(createNestedGlobalField)
177-
.then(globalField => {
178-
expect(globalField.uid).to.be.equal(createNestedGlobalField.global_field.uid);
179-
done();
180-
})
181-
.catch(err => {
182-
console.error('Error:', err.response?.data || err.message);
183-
done(err);
184-
});
185-
});
186-
187160
it('should create nested global field', done => {
188161
makeGlobalField({ api_version: '3.2' }).create(createNestedGlobalField)
189162
.then(globalField => {

types/stack/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export interface Stack extends SystemFields {
6262
contentType(uid: string): ContentType
6363

6464
globalField(): GlobalFields
65+
globalField({}): GlobalFields
6566
globalField(uid: string): GlobalField
67+
globalField(uid: string, option: object): GlobalField
6668

6769
asset(): Assets
6870
asset(uid: string): Asset

0 commit comments

Comments
 (0)