From 2865bb7d3aa343310d755e0f02cf7a651c37a3ea Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sun, 2 Jun 2024 13:36:52 +0800 Subject: [PATCH] Update package definitions Split modules to each package. --- packages/core/package.json | 44 +- packages/core/pridepack.json | 7 +- packages/core/src/backend/server.ts | 4 +- packages/core/src/common/index.ts | 1 + packages/core/src/index.ts | 0 packages/data-sources/duckdb/.gitignore | 107 +++ packages/data-sources/duckdb/LICENSE | 7 + packages/data-sources/duckdb/package.json | 67 ++ packages/data-sources/duckdb/pridepack.json | 3 + packages/data-sources/duckdb/src/index.ts | 268 ++++++ .../data-sources/duckdb/test/index.test.ts | 8 + packages/data-sources/duckdb/tsconfig.json | 23 + packages/data-sources/file-jsonl/.gitignore | 107 +++ packages/data-sources/file-jsonl/LICENSE | 7 + packages/data-sources/file-jsonl/package.json | 66 ++ .../data-sources/file-jsonl/pridepack.json | 3 + packages/data-sources/file-jsonl/src/index.ts | 255 ++++++ .../file-jsonl/test/index.test.ts | 236 +++++ .../data-sources/file-jsonl/tsconfig.json | 23 + .../examples/http-resource-server/.gitignore | 107 +++ .../http-resource-server/package.json | 45 + .../http-resource-server/pridepack.json | 3 + .../http-resource-server/src/index.ts | 6 + .../http-resource-server/test/index.test.ts | 8 + .../http-resource-server/tsconfig.json | 23 + packages/extenders/http/.gitignore | 107 +++ packages/extenders/http/LICENSE | 7 + packages/extenders/http/package.json | 49 ++ packages/extenders/http/pridepack.json | 7 + .../http/src}/backend/core.ts | 9 +- .../http/src}/backend/index.ts | 0 .../http/src/client/core.ts} | 6 +- packages/extenders/http/src/client/index.ts | 1 + .../http/test}/default.test.ts | 14 +- .../http/test/error-handling.test.ts} | 10 +- packages/extenders/http/tsconfig.json | 23 + packages/recipes/resource/.gitignore | 107 +++ packages/recipes/resource/LICENSE | 7 + packages/recipes/resource/package.json | 49 ++ packages/recipes/resource/pridepack.json | 3 + .../resource => recipes/resource/src}/core.ts | 5 +- .../resource/src}/implementation/create.ts | 4 +- .../resource/src}/implementation/delete.ts | 4 +- .../resource/src}/implementation/emplace.ts | 4 +- .../resource/src}/implementation/fetch.ts | 4 +- .../src}/implementation/patch-delta.ts | 4 +- .../src}/implementation/patch-merge.ts | 4 +- .../resource/src}/implementation/query.ts | 4 +- .../resource/src}/index.ts | 0 .../resource/src}/response.ts | 2 +- packages/recipes/resource/test/index.test.ts | 8 + packages/recipes/resource/tsconfig.json | 23 + pnpm-lock.yaml | 828 +++++++++++++++++- 53 files changed, 2659 insertions(+), 62 deletions(-) delete mode 100644 packages/core/src/index.ts create mode 100644 packages/data-sources/duckdb/.gitignore create mode 100644 packages/data-sources/duckdb/LICENSE create mode 100644 packages/data-sources/duckdb/package.json create mode 100644 packages/data-sources/duckdb/pridepack.json create mode 100644 packages/data-sources/duckdb/src/index.ts create mode 100644 packages/data-sources/duckdb/test/index.test.ts create mode 100644 packages/data-sources/duckdb/tsconfig.json create mode 100644 packages/data-sources/file-jsonl/.gitignore create mode 100644 packages/data-sources/file-jsonl/LICENSE create mode 100644 packages/data-sources/file-jsonl/package.json create mode 100644 packages/data-sources/file-jsonl/pridepack.json create mode 100644 packages/data-sources/file-jsonl/src/index.ts create mode 100644 packages/data-sources/file-jsonl/test/index.test.ts create mode 100644 packages/data-sources/file-jsonl/tsconfig.json create mode 100644 packages/examples/http-resource-server/.gitignore create mode 100644 packages/examples/http-resource-server/package.json create mode 100644 packages/examples/http-resource-server/pridepack.json create mode 100644 packages/examples/http-resource-server/src/index.ts create mode 100644 packages/examples/http-resource-server/test/index.test.ts create mode 100644 packages/examples/http-resource-server/tsconfig.json create mode 100644 packages/extenders/http/.gitignore create mode 100644 packages/extenders/http/LICENSE create mode 100644 packages/extenders/http/package.json create mode 100644 packages/extenders/http/pridepack.json rename packages/{core/src/extenders/http => extenders/http/src}/backend/core.ts (95%) rename packages/{core/src/extenders/http => extenders/http/src}/backend/index.ts (100%) rename packages/{core/src/extenders/http/client.ts => extenders/http/src/client/core.ts} (94%) create mode 100644 packages/extenders/http/src/client/index.ts rename packages/{core/test/http => extenders/http/test}/default.test.ts (90%) rename packages/{core/test/index.test.ts => extenders/http/test/error-handling.test.ts} (92%) create mode 100644 packages/extenders/http/tsconfig.json create mode 100644 packages/recipes/resource/.gitignore create mode 100644 packages/recipes/resource/LICENSE create mode 100644 packages/recipes/resource/package.json create mode 100644 packages/recipes/resource/pridepack.json rename packages/{core/src/recipes/resource => recipes/resource/src}/core.ts (93%) rename packages/{core/src/recipes/resource => recipes/resource/src}/implementation/create.ts (63%) rename packages/{core/src/recipes/resource => recipes/resource/src}/implementation/delete.ts (63%) rename packages/{core/src/recipes/resource => recipes/resource/src}/implementation/emplace.ts (63%) rename packages/{core/src/recipes/resource => recipes/resource/src}/implementation/fetch.ts (89%) rename packages/{core/src/recipes/resource => recipes/resource/src}/implementation/patch-delta.ts (63%) rename packages/{core/src/recipes/resource => recipes/resource/src}/implementation/patch-merge.ts (63%) rename packages/{core/src/recipes/resource => recipes/resource/src}/implementation/query.ts (63%) rename packages/{core/src/recipes/resource => recipes/resource/src}/index.ts (100%) rename packages/{core/src/recipes/resource => recipes/resource/src}/response.ts (87%) create mode 100644 packages/recipes/resource/test/index.test.ts create mode 100644 packages/recipes/resource/tsconfig.json diff --git a/packages/core/package.json b/packages/core/package.json index bab0cf9..d9a7b4c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,5 +1,5 @@ { - "name": "core", + "name": "@modal-sh/yasumi", "version": "0.0.0", "files": [ "dist", @@ -45,5 +45,47 @@ }, "dependencies": { "valibot": "^0.30.0" + }, + "types": "./dist/types/common/index.d.ts", + "main": "./dist/cjs/production/index.js", + "module": "./dist/esm/production/index.js", + "exports": { + ".": { + "development": { + "require": "./dist/cjs/development/index.js", + "import": "./dist/esm/development/index.js" + }, + "require": "./dist/cjs/production/index.js", + "import": "./dist/esm/production/index.js", + "types": "./dist/types/common/index.d.ts" + }, + "./backend": { + "development": { + "require": "./dist/cjs/development/backend.js", + "import": "./dist/esm/development/backend.js" + }, + "require": "./dist/cjs/production/backend.js", + "import": "./dist/esm/production/backend.js", + "types": "./dist/types/backend/index.d.ts" + }, + "./client": { + "development": { + "require": "./dist/cjs/development/client.js", + "import": "./dist/esm/development/client.js" + }, + "require": "./dist/cjs/production/client.js", + "import": "./dist/esm/production/client.js", + "types": "./dist/types/client/index.d.ts" + } + }, + "typesVersions": { + "*": { + "backend": [ + "./dist/types/backend/index.d.ts" + ], + "client": [ + "./dist/types/client/index.d.ts" + ] + } } } diff --git a/packages/core/pridepack.json b/packages/core/pridepack.json index 0bc7a8f..0ef3915 100644 --- a/packages/core/pridepack.json +++ b/packages/core/pridepack.json @@ -1,3 +1,8 @@ { - "target": "es2018" + "target": "es2018", + "entrypoints": { + ".": "src/common/index.ts", + "./backend": "src/backend/index.ts", + "./client": "src/client/index.ts" + } } diff --git a/packages/core/src/backend/server.ts b/packages/core/src/backend/server.ts index 585f4f4..f2b5aea 100644 --- a/packages/core/src/backend/server.ts +++ b/packages/core/src/backend/server.ts @@ -1,9 +1,9 @@ import {ServiceParams} from '../common'; import {Backend as BaseBackend} from './common'; -export interface ServerRequest {} +export interface ServerRequestContext {} -export interface ServerResponse {} +export interface ServerResponseContext {} export interface ServerParams { backend: Backend; diff --git a/packages/core/src/common/index.ts b/packages/core/src/common/index.ts index c963675..5657c21 100644 --- a/packages/core/src/common/index.ts +++ b/packages/core/src/common/index.ts @@ -5,6 +5,7 @@ export * from './language'; export * from './media-type'; export * from './operation'; export * from './queries'; +export * from './recipe'; export * from './response'; export * from './service'; export * as statusCodes from './status-codes'; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/data-sources/duckdb/.gitignore b/packages/data-sources/duckdb/.gitignore new file mode 100644 index 0000000..53992de --- /dev/null +++ b/packages/data-sources/duckdb/.gitignore @@ -0,0 +1,107 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.production +.env.development + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +.npmrc diff --git a/packages/data-sources/duckdb/LICENSE b/packages/data-sources/duckdb/LICENSE new file mode 100644 index 0000000..5a4fdfd --- /dev/null +++ b/packages/data-sources/duckdb/LICENSE @@ -0,0 +1,7 @@ +MIT License Copyright (c) 2024 TheoryOfNekomata + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/data-sources/duckdb/package.json b/packages/data-sources/duckdb/package.json new file mode 100644 index 0000000..8f62054 --- /dev/null +++ b/packages/data-sources/duckdb/package.json @@ -0,0 +1,67 @@ +{ + "name": "@modal-sh/yasumi-data-source-duckdb", + "version": "0.0.0", + "files": [ + "dist", + "src" + ], + "engines": { + "node": ">=16" + }, + "license": "MIT", + "keywords": [ + "pridepack" + ], + "devDependencies": { + "@types/node": "^20.11.0", + "pridepack": "2.6.0", + "tslib": "^2.6.2", + "typescript": "^5.3.3", + "vitest": "^1.2.0" + }, + "dependencies": { + "@modal-sh/yasumi": "workspace:*", + "duckdb-async": "^0.10.0" + }, + "scripts": { + "prepublishOnly": "pridepack clean && pridepack build", + "build": "pridepack build", + "type-check": "pridepack check", + "clean": "pridepack clean", + "watch": "pridepack watch", + "start": "pridepack start", + "dev": "pridepack dev", + "test": "vitest" + }, + "private": false, + "description": "DuckDB adapter for Yasumi.", + "repository": { + "url": "", + "type": "git" + }, + "homepage": "", + "bugs": { + "url": "" + }, + "author": "TheoryOfNekomata ", + "publishConfig": { + "access": "public" + }, + "types": "./dist/types/index.d.ts", + "main": "./dist/cjs/production/index.js", + "module": "./dist/esm/production/index.js", + "exports": { + ".": { + "development": { + "require": "./dist/cjs/development/index.js", + "import": "./dist/esm/development/index.js" + }, + "require": "./dist/cjs/production/index.js", + "import": "./dist/esm/production/index.js", + "types": "./dist/types/index.d.ts" + } + }, + "typesVersions": { + "*": {} + } +} diff --git a/packages/data-sources/duckdb/pridepack.json b/packages/data-sources/duckdb/pridepack.json new file mode 100644 index 0000000..0bc7a8f --- /dev/null +++ b/packages/data-sources/duckdb/pridepack.json @@ -0,0 +1,3 @@ +{ + "target": "es2018" +} diff --git a/packages/data-sources/duckdb/src/index.ts b/packages/data-sources/duckdb/src/index.ts new file mode 100644 index 0000000..a25fba7 --- /dev/null +++ b/packages/data-sources/duckdb/src/index.ts @@ -0,0 +1,268 @@ +import { Resource, validation as v, BaseResourceType } from '@modal-sh/yasumi'; +import { DataSource, ResourceIdConfig } from '@modal-sh/yasumi/backend'; +import { Database } from 'duckdb-async'; +import assert from 'assert'; + +type ID = number; + +interface DuckDbDataSourceBase< + ID, + Schema extends v.BaseSchema = v.BaseSchema, + CurrentName extends string = string, + CurrentRouteName extends string = string, + Data extends object = v.Output, +> extends DataSource { + resource?: Resource; + + db?: Database; +} + +export const AutoincrementIdConfig = { + // TODO add options: https://duckdb.org/docs/sql/statements/create_sequence + generationStrategy: async (dataSourceRaw: DataSource) => { + const dataSource = dataSourceRaw as DuckDbDataSourceBase; + assert(typeof dataSource.db !== 'undefined'); + assert(typeof dataSource.resource !== 'undefined'); + const idAttr = dataSource.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string'); + + const con = await dataSource.db.connect(); + const stmt = await con.prepare(` + SELECT nextval('${dataSource.resource.state.routeName}_sequence') as ${idAttr}; + `); + const [v] = await stmt.all(); + return v[idAttr]; + }, + schema: v.number(), + serialize: (v: unknown) => v?.toString() ?? '', + deserialize: (v: string) => Number(v), +} + +export class DuckDbDataSource< + Schema extends v.BaseSchema = v.BaseSchema, + CurrentName extends string = string, + CurrentRouteName extends string = string, + Data extends object = v.Output, +> implements DuckDbDataSourceBase { + resource?: Resource; + + db?: Database; + + constructor(private readonly path: string) { + // noop + } + + async initialize() { + assert(typeof this.path !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const idConfig = this.resource.state.shared.get('idConfig') as ResourceIdConfig | undefined; + assert(typeof idConfig !== 'undefined'); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string'); + + const idSchema = idConfig.schema as v.BaseSchema; + + this.db = await Database.create(this.path); + const clause = `CREATE TABLE IF NOT EXISTS ${this.resource.state.routeName}`; + const resourceSchema = this.resource.schema as unknown as v.ObjectSchema; + const tableSchema = Object.entries(resourceSchema.entries) + .map(([columnName, columnDefRaw]) => { + const columnDef = columnDefRaw as unknown as v.BaseSchema; + return [columnName, columnDef.type].join(' '); + }) + .join(','); + let sequenceSql = ''; + let defaultValue = ''; + let idType = 'STRING'; + if (idSchema.type === 'number') { + // TODO support more sequence statements: https://duckdb.org/docs/sql/statements/create_sequence + sequenceSql = `CREATE SEQUENCE IF NOT EXISTS ${this.resource.state.routeName}_sequence START 1;`; + defaultValue = `DEFAULT nextval('${this.resource.state.routeName}_sequence')`; + idType = 'INTEGER'; + } + const sql = `${sequenceSql}${clause} (${idAttr} ${idType} ${defaultValue},${tableSchema});`; + const con = await this.db.connect(); + const stmt = await con.prepare(sql); + await stmt.run(); + } + + prepareResource(resource: Resource) { + resource.dataSource = resource.dataSource ?? this; + const originalResourceId = resource.id; + resource.id = (newIdAttr: NewIdAttr, params: ResourceIdConfig) => { + originalResourceId(newIdAttr, params); + return resource as Resource; + }; + this.resource = resource as any; + } + + async getMultiple(query) { + // TODO translate query to SQL statements + assert(typeof this.db !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const con = await this.db.connect(); + const stmt = await con.prepare(` + SELECT * FROM ${this.resource.state.routeName}; + `); + const data = await stmt.all(); + return data as Data[]; + } + + async newId() { + assert(typeof this.resource !== 'undefined'); + const idConfig = this.resource.state.shared.get('idConfig') as ResourceIdConfig; + assert(typeof idConfig !== 'undefined'); + + const theNewId = await idConfig.generationStrategy(this); + return theNewId as ID; + } + + async create(data: Data) { + assert(typeof this.db !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const idConfig = this.resource.state.shared.get('idConfig') as ResourceIdConfig | undefined; + assert(typeof idConfig !== 'undefined'); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string'); + + let theId: any; + const { [idAttr]: dataId } = data as Record; + if (typeof dataId !== 'undefined') { + theId = idConfig.deserialize((data as Record)[idAttr]); + } else { + const newId = await this.newId(); + theId = idConfig.deserialize(newId.toString()); + } + const effectiveData = { + ...data, + } as Record; + effectiveData[idAttr] = theId; + + const clause = `INSERT INTO ${this.resource.state.routeName}`; + const keys = Object.keys(effectiveData).join(','); + const values = Object.values(effectiveData).map((d) => JSON.stringify(d).replace(/"/g, "'")).join(','); + const sql = `${clause} (${keys}) VALUES (${values});`; + const con = await this.db.connect(); + const stmt = await con.prepare(sql); + await stmt.run(); + const newData = { + ...effectiveData + }; + return newData as Data; + } + + async getTotalCount(query) { + assert(typeof this.db !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string'); + + const con = await this.db.connect(); + const stmt = await con.prepare(` + SELECT COUNT(*) as c FROM ${this.resource.state.routeName}; + `); + const [data] = await stmt.all(); + return data['c'] as unknown as number; + } + + async getById(id: ID) { + assert(typeof this.db !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string'); + + const con = await this.db.connect(); + const stmt = await con.prepare(` + SELECT * FROM ${this.resource.state.routeName} WHERE ${idAttr} = ${JSON.stringify(id).replace(/"/g, "'")}; + `); + const [data = null] = await stmt.all(); + return data as Data | null; + } + + async getSingle(query) { + assert(typeof this.db !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const con = await this.db.connect(); + const stmt = await con.prepare(` + SELECT * FROM ${this.resource.state.routeName} LIMIT 1; + `); + const [data = null] = await stmt.all(); + return data as Data | null; + } + + async delete(id: ID) { + assert(typeof this.db !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string'); + + const con = await this.db.connect(); + const stmt = await con.prepare(` + DELETE FROM ${this.resource.state.routeName} WHERE ${idAttr} = ${JSON.stringify(id).replace(/"/g, "'")}; + `); + await stmt.run(); + } + + async emplace(id: ID, data: Data) { + assert(typeof this.db !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string'); + + const clause = `INSERT OR REPLACE INTO ${this.resource.state.routeName}`; + const keys = Object.keys(data).join(','); + const values = Object.values(data).map((d) => JSON.stringify(d).replace(/"/g, "'")).join(','); + const sql = `${clause} (${idAttr},${keys}) VALUES (${id},${values});`; + const con = await this.db.connect(); + const stmt = await con.prepare(sql); + const [newData] = await stmt.all(); + // TODO check if created flag + return [newData, false] as [Data, boolean]; + } + + async patch(id: ID, data: Partial) { + assert(typeof this.db !== 'undefined'); + assert(typeof this.resource !== 'undefined'); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string'); + + const clause = `UPDATE ${this.resource.state.routeName}`; + const setParams = Object.entries(data).map(([key, value]) => ( + `${key} = ${JSON.stringify(value).replace(/"/g, "'")}` + )).join(','); + const sql = `${clause} SET ${setParams} WHERE ${idAttr} = ${JSON.stringify(id).replace(/"/g, "'")}` + const con = await this.db.connect(); + const stmt = await con.prepare(sql); + const [newData] = await stmt.all(); + return newData as Data; + } +} diff --git a/packages/data-sources/duckdb/test/index.test.ts b/packages/data-sources/duckdb/test/index.test.ts new file mode 100644 index 0000000..441ca94 --- /dev/null +++ b/packages/data-sources/duckdb/test/index.test.ts @@ -0,0 +1,8 @@ +import { describe, it, expect } from 'vitest'; +import add from '../src'; + +describe('blah', () => { + it('works', () => { + expect(add(1, 1)).toEqual(2); + }); +}); diff --git a/packages/data-sources/duckdb/tsconfig.json b/packages/data-sources/duckdb/tsconfig.json new file mode 100644 index 0000000..74083d7 --- /dev/null +++ b/packages/data-sources/duckdb/tsconfig.json @@ -0,0 +1,23 @@ +{ + "exclude": ["node_modules"], + "include": ["src", "types"], + "compilerOptions": { + "module": "ESNext", + "lib": ["ESNext"], + "importHelpers": true, + "declaration": true, + "sourceMap": true, + "rootDir": "./src", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "bundler", + "jsx": "react", + "esModuleInterop": true, + "target": "es2018", + "useDefineForClassFields": false, + "declarationMap": true + } +} diff --git a/packages/data-sources/file-jsonl/.gitignore b/packages/data-sources/file-jsonl/.gitignore new file mode 100644 index 0000000..53992de --- /dev/null +++ b/packages/data-sources/file-jsonl/.gitignore @@ -0,0 +1,107 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.production +.env.development + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +.npmrc diff --git a/packages/data-sources/file-jsonl/LICENSE b/packages/data-sources/file-jsonl/LICENSE new file mode 100644 index 0000000..5a4fdfd --- /dev/null +++ b/packages/data-sources/file-jsonl/LICENSE @@ -0,0 +1,7 @@ +MIT License Copyright (c) 2024 TheoryOfNekomata + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/data-sources/file-jsonl/package.json b/packages/data-sources/file-jsonl/package.json new file mode 100644 index 0000000..7bfa665 --- /dev/null +++ b/packages/data-sources/file-jsonl/package.json @@ -0,0 +1,66 @@ +{ + "name": "@modal-sh/yasumi-data-source-file-jsonl", + "version": "0.0.0", + "files": [ + "dist", + "src" + ], + "engines": { + "node": ">=16" + }, + "license": "MIT", + "keywords": [ + "pridepack" + ], + "devDependencies": { + "@types/node": "^20.11.0", + "pridepack": "2.6.0", + "tslib": "^2.6.2", + "typescript": "^5.3.3", + "vitest": "^1.2.0" + }, + "scripts": { + "prepublishOnly": "pridepack clean && pridepack build", + "build": "pridepack build", + "type-check": "pridepack check", + "clean": "pridepack clean", + "watch": "pridepack watch", + "start": "pridepack start", + "dev": "pridepack dev", + "test": "vitest" + }, + "dependencies": { + "@modal-sh/yasumi": "workspace:*" + }, + "private": false, + "description": "JSON lines file data source for Yasumi.", + "repository": { + "url": "", + "type": "git" + }, + "homepage": "", + "bugs": { + "url": "" + }, + "author": "TheoryOfNekomata ", + "publishConfig": { + "access": "public" + }, + "types": "./dist/types/index.d.ts", + "main": "./dist/cjs/production/index.js", + "module": "./dist/esm/production/index.js", + "exports": { + ".": { + "development": { + "require": "./dist/cjs/development/index.js", + "import": "./dist/esm/development/index.js" + }, + "require": "./dist/cjs/production/index.js", + "import": "./dist/esm/production/index.js", + "types": "./dist/types/index.d.ts" + } + }, + "typesVersions": { + "*": {} + } +} diff --git a/packages/data-sources/file-jsonl/pridepack.json b/packages/data-sources/file-jsonl/pridepack.json new file mode 100644 index 0000000..0bc7a8f --- /dev/null +++ b/packages/data-sources/file-jsonl/pridepack.json @@ -0,0 +1,3 @@ +{ + "target": "es2018" +} diff --git a/packages/data-sources/file-jsonl/src/index.ts b/packages/data-sources/file-jsonl/src/index.ts new file mode 100644 index 0000000..66973ad --- /dev/null +++ b/packages/data-sources/file-jsonl/src/index.ts @@ -0,0 +1,255 @@ +import { readFile, writeFile } from 'fs/promises'; +import { join } from 'path'; +import { Resource, validation as v, BaseResourceType } from '@modal-sh/yasumi'; +import { DataSource, ResourceIdConfig } from '@modal-sh/yasumi/backend'; +import assert from 'assert'; + +export class ResourceNotPreparedError extends Error {} + +export class ResourceIdNotDesignatedError extends Error {} + +export class JsonLinesDataSource< + Schema extends v.BaseSchema = v.BaseSchema, + CurrentName extends string = string, + CurrentRouteName extends string = string, + Data extends object = v.Output, +> implements DataSource { + private path?: string; + + private resource?: Resource; + + data: Data[] = []; + + constructor(private readonly baseDir = '') { + // noop + } + + prepareResource(resource: Resource) { + this.path = join(this.baseDir, `${resource.state.routeName}.jsonl`); + resource.dataSource = resource.dataSource ?? this; + const originalResourceId = resource.id; + resource.id = (newIdAttr: NewIdAttr, params: ResourceIdConfig) => { + originalResourceId(newIdAttr, params); + return resource as Resource; + }; + this.resource = resource as any; + } + + async initialize() { + assert(typeof this.path === 'string', new ResourceNotPreparedError()); + + try { + const fileContents = await readFile(this.path, 'utf-8'); + const lines = fileContents.split('\n'); + this.data = lines.filter((l) => l.trim().length > 0).map((l) => JSON.parse(l)); + } catch (err) { + await writeFile(this.path, ''); + } + } + + async getTotalCount() { + return this.data.length; + } + + async getMultiple() { + return [...this.data]; + } + + async newId() { + const idConfig = this.resource?.state.shared.get('idConfig') as ResourceIdConfig; + assert(typeof idConfig !== 'undefined', new ResourceNotPreparedError()); + const theNewId = await idConfig.generationStrategy(this); + return theNewId as string; + } + + async getById(idSerialized: string) { + assert(typeof this.resource !== 'undefined', new ResourceNotPreparedError()); + assert(typeof this.path === 'string', new ResourceNotPreparedError()); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string', new ResourceIdNotDesignatedError()); + + const idConfig = this.resource.state.shared.get('idConfig') as ResourceIdConfig | undefined; + assert(typeof idConfig !== 'undefined', new ResourceIdNotDesignatedError()); + + const id = idConfig.deserialize(idSerialized); + const foundData = this.data.find((s) => (s as any)[idAttr] === id); + + if (foundData) { + return { + ...foundData + }; + } + + return null; + } + + async create(data: Data) { + assert(typeof this.resource !== 'undefined', new ResourceNotPreparedError()); + assert(typeof this.path === 'string', new ResourceNotPreparedError()); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string', new ResourceIdNotDesignatedError()); + + const idConfig = this.resource.state.shared.get('idConfig') as ResourceIdConfig | undefined; + assert(typeof idConfig !== 'undefined', new ResourceIdNotDesignatedError()); + + let theId: any; + const { [idAttr]: dataId, ...etcData } = data as Record; + if (typeof dataId !== 'undefined') { + theId = idConfig.deserialize((data as Record)[idAttr]); + } else { + const newId = await this.newId(); + theId = idConfig.deserialize(newId); + } + const newData = { + [idAttr]: theId, + ...etcData + } as Record; + + const now = Date.now(); // TODO how to serialize dates + const createdAt = this.resource.state.shared.get('createdAtAttr'); + if (typeof createdAt === 'string') { + newData[createdAt] = now; + } + + const updatedAt = this.resource.state.shared.get('updatedAtAttr'); + if (typeof updatedAt === 'string') { + newData[updatedAt] = now; + } + + const newCollection = [ + ...this.data, + newData + ]; + + await writeFile(this.path, newCollection.map((d) => JSON.stringify(d)).join('\n')); + + return newData as Data; + } + + async delete(idSerialized: string) { + assert(typeof this.resource !== 'undefined', new ResourceNotPreparedError()); + assert(typeof this.path === 'string', new ResourceNotPreparedError()); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string', new ResourceIdNotDesignatedError()); + + const idConfig = this.resource.state.shared.get('idConfig') as ResourceIdConfig | undefined; + assert(typeof idConfig !== 'undefined', new ResourceIdNotDesignatedError()); + + const oldDataLength = this.data.length; + + const id = idConfig.deserialize(idSerialized); + const newData = this.data.filter((s) => !((s as any)[idAttr] === id)); + + await writeFile(this.path, newData.map((d) => JSON.stringify(d)).join('\n')); + + return oldDataLength !== newData.length; + } + + async emplace(idSerialized: string, dataWithId: Data) { + assert(typeof this.resource !== 'undefined', new ResourceNotPreparedError()); + assert(typeof this.path === 'string', new ResourceNotPreparedError()); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string', new ResourceIdNotDesignatedError()); + + const idConfig = this.resource.state.shared.get('idConfig') as ResourceIdConfig | undefined; + assert(typeof idConfig !== 'undefined', new ResourceIdNotDesignatedError()); + + const existing = await this.getById(idSerialized); + const id = idConfig.deserialize(idSerialized); + const { [idAttr]: idFromResource, ...data } = (dataWithId as any); + const dataToEmplace = { + [idAttr]: id, + ...data, + } as Record; + + if (existing) { + const createdAt = this.resource.state.shared.get('createdAtAttr'); + if (typeof createdAt === 'string') { + dataToEmplace[createdAt] = (existing as Record)[createdAt]; + } + + const now = Date.now(); // TODO how to serialize dates + const updatedAt = this.resource.state.shared.get('updatedAtAttr'); + if (typeof updatedAt === 'string') { + dataToEmplace[updatedAt] = now; + } + + const newData = this.data.map((d) => { + if ((d as any)[idAttr] === id) { + return dataToEmplace; + } + + return d; + }); + + await writeFile(this.path, newData.map((d) => JSON.stringify(d)).join('\n')); + + return [dataToEmplace, false] as [Data, boolean]; + } + + const newData = await this.create(dataToEmplace as Data); + return [newData, true] as [Data, boolean]; + } + + async patch(idSerialized: string, data: Partial) { + assert(typeof this.resource !== 'undefined', new ResourceNotPreparedError()); + assert(typeof this.path === 'string', new ResourceNotPreparedError()); + + const idAttr = this.resource.state.shared.get('idAttr'); + assert(typeof idAttr === 'string', new ResourceIdNotDesignatedError()); + + const idConfig = this.resource.state.shared.get('idConfig') as ResourceIdConfig | undefined; + assert(typeof idConfig !== 'undefined', new ResourceIdNotDesignatedError()); + + const existing = await this.getById(idSerialized); + if (!existing) { + return null; + } + + const newItem = { + ...existing, + ...data, + } as Record; + + const createdAt = this.resource.state.shared.get('createdAtAttr'); + if (typeof createdAt === 'string') { + newItem[createdAt] = (existing as Record)[createdAt]; + } + + const now = Date.now(); // TODO how to serialize dates + const updatedAt = this.resource.state.shared.get('updatedAtAttr'); + if (typeof updatedAt === 'string') { + newItem[updatedAt] = now; + } + + const id = idConfig.deserialize(idSerialized); + const newData = this.data.map((d) => { + if ((d as any)[idAttr] === id) { + return newItem; + } + + return d; + }); + + await writeFile(this.path, newData.map((d) => JSON.stringify(d)).join('\n')); + return newItem as Data; + } +} diff --git a/packages/data-sources/file-jsonl/test/index.test.ts b/packages/data-sources/file-jsonl/test/index.test.ts new file mode 100644 index 0000000..89a0ba6 --- /dev/null +++ b/packages/data-sources/file-jsonl/test/index.test.ts @@ -0,0 +1,236 @@ +import {describe, it, expect, vi, Mock, beforeAll, beforeEach} from 'vitest'; +import { readFile, writeFile } from 'fs/promises'; +import { JsonLinesDataSource } from '../src'; +import { resource, validation as v, BaseResourceType } from '@modal-sh/yasumi'; +import {DataSource} from '@modal-sh/yasumi/dist/types/backend'; + +vi.mock('fs/promises'); + +const toJsonl = (dummyItems: unknown[]) => dummyItems.map((i) => JSON.stringify(i)).join('\n'); + +const ID_ATTR = 'id' as const; + +describe('prepareResource', () => { + beforeAll(() => { + const mockWriteFile = writeFile as Mock; + mockWriteFile.mockImplementation(() => { /* noop */ }) + }); + + it('works', () => { + const schema = v.object({}); + const r = resource(schema); + const ds = new JsonLinesDataSource(); + expect(() => ds.prepareResource(r)).not.toThrow(); + }); +}); + +describe('methods', () => { + const dummyItems = [ + { + id: 1, + name: 'foo', + }, + { + id: 2, + name: 'bar', + }, + { + id: 3, + name: 'baz', + }, + ]; + const schema = v.object({ + name: v.string(), + }); + let ds: DataSource>; + let mockGenerationStrategy: Mock; + beforeEach(() => { + mockGenerationStrategy = vi.fn(); + const r = resource(schema) + .id(ID_ATTR, { + generationStrategy: mockGenerationStrategy, + schema: v.any(), + serialize: (id) => id.toString(), + deserialize: (id) => Number(id?.toString() ?? 0), + }); + ds = new JsonLinesDataSource(); + ds.prepareResource(r); + }); + + beforeEach(() => { + const mockReadFile = readFile as Mock; + mockReadFile.mockReturnValueOnce(toJsonl(dummyItems)); + }); + + let mockWriteFile: Mock; + beforeEach(() => { + mockWriteFile = writeFile as Mock; + mockWriteFile.mockImplementationOnce(() => { /* noop */ }); + }); + + describe('initialize', () => { + it('works', async () => { + try { + await ds.initialize(); + } catch { + expect.fail('Could not initialize data source.'); + } + }); + }); + + describe('operations', () => { + beforeEach(async () => { + await ds.initialize(); + }); + + describe('getTotalCount', () => { + it('works', async () => { + if (typeof ds.getTotalCount !== 'function') { + return; + } + const totalCount = await ds.getTotalCount(); + expect(totalCount).toBe(dummyItems.length); + }); + }); + + describe('getMultiple', () => { + it('works', async () => { + const items = await ds.getMultiple(); + expect(items).toEqual(dummyItems); + }); + }); + + describe('getById', () => { + it('works', async () => { + const id = 2; + const item = await ds.getById(id.toString()); // ID is always a string because it originates from URLs + const expected = dummyItems.find((i) => i[ID_ATTR] === id); + expect(item).toEqual(expected); + }); + }); + + describe('getSingle', () => { + it('works', async () => { + if (typeof ds.getSingle !== 'function') { + // skip if data source doesn't offer this + return; + } + const item = await ds.getSingle(); + const expected = dummyItems[0]; + expect(item).toEqual(expected); + }); + }); + + describe('create', () => { + it('works', async () => { + const data = { + // notice we don't have IDs here, as it is expected to be generated by newId() + name: 'foo' + }; + const newItem = await ds.create(data); + + expect(mockWriteFile).toBeCalledWith( + expect.any(String), + toJsonl([ + ...dummyItems, + { + id: 0, + ...data, + } + ]) + ); + expect(newItem).toEqual({ id: 0, ...data}); + }); + }); + + describe('delete', () => { + it('works', async () => { + await ds.delete('1'); + expect(mockWriteFile).toBeCalledWith( + expect.any(String), + toJsonl(dummyItems.filter((d) => d[ID_ATTR] !== 1)), + ); + }); + }); + + describe('emplace', () => { + it('replaces existing data', async () => { + const data = { + [ID_ATTR]: 2, + name: 'foo', + }; + const { id, ...etcData } = data; + const newItem = await ds.emplace( + id.toString(), + etcData, + ); + + expect(mockWriteFile).toBeCalledWith( + expect.any(String), + toJsonl(dummyItems.map((d) => + d[ID_ATTR] === data[ID_ATTR] + // ID will be defined first, since we are just writing to file, we need strict ordering + ? { [ID_ATTR]: id, ...etcData } + : d + )), + ); + expect(newItem).toEqual([data, false]); + }); + + it('creates new data', async () => { + const data = { + [ID_ATTR]: 4, + name: 'quux', + }; + const { [ID_ATTR]: id, ...etcData } = data; + const newItem = await ds.emplace( + id.toString(), + etcData, + ); + + expect(mockWriteFile).toBeCalledWith( + expect.any(String), + toJsonl([ + ...dummyItems, + data + ]), + ); + expect(newItem).toEqual([data, true]); + }); + }); + + describe('patch', () => { + it('works', async () => { + const data = { + [ID_ATTR]: 2, + name: 'foo', + }; + const { id, ...etcData } = data; + const newItem = await ds.emplace( + id.toString(), + etcData, + ); + + expect(mockWriteFile).toBeCalledWith( + expect.any(String), + toJsonl(dummyItems.map((d) => + d[ID_ATTR] === data[ID_ATTR] + // ID will be defined first, since we are just writing to file, we need strict ordering + ? { [ID_ATTR]: id, ...etcData } + : d + )), + ); + expect(newItem).toBeDefined(); + }); + }); + + describe('newId', () => { + it('works', async () => { + const v = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); + mockGenerationStrategy.mockResolvedValueOnce(v); + const id = await ds.newId(); + expect(id).toBe(v); + }); + }); + }); +}); diff --git a/packages/data-sources/file-jsonl/tsconfig.json b/packages/data-sources/file-jsonl/tsconfig.json new file mode 100644 index 0000000..74083d7 --- /dev/null +++ b/packages/data-sources/file-jsonl/tsconfig.json @@ -0,0 +1,23 @@ +{ + "exclude": ["node_modules"], + "include": ["src", "types"], + "compilerOptions": { + "module": "ESNext", + "lib": ["ESNext"], + "importHelpers": true, + "declaration": true, + "sourceMap": true, + "rootDir": "./src", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "bundler", + "jsx": "react", + "esModuleInterop": true, + "target": "es2018", + "useDefineForClassFields": false, + "declarationMap": true + } +} diff --git a/packages/examples/http-resource-server/.gitignore b/packages/examples/http-resource-server/.gitignore new file mode 100644 index 0000000..53992de --- /dev/null +++ b/packages/examples/http-resource-server/.gitignore @@ -0,0 +1,107 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.production +.env.development + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +.npmrc diff --git a/packages/examples/http-resource-server/package.json b/packages/examples/http-resource-server/package.json new file mode 100644 index 0000000..6cbdc44 --- /dev/null +++ b/packages/examples/http-resource-server/package.json @@ -0,0 +1,45 @@ +{ + "name": "http-resource-server", + "version": "0.0.0", + "files": [ + "dist", + "src" + ], + "engines": { + "node": ">=16" + }, + "keywords": [ + "pridepack" + ], + "devDependencies": { + "@types/node": "^20.11.0", + "pridepack": "2.6.0", + "tslib": "^2.6.2", + "typescript": "^5.3.3", + "vitest": "^1.2.0" + }, + "scripts": { + "prepublishOnly": "pridepack clean && pridepack build", + "build": "pridepack build", + "type-check": "pridepack check", + "clean": "pridepack clean", + "watch": "pridepack watch", + "start": "pridepack start", + "dev": "pridepack dev", + "test": "vitest" + }, + "private": true, + "description": "Basic HTTP resource server example for Yasumi.", + "repository": { + "url": "", + "type": "git" + }, + "homepage": "", + "bugs": { + "url": "" + }, + "author": "TheoryOfNekomata ", + "publishConfig": { + "access": "restricted" + } +} diff --git a/packages/examples/http-resource-server/pridepack.json b/packages/examples/http-resource-server/pridepack.json new file mode 100644 index 0000000..0bc7a8f --- /dev/null +++ b/packages/examples/http-resource-server/pridepack.json @@ -0,0 +1,3 @@ +{ + "target": "es2018" +} diff --git a/packages/examples/http-resource-server/src/index.ts b/packages/examples/http-resource-server/src/index.ts new file mode 100644 index 0000000..f0e1a4e --- /dev/null +++ b/packages/examples/http-resource-server/src/index.ts @@ -0,0 +1,6 @@ +export default function add(a: number, b: number): number { + if (process.env.NODE_ENV !== 'production') { + console.log('This code would not appear on production builds'); + } + return a + b; +} diff --git a/packages/examples/http-resource-server/test/index.test.ts b/packages/examples/http-resource-server/test/index.test.ts new file mode 100644 index 0000000..441ca94 --- /dev/null +++ b/packages/examples/http-resource-server/test/index.test.ts @@ -0,0 +1,8 @@ +import { describe, it, expect } from 'vitest'; +import add from '../src'; + +describe('blah', () => { + it('works', () => { + expect(add(1, 1)).toEqual(2); + }); +}); diff --git a/packages/examples/http-resource-server/tsconfig.json b/packages/examples/http-resource-server/tsconfig.json new file mode 100644 index 0000000..74083d7 --- /dev/null +++ b/packages/examples/http-resource-server/tsconfig.json @@ -0,0 +1,23 @@ +{ + "exclude": ["node_modules"], + "include": ["src", "types"], + "compilerOptions": { + "module": "ESNext", + "lib": ["ESNext"], + "importHelpers": true, + "declaration": true, + "sourceMap": true, + "rootDir": "./src", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "bundler", + "jsx": "react", + "esModuleInterop": true, + "target": "es2018", + "useDefineForClassFields": false, + "declarationMap": true + } +} diff --git a/packages/extenders/http/.gitignore b/packages/extenders/http/.gitignore new file mode 100644 index 0000000..53992de --- /dev/null +++ b/packages/extenders/http/.gitignore @@ -0,0 +1,107 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.production +.env.development + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +.npmrc diff --git a/packages/extenders/http/LICENSE b/packages/extenders/http/LICENSE new file mode 100644 index 0000000..5a4fdfd --- /dev/null +++ b/packages/extenders/http/LICENSE @@ -0,0 +1,7 @@ +MIT License Copyright (c) 2024 TheoryOfNekomata + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/extenders/http/package.json b/packages/extenders/http/package.json new file mode 100644 index 0000000..8f40169 --- /dev/null +++ b/packages/extenders/http/package.json @@ -0,0 +1,49 @@ +{ + "name": "@modal-sh/yasumi-extender-http", + "version": "0.0.0", + "files": [ + "dist", + "src" + ], + "engines": { + "node": ">=16" + }, + "license": "MIT", + "keywords": [ + "pridepack" + ], + "devDependencies": { + "@types/node": "^20.11.0", + "pridepack": "2.6.0", + "tslib": "^2.6.2", + "typescript": "^5.3.3", + "vitest": "^1.2.0" + }, + "scripts": { + "prepublishOnly": "pridepack clean && pridepack build", + "build": "pridepack build", + "type-check": "pridepack check", + "clean": "pridepack clean", + "watch": "pridepack watch", + "start": "pridepack start", + "dev": "pridepack dev", + "test": "vitest" + }, + "private": false, + "description": "HTTP extender for Yasumi.", + "repository": { + "url": "", + "type": "git" + }, + "homepage": "", + "bugs": { + "url": "" + }, + "author": "TheoryOfNekomata ", + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@modal-sh/yasumi": "workspace:*" + } +} diff --git a/packages/extenders/http/pridepack.json b/packages/extenders/http/pridepack.json new file mode 100644 index 0000000..fb05c7c --- /dev/null +++ b/packages/extenders/http/pridepack.json @@ -0,0 +1,7 @@ +{ + "target": "es2018", + "entrypoints": { + "./backend": "src/backend/index.ts", + "./client": "src/client/index.ts" + } +} diff --git a/packages/core/src/extenders/http/backend/core.ts b/packages/extenders/http/src/backend/core.ts similarity index 95% rename from packages/core/src/extenders/http/backend/core.ts rename to packages/extenders/http/src/backend/core.ts index f12bca0..9d06a8b 100644 --- a/packages/core/src/extenders/http/backend/core.ts +++ b/packages/extenders/http/src/backend/core.ts @@ -1,15 +1,14 @@ -import {ErrorResponse, parseToEndpointQueue, ServiceParams} from '../../../common'; +import http from 'http'; +import {ErrorResponse, parseToEndpointQueue, ServiceParams, statusCodes} from '@modal-sh/yasumi'; import { Backend as BaseBackend, Server, ServerRequestContext, ServerResponseContext, ServerParams, -} from '../../../backend'; -import http from 'http'; -import { statusCodes } from '../../../common'; +} from '@modal-sh/yasumi/backend'; -declare module '../../../backend' { +declare module '@modal-sh/yasumi/backend' { interface ServerRequestContext extends http.IncomingMessage {} interface ServerResponseContext extends http.ServerResponse {} diff --git a/packages/core/src/extenders/http/backend/index.ts b/packages/extenders/http/src/backend/index.ts similarity index 100% rename from packages/core/src/extenders/http/backend/index.ts rename to packages/extenders/http/src/backend/index.ts diff --git a/packages/core/src/extenders/http/client.ts b/packages/extenders/http/src/client/core.ts similarity index 94% rename from packages/core/src/extenders/http/client.ts rename to packages/extenders/http/src/client/core.ts index 1e0c841..b85ae4a 100644 --- a/packages/core/src/extenders/http/client.ts +++ b/packages/extenders/http/src/client/core.ts @@ -5,10 +5,10 @@ import { GetEndpointParams, Operation, serializeEndpointQueue, ServiceParams, -} from '../../common'; -import {Client, ClientParams, ClientConnection} from '../../client'; +} from '@modal-sh/yasumi'; +import {Client, ClientParams, ClientConnection} from '@modal-sh/yasumi/client'; -declare module '../../client' { +declare module '@modal-sh/yasumi/client' { interface ClientConnection { host: string; port: number; diff --git a/packages/extenders/http/src/client/index.ts b/packages/extenders/http/src/client/index.ts new file mode 100644 index 0000000..4b0e041 --- /dev/null +++ b/packages/extenders/http/src/client/index.ts @@ -0,0 +1 @@ +export * from './core'; diff --git a/packages/core/test/http/default.test.ts b/packages/extenders/http/test/default.test.ts similarity index 90% rename from packages/core/test/http/default.test.ts rename to packages/extenders/http/test/default.test.ts index 366d787..0af51c9 100644 --- a/packages/core/test/http/default.test.ts +++ b/packages/extenders/http/test/default.test.ts @@ -11,13 +11,13 @@ import { app, Endpoint, Operation, -} from '../../src/common'; -import {DataSource, DataSourceQuery, EmplaceDetails, Server} from '../../src/backend'; -import {Client} from '../../src/client'; -import {server} from '../../src/extenders/http/backend'; -import {client} from '../../src/extenders/http/client'; -import {composeRecipes} from '../../src/common/recipe'; -import {addResourceRecipe, ResourceItemFetchedResponse} from '../../src/recipes/resource'; + composeRecipes, +} from '@modal-sh/yasumi'; +import {DataSource, DataSourceQuery, EmplaceDetails, Server} from '@modal-sh/yasumi/backend'; +import {Client} from '@modal-sh/yasumi/client'; +import {server} from '@modal-sh/yasumi-extender-http/backend'; +import {client} from '@modal-sh/yasumi-extender-http/client'; +import {addResourceRecipe, ResourceItemFetchedResponse} from '@modal-sh/yasumi-recipe-resource'; describe('default', () => { let theClient: Client; diff --git a/packages/core/test/index.test.ts b/packages/extenders/http/test/error-handling.test.ts similarity index 92% rename from packages/core/test/index.test.ts rename to packages/extenders/http/test/error-handling.test.ts index ddf80b5..3212819 100644 --- a/packages/core/test/index.test.ts +++ b/packages/extenders/http/test/error-handling.test.ts @@ -8,11 +8,11 @@ import { operation, statusCodes, validation as v, -} from '../src/common'; -import {Backend, backend, DataSource, Server} from '../src/backend'; -import {Client} from '../src/client'; -import {server} from '../src/extenders/http/backend'; -import {client} from '../src/extenders/http/client'; +} from '../../../core/src/common'; +import {Backend, backend, DataSource, Server} from '../../../core/src/backend'; +import {Client} from '../../../core/src/client'; +import {server} from '../../../core/src/extenders/http/backend'; +import {client} from '../../../core/src/extenders/http/client'; const op = operation({ name: 'create' as const, diff --git a/packages/extenders/http/tsconfig.json b/packages/extenders/http/tsconfig.json new file mode 100644 index 0000000..74083d7 --- /dev/null +++ b/packages/extenders/http/tsconfig.json @@ -0,0 +1,23 @@ +{ + "exclude": ["node_modules"], + "include": ["src", "types"], + "compilerOptions": { + "module": "ESNext", + "lib": ["ESNext"], + "importHelpers": true, + "declaration": true, + "sourceMap": true, + "rootDir": "./src", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "bundler", + "jsx": "react", + "esModuleInterop": true, + "target": "es2018", + "useDefineForClassFields": false, + "declarationMap": true + } +} diff --git a/packages/recipes/resource/.gitignore b/packages/recipes/resource/.gitignore new file mode 100644 index 0000000..53992de --- /dev/null +++ b/packages/recipes/resource/.gitignore @@ -0,0 +1,107 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.production +.env.development + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +.npmrc diff --git a/packages/recipes/resource/LICENSE b/packages/recipes/resource/LICENSE new file mode 100644 index 0000000..5a4fdfd --- /dev/null +++ b/packages/recipes/resource/LICENSE @@ -0,0 +1,7 @@ +MIT License Copyright (c) 2024 TheoryOfNekomata + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/recipes/resource/package.json b/packages/recipes/resource/package.json new file mode 100644 index 0000000..db446f6 --- /dev/null +++ b/packages/recipes/resource/package.json @@ -0,0 +1,49 @@ +{ + "name": "@modal-sh/yasumi-recipe-resource", + "version": "0.0.0", + "files": [ + "dist", + "src" + ], + "engines": { + "node": ">=16" + }, + "license": "MIT", + "keywords": [ + "pridepack" + ], + "devDependencies": { + "@types/node": "^20.11.0", + "pridepack": "2.6.0", + "tslib": "^2.6.2", + "typescript": "^5.3.3", + "vitest": "^1.2.0" + }, + "scripts": { + "prepublishOnly": "pridepack clean && pridepack build", + "build": "pridepack build", + "type-check": "pridepack check", + "clean": "pridepack clean", + "watch": "pridepack watch", + "start": "pridepack start", + "dev": "pridepack dev", + "test": "vitest" + }, + "private": false, + "description": "Resource recipe for Yasumi.", + "repository": { + "url": "", + "type": "git" + }, + "homepage": "", + "bugs": { + "url": "" + }, + "author": "TheoryOfNekomata ", + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@modal-sh/yasumi": "workspace:*" + } +} diff --git a/packages/recipes/resource/pridepack.json b/packages/recipes/resource/pridepack.json new file mode 100644 index 0000000..0bc7a8f --- /dev/null +++ b/packages/recipes/resource/pridepack.json @@ -0,0 +1,3 @@ +{ + "target": "es2018" +} diff --git a/packages/core/src/recipes/resource/core.ts b/packages/recipes/resource/src/core.ts similarity index 93% rename from packages/core/src/recipes/resource/core.ts rename to packages/recipes/resource/src/core.ts index 399331e..ae7251b 100644 --- a/packages/core/src/recipes/resource/core.ts +++ b/packages/recipes/resource/src/core.ts @@ -1,6 +1,5 @@ -import {Recipe} from '../../common/recipe'; -import {endpoint, validation as v} from '../../common'; -import {backend, DataSource} from '../../backend'; +import {Recipe, endpoint, validation as v} from '@modal-sh/yasumi'; +import {backend, DataSource} from '@modal-sh/yasumi/backend'; import * as fetchOperation from './implementation/fetch'; import * as createOperation from './implementation/create'; import * as emplaceOperation from './implementation/emplace'; diff --git a/packages/core/src/recipes/resource/implementation/create.ts b/packages/recipes/resource/src/implementation/create.ts similarity index 63% rename from packages/core/src/recipes/resource/implementation/create.ts rename to packages/recipes/resource/src/implementation/create.ts index c4fc692..ccaa47a 100644 --- a/packages/core/src/recipes/resource/implementation/create.ts +++ b/packages/recipes/resource/src/implementation/create.ts @@ -1,5 +1,5 @@ -import {ImplementationFunction} from '../../../backend'; -import {operation as defineOperation} from '../../../common'; +import {ImplementationFunction} from '@modal-sh/yasumi/backend'; +import {operation as defineOperation} from '@modal-sh/yasumi'; export const name = 'create' as const; diff --git a/packages/core/src/recipes/resource/implementation/delete.ts b/packages/recipes/resource/src/implementation/delete.ts similarity index 63% rename from packages/core/src/recipes/resource/implementation/delete.ts rename to packages/recipes/resource/src/implementation/delete.ts index 1e8c252..d531fdd 100644 --- a/packages/core/src/recipes/resource/implementation/delete.ts +++ b/packages/recipes/resource/src/implementation/delete.ts @@ -1,5 +1,5 @@ -import {ImplementationFunction} from '../../../backend'; -import {operation as defineOperation} from '../../../common'; +import {ImplementationFunction} from '@modal-sh/yasumi/backend'; +import {operation as defineOperation} from '@modal-sh/yasumi'; export const name = 'delete' as const; diff --git a/packages/core/src/recipes/resource/implementation/emplace.ts b/packages/recipes/resource/src/implementation/emplace.ts similarity index 63% rename from packages/core/src/recipes/resource/implementation/emplace.ts rename to packages/recipes/resource/src/implementation/emplace.ts index 7b09a44..ad12f13 100644 --- a/packages/core/src/recipes/resource/implementation/emplace.ts +++ b/packages/recipes/resource/src/implementation/emplace.ts @@ -1,5 +1,5 @@ -import {ImplementationFunction} from '../../../backend'; -import {operation as defineOperation} from '../../../common'; +import {ImplementationFunction} from '@modal-sh/yasumi/backend'; +import {operation as defineOperation} from '@modal-sh/yasumi'; export const name = 'emplace' as const; diff --git a/packages/core/src/recipes/resource/implementation/fetch.ts b/packages/recipes/resource/src/implementation/fetch.ts similarity index 89% rename from packages/core/src/recipes/resource/implementation/fetch.ts rename to packages/recipes/resource/src/implementation/fetch.ts index 8b791f1..e955a3b 100644 --- a/packages/core/src/recipes/resource/implementation/fetch.ts +++ b/packages/recipes/resource/src/implementation/fetch.ts @@ -1,11 +1,11 @@ -import {DataSource, ImplementationFunction} from '../../../backend'; +import {ImplementationFunction, DataSource} from '@modal-sh/yasumi/backend'; +import {operation as defineOperation} from '@modal-sh/yasumi'; import { DataSourceNotFoundResponseError, ItemNotFoundReponseError, ResourceCollectionFetchedResponse, ResourceItemFetchedResponse, } from '../response'; -import {operation as defineOperation} from '../../../common'; export const name = 'fetch' as const; diff --git a/packages/core/src/recipes/resource/implementation/patch-delta.ts b/packages/recipes/resource/src/implementation/patch-delta.ts similarity index 63% rename from packages/core/src/recipes/resource/implementation/patch-delta.ts rename to packages/recipes/resource/src/implementation/patch-delta.ts index 2c5e9c0..a5ac069 100644 --- a/packages/core/src/recipes/resource/implementation/patch-delta.ts +++ b/packages/recipes/resource/src/implementation/patch-delta.ts @@ -1,5 +1,5 @@ -import {ImplementationFunction} from '../../../backend'; -import {operation as defineOperation} from '../../../common'; +import {ImplementationFunction} from '@modal-sh/yasumi/backend'; +import {operation as defineOperation} from '@modal-sh/yasumi'; export const name = 'patchDelta' as const; diff --git a/packages/core/src/recipes/resource/implementation/patch-merge.ts b/packages/recipes/resource/src/implementation/patch-merge.ts similarity index 63% rename from packages/core/src/recipes/resource/implementation/patch-merge.ts rename to packages/recipes/resource/src/implementation/patch-merge.ts index c0dc79d..77eb157 100644 --- a/packages/core/src/recipes/resource/implementation/patch-merge.ts +++ b/packages/recipes/resource/src/implementation/patch-merge.ts @@ -1,5 +1,5 @@ -import {ImplementationFunction} from '../../../backend'; -import {operation as defineOperation} from '../../../common'; +import {ImplementationFunction} from '@modal-sh/yasumi/backend'; +import {operation as defineOperation} from '@modal-sh/yasumi'; export const name = 'patchMerge' as const; diff --git a/packages/core/src/recipes/resource/implementation/query.ts b/packages/recipes/resource/src/implementation/query.ts similarity index 63% rename from packages/core/src/recipes/resource/implementation/query.ts rename to packages/recipes/resource/src/implementation/query.ts index e3c63eb..482ab62 100644 --- a/packages/core/src/recipes/resource/implementation/query.ts +++ b/packages/recipes/resource/src/implementation/query.ts @@ -1,5 +1,5 @@ -import {ImplementationFunction} from '../../../backend'; -import {operation as defineOperation} from '../../../common'; +import {ImplementationFunction} from '@modal-sh/yasumi/backend'; +import {operation as defineOperation} from '@modal-sh/yasumi'; export const name = 'query' as const; diff --git a/packages/core/src/recipes/resource/index.ts b/packages/recipes/resource/src/index.ts similarity index 100% rename from packages/core/src/recipes/resource/index.ts rename to packages/recipes/resource/src/index.ts diff --git a/packages/core/src/recipes/resource/response.ts b/packages/recipes/resource/src/response.ts similarity index 87% rename from packages/core/src/recipes/resource/response.ts rename to packages/recipes/resource/src/response.ts index 50a11fe..d0c971f 100644 --- a/packages/core/src/recipes/resource/response.ts +++ b/packages/recipes/resource/src/response.ts @@ -1,4 +1,4 @@ -import {HttpResponse, statusCodes} from '../../common'; +import {HttpResponse, statusCodes} from '@modal-sh/yasumi'; export class ResourceItemFetchedResponse extends HttpResponse(statusCodes.HTTP_STATUS_OK) {} diff --git a/packages/recipes/resource/test/index.test.ts b/packages/recipes/resource/test/index.test.ts new file mode 100644 index 0000000..441ca94 --- /dev/null +++ b/packages/recipes/resource/test/index.test.ts @@ -0,0 +1,8 @@ +import { describe, it, expect } from 'vitest'; +import add from '../src'; + +describe('blah', () => { + it('works', () => { + expect(add(1, 1)).toEqual(2); + }); +}); diff --git a/packages/recipes/resource/tsconfig.json b/packages/recipes/resource/tsconfig.json new file mode 100644 index 0000000..74083d7 --- /dev/null +++ b/packages/recipes/resource/tsconfig.json @@ -0,0 +1,23 @@ +{ + "exclude": ["node_modules"], + "include": ["src", "types"], + "compilerOptions": { + "module": "ESNext", + "lib": ["ESNext"], + "importHelpers": true, + "declaration": true, + "sourceMap": true, + "rootDir": "./src", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "bundler", + "jsx": "react", + "esModuleInterop": true, + "target": "es2018", + "useDefineForClassFields": false, + "declarationMap": true + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb46509..649ab06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,6 +28,115 @@ importers: specifier: ^1.2.0 version: 1.2.0(@types/node@20.11.0) + packages/data-sources/duckdb: + dependencies: + '@modal-sh/yasumi': + specifier: workspace:* + version: link:../../core + duckdb-async: + specifier: ^0.10.0 + version: 0.10.0 + devDependencies: + '@types/node': + specifier: ^20.11.0 + version: 20.11.0 + pridepack: + specifier: 2.6.0 + version: 2.6.0(tslib@2.6.2)(typescript@5.3.3) + tslib: + specifier: ^2.6.2 + version: 2.6.2 + typescript: + specifier: ^5.3.3 + version: 5.3.3 + vitest: + specifier: ^1.2.0 + version: 1.2.0(@types/node@20.11.0) + + packages/data-sources/file-jsonl: + dependencies: + '@modal-sh/yasumi': + specifier: workspace:* + version: link:../../core + devDependencies: + '@types/node': + specifier: ^20.11.0 + version: 20.11.0 + pridepack: + specifier: 2.6.0 + version: 2.6.0(tslib@2.6.2)(typescript@5.3.3) + tslib: + specifier: ^2.6.2 + version: 2.6.2 + typescript: + specifier: ^5.3.3 + version: 5.3.3 + vitest: + specifier: ^1.2.0 + version: 1.2.0(@types/node@20.11.0) + + packages/examples/http-resource-server: + devDependencies: + '@types/node': + specifier: ^20.11.0 + version: 20.11.0 + pridepack: + specifier: 2.6.0 + version: 2.6.0(tslib@2.6.2)(typescript@5.3.3) + tslib: + specifier: ^2.6.2 + version: 2.6.2 + typescript: + specifier: ^5.3.3 + version: 5.3.3 + vitest: + specifier: ^1.2.0 + version: 1.2.0(@types/node@20.11.0) + + packages/extenders/http: + dependencies: + '@modal-sh/yasumi': + specifier: workspace:* + version: link:../../core + devDependencies: + '@types/node': + specifier: ^20.11.0 + version: 20.11.0 + pridepack: + specifier: 2.6.0 + version: 2.6.0(tslib@2.6.2)(typescript@5.3.3) + tslib: + specifier: ^2.6.2 + version: 2.6.2 + typescript: + specifier: ^5.3.3 + version: 5.3.3 + vitest: + specifier: ^1.2.0 + version: 1.2.0(@types/node@20.11.0) + + packages/recipes/resource: + dependencies: + '@modal-sh/yasumi': + specifier: workspace:* + version: link:../../core + devDependencies: + '@types/node': + specifier: ^20.11.0 + version: 20.11.0 + pridepack: + specifier: 2.6.0 + version: 2.6.0(tslib@2.6.2)(typescript@5.3.3) + tslib: + specifier: ^2.6.2 + version: 2.6.2 + typescript: + specifier: ^5.3.3 + version: 5.3.3 + vitest: + specifier: ^1.2.0 + version: 1.2.0(@types/node@20.11.0) + packages: /@esbuild/aix-ppc64@0.19.12: @@ -444,6 +553,10 @@ packages: dev: true optional: true + /@gar/promisify@1.1.3: + resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} + dev: false + /@jest/schemas@29.6.3: resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -455,6 +568,41 @@ packages: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true + /@mapbox/node-pre-gyp@1.0.11: + resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} + hasBin: true + dependencies: + detect-libc: 2.0.3 + https-proxy-agent: 5.0.1 + make-dir: 3.1.0 + node-fetch: 2.7.0 + nopt: 5.0.0 + npmlog: 5.0.1 + rimraf: 3.0.2 + semver: 7.6.2 + tar: 6.2.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + /@npmcli/fs@2.1.2: + resolution: {integrity: sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + '@gar/promisify': 1.1.3 + semver: 7.6.2 + dev: false + + /@npmcli/move-file@2.0.1: + resolution: {integrity: sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + deprecated: This functionality has been moved to @npmcli/fs + dependencies: + mkdirp: 1.0.4 + rimraf: 3.0.2 + dev: false + /@ovyerus/licenses@6.4.4: resolution: {integrity: sha512-IHjc31WXciQT3hfvdY+M59jBkQp70Fpr04tNDVO5rez2PNv4u8tE6w//CkU+GeBoO9k2ahneSqzjzvlgjyjkGw==} engines: {node: '>=8'} @@ -592,6 +740,11 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true + /@tootallnate/once@2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: false + /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true @@ -641,6 +794,10 @@ packages: pretty-format: 29.7.0 dev: true + /abbrev@1.1.1: + resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + dev: false + /acorn-walk@8.3.2: resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} engines: {node: '>=0.4.0'} @@ -652,10 +809,33 @@ packages: hasBin: true dev: true + /agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /agentkeepalive@4.5.0: + resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} + engines: {node: '>= 8.0.0'} + dependencies: + humanize-ms: 1.2.1 + dev: false + + /aggregate-error@3.1.0: + resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} + engines: {node: '>=8'} + dependencies: + clean-stack: 2.2.0 + indent-string: 4.0.0 + dev: false + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - dev: true /ansi-regex@6.0.1: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} @@ -674,10 +854,36 @@ packages: engines: {node: '>=10'} dev: true + /aproba@2.0.0: + resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} + dev: false + + /are-we-there-yet@2.0.0: + resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} + engines: {node: '>=10'} + deprecated: This package is no longer supported. + dependencies: + delegates: 1.0.0 + readable-stream: 3.6.2 + dev: false + + /are-we-there-yet@3.0.1: + resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + deprecated: This package is no longer supported. + dependencies: + delegates: 1.0.0 + readable-stream: 3.6.2 + dev: false + /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: false + /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} dev: true @@ -690,6 +896,19 @@ packages: readable-stream: 3.6.2 dev: true + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: false + + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: false + /buffer@6.0.3: resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} dependencies: @@ -702,6 +921,32 @@ packages: engines: {node: '>=8'} dev: true + /cacache@16.1.3: + resolution: {integrity: sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + '@npmcli/fs': 2.1.2 + '@npmcli/move-file': 2.0.1 + chownr: 2.0.0 + fs-minipass: 2.1.0 + glob: 8.1.0 + infer-owner: 1.0.4 + lru-cache: 7.18.3 + minipass: 3.3.6 + minipass-collect: 1.0.2 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + mkdirp: 1.0.4 + p-map: 4.0.0 + promise-inflight: 1.0.1 + rimraf: 3.0.2 + ssri: 9.0.1 + tar: 6.2.1 + unique-filename: 2.0.1 + transitivePeerDependencies: + - bluebird + dev: false + /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -731,6 +976,16 @@ packages: get-func-name: 2.0.2 dev: true + /chownr@2.0.0: + resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} + engines: {node: '>=10'} + dev: false + + /clean-stack@2.2.0: + resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} + engines: {node: '>=6'} + dev: false + /cli-cursor@4.0.0: resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -771,6 +1026,15 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /color-support@1.1.3: + resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} + hasBin: true + dev: false + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: false + /confbox@0.1.7: resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} dev: true @@ -787,6 +1051,10 @@ packages: xdg-basedir: 4.0.0 dev: true + /console-control-strings@1.1.0: + resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + dev: false + /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -811,7 +1079,6 @@ packages: optional: true dependencies: ms: 2.1.2 - dev: true /decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} @@ -831,11 +1098,20 @@ packages: hasBin: true dev: true + /delegates@1.0.0: + resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} + dev: false + /detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} dev: true + /detect-libc@2.0.3: + resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + engines: {node: '>=8'} + dev: false + /diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -853,6 +1129,29 @@ packages: engines: {node: '>=12'} dev: true + /duckdb-async@0.10.0: + resolution: {integrity: sha512-YMDYulx5JLzT01CkqfG813h3ikCF3Pf7nV2xH1OZdVB6q0A6Rofrtf0x1CIotXY33fifgFY1jte3WPzD+3708Q==} + dependencies: + duckdb: 0.10.0 + transitivePeerDependencies: + - bluebird + - encoding + - supports-color + dev: false + + /duckdb@0.10.0: + resolution: {integrity: sha512-+yVccZZTCYVHccKUUKeqCiQQ5/jggdnfyafN01Cgzzx2F0NSSSqNO9vT39oLmpIhEqsJIHYXVC/LuawN3AxUyA==} + requiresBuild: true + dependencies: + '@mapbox/node-pre-gyp': 1.0.11 + node-addon-api: 7.1.0 + node-gyp: 9.4.1 + transitivePeerDependencies: + - bluebird + - encoding + - supports-color + dev: false + /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true @@ -863,7 +1162,23 @@ packages: /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: true + + /encoding@0.1.13: + resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + requiresBuild: true + dependencies: + iconv-lite: 0.6.3 + dev: false + optional: true + + /env-paths@2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + dev: false + + /err-code@2.0.3: + resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} + dev: false /esbuild@0.19.12: resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} @@ -953,6 +1268,10 @@ packages: strip-final-newline: 3.0.0 dev: true + /exponential-backoff@3.1.1: + resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} + dev: false + /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -961,6 +1280,17 @@ packages: path-exists: 4.0.0 dev: true + /fs-minipass@2.1.0: + resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + dev: false + + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: false + /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -973,6 +1303,37 @@ packages: resolution: {integrity: sha512-vAcPiyomt1ioKAsAL2uxSABHJ4Ju/e4UeDM+g1OlR0vV4YhLGMNsdLNvZTpEDY4JCSt0E4hASCNM5t2ETtsbyg==} dev: true + /gauge@3.0.2: + resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} + engines: {node: '>=10'} + deprecated: This package is no longer supported. + dependencies: + aproba: 2.0.0 + color-support: 1.1.3 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + object-assign: 4.1.1 + signal-exit: 3.0.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wide-align: 1.1.5 + dev: false + + /gauge@4.0.4: + resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + deprecated: This package is no longer supported. + dependencies: + aproba: 2.0.0 + color-support: 1.1.3 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + signal-exit: 3.0.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wide-align: 1.1.5 + dev: false + /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} @@ -992,15 +1353,82 @@ packages: engines: {node: '>=4'} dev: true + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: false + + /glob@8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + deprecated: Glob versions prior to v9 are no longer supported + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + dev: false + /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - dev: true + + /has-unicode@2.0.1: + resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + dev: false + + /http-cache-semantics@4.1.1: + resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + dev: false + + /http-proxy-agent@5.0.0: + resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 2.0.0 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false /human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} dev: true + /humanize-ms@1.2.1: + resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} + dependencies: + ms: 2.1.2 + dev: false + + /iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + requiresBuild: true + dependencies: + safer-buffer: 2.1.2 + dev: false + optional: true + /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: true @@ -1008,26 +1436,52 @@ packages: /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - dev: true + + /indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + dev: false + + /infer-owner@1.0.4: + resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==} + dev: false + + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: false /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true /ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} dev: true + /ip-address@9.0.5: + resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} + engines: {node: '>= 12'} + dependencies: + jsbn: 1.1.0 + sprintf-js: 1.1.3 + dev: false + /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - dev: true /is-interactive@2.0.0: resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} engines: {node: '>=12'} dev: true + /is-lambda@1.0.1: + resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} + dev: false + /is-obj@2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} @@ -1049,7 +1503,10 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true + + /jsbn@1.1.0: + resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} + dev: false /kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} @@ -1100,6 +1557,11 @@ packages: get-func-name: 2.0.2 dev: true + /lru-cache@7.18.3: + resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} + engines: {node: '>=12'} + dev: false + /magic-string@0.30.10: resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} dependencies: @@ -1111,7 +1573,31 @@ packages: engines: {node: '>=8'} dependencies: semver: 6.3.1 - dev: true + + /make-fetch-happen@10.2.1: + resolution: {integrity: sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + agentkeepalive: 4.5.0 + cacache: 16.1.3 + http-cache-semantics: 4.1.1 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + is-lambda: 1.0.1 + lru-cache: 7.18.3 + minipass: 3.3.6 + minipass-collect: 1.0.2 + minipass-fetch: 2.1.2 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + negotiator: 0.6.3 + promise-retry: 2.0.1 + socks-proxy-agent: 7.0.0 + ssri: 9.0.1 + transitivePeerDependencies: + - bluebird + - supports-color + dev: false /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -1127,6 +1613,84 @@ packages: engines: {node: '>=12'} dev: true + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: false + + /minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: false + + /minipass-collect@1.0.2: + resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + dev: false + + /minipass-fetch@2.1.2: + resolution: {integrity: sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + minipass: 3.3.6 + minipass-sized: 1.0.3 + minizlib: 2.1.2 + optionalDependencies: + encoding: 0.1.13 + dev: false + + /minipass-flush@1.0.5: + resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + dev: false + + /minipass-pipeline@1.2.4: + resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} + engines: {node: '>=8'} + dependencies: + minipass: 3.3.6 + dev: false + + /minipass-sized@1.0.3: + resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} + engines: {node: '>=8'} + dependencies: + minipass: 3.3.6 + dev: false + + /minipass@3.3.6: + resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} + engines: {node: '>=8'} + dependencies: + yallist: 4.0.0 + dev: false + + /minipass@5.0.0: + resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} + engines: {node: '>=8'} + dev: false + + /minizlib@2.1.2: + resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + yallist: 4.0.0 + dev: false + + /mkdirp@1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + dev: false + /mlly@1.7.0: resolution: {integrity: sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==} dependencies: @@ -1138,7 +1702,6 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true /nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} @@ -1146,6 +1709,65 @@ packages: hasBin: true dev: true + /negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: false + + /node-addon-api@7.1.0: + resolution: {integrity: sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==} + engines: {node: ^16 || ^18 || >= 20} + dev: false + + /node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: false + + /node-gyp@9.4.1: + resolution: {integrity: sha512-OQkWKbjQKbGkMf/xqI1jjy3oCTgMKJac58G2+bjZb3fza6gW2YrCSdMQYaoTb70crvE//Gngr4f0AgVHmqHvBQ==} + engines: {node: ^12.13 || ^14.13 || >=16} + hasBin: true + dependencies: + env-paths: 2.2.1 + exponential-backoff: 3.1.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + make-fetch-happen: 10.2.1 + nopt: 6.0.0 + npmlog: 6.0.2 + rimraf: 3.0.2 + semver: 7.6.2 + tar: 6.2.1 + which: 2.0.2 + transitivePeerDependencies: + - bluebird + - supports-color + dev: false + + /nopt@5.0.0: + resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} + engines: {node: '>=6'} + hasBin: true + dependencies: + abbrev: 1.1.1 + dev: false + + /nopt@6.0.0: + resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + hasBin: true + dependencies: + abbrev: 1.1.1 + dev: false + /npm-run-path@5.3.0: resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1153,6 +1775,38 @@ packages: path-key: 4.0.0 dev: true + /npmlog@5.0.1: + resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} + deprecated: This package is no longer supported. + dependencies: + are-we-there-yet: 2.0.0 + console-control-strings: 1.1.0 + gauge: 3.0.2 + set-blocking: 2.0.0 + dev: false + + /npmlog@6.0.2: + resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + deprecated: This package is no longer supported. + dependencies: + are-we-there-yet: 3.0.1 + console-control-strings: 1.1.0 + gauge: 4.0.4 + set-blocking: 2.0.0 + dev: false + + /object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: false + + /once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: false + /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -1203,6 +1857,13 @@ packages: p-limit: 2.3.0 dev: true + /p-map@4.0.0: + resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} + engines: {node: '>=10'} + dependencies: + aggregate-error: 3.1.0 + dev: false + /p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} @@ -1225,6 +1886,11 @@ packages: engines: {node: '>=8'} dev: true + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: false + /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -1301,6 +1967,23 @@ packages: yargs: 17.7.2 dev: true + /promise-inflight@1.0.1: + resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} + peerDependencies: + bluebird: '*' + peerDependenciesMeta: + bluebird: + optional: true + dev: false + + /promise-retry@2.0.1: + resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} + engines: {node: '>=10'} + dependencies: + err-code: 2.0.3 + retry: 0.12.0 + dev: false + /prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} @@ -1320,7 +2003,6 @@ packages: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 - dev: true /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} @@ -1339,6 +2021,19 @@ packages: signal-exit: 3.0.7 dev: true + /retry@0.12.0: + resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} + engines: {node: '>= 4'} + dev: false + + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + dependencies: + glob: 7.2.3 + dev: false + /rollup@4.17.2: resolution: {integrity: sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -1367,16 +2062,25 @@ packages: /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true + + /safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + requiresBuild: true + dev: false + optional: true /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - dev: true + + /semver@7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + engines: {node: '>=10'} + hasBin: true + dev: false /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - dev: true /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} @@ -1396,7 +2100,6 @@ packages: /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: true /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -1407,11 +2110,46 @@ packages: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} dev: true + /smart-buffer@4.2.0: + resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} + engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} + dev: false + + /socks-proxy-agent@7.0.0: + resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==} + engines: {node: '>= 10'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + socks: 2.8.3 + transitivePeerDependencies: + - supports-color + dev: false + + /socks@2.8.3: + resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==} + engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} + dependencies: + ip-address: 9.0.5 + smart-buffer: 4.2.0 + dev: false + /source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} dev: true + /sprintf-js@1.1.3: + resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + dev: false + + /ssri@9.0.1: + resolution: {integrity: sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + minipass: 3.3.6 + dev: false + /stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true @@ -1434,7 +2172,6 @@ packages: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - dev: true /string-width@6.1.0: resolution: {integrity: sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==} @@ -1449,14 +2186,12 @@ packages: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: safe-buffer: 5.2.1 - dev: true /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 - dev: true /strip-ansi@7.1.0: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} @@ -1476,6 +2211,18 @@ packages: acorn: 8.11.3 dev: true + /tar@6.2.1: + resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} + engines: {node: '>=10'} + dependencies: + chownr: 2.0.0 + fs-minipass: 2.1.0 + minipass: 5.0.0 + minizlib: 2.1.2 + mkdirp: 1.0.4 + yallist: 4.0.0 + dev: false + /tinybench@2.8.0: resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} dev: true @@ -1490,6 +2237,10 @@ packages: engines: {node: '>=14.0.0'} dev: true + /tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + dev: false + /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true @@ -1519,6 +2270,20 @@ packages: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} dev: true + /unique-filename@2.0.1: + resolution: {integrity: sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + unique-slug: 3.0.0 + dev: false + + /unique-slug@3.0.0: + resolution: {integrity: sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + imurmurhash: 0.1.4 + dev: false + /unique-string@2.0.0: resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==} engines: {node: '>=8'} @@ -1528,7 +2293,6 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true /valibot@0.30.0: resolution: {integrity: sha512-5POBdbSkM+3nvJ6ZlyQHsggisfRtyT4tVTo1EIIShs6qCdXJnyWU5TJ68vr8iTg5zpOLjXLRiBqNx+9zwZz/rA==} @@ -1648,6 +2412,17 @@ packages: - terser dev: true + /webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + dev: false + + /whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: false + /which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} dev: true @@ -1658,7 +2433,6 @@ packages: hasBin: true dependencies: isexe: 2.0.0 - dev: true /why-is-node-running@2.2.2: resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} @@ -1669,6 +2443,12 @@ packages: stackback: 0.0.2 dev: true + /wide-align@1.1.5: + resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + dependencies: + string-width: 4.2.3 + dev: false + /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -1691,6 +2471,10 @@ packages: resolution: {integrity: sha512-NWfjspSgMDXQIMpKM56AwCQPI01OMFRYYJBh6dGNCfH7AOl+j/VqqbiopgJ4VuQfSluqLc+2ekqaPNpYAGZ/Vg==} dev: true + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: false + /write-file-atomic@3.0.3: resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==} dependencies: @@ -1714,6 +2498,10 @@ packages: engines: {node: '>=10'} dev: true + /yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: false + /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'}