@event-driven-io/emmett-postgresql 0.20.2-alpha2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@event-driven-io/emmett-postgresql",
3
- "version": "0.20.2-alpha2",
3
+ "version": "0.21.0",
4
4
  "type": "module",
5
5
  "description": "Emmett - PostgreSQL - Event Sourcing development made simple",
6
6
  "scripts": {
@@ -70,10 +70,10 @@
70
70
  ],
71
71
  "devDependencies": {
72
72
  "@testcontainers/postgresql": "^10.12.0",
73
- "@event-driven-io/emmett-testcontainers": "0.20.2-alpha2"
73
+ "@event-driven-io/emmett-testcontainers": "0.21.0"
74
74
  },
75
75
  "peerDependencies": {
76
- "@event-driven-io/emmett": "0.20.2-alpha2",
76
+ "@event-driven-io/emmett": "0.21.0",
77
77
  "@event-driven-io/pongo": "0.16.1"
78
78
  }
79
79
  }
package/dist/cli.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _commander = require('commander');var e=new (0, _commander.Command)("migrate").description("Manage database migrations");e.command("run").description("Run database migrations").option("-cs, --connectionString <string>","Connection string for the database").option("-dr, --dryRun","Perform dry run without commiting changes",!1).action(t=>{(_nullishCoalesce(t.connectionString, () => (process.env.DB_CONNECTION_STRING)))||(console.error('Error: Connection string is required. Provide it either as a "--connectionString" parameter or through the DB_CONNECTION_STRING environment variable.'),process.exit(1)),console.log("Nothing has happened, but test was successful")});e.command("sql").description("Generate SQL for database migration").option("--print","Print the SQL to the console (default)",!0).action(t=>{let{collection:n}=t;n||(console.error('Error: You need to provide at least one collection name is required. Provide it either as a "col" parameter.'),process.exit(1)),console.log("Nothing has happened, but test was successful!")});var i={pluginType:"cli",name:"emmett-postgresql",registerCommands:t=>{t.addCommand(e)}},g= exports.default =i;exports.default = g;
2
- //# sourceMappingURL=cli.cjs.map
package/dist/cli.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commandLine/migrate.ts","../src/cli.ts"],"names":["migrateCommand","Command","options","collection","cli","program","cli_default"],"mappings":"AAAA,mNAAwB,IAeXA,CAAAA,CAAiB,IAAIC,uBAAAA,CAAQ,SAAS,CAAA,CAAE,WAAA,CACnD,4BACF,CAAA,CAEAD,CAAAA,CACG,OAAA,CAAQ,KAAK,CAAA,CACb,WAAA,CAAY,yBAAyB,CAAA,CACrC,MAAA,CACC,kCAAA,CACA,oCACF,CAAA,CAUC,MAAA,CAAO,eAAA,CAAiB,2CAAA,CAA6C,CAAA,CAAK,CAAA,CAC1E,MAAA,CAAQE,CAAAA,EAA+B,CAAA,kBAGpCA,CAAAA,CAAQ,gBAAA,SAAoB,OAAA,CAAQ,GAAA,CAAI,sBAAA,CAAA,EAAA,CAIxC,OAAA,CAAQ,KAAA,CACN,uJACF,CAAA,CACA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGhB,OAAA,CAAQ,GAAA,CAAI,+CAA+C,CAyB7D,CAAC,CAAA,CAEHF,CAAAA,CACG,OAAA,CAAQ,KAAK,CAAA,CACb,WAAA,CAAY,qCAAqC,CAAA,CAUjD,MAAA,CAAO,SAAA,CAAW,wCAAA,CAA0C,CAAA,CAAI,CAAA,CAEhE,MAAA,CAAQE,CAAAA,EAA+B,CACtC,GAAM,CAAE,UAAA,CAAAC,CAAW,CAAA,CAAID,CAAAA,CAElBC,CAAAA,EAAAA,CACH,OAAA,CAAQ,KAAA,CACN,8GACF,CAAA,CACA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGhB,OAAA,CAAQ,GAAA,CAAI,gDAAgD,CAe9D,CAAC,CAAA,CC7GH,IAAMC,CAAAA,CAAuB,CAC3B,UAAA,CAAY,KAAA,CACZ,IAAA,CAAM,mBAAA,CACN,gBAAA,CAAmBC,CAAAA,EAA8B,CAC/CA,CAAAA,CAAQ,UAAA,CAAWL,CAAc,CACnC,CACF,CAAA,CAEOM,CAAAA,mBAAQF,CAAAA,CAAAA,oBAAAA","file":"/home/runner/work/emmett/emmett/src/packages/emmett-postgresql/dist/cli.cjs","sourcesContent":["import { Command } from 'commander';\n\ninterface MigrateRunOptions {\n collection: string[];\n connectionString: string;\n config?: string;\n dryRun?: boolean;\n}\n\ninterface MigrateSqlOptions {\n print?: boolean;\n write?: string;\n collection: string[];\n}\n\nexport const migrateCommand = new Command('migrate').description(\n 'Manage database migrations',\n);\n\nmigrateCommand\n .command('run')\n .description('Run database migrations')\n .option(\n '-cs, --connectionString <string>',\n 'Connection string for the database',\n )\n // .option(\n // '-col, --collection <name>',\n // 'Specify the collection name',\n // (value: string, previous: string[]) => {\n // // Accumulate collection names into an array (explicitly typing `previous` as `string[]`)\n // return previous.concat([value]);\n // },\n // [] as string[],\n // )\n .option('-dr, --dryRun', 'Perform dry run without commiting changes', false)\n .action((options: MigrateRunOptions) => {\n //const { collection, dryRun } = options;\n const connectionString =\n options.connectionString ?? process.env.DB_CONNECTION_STRING;\n //let collectionNames: string[];\n\n if (!connectionString) {\n console.error(\n 'Error: Connection string is required. Provide it either as a \"--connectionString\" parameter or through the DB_CONNECTION_STRING environment variable.',\n );\n process.exit(1);\n }\n\n console.log('Nothing has happened, but test was successful');\n // if (options.config) {\n // const config = await loadConfigFile(options.config);\n\n // collectionNames = config.collections.map((c) => c.name);\n // } else if (collection) {\n // collectionNames = collection;\n // } else {\n // console.error(\n // 'Error: You need to provide at least one collection name. Provide it either through \"--config\" file or as a \"--collection\" parameter.',\n // );\n // process.exit(1);\n // }\n\n // const pool = dumbo({ connectionString });\n\n // const migrations = collectionNames.flatMap((collectionsName) =>\n // pongoCollectionSchemaComponent(collectionsName).migrations({\n // connector: 'PostgreSQL:pg', // TODO: Provide connector here\n // }),\n // );\n\n // await runPostgreSQLMigrations(pool, migrations, {\n // dryRun,\n // });\n });\n\nmigrateCommand\n .command('sql')\n .description('Generate SQL for database migration')\n // .option(\n // '-col, --collection <name>',\n // 'Specify the collection name',\n // (value: string, previous: string[]) => {\n // // Accumulate collection names into an array (explicitly typing `previous` as `string[]`)\n // return previous.concat([value]);\n // },\n // [] as string[],\n // )\n .option('--print', 'Print the SQL to the console (default)', true)\n //.option('--write <filename>', 'Write the SQL to a specified file')\n .action((options: MigrateSqlOptions) => {\n const { collection } = options;\n\n if (!collection) {\n console.error(\n 'Error: You need to provide at least one collection name is required. Provide it either as a \"col\" parameter.',\n );\n process.exit(1);\n }\n\n console.log('Nothing has happened, but test was successful!');\n // const coreMigrations = migrationTableSchemaComponent.migrations({\n // connector: 'PostgreSQL:pg',\n // });\n // const migrations = [\n // ...coreMigrations,\n // ...collection.flatMap((collectionsName) =>\n // pongoCollectionSchemaComponent(collectionsName).migrations({\n // connector: 'PostgreSQL:pg', // TODO: Provide connector here\n // }),\n // ),\n // ];\n\n // console.log('Printing SQL:');\n // console.log(combineMigrations(...migrations));\n });\n","import type {\n EmmettCliCommand,\n EmmettCliPlugin,\n} from '@event-driven-io/emmett';\nimport { migrateCommand } from './commandLine';\n\nconst cli: EmmettCliPlugin = {\n pluginType: 'cli',\n name: 'emmett-postgresql',\n registerCommands: (program: EmmettCliCommand) => {\n program.addCommand(migrateCommand);\n },\n};\n\nexport default cli;\n"]}
package/dist/cli.d.cts DELETED
@@ -1,5 +0,0 @@
1
- import { EmmettCliPlugin } from '@event-driven-io/emmett';
2
-
3
- declare const cli: EmmettCliPlugin;
4
-
5
- export { cli as default };
package/dist/cli.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { EmmettCliPlugin } from '@event-driven-io/emmett';
2
-
3
- declare const cli: EmmettCliPlugin;
4
-
5
- export { cli as default };
package/dist/cli.js DELETED
@@ -1,2 +0,0 @@
1
- import{Command as o}from"commander";var e=new o("migrate").description("Manage database migrations");e.command("run").description("Run database migrations").option("-cs, --connectionString <string>","Connection string for the database").option("-dr, --dryRun","Perform dry run without commiting changes",!1).action(t=>{(t.connectionString??process.env.DB_CONNECTION_STRING)||(console.error('Error: Connection string is required. Provide it either as a "--connectionString" parameter or through the DB_CONNECTION_STRING environment variable.'),process.exit(1)),console.log("Nothing has happened, but test was successful")});e.command("sql").description("Generate SQL for database migration").option("--print","Print the SQL to the console (default)",!0).action(t=>{let{collection:n}=t;n||(console.error('Error: You need to provide at least one collection name is required. Provide it either as a "col" parameter.'),process.exit(1)),console.log("Nothing has happened, but test was successful!")});var i={pluginType:"cli",name:"emmett-postgresql",registerCommands:t=>{t.addCommand(e)}},g=i;export{g as default};
2
- //# sourceMappingURL=cli.js.map
package/dist/cli.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commandLine/migrate.ts","../src/cli.ts"],"sourcesContent":["import { Command } from 'commander';\n\ninterface MigrateRunOptions {\n collection: string[];\n connectionString: string;\n config?: string;\n dryRun?: boolean;\n}\n\ninterface MigrateSqlOptions {\n print?: boolean;\n write?: string;\n collection: string[];\n}\n\nexport const migrateCommand = new Command('migrate').description(\n 'Manage database migrations',\n);\n\nmigrateCommand\n .command('run')\n .description('Run database migrations')\n .option(\n '-cs, --connectionString <string>',\n 'Connection string for the database',\n )\n // .option(\n // '-col, --collection <name>',\n // 'Specify the collection name',\n // (value: string, previous: string[]) => {\n // // Accumulate collection names into an array (explicitly typing `previous` as `string[]`)\n // return previous.concat([value]);\n // },\n // [] as string[],\n // )\n .option('-dr, --dryRun', 'Perform dry run without commiting changes', false)\n .action((options: MigrateRunOptions) => {\n //const { collection, dryRun } = options;\n const connectionString =\n options.connectionString ?? process.env.DB_CONNECTION_STRING;\n //let collectionNames: string[];\n\n if (!connectionString) {\n console.error(\n 'Error: Connection string is required. Provide it either as a \"--connectionString\" parameter or through the DB_CONNECTION_STRING environment variable.',\n );\n process.exit(1);\n }\n\n console.log('Nothing has happened, but test was successful');\n // if (options.config) {\n // const config = await loadConfigFile(options.config);\n\n // collectionNames = config.collections.map((c) => c.name);\n // } else if (collection) {\n // collectionNames = collection;\n // } else {\n // console.error(\n // 'Error: You need to provide at least one collection name. Provide it either through \"--config\" file or as a \"--collection\" parameter.',\n // );\n // process.exit(1);\n // }\n\n // const pool = dumbo({ connectionString });\n\n // const migrations = collectionNames.flatMap((collectionsName) =>\n // pongoCollectionSchemaComponent(collectionsName).migrations({\n // connector: 'PostgreSQL:pg', // TODO: Provide connector here\n // }),\n // );\n\n // await runPostgreSQLMigrations(pool, migrations, {\n // dryRun,\n // });\n });\n\nmigrateCommand\n .command('sql')\n .description('Generate SQL for database migration')\n // .option(\n // '-col, --collection <name>',\n // 'Specify the collection name',\n // (value: string, previous: string[]) => {\n // // Accumulate collection names into an array (explicitly typing `previous` as `string[]`)\n // return previous.concat([value]);\n // },\n // [] as string[],\n // )\n .option('--print', 'Print the SQL to the console (default)', true)\n //.option('--write <filename>', 'Write the SQL to a specified file')\n .action((options: MigrateSqlOptions) => {\n const { collection } = options;\n\n if (!collection) {\n console.error(\n 'Error: You need to provide at least one collection name is required. Provide it either as a \"col\" parameter.',\n );\n process.exit(1);\n }\n\n console.log('Nothing has happened, but test was successful!');\n // const coreMigrations = migrationTableSchemaComponent.migrations({\n // connector: 'PostgreSQL:pg',\n // });\n // const migrations = [\n // ...coreMigrations,\n // ...collection.flatMap((collectionsName) =>\n // pongoCollectionSchemaComponent(collectionsName).migrations({\n // connector: 'PostgreSQL:pg', // TODO: Provide connector here\n // }),\n // ),\n // ];\n\n // console.log('Printing SQL:');\n // console.log(combineMigrations(...migrations));\n });\n","import type {\n EmmettCliCommand,\n EmmettCliPlugin,\n} from '@event-driven-io/emmett';\nimport { migrateCommand } from './commandLine';\n\nconst cli: EmmettCliPlugin = {\n pluginType: 'cli',\n name: 'emmett-postgresql',\n registerCommands: (program: EmmettCliCommand) => {\n program.addCommand(migrateCommand);\n },\n};\n\nexport default cli;\n"],"mappings":"AAAA,OAAS,WAAAA,MAAe,YAejB,IAAMC,EAAiB,IAAID,EAAQ,SAAS,EAAE,YACnD,4BACF,EAEAC,EACG,QAAQ,KAAK,EACb,YAAY,yBAAyB,EACrC,OACC,mCACA,oCACF,EAUC,OAAO,gBAAiB,4CAA6C,EAAK,EAC1E,OAAQC,GAA+B,EAGpCA,EAAQ,kBAAoB,QAAQ,IAAI,wBAIxC,QAAQ,MACN,uJACF,EACA,QAAQ,KAAK,CAAC,GAGhB,QAAQ,IAAI,+CAA+C,CAyB7D,CAAC,EAEHD,EACG,QAAQ,KAAK,EACb,YAAY,qCAAqC,EAUjD,OAAO,UAAW,yCAA0C,EAAI,EAEhE,OAAQC,GAA+B,CACtC,GAAM,CAAE,WAAAC,CAAW,EAAID,EAElBC,IACH,QAAQ,MACN,8GACF,EACA,QAAQ,KAAK,CAAC,GAGhB,QAAQ,IAAI,gDAAgD,CAe9D,CAAC,EC7GH,IAAMC,EAAuB,CAC3B,WAAY,MACZ,KAAM,oBACN,iBAAmBC,GAA8B,CAC/CA,EAAQ,WAAWC,CAAc,CACnC,CACF,EAEOC,EAAQH","names":["Command","migrateCommand","options","collection","cli","program","migrateCommand","cli_default"]}