@gadgetinc/ggt 0.2.1 → 0.2.2
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/README.md +6 -6
- package/bin/dev.js +2 -2
- package/bin/run.js +1 -1
- package/lib/commands/help.js +2 -2
- package/lib/commands/help.js.map +1 -1
- package/lib/commands/list.js +3 -3
- package/lib/commands/list.js.map +1 -1
- package/lib/commands/login.js +2 -2
- package/lib/commands/login.js.map +1 -1
- package/lib/commands/logout.js +2 -2
- package/lib/commands/logout.js.map +1 -1
- package/lib/commands/sync.js +233 -88
- package/lib/commands/sync.js.map +1 -1
- package/lib/commands/whoami.js +2 -2
- package/lib/commands/whoami.js.map +1 -1
- package/lib/{utils → services}/base-command.js +23 -8
- package/lib/services/base-command.js.map +1 -0
- package/lib/{utils → services}/client.js +70 -21
- package/lib/services/client.js.map +1 -0
- package/lib/{utils → services}/context.js +42 -27
- package/lib/services/context.js.map +1 -0
- package/lib/{utils → services}/errors.js +8 -8
- package/lib/services/errors.js.map +1 -0
- package/lib/{utils → services}/flags.js +4 -3
- package/lib/services/flags.js.map +1 -0
- package/lib/{utils → services}/fs-utils.js +2 -2
- package/lib/services/fs-utils.js.map +1 -0
- package/lib/{utils → services}/help.js +1 -1
- package/lib/services/help.js.map +1 -0
- package/lib/services/promise.js.map +1 -0
- package/lib/{utils → services}/sleep.js +6 -2
- package/lib/services/sleep.js.map +1 -0
- package/npm-shrinkwrap.json +2188 -2630
- package/oclif.manifest.json +47 -7
- package/package.json +29 -28
- package/lib/utils/base-command.js.map +0 -1
- package/lib/utils/client.js.map +0 -1
- package/lib/utils/context.js.map +0 -1
- package/lib/utils/errors.js.map +0 -1
- package/lib/utils/flags.js.map +0 -1
- package/lib/utils/fs-utils.js.map +0 -1
- package/lib/utils/help.js.map +0 -1
- package/lib/utils/promise.js.map +0 -1
- package/lib/utils/sleep.js.map +0 -1
- /package/lib/{utils → services}/promise.js +0 -0
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ EXAMPLES
|
|
|
129
129
|
Goodbye!
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
_See code: [src/commands/sync.ts](https://github.com/gadget-inc/ggt/blob/v0.2.
|
|
132
|
+
_See code: [src/commands/sync.ts](https://github.com/gadget-inc/ggt/blob/v0.2.2/src/commands/sync.ts)_
|
|
133
133
|
|
|
134
134
|
### `ggt help [COMMAND]`
|
|
135
135
|
|
|
@@ -143,7 +143,7 @@ ARGUMENTS
|
|
|
143
143
|
COMMAND The command to show help for.
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
_See code: [src/commands/help.ts](https://github.com/gadget-inc/ggt/blob/v0.2.
|
|
146
|
+
_See code: [src/commands/help.ts](https://github.com/gadget-inc/ggt/blob/v0.2.2/src/commands/help.ts)_
|
|
147
147
|
|
|
148
148
|
### `ggt list`
|
|
149
149
|
|
|
@@ -170,7 +170,7 @@ EXAMPLES
|
|
|
170
170
|
$ ggt list --sort=slug
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
_See code: [src/commands/list.ts](https://github.com/gadget-inc/ggt/blob/v0.2.
|
|
173
|
+
_See code: [src/commands/list.ts](https://github.com/gadget-inc/ggt/blob/v0.2.2/src/commands/list.ts)_
|
|
174
174
|
|
|
175
175
|
### `ggt login`
|
|
176
176
|
|
|
@@ -189,7 +189,7 @@ EXAMPLES
|
|
|
189
189
|
Hello, Jane Doe (jane@example.com)
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
_See code: [src/commands/login.ts](https://github.com/gadget-inc/ggt/blob/v0.2.
|
|
192
|
+
_See code: [src/commands/login.ts](https://github.com/gadget-inc/ggt/blob/v0.2.2/src/commands/login.ts)_
|
|
193
193
|
|
|
194
194
|
### `ggt logout`
|
|
195
195
|
|
|
@@ -204,7 +204,7 @@ EXAMPLES
|
|
|
204
204
|
Goodbye
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
_See code: [src/commands/logout.ts](https://github.com/gadget-inc/ggt/blob/v0.2.
|
|
207
|
+
_See code: [src/commands/logout.ts](https://github.com/gadget-inc/ggt/blob/v0.2.2/src/commands/logout.ts)_
|
|
208
208
|
|
|
209
209
|
### `ggt whoami`
|
|
210
210
|
|
|
@@ -219,7 +219,7 @@ EXAMPLES
|
|
|
219
219
|
You are logged in as Jane Doe (jane@example.com)
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
_See code: [src/commands/whoami.ts](https://github.com/gadget-inc/ggt/blob/v0.2.
|
|
222
|
+
_See code: [src/commands/whoami.ts](https://github.com/gadget-inc/ggt/blob/v0.2.2/src/commands/whoami.ts)_
|
|
223
223
|
|
|
224
224
|
<!-- commandsstop -->
|
|
225
225
|
|
package/bin/dev.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node --loader ts-node/esm --no-warnings
|
|
2
2
|
|
|
3
|
+
import oclif from "@oclif/core";
|
|
3
4
|
import path from "node:path";
|
|
4
|
-
import url from "node:url";
|
|
5
5
|
import process from "node:process";
|
|
6
|
-
import
|
|
6
|
+
import url from "node:url";
|
|
7
7
|
|
|
8
8
|
process.env["NODE_ENV"] = "development";
|
|
9
9
|
process.env["GGT_ENV"] ??= "development";
|
package/bin/run.js
CHANGED
package/lib/commands/help.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
2
|
import { Args } from "@oclif/core";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { BaseCommand } from "../services/base-command.js";
|
|
4
|
+
import Help from "../services/help.js";
|
|
5
5
|
class HelpCommand extends BaseCommand {
|
|
6
6
|
async run() {
|
|
7
7
|
const { argv } = await this.parse();
|
package/lib/commands/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/help.ts"],"sourcesContent":["import { Args } from \"@oclif/core\";\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/commands/help.ts"],"sourcesContent":["import { Args } from \"@oclif/core\";\nimport { BaseCommand } from \"../services/base-command.js\";\nimport Help from \"../services/help.js\";\n\n/**\n * Copied from @oclif/plugin-help. Uses our own {@link Help} template class instead of the one from @oclif/core.\n *\n * @see https://github.com/oclif/plugin-help/blob/67b580570257b45e92d3a04d50bf2a432c59afe3/src/commands/help.ts\n */\nexport default class HelpCommand extends BaseCommand<typeof HelpCommand> {\n static override strict = false;\n\n static override summary = \"Display help for ggt.\";\n\n static override args = {\n command: Args.string({\n required: false,\n description: \"The command to show help for.\",\n }),\n };\n\n async run(): Promise<void> {\n const { argv } = await this.parse();\n const help = new Help(this.config, { all: true });\n await help.showHelp(argv as string[]);\n }\n}\n"],"names":["Args","BaseCommand","Help","HelpCommand","run","argv","parse","help","config","all","showHelp","strict","summary","args","command","string","required","description"],"mappings":";AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,OAAOC,UAAU,sBAAsB;AAOxB,MAAMC,oBAAoBF;IAYvC,MAAMG,MAAqB;QACzB,MAAM,EAAEC,IAAI,EAAE,GAAG,MAAM,IAAI,CAACC,KAAK;QACjC,MAAMC,OAAO,IAAIL,KAAK,IAAI,CAACM,MAAM,EAAE;YAAEC,KAAK;QAAK;QAC/C,MAAMF,KAAKG,QAAQ,CAACL;IACtB;AACF;AAhBE,iBADmBF,aACHQ,UAAS;AAEzB,iBAHmBR,aAGHS,WAAU;AAE1B,iBALmBT,aAKHU,QAAO;IACrBC,SAASd,KAAKe,MAAM,CAAC;QACnBC,UAAU;QACVC,aAAa;IACf;AACF;AAfF;;;;CAIC,GACD,SAAqBd,yBAiBpB"}
|
package/lib/commands/list.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
2
|
import { ux } from "@oclif/core";
|
|
3
|
-
import { dedent } from "ts-dedent";
|
|
4
|
-
import { BaseCommand } from "../utils/base-command.js";
|
|
5
|
-
import { context } from "../utils/context.js";
|
|
6
3
|
import chalkTemplate from "chalk-template";
|
|
4
|
+
import { dedent } from "ts-dedent";
|
|
5
|
+
import { BaseCommand } from "../services/base-command.js";
|
|
6
|
+
import { context } from "../services/context.js";
|
|
7
7
|
class List extends BaseCommand {
|
|
8
8
|
async run() {
|
|
9
9
|
const { flags } = await this.parse(List);
|
package/lib/commands/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/list.ts"],"sourcesContent":["import { ux } from \"@oclif/core\";\nimport { dedent } from \"ts-dedent\";\nimport { BaseCommand } from \"../
|
|
1
|
+
{"version":3,"sources":["../../src/commands/list.ts"],"sourcesContent":["import { ux } from \"@oclif/core\";\nimport chalkTemplate from \"chalk-template\";\nimport { dedent } from \"ts-dedent\";\nimport { BaseCommand } from \"../services/base-command.js\";\nimport type { App } from \"../services/context.js\";\nimport { context } from \"../services/context.js\";\n\nexport default class List extends BaseCommand<typeof List> {\n static override summary = \"List the apps available to the currently logged in user.\";\n\n static override usage = \"list\";\n\n static override examples = [\n dedent(chalkTemplate`\n {gray $ ggt list}\n {gray $ ggt list --extended}\n {gray $ ggt list --sort=slug}\n `),\n ];\n\n static override flags = {\n ...ux.table.flags(),\n };\n\n override requireUser = true;\n\n async run(): Promise<void> {\n const { flags } = await this.parse(List);\n\n const apps = await context.getAvailableApps();\n if (!apps.length) {\n this.log(dedent`\n It doesn't look like you have any applications.\n\n Visit https://gadget.new to create one!\n `);\n return;\n }\n\n ux.table<App & Record<string, never>>(\n apps as unknown as (App & Record<string, never>)[],\n {\n id: {\n header: \"ID\",\n extended: true,\n },\n slug: {\n header: \"Slug\",\n },\n primaryDomain: {\n header: \"Domain\",\n },\n },\n {\n printLine: this.log.bind(this),\n ...flags, // parsed flags\n },\n );\n }\n}\n"],"names":["ux","chalkTemplate","dedent","BaseCommand","context","List","run","flags","parse","apps","getAvailableApps","length","log","table","id","header","extended","slug","primaryDomain","printLine","bind","requireUser","summary","usage","examples"],"mappings":";AAAA,SAASA,EAAE,QAAQ,cAAc;AACjC,OAAOC,mBAAmB,iBAAiB;AAC3C,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,WAAW,QAAQ,8BAA8B;AAE1D,SAASC,OAAO,QAAQ,yBAAyB;AAElC,MAAMC,aAAaF;IAmBhC,MAAMG,MAAqB;QACzB,MAAM,EAAEC,KAAK,EAAE,GAAG,MAAM,IAAI,CAACC,KAAK,CAACH;QAEnC,MAAMI,OAAO,MAAML,QAAQM,gBAAgB;QAC3C,IAAI,CAACD,KAAKE,MAAM,EAAE;YAChB,IAAI,CAACC,GAAG,CAACV,MAAM,CAAC;;;;MAIhB,CAAC;YACD;QACF;QAEAF,GAAGa,KAAK,CACNJ,MACA;YACEK,IAAI;gBACFC,QAAQ;gBACRC,UAAU;YACZ;YACAC,MAAM;gBACJF,QAAQ;YACV;YACAG,eAAe;gBACbH,QAAQ;YACV;QACF,GACA;YACEI,WAAW,IAAI,CAACP,GAAG,CAACQ,IAAI,CAAC,IAAI;YAC7B,GAAGb,KAAK;QACV;IAEJ;;;QAlCA,uBAASc,eAAc;;AAmCzB;AAnDE,iBADmBhB,MACHiB,WAAU;AAE1B,iBAHmBjB,MAGHkB,SAAQ;AAExB,iBALmBlB,MAKHmB,YAAW;IACzBtB,OAAOD,aAAa,CAAC;;;;IAIrB,CAAC;CACF;AAED,iBAbmBI,MAaHE,SAAQ;IACtB,GAAGP,GAAGa,KAAK,CAACN,KAAK,EAAE;AACrB;AAfF,SAAqBF,kBAoDpB"}
|
package/lib/commands/login.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
|
-
import { dedent } from "ts-dedent";
|
|
3
|
-
import { BaseCommand } from "../utils/base-command.js";
|
|
4
2
|
import chalkTemplate from "chalk-template";
|
|
3
|
+
import { dedent } from "ts-dedent";
|
|
4
|
+
import { BaseCommand } from "../services/base-command.js";
|
|
5
5
|
class Login extends BaseCommand {
|
|
6
6
|
async run() {
|
|
7
7
|
await this.login();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/login.ts"],"sourcesContent":["import { dedent } from \"ts-dedent\";\nimport { BaseCommand } from \"../
|
|
1
|
+
{"version":3,"sources":["../../src/commands/login.ts"],"sourcesContent":["import chalkTemplate from \"chalk-template\";\nimport { dedent } from \"ts-dedent\";\nimport { BaseCommand } from \"../services/base-command.js\";\n\nexport default class Login extends BaseCommand<typeof Login> {\n static override summary = \"Log in to your account.\";\n\n static override usage = \"login\";\n\n static override examples = [\n dedent(chalkTemplate`\n {gray $ ggt login}\n We've opened Gadget's login page using your default browser.\n\n Please log in and then return to this terminal.\n\n Hello, Jane Doe {gray (jane@example.com)}\n `),\n ];\n\n async run(): Promise<void> {\n await this.login();\n }\n}\n"],"names":["chalkTemplate","dedent","BaseCommand","Login","run","login","summary","usage","examples"],"mappings":";AAAA,OAAOA,mBAAmB,iBAAiB;AAC3C,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,WAAW,QAAQ,8BAA8B;AAE3C,MAAMC,cAAcD;IAgBjC,MAAME,MAAqB;QACzB,MAAM,IAAI,CAACC,KAAK;IAClB;AACF;AAlBE,iBADmBF,OACHG,WAAU;AAE1B,iBAHmBH,OAGHI,SAAQ;AAExB,iBALmBJ,OAKHK,YAAW;IACzBP,OAAOD,aAAa,CAAC;;;;;;;IAOrB,CAAC;CACF;AAdH,SAAqBG,mBAmBpB"}
|
package/lib/commands/logout.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
2
|
import chalkTemplate from "chalk-template";
|
|
3
3
|
import { dedent } from "ts-dedent";
|
|
4
|
-
import { BaseCommand } from "../
|
|
5
|
-
import { context } from "../
|
|
4
|
+
import { BaseCommand } from "../services/base-command.js";
|
|
5
|
+
import { context } from "../services/context.js";
|
|
6
6
|
class Logout extends BaseCommand {
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
8
8
|
async run() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/logout.ts"],"sourcesContent":["import chalkTemplate from \"chalk-template\";\nimport { dedent } from \"ts-dedent\";\nimport { BaseCommand } from \"../
|
|
1
|
+
{"version":3,"sources":["../../src/commands/logout.ts"],"sourcesContent":["import chalkTemplate from \"chalk-template\";\nimport { dedent } from \"ts-dedent\";\nimport { BaseCommand } from \"../services/base-command.js\";\nimport { context } from \"../services/context.js\";\n\nexport default class Logout extends BaseCommand<typeof Logout> {\n static override summary = \"Log out of your account.\";\n\n static override usage = \"logout\";\n\n static override examples = [\n dedent(chalkTemplate`\n {gray $ ggt logout}\n Goodbye\n `),\n ];\n\n // eslint-disable-next-line @typescript-eslint/require-await\n async run(): Promise<void> {\n if (context.session) {\n context.session = undefined;\n this.log(\"Goodbye\");\n } else {\n this.log(\"You are not logged in\");\n }\n }\n}\n"],"names":["chalkTemplate","dedent","BaseCommand","context","Logout","run","session","undefined","log","summary","usage","examples"],"mappings":";AAAA,OAAOA,mBAAmB,iBAAiB;AAC3C,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,OAAO,QAAQ,yBAAyB;AAElC,MAAMC,eAAeF;IAYlC,4DAA4D;IAC5D,MAAMG,MAAqB;QACzB,IAAIF,QAAQG,OAAO,EAAE;YACnBH,QAAQG,OAAO,GAAGC;YAClB,IAAI,CAACC,GAAG,CAAC;QACX,OAAO;YACL,IAAI,CAACA,GAAG,CAAC;QACX;IACF;AACF;AApBE,iBADmBJ,QACHK,WAAU;AAE1B,iBAHmBL,QAGHM,SAAQ;AAExB,iBALmBN,QAKHO,YAAW;IACzBV,OAAOD,aAAa,CAAC;;;IAGrB,CAAC;CACF;AAVH,SAAqBI,oBAqBpB"}
|