diff --git a/lib/mysql/interfaces/mysql-webhook-store-options.interface.ts b/lib/mysql/interfaces/mysql-webhook-store-options.interface.ts index c8101b9..8281066 100644 --- a/lib/mysql/interfaces/mysql-webhook-store-options.interface.ts +++ b/lib/mysql/interfaces/mysql-webhook-store-options.interface.ts @@ -25,8 +25,8 @@ export interface MySqlWebhookStoreOptions { * Apply the store's pending migrations at startup, one statement at a time under a lock (`GET_LOCK()`), so processes * that start together migrate once, and a run that failed resumes where it stopped. With `false`, startup fails with * a `WebhookSchemaError` while the schema is behind this version of the package: apply them with - * `npx nest-webhooks migrate`, or with your own migration tool (`MySqlWebhookStore.migrationStatements()`). Default: - * `true`, except when `NODE_ENV` is `production`. + * `npx @nestjs/webhooks migrate`, or with your own migration tool (`MySqlWebhookStore.migrationStatements()`). + * Default: `true`, except when `NODE_ENV` is `production`. */ migrate?: boolean; } diff --git a/lib/postgres/errors/webhook-schema.error.ts b/lib/postgres/errors/webhook-schema.error.ts index 4f6240a..c83bc77 100644 --- a/lib/postgres/errors/webhook-schema.error.ts +++ b/lib/postgres/errors/webhook-schema.error.ts @@ -10,7 +10,7 @@ import { WebhooksError } from '../../errors/webhooks.error.js'; * await app.init(); * } catch (error) { * if (error instanceof WebhookSchemaError) { - * console.error(`Run: npx nest-webhooks migrate --schema ${error.schema} (at ${error.version}, needs ${error.requiredVersion})`); + * console.error(`Run: npx @nestjs/webhooks migrate --schema ${error.schema} (at ${error.version}, needs ${error.requiredVersion})`); * } * throw error; * } diff --git a/lib/postgres/interfaces/postgres-webhook-store-options.interface.ts b/lib/postgres/interfaces/postgres-webhook-store-options.interface.ts index 0299ae4..b968438 100644 --- a/lib/postgres/interfaces/postgres-webhook-store-options.interface.ts +++ b/lib/postgres/interfaces/postgres-webhook-store-options.interface.ts @@ -22,7 +22,7 @@ export interface PostgresWebhookStoreOptions { /** * Apply the store's pending migrations at startup, in one transaction under an advisory lock, so processes that * start together migrate once. With `false`, startup fails with a `WebhookSchemaError` while the schema is behind - * this version of the package: apply them with `npx nest-webhooks migrate`, or with your own migration tool + * this version of the package: apply them with `npx @nestjs/webhooks migrate`, or with your own migration tool * (`PostgresWebhookStore.migrationSql()`). Default: `true`, except when `NODE_ENV` is `production`. */ migrate?: boolean; diff --git a/package-lock.json b/package-lock.json index 23b093b..850fc59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1187,9 +1187,9 @@ } }, "node_modules/@nestjs/store-kit": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nestjs/store-kit/-/store-kit-0.1.0.tgz", - "integrity": "sha512-gNDt5j/aXa3vuWx2Jsxy0mUsOiEWniPavO7CKMr/54f5lhtuyRDDQYzk6+Qos1fhbZNPLQE9o96DARg4jdqH+A==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nestjs/store-kit/-/store-kit-0.1.1.tgz", + "integrity": "sha512-5qv2adhhqLfwVVx3FvmCyeomFEbckg527p+D/fQWeAnrstlS+28dWZh0JwGpADyxCQL7P60thtqXA7LvcMbtRg==", "license": "MIT", "engines": { "node": ">=20.19.0" diff --git a/tests/mysql/migrations.spec.ts b/tests/mysql/migrations.spec.ts index 55857b3..5e80103 100644 --- a/tests/mysql/migrations.spec.ts +++ b/tests/mysql/migrations.spec.ts @@ -239,7 +239,7 @@ describe('a MySQL schema behind the code, and one ahead of it', () => { expect(error).toMatchObject({ name: 'WebhookSchemaError', schema: 'm_behind', version: 0, requiredVersion: 1 }); expect((error as Error).message).toBe( 'MySqlWebhookStore: schema "m_behind" is at version 0, and this version of @nestjs/webhooks needs version 1. Apply its migrations: ' + - 'set `migrate: true` to apply them at startup, run `npx nest-webhooks migrate --url --schema m_behind`, ' + + 'set `migrate: true` to apply them at startup, run `npx @nestjs/webhooks migrate --url --schema m_behind`, ' + "or apply `MySqlWebhookStore.migrationSql({ schema: 'm_behind', from: 0 })` with your migration tool.", ); await expect(behind.getEndpoint('any')).rejects.toThrow(WebhookSchemaError); diff --git a/tests/postgres/cli.spec.ts b/tests/postgres/cli.spec.ts index 48addf9..19385cc 100644 --- a/tests/postgres/cli.spec.ts +++ b/tests/postgres/cli.spec.ts @@ -31,7 +31,7 @@ describe('nest-webhooks', () => { it('prints its usage for --help, and on stderr, exiting with 1, for no command, an unknown one or an unknown option', async () => { const help = await run(['--help']); expect(help).toMatchObject({ code: 0, err: '' }); - expect(help.out).toMatch(/^Usage: nest-webhooks \[options\]/); + expect(help.out).toMatch(/^Usage: npx @nestjs\/webhooks \[options\]/); expect(help.out).toContain("\n\nPostgresWebhookStore's schema (@nestjs/webhooks/postgres) or MySqlWebhookStore's (@nestjs/webhooks/mysql):\n\n migrate "); expect(help.out).toContain('--schema The store\'s schema. Default: nest_webhooks'); expect(await run([])).toEqual({ code: 1, out: '', err: help.out }); @@ -40,12 +40,12 @@ describe('nest-webhooks', () => { }); it('needs the database for migrate and status: --url, else DATABASE_URL, of PostgreSQL or MySQL', async () => { - expect(await run(['migrate'])).toEqual({ code: 1, out: '', err: 'nest-webhooks migrate needs the database: pass --url, or set DATABASE_URL.\n' }); - expect((await run(['status'])).err).toBe('nest-webhooks status needs the database: pass --url, or set DATABASE_URL.\n'); + expect(await run(['migrate'])).toEqual({ code: 1, out: '', err: 'npx @nestjs/webhooks migrate needs the database: pass --url, or set DATABASE_URL.\n' }); + expect((await run(['status'])).err).toBe('npx @nestjs/webhooks status needs the database: pass --url, or set DATABASE_URL.\n'); expect(await run(['migrate', '--url', 'sqlite:///tmp/shop.db'])).toEqual({ code: 1, out: '', - err: 'nest-webhooks migrate takes a database URL that starts with postgres:// or postgresql:// or mysql://.\n', + err: 'npx @nestjs/webhooks migrate takes a database URL that starts with postgres:// or postgresql:// or mysql://.\n', }); }); diff --git a/tests/postgres/migrations.spec.ts b/tests/postgres/migrations.spec.ts index 83d899f..9ac3386 100644 --- a/tests/postgres/migrations.spec.ts +++ b/tests/postgres/migrations.spec.ts @@ -207,7 +207,7 @@ describe('a schema behind the code', () => { expect(error).toMatchObject({ name: 'WebhookSchemaError', schema: 'm_behind', version: 0, requiredVersion: 1 }); expect((error as Error).message).toBe( 'PostgresWebhookStore: schema "m_behind" is at version 0, and this version of @nestjs/webhooks needs version 1. Apply its migrations: ' + - 'set `migrate: true` to apply them at startup, run `npx nest-webhooks migrate --url --schema m_behind`, ' + + 'set `migrate: true` to apply them at startup, run `npx @nestjs/webhooks migrate --url --schema m_behind`, ' + "or apply `PostgresWebhookStore.migrationSql({ schema: 'm_behind', from: 0 })` with your migration tool.", ); await expect(behind.getEndpoint('any')).rejects.toThrow(WebhookSchemaError);