@secretstash/cli 0.1.4 → 0.1.5

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/index.js +29 -29
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -306,7 +306,7 @@ var ApiClient = class {
306
306
  const refreshToken = configManager.getRefreshToken();
307
307
  if (!refreshToken) return false;
308
308
  try {
309
- const response = await fetch(`${configManager.getApiUrl()}/api/auth/refresh`, {
309
+ const response = await fetch(`${configManager.getApiUrl()}/api/v1/auth/refresh`, {
310
310
  method: "POST",
311
311
  headers: {
312
312
  "Content-Type": "application/json"
@@ -380,7 +380,7 @@ var ApiClient = class {
380
380
  }
381
381
  // Auth endpoints
382
382
  async login(email, password) {
383
- return this.request("/api/auth/login", {
383
+ return this.request("/api/v1/auth/login", {
384
384
  method: "POST",
385
385
  body: { email, password, client: "cli" },
386
386
  requireAuth: false
@@ -399,14 +399,14 @@ var ApiClient = class {
399
399
  });
400
400
  }
401
401
  async verify2FA(tempToken, code) {
402
- return this.request("/api/auth/2fa/verify", {
402
+ return this.request("/api/v1/auth/2fa/verify", {
403
403
  method: "POST",
404
404
  body: { tempToken, code },
405
405
  requireAuth: false
406
406
  });
407
407
  }
408
408
  async register(email, password) {
409
- return this.request("/api/auth/register", {
409
+ return this.request("/api/v1/auth/register", {
410
410
  method: "POST",
411
411
  body: { email, password },
412
412
  requireAuth: false
@@ -415,7 +415,7 @@ var ApiClient = class {
415
415
  async logout() {
416
416
  const refreshToken = configManager.getRefreshToken();
417
417
  if (refreshToken) {
418
- await this.request("/api/auth/logout", {
418
+ await this.request("/api/v1/auth/logout", {
419
419
  method: "POST",
420
420
  body: { refreshToken }
421
421
  });
@@ -423,39 +423,39 @@ var ApiClient = class {
423
423
  configManager.logout();
424
424
  }
425
425
  async getMe() {
426
- return this.request("/api/users/me");
426
+ return this.request("/api/v1/users/me");
427
427
  }
428
428
  // Team endpoints
429
429
  async getTeams() {
430
- return this.request("/api/teams");
430
+ return this.request("/api/v1/teams");
431
431
  }
432
432
  async createTeam(name) {
433
- return this.request("/api/teams", {
433
+ return this.request("/api/v1/teams", {
434
434
  method: "POST",
435
435
  body: { name }
436
436
  });
437
437
  }
438
438
  // Project endpoints
439
439
  async getProjects(teamId) {
440
- return this.request(`/api/teams/${teamId}/projects`);
440
+ return this.request(`/api/v1/teams/${teamId}/projects`);
441
441
  }
442
442
  async createProject(teamId, name, description) {
443
- return this.request(`/api/teams/${teamId}/projects`, {
443
+ return this.request(`/api/v1/teams/${teamId}/projects`, {
444
444
  method: "POST",
445
445
  body: { name, description }
446
446
  });
447
447
  }
448
448
  async deleteProject(projectId) {
449
- return this.request(`/api/projects/${projectId}`, {
449
+ return this.request(`/api/v1/projects/${projectId}`, {
450
450
  method: "DELETE"
451
451
  });
452
452
  }
453
453
  // Environment endpoints
454
454
  async getEnvironments(projectId) {
455
- return this.request(`/api/projects/${projectId}/environments`);
455
+ return this.request(`/api/v1/projects/${projectId}/environments`);
456
456
  }
457
457
  async createEnvironment(projectId, name, parentId) {
458
- return this.request(`/api/projects/${projectId}/environments`, {
458
+ return this.request(`/api/v1/projects/${projectId}/environments`, {
459
459
  method: "POST",
460
460
  body: { name, parentId }
461
461
  });
@@ -467,29 +467,29 @@ var ApiClient = class {
467
467
  }
468
468
  // Secret endpoints (keys only, no decryption)
469
469
  async getSecrets(environmentId) {
470
- return this.request(`/api/environments/${environmentId}/secrets`);
470
+ return this.request(`/api/v1/environments/${environmentId}/secrets`);
471
471
  }
472
472
  // Decrypted secrets (requires password)
473
473
  async getDecryptedSecrets(environmentId, password) {
474
- return this.request(`/api/environments/${environmentId}/secrets/decrypt`, {
474
+ return this.request(`/api/v1/environments/${environmentId}/secrets/decrypt`, {
475
475
  method: "POST",
476
476
  body: { password }
477
477
  });
478
478
  }
479
479
  async createSecret(environmentId, key, value, password, description) {
480
- return this.request(`/api/environments/${environmentId}/secrets`, {
480
+ return this.request(`/api/v1/environments/${environmentId}/secrets`, {
481
481
  method: "POST",
482
482
  body: { key, value, password, description }
483
483
  });
484
484
  }
485
485
  async updateSecret(secretId, value, password, description) {
486
- return this.request(`/api/secrets/${secretId}`, {
486
+ return this.request(`/api/v1/secrets/${secretId}`, {
487
487
  method: "PATCH",
488
488
  body: { value, password, description }
489
489
  });
490
490
  }
491
491
  async deleteSecret(secretId) {
492
- return this.request(`/api/secrets/${secretId}`, {
492
+ return this.request(`/api/v1/secrets/${secretId}`, {
493
493
  method: "DELETE"
494
494
  });
495
495
  }
@@ -497,58 +497,58 @@ var ApiClient = class {
497
497
  async pullSecrets(teamSlug, projectSlug, environment, password, options) {
498
498
  const includeInherited = options?.includeInherited ?? true;
499
499
  const query = includeInherited ? "" : "?includeInherited=false";
500
- return this.request(`/api/teams/${teamSlug}/projects/${projectSlug}/environments/${environment}/secrets/decrypt${query}`, {
500
+ return this.request(`/api/v1/teams/${teamSlug}/projects/${projectSlug}/environments/${environment}/secrets/decrypt${query}`, {
501
501
  method: "POST",
502
502
  body: { password }
503
503
  });
504
504
  }
505
505
  async pushSecrets(teamSlug, projectSlug, environment, secrets, password) {
506
- return this.request(`/api/teams/${teamSlug}/projects/${projectSlug}/environments/${environment}/secrets/bulk`, {
506
+ return this.request(`/api/v1/teams/${teamSlug}/projects/${projectSlug}/environments/${environment}/secrets/bulk`, {
507
507
  method: "PUT",
508
508
  body: { secrets, password }
509
509
  });
510
510
  }
511
511
  // 2FA endpoints
512
512
  async setup2FA() {
513
- return this.request("/api/users/me/2fa/setup", {
513
+ return this.request("/api/v1/users/me/2fa/setup", {
514
514
  method: "POST"
515
515
  });
516
516
  }
517
517
  async enable2FA(code) {
518
- return this.request("/api/users/me/2fa/enable", {
518
+ return this.request("/api/v1/users/me/2fa/enable", {
519
519
  method: "POST",
520
520
  body: { code }
521
521
  });
522
522
  }
523
523
  async disable2FA(code) {
524
- return this.request("/api/users/me/2fa/disable", {
524
+ return this.request("/api/v1/users/me/2fa/disable", {
525
525
  method: "POST",
526
526
  body: { code }
527
527
  });
528
528
  }
529
529
  // Team member endpoints
530
530
  async getTeamMembers(teamId) {
531
- return this.request(`/api/teams/${teamId}/members`);
531
+ return this.request(`/api/v1/teams/${teamId}/members`);
532
532
  }
533
533
  async inviteTeamMember(teamId, email, role) {
534
- return this.request(`/api/teams/${teamId}/invitations`, {
534
+ return this.request(`/api/v1/teams/${teamId}/invitations`, {
535
535
  method: "POST",
536
536
  body: { email, role }
537
537
  });
538
538
  }
539
539
  async removeTeamMember(teamId, memberId) {
540
- return this.request(`/api/teams/${teamId}/members/${memberId}`, {
540
+ return this.request(`/api/v1/teams/${teamId}/members/${memberId}`, {
541
541
  method: "DELETE"
542
542
  });
543
543
  }
544
544
  async updateTeamMemberRole(teamId, memberId, role) {
545
- return this.request(`/api/teams/${teamId}/members/${memberId}`, {
545
+ return this.request(`/api/v1/teams/${teamId}/members/${memberId}`, {
546
546
  method: "PATCH",
547
547
  body: { role }
548
548
  });
549
549
  }
550
550
  async getPendingInvitations(teamId) {
551
- return this.request(`/api/teams/${teamId}/invitations`);
551
+ return this.request(`/api/v1/teams/${teamId}/invitations`);
552
552
  }
553
553
  // Share link endpoints
554
554
  async createShare(teamSlug, projectSlug, environment, secretKey, options) {
@@ -574,7 +574,7 @@ var ApiClient = class {
574
574
  }
575
575
  // Service token verification - make a request to validate the token works
576
576
  async verifyServiceToken(token) {
577
- return this.request("/api/teams", {
577
+ return this.request("/api/v1/teams", {
578
578
  headers: {
579
579
  "Authorization": `Bearer ${token}`
580
580
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secretstash/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "CLI tool for SecretStash - secure team secrets management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",