@joystick.js/node-canary 0.0.0-canary.356 → 0.0.0-canary.357
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"./add.js";import m from"./remove.js";import e from"./list.js";import t from"./grant.js";import f from"./revoke.js";import r from"./user_has_role.js";
|
|
1
|
+
import o from"./add.js";import m from"./remove.js";import e from"./list.js";import t from"./grant.js";import f from"./revoke.js";import r from"./user_has_role.js";const i={add:o,remove:m,list:e,grant:t,revoke:f,userHasRole:r,user_has_role:r};var n=i;export{n as default};
|
package/increment_version.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
import child_process from 'child_process';
|
|
2
2
|
|
|
3
|
-
// import fs from 'fs';
|
|
4
|
-
|
|
5
|
-
// const raw_package_json = fs.readFileSync('package.json', 'utf-8');
|
|
6
|
-
// const package_json = JSON.parse(raw_package_json);
|
|
7
|
-
// const version_parts = package_json.version.split('.');
|
|
8
|
-
// const current_patch_version = version_parts?.pop();
|
|
9
|
-
|
|
10
|
-
// package_json.version = `${version_parts?.join('.')}.${parseInt(current_patch_version, 10) + 1}`;
|
|
11
|
-
|
|
12
|
-
// fs.writeFileSync('package.json', JSON.stringify(package_json, null, 2));
|
|
13
|
-
|
|
14
3
|
child_process.execSync(`npm version prerelease --preid=canary`);
|
package/package.json
CHANGED
|
@@ -5,13 +5,14 @@ import grant from './grant.js';
|
|
|
5
5
|
import revoke from './revoke.js';
|
|
6
6
|
import user_has_role from './user_has_role.js';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const roles = {
|
|
9
9
|
add,
|
|
10
10
|
remove,
|
|
11
11
|
list,
|
|
12
12
|
grant,
|
|
13
13
|
revoke,
|
|
14
|
-
// NOTE: Keep camelCase here for backwards compatibility.
|
|
15
14
|
userHasRole: user_has_role,
|
|
16
15
|
user_has_role,
|
|
17
|
-
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default roles;
|
|
@@ -2,13 +2,10 @@ import format_api_error from "./format_api_error.js";
|
|
|
2
2
|
import types from "../../lib/types.js";
|
|
3
3
|
|
|
4
4
|
const handle_api_error = (location = '', error = '', res = {}) => {
|
|
5
|
-
// NOTE: This is an internal Joystick error that we control.
|
|
5
|
+
// NOTE: This is an internal Joystick error that we control. Should be
|
|
6
|
+
// in the shape of { errors: [] } pre-formatted.
|
|
6
7
|
if (types.is_object(error) && !(error instanceof Error)) {
|
|
7
8
|
return res.status((error?.errors && error?.errors[0]?.status) || 500).send(
|
|
8
|
-
// TODO: This should match the output of format_api_error(). We can either
|
|
9
|
-
// do a mapping here, or, ensure that when we *do* return an object with
|
|
10
|
-
// an errors array, each error in that array is shaped identical to the
|
|
11
|
-
// output of format_api_error().
|
|
12
9
|
JSON.stringify(error)
|
|
13
10
|
);
|
|
14
11
|
}
|