@eloqnt/cli 0.0.5 → 0.0.7
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/CHANGELOG.md +13 -0
- package/dist/bin/eloqnt.mjs +1 -1
- package/dist/whoami-VnvhpU5y.mjs +2 -0
- package/package.json +2 -2
- package/dist/whoami-BO35bAgR.mjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @eloqnt/cli
|
|
2
2
|
|
|
3
|
+
## 0.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 62f3f06: `eloqnt whoami` now shows included usage and when it resets.
|
|
8
|
+
|
|
9
|
+
## 0.0.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [9345112]
|
|
14
|
+
- @eloqnt/sdk@0.0.6
|
|
15
|
+
|
|
3
16
|
## 0.0.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/bin/eloqnt.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import e from"node:process";import{defineCommand as t,runMain as n}from"citty";try{e.loadEnvFile()}catch{}n(t({meta:{name:`eloqnt`,description:`AI-powered translations for developers`},subCommands:{lint:r(()=>import(`../lint-EEWge-v7.mjs`)),translate:r(()=>import(`../translate-BjGIVueO.mjs`)),login:r(()=>import(`../login-I-q8XlUT.mjs`)),logout:r(()=>import(`../logout-BI-HnLL5.mjs`)),whoami:r(()=>import(`../whoami-
|
|
2
|
+
import e from"node:process";import{defineCommand as t,runMain as n}from"citty";try{e.loadEnvFile()}catch{}n(t({meta:{name:`eloqnt`,description:`AI-powered translations for developers`},subCommands:{lint:r(()=>import(`../lint-EEWge-v7.mjs`)),translate:r(()=>import(`../translate-BjGIVueO.mjs`)),login:r(()=>import(`../login-I-q8XlUT.mjs`)),logout:r(()=>import(`../logout-BI-HnLL5.mjs`)),whoami:r(()=>import(`../whoami-VnvhpU5y.mjs`))}}));function r(e){return()=>e().then(e=>e.default)}export{};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./defineEloqntCommand-BEnYhPuF.mjs";import{i as t,n}from"./urls-DdV5qJFG.mjs";import{EloqntSdkError as r,getAuthHeaders as i}from"@eloqnt/sdk";import a from"picocolors";function o(e){return a.dim(e.padEnd(14))}var s=e({meta:{name:`whoami`,description:`Shows the logged-in user account.`},requiresConfig:!1,async execute(){let e=await t();if(!e)throw new r(`NOT_AUTHENTICATED`,`Not logged in`,{hint:`Run eloqnt login to authenticate.`});let a=await fetch(new URL(`/api/engine/me`,n()),{headers:i(e)});if(a.status===401)throw new r(`NOT_AUTHENTICATED`,`Your session has expired`,{hint:`Run eloqnt login to sign in again.`});if(!a.ok)throw new r(`ENGINE_ERROR`,`Sorry, we couldn't load your account`,{details:`The studio API responded with ${a.status}.`,hint:`This is on our end. Try again in a few minutes.`});let o=await a.json();return{email:o.user.email,subscription:o.subscription.status,usage:o.usage}},render:({email:e,subscription:t,usage:r})=>{let i=[`${o(`Email:`)}${e}`,`${o(`Subscription:`)}${c(t)}`];return r&&i.push(`${o(`Quota used:`)}${l(r)}`),t===`none`&&i.push(``,a.cyan(`→ Subscribe at ${n()}/app`)),i.join(`
|
|
2
|
+
`)},json:e=>e});function c(e){return e===`active`?a.green(`active`):e===`trialing`?a.yellow(`trialing`):e}function l({usedPercent:e,resetsAt:t}){let n=`${e}%`;return`${e>=100?a.red(n):e>=80?a.yellow(n):a.green(n)} (resets ${new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`}).format(new Date(t))})`}export{s as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eloqnt/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "CLI for eloqnt/studio",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"citty": "^0.1.6",
|
|
31
31
|
"open": "^11.0.0",
|
|
32
32
|
"picocolors": "^1.1.1",
|
|
33
|
-
"@eloqnt/sdk": "0.0.
|
|
33
|
+
"@eloqnt/sdk": "0.0.6"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^25.9.1"
|
package/dist/whoami-BO35bAgR.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./defineEloqntCommand-BEnYhPuF.mjs";import{i as t,n}from"./urls-DdV5qJFG.mjs";import{EloqntSdkError as r,getAuthHeaders as i}from"@eloqnt/sdk";import a from"picocolors";var o=e({meta:{name:`whoami`,description:`Shows the logged-in user account.`},requiresConfig:!1,async execute(){let e=await t();if(!e)throw new r(`NOT_AUTHENTICATED`,`Not logged in`,{hint:`Run eloqnt login to authenticate.`});let a=await fetch(new URL(`/api/engine/me`,n()),{headers:i(e)});if(a.status===401)throw new r(`NOT_AUTHENTICATED`,`Your session has expired`,{hint:`Run eloqnt login to sign in again.`});if(!a.ok)throw new r(`ENGINE_ERROR`,`Sorry, we couldn't load your account`,{details:`The studio API responded with ${a.status}.`,hint:`This is on our end. Try again in a few minutes.`});let o=await a.json();return{email:o.user.email,subscription:o.subscription.status}},render:({email:e,subscription:t})=>`Email: ${a.green(e)}\nSubscription: ${s(t)}`,json:e=>e});function s(e){return e===`active`?a.green(`active`):e===`trialing`?a.yellow(`trialing`):e===`none`?a.yellow(`none (subscribe at ${n()}/app)`):a.yellow(e)}export{o as default};
|