Skip to content

Commit 788e120

Browse files
committed
feat: add various axis routes
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 8c0dbe6 commit 788e120

File tree

49 files changed

+2281
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2281
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var schema = require( './schema.json' );
24+
var handler = require( './main.js' );
25+
26+
27+
// MAIN //
28+
29+
/**
30+
* Defines a route handler for receiving updating a plot configuration.
31+
*
32+
* @private
33+
* @returns {Object} route declaration
34+
*/
35+
function route() {
36+
schema.handler = handler;
37+
return schema;
38+
}
39+
40+
41+
// EXPORTS //
42+
43+
module.exports = route;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var middleware = require( './../../../../middleware_sequence.js' );
24+
var allowCredentials = require( './../../../../middleware/allow-credentials' );
25+
var tryAssign = require( './../../../../middleware/plot-try-assign' );
26+
var body = require( './../../../../middleware/body' );
27+
var ok = require( './../../../../middleware/ok' );
28+
var onError = require( './../../../../middleware/error' );
29+
var transform = require( './../../transforms.js' ).toBoolean;
30+
31+
32+
// VARIABLES //
33+
34+
var steps = [
35+
allowCredentials,
36+
body,
37+
tryAssign( [ 'config', 'axes', ':axis' ], 'orient', transform ),
38+
ok
39+
];
40+
41+
42+
// MAIN //
43+
44+
/**
45+
* Request handler for updating a plot configuration.
46+
*
47+
* @private
48+
* @name handler
49+
* @type {Function}
50+
* @param {Object} request - request object
51+
* @param {Object} response - response object
52+
*/
53+
var handler = middleware( steps, onError );
54+
55+
56+
// EXPORTS //
57+
58+
module.exports = handler;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"method": "POST",
3+
"url": "/config/axes/:axis/orient",
4+
"schema": {
5+
"response": {
6+
"200": {
7+
"type": "string"
8+
},
9+
"400": {
10+
"type": "object",
11+
"properties": {
12+
"statusCode": {
13+
"type": "integer"
14+
},
15+
"error": {
16+
"type": "string"
17+
},
18+
"message": {
19+
"type": "string"
20+
}
21+
}
22+
},
23+
"413": {
24+
"type": "object",
25+
"properties": {
26+
"statusCode": {
27+
"type": "integer"
28+
},
29+
"error": {
30+
"type": "string"
31+
},
32+
"message": {
33+
"type": "string"
34+
}
35+
}
36+
}
37+
}
38+
},
39+
"handler": null
40+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var schema = require( './schema.json' );
24+
var handler = require( './main.js' );
25+
26+
27+
// MAIN //
28+
29+
/**
30+
* Defines a route handler for receiving updating a plot configuration.
31+
*
32+
* @private
33+
* @returns {Object} route declaration
34+
*/
35+
function route() {
36+
schema.handler = handler;
37+
return schema;
38+
}
39+
40+
41+
// EXPORTS //
42+
43+
module.exports = route;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var middleware = require( './../../../../middleware_sequence.js' );
24+
var allowCredentials = require( './../../../../middleware/allow-credentials' );
25+
var tryAssign = require( './../../../../middleware/plot-try-assign' );
26+
var body = require( './../../../../middleware/body' );
27+
var ok = require( './../../../../middleware/ok' );
28+
var onError = require( './../../../../middleware/error' );
29+
var transform = require( './../../transforms.js' ).toNumber;
30+
31+
32+
// VARIABLES //
33+
34+
var steps = [
35+
allowCredentials,
36+
body,
37+
tryAssign( [ 'config', 'axes', ':axis' ], 'bandPosition', transform ),
38+
ok
39+
];
40+
41+
42+
// MAIN //
43+
44+
/**
45+
* Request handler for updating a plot configuration.
46+
*
47+
* @private
48+
* @name handler
49+
* @type {Function}
50+
* @param {Object} request - request object
51+
* @param {Object} response - response object
52+
*/
53+
var handler = middleware( steps, onError );
54+
55+
56+
// EXPORTS //
57+
58+
module.exports = handler;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"method": "POST",
3+
"url": "/config/axes/:axis/bandPosition",
4+
"schema": {
5+
"response": {
6+
"200": {
7+
"type": "string"
8+
},
9+
"400": {
10+
"type": "object",
11+
"properties": {
12+
"statusCode": {
13+
"type": "integer"
14+
},
15+
"error": {
16+
"type": "string"
17+
},
18+
"message": {
19+
"type": "string"
20+
}
21+
}
22+
},
23+
"413": {
24+
"type": "object",
25+
"properties": {
26+
"statusCode": {
27+
"type": "integer"
28+
},
29+
"error": {
30+
"type": "string"
31+
},
32+
"message": {
33+
"type": "string"
34+
}
35+
}
36+
}
37+
}
38+
},
39+
"handler": null
40+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var schema = require( './schema.json' );
24+
var handler = require( './main.js' );
25+
26+
27+
// MAIN //
28+
29+
/**
30+
* Defines a route handler for receiving updating a plot configuration.
31+
*
32+
* @private
33+
* @returns {Object} route declaration
34+
*/
35+
function route() {
36+
schema.handler = handler;
37+
return schema;
38+
}
39+
40+
41+
// EXPORTS //
42+
43+
module.exports = route;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var middleware = require( './../../../../middleware_sequence.js' );
24+
var allowCredentials = require( './../../../../middleware/allow-credentials' );
25+
var tryAssign = require( './../../../../middleware/plot-try-assign' );
26+
var body = require( './../../../../middleware/body' );
27+
var ok = require( './../../../../middleware/ok' );
28+
var onError = require( './../../../../middleware/error' );
29+
30+
31+
// VARIABLES //
32+
33+
var steps = [
34+
allowCredentials,
35+
body,
36+
tryAssign( [ 'config', 'axes', ':axis' ], 'description' ),
37+
ok
38+
];
39+
40+
41+
// MAIN //
42+
43+
/**
44+
* Request handler for updating a plot configuration.
45+
*
46+
* @private
47+
* @name handler
48+
* @type {Function}
49+
* @param {Object} request - request object
50+
* @param {Object} response - response object
51+
*/
52+
var handler = middleware( steps, onError );
53+
54+
55+
// EXPORTS //
56+
57+
module.exports = handler;

0 commit comments

Comments
 (0)