Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codeplaydata/adapters

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codeplaydata/adapters - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

Collection.d.ts

3

Connection.d.ts

@@ -7,3 +7,4 @@ import { IndexOperations, IndexedDBQuery, LocalStorageQuery, MongoQuery } from "./enums.js";

database?: unknown;
store: string;
store?: string;
collection?: string;
indexNames?: unknown;

@@ -10,0 +11,0 @@ pipeline?(descriptions: unknown): any;

@@ -16,3 +16,3 @@ // @filename: GPUDeviceAdapter.ts

*/
import { NoGpuAvaiable } from "../error/NoGpuAvaiable.js";
import { NoGpuAvaiable } from "./error/NoGpuAvailable.js";
class GPUDeviceAdapter {

@@ -19,0 +19,0 @@ adapter;

@@ -1,1 +0,27 @@

"use strict";
// @filename: Axios.ts
import axios, { AxiosHeaders } from "axios";
import { AxiosInvalidArgument } from "./error/AxiosInvalidArgument.js";
class Axios {
send(requestOrUrl, options) {
if (requestOrUrl instanceof Request) {
const { url, method, referrer, headers, body } = requestOrUrl;
let axiosHeaders = new AxiosHeaders();
headers.forEach((value, key) => {
axiosHeaders.set(key, value);
});
return axios(url, {
method,
baseURL: `${referrer}/${url}`,
headers: axiosHeaders,
data: body
});
}
else if (typeof requestOrUrl === 'string') {
return axios(requestOrUrl, options);
}
else {
throw new AxiosInvalidArgument();
}
}
}
export { Axios };

@@ -9,3 +9,11 @@ import { HttpClient } from "../HttpClient.js";

send(request: Request): Promise<Response>;
/**
* An implementation of a httpClient from the FetchAPI.
* @param url @type { string }
* @param options @type {{ [key: string]: any }}
*/
send(url: string, options?: {
[key: string]: any;
}): Promise<Response>;
}
export { Fetch };
// @filename: Fetch.ts
import { FetchInvalidArgument } from "./error/FetchInvalidArgument.js";
class Fetch {
/**
* An implementation of a httpClient from the FetchAPI.
* @param request An object derived from Request constructor to be fetched.
* @returns @type { Promise<Response> } The eventLoopIdentifier of the request. Be aware, is not the Response directly.
*/
send(request) {
return fetch(request);
send(requestOrUrl, options) {
if (requestOrUrl instanceof Request) {
return fetch(requestOrUrl);
}
else if (typeof requestOrUrl === 'string') {
return fetch(requestOrUrl, options);
}
else {
throw new FetchInvalidArgument();
}
}
}
export { Fetch };

@@ -21,6 +21,9 @@ // @filename: Fetch.test.ts

const httpclient = new Fetch();
it('uma requisição GET.', async () => {
it('uma Request.', async () => {
const request = new Request('https://httpstat.us/200');
strictEqual((await httpclient.send(request)).status, 200);
});
it('uma url.', async () => {
strictEqual((await httpclient.send('https://httpstat.us/200')).status, 200);
});
});
interface HttpClient {
send(request: Request): Promise<Response> | Response;
send(url: string, options?: any): Promise<Response>;
}
export { HttpClient };

@@ -1,9 +0,9 @@

import { IndexedDB, IDBIndex, IDBRepo, IDBConfig } from "./databases/browser/IndexedDB.js";
import { LocalStorage } from "./databases/browser/LocalStorage.js";
import { MongoDB } from "./databases/document/MongoDB.js";
import { IndexedDB, IDBIndex, IDBRepo, IDBConfig } from "./databases/browser/IndexedDB/IndexedDB.js";
import { LocalStorage } from "./databases/browser/LocalStorage/LocalStorage.js";
import { MongoDB } from "./databases/document/MongoDB/MongoDB.js";
import { Fetch } from "./http/client/Fetch/Fetch.js";
import { HttpClient } from "./http/client/HttpClient.js";
import { Collection } from "./collections/Collection.js";
import { Queue } from "./collections/Queue.js";
import { GenericQueue, DatabaseQuery } from "./collections/GenericQueue.js";
import { Collection } from "./Collection.js";
import { Queue } from "./queue/memory/Queue.js";
import { GenericQueue, DatabaseQuery } from "./queue/memory/GenericQueue.js";
import { ExpressServer } from "./http/server/Express/Server.js";

@@ -10,0 +10,0 @@ import { ExpressRouter } from "./http/server/Express/Router.js";

@@ -16,7 +16,7 @@ // @filename: index.ts

*/
import { IndexedDB } from "./databases/browser/IndexedDB.js";
import { LocalStorage } from "./databases/browser/LocalStorage.js";
import { MongoDB } from "./databases/document/MongoDB.js";
import { IndexedDB } from "./databases/browser/IndexedDB/IndexedDB.js";
import { LocalStorage } from "./databases/browser/LocalStorage/LocalStorage.js";
import { MongoDB } from "./databases/document/MongoDB/MongoDB.js";
import { Fetch } from "./http/client/Fetch/Fetch.js";
import { GenericQueue } from "./collections/GenericQueue.js";
import { GenericQueue } from "./queue/memory/GenericQueue.js";
import { ExpressServer } from "./http/server/Express/Server.js";

@@ -23,0 +23,0 @@ import { ExpressRouter } from "./http/server/Express/Router.js";

{
"name": "@codeplaydata/adapters",
"version": "0.6.0",
"version": "0.6.1",
"type": "module",

@@ -31,2 +31,3 @@ "main": "index.js",

"@webgpu/types": "^0.1.23",
"dotenv": "^16.0.3",
"mock-local-storage": "^1.1.23",

@@ -36,2 +37,3 @@ "typescript": "^4.7.4"

"dependencies": {
"axios": "^1.4.0",
"express": "^4.18.2",

@@ -38,0 +40,0 @@ "mongodb": "^4.12.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc