diff --git a/.gitignore b/.gitignore index ddfa0195c..ac01738f1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,10 +18,6 @@ node_modules report.*.json -# Cypress -cypress/screenshots -cypress/videos - # config /.config/* !/.config/example.yml diff --git a/.woodpecker/misskey/test.yml b/.woodpecker/misskey/test.yml deleted file mode 100644 index dfb2920eb..000000000 --- a/.woodpecker/misskey/test.yml +++ /dev/null @@ -1,13 +0,0 @@ -url: 'http://misskey.local' - -port: 80 - -db: - host: postgres - port: 5432 - db: test-misskey - user: postgres - pass: '' -redis: - host: redis - port: 6379 diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index e42d68c73..f43344f1b 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -17,32 +17,4 @@ pipeline: commands: - yarn install - git diff --exit-code yarn.lock - - cp .woodpecker/misskey/test.yml .config - yarn build - mocha: - when: - branch: main - event: push - image: node:18.6.0 - commands: - - yarn mocha - e2e: - when: - branch: main - event: push - image: cypress/included:10.3.0 - commands: - - npm run start:test & - - sleep 30 # wait for server to start - - cypress run --browser chrome - # TODO: upload screenshots and video artifacts? - # would need some kind of storage though - -services: - postgres: - image: postgres:13 - environment: - - POSTGRES_DB=test-misskey - - POSTGRES_HOST_AUTH_METHOD=trust - redis: - image: redis:6 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53879e510..655d96cfa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -157,39 +157,6 @@ During development, it is useful to use the `npm run dev` command. This command monitors the server-side and client-side source files and automatically builds them if they are modified. In addition, it will also automatically start the Misskey server process. -## Testing -- Test codes are located in [`/test`](/test). - -### Run test -Create a config file. -``` -cp test/test.yml .config/ -``` -Prepare DB/Redis for testing. -``` -docker-compose -f test/docker-compose.yml up -``` -Alternatively, prepare an empty (data can be erased) DB and edit `.config/test.yml`. - -Run all test. -``` -npm run test -``` - -#### Run specify test -``` -npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT="./test/tsconfig.json" npx mocha test/foo.ts --require ts-node/register -``` - -### e2e tests -TODO - -## Continuous integration (CI) - -Foundkey uses Woodpecker for executing automated tests and lints. -CI runs can be found at [ci.akkoma.dev](https://ci.akkoma.dev/FoundKeyGang/FoundKey) -Configuration files are located in `/.woodpecker/`. - ## Vue Misskey uses Vue(v3) as its front-end framework. - Use TypeScript functionality. diff --git a/cypress.config.ts b/cypress.config.ts deleted file mode 100644 index e390c41a5..000000000 --- a/cypress.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { defineConfig } from 'cypress' - -export default defineConfig({ - e2e: { - // We've imported your old cypress plugins here. - // You may want to clean this up later by importing these. - setupNodeEvents(on, config) { - return require('./cypress/plugins/index.js')(on, config) - }, - baseUrl: 'http://localhost:61812', - }, -}) diff --git a/cypress/e2e/basic.cy.js b/cypress/e2e/basic.cy.js deleted file mode 100644 index eb5195c4b..000000000 --- a/cypress/e2e/basic.cy.js +++ /dev/null @@ -1,149 +0,0 @@ -describe('Before setup instance', () => { - beforeEach(() => { - cy.resetState(); - }); - - afterEach(() => { - // テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 - // waitを入れることでそれを防止できる - cy.wait(1000); - }); - - it('successfully loads', () => { - cy.visit('/'); - }); - - it('setup instance', () => { - cy.visit('/'); - - cy.intercept('POST', '/api/admin/accounts/create').as('signup'); - - cy.get('[data-cy-admin-username] input').type('admin'); - cy.get('[data-cy-admin-password] input').type('admin1234'); - cy.get('[data-cy-admin-ok]').click(); - - // なぜか動かない - //cy.wait('@signup').should('have.property', 'response.statusCode'); - cy.wait('@signup'); - }); -}); - -describe('After setup instance', () => { - beforeEach(() => { - cy.resetState(); - - // インスタンス初期セットアップ - cy.registerUser('admin', 'pass', true); - }); - - afterEach(() => { - // テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 - // waitを入れることでそれを防止できる - cy.wait(1000); - }); - - it('successfully loads', () => { - cy.visit('/'); - }); - - it('signup', () => { - cy.visit('/'); - - cy.intercept('POST', '/api/signup').as('signup'); - - cy.get('[data-cy-signup]').click(); - cy.get('[data-cy-signup-username] input').type('alice'); - cy.get('[data-cy-signup-password] input').type('alice1234'); - cy.get('[data-cy-signup-password-retype] input').type('alice1234'); - cy.get('[data-cy-signup-submit]').click(); - - cy.wait('@signup'); - }); -}); - -describe('After user signup', () => { - beforeEach(() => { - cy.resetState(); - - // インスタンス初期セットアップ - cy.registerUser('admin', 'pass', true); - - // ユーザー作成 - cy.registerUser('alice', 'alice1234'); - }); - - afterEach(() => { - // テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 - // waitを入れることでそれを防止できる - cy.wait(1000); - }); - - it('successfully loads', () => { - cy.visit('/'); - }); - - it('signin', () => { - cy.visit('/'); - - cy.intercept('POST', '/api/signin').as('signin'); - - cy.get('[data-cy-signin]').click(); - cy.get('[data-cy-signin-username] input').type('alice'); - // Enterキーでサインインできるかの確認も兼ねる - cy.get('[data-cy-signin-password] input').type('alice1234{enter}'); - - cy.wait('@signin'); - }); - - it('suspend', function() { - cy.request('POST', '/api/admin/suspend-user', { - i: this.admin.token, - userId: this.alice.id, - }); - - cy.visit('/'); - - cy.get('[data-cy-signin]').click(); - cy.get('[data-cy-signin-username] input').type('alice'); - cy.get('[data-cy-signin-password] input').type('alice1234{enter}'); - - // TODO: cypressにブラウザの言語指定できる機能が実装され次第英語のみテストするようにする - cy.contains(/アカウントが凍結されています|This account has been suspended due to/gi); - }); -}); - -describe('After user singed in', () => { - beforeEach(() => { - cy.resetState(); - - // インスタンス初期セットアップ - cy.registerUser('admin', 'pass', true); - - // ユーザー作成 - cy.registerUser('alice', 'alice1234'); - - cy.login('alice', 'alice1234'); - }); - - afterEach(() => { - // テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 - // waitを入れることでそれを防止できる - cy.wait(1000); - }); - - it('successfully loads', () => { - cy.get('[data-cy-open-post-form]').should('be.visible'); - }); - - it('note', () => { - cy.get('[data-cy-open-post-form]').click(); - cy.get('[data-cy-post-form-text]').type('Hello, Misskey!'); - cy.get('[data-cy-open-post-form-submit]').click(); - - cy.contains('Hello, Misskey!'); - }); -}); - -// TODO: 投稿フォームの公開範囲指定のテスト -// TODO: 投稿フォームのファイル添付のテスト -// TODO: 投稿フォームのハッシュタグ保持フィールドのテスト diff --git a/cypress/e2e/widgets.cy.js b/cypress/e2e/widgets.cy.js deleted file mode 100644 index 56ad95ee9..000000000 --- a/cypress/e2e/widgets.cy.js +++ /dev/null @@ -1,65 +0,0 @@ -describe('After user signed in', () => { - beforeEach(() => { - cy.resetState(); - cy.viewport('macbook-16'); - - // インスタンス初期セットアップ - cy.registerUser('admin', 'pass', true); - - // ユーザー作成 - cy.registerUser('alice', 'alice1234'); - - cy.login('alice', 'alice1234'); - }); - - afterEach(() => { - // テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。 - // waitを入れることでそれを防止できる - cy.wait(1000); - }); - - it('widget edit toggle is visible', () => { - cy.get('.mk-widget-edit').should('be.visible'); - }); - - it('widget select should be visible in edit mode', () => { - cy.get('.mk-widget-edit').click(); - cy.get('.mk-widget-select').should('be.visible'); - }); - - it('first widget should be removed', () => { - cy.get('.mk-widget-edit').click(); - cy.get('.customize-container:first-child .remove._button').click(); - cy.get('.customize-container').should('have.length', 2); - }); - - function buildWidgetTest(widgetName) { - it(`${widgetName} widget should get added`, () => { - cy.get('.mk-widget-edit').click(); - cy.get('.mk-widget-select select').select(widgetName, { force: true }); - cy.get('.bg._modalBg.transparent').click({ multiple: true, force: true }); - cy.get('.mk-widget-add').click({ force: true }); - cy.get(`.mkw-${widgetName}`).should('exist'); - }); - } - - buildWidgetTest('memo'); - buildWidgetTest('notifications'); - buildWidgetTest('timeline'); - buildWidgetTest('calendar'); - buildWidgetTest('rss'); - buildWidgetTest('trends'); - buildWidgetTest('clock'); - buildWidgetTest('activity'); - buildWidgetTest('photos'); - buildWidgetTest('digitalClock'); - buildWidgetTest('federation'); - buildWidgetTest('postForm'); - buildWidgetTest('slideshow'); - buildWidgetTest('serverMetric'); - buildWidgetTest('onlineUsers'); - buildWidgetTest('jobQueue'); - buildWidgetTest('button'); - buildWidgetTest('aiscript'); - buildWidgetTest('aichan'); -}); diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json deleted file mode 100644 index 02e425437..000000000 --- a/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js deleted file mode 100644 index 59b2bab6e..000000000 --- a/cypress/plugins/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/// -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -/** - * @type {Cypress.PluginConfig} - */ -// eslint-disable-next-line no-unused-vars -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -} diff --git a/cypress/support/commands.js b/cypress/support/commands.js deleted file mode 100644 index 95bfcf685..000000000 --- a/cypress/support/commands.js +++ /dev/null @@ -1,55 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) - -Cypress.Commands.add('resetState', () => { - cy.window(win => { - win.indexedDB.deleteDatabase('keyval-store'); - }); - cy.request('POST', '/api/reset-db').as('reset'); - cy.get('@reset').its('status').should('equal', 204); - cy.reload(true); -}); - -Cypress.Commands.add('registerUser', (username, password, isAdmin = false) => { - const route = isAdmin ? '/api/admin/accounts/create' : '/api/signup'; - - cy.request('POST', route, { - username: username, - password: password, - }).its('body').as(username); -}); - -Cypress.Commands.add('login', (username, password) => { - cy.visit('/'); - - cy.intercept('POST', '/api/signin').as('signin'); - - cy.get('[data-cy-signin]').click(); - cy.get('[data-cy-signin-username] input').type(username); - cy.get('[data-cy-signin-password] input').type(`${password}{enter}`); - - cy.wait('@signin').as('signedIn'); -}); diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js deleted file mode 100644 index 9185be344..000000000 --- a/cypress/support/e2e.js +++ /dev/null @@ -1,32 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands' - -// Alternatively you can use CommonJS syntax: -// require('./commands') - -Cypress.on('uncaught:exception', (err, runnable) => { - if ([ - // Chrome - 'ResizeObserver loop limit exceeded', - - // Firefox - 'ResizeObserver loop completed with undelivered notifications', - ].some(msg => err.message.includes(msg))) { - return false; - } -}); diff --git a/package.json b/package.json index 69fc257a2..7a1336898 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "build": "yarn workspaces foreach --topological run build && yarn run gulp", "build-parallel": "yarn workspaces foreach --parallel --topological run build && yarn run gulp", "start": "yarn workspace backend run start", - "start:test": "yarn workspace backend run start:test", "init": "yarn migrate", "migrate": "yarn workspace backend run migrate", "migrateandstart": "yarn migrate && yarn start", @@ -21,11 +20,6 @@ "watch": "yarn dev", "dev": "node ./scripts/dev.mjs", "lint": "yarn workspaces foreach run lint", - "cy:open": "cypress open --browser --e2e --config-file=cypress.config.ts", - "cy:run": "cypress run", - "e2e": "start-server-and-test start:test http://localhost:61812 cy:run", - "mocha": "yarn workspace backend run mocha", - "test": "yarn mocha", "format": "gulp format", "clean": "node ./scripts/clean.mjs", "clean-all": "node ./scripts/clean-all.mjs", @@ -49,8 +43,6 @@ "@types/gulp-rename": "2.0.1", "@typescript-eslint/parser": "^5.46.1", "cross-env": "7.0.3", - "cypress": "10.3.0", - "start-server-and-test": "1.14.0", "typescript": "^4.9.4" }, "packageManager": "yarn@3.4.1" diff --git a/packages/backend/package.json b/packages/backend/package.json index 10af8e8ac..acb2fdadc 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -8,11 +8,8 @@ "build": "tsc -p tsconfig.json || echo done. && tsc-alias -p tsconfig.json", "watch": "node watch.mjs", "lint": "tsc --noEmit --skipLibCheck && eslint src --ext .ts", - "mocha": "NODE_ENV=test mocha", "migrate": "yarn exec typeorm migration:run -d ormconfig.js", - "start": "node --experimental-json-modules ./built/index.js", - "start:test": "NODE_ENV=test node --experimental-json-modules ./built/index.js", - "test": "npm run mocha" + "start": "node --experimental-json-modules ./built/index.js" }, "dependencies": { "@bull-board/api": "^4.3.1", @@ -71,7 +68,6 @@ "koa-views": "7.0.2", "mfm-js": "0.23.3", "mime-types": "2.1.35", - "mocha": "10.2.0", "multer": "1.4.5-lts.1", "nested-property": "4.0.0", "node-fetch": "3.2.6", @@ -139,7 +135,6 @@ "@types/koa__cors": "3.1.1", "@types/koa__multer": "2.0.4", "@types/koa__router": "8.0.11", - "@types/mocha": "9.1.1", "@types/node": "18.7.16", "@types/node-fetch": "3.0.3", "@types/nodemailer": "6.4.5", diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index d598eaddc..343eef3f7 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -70,7 +70,6 @@ import { entities as charts } from '@/services/chart/entities.js'; import { Webhook } from '@/models/entities/webhook.js'; import { getRedisOptions } from '@/config/redis.js'; import { dbLogger } from './logger.js'; -import { redisClient } from './redis.js'; const sqlLogger = dbLogger.createSubLogger('sql'); @@ -209,31 +208,3 @@ export async function initDb(force = false) { await db.initialize(); } } - -export async function resetDb() { - const reset = async () => { - await redisClient.flushdb(); - const tables = await db.query(`SELECT relname AS "table" - FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) - WHERE nspname NOT IN ('pg_catalog', 'information_schema') - AND C.relkind = 'r' - AND nspname !~ '^pg_toast';`); - for (const table of tables) { - await db.query(`DELETE FROM "${table.table}" CASCADE`); - } - }; - - for (let i = 1; i <= 3; i++) { - try { - await reset(); - } catch (e) { - if (i === 3) { - throw e; - } else { - await new Promise(resolve => setTimeout(resolve, SECOND)); - continue; - } - } - break; - } -} diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 1e32cfeb9..741d77201 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -252,7 +252,6 @@ import * as ep___pages_unlike from './endpoints/pages/unlike.js'; import * as ep___pages_update from './endpoints/pages/update.js'; import * as ep___ping from './endpoints/ping.js'; import * as ep___requestResetPassword from './endpoints/request-reset-password.js'; -import * as ep___resetDb from './endpoints/reset-db.js'; import * as ep___resetPassword from './endpoints/reset-password.js'; import * as ep___serverInfo from './endpoints/server-info.js'; import * as ep___stats from './endpoints/stats.js'; @@ -546,7 +545,6 @@ const eps = [ ['pages/update', ep___pages_update], ['ping', ep___ping], ['request-reset-password', ep___requestResetPassword], - ['reset-db', ep___resetDb], ['reset-password', ep___resetPassword], ['server-info', ep___serverInfo], ['stats', ep___stats], diff --git a/packages/backend/src/server/api/endpoints/reset-db.ts b/packages/backend/src/server/api/endpoints/reset-db.ts deleted file mode 100644 index c1b61e781..000000000 --- a/packages/backend/src/server/api/endpoints/reset-db.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { resetDb } from '@/db/postgre.js'; -import { ApiError } from '@/server/api/error.js'; -import define from '@/server/api/define.js'; - -export const meta = { - tags: ['non-productive'], - - requireCredential: false, - - description: 'Only available when running with NODE_ENV=testing. Reset the database and flush Redis.', -} as const; - -export const paramDef = { - type: 'object', - properties: {}, - required: [], -} as const; - -// eslint-disable-next-line import/no-default-export -export default define(meta, paramDef, async () => { - if (process.env.NODE_ENV !== 'test') throw new ApiError('ACCESS_DENIED'); - - await resetDb(); - - await new Promise(resolve => setTimeout(resolve, 1000)); -}); diff --git a/packages/backend/test/.eslintrc.cjs b/packages/backend/test/.eslintrc.cjs deleted file mode 100644 index d83dc37d2..000000000 --- a/packages/backend/test/.eslintrc.cjs +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - parserOptions: { - tsconfigRootDir: __dirname, - project: ['./tsconfig.json'], - }, - extends: ['../.eslintrc.cjs'], - env: { - node: true, - mocha: true, - }, -}; diff --git a/packages/backend/test/activitypub.mjs b/packages/backend/test/activitypub.mjs deleted file mode 100644 index 844b2dbb1..000000000 --- a/packages/backend/test/activitypub.mjs +++ /dev/null @@ -1,113 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import { initDb } from '../built/db/postgre.js'; -import { initTestDb } from './utils.mjs'; - - -function rndstr(length) { - const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - const chars_len = 62; - - let str = ''; - - for (let i = 0; i < length; i++) { - let rand = Math.floor(Math.random() * chars_len); - if (rand === chars_len) { - rand = chars_len - 1; - } - str += chars.charAt(rand); - } - - return str; -} - -describe('ActivityPub', () => { - before(async () => { - //await initTestDb(); - await initDb(); - }); - - describe('Parse minimum object', () => { - const host = 'https://host1.test'; - const preferredUsername = `${rndstr(8)}`; - const actorId = `${host}/users/${preferredUsername.toLowerCase()}`; - - const actor = { - '@context': 'https://www.w3.org/ns/activitystreams', - id: actorId, - type: 'Person', - preferredUsername, - inbox: `${actorId}/inbox`, - outbox: `${actorId}/outbox`, - }; - - const post = { - '@context': 'https://www.w3.org/ns/activitystreams', - id: `${host}/users/${rndstr(8)}`, - type: 'Note', - attributedTo: actor.id, - to: 'https://www.w3.org/ns/activitystreams#Public', - content: 'あ', - }; - - it('Minimum Actor', async () => { - const { MockResolver } = await import('./misc/mock-resolver.mjs'); - const { createPerson } = await import('../built/remote/activitypub/models/person.js'); - - const resolver = new MockResolver(); - resolver._register(actor.id, actor); - - const user = await createPerson(actor.id, resolver); - - assert.deepStrictEqual(user.uri, actor.id); - assert.deepStrictEqual(user.username, actor.preferredUsername); - assert.deepStrictEqual(user.inbox, actor.inbox); - }); - - it('Minimum Note', async () => { - const { MockResolver } = await import('./misc/mock-resolver.mjs'); - const { createNote } = await import('../built/remote/activitypub/models/note.js'); - - const resolver = new MockResolver(); - resolver._register(actor.id, actor); - resolver._register(post.id, post); - - const note = await createNote(post.id, resolver, true); - - assert.deepStrictEqual(note?.uri, post.id); - assert.deepStrictEqual(note.visibility, 'public'); - assert.deepStrictEqual(note.text, post.content); - }); - }); - - describe('Truncate long name', () => { - const host = 'https://host1.test'; - const preferredUsername = `${rndstr(8)}`; - const actorId = `${host}/users/${preferredUsername.toLowerCase()}`; - - const name = rndstr(129); - - const actor = { - '@context': 'https://www.w3.org/ns/activitystreams', - id: actorId, - type: 'Person', - preferredUsername, - name, - inbox: `${actorId}/inbox`, - outbox: `${actorId}/outbox`, - }; - - it('Actor', async () => { - const { MockResolver } = await import('./misc/mock-resolver.mjs'); - const { createPerson } = await import('../built/remote/activitypub/models/person.js'); - - const resolver = new MockResolver(); - resolver._register(actor.id, actor); - - const user = await createPerson(actor.id, resolver); - - assert.deepStrictEqual(user.name, actor.name.substr(0, 128)); - }); - }); -}); diff --git a/packages/backend/test/ap-request.mjs b/packages/backend/test/ap-request.mjs deleted file mode 100644 index 8b5fecfa9..000000000 --- a/packages/backend/test/ap-request.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import * as assert from 'assert'; -import httpSignature from '@peertube/http-signature'; -import { genRsaKeyPair } from '../built/misc/gen-key-pair.js'; -import { createSignedPost, createSignedGet } from '../built/remote/activitypub/ap-request.js'; - -export const buildParsedSignature = (signingString, signature, algorithm) => { - return { - scheme: 'Signature', - params: { - keyId: 'KeyID', // dummy, not used for verify - algorithm: algorithm, - headers: [ '(request-target)', 'date', 'host', 'digest' ], // dummy, not used for verify - signature: signature, - }, - signingString: signingString, - algorithm: algorithm.toUpperCase(), - keyId: 'KeyID', // dummy, not used for verify - }; -}; - -describe('ap-request', () => { - it('createSignedPost with verify', async () => { - const keypair = await genRsaKeyPair(); - const key = { keyId: 'x', 'privateKeyPem': keypair.privateKey }; - const url = 'https://example.com/inbox'; - const activity = { a: 1 }; - const body = JSON.stringify(activity); - const headers = { - 'User-Agent': 'UA', - }; - - const req = createSignedPost({ key, url, body, additionalHeaders: headers }); - - const parsed = buildParsedSignature(req.signingString, req.signature, 'rsa-sha256'); - - const result = httpSignature.verifySignature(parsed, keypair.publicKey); - assert.deepStrictEqual(result, true); - }); - - it('createSignedGet with verify', async () => { - const keypair = await genRsaKeyPair(); - const key = { keyId: 'x', 'privateKeyPem': keypair.privateKey }; - const url = 'https://example.com/outbox'; - const headers = { - 'User-Agent': 'UA', - }; - - const req = createSignedGet({ key, url, additionalHeaders: headers }); - - const parsed = buildParsedSignature(req.signingString, req.signature, 'rsa-sha256'); - - const result = httpSignature.verifySignature(parsed, keypair.publicKey); - assert.deepStrictEqual(result, true); - }); -}); diff --git a/packages/backend/test/api-visibility.mjs b/packages/backend/test/api-visibility.mjs deleted file mode 100644 index 941661297..000000000 --- a/packages/backend/test/api-visibility.mjs +++ /dev/null @@ -1,473 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, startServer, shutdownServer } from './utils.mjs'; - -describe('API visibility', function() { - this.timeout(20*60*1000); - - let p; - - before(async () => { - p = await startServer(); - }); - - after(async () => { - await shutdownServer(p); - }); - - describe('Note visibility', async () => { - //#region vars - /** protagonist */ - let alice; - /** follower */ - let follower; - /** non-follower */ - let other; - /** non-follower who has been replied to or mentioned */ - let target; - /** actor for which a specified visibility was set */ - let target2; - - /** public-post */ - let pub; - /** home-post */ - let home; - /** followers-post */ - let fol; - /** specified-post */ - let spe; - - /** public-reply to target's post */ - let pubR; - /** home-reply to target's post */ - let homeR; - /** followers-reply to target's post */ - let folR; - /** specified-reply to target's post */ - let speR; - - /** public-mention to target */ - let pubM; - /** home-mention to target */ - let homeM; - /** followers-mention to target */ - let folM; - /** specified-mention to target */ - let speM; - - /** reply target post */ - let tgt; - //#endregion - - const show = async (noteId, by) => { - return await request('/notes/show', { - noteId, - }, by); - }; - - before(async () => { - //#region prepare - // signup - alice = await signup({ username: 'alice' }); - follower = await signup({ username: 'follower' }); - other = await signup({ username: 'other' }); - target = await signup({ username: 'target' }); - target2 = await signup({ username: 'target2' }); - - // follow alice <= follower - await request('/following/create', { userId: alice.id }, follower); - - // normal posts - pub = await post(alice, { text: 'x', visibility: 'public' }); - home = await post(alice, { text: 'x', visibility: 'home' }); - fol = await post(alice, { text: 'x', visibility: 'followers' }); - spe = await post(alice, { text: 'x', visibility: 'specified', visibleUserIds: [target.id] }); - - // replies - tgt = await post(target, { text: 'y', visibility: 'public' }); - pubR = await post(alice, { text: 'x', replyId: tgt.id, visibility: 'public' }); - homeR = await post(alice, { text: 'x', replyId: tgt.id, visibility: 'home' }); - folR = await post(alice, { text: 'x', replyId: tgt.id, visibility: 'followers' }); - speR = await post(alice, { text: 'x', replyId: tgt.id, visibility: 'specified' }); - - // mentions - pubM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'public' }); - homeM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'home' }); - folM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'followers' }); - speM = await post(alice, { text: '@target2 x', replyId: tgt.id, visibility: 'specified' }); - //#endregion - }); - - //#region show post - // public - it('[show] public post can be seen by author', async(async () => { - const res = await show(pub.id, alice); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] public post can be seen by follower', async(async () => { - const res = await show(pub.id, follower); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] public post can be seen by non-follower', async(async () => { - const res = await show(pub.id, other); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] public post can be seen unauthenticated', async(async () => { - const res = await show(pub.id, null); - assert.strictEqual(res.body.text, 'x'); - })); - - // home - it('[show] home post can be seen by author', async(async () => { - const res = await show(home.id, alice); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] home post can be seen by follower', async(async () => { - const res = await show(home.id, follower); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] home post can be seen by non-follower', async(async () => { - const res = await show(home.id, other); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] home post can be seen unauthenticated', async(async () => { - const res = await show(home.id, null); - assert.strictEqual(res.body.text, 'x'); - })); - - // followers - it('[show] followers post can be seen by author', async(async () => { - const res = await show(fol.id, alice); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] followers post can be seen by follower', async(async () => { - const res = await show(fol.id, follower); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] followers post is hidden from non-follower', async(async () => { - const res = await show(fol.id, other); - assert.strictEqual(res.status, 404); - })); - - it('[show] followers post is hidden when unathenticated', async(async () => { - const res = await show(fol.id, null); - assert.strictEqual(res.status, 404); - })); - - // specified - it('[show] specified post can be seen by author', async(async () => { - const res = await show(spe.id, alice); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] specified post can be seen by designated user', async(async () => { - const res = await show(spe.id, target); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] specified post is hidden from non-specified follower', async(async () => { - const res = await show(spe.id, follower); - assert.strictEqual(res.status, 404); - })); - - it('[show] specified post is hidden from non-follower', async(async () => { - const res = await show(spe.id, other); - assert.strictEqual(res.status, 404); - })); - - it('[show] specified post is hidden when unauthenticated', async(async () => { - const res = await show(spe.id, null); - assert.strictEqual(res.status, 404); - })); - //#endregion - - //#region show reply - // public - it('[show] public reply can be seen by author', async(async () => { - const res = await show(pubR.id, alice); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] public reply can be seen by replied to author', async(async () => { - const res = await show(pubR.id, target); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] public reply can be seen by follower', async(async () => { - const res = await show(pubR.id, follower); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] public reply can be seen by non-follower', async(async () => { - const res = await show(pubR.id, other); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] public reply can be seen unauthenticated', async(async () => { - const res = await show(pubR.id, null); - assert.strictEqual(res.body.text, 'x'); - })); - - // home - it('[show] home reply can be seen by author', async(async () => { - const res = await show(homeR.id, alice); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] home reply can be seen by replied to author', async(async () => { - const res = await show(homeR.id, target); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] home reply can be seen by follower', async(async () => { - const res = await show(homeR.id, follower); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] home reply can be seen by non-follower', async(async () => { - const res = await show(homeR.id, other); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] home reply can be seen unauthenticated', async(async () => { - const res = await show(homeR.id, null); - assert.strictEqual(res.body.text, 'x'); - })); - - // followers - it('[show] followers reply can be seen by author', async(async () => { - const res = await show(folR.id, alice); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] followers reply can be seen by replied to author', async(async () => { - const res = await show(folR.id, target); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] followers reply can be seen by follower', async(async () => { - const res = await show(folR.id, follower); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] followers reply is hidden from non-follower', async(async () => { - const res = await show(folR.id, other); - assert.strictEqual(res.status, 404); - })); - - it('[show] followers reply is hidden when unauthenticated', async(async () => { - const res = await show(folR.id, null); - assert.strictEqual(res.status, 404); - })); - - // specified - it('[show] specified reply can be seen by author', async(async () => { - const res = await show(speR.id, alice); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] specified reply can be seen by replied to user', async(async () => { - const res = await show(speR.id, target); - assert.strictEqual(res.body.text, 'x'); - })); - - it('[show] specified reply is hidden from follower', async(async () => { - const res = await show(speR.id, follower); - assert.strictEqual(res.status, 404); - })); - - it('[show] specified reply is hidden from non-follower', async(async () => { - const res = await show(speR.id, other); - assert.strictEqual(res.status, 404); - })); - - it('[show] specified reply is hidden when unauthenticated', async(async () => { - const res = await show(speR.id, null); - assert.strictEqual(res.status, 404); - })); - //#endregion - - //#region show mention - // public - it('[show] public-mention can be seen by author', async(async () => { - const res = await show(pubM.id, alice); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] public mention can be seen by mentioned', async(async () => { - const res = await show(pubM.id, target); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] public mention can be seen by follower', async(async () => { - const res = await show(pubM.id, follower); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] public mention can be seen by non-follower', async(async () => { - const res = await show(pubM.id, other); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] public mention can be seen unauthenticated', async(async () => { - const res = await show(pubM.id, null); - assert.strictEqual(res.body.text, '@target x'); - })); - - // home - it('[show] home mention can be seen by author', async(async () => { - const res = await show(homeM.id, alice); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] home mention can be seen by mentioned', async(async () => { - const res = await show(homeM.id, target); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] home mention can be seen by follower', async(async () => { - const res = await show(homeM.id, follower); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] home mention can be seen by non-follower', async(async () => { - const res = await show(homeM.id, other); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] home mention can be seen unauthenticated', async(async () => { - const res = await show(homeM.id, null); - assert.strictEqual(res.body.text, '@target x'); - })); - - // followers - it('[show] followers mention can be seen by author', async(async () => { - const res = await show(folM.id, alice); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] followers mention can be seen by non-follower mentioned', async(async () => { - const res = await show(folM.id, target); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] followers mention can be seen by follower', async(async () => { - const res = await show(folM.id, follower); - assert.strictEqual(res.body.text, '@target x'); - })); - - it('[show] followers mention is hidden from non-follower', async(async () => { - const res = await show(folM.id, other); - assert.strictEqual(res.status, 404); - })); - - it('[show] followers mention is hidden when unauthenticated', async(async () => { - const res = await show(folM.id, null); - assert.strictEqual(res.status, 404); - })); - - // specified - it('[show] specified mention can be seen by author', async(async () => { - const res = await show(speM.id, alice); - assert.strictEqual(res.body.text, '@target2 x'); - })); - - it('[show] specified mention can be seen by specified actor', async(async () => { - const res = await show(speM.id, target); - assert.strictEqual(res.body.text, '@target2 x'); - })); - - it('[show] specified mention is hidden from mentioned but not specified actor', async(async () => { - const res = await show(speM.id, target2); - assert.strictEqual(res.status, 404); - })); - - it('[show] specified mention is hidden from follower', async(async () => { - const res = await show(speM.id, follower); - assert.strictEqual(res.status, 404); - })); - - it('[show] specified mention is hidden from non-follower', async(async () => { - const res = await show(speM.id, other); - assert.strictEqual(res.status, 404); - })); - - it('[show] specified mention is hidden when unauthenticated', async(async () => { - const res = await show(speM.id, null); - assert.strictEqual(res.status, 404); - })); - //#endregion - - //#region Home Timeline - it('[TL] public post on author home TL', async(async () => { - const res = await request('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.status, 200); - const notes = res.body.filter((n) => n.id == pub.id); - assert.strictEqual(notes[0].text, 'x'); - })); - - it('[TL] public post absent from non-follower home TL', async(async () => { - const res = await request('/notes/timeline', { limit: 100 }, other); - assert.strictEqual(res.status, 200); - const notes = res.body.filter((n) => n.id == pub.id); - assert.strictEqual(notes.length, 0); - })); - - it('[TL] followers post on follower home TL', async(async () => { - const res = await request('/notes/timeline', { limit: 100 }, follower); - assert.strictEqual(res.status, 200); - const notes = res.body.filter((n) => n.id == fol.id); - assert.strictEqual(notes[0].text, 'x'); - })); - //#endregion - - //#region replies timeline - it('[TL] followers reply on follower reply TL', async(async () => { - const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, follower); - assert.strictEqual(res.status, 200); - const notes = res.body.filter((n) => n.id == folR.id); - assert.strictEqual(notes[0].text, 'x'); - })); - - it('[TL] followers reply absent from not replied to non-follower reply TL', async(async () => { - const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, other); - assert.strictEqual(res.status, 200); - const notes = res.body.filter((n) => n.id == folR.id); - assert.strictEqual(notes.length, 0); - })); - - it('[TL] followers reply on replied to actor reply TL', async(async () => { - const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, target); - assert.strictEqual(res.status, 200); - const notes = res.body.filter((n) => n.id == folR.id); - assert.strictEqual(notes[0].text, 'x'); - })); - //#endregion - - //#region MTL - it('[TL] followers reply on replied to non-follower mention TL', async(async () => { - const res = await request('/notes/mentions', { limit: 100 }, target); - assert.strictEqual(res.status, 200); - const notes = res.body.filter((n) => n.id == folR.id); - assert.strictEqual(notes[0].text, 'x'); - })); - - it('[TL] followers mention on mentioned non-follower mention TL', async(async () => { - const res = await request('/notes/mentions', { limit: 100 }, target); - assert.strictEqual(res.status, 200); - const notes = res.body.filter((n) => n.id == folM.id); - assert.strictEqual(notes[0].text, '@target x'); - })); - //#endregion - }); -}); diff --git a/packages/backend/test/api.mjs b/packages/backend/test/api.mjs deleted file mode 100644 index 7c5b7e0b2..000000000 --- a/packages/backend/test/api.mjs +++ /dev/null @@ -1,83 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, uploadFile, startServer, shutdownServer } from './utils.mjs'; - -describe('API', function() { - this.timeout(20*60*1000); - - let p; - let alice, bob, carol; - - before(async () => { - p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); - }); - - after(async () => { - await shutdownServer(p); - }); - - describe('General validation', () => { - it('wrong type', async(async () => { - const res = await request('/test', { - required: true, - string: 42, - }); - assert.strictEqual(res.status, 400); - })); - - it('missing require param', async(async () => { - const res = await request('/test', { - string: 'a', - }); - assert.strictEqual(res.status, 400); - })); - - it('invalid misskey:id (empty string)', async(async () => { - const res = await request('/test', { - required: true, - id: '', - }); - assert.strictEqual(res.status, 400); - })); - - it('valid misskey:id', async(async () => { - const res = await request('/test', { - required: true, - id: '8wvhjghbxu', - }); - assert.strictEqual(res.status, 200); - })); - - it('default value', async(async () => { - const res = await request('/test', { - required: true, - string: 'a', - }); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.default, 'hello'); - })); - - it('can set null even if it has default value', async(async () => { - const res = await request('/test', { - required: true, - nullableDefault: null, - }); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.nullableDefault, null); - })); - - it('cannot set undefined if it has default value', async(async () => { - const res = await request('/test', { - required: true, - nullableDefault: undefined, - }); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.nullableDefault, 'hello'); - })); - }); -}); diff --git a/packages/backend/test/block.mjs b/packages/backend/test/block.mjs deleted file mode 100644 index ed5cf2170..000000000 --- a/packages/backend/test/block.mjs +++ /dev/null @@ -1,85 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, startServer, shutdownServer } from './utils.mjs'; - -describe('Block', function() { - this.timeout(20*60*1000); - - let p; - - // alice blocks bob - let alice, bob, carol; - - before(async () => { - p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); - }); - - after(async () => { - await shutdownServer(p); - }); - - it('can block someone', async(async () => { - const res = await request('/blocking/create', { - userId: bob.id, - }, alice); - - assert.strictEqual(res.status, 200); - })); - - it('cannot follow if blocked', async(async () => { - const res = await request('/following/create', { userId: alice.id }, bob); - - assert.strictEqual(res.status, 400); - assert.strictEqual(res.body.error.code, 'BLOCKED'); - })); - - it('cannot react to blocking users note', async(async () => { - const note = await post(alice, { text: 'hello' }); - - const res = await request('/notes/reactions/create', { noteId: note.id, reaction: '👍' }, bob); - - assert.strictEqual(res.status, 400); - assert.strictEqual(res.body.error.code, 'BLOCKED'); - })); - - it('cannot reply to blocking users note', async(async () => { - const note = await post(alice, { text: 'hello' }); - - const res = await request('/notes/create', { replyId: note.id, text: 'yo' }, bob); - - assert.strictEqual(res.status, 400); - assert.strictEqual(res.body.error.code, 'BLOCKED'); - })); - - it('canot renote blocking users note', async(async () => { - const note = await post(alice, { text: 'hello' }); - - const res = await request('/notes/create', { renoteId: note.id, text: 'yo' }, bob); - - assert.strictEqual(res.status, 400); - assert.strictEqual(res.body.error.code, 'BLOCKED'); - })); - - it('cannot include blocked users in user lists'); - - it('removes users from user lists'); - - it('local timeline does not contain blocked users', async(async () => { - const aliceNote = await post(alice); - const bobNote = await post(bob); - const carolNote = await post(carol); - - const res = await request('/notes/local-timeline', {}, bob); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note) => note.id === aliceNote.id), false); - assert.strictEqual(res.body.some((note) => note.id === bobNote.id), true); - assert.strictEqual(res.body.some((note) => note.id === carolNote.id), true); - })); -}); diff --git a/packages/backend/test/chart.mjs b/packages/backend/test/chart.mjs deleted file mode 100644 index 70874df16..000000000 --- a/packages/backend/test/chart.mjs +++ /dev/null @@ -1,527 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as lolex from '@sinonjs/fake-timers'; -import TestChart from '../built/services/chart/charts/test.js'; -import TestGroupedChart from '../built/services/chart/charts/test-grouped.js'; -import TestUniqueChart from '../built/services/chart/charts/test-unique.js'; -import TestIntersectionChart from '../built/services/chart/charts/test-intersection.js'; -import { initDb } from '../built/db/postgre.js'; - -describe('Chart', () => { - let testChart, testGroupedChart, testUniqueChart, testIntersectionChart, clock; - - beforeEach(async () => { - await initDb(true); - - testChart = new TestChart(); - testGroupedChart = new TestGroupedChart(); - testUniqueChart = new TestUniqueChart(); - testIntersectionChart = new TestIntersectionChart(); - - clock = lolex.install({ - now: new Date(Date.UTC(2000, 0, 1, 0, 0, 0)), - shouldClearNativeTimers: true, - }); - }); - - afterEach(() => { - clock.uninstall(); - }); - - it('Can updates', async () => { - await testChart.increment(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - }); - - it('Can updates (dec)', async () => { - await testChart.decrement(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [1, 0, 0], - inc: [0, 0, 0], - total: [-1, 0, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [1, 0, 0], - inc: [0, 0, 0], - total: [-1, 0, 0], - }, - }); - }); - - it('Empty chart', async () => { - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [0, 0, 0], - total: [0, 0, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [0, 0, 0], - total: [0, 0, 0], - }, - }); - }); - - it('Can updates at multiple times at same time', async () => { - await testChart.increment(); - await testChart.increment(); - await testChart.increment(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [3, 0, 0], - total: [3, 0, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [3, 0, 0], - total: [3, 0, 0], - }, - }); - }); - - it('複数回saveされてもデータの更新は一度だけ', async () => { - await testChart.increment(); - await testChart.save(); - await testChart.save(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - }); - - it('Can updates at different times', async () => { - await testChart.increment(); - await testChart.save(); - - clock.tick('01:00:00'); - - await testChart.increment(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 1, 0], - total: [2, 1, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [2, 0, 0], - total: [2, 0, 0], - }, - }); - }); - - // 仕様上はこうなってほしいけど、実装は難しそうなのでskip - /* - it('Can updates at different times without save', async () => { - await testChart.increment(); - - clock.tick('01:00:00'); - - await testChart.increment(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 1, 0], - total: [2, 1, 0] - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [2, 0, 0], - total: [2, 0, 0] - }, - }); - }); - */ - - it('Can padding', async () => { - await testChart.increment(); - await testChart.save(); - - clock.tick('02:00:00'); - - await testChart.increment(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 1], - total: [2, 1, 1], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [2, 0, 0], - total: [2, 0, 0], - }, - }); - }); - - // 要求された範囲にログがひとつもない場合でもパディングできる - it('Can padding from past range', async () => { - await testChart.increment(); - await testChart.save(); - - clock.tick('05:00:00'); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [0, 0, 0], - total: [1, 1, 1], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - }); - - // 要求された範囲の最も古い箇所に位置するログが存在しない場合でもパディングできる - // Issue #3190 - it('Can padding from past range 2', async () => { - await testChart.increment(); - await testChart.save(); - - clock.tick('05:00:00'); - - await testChart.increment(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [2, 1, 1], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [2, 0, 0], - total: [2, 0, 0], - }, - }); - }); - - it('Can specify offset', async () => { - await testChart.increment(); - await testChart.save(); - - clock.tick('01:00:00'); - - await testChart.increment(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, new Date(Date.UTC(2000, 0, 1, 0, 0, 0))); - const chartDays = await testChart.getChart('day', 3, new Date(Date.UTC(2000, 0, 1, 0, 0, 0))); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [2, 0, 0], - total: [2, 0, 0], - }, - }); - }); - - it('Can specify offset (floor time)', async () => { - clock.tick('00:30:00'); - - await testChart.increment(); - await testChart.save(); - - clock.tick('01:30:00'); - - await testChart.increment(); - await testChart.save(); - - const chartHours = await testChart.getChart('hour', 3, new Date(Date.UTC(2000, 0, 1, 0, 0, 0))); - const chartDays = await testChart.getChart('day', 3, new Date(Date.UTC(2000, 0, 1, 0, 0, 0))); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [2, 0, 0], - total: [2, 0, 0], - }, - }); - }); - - describe('Grouped', () => { - it('Can updates', async () => { - await testGroupedChart.increment('alice'); - await testGroupedChart.save(); - - const aliceChartHours = await testGroupedChart.getChart('hour', 3, null, 'alice'); - const aliceChartDays = await testGroupedChart.getChart('day', 3, null, 'alice'); - const bobChartHours = await testGroupedChart.getChart('hour', 3, null, 'bob'); - const bobChartDays = await testGroupedChart.getChart('day', 3, null, 'bob'); - - assert.deepStrictEqual(aliceChartHours, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - - assert.deepStrictEqual(aliceChartDays, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [1, 0, 0], - }, - }); - - assert.deepStrictEqual(bobChartHours, { - foo: { - dec: [0, 0, 0], - inc: [0, 0, 0], - total: [0, 0, 0], - }, - }); - - assert.deepStrictEqual(bobChartDays, { - foo: { - dec: [0, 0, 0], - inc: [0, 0, 0], - total: [0, 0, 0], - }, - }); - }); - }); - - describe('Unique increment', () => { - it('Can updates', async () => { - await testUniqueChart.uniqueIncrement('alice'); - await testUniqueChart.uniqueIncrement('alice'); - await testUniqueChart.uniqueIncrement('bob'); - await testUniqueChart.save(); - - const chartHours = await testUniqueChart.getChart('hour', 3, null); - const chartDays = await testUniqueChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: [2, 0, 0], - }); - - assert.deepStrictEqual(chartDays, { - foo: [2, 0, 0], - }); - }); - - describe('Intersection', () => { - it('条件が満たされていない場合はカウントされない', async () => { - await testIntersectionChart.addA('alice'); - await testIntersectionChart.addA('bob'); - await testIntersectionChart.addB('carol'); - await testIntersectionChart.save(); - - const chartHours = await testIntersectionChart.getChart('hour', 3, null); - const chartDays = await testIntersectionChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - a: [2, 0, 0], - b: [1, 0, 0], - aAndB: [0, 0, 0], - }); - - assert.deepStrictEqual(chartDays, { - a: [2, 0, 0], - b: [1, 0, 0], - aAndB: [0, 0, 0], - }); - }); - - it('条件が満たされている場合にカウントされる', async () => { - await testIntersectionChart.addA('alice'); - await testIntersectionChart.addA('bob'); - await testIntersectionChart.addB('carol'); - await testIntersectionChart.addB('alice'); - await testIntersectionChart.save(); - - const chartHours = await testIntersectionChart.getChart('hour', 3, null); - const chartDays = await testIntersectionChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - a: [2, 0, 0], - b: [2, 0, 0], - aAndB: [1, 0, 0], - }); - - assert.deepStrictEqual(chartDays, { - a: [2, 0, 0], - b: [2, 0, 0], - aAndB: [1, 0, 0], - }); - }); - }); - }); - - describe('Resync', () => { - it('Can resync', async () => { - testChart.total = 1; - - await testChart.resync(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [0, 0, 0], - total: [1, 0, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [0, 0, 0], - total: [1, 0, 0], - }, - }); - }); - - it('Can resync (2)', async () => { - await testChart.increment(); - await testChart.save(); - - clock.tick('01:00:00'); - - testChart.total = 100; - - await testChart.resync(); - - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); - - assert.deepStrictEqual(chartHours, { - foo: { - dec: [0, 0, 0], - inc: [0, 1, 0], - total: [100, 1, 0], - }, - }); - - assert.deepStrictEqual(chartDays, { - foo: { - dec: [0, 0, 0], - inc: [1, 0, 0], - total: [100, 0, 0], - }, - }); - }); - }); -}); diff --git a/packages/backend/test/endpoints.mjs b/packages/backend/test/endpoints.mjs deleted file mode 100644 index 40bb91ed7..000000000 --- a/packages/backend/test/endpoints.mjs +++ /dev/null @@ -1,864 +0,0 @@ -/* -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, uploadFile, startServer, shutdownServer } from './utils.mjs'; - -describe('API: Endpoints', () => { - let p; - - let alice, bob, carol; - - before(async () => { - p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); - }); - - after(async () => { - await shutdownServer(p); - }); - - describe('signup', () => { - it('不正なユーザー名でアカウントが作成できない', async(async () => { - const res = await request('/signup', { - username: 'test.', - password: 'test' - }); - assert.strictEqual(res.status, 400); - })); - - it('空のパスワードでアカウントが作成できない', async(async () => { - const res = await request('/signup', { - username: 'test', - password: '' - }); - assert.strictEqual(res.status, 400); - })); - - it('正しくアカウントが作成できる', async(async () => { - const me = { - username: 'test1', - password: 'test1' - }; - - const res = await request('/signup', me); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.username, me.username); - })); - - it('同じユーザー名のアカウントは作成できない', async(async () => { - await signup({ - username: 'test2' - }); - - const res = await request('/signup', { - username: 'test2', - password: 'test2' - }); - - assert.strictEqual(res.status, 400); - })); - }); - - describe('signin', () => { - it('間違ったパスワードでサインインできない', async(async () => { - await signup({ - username: 'test3', - password: 'foo' - }); - - const res = await request('/signin', { - username: 'test3', - password: 'bar' - }); - - assert.strictEqual(res.status, 403); - })); - - it('クエリをインジェクションできない', async(async () => { - await signup({ - username: 'test4' - }); - - const res = await request('/signin', { - username: 'test4', - password: { - $gt: '' - } - }); - - assert.strictEqual(res.status, 400); - })); - - it('正しい情報でサインインできる', async(async () => { - await signup({ - username: 'test5', - password: 'foo' - }); - - const res = await request('/signin', { - username: 'test5', - password: 'foo' - }); - - assert.strictEqual(res.status, 200); - })); - }); - - describe('i/update', () => { - it('アカウント設定を更新できる', async(async () => { - const myName = '大室櫻子'; - const myLocation = '七森中'; - const myBirthday = '2000-09-07'; - - const res = await request('/i/update', { - name: myName, - location: myLocation, - birthday: myBirthday - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.name, myName); - assert.strictEqual(res.body.location, myLocation); - assert.strictEqual(res.body.birthday, myBirthday); - })); - - it('名前を空白にできない', async(async () => { - const res = await request('/i/update', { - name: ' ' - }, alice); - assert.strictEqual(res.status, 400); - })); - - it('誕生日の設定を削除できる', async(async () => { - await request('/i/update', { - birthday: '2000-09-07' - }, alice); - - const res = await request('/i/update', { - birthday: null - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.birthday, null); - })); - - it('不正な誕生日の形式で怒られる', async(async () => { - const res = await request('/i/update', { - birthday: '2000/09/07' - }, alice); - assert.strictEqual(res.status, 400); - })); - }); - - describe('users/show', () => { - it('ユーザーが取得できる', async(async () => { - const res = await request('/users/show', { - userId: alice.id - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.id, alice.id); - })); - - it('ユーザーが存在しなかったら怒る', async(async () => { - const res = await request('/users/show', { - userId: '000000000000000000000000' - }); - assert.strictEqual(res.status, 400); - })); - - it('間違ったIDで怒られる', async(async () => { - const res = await request('/users/show', { - userId: 'kyoppie' - }); - assert.strictEqual(res.status, 400); - })); - }); - - describe('notes/show', () => { - it('投稿が取得できる', async(async () => { - const myPost = await post(alice, { - text: 'test' - }); - - const res = await request('/notes/show', { - noteId: myPost.id - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.id, myPost.id); - assert.strictEqual(res.body.text, myPost.text); - })); - - it('投稿が存在しなかったら怒る', async(async () => { - const res = await request('/notes/show', { - noteId: '000000000000000000000000' - }); - assert.strictEqual(res.status, 400); - })); - - it('間違ったIDで怒られる', async(async () => { - const res = await request('/notes/show', { - noteId: 'kyoppie' - }); - assert.strictEqual(res.status, 400); - })); - }); - - describe('notes/reactions/create', () => { - it('リアクションできる', async(async () => { - const bobPost = await post(bob); - - const alice = await signup({ username: 'alice' }); - const res = await request('/notes/reactions/create', { - noteId: bobPost.id, - reaction: '🚀', - }, alice); - - assert.strictEqual(res.status, 204); - - const resNote = await request('/notes/show', { - noteId: bobPost.id, - }, alice); - - assert.strictEqual(resNote.status, 200); - assert.strictEqual(resNote.body.reactions['🚀'], [alice.id]); - })); - - it('自分の投稿にもリアクションできる', async(async () => { - const myPost = await post(alice); - - const res = await request('/notes/reactions/create', { - noteId: myPost.id, - reaction: '🚀', - }, alice); - - assert.strictEqual(res.status, 204); - })); - - it('二重にリアクションできない', async(async () => { - const bobPost = await post(bob); - - await react(alice, bobPost, 'like'); - - const res = await request('/notes/reactions/create', { - noteId: bobPost.id, - reaction: '🚀', - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('存在しない投稿にはリアクションできない', async(async () => { - const res = await request('/notes/reactions/create', { - noteId: '000000000000000000000000', - reaction: '🚀', - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('空のパラメータで怒られる', async(async () => { - const res = await request('/notes/reactions/create', {}, alice); - - assert.strictEqual(res.status, 400); - })); - - it('間違ったIDで怒られる', async(async () => { - const res = await request('/notes/reactions/create', { - noteId: 'kyoppie', - reaction: '🚀', - }, alice); - - assert.strictEqual(res.status, 400); - })); - }); - - describe('following/create', () => { - it('フォローできる', async(async () => { - const res = await request('/following/create', { - userId: alice.id - }, bob); - - assert.strictEqual(res.status, 200); - })); - - it('既にフォローしている場合は怒る', async(async () => { - const res = await request('/following/create', { - userId: alice.id - }, bob); - - assert.strictEqual(res.status, 400); - })); - - it('存在しないユーザーはフォローできない', async(async () => { - const res = await request('/following/create', { - userId: '000000000000000000000000' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('自分自身はフォローできない', async(async () => { - const res = await request('/following/create', { - userId: alice.id - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('空のパラメータで怒られる', async(async () => { - const res = await request('/following/create', {}, alice); - - assert.strictEqual(res.status, 400); - })); - - it('間違ったIDで怒られる', async(async () => { - const res = await request('/following/create', { - userId: 'foo' - }, alice); - - assert.strictEqual(res.status, 400); - })); - }); - - describe('following/delete', () => { - it('フォロー解除できる', async(async () => { - await request('/following/create', { - userId: alice.id - }, bob); - - const res = await request('/following/delete', { - userId: alice.id - }, bob); - - assert.strictEqual(res.status, 200); - })); - - it('フォローしていない場合は怒る', async(async () => { - const res = await request('/following/delete', { - userId: alice.id - }, bob); - - assert.strictEqual(res.status, 400); - })); - - it('存在しないユーザーはフォロー解除できない', async(async () => { - const res = await request('/following/delete', { - userId: '000000000000000000000000' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('自分自身はフォロー解除できない', async(async () => { - const res = await request('/following/delete', { - userId: alice.id - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('空のパラメータで怒られる', async(async () => { - const res = await request('/following/delete', {}, alice); - - assert.strictEqual(res.status, 400); - })); - - it('間違ったIDで怒られる', async(async () => { - const res = await request('/following/delete', { - userId: 'kyoppie' - }, alice); - - assert.strictEqual(res.status, 400); - })); - }); - - describe('drive', () => { - it('ドライブ情報を取得できる', async(async () => { - await uploadFile({ - userId: alice.id, - size: 256 - }); - await uploadFile({ - userId: alice.id, - size: 512 - }); - await uploadFile({ - userId: alice.id, - size: 1024 - }); - const res = await request('/drive', {}, alice); - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - expect(res.body).have.property('usage').eql(1792); - })); - }); - - describe('drive/files/create', () => { - it('ファイルを作成できる', async(async () => { - const res = await uploadFile(alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.name, 'Lenna.png'); - })); - - it('ファイルに名前を付けられる', async(async () => { - const res = await assert.request(server) - .post('/drive/files/create') - .field('i', alice.token) - .field('name', 'Belmond.png') - .attach('file', fs.readFileSync(__dirname + '/resources/Lenna.png'), 'Lenna.png'); - - expect(res).have.status(200); - expect(res.body).be.a('object'); - expect(res.body).have.property('name').eql('Belmond.png'); - })); - - it('ファイル無しで怒られる', async(async () => { - const res = await request('/drive/files/create', {}, alice); - - assert.strictEqual(res.status, 400); - })); - - it('SVGファイルを作成できる', async(async () => { - const res = await uploadFile(alice, __dirname + '/resources/image.svg'); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.name, 'image.svg'); - assert.strictEqual(res.body.type, 'image/svg+xml'); - })); - }); - - describe('drive/files/update', () => { - it('名前を更新できる', async(async () => { - const file = await uploadFile(alice); - const newName = 'いちごパスタ.png'; - - const res = await request('/drive/files/update', { - fileId: file.id, - name: newName - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.name, newName); - })); - - it('他人のファイルは更新できない', async(async () => { - const file = await uploadFile(bob); - - const res = await request('/drive/files/update', { - fileId: file.id, - name: 'いちごパスタ.png' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('親フォルダを更新できる', async(async () => { - const file = await uploadFile(alice); - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - - const res = await request('/drive/files/update', { - fileId: file.id, - folderId: folder.id - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.folderId, folder.id); - })); - - it('親フォルダを無しにできる', async(async () => { - const file = await uploadFile(alice); - - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - - await request('/drive/files/update', { - fileId: file.id, - folderId: folder.id - }, alice); - - const res = await request('/drive/files/update', { - fileId: file.id, - folderId: null - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.folderId, null); - })); - - it('他人のフォルダには入れられない', async(async () => { - const file = await uploadFile(alice); - const folder = (await request('/drive/folders/create', { - name: 'test' - }, bob)).body; - - const res = await request('/drive/files/update', { - fileId: file.id, - folderId: folder.id - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('存在しないフォルダで怒られる', async(async () => { - const file = await uploadFile(alice); - - const res = await request('/drive/files/update', { - fileId: file.id, - folderId: '000000000000000000000000' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('不正なフォルダIDで怒られる', async(async () => { - const file = await uploadFile(alice); - - const res = await request('/drive/files/update', { - fileId: file.id, - folderId: 'foo' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('ファイルが存在しなかったら怒る', async(async () => { - const res = await request('/drive/files/update', { - fileId: '000000000000000000000000', - name: 'いちごパスタ.png' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('間違ったIDで怒られる', async(async () => { - const res = await request('/drive/files/update', { - fileId: 'kyoppie', - name: 'いちごパスタ.png' - }, alice); - - assert.strictEqual(res.status, 400); - })); - }); - - describe('drive/folders/create', () => { - it('フォルダを作成できる', async(async () => { - const res = await request('/drive/folders/create', { - name: 'test' - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.name, 'test'); - })); - }); - - describe('drive/folders/update', () => { - it('名前を更新できる', async(async () => { - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - - const res = await request('/drive/folders/update', { - folderId: folder.id, - name: 'new name' - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.name, 'new name'); - })); - - it('他人のフォルダを更新できない', async(async () => { - const folder = (await request('/drive/folders/create', { - name: 'test' - }, bob)).body; - - const res = await request('/drive/folders/update', { - folderId: folder.id, - name: 'new name' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('親フォルダを更新できる', async(async () => { - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - const parentFolder = (await request('/drive/folders/create', { - name: 'parent' - }, alice)).body; - - const res = await request('/drive/folders/update', { - folderId: folder.id, - parentId: parentFolder.id - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.parentId, parentFolder.id); - })); - - it('親フォルダを無しに更新できる', async(async () => { - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - const parentFolder = (await request('/drive/folders/create', { - name: 'parent' - }, alice)).body; - await request('/drive/folders/update', { - folderId: folder.id, - parentId: parentFolder.id - }, alice); - - const res = await request('/drive/folders/update', { - folderId: folder.id, - parentId: null - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.parentId, null); - })); - - it('他人のフォルダを親フォルダに設定できない', async(async () => { - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - const parentFolder = (await request('/drive/folders/create', { - name: 'parent' - }, bob)).body; - - const res = await request('/drive/folders/update', { - folderId: folder.id, - parentId: parentFolder.id - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('フォルダが循環するような構造にできない', async(async () => { - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - const parentFolder = (await request('/drive/folders/create', { - name: 'parent' - }, alice)).body; - await request('/drive/folders/update', { - folderId: parentFolder.id, - parentId: folder.id - }, alice); - - const res = await request('/drive/folders/update', { - folderId: folder.id, - parentId: parentFolder.id - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('フォルダが循環するような構造にできない(再帰的)', async(async () => { - const folderA = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - const folderB = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - const folderC = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - await request('/drive/folders/update', { - folderId: folderB.id, - parentId: folderA.id - }, alice); - await request('/drive/folders/update', { - folderId: folderC.id, - parentId: folderB.id - }, alice); - - const res = await request('/drive/folders/update', { - folderId: folderA.id, - parentId: folderC.id - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('フォルダが循環するような構造にできない(自身)', async(async () => { - const folderA = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - - const res = await request('/drive/folders/update', { - folderId: folderA.id, - parentId: folderA.id - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('存在しない親フォルダを設定できない', async(async () => { - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - - const res = await request('/drive/folders/update', { - folderId: folder.id, - parentId: '000000000000000000000000' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('不正な親フォルダIDで怒られる', async(async () => { - const folder = (await request('/drive/folders/create', { - name: 'test' - }, alice)).body; - - const res = await request('/drive/folders/update', { - folderId: folder.id, - parentId: 'foo' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('存在しないフォルダを更新できない', async(async () => { - const res = await request('/drive/folders/update', { - folderId: '000000000000000000000000' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('不正なフォルダIDで怒られる', async(async () => { - const res = await request('/drive/folders/update', { - folderId: 'foo' - }, alice); - - assert.strictEqual(res.status, 400); - })); - }); - - describe('messaging/messages/create', () => { - it('メッセージを送信できる', async(async () => { - const res = await request('/messaging/messages/create', { - userId: bob.id, - text: 'test' - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.text, 'test'); - })); - - it('自分自身にはメッセージを送信できない', async(async () => { - const res = await request('/messaging/messages/create', { - userId: alice.id, - text: 'Yo' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('存在しないユーザーにはメッセージを送信できない', async(async () => { - const res = await request('/messaging/messages/create', { - userId: '000000000000000000000000', - text: 'test' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('不正なユーザーIDで怒られる', async(async () => { - const res = await request('/messaging/messages/create', { - userId: 'foo', - text: 'test' - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('テキストが無くて怒られる', async(async () => { - const res = await request('/messaging/messages/create', { - userId: bob.id - }, alice); - - assert.strictEqual(res.status, 400); - })); - - it('文字数オーバーで怒られる', async(async () => { - const res = await request('/messaging/messages/create', { - userId: bob.id, - text: '!'.repeat(1001) - }, alice); - - assert.strictEqual(res.status, 400); - })); - }); - - describe('notes/replies', () => { - it('自分に閲覧権限のない投稿は含まれない', async(async () => { - const alicePost = await post(alice, { - text: 'foo' - }); - - await post(bob, { - replyId: alicePost.id, - text: 'bar', - visibility: 'specified', - visibleUserIds: [alice.id] - }); - - const res = await request('/notes/replies', { - noteId: alicePost.id - }, carol); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.length, 0); - })); - }); - - describe('notes/timeline', () => { - it('フォロワー限定投稿が含まれる', async(async () => { - await request('/following/create', { - userId: alice.id - }, bob); - - const alicePost = await post(alice, { - text: 'foo', - visibility: 'followers' - }); - - const res = await request('/notes/timeline', {}, bob); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.length, 1); - assert.strictEqual(res.body[0].id, alicePost.id); - })); - }); -}); -*/ diff --git a/packages/backend/test/extract-mentions.mjs b/packages/backend/test/extract-mentions.mjs deleted file mode 100644 index 2512ac868..000000000 --- a/packages/backend/test/extract-mentions.mjs +++ /dev/null @@ -1,42 +0,0 @@ -import * as assert from 'assert'; - -import { parse } from 'mfm-js'; -import { extractMentions } from '../built/misc/extract-mentions.js'; - -describe('Extract mentions', () => { - it('simple', () => { - const ast = parse('@foo @bar @baz'); - const mentions = extractMentions(ast); - assert.deepStrictEqual(mentions, [{ - username: 'foo', - acct: '@foo', - host: null, - }, { - username: 'bar', - acct: '@bar', - host: null, - }, { - username: 'baz', - acct: '@baz', - host: null, - }]); - }); - - it('nested', () => { - const ast = parse('@foo **@bar** @baz'); - const mentions = extractMentions(ast); - assert.deepStrictEqual(mentions, [{ - username: 'foo', - acct: '@foo', - host: null, - }, { - username: 'bar', - acct: '@bar', - host: null, - }, { - username: 'baz', - acct: '@baz', - host: null, - }]); - }); -}); diff --git a/packages/backend/test/fetch-resource.mjs b/packages/backend/test/fetch-resource.mjs deleted file mode 100644 index ad135bcec..000000000 --- a/packages/backend/test/fetch-resource.mjs +++ /dev/null @@ -1,206 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import * as openapi from '@redocly/openapi-core'; -import { async, startServer, signup, post, request, simpleGet, port, shutdownServer } from './utils.mjs'; - -// Request Accept -const ONLY_AP = 'application/activity+json'; -const PREFER_AP = 'application/activity+json, */*'; -const PREFER_HTML = 'text/html, */*'; -const UNSPECIFIED = '*/*'; - -// Response Contet-Type -const AP = 'application/activity+json; charset=utf-8'; -const JSON = 'application/json; charset=utf-8'; -const HTML = 'text/html; charset=utf-8'; - -describe('Fetch resource', function() { - this.timeout(20*60*1000); - - let p; - - let alice, alicesPost; - - before(async () => { - p = await startServer(); - alice = await signup({ username: 'alice' }); - alicesPost = await post(alice, { - text: 'test', - }); - }); - - after(async () => { - await shutdownServer(p); - }); - - describe('Common', () => { - it('meta', async(async () => { - const res = await request('/meta', { - }); - - assert.strictEqual(res.status, 200); - })); - - it('GET root', async(async () => { - const res = await simpleGet('/'); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, HTML); - })); - - it('GET docs', async(async () => { - const res = await simpleGet('/docs/ja-JP/about'); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, HTML); - })); - - it('GET api-doc', async(async () => { - const res = await simpleGet('/api-doc'); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, HTML); - })); - - it('GET api.json', async(async () => { - const res = await simpleGet('/api.json'); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, JSON); - })); - - it('Validate api.json', async(async () => { - const config = await openapi.loadConfig(); - const result = await openapi.bundle({ - config, - ref: `http://localhost:${port}/api.json`, - }); - - for (const problem of result.problems) { - console.log(`${problem.message} - ${problem.location[0]?.pointer}`); - } - - assert.strictEqual(result.problems.length, 0); - })); - - it('GET favicon.ico', async(async () => { - const res = await simpleGet('/favicon.ico'); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'image/x-icon'); - })); - - it('GET apple-touch-icon.png', async(async () => { - const res = await simpleGet('/apple-touch-icon.png'); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'image/png'); - })); - - it('GET twemoji svg', async(async () => { - const res = await simpleGet('/twemoji/2764.svg'); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'image/svg+xml'); - })); - - it('GET twemoji svg with hyphen', async(async () => { - const res = await simpleGet('/twemoji/2764-fe0f-200d-1f525.svg'); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'image/svg+xml'); - })); - }); - - describe('/@:username', () => { - it('Only AP => AP', async(async () => { - const res = await simpleGet(`/@${alice.username}`, ONLY_AP); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, AP); - })); - - it('Prefer AP => AP', async(async () => { - const res = await simpleGet(`/@${alice.username}`, PREFER_AP); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, AP); - })); - - it('Prefer HTML => HTML', async(async () => { - const res = await simpleGet(`/@${alice.username}`, PREFER_HTML); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, HTML); - })); - - it('Unspecified => HTML', async(async () => { - const res = await simpleGet(`/@${alice.username}`, UNSPECIFIED); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, HTML); - })); - }); - - describe('/users/:id', () => { - it('Only AP => AP', async(async () => { - const res = await simpleGet(`/users/${alice.id}`, ONLY_AP); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, AP); - })); - - it('Prefer AP => AP', async(async () => { - const res = await simpleGet(`/users/${alice.id}`, PREFER_AP); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, AP); - })); - - it('Prefer HTML => Redirect to /@:username', async(async () => { - const res = await simpleGet(`/users/${alice.id}`, PREFER_HTML); - assert.strictEqual(res.status, 302); - assert.strictEqual(res.location, `/@${alice.username}`); - })); - - it('Undecided => HTML', async(async () => { - const res = await simpleGet(`/users/${alice.id}`, UNSPECIFIED); - assert.strictEqual(res.status, 302); - assert.strictEqual(res.location, `/@${alice.username}`); - })); - }); - - describe('/notes/:id', () => { - it('Only AP => AP', async(async () => { - const res = await simpleGet(`/notes/${alicesPost.id}`, ONLY_AP); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, AP); - })); - - it('Prefer AP => AP', async(async () => { - const res = await simpleGet(`/notes/${alicesPost.id}`, PREFER_AP); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, AP); - })); - - it('Prefer HTML => HTML', async(async () => { - const res = await simpleGet(`/notes/${alicesPost.id}`, PREFER_HTML); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, HTML); - })); - - it('Unspecified => HTML', async(async () => { - const res = await simpleGet(`/notes/${alicesPost.id}`, UNSPECIFIED); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, HTML); - })); - }); - - describe('Feeds', () => { - it('RSS', async(async () => { - const res = await simpleGet(`/@${alice.username}.rss`, UNSPECIFIED); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'application/rss+xml; charset=utf-8'); - })); - - it('ATOM', async(async () => { - const res = await simpleGet(`/@${alice.username}.atom`, UNSPECIFIED); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'application/atom+xml; charset=utf-8'); - })); - - it('JSON', async(async () => { - const res = await simpleGet(`/@${alice.username}.json`, UNSPECIFIED); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'application/json; charset=utf-8'); - })); - }); -}); diff --git a/packages/backend/test/ff-visibility.mjs b/packages/backend/test/ff-visibility.mjs deleted file mode 100644 index 96126b072..000000000 --- a/packages/backend/test/ff-visibility.mjs +++ /dev/null @@ -1,116 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, connectStream, startServer, shutdownServer, simpleGet } from './utils.mjs'; - -describe('FF visibility', function() { - this.timeout(20*60*1000); - - let p; - - let alice, bob, follower; - - before(async () => { - p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - follower = await signup({ username: 'follower' }); - - await request('/following/create', { userId: alice.id }, follower); - }); - - after(async () => { - await shutdownServer(p); - }); - - const visible = (user) => { - return async () => { - const followingRes = await request('/users/following', { - userId: alice.id, - }, user); - const followersRes = await request('/users/followers', { - userId: alice.id, - }, user); - - assert.strictEqual(followingRes.status, 200); - assert.ok(Array.isArray(followingRes.body)); - assert.strictEqual(followersRes.status, 200); - assert.ok(Array.isArray(followersRes.body)); - }; - }; - - const hidden = (user) => { - return async () => { - const followingRes = await request('/users/following', { - userId: alice.id, - }, user); - const followersRes = await request('/users/followers', { - userId: alice.id, - }, user); - - assert.strictEqual(followingRes.status, 403); - assert.strictEqual(followersRes.status, 403); - }; - }; - - describe('public visibility', () => { - before(async () => { - await request('/i/update', { - ffVisibility: 'public', - }, alice); - }); - - it('shows followers and following to self', visible(alice)); - it('shows followers and following to a follower', visible(follower)); - it('shows followers and following to a non-follower', visible(bob)); - it('shows followers and following when unauthenticated', visible(null)); - - it('provides followers in ActivityPub representation', async () => { - const followingRes = await simpleGet(`/users/${alice.id}/following`, 'application/activity+json'); - const followersRes = await simpleGet(`/users/${alice.id}/followers`, 'application/activity+json'); - assert.strictEqual(followingRes.status, 200); - assert.strictEqual(followersRes.status, 200); - }); - }); - - describe('followers visibility', () => { - before(async () => { - await request('/i/update', { - ffVisibility: 'followers', - }, alice); - }); - - it('shows followers and following to self', visible(alice)); - it('shows followers and following to a follower', visible(follower)); - it('hides followers and following from a non-follower', hidden(bob)); - it('hides followers and following when unauthenticated', hidden(null)); - - it('hides followers from ActivityPub representation', async () => { - const followingRes = await simpleGet(`/users/${alice.id}/following`, 'application/activity+json').catch(res => ({ status: res.statusCode })); - const followersRes = await simpleGet(`/users/${alice.id}/followers`, 'application/activity+json').catch(res => ({ status: res.statusCode })); - assert.strictEqual(followingRes.status, 403); - assert.strictEqual(followersRes.status, 403); - }); - }); - - describe('private visibility', () => { - before(async () => { - await request('/i/update', { - ffVisibility: 'private', - }, alice); - }); - - it('shows followers and following to self', visible(alice)); - it('hides followers and following from a follower', hidden(follower)); - it('hides followers and following from a non-follower', hidden(bob)); - it('hides followers and following when unauthenticated', hidden(null)); - - it('hides followers from ActivityPub representation', async () => { - const followingRes = await simpleGet(`/users/${alice.id}/following`, 'application/activity+json').catch(res => ({ status: res.statusCode })); - const followersRes = await simpleGet(`/users/${alice.id}/followers`, 'application/activity+json').catch(res => ({ status: res.statusCode })); - assert.strictEqual(followingRes.status, 403); - assert.strictEqual(followersRes.status, 403); - }); - }); -}); diff --git a/packages/backend/test/get-file-info.mjs b/packages/backend/test/get-file-info.mjs deleted file mode 100644 index 8aa6dd6f0..000000000 --- a/packages/backend/test/get-file-info.mjs +++ /dev/null @@ -1,173 +0,0 @@ -import * as assert from 'assert'; -import { fileURLToPath } from 'node:url'; -import { dirname } from 'node:path'; -import { getFileInfo } from '../built/misc/get-file-info.js'; -import { async } from './utils.mjs'; - -const _filename = fileURLToPath(import.meta.url); -const _dirname = dirname(_filename); - -describe('Get file info', () => { - it('Empty file', async (async () => { - const path = `${_dirname}/resources/emptyfile`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 0, - md5: 'd41d8cd98f00b204e9800998ecf8427e', - type: { - mime: 'application/octet-stream', - ext: null, - }, - width: undefined, - height: undefined, - orientation: undefined, - }); - })); - - it('Generic JPEG', async (async () => { - const path = `${_dirname}/resources/Lenna.jpg`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 25360, - md5: '091b3f259662aa31e2ffef4519951168', - type: { - mime: 'image/jpeg', - ext: 'jpg', - }, - width: 512, - height: 512, - orientation: undefined, - }); - })); - - it('Generic APNG', async (async () => { - const path = `${_dirname}/resources/anime.png`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 1868, - md5: '08189c607bea3b952704676bb3c979e0', - type: { - mime: 'image/apng', - ext: 'apng', - }, - width: 256, - height: 256, - orientation: undefined, - }); - })); - - it('Generic AGIF', async (async () => { - const path = `${_dirname}/resources/anime.gif`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 2248, - md5: '32c47a11555675d9267aee1a86571e7e', - type: { - mime: 'image/gif', - ext: 'gif', - }, - width: 256, - height: 256, - orientation: undefined, - }); - })); - - it('PNG with alpha', async (async () => { - const path = `${_dirname}/resources/with-alpha.png`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 3772, - md5: 'f73535c3e1e27508885b69b10cf6e991', - type: { - mime: 'image/png', - ext: 'png', - }, - width: 256, - height: 256, - orientation: undefined, - }); - })); - - it('Generic SVG', async (async () => { - const path = `${_dirname}/resources/image.svg`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 505, - md5: 'b6f52b4b021e7b92cdd04509c7267965', - type: { - mime: 'image/svg+xml', - ext: 'svg', - }, - width: 256, - height: 256, - orientation: undefined, - }); - })); - - it('SVG with XML definition', async (async () => { - // https://github.com/misskey-dev/misskey/issues/4413 - const path = `${_dirname}/resources/with-xml-def.svg`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 544, - md5: '4b7a346cde9ccbeb267e812567e33397', - type: { - mime: 'image/svg+xml', - ext: 'svg', - }, - width: 256, - height: 256, - orientation: undefined, - }); - })); - - it('Dimension limit', async (async () => { - const path = `${_dirname}/resources/25000x25000.png`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 75933, - md5: '268c5dde99e17cf8fe09f1ab3f97df56', - type: { - mime: 'application/octet-stream', // do not treat as image - ext: null, - }, - width: 25000, - height: 25000, - orientation: undefined, - }); - })); - - it('Rotate JPEG', async (async () => { - const path = `${_dirname}/resources/rotate.jpg`; - const info = await getFileInfo(path); - delete info.warnings; - delete info.blurhash; - assert.deepStrictEqual(info, { - size: 12624, - md5: '68d5b2d8d1d1acbbce99203e3ec3857e', - type: { - mime: 'image/jpeg', - ext: 'jpg', - }, - width: 512, - height: 256, - orientation: 8, - }); - })); -}); diff --git a/packages/backend/test/mfm.mjs b/packages/backend/test/mfm.mjs deleted file mode 100644 index 8ccf30911..000000000 --- a/packages/backend/test/mfm.mjs +++ /dev/null @@ -1,88 +0,0 @@ -import * as assert from 'assert'; - -import { toHtml } from '../built/mfm/to-html.js'; -import { fromHtml } from '../built/mfm/from-html.js'; - -describe('toHtml', () => { - it('br', async () => { - const input = 'foo\nbar\nbaz'; - const output = '

