@capawesome/cli 4.18.0 → 4.18.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/CHANGELOG.md +15 -0
- package/dist/commands/apps/automations/create.js +1 -1
- package/dist/commands/apps/automations/delete.js +1 -1
- package/dist/commands/apps/automations/get.js +1 -1
- package/dist/commands/apps/automations/list.js +1 -1
- package/dist/commands/apps/automations/update.js +1 -1
- package/dist/commands/apps/builds/cancel.js +1 -1
- package/dist/commands/apps/builds/create.js +1 -1
- package/dist/commands/apps/builds/download.js +1 -1
- package/dist/commands/apps/builds/failure-summary.js +1 -1
- package/dist/commands/apps/builds/get.js +1 -1
- package/dist/commands/apps/builds/list.js +1 -1
- package/dist/commands/apps/builds/logs.js +1 -1
- package/dist/commands/apps/builds/run.js +1 -1
- package/dist/commands/apps/builds/share.js +1 -1
- package/dist/commands/apps/builds/unshare.js +1 -1
- package/dist/commands/apps/bundles/create.js +1 -1
- package/dist/commands/apps/bundles/delete.js +1 -1
- package/dist/commands/apps/bundles/update.js +1 -1
- package/dist/commands/apps/certificates/create.js +1 -1
- package/dist/commands/apps/certificates/delete.js +1 -1
- package/dist/commands/apps/certificates/get.js +1 -1
- package/dist/commands/apps/certificates/list.js +1 -1
- package/dist/commands/apps/certificates/update.js +1 -1
- package/dist/commands/apps/channels/create.js +1 -1
- package/dist/commands/apps/channels/delete.js +1 -1
- package/dist/commands/apps/channels/get.js +1 -1
- package/dist/commands/apps/channels/list.js +1 -1
- package/dist/commands/apps/channels/pause.js +1 -1
- package/dist/commands/apps/channels/resume.js +1 -1
- package/dist/commands/apps/channels/update.js +1 -1
- package/dist/commands/apps/configurations/create.js +1 -1
- package/dist/commands/apps/configurations/delete.js +1 -1
- package/dist/commands/apps/configurations/get.js +1 -1
- package/dist/commands/apps/configurations/list.js +1 -1
- package/dist/commands/apps/configurations/update.js +1 -1
- package/dist/commands/apps/create.js +1 -1
- package/dist/commands/apps/delete.js +1 -1
- package/dist/commands/apps/deployments/cancel.js +1 -1
- package/dist/commands/apps/deployments/create.js +1 -1
- package/dist/commands/apps/deployments/failure-summary.js +1 -1
- package/dist/commands/apps/deployments/get.js +1 -1
- package/dist/commands/apps/deployments/list.js +1 -1
- package/dist/commands/apps/deployments/logs.js +1 -1
- package/dist/commands/apps/destinations/create.js +1 -1
- package/dist/commands/apps/destinations/delete.js +1 -1
- package/dist/commands/apps/destinations/get.js +1 -1
- package/dist/commands/apps/destinations/list.js +1 -1
- package/dist/commands/apps/destinations/update.js +1 -1
- package/dist/commands/apps/devices/delete.js +1 -1
- package/dist/commands/apps/devices/forcechannel.js +1 -1
- package/dist/commands/apps/devices/probe.js +1 -1
- package/dist/commands/apps/devices/unforcechannel.js +1 -1
- package/dist/commands/apps/environments/create.js +1 -1
- package/dist/commands/apps/environments/delete.js +1 -1
- package/dist/commands/apps/environments/get.js +1 -1
- package/dist/commands/apps/environments/list.js +1 -1
- package/dist/commands/apps/environments/set.js +1 -1
- package/dist/commands/apps/environments/unset.js +1 -1
- package/dist/commands/apps/get.js +1 -1
- package/dist/commands/apps/link.js +1 -1
- package/dist/commands/apps/list.js +1 -1
- package/dist/commands/apps/liveupdates/bundle.js +1 -1
- package/dist/commands/apps/liveupdates/create.js +1 -1
- package/dist/commands/apps/liveupdates/generate-manifest.js +1 -1
- package/dist/commands/apps/liveupdates/generate-signing-key.js +1 -1
- package/dist/commands/apps/liveupdates/register.js +1 -1
- package/dist/commands/apps/liveupdates/rollback.js +1 -1
- package/dist/commands/apps/liveupdates/rollout.js +1 -1
- package/dist/commands/apps/liveupdates/set-native-versions.js +1 -1
- package/dist/commands/apps/liveupdates/upload.js +1 -1
- package/dist/commands/apps/transfer.js +1 -1
- package/dist/commands/apps/unlink.js +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/login.js +4 -4
- package/dist/commands/logout.js +1 -1
- package/dist/commands/manifests/generate.js +1 -1
- package/dist/commands/organizations/create.js +1 -1
- package/dist/commands/organizations/get.js +1 -1
- package/dist/commands/organizations/list.js +1 -1
- package/dist/commands/whoami.js +1 -1
- package/dist/config/consts.js +2 -0
- package/dist/index.js +2 -2
- package/dist/index.test.js +1 -1
- package/dist/services/app-build-sources.js +4 -5
- package/dist/services/app-bundle-files.js +5 -6
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import appDevicesService from '../../../services/app-devices.js';
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
4
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
5
4
|
import consola from 'consola';
|
|
6
5
|
import { isInteractive } from '../../../utils/environment.js';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Delete an app device.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -3,9 +3,9 @@ import appDevicesService from '../../../services/app-devices.js';
|
|
|
3
3
|
import { withAuth } from '../../../utils/auth.js';
|
|
4
4
|
import { isInteractive } from '../../../utils/environment.js';
|
|
5
5
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
6
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
7
6
|
import consola from 'consola';
|
|
8
7
|
import { z } from 'zod';
|
|
8
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
9
9
|
export default defineCommand({
|
|
10
10
|
description: 'Force a device to use a specific channel.',
|
|
11
11
|
options: defineOptions(z.object({
|
|
@@ -2,10 +2,10 @@ import appDevicesService from '../../../services/app-devices.js';
|
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../../utils/environment.js';
|
|
4
4
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import { AxiosError } from 'axios';
|
|
7
6
|
import consola from 'consola';
|
|
8
7
|
import { z } from 'zod';
|
|
8
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
9
9
|
export default defineCommand({
|
|
10
10
|
description: 'Check whether a device would receive a live update.',
|
|
11
11
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import appDevicesService from '../../../services/app-devices.js';
|
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../../utils/environment.js';
|
|
4
4
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Remove the forced channel from a device.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import appEnvironmentsService from '../../../services/app-environments.js';
|
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../../utils/environment.js';
|
|
4
4
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Create a new environment.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import appEnvironmentsService from '../../../services/app-environments.js';
|
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../../utils/environment.js';
|
|
4
4
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Delete an environment.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import appEnvironmentsService from '../../../services/app-environments.js';
|
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../../utils/environment.js';
|
|
4
4
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Get an existing environment.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import appEnvironmentsService from '../../../services/app-environments.js';
|
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../../utils/environment.js';
|
|
4
4
|
import { promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'List all environments for an app.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -4,10 +4,10 @@ import { withAuth } from '../../../utils/auth.js';
|
|
|
4
4
|
import { isInteractive } from '../../../utils/environment.js';
|
|
5
5
|
import { isReadable } from '../../../utils/file.js';
|
|
6
6
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
7
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
8
7
|
import consola from 'consola';
|
|
9
8
|
import fs from 'fs';
|
|
10
9
|
import { z } from 'zod';
|
|
10
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
11
11
|
export default defineCommand({
|
|
12
12
|
description: 'Set environment variables and secrets.',
|
|
13
13
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import appEnvironmentsService from '../../../services/app-environments.js';
|
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../../utils/environment.js';
|
|
4
4
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Unset environment variables and secrets.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import appsService from '../../services/apps.js';
|
|
2
2
|
import { withAuth } from '../../utils/auth.js';
|
|
3
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
4
3
|
import consola from 'consola';
|
|
5
4
|
import { z } from 'zod';
|
|
5
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
6
6
|
export default defineCommand({
|
|
7
7
|
description: 'Get an existing app.',
|
|
8
8
|
options: defineOptions(z.object({
|
|
@@ -3,9 +3,9 @@ import { withAuth } from '../../utils/auth.js';
|
|
|
3
3
|
import { isInteractive } from '../../utils/environment.js';
|
|
4
4
|
import { getGitRemoteInfo } from '../../utils/git.js';
|
|
5
5
|
import { promptAppSelection, promptOrganizationSelection } from '../../utils/prompt.js';
|
|
6
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
7
6
|
import consola from 'consola';
|
|
8
7
|
import { z } from 'zod';
|
|
8
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
9
9
|
export default defineCommand({
|
|
10
10
|
description: 'Connect a git repository to an app.',
|
|
11
11
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import appsService from '../../services/apps.js';
|
|
|
2
2
|
import { withAuth } from '../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../utils/environment.js';
|
|
4
4
|
import { promptOrganizationSelection } from '../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Retrieve a list of existing apps.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isInteractive } from '../../../utils/environment.js';
|
|
2
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
2
3
|
import { directoryContainsSourceMaps, directoryContainsSymlinks, isDirectory, isReadable, pathExists, } from '../../../utils/file.js';
|
|
3
4
|
import { generateManifestJson } from '../../../utils/manifest.js';
|
|
4
5
|
import { prompt } from '../../../utils/prompt.js';
|
|
5
6
|
import zip from '../../../utils/zip.js';
|
|
6
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
7
7
|
import consola from 'consola';
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
import pathModule from 'path';
|
|
@@ -12,11 +12,11 @@ import { isReadable } from '../../../utils/file.js';
|
|
|
12
12
|
import { waitForJobCompletion } from '../../../utils/job.js';
|
|
13
13
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
14
14
|
import zip from '../../../utils/zip.js';
|
|
15
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
16
15
|
import consola from 'consola';
|
|
17
16
|
import fs from 'fs/promises';
|
|
18
17
|
import path from 'path';
|
|
19
18
|
import { z } from 'zod';
|
|
19
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
20
20
|
export default defineCommand({
|
|
21
21
|
description: 'Create a new live update by building and deploying web assets using Capawesome Cloud Runners.',
|
|
22
22
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import { isInteractive } from '../../../utils/environment.js';
|
|
|
2
2
|
import { directoryContainsSourceMaps, directoryContainsSymlinks, isReadable, isDirectory } from '../../../utils/file.js';
|
|
3
3
|
import { generateManifestJson } from '../../../utils/manifest.js';
|
|
4
4
|
import { prompt } from '../../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Generate a manifest file.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
2
1
|
import consola from 'consola';
|
|
3
2
|
import { promises as fs } from 'fs';
|
|
4
3
|
import pathModule from 'path';
|
|
5
4
|
import { z } from 'zod';
|
|
6
5
|
import { isInteractive } from '../../../utils/environment.js';
|
|
7
6
|
import { prompt } from '../../../utils/prompt.js';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
const APP_TYPES = ['capacitor', 'cordova'];
|
|
9
9
|
export default defineCommand({
|
|
10
10
|
description: 'Generate a new code signing key pair for Live Updates.',
|
|
@@ -11,9 +11,9 @@ import { formatPrivateKey } from '../../../utils/private-key.js';
|
|
|
11
11
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
12
12
|
import { createSignature } from '../../../utils/signature.js';
|
|
13
13
|
import zip from '../../../utils/zip.js';
|
|
14
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
15
14
|
import consola from 'consola';
|
|
16
15
|
import { z } from 'zod';
|
|
16
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
17
17
|
export default defineCommand({
|
|
18
18
|
description: 'Register a self-hosted bundle URL for serving artifacts from your own infrastructure.',
|
|
19
19
|
options: defineOptions(z.object({
|
|
@@ -5,9 +5,9 @@ import { withAuth } from '../../../utils/auth.js';
|
|
|
5
5
|
import { isInteractive } from '../../../utils/environment.js';
|
|
6
6
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
7
7
|
import { formatTimeAgo } from '../../../utils/time-format.js';
|
|
8
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
9
8
|
import consola from 'consola';
|
|
10
9
|
import { z } from 'zod';
|
|
10
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
11
11
|
export default defineCommand({
|
|
12
12
|
description: 'Rollback the active build in a channel to a previous build.',
|
|
13
13
|
options: defineOptions(z.object({
|
|
@@ -4,9 +4,9 @@ import appDeploymentsService from '../../../services/app-deployments.js';
|
|
|
4
4
|
import { withAuth } from '../../../utils/auth.js';
|
|
5
5
|
import { isInteractive } from '../../../utils/environment.js';
|
|
6
6
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
7
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
8
7
|
import consola from 'consola';
|
|
9
8
|
import { z } from 'zod';
|
|
9
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
10
10
|
export default defineCommand({
|
|
11
11
|
description: 'Update the rollout percentage of the active build in a channel.',
|
|
12
12
|
options: defineOptions(z.object({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import appBuildsService from '../../../services/app-builds.js';
|
|
2
2
|
import { withAuth } from '../../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../../utils/environment.js';
|
|
4
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
5
4
|
import consola from 'consola';
|
|
6
5
|
import { z } from 'zod';
|
|
6
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
7
7
|
export default defineCommand({
|
|
8
8
|
description: 'Set native version constraints on a web build.',
|
|
9
9
|
options: defineOptions(z.object({
|
|
@@ -4,6 +4,7 @@ import appBundlesService from '../../../services/app-bundles.js';
|
|
|
4
4
|
import appsService from '../../../services/apps.js';
|
|
5
5
|
import { withAuth } from '../../../utils/auth.js';
|
|
6
6
|
import { parseCustomProperties } from '../../../utils/custom-properties.js';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
7
8
|
import { createBufferFromPath, createBufferFromReadStream, createBufferFromString, isPrivateKeyContent, } from '../../../utils/buffer.js';
|
|
8
9
|
import { isInteractive } from '../../../utils/environment.js';
|
|
9
10
|
import { directoryContainsSourceMaps, directoryContainsSymlinks, isReadable, getFilesInDirectoryAndSubdirectories, isDirectory, } from '../../../utils/file.js';
|
|
@@ -13,7 +14,6 @@ import { formatPrivateKey } from '../../../utils/private-key.js';
|
|
|
13
14
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
14
15
|
import { createSignature } from '../../../utils/signature.js';
|
|
15
16
|
import zip from '../../../utils/zip.js';
|
|
16
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
17
17
|
import consola from 'consola';
|
|
18
18
|
import { createReadStream } from 'fs';
|
|
19
19
|
import pathModule from 'path';
|
|
@@ -2,9 +2,9 @@ import appsService from '../../services/apps.js';
|
|
|
2
2
|
import { withAuth } from '../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../utils/environment.js';
|
|
4
4
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Transfer an app to another organization.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import appsService from '../../services/apps.js';
|
|
|
2
2
|
import { withAuth } from '../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../utils/environment.js';
|
|
4
4
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Disconnect a git repository from an app.',
|
|
10
10
|
options: defineOptions(z.object({
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
import { defineCommand } from '@robingenz/zli';
|
|
3
2
|
import consola from 'consola';
|
|
4
3
|
import systeminformation from 'systeminformation';
|
|
4
|
+
import { defineCommand } from 'zodline';
|
|
5
5
|
const require = createRequire(import.meta.url);
|
|
6
6
|
const pkg = require('../../package.json');
|
|
7
7
|
export default defineCommand({
|
package/dist/commands/login.js
CHANGED
|
@@ -6,11 +6,11 @@ import { isInteractive } from '../utils/environment.js';
|
|
|
6
6
|
import { prompt } from '../utils/prompt.js';
|
|
7
7
|
import credentialStore from '../utils/credential-store.js';
|
|
8
8
|
import userConfig from '../utils/user-config.js';
|
|
9
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
10
9
|
import { AxiosError } from 'axios';
|
|
11
10
|
import consola from 'consola';
|
|
12
11
|
import open from 'open';
|
|
13
12
|
import { z } from 'zod';
|
|
13
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
14
14
|
export default defineCommand({
|
|
15
15
|
description: 'Sign in to the Capawesome Cloud Console.',
|
|
16
16
|
options: defineOptions(z.object({
|
|
@@ -48,13 +48,13 @@ export default defineCommand({
|
|
|
48
48
|
process.exit(1);
|
|
49
49
|
}
|
|
50
50
|
// Open the authorization URL in the user's default browser
|
|
51
|
-
consola.start('Opening browser...');
|
|
52
51
|
const authorizationUrl = `${consoleBaseUrl}/login/device`;
|
|
52
|
+
consola.start(`Opening browser at ${authorizationUrl}...`);
|
|
53
53
|
try {
|
|
54
54
|
open(authorizationUrl);
|
|
55
55
|
}
|
|
56
56
|
catch (error) {
|
|
57
|
-
consola.warn(
|
|
57
|
+
consola.warn('Could not open browser automatically. Please open the URL above manually.');
|
|
58
58
|
}
|
|
59
59
|
// Wait for the user to authenticate
|
|
60
60
|
consola.start('Waiting for authentication...');
|
|
@@ -112,7 +112,7 @@ export default defineCommand({
|
|
|
112
112
|
},
|
|
113
113
|
});
|
|
114
114
|
const createSession = async (deviceCode) => {
|
|
115
|
-
const maxAttempts =
|
|
115
|
+
const maxAttempts = 60;
|
|
116
116
|
const interval = 3 * 1000; // 3 seconds
|
|
117
117
|
let attempts = 0;
|
|
118
118
|
let session = null;
|
package/dist/commands/logout.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineCommand } from '@robingenz/zli';
|
|
2
1
|
import consola from 'consola';
|
|
3
2
|
import authorizationService from '../services/authorization-service.js';
|
|
4
3
|
import sessionsService from '../services/sessions.js';
|
|
5
4
|
import credentialStore from '../utils/credential-store.js';
|
|
6
5
|
import userConfig from '../utils/user-config.js';
|
|
6
|
+
import { defineCommand } from 'zodline';
|
|
7
7
|
export default defineCommand({
|
|
8
8
|
description: 'Sign out from the Capawesome Cloud Console.',
|
|
9
9
|
action: async (options, args) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
2
1
|
import consola from 'consola';
|
|
3
2
|
import { z } from 'zod';
|
|
3
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: 'Generate a manifest file. Deprecated, use `apps:liveupdates:generate-manifest` instead.',
|
|
6
6
|
options: defineOptions(z.object({
|
|
@@ -2,9 +2,9 @@ import organizationsService from '../../services/organizations.js';
|
|
|
2
2
|
import { withAuth } from '../../utils/auth.js';
|
|
3
3
|
import { isInteractive } from '../../utils/environment.js';
|
|
4
4
|
import { prompt } from '../../utils/prompt.js';
|
|
5
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
import { z } from 'zod';
|
|
7
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Create a new organization.',
|
|
10
10
|
options: defineOptions(z.object({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import organizationsService from '../../services/organizations.js';
|
|
2
2
|
import { withAuth } from '../../utils/auth.js';
|
|
3
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
4
3
|
import consola from 'consola';
|
|
5
4
|
import { z } from 'zod';
|
|
5
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
6
6
|
export default defineCommand({
|
|
7
7
|
description: 'Get an existing organization.',
|
|
8
8
|
options: defineOptions(z.object({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import organizationsService from '../../services/organizations.js';
|
|
2
2
|
import { withAuth } from '../../utils/auth.js';
|
|
3
|
-
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
4
3
|
import consola from 'consola';
|
|
5
4
|
import { z } from 'zod';
|
|
5
|
+
import { defineCommand, defineOptions } from 'zodline';
|
|
6
6
|
export default defineCommand({
|
|
7
7
|
description: 'Retrieve a list of existing organizations.',
|
|
8
8
|
options: defineOptions(z.object({
|
package/dist/commands/whoami.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import authorizationService from '../services/authorization-service.js';
|
|
2
2
|
import usersService from '../services/users.js';
|
|
3
|
-
import { defineCommand } from '@robingenz/zli';
|
|
4
3
|
import { AxiosError } from 'axios';
|
|
5
4
|
import consola from 'consola';
|
|
5
|
+
import { defineCommand } from 'zodline';
|
|
6
6
|
export default defineCommand({
|
|
7
7
|
description: 'Show current user',
|
|
8
8
|
action: async (options, args) => {
|
package/dist/config/consts.js
CHANGED
|
@@ -3,3 +3,5 @@ export const DEFAULT_CONSOLE_BASE_URL = 'https://console.cloud.capawesome.io';
|
|
|
3
3
|
export const MANIFEST_JSON_FILE_NAME = 'capawesome-live-update-manifest.json'; // Do NOT change this!
|
|
4
4
|
export const MAX_CONCURRENT_FILE_UPLOADS = 20;
|
|
5
5
|
export const MAX_CONCURRENT_PART_UPLOADS = 4;
|
|
6
|
+
export const MULTIPART_UPLOAD_THRESHOLD_IN_BYTES = 10 * 1024 * 1024; // 10 MB
|
|
7
|
+
export const UPLOAD_PART_SIZE_IN_BYTES = 10 * 1024 * 1024; // 10 MB. 5 MB is the minimum part size except for the last part.
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import telemetryService from './services/telemetry.js';
|
|
|
4
4
|
import updateService from './services/update.js';
|
|
5
5
|
import { getMessageFromUnknownError, UserError } from './utils/error.js';
|
|
6
6
|
import userConfig from './utils/user-config.js';
|
|
7
|
-
import { defineConfig, processConfig, ZliError } from '@robingenz/zli';
|
|
8
7
|
import * as Sentry from '@sentry/node';
|
|
9
8
|
import { AxiosError } from 'axios';
|
|
10
9
|
import consola from 'consola';
|
|
11
10
|
import { createRequire } from 'module';
|
|
12
11
|
import { ZodError } from 'zod';
|
|
12
|
+
import { defineConfig, processConfig, ZodlineError } from 'zodline';
|
|
13
13
|
const require = createRequire(import.meta.url);
|
|
14
14
|
const pkg = require('../package.json');
|
|
15
15
|
const config = defineConfig({
|
|
@@ -111,7 +111,7 @@ const captureException = async (error) => {
|
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
// Ignore errors from the CLI itself (e.g. "No command found.")
|
|
114
|
-
if (error instanceof
|
|
114
|
+
if (error instanceof ZodlineError) {
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
// Ignore validation errors
|
package/dist/index.test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
import { defineConfig, processConfig } from '@robingenz/zli';
|
|
3
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import { defineConfig, processConfig } from 'zodline';
|
|
4
4
|
const require = createRequire(import.meta.url);
|
|
5
5
|
const pkg = require('../package.json');
|
|
6
6
|
const config = defineConfig({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MAX_CONCURRENT_PART_UPLOADS } from '../config/index.js';
|
|
1
|
+
import { MAX_CONCURRENT_PART_UPLOADS, UPLOAD_PART_SIZE_IN_BYTES } from '../config/index.js';
|
|
2
2
|
import authorizationService from '../services/authorization-service.js';
|
|
3
3
|
import httpClient from '../utils/http-client.js';
|
|
4
4
|
import FormData from 'form-data';
|
|
@@ -63,8 +63,7 @@ class AppBuildSourcesServiceImpl {
|
|
|
63
63
|
}
|
|
64
64
|
async createUploadParts(dto, onProgress) {
|
|
65
65
|
const uploadedParts = [];
|
|
66
|
-
const
|
|
67
|
-
const totalParts = Math.ceil(dto.buffer.byteLength / partSize);
|
|
66
|
+
const totalParts = Math.ceil(dto.buffer.byteLength / UPLOAD_PART_SIZE_IN_BYTES);
|
|
68
67
|
let partNumber = 0;
|
|
69
68
|
const uploadNextPart = async () => {
|
|
70
69
|
if (partNumber >= totalParts) {
|
|
@@ -72,8 +71,8 @@ class AppBuildSourcesServiceImpl {
|
|
|
72
71
|
}
|
|
73
72
|
partNumber++;
|
|
74
73
|
onProgress?.(partNumber, totalParts);
|
|
75
|
-
const start = (partNumber - 1) *
|
|
76
|
-
const end = Math.min(start +
|
|
74
|
+
const start = (partNumber - 1) * UPLOAD_PART_SIZE_IN_BYTES;
|
|
75
|
+
const end = Math.min(start + UPLOAD_PART_SIZE_IN_BYTES, dto.buffer.byteLength);
|
|
77
76
|
const partBuffer = dto.buffer.subarray(start, end);
|
|
78
77
|
const uploadedPart = await this.createUploadPart({
|
|
79
78
|
appBuildSourceId: dto.appBuildSourceId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MAX_CONCURRENT_PART_UPLOADS } from '../config/index.js';
|
|
1
|
+
import { MAX_CONCURRENT_PART_UPLOADS, MULTIPART_UPLOAD_THRESHOLD_IN_BYTES, UPLOAD_PART_SIZE_IN_BYTES, } from '../config/index.js';
|
|
2
2
|
import authorizationService from '../services/authorization-service.js';
|
|
3
3
|
import httpClient from '../utils/http-client.js';
|
|
4
4
|
import FormData from 'form-data';
|
|
@@ -9,7 +9,7 @@ class AppBundleFilesServiceImpl {
|
|
|
9
9
|
}
|
|
10
10
|
async create(dto, onProgress) {
|
|
11
11
|
const sizeInBytes = dto.buffer.byteLength;
|
|
12
|
-
const useMultipartUpload = sizeInBytes >=
|
|
12
|
+
const useMultipartUpload = sizeInBytes >= MULTIPART_UPLOAD_THRESHOLD_IN_BYTES;
|
|
13
13
|
const formData = new FormData();
|
|
14
14
|
formData.append('checksum', dto.checksum);
|
|
15
15
|
if (!useMultipartUpload) {
|
|
@@ -76,8 +76,7 @@ class AppBundleFilesServiceImpl {
|
|
|
76
76
|
}
|
|
77
77
|
async createUploadParts(dto, onProgress) {
|
|
78
78
|
const uploadedParts = [];
|
|
79
|
-
const
|
|
80
|
-
const totalParts = Math.ceil(dto.buffer.byteLength / partSize);
|
|
79
|
+
const totalParts = Math.ceil(dto.buffer.byteLength / UPLOAD_PART_SIZE_IN_BYTES);
|
|
81
80
|
let partNumber = 0;
|
|
82
81
|
const uploadNextPart = async () => {
|
|
83
82
|
if (partNumber >= totalParts) {
|
|
@@ -85,8 +84,8 @@ class AppBundleFilesServiceImpl {
|
|
|
85
84
|
}
|
|
86
85
|
partNumber++;
|
|
87
86
|
onProgress?.(partNumber, totalParts);
|
|
88
|
-
const start = (partNumber - 1) *
|
|
89
|
-
const end = Math.min(start +
|
|
87
|
+
const start = (partNumber - 1) * UPLOAD_PART_SIZE_IN_BYTES;
|
|
88
|
+
const end = Math.min(start + UPLOAD_PART_SIZE_IN_BYTES, dto.buffer.byteLength);
|
|
90
89
|
const partBuffer = dto.buffer.subarray(start, end);
|
|
91
90
|
const uploadedPart = await this.createUploadPart({
|
|
92
91
|
appBundleFileId: dto.appBundleFileId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/cli",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.2",
|
|
4
4
|
"description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@clack/prompts": "0.7.0",
|
|
59
59
|
"@napi-rs/keyring": "1.3.0",
|
|
60
|
-
"@robingenz/zli": "0.2.0",
|
|
61
60
|
"@sentry/node": "10.58.0",
|
|
62
61
|
"adm-zip": "0.6.0",
|
|
63
62
|
"axios": "1.18.1",
|
|
@@ -73,7 +72,8 @@
|
|
|
73
72
|
"rc9": "2.1.2",
|
|
74
73
|
"semver": "7.6.3",
|
|
75
74
|
"systeminformation": "5.31.17",
|
|
76
|
-
"zod": "4.0.17"
|
|
75
|
+
"zod": "4.0.17",
|
|
76
|
+
"zodline": "0.3.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@ionic/prettier-config": "4.0.0",
|