@semiont/cli 0.2.34-build.88 → 0.2.34-build.89

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +15 -38
  2. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -15817,7 +15817,8 @@ var init_backend_paths = __esm({
15817
15817
 
15818
15818
  // src/platforms/posix/handlers/backend-check.ts
15819
15819
  import * as fs9 from "fs";
15820
- import { SemiontApiClient, baseUrl } from "@semiont/api-client";
15820
+ import { baseUrl } from "@semiont/core";
15821
+ import { SemiontApiClient } from "@semiont/api-client";
15821
15822
  var checkBackendService, backendCheckDescriptor;
15822
15823
  var init_backend_check = __esm({
15823
15824
  "src/platforms/posix/handlers/backend-check.ts"() {
@@ -19403,7 +19404,8 @@ var init_platform2 = __esm({
19403
19404
 
19404
19405
  // src/platforms/container/handlers/web-check.ts
19405
19406
  import { execSync as execSync16 } from "child_process";
19406
- import { SemiontApiClient as SemiontApiClient2, baseUrl as baseUrl2 } from "@semiont/api-client";
19407
+ import { baseUrl as baseUrl2 } from "@semiont/core";
19408
+ import { SemiontApiClient as SemiontApiClient2 } from "@semiont/api-client";
19407
19409
  var checkWebContainer, webCheckDescriptor;
19408
19410
  var init_web_check = __esm({
19409
19411
  "src/platforms/container/handlers/web-check.ts"() {
@@ -42368,10 +42370,10 @@ var UseraddOptionsSchema = BaseOptionsSchema.extend({
42368
42370
  function validateEmail(email3) {
42369
42371
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
42370
42372
  if (!emailRegex.test(email3)) {
42371
- throw new Error(`Invalid email format: ${email3}`);
42373
+ throw new Error(`invalid email format: ${email3}`);
42372
42374
  }
42373
42375
  if (!email3.includes("@")) {
42374
- throw new Error("Invalid email: missing @ symbol");
42376
+ throw new Error("invalid email: missing @ symbol");
42375
42377
  }
42376
42378
  }
42377
42379
  function validatePassword(password) {
@@ -42395,24 +42397,26 @@ async function useradd(options) {
42395
42397
  try {
42396
42398
  validateEmail(options.email);
42397
42399
  const domain2 = extractDomain(options.email);
42400
+ const existingUser = await prisma.user.findUnique({
42401
+ where: { email: options.email }
42402
+ });
42398
42403
  let password;
42404
+ let passwordHash;
42399
42405
  let generatedPassword;
42400
42406
  if (options.generatePassword) {
42401
42407
  password = generatePassword();
42402
42408
  generatedPassword = password;
42409
+ passwordHash = await bcrypt.hash(password, 12);
42403
42410
  if (!options.quiet) {
42404
42411
  printInfo(`Generated password: ${password}`);
42405
42412
  }
42406
42413
  } else if (options.password) {
42407
42414
  password = options.password;
42408
42415
  validatePassword(password);
42409
- } else {
42416
+ passwordHash = await bcrypt.hash(password, 12);
42417
+ } else if (!existingUser) {
42410
42418
  throw new Error("Password required: use --password or --generate-password");
42411
42419
  }
42412
- const passwordHash = await bcrypt.hash(password, 12);
42413
- const existingUser = await prisma.user.findUnique({
42414
- where: { email: options.email }
42415
- });
42416
42420
  let user;
42417
42421
  if (existingUser) {
42418
42422
  if (!options.update) {
@@ -42497,35 +42501,8 @@ async function useradd(options) {
42497
42501
  duration: duration3
42498
42502
  };
42499
42503
  } catch (error46) {
42500
- const duration3 = Date.now() - startTime;
42501
- const errorMessage = error46 instanceof Error ? error46.message : "Unknown error";
42502
- if (!options.quiet) {
42503
- printError(`Failed to add user: ${errorMessage}`);
42504
- }
42505
- return {
42506
- command: "useradd",
42507
- environment: options.environment,
42508
- timestamp: /* @__PURE__ */ new Date(),
42509
- summary: {
42510
- succeeded: 0,
42511
- failed: 1,
42512
- total: 1,
42513
- warnings: 0
42514
- },
42515
- executionContext: {
42516
- user: process.env.USER || "unknown",
42517
- workingDirectory: process.cwd(),
42518
- dryRun: options.dryRun
42519
- },
42520
- results: [{
42521
- entity: options.email,
42522
- platform: "posix",
42523
- success: false,
42524
- error: errorMessage,
42525
- duration: duration3
42526
- }],
42527
- duration: duration3
42528
- };
42504
+ await prisma.$disconnect();
42505
+ throw error46;
42529
42506
  } finally {
42530
42507
  await prisma.$disconnect();
42531
42508
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@semiont/cli",
3
- "version": "0.2.34-build.88",
3
+ "version": "0.2.34-build.89",
4
4
  "description": "Semiont CLI - Unified environment management tool",
5
5
  "_comment": "AWS SDK dependencies (@aws-sdk/*) are only used by platforms/aws",
6
6
  "type": "module",
@@ -65,8 +65,8 @@
65
65
  "@aws-sdk/client-sts": "^3.859.0",
66
66
  "@aws-sdk/client-wafv2": "^3.859.0",
67
67
  "@prisma/client": "^6.13.0",
68
- "@semiont/api-client": "0.2.34-build.88",
69
- "@semiont/core": "0.2.34-build.88",
68
+ "@semiont/api-client": "0.2.34-build.89",
69
+ "@semiont/core": "0.2.34-build.89",
70
70
  "@testcontainers/postgresql": "^11.5.1",
71
71
  "arg": "^5.0.2",
72
72
  "bcrypt": "^5.1.1",