@constructive-io/seeder 0.5.2 → 0.5.3

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/dist/index.js CHANGED
@@ -18005,7 +18005,7 @@ function getBlueprintNames() {
18005
18005
 
18006
18006
  // package.json
18007
18007
  var package_default = {
18008
- version: "0.5.2"};
18008
+ version: "0.5.3"};
18009
18009
 
18010
18010
  // src/templates/blog/generators.ts
18011
18011
  var POST_STATUSES = ["draft", "published", "archived"];
@@ -20226,7 +20226,8 @@ async function provisionDatabase(db, options) {
20226
20226
  domain: options.domain,
20227
20227
  subdomain: options.subdomain || void 0,
20228
20228
  ownerId: options.ownerId,
20229
- modules: ["all"]
20229
+ modules: ["all"],
20230
+ bootstrapUser: true
20230
20231
  },
20231
20232
  select: {
20232
20233
  id: true,
@@ -22431,9 +22432,9 @@ Endpoint: ${config.endpoint}`);
22431
22432
  console.log("");
22432
22433
  logStep("Authenticating with schema builder");
22433
22434
  const credentials = await promptForCredentials(config);
22434
- const authResult = await login(credentials, config.endpoint);
22435
+ const authResult = await loginOrRegister(config.endpoint, credentials.email, credentials.password);
22435
22436
  const { token, userId } = authResult;
22436
- logOk(`Logged in as user ${mask(userId)}`);
22437
+ logOk(`Authenticated as user ${mask(userId)}`);
22437
22438
  if (config.dryRun) {
22438
22439
  logWarn("Dry run mode - skipping provisioning");
22439
22440
  return;
@@ -22468,6 +22469,14 @@ Endpoint: ${config.endpoint}`);
22468
22469
  authenticatedRoleName: topology.dataRoleName
22469
22470
  }
22470
22471
  );
22472
+ logStep("Registering admin user on per-database auth...");
22473
+ await sleep(5e3);
22474
+ try {
22475
+ const perDbAuth = await loginOrRegister(topology.authEndpoint, credentials.email, credentials.password);
22476
+ logOk(`Per-database admin user ready: ${mask(perDbAuth.userId)}`);
22477
+ } catch (error) {
22478
+ logWarn(`Per-database admin registration deferred: ${error instanceof Error ? error.message : String(error)}`);
22479
+ }
22471
22480
  const seededRowCounts = {};
22472
22481
  let seedUserId;
22473
22482
  if (dataset && preset) {