json-rest-api 1.0.1 → 1.0.3

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 CHANGED
@@ -18,7 +18,7 @@ This tutorial will guide you through building a REST API using the `jsonrestapi`
18
18
  First, let's install the required packages:
19
19
 
20
20
  ```bash
21
- npm install hooked-api jsonrestapi
21
+ npm install hooked-api json-rest-api
22
22
  ```
23
23
 
24
24
  Create a new file called `api.js`:
@@ -33,8 +33,8 @@ The file handling system consists of three main components:
33
33
 
34
34
  ```javascript
35
35
  import { Api } from 'hooked-api';
36
- import { RestApiPlugin, FileHandlingPlugin, ExpressPlugin } from 'jsonrestapi';
37
- import { LocalStorage } from 'jsonrestapi/plugins/storage/local-storage.js';
36
+ import { RestApiPlugin, FileHandlingPlugin, ExpressPlugin } from 'json-rest-api';
37
+ import { LocalStorage } from 'json-rest-api/plugins/storage/local-storage.js';
38
38
 
39
39
  // Create API
40
40
  const api = new Api({ name: 'my-api', version: '1.0.0' });
@@ -122,7 +122,7 @@ Storage adapters handle where and how files are saved. The library includes two
122
122
  Saves files to Amazon S3 or S3-compatible storage:
123
123
 
124
124
  ```javascript
125
- import { S3Storage } from 'jsonrestapi/plugins/storage/s3-storage.js';
125
+ import { S3Storage } from 'json-rest-api/plugins/storage/s3-storage.js';
126
126
 
127
127
  const s3Storage = new S3Storage({
128
128
  bucket: 'my-uploads', // S3 bucket name (required)
@@ -144,7 +144,7 @@ const s3Storage = new S3Storage({
144
144
  Saves files to the local filesystem with secure filename handling:
145
145
 
146
146
  ```javascript
147
- import { LocalStorage } from 'jsonrestapi/plugins/storage/local-storage.js';
147
+ import { LocalStorage } from 'json-rest-api/plugins/storage/local-storage.js';
148
148
 
149
149
  const localStorage = new LocalStorage({
150
150
  directory: './uploads', // Where to save files
@@ -411,8 +411,8 @@ When validation fails, you'll get appropriate error responses:
411
411
 
412
412
  ```javascript
413
413
  import { Api } from 'hooked-api';
414
- import { RestApiPlugin, FileHandlingPlugin, ExpressPlugin } from 'jsonrestapi';
415
- import { LocalStorage } from 'jsonrestapi/plugins/storage/local-storage.js';
414
+ import { RestApiPlugin, FileHandlingPlugin, ExpressPlugin } from 'json-rest-api';
415
+ import { LocalStorage } from 'json-rest-api/plugins/storage/local-storage.js';
416
416
  import express from 'express';
417
417
 
418
418
  // Setup
@@ -493,7 +493,7 @@ api.addScope('articles', {
493
493
  Different strategies for different use cases:
494
494
 
495
495
  ```javascript
496
- import { LocalStorage } from 'jsonrestapi/plugins/storage/local-storage.js';
496
+ import { LocalStorage } from 'json-rest-api/plugins/storage/local-storage.js';
497
497
 
498
498
  // User avatars - use hash for security and deduplication
499
499
  const avatarStorage = new LocalStorage({
@@ -649,7 +649,7 @@ Use the included example to test your setup:
649
649
 
650
650
  ```javascript
651
651
  // Run the example
652
- node ./node_modules/jsonrestapi/examples/file-upload-example.js
652
+ node ./node_modules/json-rest-api/examples/file-upload-example.js
653
653
  ```
654
654
 
655
655
  Then visit http://localhost:3000 to see the test forms.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-rest-api",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  "description": "REST API plugin for hooked-api with JSON:API compliance",
20
20
  "dependencies": {
21
21
  "hooked-api": "^1.0.0",
22
- "jsonrestapi-schema": "^1.0.0",
22
+ "json-rest-schema": "^1.0.0",
23
23
  "qs": "^6.0.0"
24
24
  },
25
25
  "peerDependencies": {
@@ -1,4 +1,4 @@
1
- import CreateSchema from 'jsonrestapi-schema'
1
+ import CreateSchema from 'json-rest-schema'
2
2
  import {
3
3
  validateGetPayload,
4
4
  validateQueryPayload,