@restura/core 0.1.0-alpha.2 → 0.1.0-alpha.4

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.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @restura/core
2
+
3
+ Restura is a powerful utility library for building Node.js backend applications with ease. It provides the core functionality to define, validate, and manage your REST API by generating Express.js routes from a schema file. Additionally, it integrates with PostgreSQL databases to handle SQL queries and offers comprehensive authentication and authorization capabilities.
4
+
5
+ `@restura/core` is the core library that powers the Restura framework. It provides the essential functionality to define your REST API, validate input parameters, generate SQL queries, and handle user authentication and authorization. The library is designed to be extensible and customizable, allowing you to build complex backend applications with minimal effort.
6
+
7
+ ## Key Features
8
+
9
+ - **Schema-Based REST API**: Define your entire REST API in a schema file, and automatically generate all the required Express.js routes.
10
+ - **Input Validation**: Automatically detects and validates query and body parameters for all routes.
11
+ - **Authentication & Authorization**: Built-in support for handling user authentication and role-based authorization.
12
+ - **Database Query Generation**: Automatically generate and run SQL queries against a PostgreSQL database, returning properly formatted data.
13
+ - **Post-Validation**: Ensures all data returned from the database is correctly formatted according to your schema.
14
+
15
+ ## Installation and Simple Usage
16
+
17
+ Install the library using npm:
18
+
19
+ ```bash
20
+ pnpm add @restura/core
21
+
22
+ // Todo add more usage instructions
23
+
24
+ ```
25
+
26
+ ## Full Documentation
27
+
28
+ Documentation can be found in the [official Restura documentation](https://restura.io/docs).
29
+
30
+ ## License
31
+
32
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
package/dist/index.cjs ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ isEven: () => isEven
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+ var import_internal = require("@restura/internal");
27
+ function isEven(value) {
28
+ (0, import_internal.log)("isEven called");
29
+ return value % 2 === 0;
30
+ }
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ isEven
34
+ });
35
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { log } from '@restura/internal';\n\nexport function isEven(value: number): boolean {\n\tlog('isEven called');\n\treturn value % 2 === 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoB;AAEb,SAAS,OAAO,OAAwB;AAC9C,2BAAI,eAAe;AACnB,SAAO,QAAQ,MAAM;AACtB;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function isEven(value: number): boolean;
2
+
3
+ export { isEven };
package/dist/index.js CHANGED
@@ -1,35 +1,10 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
1
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- isEven: () => isEven
24
- });
25
- module.exports = __toCommonJS(src_exports);
26
- var import_internal = require("@restura/internal");
2
+ import { log } from "@restura/internal";
27
3
  function isEven(value) {
28
- (0, import_internal.log)("isEven called");
4
+ log("isEven called");
29
5
  return value % 2 === 0;
30
6
  }
31
- // Annotate the CommonJS export names for ESM import in node:
32
- 0 && (module.exports = {
7
+ export {
33
8
  isEven
34
- });
9
+ };
35
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { log } from '@restura/internal';\n\nexport function isEven(value: number): boolean {\n\tlog('isEven called');\n\treturn value % 2 === 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoB;AAEb,SAAS,OAAO,OAAwB;AAC9C,2BAAI,eAAe;AACnB,SAAO,QAAQ,MAAM;AACtB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { log } from '@restura/internal';\n\nexport function isEven(value: number): boolean {\n\tlog('isEven called');\n\treturn value % 2 === 0;\n}\n"],"mappings":";AAAA,SAAS,WAAW;AAEb,SAAS,OAAO,OAAwB;AAC9C,MAAI,eAAe;AACnB,SAAO,QAAQ,MAAM;AACtB;","names":[]}
package/package.json CHANGED
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "name": "@restura/core",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.4",
4
4
  "description": "Restura core utilities for No Code APIs",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.mjs",
7
5
  "types": "./dist/index.d.ts",
8
6
  "repository": "https://github.com/redsky-engineering/restura",
9
7
  "author": "Joshua Hintze",
@@ -11,6 +9,8 @@
11
9
  "files": [
12
10
  "dist/**"
13
11
  ],
12
+ "type": "module",
13
+ "main": "./dist/index.js",
14
14
  "exports": {
15
15
  "import": "./dist/index.mjs",
16
16
  "require": "./dist/index.js"
@@ -22,7 +22,7 @@
22
22
  "sql generator"
23
23
  ],
24
24
  "dependencies": {
25
- "@restura/internal": "0.1.0-alpha.2"
25
+ "@restura/internal": "0.1.0-alpha.4"
26
26
  },
27
27
  "devDependencies": {
28
28
  "tsup": "^8.3.0"