From 7e3bed4567350f27feb9c416da8455d77c3f880b Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Thu, 12 Dec 2024 06:56:33 +0100 Subject: [PATCH] Updates --- index.d.ts | 12 +----------- index.js | 5 ----- package-shared/utils/index.js | 8 ++++++++ package.json | 11 ++++++++++- 4 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 package-shared/utils/index.js diff --git a/index.d.ts b/index.d.ts index db8d1ab..8e319bf 100644 --- a/index.d.ts +++ b/index.d.ts @@ -31,11 +31,6 @@ export namespace sql { export { sqlDeleteGenerator }; export { trimSql as trim }; } -import serializeQuery = require("./package-shared/utils/serialize-query"); -import serializeCookies = require("./package-shared/utils/serialize-cookies"); -import EJSON = require("./package-shared/utils/ejson"); -import numberfy = require("./package-shared/utils/numberfy"); -import slugify = require("./package-shared/utils/slugify"); import uploadImage = require("./utils/upload-image"); import uploadFile = require("./utils/upload-file"); import deleteFile = require("./utils/delete-file"); @@ -56,7 +51,7 @@ import sqlInsertGenerator = require("./package-shared/functions/dsql/sql/sql-ins import sqlDeleteGenerator = require("./package-shared/functions/dsql/sql/sql-delete-generator"); import trimSql = require("./package-shared/utils/trim-sql"); export declare namespace utils { - export namespace crypto { + namespace crypto { let encrypt: ({ data, encryptionKey, encryptionSalt }: { data: string; encryptionKey?: string; @@ -72,10 +67,5 @@ export declare namespace utils { encryptionKey?: string; }) => string; } - export { serializeQuery }; - export { serializeCookies }; - export { EJSON }; - export { numberfy }; - export { slugify }; } export { get, post, getSchema, datasquirelClient as client }; diff --git a/index.js b/index.js index fcb0615..d6b14cf 100644 --- a/index.js +++ b/index.js @@ -99,11 +99,6 @@ const datasquirel = { decrypt: require("./package-shared/functions/dsql/decrypt"), hash: require("./package-shared/functions/dsql/hashPassword"), }, - serializeQuery, - serializeCookies, - EJSON: EJSON, - numberfy, - slugify, }, }; diff --git a/package-shared/utils/index.js b/package-shared/utils/index.js new file mode 100644 index 0000000..53e292c --- /dev/null +++ b/package-shared/utils/index.js @@ -0,0 +1,8 @@ +// @ts-check + +exports.numberfy = require("./numberfy"); +exports.slugify = require("./slugify"); +exports.serializeCookies = require("./serialize-cookies"); +exports.serializeQuery = require("./serialize-query"); +exports.trimSql = require("./trim-sql"); +exports.EJSON = require("./ejson"); diff --git a/package.json b/package.json index 670d368..f3e16c4 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,21 @@ { "name": "@moduletrace/datasquirel", - "version": "3.0.0", + "version": "3.0.1", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": { "dsql-watch": "./engine/dsql.js", "dsql-dump": "./engine/dump.js" }, + "exports": { + ".": "./index.js", + "./client": { + "default": "./client/index.js" + }, + "./dsql-utils": { + "default": "./package-shared/utils/index.js" + } + }, "scripts": { "delete-ts": "find . -name \"*.d.ts\" -type f -not -path \"./node_modules/*\" -delete", "compile": "find . -name \"*.d.ts\" -type f -not -path \"./node_modules/*\" -delete && tsc --declaration --allowJs --emitDeclarationOnly --resolveJsonModule index.js",