@dpype/rest-at-rest
TypeScript icon, indicating that this package has built-in type declarations

0.4.11 • Public • Published

Everything API Endpoints

This document outlines the API endpoints exposed by the "Everything" API. The base path for all endpoints is /v[x], where x is a positive number. The current version is v2.

Authentication

  • POST /auth/refreshToken: Refresh an expired access token using a refresh token.
  • POST /auth/otp/request: Request a One-Time Password (OTP) for a resource.
  • POST /auth/otp/exchange: Verify an OTP and exchange it for an authentication session.

Resource Management

  • POST /api/{collectionName}/{resourceName}: Create a new resource within a specified collection.
  • GET /api/{collectionName}/{resourceName}: Retrieve a list of resources within a specified collection.
  • POST, PATCH, PUT /api/{collectionName}/{resourceName}/{resourceId}: Update an existing resource identified by its resourceId.
  • GET /api/{collectionName}/{resourceName}/{resourceId}: Retrieve a specific resource by its resourceId.

Resource Actions

  • POST /api/{collectionName}/{resourceName}/{resourceId}/actions/{actionType}/{destination}: Perform an action on a resource. The specific action type and destination depend on the use case.

Resource Permissions

  • POST /api/{collectionName}/{resourceName}/{resourceId}/permissions/{accessType}: Assign a permission level (accessType) to a resource.

Notes

  • {collectionName} and {resourceName} are placeholders for the collection and resource names, respectively.
  • {resourceId} is a placeholder for the unique identifier of a specific resource.
  • {actionType} and {destination} define actions that can be performed on a resource.
  • {accessType} determines the permission level granted to a resource.

API Endpoints Overview

General Endpoints

Method Endpoint Description
GET /v2/ Base API endpoint
POST /v2/requests/{requestName} Submit a request
GET /v2/contents/{contentName}/{slug} Retrieve specific content
GET /v2/static/{type}/{slug} Retrieve static content
ANY /v2/{proxy+} Proxy endpoint for dynamic routes

Expanded Proxy Routes

Method Endpoint Function
GET /content/{name}/{slug} staticAssetHandler
POST /requests/{requestName}/{requestId} requestHandler
GET /static/{name}/{slug} staticAssetHandler
GET /auth/passwordless/{slug} passwordLessLoginHandler
POST /auth/refreshToken refreshTokenHandler
POST /auth/otp/request requestResourceOTPHandler
POST /auth/otp/exchange exchangeResourceOTPHandler
POST /api/{collectionName}/{resourceName}/{resourceId}/actions/{actionType}/{destination} tagResourceHandler
POST /api/{collectionName}/{resourceName}/{resourceId}/permissions/{accessType} assignResourcePermissionHandler
POST /api/{collectionName}/{resourceName}/{resourceId}/files/create signUrlForFileUpload
POST /api/{collectionName}/{resourceName}/{resourceId}/files/update updateSignedUrlForFileAccess
POST /api/{collectionName}/{resourceName} createResourceHandler
GET /api/{collectionName}/{resourceName} listResourceHandler
POST, PATCH, PUT /api/{collectionName}/{resourceName}/{resourceId} updateResourceHandler
GET /api/{collectionName}/{resourceName}/{resourceId} getResourceHandler

This document serves as a quick reference for API usage and route configurations.

Readme

Keywords

none

Package Sidebar

Install

npm i @dpype/rest-at-rest

Weekly Downloads

27

Version

0.4.11

License

UNLICENSED

Unpacked Size

1.44 MB

Total Files

25

Last publish

Collaborators

  • aarjae
  • dapore