diff --git a/classes/Group/Group.js b/classes/Group/Group.js index 2f491e63..58cc6eb8 100644 --- a/classes/Group/Group.js +++ b/classes/Group/Group.js @@ -267,7 +267,7 @@ export default class Group { if (!this.isValidRolesMap(roles)) throw new Error("Invalid roles. Must be a JSON Object with keys as roles and values as arrays of permissions or space-delimited strings.") this.data.customRoles = roles - await this.update() + return this.update() } async addCustomRoles(roleMap) { @@ -277,7 +277,7 @@ export default class Group { if (!this.isValidRolesMap(roleMap)) throw new Error("Invalid roles. Must be a JSON Object with keys as roles and values as arrays of permissions or space-delimited strings.") this.data.customRoles = { ...this.data.customRoles, ...roleMap } - await this.update() + return this.update() } async removeCustomRoles(roleName) { @@ -286,7 +286,7 @@ export default class Group { } delete this.data.customRoles[roleName] - await this.update() + return this.update() } async save() { @@ -324,8 +324,8 @@ export default class Group { await this.addMemberRoles(this.data.creator, "OWNER", true, false) } if (!this.getByRole("LEADER")?.length) { - await this.addMemberRoles(this.data.creator, "LEADER", false, false) - } + await this.addMemberRoles(this.data.creator, "LEADER", false, false) + } } static async createNewGroup(creator, payload) { diff --git a/database/tiny/controller.js b/database/tiny/controller.js index 09c9313b..2b9b4d00 100644 --- a/database/tiny/controller.js +++ b/database/tiny/controller.js @@ -98,7 +98,7 @@ class DatabaseController { method: 'post', body: JSON.stringify(query), headers: { - 'Content-Type': 'application/json; charset=utf-8' + 'Content-Type': 'application/ld+json; charset=utf-8' } }) .then(resp => { @@ -129,7 +129,7 @@ class DatabaseController { method: 'post', body: JSON.stringify(data), headers: { - 'Content-Type': 'application/json; charset=utf-8' + 'Content-Type': 'application/ld+json; charset=utf-8' } }) .then(resp => { @@ -160,7 +160,7 @@ class DatabaseController { method: 'put', body: JSON.stringify(data), headers: { - 'Content-Type': 'application/json; charset=utf-8' + 'Content-Type': 'application/ld+json; charset=utf-8' } }) .then(resp => { @@ -190,7 +190,7 @@ class DatabaseController { err_out._dbaction = this.URLS.OVERWRITE const headers = { - 'Content-Type': 'application/json; charset=utf-8' + 'Content-Type': 'application/ld+json; charset=utf-8' } // Add optimistic locking header if __rerum.isOverwritten exists @@ -255,7 +255,7 @@ class DatabaseController { method: 'delete', body: JSON.stringify(data), headers: { - 'Content-Type': 'application/json; charset=utf-8' + 'Content-Type': 'application/ld+json; charset=utf-8' } }) .then(resp => { diff --git a/package-lock.json b/package-lock.json index a405827c..5cb363f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2092,13 +2092,24 @@ } }, "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz", + "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==", "dev": true, - "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "engines": { + "node": "18 || 20 || >=22" } }, "node_modules/braces": { @@ -2703,11 +2714,10 @@ } }, "node_modules/diff": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.2.tgz", - "integrity": "sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.3.tgz", + "integrity": "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } @@ -4737,13 +4747,12 @@ } }, "node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.8.tgz", + "integrity": "sha512-reYkDYtj/b19TeqbNZCV4q9t+Yxylf/rYBsLb42SXJatTv4/ylq5lEiAmhA/IToxO7NI2UzNMghHoHuaqDkAjw==", "dev": true, - "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^5.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -5010,11 +5019,10 @@ } }, "node_modules/nodemon/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5429,10 +5437,9 @@ "license": "MIT" }, "node_modules/qs": { - "version": "6.14.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", - "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", - "license": "BSD-3-Clause", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", "dependencies": { "side-channel": "^1.1.0" }, @@ -6209,11 +6216,10 @@ } }, "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" },