foo
bar
baz

'; - assert.equal(await toHtml(input), output); - }); - - it('br alt', async () => { - const input = 'foo\r\nbar\rbaz'; - const output = '

foo
bar
baz

'; - assert.equal(await toHtml(input), output); - }); -}); - -describe('fromHtml', () => { - it('p', () => { - assert.deepStrictEqual(fromHtml('

a

b

'), 'a\n\nb'); - }); - - it('block element', () => { - assert.deepStrictEqual(fromHtml('
a
b
'), 'a\nb'); - }); - - it('inline element', () => { - assert.deepStrictEqual(fromHtml(''), 'a\nb'); - }); - - it('block code', () => { - assert.deepStrictEqual(fromHtml('
a\nb
'), '```\na\nb\n```'); - }); - - it('inline code', () => { - assert.deepStrictEqual(fromHtml('a'), '`a`'); - }); - - it('quote', () => { - assert.deepStrictEqual(fromHtml('
a\nb
'), '> a\n> b'); - }); - - it('br', () => { - assert.deepStrictEqual(fromHtml('

abc

d

'), 'abc\n\nd'); - }); - - it('link with different text', () => { - assert.deepStrictEqual(fromHtml('

a c d

'), 'a [c](https://example.com/b) d'); - }); - - it('link with different text, but not encoded', () => { - assert.deepStrictEqual(fromHtml('

a c d

'), 'a [c]() d'); - }); - - it('link with same text', () => { - assert.deepStrictEqual(fromHtml('

a https://example.com/b d

'), 'a https://example.com/b d'); - }); - - it('link with same text, but not encoded', () => { - assert.deepStrictEqual(fromHtml('

a https://example.com/ä d

'), 'a d'); - }); - - it('link with no url', () => { - assert.deepStrictEqual(fromHtml('

a c d

'), 'a [c](b) d'); - }); - - it('link without href', () => { - assert.deepStrictEqual(fromHtml('

a c d

'), 'a c d'); - }); - - it('link without text', () => { - assert.deepStrictEqual(fromHtml('

a d

'), 'a https://example.com/b d'); - }); - - it('link without both', () => { - assert.deepStrictEqual(fromHtml('

a d

'), 'a d'); - }); - - it('mention', () => { - assert.deepStrictEqual(fromHtml('

a @user d

'), 'a @user@example.com d'); - }); - - it('hashtag', () => { - assert.deepStrictEqual(fromHtml('

a #a d

', ['#a']), 'a #a d'); - }); -}); diff --git a/packages/backend/test/misc/mock-resolver.mjs b/packages/backend/test/misc/mock-resolver.mjs deleted file mode 100644 index d74bc36a7..000000000 --- a/packages/backend/test/misc/mock-resolver.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import { Resolver } from '../../built/remote/activitypub/resolver.js'; - -export class MockResolver extends Resolver { - _rs = new Map(); - - async _register(uri, content, type = 'application/activity+json') { - this._rs.set(uri, { - type, - content: typeof content === 'string' ? content : JSON.stringify(content), - }); - } - - async resolve(value) { - if (typeof value !== 'string') return value; - - const r = this._rs.get(value); - - if (!r) { - throw { - name: 'StatusError', - statusCode: 404, - message: 'Not registed for mock', - }; - } - - const object = JSON.parse(r.content); - - return object; - } -} diff --git a/packages/backend/test/mute.mjs b/packages/backend/test/mute.mjs deleted file mode 100644 index 539f7dc3a..000000000 --- a/packages/backend/test/mute.mjs +++ /dev/null @@ -1,123 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, startServer, shutdownServer, waitFire } from './utils.mjs'; - -describe('Mute', function() { - this.timeout(20*60*1000); - - let p; - - // alice mutes carol - let alice, bob, carol; - - before(async () => { - p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); - }); - - after(async () => { - await shutdownServer(p); - }); - - it('ミュート作成', async(async () => { - const res = await request('/mute/create', { - userId: carol.id, - }, alice); - - assert.strictEqual(res.status, 204); - })); - - it('「自分宛ての投稿」にミュートしているユーザーの投稿が含まれない', async(async () => { - const bobNote = await post(bob, { text: '@alice hi' }); - const carolNote = await post(carol, { text: '@alice hi' }); - - const res = await request('/notes/mentions', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note) => note.id === bobNote.id), true); - assert.strictEqual(res.body.some((note) => note.id === carolNote.id), false); - })); - - it('ミュートしているユーザーからメンションされても、hasUnreadMentions が true にならない', async(async () => { - // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); - - await post(carol, { text: '@alice hi' }); - - const res = await request('/i', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.hasUnreadMentions, false); - })); - - it('ミュートしているユーザーからメンションされても、ストリームに unreadMention イベントが流れてこない', async () => { - // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); - - const fired = await waitFire(alice, 'main', () => post(carol, { text: '@alice hi' }), msg => msg.type === 'unreadMention'); - - assert.strictEqual(fired, false); - }); - - it('ミュートしているユーザーからメンションされても、ストリームに unreadNotification イベントが流れてこない', async () => { - // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); - await request('/notifications/mark-all-as-read', {}, alice); - - const fired = await waitFire(alice, 'main', () => post(carol, { text: '@alice hi' }), msg => msg.type === 'unreadNotification'); - - assert.strictEqual(fired, false); - }); - - describe('Timeline', () => { - it('タイムラインにミュートしているユーザーの投稿が含まれない', async(async () => { - const aliceNote = await post(alice); - const bobNote = await post(bob); - const carolNote = await post(carol); - - const res = await request('/notes/local-timeline', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note) => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some((note) => note.id === bobNote.id), true); - assert.strictEqual(res.body.some((note) => note.id === carolNote.id), false); - })); - - it('タイムラインにミュートしているユーザーの投稿のRenoteが含まれない', async(async () => { - const aliceNote = await post(alice); - const carolNote = await post(carol); - const bobNote = await post(bob, { - renoteId: carolNote.id, - }); - - const res = await request('/notes/local-timeline', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note) => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some((note) => note.id === bobNote.id), false); - assert.strictEqual(res.body.some((note) => note.id === carolNote.id), false); - })); - }); - - describe('Notification', () => { - it('通知にミュートしているユーザーの通知が含まれない(リアクション)', async(async () => { - const aliceNote = await post(alice); - await react(bob, aliceNote, 'like'); - await react(carol, aliceNote, 'like'); - - const res = await request('/i/notifications', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((notification) => notification.userId === bob.id), true); - assert.strictEqual(res.body.some((notification) => notification.userId === carol.id), false); - })); - }); -}); diff --git a/packages/backend/test/note.mjs b/packages/backend/test/note.mjs deleted file mode 100644 index f9a66c465..000000000 --- a/packages/backend/test/note.mjs +++ /dev/null @@ -1,371 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { Note } from '../built/models/entities/note.js'; -import { async, signup, request, post, uploadUrl, startServer, shutdownServer, initTestDb, api } from './utils.mjs'; - -describe('Note', function() { - this.timeout(20*60*1000); - - let p; - let Notes; - - let alice, bob; - - before(async () => { - p = await startServer(); - const connection = await initTestDb(true); - Notes = connection.getRepository(Note); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - }); - - after(async () => { - await shutdownServer(p); - }); - - it('投稿できる', async(async () => { - const post = { - text: 'test', - }; - - const res = await request('/notes/create', post, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.createdNote.text, post.text); - })); - - it('ファイルを添付できる', async(async () => { - const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); - - const res = await request('/notes/create', { - fileIds: [file.id], - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.deepStrictEqual(res.body.createdNote.fileIds, [file.id]); - })); - - it('他人のファイルは無視', async(async () => { - const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); - - const res = await request('/notes/create', { - text: 'test', - fileIds: [file.id], - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.deepStrictEqual(res.body.createdNote.fileIds, []); - })); - - it('存在しないファイルは無視', async(async () => { - const res = await request('/notes/create', { - text: 'test', - fileIds: ['000000000000000000000000'], - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.deepStrictEqual(res.body.createdNote.fileIds, []); - })); - - it('不正なファイルIDは無視', async(async () => { - const res = await request('/notes/create', { - fileIds: ['kyoppie'], - }, alice); - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.deepStrictEqual(res.body.createdNote.fileIds, []); - })); - - it('返信できる', async(async () => { - const bobPost = await post(bob, { - text: 'foo', - }); - - const alicePost = { - text: 'bar', - replyId: bobPost.id, - }; - - const res = await request('/notes/create', alicePost, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.createdNote.text, alicePost.text); - assert.strictEqual(res.body.createdNote.replyId, alicePost.replyId); - assert.strictEqual(res.body.createdNote.reply.text, bobPost.text); - })); - - it('renoteできる', async(async () => { - const bobPost = await post(bob, { - text: 'test', - }); - - const alicePost = { - renoteId: bobPost.id, - }; - - const res = await request('/notes/create', alicePost, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.createdNote.renoteId, alicePost.renoteId); - assert.strictEqual(res.body.createdNote.renote.text, bobPost.text); - })); - - it('引用renoteできる', async(async () => { - const bobPost = await post(bob, { - text: 'test', - }); - - const alicePost = { - text: 'test', - renoteId: bobPost.id, - }; - - const res = await request('/notes/create', alicePost, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.createdNote.text, alicePost.text); - assert.strictEqual(res.body.createdNote.renoteId, alicePost.renoteId); - assert.strictEqual(res.body.createdNote.renote.text, bobPost.text); - })); - - it('文字数ぎりぎりで怒られない', async(async () => { - const post = { - text: '!'.repeat(3000), - }; - const res = await request('/notes/create', post, alice); - assert.strictEqual(res.status, 200); - })); - - it('文字数オーバーで怒られる', async(async () => { - const post = { - text: '!'.repeat(3001), - }; - const res = await request('/notes/create', post, alice); - assert.strictEqual(res.status, 400); - })); - - it('存在しないリプライ先で怒られる', async(async () => { - const post = { - text: 'test', - replyId: '000000000000000000000000', - }; - const res = await request('/notes/create', post, alice); - assert.strictEqual(res.status, 404); - })); - - it('存在しないrenote対象で怒られる', async(async () => { - const post = { - renoteId: '000000000000000000000000', - }; - const res = await request('/notes/create', post, alice); - assert.strictEqual(res.status, 404); - })); - - it('不正なリプライ先IDで怒られる', async(async () => { - const post = { - text: 'test', - replyId: 'foo', - }; - const res = await request('/notes/create', post, alice); - assert.strictEqual(res.status, 404); - })); - - it('不正なrenote対象IDで怒られる', async(async () => { - const post = { - renoteId: 'foo', - }; - const res = await request('/notes/create', post, alice); - assert.strictEqual(res.status, 404); - })); - - it('存在しないユーザーにメンションできる', async(async () => { - const post = { - text: '@ghost yo', - }; - - const res = await request('/notes/create', post, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.createdNote.text, post.text); - })); - - it('同じユーザーに複数メンションしても内部的にまとめられる', async(async () => { - const post = { - text: '@bob @bob @bob yo', - }; - - const res = await request('/notes/create', post, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.createdNote.text, post.text); - - const noteDoc = await Notes.findOneBy({ id: res.body.createdNote.id }); - assert.deepStrictEqual(noteDoc.mentions, [bob.id]); - })); - - describe('notes/create', () => { - it('投票を添付できる', async(async () => { - const res = await request('/notes/create', { - text: 'test', - poll: { - choices: ['foo', 'bar'], - }, - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body.createdNote.poll != null, true); - })); - - it('投票の選択肢が無くて怒られる', async(async () => { - const res = await request('/notes/create', { - poll: {}, - }, alice); - assert.strictEqual(res.status, 400); - })); - - it('投票の選択肢が無くて怒られる (空の配列)', async(async () => { - const res = await request('/notes/create', { - poll: { - choices: [], - }, - }, alice); - assert.strictEqual(res.status, 400); - })); - - it('投票の選択肢が1つで怒られる', async(async () => { - const res = await request('/notes/create', { - poll: { - choices: ['Strawberry Pasta'], - }, - }, alice); - assert.strictEqual(res.status, 400); - })); - - it('投票できる', async(async () => { - const { body } = await request('/notes/create', { - text: 'test', - poll: { - choices: ['sakura', 'izumi', 'ako'], - }, - }, alice); - - const res = await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 1, - }, alice); - - assert.strictEqual(res.status, 204); - })); - - it('複数投票できない', async(async () => { - const { body } = await request('/notes/create', { - text: 'test', - poll: { - choices: ['sakura', 'izumi', 'ako'], - }, - }, alice); - - await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 0, - }, alice); - - const res = await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 2, - }, alice); - - assert.strictEqual(res.status, 409); - })); - - it('許可されている場合は複数投票できる', async(async () => { - const { body } = await request('/notes/create', { - text: 'test', - poll: { - choices: ['sakura', 'izumi', 'ako'], - multiple: true, - }, - }, alice); - - await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 0, - }, alice); - - await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 1, - }, alice); - - const res = await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 2, - }, alice); - - assert.strictEqual(res.status, 204); - })); - - it('締め切られている場合は投票できない', async(async () => { - const { body } = await request('/notes/create', { - text: 'test', - poll: { - choices: ['sakura', 'izumi', 'ako'], - expiredAfter: 1, - }, - }, alice); - - await new Promise(x => setTimeout(x, 2)); - - const res = await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 1, - }, alice); - - assert.strictEqual(res.status, 400); - })); - }); - - describe('notes/delete', () => { - it('delete a reply', async(async () => { - const mainNoteRes = await api('notes/create', { - text: 'main post', - }, alice); - const replyOneRes = await api('notes/create', { - text: 'reply one', - replyId: mainNoteRes.body.createdNote.id, - }, alice); - const replyTwoRes = await api('notes/create', { - text: 'reply two', - replyId: mainNoteRes.body.createdNote.id, - }, alice); - - const deleteOneRes = await api('notes/delete', { - noteId: replyOneRes.body.createdNote.id, - }, alice); - - assert.strictEqual(deleteOneRes.status, 204); - let mainNote = await Notes.findOneBy({ id: mainNoteRes.body.createdNote.id }); - assert.strictEqual(mainNote.repliesCount, 1); - - const deleteTwoRes = await api('notes/delete', { - noteId: replyTwoRes.body.createdNote.id, - }, alice); - - assert.strictEqual(deleteTwoRes.status, 204); - mainNote = await Notes.findOneBy({ id: mainNoteRes.body.createdNote.id }); - assert.strictEqual(mainNote.repliesCount, 0); - })); - }); -}); diff --git a/packages/backend/test/prelude/url.mjs b/packages/backend/test/prelude/url.mjs deleted file mode 100644 index 66879ce30..000000000 --- a/packages/backend/test/prelude/url.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import * as assert from 'assert'; -import { query } from '../../built/prelude/url.js'; - -describe('url', () => { - it('query', () => { - const s = query({ - foo: 'ふぅ', - bar: 'b a r', - baz: undefined, - }); - assert.deepStrictEqual(s, 'foo=%E3%81%B5%E3%81%85&bar=b%20a%20r'); - }); -}); diff --git a/packages/backend/test/resources/25000x25000.png b/packages/backend/test/resources/25000x25000.png deleted file mode 100644 index 0ed466692..000000000 Binary files a/packages/backend/test/resources/25000x25000.png and /dev/null differ diff --git a/packages/backend/test/resources/Lenna.jpg b/packages/backend/test/resources/Lenna.jpg deleted file mode 100644 index 6b5b32281..000000000 Binary files a/packages/backend/test/resources/Lenna.jpg and /dev/null differ diff --git a/packages/backend/test/resources/Lenna.png b/packages/backend/test/resources/Lenna.png deleted file mode 100644 index 59ef68aab..000000000 Binary files a/packages/backend/test/resources/Lenna.png and /dev/null differ diff --git a/packages/backend/test/resources/anime.gif b/packages/backend/test/resources/anime.gif deleted file mode 100644 index 256ba495c..000000000 Binary files a/packages/backend/test/resources/anime.gif and /dev/null differ diff --git a/packages/backend/test/resources/anime.png b/packages/backend/test/resources/anime.png deleted file mode 100644 index f13600f7a..000000000 Binary files a/packages/backend/test/resources/anime.png and /dev/null differ diff --git a/packages/backend/test/resources/emptyfile b/packages/backend/test/resources/emptyfile deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/backend/test/resources/image.svg b/packages/backend/test/resources/image.svg deleted file mode 100644 index 1e2bf5b5b..000000000 Binary files a/packages/backend/test/resources/image.svg and /dev/null differ diff --git a/packages/backend/test/resources/rotate.jpg b/packages/backend/test/resources/rotate.jpg deleted file mode 100644 index 477c2baf5..000000000 Binary files a/packages/backend/test/resources/rotate.jpg and /dev/null differ diff --git a/packages/backend/test/resources/with-alpha.png b/packages/backend/test/resources/with-alpha.png deleted file mode 100644 index adc8d0180..000000000 Binary files a/packages/backend/test/resources/with-alpha.png and /dev/null differ diff --git a/packages/backend/test/resources/with-xml-def.svg b/packages/backend/test/resources/with-xml-def.svg deleted file mode 100644 index 90971215a..000000000 Binary files a/packages/backend/test/resources/with-xml-def.svg and /dev/null differ diff --git a/packages/backend/test/services/blocking.mjs b/packages/backend/test/services/blocking.mjs deleted file mode 100644 index f0e39772b..000000000 --- a/packages/backend/test/services/blocking.mjs +++ /dev/null @@ -1,58 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import * as sinon from 'sinon'; -import { async, signup, startServer, shutdownServer, initTestDb } from '../utils.mjs'; - -describe('Creating a block activity', function() { - this.timeout(20*60*1000); - - let p; - - // alice blocks bob - let alice, bob, carol; - - before(async () => { - await initTestDb(); - p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); - bob.host = 'http://remote'; - carol.host = 'http://remote'; - }); - - beforeEach(() => { - sinon.restore(); - }); - - after(async () => { - await shutdownServer(p); - }); - - it('Should federate blocks normally', async(async () => { - const createBlock = (await import('../../built/services/blocking/create')).default; - const deleteBlock = (await import('../../built/services/blocking/delete')).default; - - const queues = await import('../../built/queue/index'); - const spy = sinon.spy(queues, 'deliver'); - await createBlock(alice, bob); - assert(spy.calledOnce); - await deleteBlock(alice, bob); - assert(spy.calledTwice); - })); - - it('Should not federate blocks if federateBlocks is false', async () => { - const createBlock = (await import('../../built/services/blocking/create')).default; - const deleteBlock = (await import('../../built/services/blocking/delete')).default; - - alice.federateBlocks = true; - - const queues = await import('../../built/queue/index'); - const spy = sinon.spy(queues, 'deliver'); - await createBlock(alice, carol); - await deleteBlock(alice, carol); - assert(spy.notCalled); - }); -}); diff --git a/packages/backend/test/streaming.mjs b/packages/backend/test/streaming.mjs deleted file mode 100644 index 830dd91d7..000000000 --- a/packages/backend/test/streaming.mjs +++ /dev/null @@ -1,543 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { Following } from '../built/models/entities/following.js'; -import { connectStream, signup, api, post, startServer, shutdownServer, initTestDb, waitFire } from './utils.mjs'; - -describe('Streaming', () => { - let p; - let Followings; - - const follow = async (follower, followee) => { - await Followings.save({ - id: 'a', - createdAt: new Date(), - followerId: follower.id, - followeeId: followee.id, - followerHost: follower.host, - followerInbox: null, - followerSharedInbox: null, - followeeHost: followee.host, - followeeInbox: null, - followeeSharedInbox: null, - }); - }; - - describe('Streaming', function() { - this.timeout(20*60*1000); - - // Local users - let ayano, kyoko, chitose; - - // Remote users - let akari, chinatsu; - - let kyokoNote, list; - - before(async () => { - p = await startServer(); - const connection = await initTestDb(true); - Followings = connection.getRepository(Following); - - ayano = await signup({ username: 'ayano' }); - kyoko = await signup({ username: 'kyoko' }); - chitose = await signup({ username: 'chitose' }); - - akari = await signup({ username: 'akari', host: 'example.com' }); - chinatsu = await signup({ username: 'chinatsu', host: 'example.com' }); - - kyokoNote = await post(kyoko, { text: 'foo' }); - - // Follow: ayano => kyoko - await api('following/create', { userId: kyoko.id }, ayano); - - // Follow: ayano => akari - await follow(ayano, akari); - - // List: chitose => ayano, kyoko - list = await api('users/lists/create', { - name: 'my list', - }, chitose).then(x => x.body); - - await api('users/lists/push', { - listId: list.id, - userId: ayano.id, - }, chitose); - - await api('users/lists/push', { - listId: list.id, - userId: kyoko.id, - }, chitose); - }); - - after(async () => { - await shutdownServer(p); - }); - - describe('Events', () => { - it('mention event', async () => { - const fired = await waitFire( - kyoko, 'main', // kyoko:main - () => post(ayano, { text: 'foo @kyoko bar' }), // ayano mention => kyoko - msg => msg.type === 'mention' && msg.body.userId === ayano.id // wait ayano - ); - - assert.strictEqual(fired, true); - }); - - it('renote event', async () => { - const fired = await waitFire( - kyoko, 'main', // kyoko:main - () => post(ayano, { renoteId: kyokoNote.id }), // ayano renote - msg => msg.type === 'renote' && msg.body.renoteId === kyokoNote.id // wait renote - ); - - assert.strictEqual(fired, true); - }); - }); - - describe('Home Timeline', () => { - it('自分の投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:Home - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.text === 'foo' - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしているユーザーの投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'foo' }, kyoko), // kyoko posts - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしていないユーザーの投稿は流れない', async () => { - const fired = await waitFire( - kyoko, 'homeTimeline', // kyoko:home - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.userId === ayano.id // wait ayano - ); - - assert.strictEqual(fired, false); - }); - - it('フォローしているユーザーのダイレクト投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id], }, kyoko), // kyoko dm => ayano - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしているユーザーでも自分が指定されていないダイレクト投稿は流れない', async () => { - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [chitose.id], }, kyoko), // kyoko dm => chitose - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, false); - }); - }); // Home - - describe('Local Timeline', () => { - it('自分の投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.text === 'foo' - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしていないローカルユーザーの投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, chitose), // chitose posts - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose - ); - - assert.strictEqual(fired, true); - }); - - it('リモートユーザーの投稿は流れない', async () => { - const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts - msg => msg.type === 'note' && msg.body.userId === chinatsu.id // wait chinatsu - ); - - assert.strictEqual(fired, false); - }); - - it('フォローしてたとしてもリモートユーザーの投稿は流れない', async () => { - const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, akari), // akari posts - msg => msg.type === 'note' && msg.body.userId === akari.id // wait akari - ); - - assert.strictEqual(fired, false); - }); - - it('ホーム指定の投稿は流れない', async () => { - const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), // kyoko home posts - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, false); - }); - - it('フォローしているローカルユーザーのダイレクト投稿は流れない', async () => { - const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id] }, kyoko), // kyoko DM => ayano - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, false); - }); - - it('フォローしていないローカルユーザーのフォロワー宛て投稿は流れない', async () => { - const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'followers' }, chitose), - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose - ); - - assert.strictEqual(fired, false); - }); - }); - - describe('Hybrid Timeline', () => { - it('自分の投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.text === 'foo' - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしていないローカルユーザーの投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo' }, chitose), // chitose posts - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしているリモートユーザーの投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo' }, akari), // akari posts - msg => msg.type === 'note' && msg.body.userId === akari.id // wait akari - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしていないリモートユーザーの投稿は流れない', async () => { - const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts - msg => msg.type === 'note' && msg.body.userId === chinatsu.id // wait chinatsu - ); - - assert.strictEqual(fired, false); - }); - - it('フォローしているユーザーのダイレクト投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id] }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしているユーザーのホーム投稿が流れる', async () => { - const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしていないローカルユーザーのホーム投稿は流れない', async () => { - const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo', visibility: 'home' }, chitose), - msg => msg.type === 'note' && msg.body.userId === chitose.id - ); - - assert.strictEqual(fired, false); - }); - - it('フォローしていないローカルユーザーのフォロワー宛て投稿は流れない', () => async () => { - const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo', visibility: 'followers' }, chitose), - msg => msg.type === 'note' && msg.body.userId === chitose.id - ); - - assert.strictEqual(fired, false); - }); - }); - - describe('Global Timeline', () => { - it('フォローしていないローカルユーザーの投稿が流れる', () => async () => { - const fired = await waitFire( - ayano, 'globalTimeline', // ayano:Global - () => api('notes/create', { text: 'foo' }, chitose), // chitose posts - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose - ); - - assert.strictEqual(fired, true); - }); - - it('フォローしていないリモートユーザーの投稿が流れる', () => async () => { - const fired = await waitFire( - ayano, 'globalTimeline', // ayano:Global - () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts - msg => msg.type === 'note' && msg.body.userId === chinatsu.id // wait chinatsu - ); - - assert.strictEqual(fired, true); - }); - - it('ホーム投稿は流れない', () => async () => { - const fired = await waitFire( - ayano, 'globalTimeline', // ayano:Global - () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), // kyoko posts - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, false); - }); - }); - - describe('UserList Timeline', () => { - it('リストに入れているユーザーの投稿が流れる', () => async () => { - const fired = await waitFire( - chitose, 'userList', - () => api('notes/create', { text: 'foo' }, ayano), - msg => msg.type === 'note' && msg.body.userId === ayano.id, - { listId: list.id, } - ); - - assert.strictEqual(fired, true); - }); - - it('リストに入れていないユーザーの投稿は流れない', () => async () => { - const fired = await waitFire( - chitose, 'userList', - () => api('notes/create', { text: 'foo' }, chinatsu), - msg => msg.type === 'note' && msg.body.userId === chinatsu.id, - { listId: list.id, } - ); - - assert.strictEqual(fired, false); - }); - - // #4471 - it('リストに入れているユーザーのダイレクト投稿が流れる', () => async () => { - const fired = await waitFire( - chitose, 'userList', - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [chitose.id] }, ayano), - msg => msg.type === 'note' && msg.body.userId === ayano.id, - { listId: list.id, } - ); - - assert.strictEqual(fired, true); - }); - - // #4335 - it('リストに入れているがフォローはしてないユーザーのフォロワー宛て投稿は流れない', () => async () => { - const fired = await waitFire( - chitose, 'userList', - () => api('notes/create', { text: 'foo', visibility: 'followers' }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id, - { listId: list.id, } - ); - - assert.strictEqual(fired, false); - }); - }); - - describe('Hashtag Timeline', () => { - it('指定したハッシュタグの投稿が流れる', () => new Promise(async done => { - const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { - if (type == 'note') { - assert.deepStrictEqual(body.text, '#foo'); - ws.close(); - done(); - } - }, { - q: [ - ['foo'], - ], - }); - - post(chitose, { - text: '#foo', - }); - })); - - it('指定したハッシュタグの投稿が流れる (AND)', () => new Promise(async done => { - let fooCount = 0; - let barCount = 0; - let fooBarCount = 0; - - const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { - if (type == 'note') { - if (body.text === '#foo') fooCount++; - if (body.text === '#bar') barCount++; - if (body.text === '#foo #bar') fooBarCount++; - } - }, { - q: [ - ['foo', 'bar'], - ], - }); - - post(chitose, { - text: '#foo', - }); - - post(chitose, { - text: '#bar', - }); - - post(chitose, { - text: '#foo #bar', - }); - - setTimeout(() => { - assert.strictEqual(fooCount, 0); - assert.strictEqual(barCount, 0); - assert.strictEqual(fooBarCount, 1); - ws.close(); - done(); - }, 3000); - })); - - it('指定したハッシュタグの投稿が流れる (OR)', () => new Promise(async done => { - let fooCount = 0; - let barCount = 0; - let fooBarCount = 0; - let piyoCount = 0; - - const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { - if (type == 'note') { - if (body.text === '#foo') fooCount++; - if (body.text === '#bar') barCount++; - if (body.text === '#foo #bar') fooBarCount++; - if (body.text === '#piyo') piyoCount++; - } - }, { - q: [ - ['foo'], - ['bar'], - ], - }); - - post(chitose, { - text: '#foo', - }); - - post(chitose, { - text: '#bar', - }); - - post(chitose, { - text: '#foo #bar', - }); - - post(chitose, { - text: '#piyo', - }); - - setTimeout(() => { - assert.strictEqual(fooCount, 1); - assert.strictEqual(barCount, 1); - assert.strictEqual(fooBarCount, 1); - assert.strictEqual(piyoCount, 0); - ws.close(); - done(); - }, 3000); - })); - - it('指定したハッシュタグの投稿が流れる (AND + OR)', () => new Promise(async done => { - let fooCount = 0; - let barCount = 0; - let fooBarCount = 0; - let piyoCount = 0; - let waaaCount = 0; - - const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { - if (type == 'note') { - if (body.text === '#foo') fooCount++; - if (body.text === '#bar') barCount++; - if (body.text === '#foo #bar') fooBarCount++; - if (body.text === '#piyo') piyoCount++; - if (body.text === '#waaa') waaaCount++; - } - }, { - q: [ - ['foo', 'bar'], - ['piyo'], - ], - }); - - post(chitose, { - text: '#foo', - }); - - post(chitose, { - text: '#bar', - }); - - post(chitose, { - text: '#foo #bar', - }); - - post(chitose, { - text: '#piyo', - }); - - post(chitose, { - text: '#waaa', - }); - - setTimeout(() => { - assert.strictEqual(fooCount, 0); - assert.strictEqual(barCount, 0); - assert.strictEqual(fooBarCount, 1); - assert.strictEqual(piyoCount, 1); - assert.strictEqual(waaaCount, 0); - ws.close(); - done(); - }, 3000); - })); - }); - }); -}); diff --git a/packages/backend/test/thread-mute.mjs b/packages/backend/test/thread-mute.mjs deleted file mode 100644 index aa2b4679d..000000000 --- a/packages/backend/test/thread-mute.mjs +++ /dev/null @@ -1,103 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, connectStream, startServer, shutdownServer } from './utils.mjs'; - -describe('Note thread mute', function() { - this.timeout(20*60*1000); - - let p; - - let alice, bob, carol; - - before(async () => { - p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); - }); - - after(async () => { - await shutdownServer(p); - }); - - it('notes/mentions にミュートしているスレッドの投稿が含まれない', async(async () => { - const bobNote = await post(bob, { text: '@alice @carol root note' }); - const aliceReply = await post(alice, { replyId: bobNote.id, text: '@bob @carol child note' }); - - await request('/notes/thread-muting/create', { noteId: bobNote.id }, alice); - - const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); - const carolReplyWithoutMention = await post(carol, { replyId: aliceReply.id, text: 'child note' }); - - const res = await request('/notes/mentions', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note) => note.id === bobNote.id), false); - assert.strictEqual(res.body.some((note) => note.id === carolReply.id), false); - assert.strictEqual(res.body.some((note) => note.id === carolReplyWithoutMention.id), false); - })); - - it('ミュートしているスレッドからメンションされても、hasUnreadMentions が true にならない', async(async () => { - // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); - - const bobNote = await post(bob, { text: '@alice @carol root note' }); - - await request('/notes/thread-muting/create', { noteId: bobNote.id }, alice); - - const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); - - const res = await request('/i', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.hasUnreadMentions, false); - })); - - it('ミュートしているスレッドからメンションされても、ストリームに unreadMention イベントが流れてこない', () => new Promise(async done => { - // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); - - const bobNote = await post(bob, { text: '@alice @carol root note' }); - - await request('/notes/thread-muting/create', { noteId: bobNote.id }, alice); - - let fired = false; - - const ws = await connectStream(alice, 'main', async ({ type, body }) => { - if (type === 'unreadMention') { - if (body === bobNote.id) return; - fired = true; - } - }); - - const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); - - setTimeout(() => { - assert.strictEqual(fired, false); - ws.close(); - done(); - }, 5000); - })); - - it('i/notifications にミュートしているスレッドの通知が含まれない', async(async () => { - const bobNote = await post(bob, { text: '@alice @carol root note' }); - const aliceReply = await post(alice, { replyId: bobNote.id, text: '@bob @carol child note' }); - - await request('/notes/thread-muting/create', { noteId: bobNote.id }, alice); - - const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); - const carolReplyWithoutMention = await post(carol, { replyId: aliceReply.id, text: 'child note' }); - - const res = await request('/i/notifications', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((notification) => notification.note.id === carolReply.id), false); - assert.strictEqual(res.body.some((notification) => notification.note.id === carolReplyWithoutMention.id), false); - - // NOTE: bobの投稿はスレッドミュート前に行われたため通知に含まれていてもよい - })); -}); diff --git a/packages/backend/test/user-notes.mjs b/packages/backend/test/user-notes.mjs deleted file mode 100644 index 4a0e87c27..000000000 --- a/packages/backend/test/user-notes.mjs +++ /dev/null @@ -1,60 +0,0 @@ -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, uploadUrl, startServer, shutdownServer } from './utils.mjs'; - -describe('users/notes', function() { - this.timeout(20*60*1000); - - let p; - - let alice, jpgNote, pngNote, jpgPngNote; - - before(async () => { - p = await startServer(); - alice = await signup({ username: 'alice' }); - const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); - const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.png'); - jpgNote = await post(alice, { - fileIds: [jpg.id], - }); - pngNote = await post(alice, { - fileIds: [png.id], - }); - jpgPngNote = await post(alice, { - fileIds: [jpg.id, png.id], - }); - }); - - after(async() => { - await shutdownServer(p); - }); - - it('ファイルタイプ指定 (jpg)', async(async () => { - const res = await request('/users/notes', { - userId: alice.id, - fileType: ['image/jpeg'], - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.length, 2); - assert.strictEqual(res.body.some((note) => note.id === jpgNote.id), true); - assert.strictEqual(res.body.some((note) => note.id === jpgPngNote.id), true); - })); - - it('ファイルタイプ指定 (jpg or png)', async(async () => { - const res = await request('/users/notes', { - userId: alice.id, - fileType: ['image/jpeg', 'image/png'], - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.length, 3); - assert.strictEqual(res.body.some((note) => note.id === jpgNote.id), true); - assert.strictEqual(res.body.some((note) => note.id === pngNote.id), true); - assert.strictEqual(res.body.some((note) => note.id === jpgPngNote.id), true); - })); -}); diff --git a/packages/backend/test/utils.mjs b/packages/backend/test/utils.mjs deleted file mode 100644 index e0af3ac46..000000000 --- a/packages/backend/test/utils.mjs +++ /dev/null @@ -1,322 +0,0 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { dirname } from 'node:path'; -import * as childProcess from 'child_process'; -import * as http from 'node:http'; -import { SIGKILL } from 'constants'; -import WebSocket from 'ws'; -import * as foundkey from 'foundkey-js'; -import fetch from 'node-fetch'; -import FormData from 'form-data'; -import { DataSource } from 'typeorm'; -import { loadConfig } from '../built/config/load.js'; -import { entities } from '../built/db/postgre.js'; -import got from 'got'; - -const _filename = fileURLToPath(import.meta.url); -const _dirname = dirname(_filename); - -const config = loadConfig(); -export const port = config.port; - -export const async = (fn) => (done) => { - fn().then(() => { - done(); - }, (err) => { - done(err); - }); -}; - -export const api = async (endpoint, params, me) => { - endpoint = endpoint.replace(/^\//, ''); - - const auth = me ? { authorization: `Bearer ${me.token}` } : {}; - - const res = await got(`http://localhost:${port}/api/${endpoint}`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - ...auth, - }, - body: JSON.stringify(params), - retry: { - limit: 0, - }, - hooks: { - beforeError: [ - error => { - const { response } = error; - if (response && response.body) console.warn(response.body); - return error; - } - ] - }, - }); - - const status = res.statusCode; - const body = res.statusCode !== 204 ? await JSON.parse(res.body) : null; - - return { - status, - body - }; -}; - -export const request = async (endpoint, params, me) => { - const auth = me ? { authorization: `Bearer ${me.token}` } : {}; - - const res = await fetch(`http://localhost:${port}/api${endpoint}`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - ...auth, - }, - body: JSON.stringify(params), - }); - - const status = res.status; - const body = res.status !== 204 ? await res.json().catch() : null; - - return { - body, status, - }; -}; - -export const signup = async (params) => { - const q = Object.assign({ - username: 'test', - password: 'test', - }, params); - - const res = await api('signup', q); - - return res.body; -}; - -export const post = async (user, params) => { - const q = Object.assign({ - text: 'test', - }, params); - - const res = await api('notes/create', q, user); - - return res.body ? res.body.createdNote : null; -}; - -export const react = async (user, note, reaction) => { - await api('notes/reactions/create', { - noteId: note.id, - reaction: reaction, - }, user); -}; - -/** - * Upload file - * @param user User - * @param _path Optional, absolute path or relative from ./resources/ - */ -export const uploadFile = async (user, _path) => { - const absPath = _path == null ? `${_dirname}/resources/Lenna.jpg` : path.isAbsolute(_path) ? _path : `${_dirname}/resources/${_path}`; - - const formData = new FormData(); - formData.append('i', user.token); - formData.append('file', fs.createReadStream(absPath)); - formData.append('force', 'true'); - - const res = await got(`http://localhost:${port}/api/drive/files/create`, { - method: 'POST', - body: formData, - retry: { - limit: 0, - }, - }); - - const body = res.statusCode !== 204 ? await JSON.parse(res.body) : null; - - return body; -}; - -export const uploadUrl = async (user, url) => { - let file; - - const ws = await connectStream(user, 'main', (msg) => { - if (msg.type === 'driveFileCreated') { - file = msg.body; - } - }); - - await api('drive/files/upload-from-url', { - url, - force: true, - }, user); - - await sleep(5000); - ws.close(); - - return file; -}; - -export function connectStream(user, channel, listener, params) { - return new Promise((res, rej) => { - const ws = new WebSocket(`ws://localhost:${port}/streaming?i=${user.token}`); - - ws.on('open', () => { - ws.on('message', data => { - const msg = JSON.parse(data.toString()); - if (msg.type === 'channel' && msg.body.id === 'a') { - listener(msg.body); - } else if (msg.type === 'connected' && msg.body.id === 'a') { - res(ws); - } - }); - - ws.send(JSON.stringify({ - type: 'connect', - body: { - channel: channel, - id: 'a', - pong: true, - params: params, - }, - })); - }); - }); -} - -export const waitFire = async (user, channel, trgr, cond, params) => { - return new Promise(async (res, rej) => { - let timer; - - let ws; - try { - ws = await connectStream(user, channel, msg => { - if (cond(msg)) { - ws.close(); - if (timer) clearTimeout(timer); - res(true); - } - }, params); - } catch (e) { - rej(e); - } - - if (!ws) return; - - timer = setTimeout(() => { - ws.close(); - res(false); - }, 3000); - - try { - await trgr(); - } catch (e) { - ws.close(); - if (timer) clearTimeout(timer); - rej(e); - } - }) -}; - -export const simpleGet = async (path, accept = '*/*') => { - // node-fetchだと3xxを取れない - return await new Promise((resolve, reject) => { - const req = http.request(`http://localhost:${port}${path}`, { - headers: { - Accept: accept, - }, - }, res => { - if (res.statusCode >= 400) { - reject(res); - } else { - resolve({ - status: res.statusCode, - type: res.headers['content-type'], - location: res.headers.location, - }); - } - }); - - req.end(); - }); -}; - -export function launchServer(callbackSpawnedProcess, moreProcess = async () => {}) { - return (done) => { - const p = childProcess.spawn('node', [_dirname + '/../index.js'], { - stdio: ['inherit', 'inherit', 'inherit', 'ipc'], - env: { NODE_ENV: 'test', PATH: process.env.PATH }, - }); - callbackSpawnedProcess(p); - p.on('message', message => { - if (message === 'ok') moreProcess().then(() => done()).catch(e => done(e)); - }); - }; -} - -export async function initTestDb(justBorrow = false, initEntities) { - if (process.env.NODE_ENV !== 'test') throw 'NODE_ENV is not a test'; - - const db = new DataSource({ - type: 'postgres', - host: config.db.host, - port: config.db.port, - username: config.db.user, - password: config.db.pass, - database: config.db.db, - synchronize: true && !justBorrow, - dropSchema: true && !justBorrow, - entities: initEntities || entities, - }); - - await db.initialize(); - - return db; -} - -export function startServer(timeout = 60 * 1000) { - return new Promise((res, rej) => { - const t = setTimeout(() => { - p.kill(SIGKILL); - rej('timeout to start'); - }, timeout); - - const p = childProcess.spawn('node', [_dirname + '/../built/index.js'], { - stdio: ['inherit', 'inherit', 'inherit', 'ipc'], - env: { NODE_ENV: 'test', PATH: process.env.PATH }, - }); - - p.on('error', e => rej(e)); - - p.on('message', message => { - if (message === 'ok') { - clearTimeout(t); - res(p); - } - }); - }); -} - -export function shutdownServer(p, timeout = 20 * 1000) { - return new Promise((res, rej) => { - const t = setTimeout(() => { - p.kill(SIGKILL); - res('force exit'); - }, timeout); - - p.once('exit', () => { - clearTimeout(t); - res('exited'); - }); - - p.kill(); - }); -} - -export function sleep(msec) { - return new Promise(res => { - setTimeout(() => { - res(); - }, msec); - }); -} diff --git a/packages/client/package.json b/packages/client/package.json index ae0b9747e..4d2e56188 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -65,7 +65,6 @@ "@typescript-eslint/eslint-plugin": "^5.46.1", "@typescript-eslint/parser": "^5.46.1", "cross-env": "7.0.3", - "cypress": "10.3.0", "eslint": "^8.29.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-vue": "^9.8.0" diff --git a/packages/foundkey-js/test-d/api.ts b/packages/foundkey-js/test-d/api.ts deleted file mode 100644 index 0ff2c6f2b..000000000 --- a/packages/foundkey-js/test-d/api.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { expectType } from 'tsd'; -import * as foundkey from '../src'; - -describe('API', () => { - test('success', async () => { - const cli = new foundkey.api.APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN' - }); - const res = await cli.request('meta', { detail: true }); - expectType(res); - }); - - test('conditional respose type (meta)', async () => { - const cli = new foundkey.api.APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN' - }); - - const res = await cli.request('meta', { detail: true }); - expectType(res); - - const res2 = await cli.request('meta', { detail: false }); - expectType(res2); - - const res3 = await cli.request('meta', { }); - expectType(res3); - - const res4 = await cli.request('meta', { detail: true as boolean }); - expectType(res4); - }); - - test('conditional respose type (users/show)', async () => { - const cli = new foundkey.api.APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN' - }); - - const res = await cli.request('users/show', { userId: 'xxxxxxxx' }); - expectType(res); - - const res2 = await cli.request('users/show', { userIds: ['xxxxxxxx'] }); - expectType(res2); - }); -}); diff --git a/packages/foundkey-js/test-d/streaming.ts b/packages/foundkey-js/test-d/streaming.ts deleted file mode 100644 index 7f257ca4d..000000000 --- a/packages/foundkey-js/test-d/streaming.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { expectType } from 'tsd'; -import * as foundkey from '../src'; - -describe('Streaming', () => { - test('emit type', async () => { - const stream = new foundkey.Stream('https://foundkey.test', { token: 'TOKEN' }); - const mainChannel = stream.useChannel('main'); - mainChannel.on('notification', notification => { - expectType(notification); - }); - }); - - test('params type', async () => { - const stream = new foundkey.Stream('https://foundkey.test', { token: 'TOKEN' }); - // TODO: 「stream.useChannel の第二引数として受け入れる型が - // { - // otherparty?: User['id'] | null; - // group?: UserGroup['id'] | null; - // } - // になっている」というテストを行いたいけどtsdでの書き方がわからない - const messagingChannel = stream.useChannel('messaging', { otherparty: 'aaa' }); - messagingChannel.on('message', message => { - expectType(message); - }); - }); -}); diff --git a/packages/foundkey-js/test/api.ts b/packages/foundkey-js/test/api.ts deleted file mode 100644 index ae3ca7181..000000000 --- a/packages/foundkey-js/test/api.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { APIClient, isAPIError } from '../src/api'; -import { enableFetchMocks } from 'jest-fetch-mock'; - -enableFetchMocks(); - -function getFetchCall(call: any[]) { - const { body, method } = call[1]; - if (body != null && typeof body != 'string') { - throw new Error('invalid body'); - } - return { - url: call[0], - method: method, - body: JSON.parse(body as any) - }; -} - -describe('API', () => { - test('success', async () => { - fetchMock.resetMocks(); - fetchMock.mockResponse(async (req) => { - const body = await req.json(); - if (req.method == 'POST' && req.url == 'https://foundkey.test/api/i') { - if (body.i === 'TOKEN') { - return JSON.stringify({ id: 'foo' }); - } else { - return { status: 400 }; - } - } else { - return { status: 404 }; - } - }); - - const cli = new APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN', - }); - - const res = await cli.request('i'); - - expect(res).toEqual({ - id: 'foo' - }); - - expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ - url: 'https://foundkey.test/api/i', - method: 'POST', - body: { i: 'TOKEN' } - }); - }); - - test('with params', async () => { - fetchMock.resetMocks(); - fetchMock.mockResponse(async (req) => { - const body = await req.json(); - if (req.method == 'POST' && req.url == 'https://foundkey.test/api/notes/show') { - if (body.i === 'TOKEN' && body.noteId === 'aaaaa') { - return JSON.stringify({ id: 'foo' }); - } else { - return { status: 400 }; - } - } else { - return { status: 404 }; - } - }); - - const cli = new APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN', - }); - - const res = await cli.request('notes/show', { noteId: 'aaaaa' }); - - expect(res).toEqual({ - id: 'foo' - }); - - expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ - url: 'https://foundkey.test/api/notes/show', - method: 'POST', - body: { i: 'TOKEN', noteId: 'aaaaa' } - }); - }); - - test('204 No Content で null が返る', async () => { - fetchMock.resetMocks(); - fetchMock.mockResponse(async (req) => { - if (req.method == 'POST' && req.url == 'https://foundkey.test/api/reset-password') { - return { status: 204 }; - } else { - return { status: 404 }; - } - }); - - const cli = new APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN', - }); - - const res = await cli.request('reset-password', { token: 'aaa', password: 'aaa' }); - - expect(res).toEqual(null); - - expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ - url: 'https://foundkey.test/api/reset-password', - method: 'POST', - body: { i: 'TOKEN', token: 'aaa', password: 'aaa' } - }); - }); - - test('インスタンスの credential が指定されていても引数で credential が null ならば null としてリクエストされる', async () => { - fetchMock.resetMocks(); - fetchMock.mockResponse(async (req) => { - const body = await req.json(); - if (req.method == 'POST' && req.url == 'https://foundkey.test/api/i') { - if (typeof body.i === 'string') { - return JSON.stringify({ id: 'foo' }); - } else { - return { - status: 401, - body: JSON.stringify({ - error: { - message: 'Credential required.', - code: 'CREDENTIAL_REQUIRED', - id: '1384574d-a912-4b81-8601-c7b1c4085df1', - } - }) - }; - } - } else { - return { status: 404 }; - } - }); - - try { - const cli = new APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN', - }); - - await cli.request('i', {}, null); - } catch (e) { - expect(isAPIError(e)).toEqual(true); - } - }); - - test('api error', async () => { - fetchMock.resetMocks(); - fetchMock.mockResponse(async (req) => { - return { - status: 500, - body: JSON.stringify({ - error: { - message: 'Internal error occurred. Please contact us if the error persists.', - code: 'INTERNAL_ERROR', - id: '5d37dbcb-891e-41ca-a3d6-e690c97775ac', - kind: 'server', - }, - }) - }; - }); - - try { - const cli = new APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN', - }); - - await cli.request('i'); - } catch (e: any) { - expect(isAPIError(e)).toEqual(true); - expect(e.id).toEqual('5d37dbcb-891e-41ca-a3d6-e690c97775ac'); - } - }); - - test('network error', async () => { - fetchMock.resetMocks(); - fetchMock.mockAbort(); - - try { - const cli = new APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN', - }); - - await cli.request('i'); - } catch (e) { - expect(isAPIError(e)).toEqual(false); - } - }); - - test('json parse error', async () => { - fetchMock.resetMocks(); - fetchMock.mockResponse(async (req) => { - return { - status: 500, - body: 'I AM NOT JSON' - }; - }); - - try { - const cli = new APIClient({ - origin: 'https://foundkey.test', - credential: 'TOKEN', - }); - - await cli.request('i'); - } catch (e) { - expect(isAPIError(e)).toEqual(false); - } - }); -}); diff --git a/packages/foundkey-js/test/streaming.ts b/packages/foundkey-js/test/streaming.ts deleted file mode 100644 index 7fbb8e2f2..000000000 --- a/packages/foundkey-js/test/streaming.ts +++ /dev/null @@ -1,165 +0,0 @@ -import WS from 'jest-websocket-mock'; -import Stream from '../src/streaming'; - -describe('Streaming', () => { - test('useChannel', async () => { - const server = new WS('wss://foundkey.test/streaming'); - const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); - const mainChannelReceived: any[] = []; - const main = stream.useChannel('main'); - main.on('meUpdated', payload => { - mainChannelReceived.push(payload); - }); - - const ws = await server.connected; - expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN'); - - const msg = JSON.parse(await server.nextMessage as string); - const mainChannelId = msg.body.id; - expect(msg.type).toEqual('connect'); - expect(msg.body.channel).toEqual('main'); - expect(mainChannelId != null).toEqual(true); - - server.send(JSON.stringify({ - type: 'channel', - body: { - id: mainChannelId, - type: 'meUpdated', - body: { - id: 'foo' - } - } - })); - - expect(mainChannelReceived[0]).toEqual({ - id: 'foo' - }); - - stream.close(); - server.close(); - }); - - test('useChannel with parameters', async () => { - const server = new WS('wss://foundkey.test/streaming'); - const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); - const messagingChannelReceived: any[] = []; - const messaging = stream.useChannel('messaging', { otherparty: 'aaa' }); - messaging.on('message', payload => { - messagingChannelReceived.push(payload); - }); - - const ws = await server.connected; - expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN'); - - const msg = JSON.parse(await server.nextMessage as string); - const messagingChannelId = msg.body.id; - expect(msg.type).toEqual('connect'); - expect(msg.body.channel).toEqual('messaging'); - expect(msg.body.params).toEqual({ otherparty: 'aaa' }); - expect(messagingChannelId != null).toEqual(true); - - server.send(JSON.stringify({ - type: 'channel', - body: { - id: messagingChannelId, - type: 'message', - body: { - id: 'foo' - } - } - })); - - expect(messagingChannelReceived[0]).toEqual({ - id: 'foo' - }); - - stream.close(); - server.close(); - }); - - test('ちゃんとチャンネルごとにidが異なる', async () => { - const server = new WS('wss://foundkey.test/streaming'); - const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); - - stream.useChannel('messaging', { otherparty: 'aaa' }); - stream.useChannel('messaging', { otherparty: 'bbb' }); - - const ws = await server.connected; - expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN'); - - const msg = JSON.parse(await server.nextMessage as string); - const messagingChannelId = msg.body.id; - const msg2 = JSON.parse(await server.nextMessage as string); - const messagingChannelId2 = msg2.body.id; - - expect(messagingChannelId != null).toEqual(true); - expect(messagingChannelId2 != null).toEqual(true); - expect(messagingChannelId).not.toEqual(messagingChannelId2); - - stream.close(); - server.close(); - }); - - test('Connection#send', async () => { - const server = new WS('wss://foundkey.test/streaming'); - const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); - - const messaging = stream.useChannel('messaging', { otherparty: 'aaa' }); - messaging.send('read', { id: 'aaa' }); - - const ws = await server.connected; - expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN'); - - const connectMsg = JSON.parse(await server.nextMessage as string); - const channelId = connectMsg.body.id; - const msg = JSON.parse(await server.nextMessage as string); - - expect(msg.type).toEqual('ch'); - expect(msg.body.id).toEqual(channelId); - expect(msg.body.type).toEqual('read'); - expect(msg.body.body).toEqual({ id: 'aaa' }); - - stream.close(); - server.close(); - }); - - test('Connection#dispose', async () => { - const server = new WS('wss://foundkey.test/streaming'); - const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); - const mainChannelReceived: any[] = []; - const main = stream.useChannel('main'); - main.on('meUpdated', payload => { - mainChannelReceived.push(payload); - }); - - const ws = await server.connected; - expect(new URLSearchParams(new URL(ws.url).search).get('i')).toEqual('TOKEN'); - - const msg = JSON.parse(await server.nextMessage as string); - const mainChannelId = msg.body.id; - expect(msg.type).toEqual('connect'); - expect(msg.body.channel).toEqual('main'); - expect(mainChannelId != null).toEqual(true); - main.dispose(); - - server.send(JSON.stringify({ - type: 'channel', - body: { - id: mainChannelId, - type: 'meUpdated', - body: { - id: 'foo' - } - } - })); - - expect(mainChannelReceived.length).toEqual(0); - - stream.close(); - server.close(); - }); - - // TODO: SharedConnection#dispose して一定時間経ったら disconnect メッセージがサーバーに送られてくるかのテスト - - // TODO: チャンネル接続が使いまわされるかのテスト -}); diff --git a/packages/shared/custom-rules/index.js b/packages/shared/custom-rules/index.js index 25330a2e8..0108406df 100644 --- a/packages/shared/custom-rules/index.js +++ b/packages/shared/custom-rules/index.js @@ -3,7 +3,7 @@ const path = require("path"); const ruleFiles = fs .readdirSync(__dirname) - .filter((file) => file !== "index.js" && !file.endsWith("test.js")); + .filter((file) => file !== "index.js"); const rules = Object.fromEntries( ruleFiles.map((file) => [path.basename(file, ".js"), require("./" + file)]) diff --git a/yarn.lock b/yarn.lock index 60db732c1..06fe56e14 100644 --- a/yarn.lock +++ b/yarn.lock @@ -570,42 +570,6 @@ __metadata: languageName: node linkType: hard -"@cypress/request@npm:^2.88.10": - version: 2.88.10 - resolution: "@cypress/request@npm:2.88.10" - dependencies: - aws-sign2: ~0.7.0 - aws4: ^1.8.0 - caseless: ~0.12.0 - combined-stream: ~1.0.6 - extend: ~3.0.2 - forever-agent: ~0.6.1 - form-data: ~2.3.2 - http-signature: ~1.3.6 - is-typedarray: ~1.0.0 - isstream: ~0.1.2 - json-stringify-safe: ~5.0.1 - mime-types: ~2.1.19 - performance-now: ^2.1.0 - qs: ~6.5.2 - safe-buffer: ^5.1.2 - tough-cookie: ~2.5.0 - tunnel-agent: ^0.6.0 - uuid: ^8.3.2 - checksum: 69c3e3b332e9be4866a900f6bcca5d274d8cea6c99707fbcce061de8dbab11c9b1e39f4c017f6e83e6e682717781d4f6106fd6b7cf9546580fcfac353b6676cf - languageName: node - linkType: hard - -"@cypress/xvfb@npm:^1.2.4": - version: 1.2.4 - resolution: "@cypress/xvfb@npm:1.2.4" - dependencies: - debug: ^3.1.0 - lodash.once: ^4.1.1 - checksum: 7bdcdaeb1bb692ec9d9bf8ec52538aa0bead6764753f4a067a171a511807a43fab016f7285a56bef6a606c2467ff3f1365e1ad2d2d583b81beed849ee1573fd1 - languageName: node - linkType: hard - "@digitalbazaar/http-client@npm:^3.2.0": version: 3.2.0 resolution: "@digitalbazaar/http-client@npm:3.2.0" @@ -687,22 +651,6 @@ __metadata: languageName: node linkType: hard -"@hapi/hoek@npm:^9.0.0": - version: 9.2.0 - resolution: "@hapi/hoek@npm:9.2.0" - checksum: 57103bb5074d24ffd876f559bac6b312f2f58fe0f21dbfb0b8941032cba4fd37d92249db366516e1f68e2033834b87001c1558f523b48130b21f823f1e35b91a - languageName: node - linkType: hard - -"@hapi/topo@npm:^5.0.0": - version: 5.1.0 - resolution: "@hapi/topo@npm:5.1.0" - dependencies: - "@hapi/hoek": ^9.0.0 - checksum: 604dfd5dde76d5c334bd03f9001fce69c7ce529883acf92da96f4fe7e51221bf5e5110e964caca287a6a616ba027c071748ab636ff178ad750547fba611d6014 - languageName: node - linkType: hard - "@humanwhocodes/config-array@npm:^0.11.6": version: 0.11.7 resolution: "@humanwhocodes/config-array@npm:0.11.7" @@ -1398,29 +1346,6 @@ __metadata: languageName: node linkType: hard -"@sideway/address@npm:^4.1.0": - version: 4.1.2 - resolution: "@sideway/address@npm:4.1.2" - dependencies: - "@hapi/hoek": ^9.0.0 - checksum: 1e4910f7b3205347f78e698923dd7e0bb400c9e9e9bdd4a059edb6d2e32a540b426aba4652d095ea299fb75019d87883251dd9b96b350c00a35454bcdfa5f9f5 - languageName: node - linkType: hard - -"@sideway/formula@npm:^3.0.0": - version: 3.0.0 - resolution: "@sideway/formula@npm:3.0.0" - checksum: 8ae26a0ed6bc84f7310be6aae6eb9d81e97f382619fc69025d346871a707eaab0fa38b8c857e3f0c35a19923de129f42d35c50b8010c928d64aab41578580ec4 - languageName: node - linkType: hard - -"@sideway/pinpoint@npm:^2.0.0": - version: 2.0.0 - resolution: "@sideway/pinpoint@npm:2.0.0" - checksum: 0f4491e5897fcf5bf02c46f5c359c56a314e90ba243f42f0c100437935daa2488f20482f0f77186bd6bf43345095a95d8143ecf8b1f4d876a7bc0806aba9c3d2 - languageName: node - linkType: hard - "@sinclair/typebox@npm:^0.24.1": version: 0.24.28 resolution: "@sinclair/typebox@npm:0.24.28" @@ -2174,13 +2099,6 @@ __metadata: languageName: node linkType: hard -"@types/mocha@npm:9.1.1": - version: 9.1.1 - resolution: "@types/mocha@npm:9.1.1" - checksum: 516077c0acd9806dc78317f88aaac0df5aaf0bdc2f63dfdadeabdf0b0137953b6ca65472e6ff7c30bc93ce4e0ae76eae70e8d46764b9a8eae4877a928b6ef49a - languageName: node - linkType: hard - "@types/node-fetch@npm:3.0.3": version: 3.0.3 resolution: "@types/node-fetch@npm:3.0.3" @@ -2204,7 +2122,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^14.11.8, @types/node@npm:^14.14.31, @types/node@npm:^14.14.41": +"@types/node@npm:^14.11.8, @types/node@npm:^14.14.41": version: 14.18.26 resolution: "@types/node@npm:14.18.26" checksum: c6ac3f9d4f6f77c0fa5ac17757779ad4d9835abfe3af5708b7552597cb5c7c1103e83499ccaf767a1cfa70040990bcf3f58761c547051dc8d5077f3c419091b1 @@ -2399,20 +2317,6 @@ __metadata: languageName: node linkType: hard -"@types/sinonjs__fake-timers@npm:8.1.1": - version: 8.1.1 - resolution: "@types/sinonjs__fake-timers@npm:8.1.1" - checksum: ca09d54d47091d87020824a73f026300fa06b17cd9f2f9b9387f28b549364b141ef194ee28db762f6588de71d8febcd17f753163cb7ea116b8387c18e80ebd5c - languageName: node - linkType: hard - -"@types/sizzle@npm:^2.3.2": - version: 2.3.3 - resolution: "@types/sizzle@npm:2.3.3" - checksum: 586a9fb1f6ff3e325e0f2cc1596a460615f0bc8a28f6e276ac9b509401039dd242fa8b34496d3a30c52f5b495873922d09a9e76c50c2ab2bcc70ba3fb9c4e160 - languageName: node - linkType: hard - "@types/speakeasy@npm:2.0.7": version: 2.0.7 resolution: "@types/speakeasy@npm:2.0.7" @@ -2535,15 +2439,6 @@ __metadata: languageName: node linkType: hard -"@types/yauzl@npm:^2.9.1": - version: 2.9.2 - resolution: "@types/yauzl@npm:2.9.2" - dependencies: - "@types/node": "*" - checksum: dfb49abe82605615712fc694eaa4f7068fe30aa03f38c085e2c2e74408beaad30471d36da9654a811482ece2ea4405575fd99b19c0aa327ed2a9736b554bbf43 - languageName: node - linkType: hard - "@typescript-eslint/eslint-plugin@npm:^5.46.1": version: 5.46.1 resolution: "@typescript-eslint/eslint-plugin@npm:5.46.1" @@ -2940,13 +2835,6 @@ __metadata: languageName: node linkType: hard -"ansi-colors@npm:4.1.1, ansi-colors@npm:^4.1.1": - version: 4.1.1 - resolution: "ansi-colors@npm:4.1.1" - checksum: 138d04a51076cb085da0a7e2d000c5c0bb09f6e772ed5c65c53cb118d37f6c5f1637506d7155fb5f330f0abcf6f12fa2e489ac3f8cdab9da393bf1bb4f9a32b0 - languageName: node - linkType: hard - "ansi-colors@npm:^1.0.1": version: 1.1.0 resolution: "ansi-colors@npm:1.1.0" @@ -2956,7 +2844,7 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.0": +"ansi-escapes@npm:^4.2.1": version: 4.3.2 resolution: "ansi-escapes@npm:4.3.2" dependencies: @@ -3085,13 +2973,6 @@ __metadata: languageName: node linkType: hard -"arch@npm:^2.2.0": - version: 2.2.0 - resolution: "arch@npm:2.2.0" - checksum: e21b7635029fe8e9cdd5a026f9a6c659103e63fff423834323cdf836a1bb240a72d0c39ca8c470f84643385cf581bd8eda2cad8bf493e27e54bd9783abe9101f - languageName: node - linkType: hard - "archiver-utils@npm:^2.1.0": version: 2.1.0 resolution: "archiver-utils@npm:2.1.0" @@ -3364,13 +3245,6 @@ __metadata: languageName: node linkType: hard -"astral-regex@npm:^2.0.0": - version: 2.0.0 - resolution: "astral-regex@npm:2.0.0" - checksum: 876231688c66400473ba505731df37ea436e574dd524520294cc3bbc54ea40334865e01fa0d074d74d036ee874ee7e62f486ea38bc421ee8e6a871c06f011766 - languageName: node - linkType: hard - "async-done@npm:^1.2.0, async-done@npm:^1.2.2": version: 1.3.2 resolution: "async-done@npm:1.3.2" @@ -3392,7 +3266,7 @@ __metadata: languageName: node linkType: hard -"async@npm:>=0.2.9, async@npm:^3.2.0, async@npm:^3.2.3": +"async@npm:>=0.2.9, async@npm:^3.2.3": version: 3.2.4 resolution: "async@npm:3.2.4" checksum: 43d07459a4e1d09b84a20772414aa684ff4de085cbcaec6eea3c7a8f8150e8c62aa6cd4e699fe8ee93c3a5b324e777d34642531875a0817a35697522c1b02e89 @@ -3406,13 +3280,6 @@ __metadata: languageName: node linkType: hard -"at-least-node@npm:^1.0.0": - version: 1.0.0 - resolution: "at-least-node@npm:1.0.0" - checksum: 463e2f8e43384f1afb54bc68485c436d7622acec08b6fad269b421cb1d29cebb5af751426793d0961ed243146fe4dc983402f6d5a51b720b277818dbf6f2e49e - languageName: node - linkType: hard - "atob@npm:^2.1.2": version: 2.1.2 resolution: "atob@npm:2.1.2" @@ -3467,29 +3334,6 @@ __metadata: languageName: node linkType: hard -"aws-sign2@npm:~0.7.0": - version: 0.7.0 - resolution: "aws-sign2@npm:0.7.0" - checksum: b148b0bb0778098ad8cf7e5fc619768bcb51236707ca1d3e5b49e41b171166d8be9fdc2ea2ae43d7decf02989d0aaa3a9c4caa6f320af95d684de9b548a71525 - languageName: node - linkType: hard - -"aws4@npm:^1.8.0": - version: 1.9.1 - resolution: "aws4@npm:1.9.1" - checksum: aa6f42024a4a191136d663bfca3866e97a2683e4facc77485e48a0ee1c1675d0a84fd006c911930f5c78596fab9d7b5e6579eb71be2f041f130210a6e90e43b7 - languageName: node - linkType: hard - -"axios@npm:^0.21.1": - version: 0.21.4 - resolution: "axios@npm:0.21.4" - dependencies: - follow-redirects: ^1.14.0 - checksum: 44245f24ac971e7458f3120c92f9d66d1fc695e8b97019139de5b0cc65d9b8104647db01e5f46917728edfc0cfd88eb30fc4c55e6053eef4ace76768ce95ff3c - languageName: node - linkType: hard - "axios@npm:^0.24.0": version: 0.24.0 resolution: "axios@npm:0.24.0" @@ -3639,7 +3483,6 @@ __metadata: "@types/koa__cors": 3.1.1 "@types/koa__multer": 2.0.4 "@types/koa__router": 8.0.11 - "@types/mocha": 9.1.1 "@types/node": 18.7.16 "@types/node-fetch": 3.0.3 "@types/nodemailer": 6.4.5 @@ -3715,7 +3558,6 @@ __metadata: koa-views: 7.0.2 mfm-js: 0.23.3 mime-types: 2.1.35 - mocha: 10.2.0 multer: 1.4.5-lts.1 nested-property: 4.0.0 node-fetch: 3.2.6 @@ -3864,14 +3706,7 @@ __metadata: languageName: node linkType: hard -"blob-util@npm:^2.0.2": - version: 2.0.2 - resolution: "blob-util@npm:2.0.2" - checksum: d543e6b92e4ca715ca33c78e89a07a2290d43e5b2bc897d7ec588c5c7bbf59df93e45225ac0c9258aa6ce4320358990f99c9288f1c48280f8ec5d7a2e088d19b - languageName: node - linkType: hard - -"bluebird@npm:3.7.2, bluebird@npm:^3.7.2": +"bluebird@npm:^3.7.2": version: 3.7.2 resolution: "bluebird@npm:3.7.2" checksum: 869417503c722e7dc54ca46715f70e15f4d9c602a423a02c825570862d12935be59ed9c7ba34a9b31f186c017c23cac6b54e35446f8353059c101da73eac22ef @@ -3974,13 +3809,6 @@ __metadata: languageName: node linkType: hard -"browser-stdout@npm:1.3.1": - version: 1.3.1 - resolution: "browser-stdout@npm:1.3.1" - checksum: b717b19b25952dd6af483e368f9bcd6b14b87740c3d226c2977a65e84666ffd67000bddea7d911f111a9b6ddc822b234de42d52ab6507bce4119a4cc003ef7b3 - languageName: node - linkType: hard - "browserslist@npm:^1.3.6, browserslist@npm:^1.5.2, browserslist@npm:^1.7.6": version: 1.7.7 resolution: "browserslist@npm:1.7.7" @@ -4095,7 +3923,7 @@ __metadata: languageName: node linkType: hard -"buffer@npm:^5.2.1, buffer@npm:^5.5.0, buffer@npm:^5.6.0": +"buffer@npm:^5.2.1, buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" dependencies: @@ -4237,13 +4065,6 @@ __metadata: languageName: node linkType: hard -"cachedir@npm:^2.3.0": - version: 2.3.0 - resolution: "cachedir@npm:2.3.0" - checksum: ec90cb0f2e6336e266aa748dbadf3da9e0b20e843e43f1591acab7a3f1451337dc2f26cb9dd833ae8cfefeffeeb43ef5b5ff62782a685f4e3c2305dd98482fcb - languageName: node - linkType: hard - "call-bind@npm:^1.0.0, call-bind@npm:^1.0.2": version: 1.0.2 resolution: "call-bind@npm:1.0.2" @@ -4286,7 +4107,7 @@ __metadata: languageName: node linkType: hard -"camelcase@npm:^6.0.0, camelcase@npm:^6.2.0": +"camelcase@npm:^6.2.0": version: 6.3.0 resolution: "camelcase@npm:6.3.0" checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d @@ -4326,13 +4147,6 @@ __metadata: languageName: node linkType: hard -"caseless@npm:~0.12.0": - version: 0.12.0 - resolution: "caseless@npm:0.12.0" - checksum: b43bd4c440aa1e8ee6baefee8063b4850fd0d7b378f6aabc796c9ec8cb26d27fb30b46885350777d9bd079c5256c0e1329ad0dc7c2817e0bb466810ebb353751 - languageName: node - linkType: hard - "cbor@npm:*, cbor@npm:8.1.0": version: 8.1.0 resolution: "cbor@npm:8.1.0" @@ -4438,13 +4252,6 @@ __metadata: languageName: node linkType: hard -"check-more-types@npm:2.24.0, check-more-types@npm:^2.24.0": - version: 2.24.0 - resolution: "check-more-types@npm:2.24.0" - checksum: b09080ec3404d20a4b0ead828994b2e5913236ef44ed3033a27062af0004cf7d2091fbde4b396bf13b7ce02fb018bc9960b48305e6ab2304cd82d73ed7a51ef4 - languageName: node - linkType: hard - "cheerio@npm:0.22.0": version: 0.22.0 resolution: "cheerio@npm:0.22.0" @@ -4502,7 +4309,7 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^3.1.1, ci-info@npm:^3.2.0": +"ci-info@npm:^3.2.0": version: 3.3.2 resolution: "ci-info@npm:3.3.2" checksum: fd81f1edd2d3b0f6cb077b2e84365136d87b9db8c055928c1ad69da8a76c2c2f19cba8ea51b90238302157ca927f91f92b653e933f2398dde4867500f08d6e62 @@ -4544,15 +4351,6 @@ __metadata: languageName: node linkType: hard -"cli-cursor@npm:^3.1.0": - version: 3.1.0 - resolution: "cli-cursor@npm:3.1.0" - dependencies: - restore-cursor: ^3.1.0 - checksum: 2692784c6cd2fd85cfdbd11f53aea73a463a6d64a77c3e098b2b4697a20443f430c220629e1ca3b195ea5ac4a97a74c2ee411f3807abf6df2b66211fec0c0a29 - languageName: node - linkType: hard - "cli-highlight@npm:2.1.11, cli-highlight@npm:^2.1.11": version: 2.1.11 resolution: "cli-highlight@npm:2.1.11" @@ -4569,29 +4367,6 @@ __metadata: languageName: node linkType: hard -"cli-table3@npm:~0.6.1": - version: 0.6.1 - resolution: "cli-table3@npm:0.6.1" - dependencies: - colors: 1.4.0 - string-width: ^4.2.0 - dependenciesMeta: - colors: - optional: true - checksum: 956e175f8eb019c26465b9f1e51121c08d8978e2aab04be7f8520ea8a4e67906fcbd8516dfb77e386ae3730ef0281aa21a65613dffbfa3d62969263252bd25a9 - languageName: node - linkType: hard - -"cli-truncate@npm:^2.1.0": - version: 2.1.0 - resolution: "cli-truncate@npm:2.1.0" - dependencies: - slice-ansi: ^3.0.0 - string-width: ^4.2.0 - checksum: bf1e4e6195392dc718bf9cd71f317b6300dc4a9191d052f31046b8773230ece4fa09458813bf0e3455a5e68c0690d2ea2c197d14a8b85a7b5e01c97f4b5feb5d - languageName: node - linkType: hard - "client@workspace:packages/client": version: 0.0.0-use.local resolution: "client@workspace:packages/client" @@ -4623,7 +4398,6 @@ __metadata: compare-versions: 4.1.3 cropperjs: 2.0.0-beta.1 cross-env: 7.0.3 - cypress: 10.3.0 date-fns: 2.28.0 eslint: ^8.29.0 eslint-plugin-import: ^2.26.0 @@ -4902,7 +4676,7 @@ __metadata: languageName: node linkType: hard -"colorette@npm:^1.2.0, colorette@npm:^1.2.2": +"colorette@npm:^1.2.0": version: 1.4.0 resolution: "colorette@npm:1.4.0" checksum: 01c3c16058b182a4ab4c126a65a75faa4d38a20fa7c845090b25453acec6c371bb2c5dceb0a2338511f17902b9d1a9af0cadd8509c9403894b79311032c256c3 @@ -4920,13 +4694,6 @@ __metadata: languageName: node linkType: hard -"colors@npm:1.4.0": - version: 1.4.0 - resolution: "colors@npm:1.4.0" - checksum: 98aa2c2418ad87dedf25d781be69dc5fc5908e279d9d30c34d8b702e586a0474605b3a189511482b9d5ed0d20c867515d22749537f7bc546256c6014f3ebdcec - languageName: node - linkType: hard - "colors@npm:~1.1.2": version: 1.1.2 resolution: "colors@npm:1.1.2" @@ -4941,7 +4708,7 @@ __metadata: languageName: node linkType: hard -"combined-stream@npm:^1.0.6, combined-stream@npm:^1.0.8, combined-stream@npm:~1.0.6": +"combined-stream@npm:^1.0.8": version: 1.0.8 resolution: "combined-stream@npm:1.0.8" dependencies: @@ -4957,13 +4724,6 @@ __metadata: languageName: node linkType: hard -"commander@npm:^5.1.0": - version: 5.1.0 - resolution: "commander@npm:5.1.0" - checksum: 0b7fec1712fbcc6230fcb161d8d73b4730fa91a21dc089515489402ad78810547683f058e2a9835929c212fead1d6a6ade70db28bbb03edbc2829a9ab7d69447 - languageName: node - linkType: hard - "commander@npm:^8.3.0": version: 8.3.0 resolution: "commander@npm:8.3.0" @@ -4978,13 +4738,6 @@ __metadata: languageName: node linkType: hard -"common-tags@npm:^1.8.0": - version: 1.8.0 - resolution: "common-tags@npm:1.8.0" - checksum: fb0cc9420d149176f2bd2b1fc9e6df622cd34eccaca60b276aa3253a7c9241e8a8ed1ec0702b2679eba7e47aeef721869c686bbd7257b75b5c44993c8462cd7f - languageName: node - linkType: hard - "compare-versions@npm:4.1.3": version: 4.1.3 resolution: "compare-versions@npm:4.1.3" @@ -5219,7 +4972,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" dependencies: @@ -5354,58 +5107,6 @@ __metadata: languageName: node linkType: hard -"cypress@npm:10.3.0": - version: 10.3.0 - resolution: "cypress@npm:10.3.0" - dependencies: - "@cypress/request": ^2.88.10 - "@cypress/xvfb": ^1.2.4 - "@types/node": ^14.14.31 - "@types/sinonjs__fake-timers": 8.1.1 - "@types/sizzle": ^2.3.2 - arch: ^2.2.0 - blob-util: ^2.0.2 - bluebird: ^3.7.2 - buffer: ^5.6.0 - cachedir: ^2.3.0 - chalk: ^4.1.0 - check-more-types: ^2.24.0 - cli-cursor: ^3.1.0 - cli-table3: ~0.6.1 - commander: ^5.1.0 - common-tags: ^1.8.0 - dayjs: ^1.10.4 - debug: ^4.3.2 - enquirer: ^2.3.6 - eventemitter2: ^6.4.3 - execa: 4.1.0 - executable: ^4.1.1 - extract-zip: 2.0.1 - figures: ^3.2.0 - fs-extra: ^9.1.0 - getos: ^3.2.1 - is-ci: ^3.0.0 - is-installed-globally: ~0.4.0 - lazy-ass: ^1.6.0 - listr2: ^3.8.3 - lodash: ^4.17.21 - log-symbols: ^4.0.0 - minimist: ^1.2.6 - ospath: ^1.2.2 - pretty-bytes: ^5.6.0 - proxy-from-env: 1.0.0 - request-progress: ^3.0.0 - semver: ^7.3.2 - supports-color: ^8.1.1 - tmp: ~0.2.1 - untildify: ^4.0.0 - yauzl: ^2.10.0 - bin: - cypress: bin/cypress - checksum: 9cc6d8cd087d7c79f07ad83b8ef9b183f44cf816499bba53e1cee2b6f987d0a6893be209fcd47660cdd0e8456bd132813abe8a6bd15f446d9c96e0129be2de29 - languageName: node - linkType: hard - "d@npm:1, d@npm:^1.0.1": version: 1.0.1 resolution: "d@npm:1.0.1" @@ -5468,13 +5169,6 @@ __metadata: languageName: node linkType: hard -"dayjs@npm:^1.10.4": - version: 1.10.6 - resolution: "dayjs@npm:1.10.6" - checksum: a79af6d19cf1e3aefc231e480037b37df50701e8d0cdbe1736fc6665b7045a159777215c5c8dd42ede7dd3c4c4f4a174d4ddd5bffca51df2a4ba0e0e25a6163c - languageName: node - linkType: hard - "debug@npm:2, debug@npm:^2.2.0, debug@npm:^2.3.3, debug@npm:^2.5.2, debug@npm:^2.6.9": version: 2.6.9 resolution: "debug@npm:2.6.9" @@ -5484,7 +5178,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:4.3.4, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -5496,18 +5190,6 @@ __metadata: languageName: node linkType: hard -"debug@npm:4.3.2": - version: 4.3.2 - resolution: "debug@npm:4.3.2" - dependencies: - ms: 2.1.2 - peerDependenciesMeta: - supports-color: - optional: true - checksum: 820ea160e267e23c953c9ed87e7ad93494d8cda2f7349af5e7e3bb236d23707ee3022f477d5a7d2ee86ef2bf7d60aa9ab22d1f58080d7deb9dccd073585e1e43 - languageName: node - linkType: hard - "debug@npm:4.3.3": version: 4.3.3 resolution: "debug@npm:4.3.3" @@ -5553,13 +5235,6 @@ __metadata: languageName: node linkType: hard -"decamelize@npm:^4.0.0": - version: 4.0.0 - resolution: "decamelize@npm:4.0.0" - checksum: b7d09b82652c39eead4d6678bb578e3bebd848add894b76d0f6b395bc45b2d692fb88d977e7cfb93c4ed6c119b05a1347cef261174916c2e75c0a8ca57da1809 - languageName: node - linkType: hard - "decimal.js@npm:^10.2.1, decimal.js@npm:^10.3.1": version: 10.4.0 resolution: "decimal.js@npm:10.4.0" @@ -5845,13 +5520,6 @@ __metadata: languageName: node linkType: hard -"diff@npm:5.0.0": - version: 5.0.0 - resolution: "diff@npm:5.0.0" - checksum: f19fe29284b633afdb2725c2a8bb7d25761ea54d321d8e67987ac851c5294be4afeab532bd84531e02583a3fe7f4014aa314a3eda84f5590e7a9e6b371ef3b46 - languageName: node - linkType: hard - "diff@npm:^4.0.1": version: 4.0.2 resolution: "diff@npm:4.0.2" @@ -6033,13 +5701,6 @@ __metadata: languageName: node linkType: hard -"duplexer@npm:~0.1.1": - version: 0.1.2 - resolution: "duplexer@npm:0.1.2" - checksum: 62ba61a830c56801db28ff6305c7d289b6dc9f859054e8c982abd8ee0b0a14d2e9a8e7d086ffee12e868d43e2bbe8a964be55ddbd8c8957714c87373c7a4f9b0 - languageName: node - linkType: hard - "duplexify@npm:^3.6.0": version: 3.7.1 resolution: "duplexify@npm:3.7.1" @@ -6183,15 +5844,6 @@ __metadata: languageName: node linkType: hard -"enquirer@npm:^2.3.6": - version: 2.3.6 - resolution: "enquirer@npm:2.3.6" - dependencies: - ansi-colors: ^4.1.1 - checksum: 1c0911e14a6f8d26721c91e01db06092a5f7675159f0261d69c403396a385afd13dd76825e7678f66daffa930cfaa8d45f506fb35f818a2788463d022af1b884 - languageName: node - linkType: hard - "entities@npm:^1.1.1, entities@npm:~1.1.1": version: 1.1.2 resolution: "entities@npm:1.1.2" @@ -6780,13 +6432,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": - version: 4.0.0 - resolution: "escape-string-regexp@npm:4.0.0" - checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 - languageName: node - linkType: hard - "escape-string-regexp@npm:^1.0.2, escape-string-regexp@npm:^1.0.3, escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" @@ -6801,6 +6446,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^4.0.0": + version: 4.0.0 + resolution: "escape-string-regexp@npm:4.0.0" + checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 + languageName: node + linkType: hard + "escodegen@npm:^2.0.0": version: 2.0.0 resolution: "escodegen@npm:2.0.0" @@ -7090,21 +6742,6 @@ __metadata: languageName: node linkType: hard -"event-stream@npm:=3.3.4": - version: 3.3.4 - resolution: "event-stream@npm:3.3.4" - dependencies: - duplexer: ~0.1.1 - from: ~0 - map-stream: ~0.1.0 - pause-stream: 0.0.11 - split: 0.3 - stream-combiner: ~0.0.4 - through: ~2.3.1 - checksum: 80b467820b6daf824d9fb4345d2daf115a056e5c104463f2e98534e92d196a27f2df5ea2aa085624db26f4c45698905499e881d13bc7c01f7a13eac85be72a22 - languageName: node - linkType: hard - "event-target-shim@npm:^5.0.0": version: 5.0.1 resolution: "event-target-shim@npm:5.0.1" @@ -7112,13 +6749,6 @@ __metadata: languageName: node linkType: hard -"eventemitter2@npm:^6.4.3": - version: 6.4.4 - resolution: "eventemitter2@npm:6.4.4" - checksum: b5e707039973d5a770bc4c64255604df66df3a1f63389dccb7118af163b9f790ca7596463d7868426339301ad9de5ef1c3f4a9c7ac3b93874c5ca792916dede1 - languageName: node - linkType: hard - "eventemitter3@npm:4.0.7, eventemitter3@npm:^4.0.4, eventemitter3@npm:^4.0.7": version: 4.0.7 resolution: "eventemitter3@npm:4.0.7" @@ -7133,23 +6763,6 @@ __metadata: languageName: node linkType: hard -"execa@npm:4.1.0": - version: 4.1.0 - resolution: "execa@npm:4.1.0" - dependencies: - cross-spawn: ^7.0.0 - get-stream: ^5.0.0 - human-signals: ^1.1.1 - is-stream: ^2.0.0 - merge-stream: ^2.0.0 - npm-run-path: ^4.0.0 - onetime: ^5.1.0 - signal-exit: ^3.0.2 - strip-final-newline: ^2.0.0 - checksum: e30d298934d9c52f90f3847704fd8224e849a081ab2b517bbc02f5f7732c24e56a21f14cb96a08256deffeb2d12b2b7cb7e2b014a12fb36f8d3357e06417ed55 - languageName: node - linkType: hard - "execa@npm:5.1.1, execa@npm:^5.0.0": version: 5.1.1 resolution: "execa@npm:5.1.1" @@ -7184,15 +6797,6 @@ __metadata: languageName: node linkType: hard -"executable@npm:^4.1.1": - version: 4.1.1 - resolution: "executable@npm:4.1.1" - dependencies: - pify: ^2.2.0 - checksum: f01927ce59bccec804e171bf859a26e362c1f50aa9ebc69f7cafdcce3859d29d4b6267fd47237c18b0a1830614bd3f0ee14b7380d9bad18a4e7af9b5f0b6984f - languageName: node - linkType: hard - "exit@npm:^0.1.2": version: 0.1.2 resolution: "exit@npm:0.1.2" @@ -7271,7 +6875,7 @@ __metadata: languageName: node linkType: hard -"extend@npm:^3.0.0, extend@npm:~3.0.2": +"extend@npm:^3.0.0": version: 3.0.2 resolution: "extend@npm:3.0.2" checksum: a50a8309ca65ea5d426382ff09f33586527882cf532931cb08ca786ea3146c0553310bda688710ff61d7668eba9f96b923fe1420cdf56a2c3eaf30fcab87b515 @@ -7294,23 +6898,6 @@ __metadata: languageName: node linkType: hard -"extract-zip@npm:2.0.1": - version: 2.0.1 - resolution: "extract-zip@npm:2.0.1" - dependencies: - "@types/yauzl": ^2.9.1 - debug: ^4.1.1 - get-stream: ^5.1.0 - yauzl: ^2.10.0 - dependenciesMeta: - "@types/yauzl": - optional: true - bin: - extract-zip: cli.js - checksum: 8cbda9debdd6d6980819cc69734d874ddd71051c9fe5bde1ef307ebcedfe949ba57b004894b585f758b7c9eeeea0e3d87f2dda89b7d25320459c2c9643ebb635 - languageName: node - linkType: hard - "extsprintf@npm:1.3.0": version: 1.3.0 resolution: "extsprintf@npm:1.3.0" @@ -7428,15 +7015,6 @@ __metadata: languageName: node linkType: hard -"figures@npm:^3.2.0": - version: 3.2.0 - resolution: "figures@npm:3.2.0" - dependencies: - escape-string-regexp: ^1.0.5 - checksum: 85a6ad29e9aca80b49b817e7c89ecc4716ff14e3779d9835af554db91bac41c0f289c418923519392a1e582b4d10482ad282021330cd045bb7b80c84152f2a2b - languageName: node - linkType: hard - "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -7508,16 +7086,6 @@ __metadata: languageName: node linkType: hard -"find-up@npm:5.0.0, find-up@npm:^5.0.0": - version: 5.0.0 - resolution: "find-up@npm:5.0.0" - dependencies: - locate-path: ^6.0.0 - path-exists: ^4.0.0 - checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 - languageName: node - linkType: hard - "find-up@npm:^1.0.0": version: 1.1.2 resolution: "find-up@npm:1.1.2" @@ -7538,6 +7106,16 @@ __metadata: languageName: node linkType: hard +"find-up@npm:^5.0.0": + version: 5.0.0 + resolution: "find-up@npm:5.0.0" + dependencies: + locate-path: ^6.0.0 + path-exists: ^4.0.0 + checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 + languageName: node + linkType: hard + "findup-sync@npm:^2.0.0": version: 2.0.0 resolution: "findup-sync@npm:2.0.0" @@ -7592,15 +7170,6 @@ __metadata: languageName: node linkType: hard -"flat@npm:^5.0.2": - version: 5.0.2 - resolution: "flat@npm:5.0.2" - bin: - flat: cli.js - checksum: 12a1536ac746db74881316a181499a78ef953632ddd28050b7a3a43c62ef5462e3357c8c29d76072bb635f147f7a9a1f0c02efef6b4be28f8db62ceb3d5c7f5d - languageName: node - linkType: hard - "flatted@npm:^3.1.0": version: 3.2.7 resolution: "flatted@npm:3.2.7" @@ -7635,7 +7204,7 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.14.4": +"follow-redirects@npm:^1.14.4": version: 1.15.1 resolution: "follow-redirects@npm:1.15.1" peerDependenciesMeta: @@ -7661,13 +7230,6 @@ __metadata: languageName: node linkType: hard -"forever-agent@npm:~0.6.1": - version: 0.6.1 - resolution: "forever-agent@npm:0.6.1" - checksum: 766ae6e220f5fe23676bb4c6a99387cec5b7b62ceb99e10923376e27bfea72f3c3aeec2ba5f45f3f7ba65d6616965aa7c20b15002b6860833bb6e394dea546a8 - languageName: node - linkType: hard - "form-data-encoder@npm:^2.0.1": version: 2.1.0 resolution: "form-data-encoder@npm:2.1.0" @@ -7697,17 +7259,6 @@ __metadata: languageName: node linkType: hard -"form-data@npm:~2.3.2": - version: 2.3.3 - resolution: "form-data@npm:2.3.3" - dependencies: - asynckit: ^0.4.0 - combined-stream: ^1.0.6 - mime-types: ^2.1.12 - checksum: 10c1780fa13dbe1ff3100114c2ce1f9307f8be10b14bf16e103815356ff567b6be39d70fc4a40f8990b9660012dc24b0f5e1dde1b6426166eb23a445ba068ca3 - languageName: node - linkType: hard - "formdata-polyfill@npm:^4.0.10": version: 4.0.10 resolution: "formdata-polyfill@npm:4.0.10" @@ -7749,7 +7300,6 @@ __metadata: "@types/gulp-rename": 2.0.1 "@typescript-eslint/parser": ^5.46.1 cross-env: 7.0.3 - cypress: 10.3.0 execa: 5.1.1 gulp: 4.0.2 gulp-cssnano: 2.1.3 @@ -7757,7 +7307,6 @@ __metadata: gulp-replace: 1.1.3 gulp-terser: 2.1.0 js-yaml: 4.1.0 - start-server-and-test: 1.14.0 typescript: ^4.9.4 languageName: unknown linkType: soft @@ -7778,13 +7327,6 @@ __metadata: languageName: node linkType: hard -"from@npm:~0": - version: 0.1.7 - resolution: "from@npm:0.1.7" - checksum: b85125b7890489656eb2e4f208f7654a93ec26e3aefaf3bbbcc0d496fc1941e4405834fcc9fe7333192aa2187905510ace70417bbf9ac6f6f4784a731d986939 - languageName: node - linkType: hard - "fs-constants@npm:^1.0.0": version: 1.0.0 resolution: "fs-constants@npm:1.0.0" @@ -7803,18 +7345,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^9.1.0": - version: 9.1.0 - resolution: "fs-extra@npm:9.1.0" - dependencies: - at-least-node: ^1.0.0 - graceful-fs: ^4.2.0 - jsonfile: ^6.0.1 - universalify: ^2.0.0 - checksum: ba71ba32e0faa74ab931b7a0031d1523c66a73e225de7426e275e238e312d07313d2da2d33e34a52aa406c8763ade5712eb3ec9ba4d9edce652bcacdc29e6b20 - languageName: node - linkType: hard - "fs-extra@npm:~7.0.1": version: 7.0.1 resolution: "fs-extra@npm:7.0.1" @@ -8021,7 +7551,7 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^5.0.0, get-stream@npm:^5.1.0": +"get-stream@npm:^5.1.0": version: 5.2.0 resolution: "get-stream@npm:5.2.0" dependencies: @@ -8054,15 +7584,6 @@ __metadata: languageName: node linkType: hard -"getos@npm:^3.2.1": - version: 3.2.1 - resolution: "getos@npm:3.2.1" - dependencies: - async: ^3.2.0 - checksum: 42fd78a66d47cebd3e09de5566cc0044e034b08f4a000a310dbd89a77b02c65d8f4002554bfa495ea5bdc4fa9d515f5ac785a7cc474ba45383cc697f865eeaf1 - languageName: node - linkType: hard - "getpass@npm:^0.1.1": version: 0.1.7 resolution: "getpass@npm:0.1.7" @@ -8139,20 +7660,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:7.2.0": - version: 7.2.0 - resolution: "glob@npm:7.2.0" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^3.0.4 - once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: 78a8ea942331f08ed2e055cb5b9e40fe6f46f579d7fd3d694f3412fe5db23223d29b7fee1575440202e9a7ff9a72ab106a39fee39934c7bedafe5e5f8ae20134 - languageName: node - linkType: hard - "glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.2.0": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -8180,15 +7687,6 @@ __metadata: languageName: node linkType: hard -"global-dirs@npm:^3.0.0": - version: 3.0.0 - resolution: "global-dirs@npm:3.0.0" - dependencies: - ini: 2.0.0 - checksum: 953c17cf14bf6ee0e2100ae82a0d779934eed8a3ec5c94a7a4f37c5b3b592c31ea015fb9a15cf32484de13c79f4a814f3015152f3e1d65976cfbe47c1bfe4a88 - languageName: node - linkType: hard - "global-modules@npm:^1.0.0": version: 1.0.0 resolution: "global-modules@npm:1.0.0" @@ -8533,15 +8031,6 @@ __metadata: languageName: node linkType: hard -"he@npm:1.2.0": - version: 1.2.0 - resolution: "he@npm:1.2.0" - bin: - he: bin/he - checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7 - languageName: node - linkType: hard - "highlight.js@npm:^10.7.1": version: 10.7.3 resolution: "highlight.js@npm:10.7.3" @@ -8730,17 +8219,6 @@ __metadata: languageName: node linkType: hard -"http-signature@npm:~1.3.6": - version: 1.3.6 - resolution: "http-signature@npm:1.3.6" - dependencies: - assert-plus: ^1.0.0 - jsprim: ^2.0.2 - sshpk: ^1.14.1 - checksum: 10be2af4764e71fee0281392937050201ee576ac755c543f570d6d87134ce5e858663fe999a7adb3e4e368e1e356d0d7fec6b9542295b875726ff615188e7a0c - languageName: node - linkType: hard - "http2-wrapper@npm:^1.0.0-beta.5.2": version: 1.0.3 resolution: "http2-wrapper@npm:1.0.3" @@ -8780,13 +8258,6 @@ __metadata: languageName: node linkType: hard -"human-signals@npm:^1.1.1": - version: 1.1.1 - resolution: "human-signals@npm:1.1.1" - checksum: d587647c9e8ec24e02821b6be7de5a0fc37f591f6c4e319b3054b43fd4c35a70a94c46fc74d8c1a43c47fde157d23acd7421f375e1c1365b09a16835b8300205 - languageName: node - linkType: hard - "human-signals@npm:^2.1.0": version: 2.1.0 resolution: "human-signals@npm:2.1.0" @@ -8960,13 +8431,6 @@ __metadata: languageName: node linkType: hard -"ini@npm:2.0.0": - version: 2.0.0 - resolution: "ini@npm:2.0.0" - checksum: e7aadc5fb2e4aefc666d74ee2160c073995a4061556b1b5b4241ecb19ad609243b9cceafe91bae49c219519394bbd31512516cb22a3b1ca6e66d869e0447e84e - languageName: node - linkType: hard - "ini@npm:^1.3.4, ini@npm:~1.3.0": version: 1.3.8 resolution: "ini@npm:1.3.8" @@ -9181,17 +8645,6 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:^3.0.0": - version: 3.0.0 - resolution: "is-ci@npm:3.0.0" - dependencies: - ci-info: ^3.1.1 - bin: - is-ci: bin.js - checksum: 4b45aef32dd42dcb1f6fb3cd4b3a7ee7e18ea47516d2129005f46c3f36983506bb471382bac890973cf48a2f60d926a24461674ca2d9dc10744d82d4a876c26b - languageName: node - linkType: hard - "is-core-module@npm:^2.1.0, is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": version: 2.10.0 resolution: "is-core-module@npm:2.10.0" @@ -9333,16 +8786,6 @@ __metadata: languageName: node linkType: hard -"is-installed-globally@npm:~0.4.0": - version: 0.4.0 - resolution: "is-installed-globally@npm:0.4.0" - dependencies: - global-dirs: ^3.0.0 - is-path-inside: ^3.0.2 - checksum: 3359840d5982d22e9b350034237b2cda2a12bac1b48a721912e1ab8e0631dd07d45a2797a120b7b87552759a65ba03e819f1bd63f2d7ab8657ec0b44ee0bf399 - languageName: node - linkType: hard - "is-ip@npm:^3.1.0": version: 3.1.0 resolution: "is-ip@npm:3.1.0" @@ -9412,7 +8855,7 @@ __metadata: languageName: node linkType: hard -"is-path-inside@npm:^3.0.2, is-path-inside@npm:^3.0.3": +"is-path-inside@npm:^3.0.3": version: 3.0.3 resolution: "is-path-inside@npm:3.0.3" checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 @@ -9426,13 +8869,6 @@ __metadata: languageName: node linkType: hard -"is-plain-obj@npm:^2.1.0": - version: 2.1.0 - resolution: "is-plain-obj@npm:2.1.0" - checksum: cec9100678b0a9fe0248a81743041ed990c2d4c99f893d935545cfbc42876cbe86d207f3b895700c690ad2fa520e568c44afc1605044b535a7820c1d40e38daa - languageName: node - linkType: hard - "is-plain-object@npm:^2.0.1, is-plain-object@npm:^2.0.3, is-plain-object@npm:^2.0.4": version: 2.0.4 resolution: "is-plain-object@npm:2.0.4" @@ -9548,7 +8984,7 @@ __metadata: languageName: node linkType: hard -"is-typedarray@npm:^1.0.0, is-typedarray@npm:~1.0.0": +"is-typedarray@npm:^1.0.0": version: 1.0.0 resolution: "is-typedarray@npm:1.0.0" checksum: 3508c6cd0a9ee2e0df2fa2e9baabcdc89e911c7bd5cf64604586697212feec525aa21050e48affb5ffc3df20f0f5d2e2cf79b08caa64e1ccc9578e251763aef7 @@ -9645,13 +9081,6 @@ __metadata: languageName: node linkType: hard -"isstream@npm:~0.1.2": - version: 0.1.2 - resolution: "isstream@npm:0.1.2" - checksum: 1eb2fe63a729f7bdd8a559ab552c69055f4f48eb5c2f03724430587c6f450783c8f1cd936c1c952d0a927925180fcc892ebd5b174236cf1065d4bd5bdb37e963 - languageName: node - linkType: hard - "istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": version: 3.2.0 resolution: "istanbul-lib-coverage@npm:3.2.0" @@ -10270,19 +9699,6 @@ __metadata: languageName: node linkType: hard -"joi@npm:^17.4.0": - version: 17.4.2 - resolution: "joi@npm:17.4.2" - dependencies: - "@hapi/hoek": ^9.0.0 - "@hapi/topo": ^5.0.0 - "@sideway/address": ^4.1.0 - "@sideway/formula": ^3.0.0 - "@sideway/pinpoint": ^2.0.0 - checksum: 977ada1f9d38c2762689b61cec1272176968ccea731a16b71713ebaa067f140460e0b6f7eccff6fc12206fddce22e7f4ed74724651bc1b24b1e26d43280633d0 - languageName: node - linkType: hard - "jpeg-js@npm:^0.4.1": version: 0.4.4 resolution: "jpeg-js@npm:0.4.4" @@ -10528,7 +9944,7 @@ __metadata: languageName: node linkType: hard -"json-stringify-safe@npm:^5.0.1, json-stringify-safe@npm:~5.0.1": +"json-stringify-safe@npm:^5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" checksum: 48ec0adad5280b8a96bb93f4563aa1667fd7a36334f79149abd42446d0989f2ddc58274b479f4819f1f00617957e6344c886c55d05a4e15ebb4ab931e4a6a8ee @@ -10593,19 +10009,6 @@ __metadata: languageName: node linkType: hard -"jsonfile@npm:^6.0.1": - version: 6.1.0 - resolution: "jsonfile@npm:6.1.0" - dependencies: - graceful-fs: ^4.1.6 - universalify: ^2.0.0 - dependenciesMeta: - graceful-fs: - optional: true - checksum: 7af3b8e1ac8fe7f1eccc6263c6ca14e1966fcbc74b618d3c78a0a2075579487547b94f72b7a1114e844a1e15bb00d440e5d1720bfc4612d790a6f285d5ea8354 - languageName: node - linkType: hard - "jsonld@npm:6.0.0": version: 6.0.0 resolution: "jsonld@npm:6.0.0" @@ -10630,18 +10033,6 @@ __metadata: languageName: node linkType: hard -"jsprim@npm:^2.0.2": - version: 2.0.2 - resolution: "jsprim@npm:2.0.2" - dependencies: - assert-plus: 1.0.0 - extsprintf: 1.3.0 - json-schema: 0.4.0 - verror: 1.10.0 - checksum: d175f6b1991e160cb0aa39bc857da780e035611986b5492f32395411879fdaf4e513d98677f08f7352dac93a16b66b8361c674b86a3fa406e2e7af6b26321838 - languageName: node - linkType: hard - "jsrsasign@npm:10.5.25": version: 10.5.25 resolution: "jsrsasign@npm:10.5.25" @@ -10978,13 +10369,6 @@ __metadata: languageName: node linkType: hard -"lazy-ass@npm:1.6.0, lazy-ass@npm:^1.6.0": - version: 1.6.0 - resolution: "lazy-ass@npm:1.6.0" - checksum: 5a3ebb17915b03452320804466345382a6c25ac782ec4874fecdb2385793896cd459be2f187dc7def8899180c32ee0ab9a1aa7fe52193ac3ff3fe29bb0591729 - languageName: node - linkType: hard - "lazystream@npm:^1.0.0": version: 1.0.0 resolution: "lazystream@npm:1.0.0" @@ -11062,23 +10446,6 @@ __metadata: languageName: node linkType: hard -"listr2@npm:^3.8.3": - version: 3.11.0 - resolution: "listr2@npm:3.11.0" - dependencies: - cli-truncate: ^2.1.0 - colorette: ^1.2.2 - log-update: ^4.0.0 - p-map: ^4.0.0 - rxjs: ^6.6.7 - through: ^2.3.8 - wrap-ansi: ^7.0.0 - peerDependencies: - enquirer: ">= 2.3.0 < 3" - checksum: 6533edd4304f5c113198db42b87ddb17fb3dc2167017b2d63c30df50c1277865fc0eed99c4f4c8abdfc5a960b997049dba14a65180fbf2851ad82f2259038a0c - languageName: node - linkType: hard - "load-json-file@npm:^1.0.0": version: 1.1.0 resolution: "load-json-file@npm:1.1.0" @@ -11226,13 +10593,6 @@ __metadata: languageName: node linkType: hard -"lodash.once@npm:^4.1.1": - version: 4.1.1 - resolution: "lodash.once@npm:4.1.1" - checksum: d768fa9f9b4e1dc6453be99b753906f58990e0c45e7b2ca5a3b40a33111e5d17f6edf2f768786e2716af90a8e78f8f91431ab8435f761fef00f9b0c256f6d245 - languageName: node - linkType: hard - "lodash.pick@npm:^4.2.1": version: 4.4.0 resolution: "lodash.pick@npm:4.4.0" @@ -11282,7 +10642,7 @@ __metadata: languageName: node linkType: hard -"log-symbols@npm:4.1.0, log-symbols@npm:^4.0.0": +"log-symbols@npm:^4.0.0": version: 4.1.0 resolution: "log-symbols@npm:4.1.0" dependencies: @@ -11292,18 +10652,6 @@ __metadata: languageName: node linkType: hard -"log-update@npm:^4.0.0": - version: 4.0.0 - resolution: "log-update@npm:4.0.0" - dependencies: - ansi-escapes: ^4.3.0 - cli-cursor: ^3.1.0 - slice-ansi: ^4.0.0 - wrap-ansi: ^6.2.0 - checksum: ae2f85bbabc1906034154fb7d4c4477c79b3e703d22d78adee8b3862fa913942772e7fa11713e3d96fb46de4e3cabefbf5d0a544344f03b58d3c4bff52aa9eb2 - languageName: node - linkType: hard - "long@npm:^4.0.0": version: 4.0.0 resolution: "long@npm:4.0.0" @@ -11462,13 +10810,6 @@ __metadata: languageName: node linkType: hard -"map-stream@npm:~0.1.0": - version: 0.1.0 - resolution: "map-stream@npm:0.1.0" - checksum: 38abbe4eb883888031e6b2fc0630bc583c99396be16b8ace5794b937b682a8a081f03e8b15bfd4914d1bc88318f0e9ac73ba3512ae65955cd449f63256ddb31d - languageName: node - linkType: hard - "map-visit@npm:^1.0.0": version: 1.0.0 resolution: "map-visit@npm:1.0.0" @@ -11610,7 +10951,7 @@ __metadata: languageName: node linkType: hard -"mime-types@npm:2.1.35, mime-types@npm:^2.1.12, mime-types@npm:^2.1.18, mime-types@npm:~2.1.19, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": +"mime-types@npm:2.1.35, mime-types@npm:^2.1.12, mime-types@npm:^2.1.18, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": version: 2.1.35 resolution: "mime-types@npm:2.1.35" dependencies: @@ -11661,15 +11002,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:5.0.1": - version: 5.0.1 - resolution: "minimatch@npm:5.0.1" - dependencies: - brace-expansion: ^2.0.1 - checksum: b34b98463da4754bc526b244d680c69d4d6089451ebe512edaf6dd9eeed0279399cfa3edb19233513b8f830bf4bfcad911dddcdf125e75074100d52f724774f0 - languageName: node - linkType: hard - "minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -11831,38 +11163,6 @@ __metadata: languageName: node linkType: hard -"mocha@npm:10.2.0": - version: 10.2.0 - resolution: "mocha@npm:10.2.0" - dependencies: - ansi-colors: 4.1.1 - browser-stdout: 1.3.1 - chokidar: 3.5.3 - debug: 4.3.4 - diff: 5.0.0 - escape-string-regexp: 4.0.0 - find-up: 5.0.0 - glob: 7.2.0 - he: 1.2.0 - js-yaml: 4.1.0 - log-symbols: 4.1.0 - minimatch: 5.0.1 - ms: 2.1.3 - nanoid: 3.3.3 - serialize-javascript: 6.0.0 - strip-json-comments: 3.1.1 - supports-color: 8.1.1 - workerpool: 6.2.1 - yargs: 16.2.0 - yargs-parser: 20.2.4 - yargs-unparser: 2.0.0 - bin: - _mocha: bin/_mocha - mocha: bin/mocha.js - checksum: 406c45eab122ffd6ea2003c2f108b2bc35ba036225eee78e0c784b6fa2c7f34e2b13f1dbacef55a4fdf523255d76e4f22d1b5aacda2394bd11666febec17c719 - languageName: node - linkType: hard - "mock-socket@npm:^9.0.8, mock-socket@npm:^9.1.0": version: 9.1.5 resolution: "mock-socket@npm:9.1.5" @@ -11884,7 +11184,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:2.1.3, ms@npm:^2.0.0, ms@npm:^2.1.1": +"ms@npm:^2.0.0, ms@npm:^2.1.1": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -11983,15 +11283,6 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:3.3.3": - version: 3.3.3 - resolution: "nanoid@npm:3.3.3" - bin: - nanoid: bin/nanoid.cjs - checksum: ada019402a07464a694553c61d2dca8a4353645a7d92f2830f0d487fedff403678a0bee5323a46522752b2eab95a0bc3da98b6cccaa7c0c55cd9975130e6d6f0 - languageName: node - linkType: hard - "nanoid@npm:^3.3.4": version: 3.3.4 resolution: "nanoid@npm:3.3.4" @@ -12352,7 +11643,7 @@ __metadata: languageName: node linkType: hard -"npm-run-path@npm:^4.0.0, npm-run-path@npm:^4.0.1": +"npm-run-path@npm:^4.0.1": version: 4.0.1 resolution: "npm-run-path@npm:4.0.1" dependencies: @@ -12577,7 +11868,7 @@ __metadata: languageName: node linkType: hard -"onetime@npm:^5.1.0, onetime@npm:^5.1.2": +"onetime@npm:^5.1.2": version: 5.1.2 resolution: "onetime@npm:5.1.2" dependencies: @@ -12664,13 +11955,6 @@ __metadata: languageName: node linkType: hard -"ospath@npm:^1.2.2": - version: 1.2.2 - resolution: "ospath@npm:1.2.2" - checksum: 505f48a4f4f1c557d6c656ec985707726e3714721680139be037613e903aa8c8fa4ddd8d1342006f9b2dc0065e6e20f8b7bea2ee05354f31257044790367b347 - languageName: node - linkType: hard - "p-cancelable@npm:^2.0.0": version: 2.1.1 resolution: "p-cancelable@npm:2.1.1" @@ -13002,15 +12286,6 @@ __metadata: languageName: node linkType: hard -"pause-stream@npm:0.0.11": - version: 0.0.11 - resolution: "pause-stream@npm:0.0.11" - dependencies: - through: ~2.3 - checksum: 3c4a14052a638b92e0c96eb00c0d7977df7f79ea28395250c525d197f1fc02d34ce1165d5362e2e6ebbb251524b94a76f3f0d4abc39ab8b016d97449fe15583c - languageName: node - linkType: hard - "peek-readable@npm:^5.0.0": version: 5.0.0 resolution: "peek-readable@npm:5.0.0" @@ -13025,13 +12300,6 @@ __metadata: languageName: node linkType: hard -"performance-now@npm:^2.1.0": - version: 2.1.0 - resolution: "performance-now@npm:2.1.0" - checksum: 534e641aa8f7cba160f0afec0599b6cecefbb516a2e837b512be0adbe6c1da5550e89c78059c7fabc5c9ffdf6627edabe23eb7c518c4500067a898fa65c2b550 - languageName: node - linkType: hard - "pg-connection-string@npm:^2.5.0": version: 2.5.0 resolution: "pg-connection-string@npm:2.5.0" @@ -13125,7 +12393,7 @@ __metadata: languageName: node linkType: hard -"pify@npm:^2.0.0, pify@npm:^2.2.0, pify@npm:^2.3.0": +"pify@npm:^2.0.0, pify@npm:^2.3.0": version: 2.3.0 resolution: "pify@npm:2.3.0" checksum: 9503aaeaf4577acc58642ad1d25c45c6d90288596238fb68f82811c08104c800e5a7870398e9f015d82b44ecbcbef3dc3d4251a1cbb582f6e5959fe09884b2ba @@ -13627,13 +12895,6 @@ __metadata: languageName: node linkType: hard -"pretty-bytes@npm:^5.6.0": - version: 5.6.0 - resolution: "pretty-bytes@npm:5.6.0" - checksum: 9c082500d1e93434b5b291bd651662936b8bd6204ec9fa17d563116a192d6d86b98f6d328526b4e8d783c07d5499e2614a807520249692da9ec81564b2f439cd - languageName: node - linkType: hard - "pretty-format@npm:^27.0.0, pretty-format@npm:^27.5.1": version: 27.5.1 resolution: "pretty-format@npm:27.5.1" @@ -13769,24 +13030,6 @@ __metadata: languageName: node linkType: hard -"proxy-from-env@npm:1.0.0": - version: 1.0.0 - resolution: "proxy-from-env@npm:1.0.0" - checksum: 292e28d1de0c315958d71d8315eb546dd3cd8c8cbc2dab7c54eeb9f5c17f421771964ad0b5e1f77011bab2305bdae42e1757ce33bdb1ccc3e87732322a8efcf1 - languageName: node - linkType: hard - -"ps-tree@npm:1.2.0": - version: 1.2.0 - resolution: "ps-tree@npm:1.2.0" - dependencies: - event-stream: =3.3.4 - bin: - ps-tree: ./bin/ps-tree.js - checksum: e635dd00f53d30d31696cf5f95b3a8dbdf9b1aeb36d4391578ce8e8cd22949b7c5536c73b0dc18c78615ea3ddd4be96101166be59ca2e3e3cb1e2f79ba3c7f98 - languageName: node - linkType: hard - "pseudomap@npm:^1.0.2": version: 1.0.2 resolution: "pseudomap@npm:1.0.2" @@ -13794,7 +13037,7 @@ __metadata: languageName: node linkType: hard -"psl@npm:^1.1.28, psl@npm:^1.1.33": +"psl@npm:^1.1.33": version: 1.9.0 resolution: "psl@npm:1.9.0" checksum: 20c4277f640c93d393130673f392618e9a8044c6c7bf61c53917a0fddb4952790f5f362c6c730a9c32b124813e173733f9895add8d26f566ed0ea0654b2e711d @@ -14021,13 +13264,6 @@ __metadata: languageName: node linkType: hard -"qs@npm:~6.5.2": - version: 6.5.2 - resolution: "qs@npm:6.5.2" - checksum: 24af7b9928ba2141233fba2912876ff100403dba1b08b20c3b490da9ea6c636760445ea2211a079e7dfa882a5cf8f738337b3748c8bdd0f93358fa8881d2db8f - languageName: node - linkType: hard - "query-string@npm:^4.1.0": version: 4.3.4 resolution: "query-string@npm:4.3.4" @@ -14089,15 +13325,6 @@ __metadata: languageName: node linkType: hard -"randombytes@npm:^2.1.0": - version: 2.1.0 - resolution: "randombytes@npm:2.1.0" - dependencies: - safe-buffer: ^5.1.0 - checksum: d779499376bd4cbb435ef3ab9a957006c8682f343f14089ed5f27764e4645114196e75b7f6abf1cbd84fd247c0cb0651698444df8c9bf30e62120fbbc52269d6 - languageName: node - linkType: hard - "ratelimiter@npm:3.4.1": version: 3.4.1 resolution: "ratelimiter@npm:3.4.1" @@ -14483,15 +13710,6 @@ __metadata: languageName: node linkType: hard -"request-progress@npm:^3.0.0": - version: 3.0.0 - resolution: "request-progress@npm:3.0.0" - dependencies: - throttleit: ^1.0.0 - checksum: 6ea1761dcc8a8b7b5894afd478c0286aa31bd69438d7050294bd4fd0d0b3e09b5cde417d38deef9c49809039c337d8744e4bb49d8632b0c3e4ffa5e8a687e0fd - languageName: node - linkType: hard - "require-all@npm:3.0.0": version: 3.0.0 resolution: "require-all@npm:3.0.0" @@ -14680,16 +13898,6 @@ __metadata: languageName: node linkType: hard -"restore-cursor@npm:^3.1.0": - version: 3.1.0 - resolution: "restore-cursor@npm:3.1.0" - dependencies: - onetime: ^5.1.0 - signal-exit: ^3.0.2 - checksum: f877dd8741796b909f2a82454ec111afb84eb45890eb49ac947d87991379406b3b83ff9673a46012fca0d7844bb989f45cc5b788254cf1a39b6b5a9659de0630 - languageName: node - linkType: hard - "ret@npm:~0.1.10": version: 0.1.15 resolution: "ret@npm:0.1.15" @@ -14755,24 +13963,6 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:^6.6.7": - version: 6.6.7 - resolution: "rxjs@npm:6.6.7" - dependencies: - tslib: ^1.9.0 - checksum: bc334edef1bb8bbf56590b0b25734ba0deaf8825b703256a93714308ea36dff8a11d25533671adf8e104e5e8f256aa6fdfe39b2e248cdbd7a5f90c260acbbd1b - languageName: node - linkType: hard - -"rxjs@npm:^7.1.0": - version: 7.3.0 - resolution: "rxjs@npm:7.3.0" - dependencies: - tslib: ~2.1.0 - checksum: e63adb8808ea6c299a020d56d2af92bcf71efe641adf838499932e29b8f5fd5ff00873653ad48ba3ecf6c9fc11c3c595acf995e8d456f9d8cb85c7d37a1fd72e - languageName: node - linkType: hard - "safari-14-idb-fix@npm:^3.0.0": version: 3.0.0 resolution: "safari-14-idb-fix@npm:3.0.0" @@ -14780,7 +13970,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -14955,15 +14145,6 @@ __metadata: languageName: node linkType: hard -"serialize-javascript@npm:6.0.0": - version: 6.0.0 - resolution: "serialize-javascript@npm:6.0.0" - dependencies: - randombytes: ^2.1.0 - checksum: 56f90b562a1bdc92e55afb3e657c6397c01a902c588c0fe3d4c490efdcc97dcd2a3074ba12df9e94630f33a5ce5b76a74784a7041294628a6f4306e0ec84bf93 - languageName: node - linkType: hard - "set-blocking@npm:^2.0.0": version: 2.0.0 resolution: "set-blocking@npm:2.0.0" @@ -15129,28 +14310,6 @@ __metadata: languageName: node linkType: hard -"slice-ansi@npm:^3.0.0": - version: 3.0.0 - resolution: "slice-ansi@npm:3.0.0" - dependencies: - ansi-styles: ^4.0.0 - astral-regex: ^2.0.0 - is-fullwidth-code-point: ^3.0.0 - checksum: 5ec6d022d12e016347e9e3e98a7eb2a592213a43a65f1b61b74d2c78288da0aded781f665807a9f3876b9daa9ad94f64f77d7633a0458876c3a4fdc4eb223f24 - languageName: node - linkType: hard - -"slice-ansi@npm:^4.0.0": - version: 4.0.0 - resolution: "slice-ansi@npm:4.0.0" - dependencies: - ansi-styles: ^4.0.0 - astral-regex: ^2.0.0 - is-fullwidth-code-point: ^3.0.0 - checksum: 4a82d7f085b0e1b070e004941ada3c40d3818563ac44766cca4ceadd2080427d337554f9f99a13aaeb3b4a94d9964d9466c807b3d7b7541d1ec37ee32d308756 - languageName: node - linkType: hard - "smart-buffer@npm:^4.2.0": version: 4.2.0 resolution: "smart-buffer@npm:4.2.0" @@ -15362,15 +14521,6 @@ __metadata: languageName: node linkType: hard -"split@npm:0.3": - version: 0.3.3 - resolution: "split@npm:0.3.3" - dependencies: - through: 2 - checksum: 2e076634c9637cfdc54ab4387b6a243b8c33b360874a25adf6f327a5647f07cb3bf1c755d515248eb3afee4e382278d01f62c62d87263c118f28065b86f74f02 - languageName: node - linkType: hard - "sprintf-js@npm:1.1.2": version: 1.1.2 resolution: "sprintf-js@npm:1.1.2" @@ -15438,25 +14588,6 @@ __metadata: languageName: node linkType: hard -"start-server-and-test@npm:1.14.0": - version: 1.14.0 - resolution: "start-server-and-test@npm:1.14.0" - dependencies: - bluebird: 3.7.2 - check-more-types: 2.24.0 - debug: 4.3.2 - execa: 5.1.1 - lazy-ass: 1.6.0 - ps-tree: 1.2.0 - wait-on: 6.0.0 - bin: - server-test: src/bin/start.js - start-server-and-test: src/bin/start.js - start-test: src/bin/start.js - checksum: 8437f5fc39bb47dd684b94023bab654703abc4890d08f005c3d86df620b2cdaac03f6e3bb21792a93209f1a70c8bb500d82fe4025a356da45fc060f2a80374e1 - languageName: node - linkType: hard - "static-extend@npm:^0.1.1": version: 0.1.2 resolution: "static-extend@npm:0.1.2" @@ -15481,15 +14612,6 @@ __metadata: languageName: node linkType: hard -"stream-combiner@npm:~0.0.4": - version: 0.0.4 - resolution: "stream-combiner@npm:0.0.4" - dependencies: - duplexer: ~0.1.1 - checksum: 844b622cfe8b9de45a6007404f613b60aaf85200ab9862299066204242f89a7c8033b1c356c998aa6cfc630f6cd9eba119ec1c6dc1f93e245982be4a847aee7d - languageName: node - linkType: hard - "stream-exhaust@npm:^1.0.1": version: 1.0.2 resolution: "stream-exhaust@npm:1.0.2" @@ -15695,7 +14817,7 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1, strip-json-comments@npm:~3.1.1": +"strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1, strip-json-comments@npm:~3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 @@ -15754,15 +14876,6 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:8.1.1, supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": - version: 8.1.1 - resolution: "supports-color@npm:8.1.1" - dependencies: - has-flag: ^4.0.0 - checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 - languageName: node - linkType: hard - "supports-color@npm:^2.0.0": version: 2.0.0 resolution: "supports-color@npm:2.0.0" @@ -15797,6 +14910,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:^8.0.0": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" + dependencies: + has-flag: ^4.0.0 + checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 + languageName: node + linkType: hard + "supports-hyperlinks@npm:^2.0.0": version: 2.2.0 resolution: "supports-hyperlinks@npm:2.2.0" @@ -16041,13 +15163,6 @@ __metadata: languageName: node linkType: hard -"throttleit@npm:^1.0.0": - version: 1.0.0 - resolution: "throttleit@npm:1.0.0" - checksum: 1b2db4d2454202d589e8236c07a69d2fab838876d370030ebea237c34c0a7d1d9cf11c29f994531ebb00efd31e9728291042b7754f2798a8352ec4463455b659 - languageName: node - linkType: hard - "through2-filter@npm:^3.0.0": version: 3.0.0 resolution: "through2-filter@npm:3.0.0" @@ -16077,7 +15192,7 @@ __metadata: languageName: node linkType: hard -"through@npm:2, through@npm:^2.3.8, through@npm:~2.3, through@npm:~2.3.1": +"through@npm:^2.3.8": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd @@ -16098,7 +15213,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:0.2.1, tmp@npm:~0.2.1": +"tmp@npm:0.2.1": version: 0.2.1 resolution: "tmp@npm:0.2.1" dependencies: @@ -16223,16 +15338,6 @@ __metadata: languageName: node linkType: hard -"tough-cookie@npm:~2.5.0": - version: 2.5.0 - resolution: "tough-cookie@npm:2.5.0" - dependencies: - psl: ^1.1.28 - punycode: ^2.1.1 - checksum: 16a8cd090224dd176eee23837cbe7573ca0fa297d7e468ab5e1c02d49a4e9a97bb05fef11320605eac516f91d54c57838a25864e8680e27b069a5231d8264977 - languageName: node - linkType: hard - "tr46@npm:^2.1.0": version: 2.1.0 resolution: "tr46@npm:2.1.0" @@ -16413,7 +15518,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.8.1, tslib@npm:^1.9.0": +"tslib@npm:^1.8.1": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: dbe628ef87f66691d5d2959b3e41b9ca0045c3ee3c7c7b906cc1e328b39f199bb1ad9e671c39025bd56122ac57dfbf7385a94843b1cc07c60a4db74795829acd @@ -16427,13 +15532,6 @@ __metadata: languageName: node linkType: hard -"tslib@npm:~2.1.0": - version: 2.1.0 - resolution: "tslib@npm:2.1.0" - checksum: aa189c8179de0427b0906da30926fd53c59d96ec239dff87d6e6bc831f608df0cbd6f77c61dabc074408bd0aa0b9ae4ec35cb2c15f729e32f37274db5730cb78 - languageName: node - linkType: hard - "tsscmp@npm:1.0.6": version: 1.0.6 resolution: "tsscmp@npm:1.0.6" @@ -16825,13 +15923,6 @@ __metadata: languageName: node linkType: hard -"universalify@npm:^2.0.0": - version: 2.0.0 - resolution: "universalify@npm:2.0.0" - checksum: 2406a4edf4a8830aa6813278bab1f953a8e40f2f63a37873ffa9a3bc8f9745d06cc8e88f3572cb899b7e509013f7f6fcc3e37e8a6d914167a5381d8440518c44 - languageName: node - linkType: hard - "unload@npm:2.3.1": version: 2.3.1 resolution: "unload@npm:2.3.1" @@ -16859,13 +15950,6 @@ __metadata: languageName: node linkType: hard -"untildify@npm:^4.0.0": - version: 4.0.0 - resolution: "untildify@npm:4.0.0" - checksum: 39ced9c418a74f73f0a56e1ba4634b4d959422dff61f4c72a8e39f60b99380c1b45ed776fbaa0a4101b157e4310d873ad7d114e8534ca02609b4916bb4187fb9 - languageName: node - linkType: hard - "update-browserslist-db@npm:^1.0.5": version: 1.0.5 resolution: "update-browserslist-db@npm:1.0.5" @@ -17219,21 +16303,6 @@ __metadata: languageName: node linkType: hard -"wait-on@npm:6.0.0": - version: 6.0.0 - resolution: "wait-on@npm:6.0.0" - dependencies: - axios: ^0.21.1 - joi: ^17.4.0 - lodash: ^4.17.21 - minimist: ^1.2.5 - rxjs: ^7.1.0 - bin: - wait-on: bin/wait-on - checksum: 6ae7bd2a933715c3b2f1c49f033d97c576b2c6a0257420d4c83964d2846c3967bfce33bc9af9a1a631ef38dfa6185be03cef57d2867c8c30c523278f964ac9e3 - languageName: node - linkType: hard - "walker@npm:^1.0.7": version: 1.0.8 resolution: "walker@npm:1.0.8" @@ -17448,13 +16517,6 @@ __metadata: languageName: node linkType: hard -"workerpool@npm:6.2.1": - version: 6.2.1 - resolution: "workerpool@npm:6.2.1" - checksum: c2c6eebbc5225f10f758d599a5c016fa04798bcc44e4c1dffb34050cd361d7be2e97891aa44419e7afe647b1f767b1dc0b85a5e046c409d890163f655028b09d - languageName: node - linkType: hard - "wrap-ansi@npm:^2.0.0": version: 2.1.0 resolution: "wrap-ansi@npm:2.1.0" @@ -17673,13 +16735,6 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:20.2.4": - version: 20.2.4 - resolution: "yargs-parser@npm:20.2.4" - checksum: d251998a374b2743a20271c2fd752b9fbef24eb881d53a3b99a7caa5e8227fcafd9abf1f345ac5de46435821be25ec12189a11030c12ee6481fef6863ed8b924 - languageName: node - linkType: hard - "yargs-parser@npm:20.x, yargs-parser@npm:^20.2.2, yargs-parser@npm:^20.2.3": version: 20.2.9 resolution: "yargs-parser@npm:20.2.9" @@ -17714,33 +16769,6 @@ __metadata: languageName: node linkType: hard -"yargs-unparser@npm:2.0.0": - version: 2.0.0 - resolution: "yargs-unparser@npm:2.0.0" - dependencies: - camelcase: ^6.0.0 - decamelize: ^4.0.0 - flat: ^5.0.2 - is-plain-obj: ^2.1.0 - checksum: 68f9a542c6927c3768c2f16c28f71b19008710abd6b8f8efbac6dcce26bbb68ab6503bed1d5994bdbc2df9a5c87c161110c1dfe04c6a3fe5c6ad1b0e15d9a8a3 - languageName: node - linkType: hard - -"yargs@npm:16.2.0, yargs@npm:^16.0.0, yargs@npm:^16.2.0": - version: 16.2.0 - resolution: "yargs@npm:16.2.0" - dependencies: - cliui: ^7.0.2 - escalade: ^3.1.1 - get-caller-file: ^2.0.5 - require-directory: ^2.1.1 - string-width: ^4.2.0 - y18n: ^5.0.5 - yargs-parser: ^20.2.2 - checksum: b14afbb51e3251a204d81937c86a7e9d4bdbf9a2bcee38226c900d00f522969ab675703bee2a6f99f8e20103f608382936034e64d921b74df82b63c07c5e8f59 - languageName: node - linkType: hard - "yargs@npm:^15.3.1": version: 15.4.1 resolution: "yargs@npm:15.4.1" @@ -17760,6 +16788,21 @@ __metadata: languageName: node linkType: hard +"yargs@npm:^16.0.0, yargs@npm:^16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: ^7.0.2 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.0 + y18n: ^5.0.5 + yargs-parser: ^20.2.2 + checksum: b14afbb51e3251a204d81937c86a7e9d4bdbf9a2bcee38226c900d00f522969ab675703bee2a6f99f8e20103f608382936034e64d921b74df82b63c07c5e8f59 + languageName: node + linkType: hard + "yargs@npm:^17.3.1": version: 17.5.1 resolution: "yargs@npm:17.5.1" @@ -17796,7 +16839,7 @@ __metadata: languageName: node linkType: hard -"yauzl@npm:^2.10.0, yauzl@npm:^2.4.2": +"yauzl@npm:^2.4.2": version: 2.10.0 resolution: "yauzl@npm:2.10.0" dependencies: