envshed 0.16.0 → 0.18.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.
@@ -96,7 +96,9 @@
96
96
  "placeholderConfigHint_other": "Click the link below to configure each value in the dashboard.",
97
97
  "setOverride": "Set override",
98
98
  "placeholderPullAgain": "After setting your values, run envshed pull again to update your local env file.",
99
- "envChanged": "Environment changed: {{count}} update(s) since your last pull (v{{from}} → v{{to}})"
99
+ "envChanged": "Environment changed: {{count}} update(s) since your last pull (v{{from}} → v{{to}})",
100
+ "disabledSkipped_one": "{{count}} disabled secret skipped",
101
+ "disabledSkipped_other": "{{count}} disabled secrets skipped"
100
102
  },
101
103
  "push": {
102
104
  "description": "Push secrets from a .env file",
@@ -156,7 +158,9 @@
156
158
  "watchRestarting": "Secret version {{version}} detected — restarting...",
157
159
  "watchRateLimit": "Rate limited — backing off for {{nextSec}}s",
158
160
  "watchPollError": "Poll error ({{status}}) — will retry",
159
- "watchPollFailed": "Poll failed: {{message}} — will retry"
161
+ "watchPollFailed": "Poll failed: {{message}} — will retry",
162
+ "disabledSkipped_one": "{{count}} disabled secret skipped",
163
+ "disabledSkipped_other": "{{count}} disabled secrets skipped"
160
164
  },
161
165
  "orgs": {
162
166
  "description": "List organizations",
@@ -472,6 +476,8 @@
472
476
  "getDescription": "Get the value of a secret by key",
473
477
  "setDescription": "Set or update a secret value",
474
478
  "deleteDescription": "Delete a secret by key",
479
+ "disableDescription": "Disable a secret (hide it from consumption without deleting it)",
480
+ "enableDescription": "Re-enable a previously disabled secret",
475
481
  "keyArg": "Secret key name",
476
482
  "placeholderOption": "Mark the secret as a placeholder",
477
483
  "ttyWarning": "Tip: pipe to clipboard or file to avoid terminal history exposure",
@@ -483,6 +489,12 @@
483
489
  "deleted": "Secret {{key}} deleted",
484
490
  "deleteConfirm": "Delete secret {{key}}?",
485
491
  "deleteCancelled": "Delete cancelled",
492
+ "disabling": "Disabling secret...",
493
+ "enabling": "Enabling secret...",
494
+ "disabled": "Secret {{key}} disabled",
495
+ "enabled": "Secret {{key}} enabled",
496
+ "disableConfirm": "Disable secret {{key}}? It will be hidden from consumption until re-enabled.",
497
+ "disableCancelled": "Disable cancelled",
486
498
  "failed": "Failed: {{message}}",
487
499
  "override": {
488
500
  "description": "Manage personal secret overrides",
@@ -628,5 +640,75 @@
628
640
  "dopplerPushed": "Migrated {{count}} secrets into {{target}}.",
629
641
  "dopplerTargetFailed": "Failed to migrate {{target}}: {{message}}",
630
642
  "dopplerDone": "Doppler migration complete: {{envs}} environment(s), {{new}} new, {{modified}} modified, {{unchanged}} unchanged."
643
+ },
644
+ "share": {
645
+ "description": "Share secrets through expiring, encrypted links",
646
+ "createDescription": "Create a share link for secrets in an environment (all secrets when no keys are given)",
647
+ "listDescription": "List share links in an organization",
648
+ "revokeDescription": "Revoke a share link",
649
+ "openDescription": "Open a share link and print its secrets (no login required)",
650
+ "keysArg": "Secret keys to share (default: every secret in the environment)",
651
+ "urlArg": "Share link URL (or <id>#<key>)",
652
+ "idArg": "Share link ID",
653
+ "expiresOption": "Lifetime, e.g. 15m, 1h, 24h, 7d (max 30d)",
654
+ "burnOption": "One-time link: self-destructs after the first open",
655
+ "maxViewsOption": "Maximum number of opens",
656
+ "passwordOption": "Protect the link with a password (prompted, or read from stdin when piped)",
657
+ "noteOption": "Note shown to the recipient",
658
+ "fileOption": "Write the secrets to a file (mode 0600) instead of stdout",
659
+ "invalidDuration": "Invalid duration \"{{value}}\". Use minutes or a suffix: 15m, 2h, 7d.",
660
+ "invalidMaxViews": "Invalid --max-views value. Use a whole number of at least 1.",
661
+ "invalidUrl": "Not a share link. Expected https://app.envshed.com/s/<id>#<key>.",
662
+ "confirmAll": "Share ALL secrets in {{env}}?",
663
+ "confirmBurn": "This is a one-time link. Opening it destroys it. Continue?",
664
+ "cancelled": "Cancelled.",
665
+ "passwordPrompt": "Link password:",
666
+ "creating": "Creating share link...",
667
+ "created": "Share link created",
668
+ "urlLabel": "URL",
669
+ "expiresLabel": "Expires",
670
+ "viewsLabel": "Views",
671
+ "viewsOneTime": "one-time (destroyed after the first open)",
672
+ "viewsUnlimited": "unlimited until expiry",
673
+ "viewsMax": "max {{count}}",
674
+ "passwordLabel": "Password",
675
+ "passwordYes": "required",
676
+ "passwordNo": "none",
677
+ "skipped": "Skipped (no shareable value): {{keys}}",
678
+ "copyHint": "Copy the URL now: it cannot be shown again.",
679
+ "openHint": "Recipients without a browser can run: envshed share open \"{{url}}\"",
680
+ "fetching": "Fetching share links...",
681
+ "noLinks": "No share links found.",
682
+ "headId": "ID",
683
+ "headSecrets": "Secrets",
684
+ "headStatus": "Status",
685
+ "headViews": "Views",
686
+ "headExpires": "Expires",
687
+ "headBy": "Created by",
688
+ "statusActive": "active",
689
+ "statusExpired": "expired",
690
+ "statusExhausted": "used up",
691
+ "statusRevoked": "revoked",
692
+ "confirmRevoke": "Revoke share link {{id}}? Anyone holding it loses access immediately.",
693
+ "revoking": "Revoking share link...",
694
+ "revoked": "Share link revoked.",
695
+ "checking": "Checking share link...",
696
+ "opening": "Opening share link...",
697
+ "savedToFile_one": "Saved 1 secret to {{file}}",
698
+ "savedToFile_other": "Saved {{count}} secrets to {{file}}",
699
+ "ttyWarning": "Tip: use --file or pipe the output to keep secrets out of your terminal history",
700
+ "burnedNotice": "This one-time link has now been destroyed.",
701
+ "remainingViews_one": "{{count}} view left on this link.",
702
+ "remainingViews_other": "{{count}} views left on this link.",
703
+ "errorNotFound": "This share link is invalid or has been removed.",
704
+ "errorExpired": "This share link has expired.",
705
+ "errorExhausted": "This share link has already been opened the maximum number of times.",
706
+ "errorRevoked": "This share link was revoked by its owner.",
707
+ "errorLocked": "This share link was locked after too many wrong password attempts.",
708
+ "errorInvalidPassword": "Wrong password.",
709
+ "errorPasswordRequired": "This share link requires a password.",
710
+ "errorRateLimited": "Too many attempts. Wait a minute and try again.",
711
+ "errorGeneric": "Could not open the share link.",
712
+ "failed": "Failed: {{message}}"
631
713
  }
632
714
  }
@@ -96,7 +96,9 @@
96
96
  "placeholderConfigHint_other": "Haz clic en el enlace para configurar cada valor en el panel.",
97
97
  "setOverride": "Establecer valor",
98
98
  "placeholderPullAgain": "Después de establecer tus valores, ejecuta envshed pull de nuevo para actualizar tu archivo env local.",
99
- "envChanged": "Entorno modificado: {{count}} actualización(es) desde tu último pull (v{{from}} → v{{to}})"
99
+ "envChanged": "Entorno modificado: {{count}} actualización(es) desde tu último pull (v{{from}} → v{{to}})",
100
+ "disabledSkipped_one": "{{count}} secreto deshabilitado omitido",
101
+ "disabledSkipped_other": "{{count}} secretos deshabilitados omitidos"
100
102
  },
101
103
  "push": {
102
104
  "description": "Subir secretos desde un archivo .env",
@@ -156,7 +158,9 @@
156
158
  "watchRestarting": "Versión {{version}} de secretos detectada — reiniciando...",
157
159
  "watchRateLimit": "Límite de tasa alcanzado — esperando {{nextSec}}s",
158
160
  "watchPollError": "Error de sondeo ({{status}}) — reintentando",
159
- "watchPollFailed": "Sondeo fallido: {{message}} — reintentando"
161
+ "watchPollFailed": "Sondeo fallido: {{message}} — reintentando",
162
+ "disabledSkipped_one": "{{count}} secreto deshabilitado omitido",
163
+ "disabledSkipped_other": "{{count}} secretos deshabilitados omitidos"
160
164
  },
161
165
  "orgs": {
162
166
  "description": "Listar organizaciones",
@@ -604,6 +608,8 @@
604
608
  "getDescription": "Obtener el valor de un secreto por clave",
605
609
  "setDescription": "Establecer o actualizar el valor de un secreto",
606
610
  "deleteDescription": "Eliminar un secreto por clave",
611
+ "disableDescription": "Deshabilitar un secreto (ocultarlo del consumo sin eliminarlo)",
612
+ "enableDescription": "Volver a habilitar un secreto deshabilitado",
607
613
  "keyArg": "Nombre de la clave del secreto",
608
614
  "placeholderOption": "Marcar el secreto como marcador de posición",
609
615
  "ttyWarning": "Consejo: redirige a portapapeles o archivo para evitar exposición en el historial del terminal",
@@ -615,6 +621,12 @@
615
621
  "deleted": "Secreto {{key}} eliminado",
616
622
  "deleteConfirm": "¿Eliminar secreto {{key}}?",
617
623
  "deleteCancelled": "Eliminación cancelada",
624
+ "disabling": "Deshabilitando secreto...",
625
+ "enabling": "Habilitando secreto...",
626
+ "disabled": "Secreto {{key}} deshabilitado",
627
+ "enabled": "Secreto {{key}} habilitado",
628
+ "disableConfirm": "¿Deshabilitar secreto {{key}}? Se ocultará del consumo hasta volver a habilitarlo.",
629
+ "disableCancelled": "Deshabilitación cancelada",
618
630
  "failed": "Falló: {{message}}",
619
631
  "override": {
620
632
  "description": "Gestionar anulaciones personales de secretos",
@@ -628,5 +640,75 @@
628
640
  "removeConfirm": "¿Eliminar anulación para {{key}}?",
629
641
  "removeCancelled": "Eliminación cancelada"
630
642
  }
643
+ },
644
+ "share": {
645
+ "description": "Compartir secretos mediante enlaces cifrados con caducidad",
646
+ "createDescription": "Crear un enlace compartido para secretos de un entorno (todos los secretos si no se indican claves)",
647
+ "listDescription": "Listar enlaces compartidos de una organización",
648
+ "revokeDescription": "Revocar un enlace compartido",
649
+ "openDescription": "Abrir un enlace compartido e imprimir sus secretos (no requiere inicio de sesión)",
650
+ "keysArg": "Claves de secretos a compartir (por defecto: todos los secretos del entorno)",
651
+ "urlArg": "URL del enlace compartido (o <id>#<key>)",
652
+ "idArg": "ID del enlace compartido",
653
+ "expiresOption": "Duración, p. ej. 15m, 1h, 24h, 7d (máx. 30d)",
654
+ "burnOption": "Enlace de un solo uso: se autodestruye tras la primera apertura",
655
+ "maxViewsOption": "Número máximo de aperturas",
656
+ "passwordOption": "Proteger el enlace con contraseña (se solicita, o se lee de stdin si viene por tubería)",
657
+ "noteOption": "Nota que se muestra al destinatario",
658
+ "fileOption": "Escribir los secretos en un archivo (modo 0600) en lugar de stdout",
659
+ "invalidDuration": "Duración inválida \"{{value}}\". Usa minutos o un sufijo: 15m, 2h, 7d.",
660
+ "invalidMaxViews": "Valor de --max-views inválido. Usa un número entero de al menos 1.",
661
+ "invalidUrl": "No es un enlace compartido. Se esperaba https://app.envshed.com/s/<id>#<key>.",
662
+ "confirmAll": "¿Compartir TODOS los secretos de {{env}}?",
663
+ "confirmBurn": "Este enlace es de un solo uso. Abrirlo lo destruye. ¿Continuar?",
664
+ "cancelled": "Cancelado.",
665
+ "passwordPrompt": "Contraseña del enlace:",
666
+ "creating": "Creando enlace compartido...",
667
+ "created": "Enlace compartido creado",
668
+ "urlLabel": "URL",
669
+ "expiresLabel": "Caduca",
670
+ "viewsLabel": "Aperturas",
671
+ "viewsOneTime": "un solo uso (se destruye tras la primera apertura)",
672
+ "viewsUnlimited": "ilimitadas hasta la caducidad",
673
+ "viewsMax": "máx. {{count}}",
674
+ "passwordLabel": "Contraseña",
675
+ "passwordYes": "requerida",
676
+ "passwordNo": "ninguna",
677
+ "skipped": "Omitidos (sin valor compartible): {{keys}}",
678
+ "copyHint": "Copia la URL ahora: no se puede mostrar de nuevo.",
679
+ "openHint": "Los destinatarios sin navegador pueden ejecutar: envshed share open \"{{url}}\"",
680
+ "fetching": "Obteniendo enlaces compartidos...",
681
+ "noLinks": "No se encontraron enlaces compartidos.",
682
+ "headId": "ID",
683
+ "headSecrets": "Secretos",
684
+ "headStatus": "Estado",
685
+ "headViews": "Aperturas",
686
+ "headExpires": "Caduca",
687
+ "headBy": "Creado por",
688
+ "statusActive": "activo",
689
+ "statusExpired": "caducado",
690
+ "statusExhausted": "agotado",
691
+ "statusRevoked": "revocado",
692
+ "confirmRevoke": "¿Revocar el enlace compartido {{id}}? Quien lo tenga perderá el acceso de inmediato.",
693
+ "revoking": "Revocando enlace compartido...",
694
+ "revoked": "Enlace compartido revocado.",
695
+ "checking": "Comprobando enlace compartido...",
696
+ "opening": "Abriendo enlace compartido...",
697
+ "savedToFile_one": "Se guardó 1 secreto en {{file}}",
698
+ "savedToFile_other": "Se guardaron {{count}} secretos en {{file}}",
699
+ "ttyWarning": "Consejo: usa --file o redirige la salida para que los secretos no queden en el historial de la terminal",
700
+ "burnedNotice": "Este enlace de un solo uso ya se ha destruido.",
701
+ "remainingViews_one": "Queda {{count}} apertura en este enlace.",
702
+ "remainingViews_other": "Quedan {{count}} aperturas en este enlace.",
703
+ "errorNotFound": "Este enlace compartido no es válido o se ha eliminado.",
704
+ "errorExpired": "Este enlace compartido ha caducado.",
705
+ "errorExhausted": "Este enlace compartido ya se abrió el número máximo de veces.",
706
+ "errorRevoked": "El propietario revocó este enlace compartido.",
707
+ "errorLocked": "Este enlace compartido se bloqueó tras demasiados intentos de contraseña incorrectos.",
708
+ "errorInvalidPassword": "Contraseña incorrecta.",
709
+ "errorPasswordRequired": "Este enlace compartido requiere contraseña.",
710
+ "errorRateLimited": "Demasiados intentos. Espera un minuto e inténtalo de nuevo.",
711
+ "errorGeneric": "No se pudo abrir el enlace compartido.",
712
+ "failed": "Falló: {{message}}"
631
713
  }
632
714
  }
@@ -577,5 +577,75 @@
577
577
  "removeConfirm": "Remover substituição para {{key}}?",
578
578
  "removeCancelled": "Remoção cancelada"
579
579
  }
580
+ },
581
+ "share": {
582
+ "description": "Compartilhar secrets por meio de links criptografados com expiração",
583
+ "createDescription": "Criar um link de compartilhamento para secrets de um ambiente (todos os secrets quando nenhuma chave é informada)",
584
+ "listDescription": "Listar links de compartilhamento de uma organização",
585
+ "revokeDescription": "Revogar um link de compartilhamento",
586
+ "openDescription": "Abrir um link de compartilhamento e imprimir seus secrets (não requer login)",
587
+ "keysArg": "Chaves dos secrets a compartilhar (padrão: todos os secrets do ambiente)",
588
+ "urlArg": "URL do link de compartilhamento (ou <id>#<key>)",
589
+ "idArg": "ID do link de compartilhamento",
590
+ "expiresOption": "Duração, ex.: 15m, 1h, 24h, 7d (máx. 30d)",
591
+ "burnOption": "Link de uso único: se autodestrói após a primeira abertura",
592
+ "maxViewsOption": "Número máximo de aberturas",
593
+ "passwordOption": "Proteger o link com senha (solicitada, ou lida de stdin quando vier por pipe)",
594
+ "noteOption": "Observação exibida ao destinatário",
595
+ "fileOption": "Gravar os secrets em um arquivo (modo 0600) em vez de stdout",
596
+ "invalidDuration": "Duração inválida \"{{value}}\". Use minutos ou um sufixo: 15m, 2h, 7d.",
597
+ "invalidMaxViews": "Valor de --max-views inválido. Use um número inteiro de pelo menos 1.",
598
+ "invalidUrl": "Não é um link de compartilhamento. Esperado https://app.envshed.com/s/<id>#<key>.",
599
+ "confirmAll": "Compartilhar TODOS os secrets de {{env}}?",
600
+ "confirmBurn": "Este é um link de uso único. Abri-lo o destrói. Continuar?",
601
+ "cancelled": "Cancelado.",
602
+ "passwordPrompt": "Senha do link:",
603
+ "creating": "Criando link de compartilhamento...",
604
+ "created": "Link de compartilhamento criado",
605
+ "urlLabel": "URL",
606
+ "expiresLabel": "Expira",
607
+ "viewsLabel": "Aberturas",
608
+ "viewsOneTime": "uso único (destruído após a primeira abertura)",
609
+ "viewsUnlimited": "ilimitadas até a expiração",
610
+ "viewsMax": "máx. {{count}}",
611
+ "passwordLabel": "Senha",
612
+ "passwordYes": "obrigatória",
613
+ "passwordNo": "nenhuma",
614
+ "skipped": "Ignorados (sem valor compartilhável): {{keys}}",
615
+ "copyHint": "Copie a URL agora: ela não pode ser exibida novamente.",
616
+ "openHint": "Destinatários sem navegador podem executar: envshed share open \"{{url}}\"",
617
+ "fetching": "Buscando links de compartilhamento...",
618
+ "noLinks": "Nenhum link de compartilhamento encontrado.",
619
+ "headId": "ID",
620
+ "headSecrets": "Secrets",
621
+ "headStatus": "Status",
622
+ "headViews": "Aberturas",
623
+ "headExpires": "Expira",
624
+ "headBy": "Criado por",
625
+ "statusActive": "ativo",
626
+ "statusExpired": "expirado",
627
+ "statusExhausted": "esgotado",
628
+ "statusRevoked": "revogado",
629
+ "confirmRevoke": "Revogar o link de compartilhamento {{id}}? Quem o tiver perde o acesso imediatamente.",
630
+ "revoking": "Revogando link de compartilhamento...",
631
+ "revoked": "Link de compartilhamento revogado.",
632
+ "checking": "Verificando link de compartilhamento...",
633
+ "opening": "Abrindo link de compartilhamento...",
634
+ "savedToFile_one": "1 secret salvo em {{file}}",
635
+ "savedToFile_other": "{{count}} secrets salvos em {{file}}",
636
+ "ttyWarning": "Dica: use --file ou redirecione a saída para manter os secrets fora do histórico do terminal",
637
+ "burnedNotice": "Este link de uso único já foi destruído.",
638
+ "remainingViews_one": "{{count}} abertura restante neste link.",
639
+ "remainingViews_other": "{{count}} aberturas restantes neste link.",
640
+ "errorNotFound": "Este link de compartilhamento é inválido ou foi removido.",
641
+ "errorExpired": "Este link de compartilhamento expirou.",
642
+ "errorExhausted": "Este link de compartilhamento já foi aberto o número máximo de vezes.",
643
+ "errorRevoked": "Este link de compartilhamento foi revogado pelo proprietário.",
644
+ "errorLocked": "Este link de compartilhamento foi bloqueado após muitas tentativas de senha incorretas.",
645
+ "errorInvalidPassword": "Senha incorreta.",
646
+ "errorPasswordRequired": "Este link de compartilhamento requer senha.",
647
+ "errorRateLimited": "Muitas tentativas. Aguarde um minuto e tente novamente.",
648
+ "errorGeneric": "Não foi possível abrir o link de compartilhamento.",
649
+ "failed": "Falhou: {{message}}"
580
650
  }
581
651
  }
package/dist/utils.d.ts CHANGED
@@ -18,4 +18,19 @@ export declare function checkForBreakingChanges(existingSecrets: Record<string,
18
18
  modified: string[];
19
19
  deleted: string[];
20
20
  };
21
+ /**
22
+ * Parse a human duration into minutes: "15m", "2h", "7d", or a bare number
23
+ * of minutes. Returns null for anything else (including 0 / negatives).
24
+ */
25
+ export declare function parseDurationToMinutes(input: string): number | null;
26
+ /**
27
+ * Parse a share link. Accepts the full URL (`https://app.envshed.com/s/<id>#<key>`,
28
+ * with or without a locale prefix such as `/en/s/...`) or the bare `<id>#<key>`.
29
+ * `origin` is null for the bare form (caller falls back to the configured API URL).
30
+ */
31
+ export declare function parseShareUrl(input: string): {
32
+ origin: string | null;
33
+ id: string;
34
+ key: string;
35
+ } | null;
21
36
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAepE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAa3C"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAepE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAa3C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASnE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,GACZ;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAqB3D"}
package/dist/utils.js CHANGED
@@ -52,4 +52,50 @@ export function checkForBreakingChanges(existingSecrets, incomingSecrets) {
52
52
  }
53
53
  return { modified, deleted };
54
54
  }
55
+ /**
56
+ * Parse a human duration into minutes: "15m", "2h", "7d", or a bare number
57
+ * of minutes. Returns null for anything else (including 0 / negatives).
58
+ */
59
+ export function parseDurationToMinutes(input) {
60
+ const m = /^\s*(\d+)\s*([mhd]?)\s*$/i.exec(input ?? "");
61
+ if (!m)
62
+ return null;
63
+ const n = parseInt(m[1], 10);
64
+ if (!Number.isFinite(n) || n <= 0)
65
+ return null;
66
+ const unit = m[2].toLowerCase();
67
+ if (unit === "h")
68
+ return n * 60;
69
+ if (unit === "d")
70
+ return n * 24 * 60;
71
+ return n;
72
+ }
73
+ /**
74
+ * Parse a share link. Accepts the full URL (`https://app.envshed.com/s/<id>#<key>`,
75
+ * with or without a locale prefix such as `/en/s/...`) or the bare `<id>#<key>`.
76
+ * `origin` is null for the bare form (caller falls back to the configured API URL).
77
+ */
78
+ export function parseShareUrl(input) {
79
+ const trimmed = (input ?? "").trim();
80
+ const uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
81
+ const keyRe = /^[A-Za-z0-9_-]{43}$/;
82
+ const bare = /^([^#\s/]+)#([^#\s]+)$/.exec(trimmed);
83
+ if (bare && uuid.test(bare[1]) && keyRe.test(bare[2])) {
84
+ return { origin: null, id: bare[1], key: bare[2] };
85
+ }
86
+ let url;
87
+ try {
88
+ url = new URL(trimmed);
89
+ }
90
+ catch {
91
+ return null;
92
+ }
93
+ if (url.protocol !== "http:" && url.protocol !== "https:")
94
+ return null;
95
+ const path = /^\/(?:[A-Za-z]{2}(?:-[A-Za-z]{2})?\/)?s\/([^/]+)\/?$/.exec(url.pathname);
96
+ const key = url.hash.replace(/^#/, "");
97
+ if (!path || !uuid.test(path[1]) || !keyRe.test(key))
98
+ return null;
99
+ return { origin: url.origin, id: path[1], key };
100
+ }
55
101
  //# sourceMappingURL=utils.js.map
package/dist/utils.js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CLI — manage secrets from the terminal",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-MIT",