@sidekickdb/cli 2.0.0 → 3.0.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.
- package/.turbo/turbo-build.log +1 -1
- package/README.md +5 -5
- package/__tests__/appCommands.test.ts +8 -8
- package/__tests__/auth.test.ts +11 -65
- package/__tests__/authClientAddApple.test.ts +3 -3
- package/__tests__/authClientAddClerk.test.ts +8 -13
- package/__tests__/authClientAddGithub.test.ts +5 -5
- package/__tests__/authClientAddGoogle.test.ts +3 -3
- package/__tests__/authClientAddLinkedin.test.ts +3 -3
- package/__tests__/authClientList.test.ts +4 -3
- package/__tests__/authClientUpdate.test.ts +6 -8
- package/__tests__/authOriginManagement.test.ts +11 -11
- package/__tests__/backups.test.ts +2 -2
- package/__tests__/config.test.ts +34 -34
- package/__tests__/configAliases.test.ts +27 -215
- package/__tests__/configFileNames.test.ts +118 -0
- package/__tests__/e2e/cli.e2e.test.ts +102 -102
- package/__tests__/e2e/helpers.ts +5 -5
- package/__tests__/effectHelpers.ts +3 -3
- package/__tests__/emailVerification.test.ts +31 -0
- package/__tests__/oldConfigFiles.test.ts +254 -0
- package/__tests__/webhooks.test.ts +2 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +6 -43
- package/dist/auth/index.js.map +1 -1
- package/dist/commands/app/delete.d.ts +2 -2
- package/dist/commands/app/delete.d.ts.map +1 -1
- package/dist/commands/app/delete.js +2 -2
- package/dist/commands/app/delete.js.map +1 -1
- package/dist/commands/app/list.d.ts +2 -2
- package/dist/commands/app/list.d.ts.map +1 -1
- package/dist/commands/app/list.js +2 -2
- package/dist/commands/app/list.js.map +1 -1
- package/dist/commands/auth/client/add.d.ts +1 -1
- package/dist/commands/auth/client/add.d.ts.map +1 -1
- package/dist/commands/auth/client/delete.d.ts +2 -2
- package/dist/commands/auth/client/delete.d.ts.map +1 -1
- package/dist/commands/auth/client/delete.js +2 -2
- package/dist/commands/auth/client/delete.js.map +1 -1
- package/dist/commands/auth/client/list.d.ts +1 -1
- package/dist/commands/auth/client/list.d.ts.map +1 -1
- package/dist/commands/auth/client/update.d.ts +1 -1
- package/dist/commands/auth/client/update.d.ts.map +1 -1
- package/dist/commands/auth/email/pull.d.ts +4 -4
- package/dist/commands/auth/email/pull.d.ts.map +1 -1
- package/dist/commands/auth/email/pull.js +5 -2
- package/dist/commands/auth/email/pull.js.map +1 -1
- package/dist/commands/auth/email/push.d.ts +2 -2
- package/dist/commands/auth/email/push.d.ts.map +1 -1
- package/dist/commands/auth/email/push.js +3 -3
- package/dist/commands/auth/email/push.js.map +1 -1
- package/dist/commands/auth/email/resend.d.ts +1 -1
- package/dist/commands/auth/email/resend.d.ts.map +1 -1
- package/dist/commands/auth/email/reset.d.ts +2 -2
- package/dist/commands/auth/email/reset.d.ts.map +1 -1
- package/dist/commands/auth/email/reset.js +3 -3
- package/dist/commands/auth/email/reset.js.map +1 -1
- package/dist/commands/auth/email/status.d.ts +4 -4
- package/dist/commands/auth/email/status.d.ts.map +1 -1
- package/dist/commands/auth/email/status.js +4 -4
- package/dist/commands/auth/email/status.js.map +1 -1
- package/dist/commands/auth/email/verify.d.ts +1 -1
- package/dist/commands/auth/email/verify.d.ts.map +1 -1
- package/dist/commands/auth/email/verify.js +1 -1
- package/dist/commands/auth/email/verify.js.map +1 -1
- package/dist/commands/auth/origin/add.d.ts +1 -1
- package/dist/commands/auth/origin/add.d.ts.map +1 -1
- package/dist/commands/auth/origin/delete.d.ts +1 -1
- package/dist/commands/auth/origin/delete.d.ts.map +1 -1
- package/dist/commands/auth/origin/list.d.ts +1 -1
- package/dist/commands/auth/origin/list.d.ts.map +1 -1
- package/dist/commands/claim.d.ts +2 -2
- package/dist/commands/claim.d.ts.map +1 -1
- package/dist/commands/claim.js +2 -2
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/info.js +2 -2
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/initWithoutFiles.d.ts.map +1 -1
- package/dist/commands/initWithoutFiles.js +7 -3
- package/dist/commands/initWithoutFiles.js.map +1 -1
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/pull.d.ts +1 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +4 -0
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.d.ts +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +4 -0
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/query.d.ts +1 -1
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +2 -2
- package/dist/commands/query.js.map +1 -1
- package/dist/context/authToken.d.ts +2 -2
- package/dist/context/authToken.d.ts.map +1 -1
- package/dist/context/authToken.js +6 -4
- package/dist/context/authToken.js.map +1 -1
- package/dist/context/currentApp.d.ts +3 -3
- package/dist/context/currentApp.d.ts.map +1 -1
- package/dist/context/currentApp.js +20 -20
- package/dist/context/currentApp.js.map +1 -1
- package/dist/context/globalOpts.d.ts +1 -1
- package/dist/context/globalOpts.js +1 -1
- package/dist/context/globalOpts.js.map +1 -1
- package/dist/context/platformApi.d.ts +3 -3
- package/dist/context/platformApi.d.ts.map +1 -1
- package/dist/context/platformApi.js +3 -3
- package/dist/context/platformApi.js.map +1 -1
- package/dist/context/projectInfo.d.ts +4 -4
- package/dist/context/projectInfo.d.ts.map +1 -1
- package/dist/context/projectInfo.js +12 -18
- package/dist/context/projectInfo.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -49
- package/dist/index.js.map +1 -1
- package/dist/layer.d.ts +4 -4
- package/dist/layer.d.ts.map +1 -1
- package/dist/layer.js +7 -7
- package/dist/layer.js.map +1 -1
- package/dist/lib/backupDownload.js +1 -1
- package/dist/lib/backupDownload.js.map +1 -1
- package/dist/lib/config.d.ts +2 -2
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +21 -23
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/createApp.d.ts +2 -2
- package/dist/lib/createApp.d.ts.map +1 -1
- package/dist/lib/createApp.js +2 -2
- package/dist/lib/createApp.js.map +1 -1
- package/dist/lib/email.d.ts +38 -6
- package/dist/lib/email.d.ts.map +1 -1
- package/dist/lib/email.js +22 -13
- package/dist/lib/email.js.map +1 -1
- package/dist/lib/handleEnv.js +4 -4
- package/dist/lib/handleEnv.js.map +1 -1
- package/dist/lib/http.d.ts +13 -13
- package/dist/lib/http.d.ts.map +1 -1
- package/dist/lib/http.js +12 -12
- package/dist/lib/http.js.map +1 -1
- package/dist/lib/login.d.ts +4 -4
- package/dist/lib/login.d.ts.map +1 -1
- package/dist/lib/login.js +4 -4
- package/dist/lib/login.js.map +1 -1
- package/dist/lib/oauth.d.ts +10 -10
- package/dist/lib/oauth.d.ts.map +1 -1
- package/dist/lib/oauth.js +7 -7
- package/dist/lib/oauth.js.map +1 -1
- package/dist/lib/platformApi.d.ts +2 -2
- package/dist/lib/platformApi.d.ts.map +1 -1
- package/dist/lib/platformApi.js +2 -2
- package/dist/lib/platformApi.js.map +1 -1
- package/dist/lib/pullPerms.d.ts +2 -2
- package/dist/lib/pullPerms.d.ts.map +1 -1
- package/dist/lib/pullPerms.js +7 -4
- package/dist/lib/pullPerms.js.map +1 -1
- package/dist/lib/pullSchema.d.ts +2 -2
- package/dist/lib/pullSchema.d.ts.map +1 -1
- package/dist/lib/pullSchema.js +8 -5
- package/dist/lib/pullSchema.js.map +1 -1
- package/dist/lib/pushPerms.d.ts +2 -2
- package/dist/lib/pushPerms.d.ts.map +1 -1
- package/dist/lib/pushPerms.js +6 -3
- package/dist/lib/pushPerms.js.map +1 -1
- package/dist/lib/pushSchema.d.ts +2 -2
- package/dist/lib/pushSchema.d.ts.map +1 -1
- package/dist/lib/pushSchema.js +18 -7
- package/dist/lib/pushSchema.js.map +1 -1
- package/dist/lib/webhooks.d.ts +1 -1
- package/dist/lib/webhooks.d.ts.map +1 -1
- package/dist/old.js +9 -9
- package/dist/old.js.map +1 -1
- package/dist/renderSchemaPlan.d.ts +2 -2
- package/dist/renderSchemaPlan.d.ts.map +1 -1
- package/dist/renderSchemaPlan.js.map +1 -1
- package/dist/util/findConfigCandidates.d.ts +0 -20
- package/dist/util/findConfigCandidates.d.ts.map +1 -1
- package/dist/util/findConfigCandidates.js +44 -63
- package/dist/util/findConfigCandidates.js.map +1 -1
- package/dist/util/getAppName.d.ts +2 -2
- package/dist/util/getAppName.d.ts.map +1 -1
- package/dist/util/getAppName.js +2 -2
- package/dist/util/getAppName.js.map +1 -1
- package/dist/util/isHeadlessEnvironment.js +1 -1
- package/dist/util/isHeadlessEnvironment.js.map +1 -1
- package/dist/util/loadConfig.d.ts.map +1 -1
- package/dist/util/loadConfig.js +4 -11
- package/dist/util/loadConfig.js.map +1 -1
- package/dist/util/loadEnv.d.ts.map +1 -1
- package/dist/util/loadEnv.js +0 -6
- package/dist/util/loadEnv.js.map +1 -1
- package/dist/util/oldConfigFiles.d.ts +30 -0
- package/dist/util/oldConfigFiles.d.ts.map +1 -0
- package/dist/util/oldConfigFiles.js +104 -0
- package/dist/util/oldConfigFiles.js.map +1 -0
- package/dist/util/projectDir.d.ts +1 -1
- package/dist/util/projectDir.d.ts.map +1 -1
- package/dist/util/projectDir.js +6 -9
- package/dist/util/projectDir.js.map +1 -1
- package/dist/util/sidekickConfig.d.ts +9 -0
- package/dist/util/sidekickConfig.d.ts.map +1 -0
- package/dist/util/sidekickConfig.js +18 -0
- package/dist/util/sidekickConfig.js.map +1 -0
- package/package.json +6 -7
- package/src/auth/index.ts +6 -54
- package/src/commands/app/delete.ts +2 -2
- package/src/commands/app/list.ts +2 -2
- package/src/commands/auth/client/delete.ts +2 -2
- package/src/commands/auth/email/pull.ts +5 -2
- package/src/commands/auth/email/push.ts +3 -3
- package/src/commands/auth/email/reset.ts +5 -3
- package/src/commands/auth/email/status.ts +4 -4
- package/src/commands/auth/email/verify.ts +1 -1
- package/src/commands/claim.ts +2 -2
- package/src/commands/info.ts +2 -2
- package/src/commands/init.ts +3 -0
- package/src/commands/initWithoutFiles.ts +13 -6
- package/src/commands/pull.ts +6 -0
- package/src/commands/push.ts +6 -0
- package/src/commands/query.ts +2 -2
- package/src/context/authToken.ts +9 -5
- package/src/context/currentApp.ts +20 -20
- package/src/context/globalOpts.ts +1 -1
- package/src/context/platformApi.ts +3 -3
- package/src/context/projectInfo.ts +13 -20
- package/src/index.ts +42 -52
- package/src/layer.ts +10 -10
- package/src/lib/backupDownload.ts +1 -1
- package/src/lib/config.ts +21 -23
- package/src/lib/createApp.ts +2 -2
- package/src/lib/email.ts +30 -15
- package/src/lib/handleEnv.ts +4 -4
- package/src/lib/http.ts +28 -24
- package/src/lib/login.ts +4 -4
- package/src/lib/oauth.ts +7 -7
- package/src/lib/platformApi.ts +2 -2
- package/src/lib/pullPerms.ts +7 -4
- package/src/lib/pullSchema.ts +9 -6
- package/src/lib/pushPerms.ts +6 -3
- package/src/lib/pushSchema.ts +19 -7
- package/src/old.js +9 -9
- package/src/renderSchemaPlan.ts +3 -3
- package/src/util/findConfigCandidates.ts +45 -71
- package/src/util/getAppName.ts +2 -2
- package/src/util/isHeadlessEnvironment.ts +1 -1
- package/src/util/loadConfig.ts +4 -12
- package/src/util/loadEnv.ts +0 -8
- package/src/util/oldConfigFiles.ts +132 -0
- package/src/util/projectDir.ts +7 -9
- package/src/util/sidekickConfig.ts +25 -0
- package/__tests__/legacyPackageCompat.test.ts +0 -104
- package/dist/util/envAliases.d.ts +0 -25
- package/dist/util/envAliases.d.ts.map +0 -1
- package/dist/util/envAliases.js +0 -47
- package/dist/util/envAliases.js.map +0 -1
- package/dist/util/instantConfig.d.ts +0 -9
- package/dist/util/instantConfig.d.ts.map +0 -1
- package/dist/util/instantConfig.js +0 -13
- package/dist/util/instantConfig.js.map +0 -1
- package/src/util/envAliases.ts +0 -53
- package/src/util/instantConfig.ts +0 -21
package/.turbo/turbo-build.log
CHANGED
package/README.md
CHANGED
|
@@ -7,16 +7,16 @@ Part of [SidekickDB](https://github.com/SidekickDB/sidekick), an independent con
|
|
|
7
7
|
Welcome to SidekickDB's command line tool. You can create apps, write schema, and push permissions.
|
|
8
8
|
|
|
9
9
|
```javascript
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
SIDEKICK_CLI_API_URI=https://sidekick.example.com \
|
|
11
|
+
SIDEKICK_CLI_DASH_URI=https://dash.sidekick.example.com \
|
|
12
12
|
npx @sidekickdb/cli init
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
There is no default server: set `
|
|
15
|
+
There is no default server: set `SIDEKICK_CLI_API_URI` (or `apiURI` in `sidekick.config.ts`) to your SidekickDB server, and `SIDEKICK_CLI_DASH_URI` (or `dashURI`) to its dashboard for commands such as `login`.
|
|
16
16
|
|
|
17
17
|
## Get Started
|
|
18
18
|
|
|
19
|
-
Start by peeking at the [@sidekickdb/cli docs](https://
|
|
19
|
+
Start by peeking at the [@sidekickdb/cli docs](https://sidekickdb.co/docs/cli).
|
|
20
20
|
|
|
21
21
|
# Contributing
|
|
22
22
|
|
|
@@ -42,7 +42,7 @@ make dev
|
|
|
42
42
|
|
|
43
43
|
# Now go into a place where you can test out the CLI in your terminal
|
|
44
44
|
cd client/sandbox/cli-nodejs
|
|
45
|
-
|
|
45
|
+
SIDEKICK_CLI_DEV=1 npx @sidekickdb/cli ...
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## Testing local builds
|
|
@@ -8,7 +8,7 @@ import { Effect, Layer, Logger } from 'effect';
|
|
|
8
8
|
import { GlobalOpts } from '../src/context/globalOpts.ts';
|
|
9
9
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
10
10
|
import type { CurrentAppInfo } from '../src/context/currentApp.ts';
|
|
11
|
-
import {
|
|
11
|
+
import { SidekickHttp, SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
12
12
|
|
|
13
13
|
vi.mock('../src/index.ts', () => ({}));
|
|
14
14
|
|
|
@@ -89,8 +89,8 @@ const loggerLayer = Logger.replace(
|
|
|
89
89
|
const baseLayer = (opts: { yes?: boolean; currentApp?: CurrentAppInfo }) =>
|
|
90
90
|
Layer.mergeAll(
|
|
91
91
|
Layer.succeed(GlobalOpts, { yes: opts.yes ?? true }),
|
|
92
|
-
Layer.succeed(
|
|
93
|
-
Layer.succeed(
|
|
92
|
+
Layer.succeed(SidekickHttpAuthed, makeHttp()),
|
|
93
|
+
Layer.succeed(SidekickHttp, makeHttp()),
|
|
94
94
|
loggerLayer,
|
|
95
95
|
opts.currentApp ? Layer.succeed(CurrentApp, opts.currentApp) : Layer.empty,
|
|
96
96
|
);
|
|
@@ -107,18 +107,18 @@ const runFail = <A, E, R>(
|
|
|
107
107
|
);
|
|
108
108
|
|
|
109
109
|
beforeEach(() => {
|
|
110
|
-
vi.stubEnv('
|
|
110
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.test');
|
|
111
111
|
logs = [];
|
|
112
112
|
prompts = [];
|
|
113
113
|
requests = [];
|
|
114
114
|
dashApps = apps;
|
|
115
115
|
appInfo = { id: 'app-1', title: 'Alpha' };
|
|
116
116
|
mockPromptReturn = undefined;
|
|
117
|
-
delete process.env.
|
|
117
|
+
delete process.env.SIDEKICK_APP_ID;
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
afterEach(() => {
|
|
121
|
-
delete process.env.
|
|
121
|
+
delete process.env.SIDEKICK_APP_ID;
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
describe('app list', () => {
|
|
@@ -164,8 +164,8 @@ describe('app delete', () => {
|
|
|
164
164
|
expect(logs.join('\n')).toContain('Deleted app "Beta" (app-2).');
|
|
165
165
|
});
|
|
166
166
|
|
|
167
|
-
test('defaults to
|
|
168
|
-
process.env.
|
|
167
|
+
test('defaults to SIDEKICK_APP_ID when --app is omitted', async () => {
|
|
168
|
+
process.env.SIDEKICK_APP_ID = 'app-1';
|
|
169
169
|
|
|
170
170
|
await run(appDeleteCommand({} as any));
|
|
171
171
|
|
package/__tests__/auth.test.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
mkdir,
|
|
3
|
-
mkdtemp,
|
|
4
|
-
readFile,
|
|
5
|
-
rm,
|
|
6
|
-
unlink,
|
|
7
|
-
writeFile,
|
|
8
|
-
} from 'node:fs/promises';
|
|
1
|
+
import { mkdtemp, readdir, readFile, rm } from 'node:fs/promises';
|
|
9
2
|
import { tmpdir } from 'node:os';
|
|
10
3
|
import { join } from 'node:path';
|
|
11
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
@@ -30,15 +23,6 @@ afterEach(async () => {
|
|
|
30
23
|
await rm(paths.root, { recursive: true, force: true });
|
|
31
24
|
});
|
|
32
25
|
|
|
33
|
-
const writeLegacyAuthToken = async (
|
|
34
|
-
configName: 'instantdb-prod' | 'instantdb-dev',
|
|
35
|
-
authToken: string,
|
|
36
|
-
) => {
|
|
37
|
-
const configDir = join(paths.root, configName);
|
|
38
|
-
await mkdir(configDir, { recursive: true });
|
|
39
|
-
await writeFile(join(configDir, 'a'), authToken);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
26
|
describe('backend-scoped auth tokens', () => {
|
|
43
27
|
it('treats equivalent backend URLs as the same credential scope', async () => {
|
|
44
28
|
await writeAuthToken(
|
|
@@ -58,8 +42,8 @@ describe('backend-scoped auth tokens', () => {
|
|
|
58
42
|
});
|
|
59
43
|
|
|
60
44
|
it('stores and removes credentials independently by backend', async () => {
|
|
61
|
-
const cloudApiURI = 'https://api.
|
|
62
|
-
const selfHostedApiURI = 'https://
|
|
45
|
+
const cloudApiURI = 'https://api.example.com';
|
|
46
|
+
const selfHostedApiURI = 'https://sidekick.example.com';
|
|
63
47
|
|
|
64
48
|
await writeAuthToken(cloudApiURI, 'cloud-token');
|
|
65
49
|
await writeAuthToken(selfHostedApiURI, 'self-hosted-token');
|
|
@@ -72,54 +56,16 @@ describe('backend-scoped auth tokens', () => {
|
|
|
72
56
|
expect(await readAuthToken(cloudApiURI)).toBe('cloud-token');
|
|
73
57
|
});
|
|
74
58
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const selfHostedApiURI = 'https://instant.example.com';
|
|
79
|
-
expect(await readAuthToken(selfHostedApiURI)).toBeNull();
|
|
80
|
-
|
|
81
|
-
await writeAuthToken(selfHostedApiURI, 'self-hosted-token');
|
|
82
|
-
expect(
|
|
83
|
-
await readFile(join(paths.root, 'instantdb-prod', 'a'), 'utf8'),
|
|
84
|
-
).toBe('cloud-token');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('copies the legacy Cloud token into scoped storage', async () => {
|
|
88
|
-
const apiURI = 'https://api.instantdb.com';
|
|
89
|
-
const legacyPath = join(paths.root, 'instantdb-prod', 'a');
|
|
90
|
-
await writeLegacyAuthToken('instantdb-prod', 'cloud-token');
|
|
91
|
-
|
|
92
|
-
expect(await readAuthToken(apiURI)).toBe('cloud-token');
|
|
93
|
-
await unlink(legacyPath);
|
|
94
|
-
expect(await readAuthToken(apiURI)).toBe('cloud-token');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('copies the legacy localhost token into scoped storage', async () => {
|
|
59
|
+
// SidekickDB: tokens live in the sidekick directory, one file per
|
|
60
|
+
// backend, and no older location is read.
|
|
61
|
+
it('stores the token in the sidekick config directory', async () => {
|
|
98
62
|
const apiURI = 'http://localhost:8888';
|
|
99
|
-
|
|
100
|
-
await writeLegacyAuthToken('instantdb-dev', 'local-token');
|
|
101
|
-
|
|
102
|
-
expect(await readAuthToken(apiURI)).toBe('local-token');
|
|
103
|
-
await unlink(legacyPath);
|
|
104
|
-
expect(await readAuthToken(apiURI)).toBe('local-token');
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('keeps legacy clients logged in for known backends', async () => {
|
|
108
|
-
await writeAuthToken('https://api.instantdb.com', 'cloud-token');
|
|
109
|
-
await writeAuthToken('http://localhost:8888', 'local-token');
|
|
110
|
-
|
|
111
|
-
expect(
|
|
112
|
-
await readFile(join(paths.root, 'instantdb-prod', 'a'), 'utf8'),
|
|
113
|
-
).toBe('cloud-token');
|
|
114
|
-
expect(await readFile(join(paths.root, 'instantdb-dev', 'a'), 'utf8')).toBe(
|
|
115
|
-
'local-token',
|
|
116
|
-
);
|
|
117
|
-
});
|
|
63
|
+
await writeAuthToken(apiURI, 'local-token');
|
|
118
64
|
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
await
|
|
122
|
-
await
|
|
65
|
+
const dir = join(paths.root, 'sidekick', 'auth');
|
|
66
|
+
const [file] = await readdir(dir);
|
|
67
|
+
expect(await readFile(join(dir, file), 'utf8')).toBe('local-token');
|
|
68
|
+
expect(await readdir(paths.root)).toEqual(['sidekick']);
|
|
123
69
|
|
|
124
70
|
expect(await removeAuthToken(apiURI)).toBe(true);
|
|
125
71
|
expect(await readAuthToken(apiURI)).toBeNull();
|
|
@@ -4,7 +4,7 @@ import { FileSystem } from '@effect/platform';
|
|
|
4
4
|
import { SystemError } from '@effect/platform/Error';
|
|
5
5
|
import { GlobalOpts } from '../src/context/globalOpts.ts';
|
|
6
6
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
7
|
-
import {
|
|
7
|
+
import { SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
8
8
|
|
|
9
9
|
// -- mocks --
|
|
10
10
|
|
|
@@ -87,7 +87,7 @@ const run = (flags: Map<string, string>, { yes }: { yes: boolean }) =>
|
|
|
87
87
|
Layer.mergeAll(
|
|
88
88
|
Layer.succeed(GlobalOpts, { yes }),
|
|
89
89
|
Layer.succeed(CurrentApp, { appId: 'test-app', source: 'env' }),
|
|
90
|
-
Layer.succeed(
|
|
90
|
+
Layer.succeed(SidekickHttpAuthed, {} as any),
|
|
91
91
|
// Mocked FileSystem so readPrivateKeyFile reads from `mockFiles`.
|
|
92
92
|
MockFileSystemLayer,
|
|
93
93
|
Logger.replace(
|
|
@@ -115,7 +115,7 @@ const PEM_CONTENTS =
|
|
|
115
115
|
const PEM_PATH = '/tmp/AuthKey_ABC123.p8';
|
|
116
116
|
|
|
117
117
|
beforeEach(() => {
|
|
118
|
-
vi.stubEnv('
|
|
118
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.test');
|
|
119
119
|
prompts = [];
|
|
120
120
|
addedClients = [];
|
|
121
121
|
logs = [];
|
|
@@ -3,7 +3,7 @@ import { Effect, Layer, Logger } from 'effect';
|
|
|
3
3
|
import * as NodeContext from '@effect/platform-node/NodeContext';
|
|
4
4
|
import { GlobalOpts } from '../src/context/globalOpts.ts';
|
|
5
5
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
6
|
-
import {
|
|
6
|
+
import { SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
7
7
|
|
|
8
8
|
// -- mocks --
|
|
9
9
|
|
|
@@ -73,7 +73,7 @@ const run = (flags: Map<string, string>, { yes }: { yes: boolean }) =>
|
|
|
73
73
|
Layer.mergeAll(
|
|
74
74
|
Layer.succeed(GlobalOpts, { yes }),
|
|
75
75
|
Layer.succeed(CurrentApp, { appId: 'test-app', source: 'env' }),
|
|
76
|
-
Layer.succeed(
|
|
76
|
+
Layer.succeed(SidekickHttpAuthed, {} as any),
|
|
77
77
|
// Provides FileSystem (required by the Apple handler).
|
|
78
78
|
NodeContext.layer,
|
|
79
79
|
Logger.replace(
|
|
@@ -97,7 +97,7 @@ const withEntry = (flags: Map<string, string>, key: string, value: string) =>
|
|
|
97
97
|
new Map([...flags, [key, value]]);
|
|
98
98
|
|
|
99
99
|
beforeEach(() => {
|
|
100
|
-
vi.stubEnv('
|
|
100
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.test');
|
|
101
101
|
prompts = [];
|
|
102
102
|
addedClients = [];
|
|
103
103
|
addedProviders = [];
|
|
@@ -111,10 +111,7 @@ beforeEach(() => {
|
|
|
111
111
|
const webFlags = new Map([
|
|
112
112
|
['type', 'clerk'],
|
|
113
113
|
['name', 'clerk-web'],
|
|
114
|
-
[
|
|
115
|
-
'publishable-key',
|
|
116
|
-
'pk_test_Z3VpZGluZy1wZWdhc3VzLTkzLmNsZXJrLmFjY291bnRzLmRldiQ',
|
|
117
|
-
],
|
|
114
|
+
['publishable-key', 'pk_test_ZXhhbXBsZS0xMi5jbGVyay5hY2NvdW50cy5kZXYk'],
|
|
118
115
|
]);
|
|
119
116
|
|
|
120
117
|
// -- --yes: build-up behavior --
|
|
@@ -158,8 +155,7 @@ describe('interactive prompts for each missing flag', () => {
|
|
|
158
155
|
});
|
|
159
156
|
|
|
160
157
|
test('missing --publishable-key → prompts for publishable key', async () => {
|
|
161
|
-
mockPromptReturn =
|
|
162
|
-
'pk_test_Z3VpZGluZy1wZWdhc3VzLTkzLmNsZXJrLmFjY291bnRzLmRldiQ';
|
|
158
|
+
mockPromptReturn = 'pk_test_ZXhhbXBsZS0xMi5jbGVyay5hY2NvdW50cy5kZXYk';
|
|
163
159
|
await run(without(webFlags, 'publishable-key'), { yes: false });
|
|
164
160
|
expect((prompts[0] as any).props.prompt).toMatch(
|
|
165
161
|
/^Clerk publishable key.*https:\/\/dashboard\.clerk\.com/,
|
|
@@ -197,17 +193,16 @@ describe('success', () => {
|
|
|
197
193
|
expect(addedClients[0]).toMatchObject({
|
|
198
194
|
clientName: 'clerk-web',
|
|
199
195
|
discoveryEndpoint:
|
|
200
|
-
'https://
|
|
196
|
+
'https://example-12.clerk.accounts.dev/.well-known/openid-configuration',
|
|
201
197
|
meta: {
|
|
202
|
-
clerkPublishableKey:
|
|
203
|
-
'pk_test_Z3VpZGluZy1wZWdhc3VzLTkzLmNsZXJrLmFjY291bnRzLmRldiQ',
|
|
198
|
+
clerkPublishableKey: 'pk_test_ZXhhbXBsZS0xMi5jbGVyay5hY2NvdW50cy5kZXYk',
|
|
204
199
|
},
|
|
205
200
|
});
|
|
206
201
|
const output = logs.join('\n');
|
|
207
202
|
expect(output).toContain('Clerk OAuth client created: clerk-web');
|
|
208
203
|
expect(output).toContain('ID: client-1');
|
|
209
204
|
expect(output).toContain(
|
|
210
|
-
'Clerk Domain: https://
|
|
205
|
+
'Clerk Domain: https://example-12.clerk.accounts.dev',
|
|
211
206
|
);
|
|
212
207
|
});
|
|
213
208
|
|
|
@@ -3,7 +3,7 @@ import { Effect, Layer, Logger } from 'effect';
|
|
|
3
3
|
import * as NodeContext from '@effect/platform-node/NodeContext';
|
|
4
4
|
import { GlobalOpts } from '../src/context/globalOpts.ts';
|
|
5
5
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
6
|
-
import {
|
|
6
|
+
import { SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
7
7
|
|
|
8
8
|
// -- mocks --
|
|
9
9
|
|
|
@@ -66,7 +66,7 @@ const run = (flags: Map<string, string>, { yes }: { yes: boolean }) =>
|
|
|
66
66
|
Layer.mergeAll(
|
|
67
67
|
Layer.succeed(GlobalOpts, { yes }),
|
|
68
68
|
Layer.succeed(CurrentApp, { appId: 'test-app', source: 'env' }),
|
|
69
|
-
Layer.succeed(
|
|
69
|
+
Layer.succeed(SidekickHttpAuthed, {} as any),
|
|
70
70
|
// Provides FileSystem (required by the Apple handler).
|
|
71
71
|
NodeContext.layer,
|
|
72
72
|
Logger.replace(
|
|
@@ -90,7 +90,7 @@ const withEntry = (flags: Map<string, string>, key: string, value: string) =>
|
|
|
90
90
|
new Map([...flags, [key, value]]);
|
|
91
91
|
|
|
92
92
|
beforeEach(() => {
|
|
93
|
-
vi.stubEnv('
|
|
93
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.test');
|
|
94
94
|
prompts = [];
|
|
95
95
|
addedClients = [];
|
|
96
96
|
logs = [];
|
|
@@ -192,12 +192,12 @@ describe('interactive prompts for each missing flag', () => {
|
|
|
192
192
|
|
|
193
193
|
describe('success', () => {
|
|
194
194
|
test('uses the configured API URI for the callback URL', async () => {
|
|
195
|
-
vi.stubEnv('
|
|
195
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.example');
|
|
196
196
|
|
|
197
197
|
await run(webFlags, { yes: true });
|
|
198
198
|
|
|
199
199
|
expect(addedClients[0].redirectTo).toBe(
|
|
200
|
-
'https://api.
|
|
200
|
+
'https://api.sidekick.example/runtime/oauth/callback',
|
|
201
201
|
);
|
|
202
202
|
});
|
|
203
203
|
|
|
@@ -3,7 +3,7 @@ import { Effect, Layer, Logger } from 'effect';
|
|
|
3
3
|
import * as NodeContext from '@effect/platform-node/NodeContext';
|
|
4
4
|
import { GlobalOpts } from '../src/context/globalOpts.ts';
|
|
5
5
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
6
|
-
import {
|
|
6
|
+
import { SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
7
7
|
|
|
8
8
|
// -- mocks --
|
|
9
9
|
|
|
@@ -66,7 +66,7 @@ const run = (flags: Map<string, string>, { yes }: { yes: boolean }) =>
|
|
|
66
66
|
Layer.mergeAll(
|
|
67
67
|
Layer.succeed(GlobalOpts, { yes }),
|
|
68
68
|
Layer.succeed(CurrentApp, { appId: 'test-app', source: 'env' }),
|
|
69
|
-
Layer.succeed(
|
|
69
|
+
Layer.succeed(SidekickHttpAuthed, {} as any),
|
|
70
70
|
// Provides FileSystem (required by the Apple handler).
|
|
71
71
|
NodeContext.layer,
|
|
72
72
|
Logger.replace(
|
|
@@ -90,7 +90,7 @@ const withEntry = (flags: Map<string, string>, key: string, value: string) =>
|
|
|
90
90
|
new Map([...flags, [key, value]]);
|
|
91
91
|
|
|
92
92
|
beforeEach(() => {
|
|
93
|
-
vi.stubEnv('
|
|
93
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.test');
|
|
94
94
|
prompts = [];
|
|
95
95
|
addedClients = [];
|
|
96
96
|
logs = [];
|
|
@@ -3,7 +3,7 @@ import { Effect, Layer, Logger } from 'effect';
|
|
|
3
3
|
import * as NodeContext from '@effect/platform-node/NodeContext';
|
|
4
4
|
import { GlobalOpts } from '../src/context/globalOpts.ts';
|
|
5
5
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
6
|
-
import {
|
|
6
|
+
import { SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
7
7
|
|
|
8
8
|
// -- mocks --
|
|
9
9
|
|
|
@@ -72,7 +72,7 @@ const run = (flags: Map<string, string>, { yes }: { yes: boolean }) =>
|
|
|
72
72
|
Layer.mergeAll(
|
|
73
73
|
Layer.succeed(GlobalOpts, { yes }),
|
|
74
74
|
Layer.succeed(CurrentApp, { appId: 'test-app', source: 'env' }),
|
|
75
|
-
Layer.succeed(
|
|
75
|
+
Layer.succeed(SidekickHttpAuthed, {} as any),
|
|
76
76
|
// Provides FileSystem (required by the Apple handler).
|
|
77
77
|
NodeContext.layer,
|
|
78
78
|
Logger.replace(
|
|
@@ -96,7 +96,7 @@ const withEntry = (flags: Map<string, string>, key: string, value: string) =>
|
|
|
96
96
|
new Map([...flags, [key, value]]);
|
|
97
97
|
|
|
98
98
|
beforeEach(() => {
|
|
99
|
-
vi.stubEnv('
|
|
99
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.test');
|
|
100
100
|
prompts = [];
|
|
101
101
|
addedClients = [];
|
|
102
102
|
addedProviders = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { test, expect, describe, vi, beforeEach } from 'vitest';
|
|
2
2
|
import { Effect, Layer, Logger } from 'effect';
|
|
3
3
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
4
|
-
import {
|
|
4
|
+
import { SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
5
5
|
|
|
6
6
|
vi.mock('../src/index.ts', () => ({}));
|
|
7
7
|
|
|
@@ -25,7 +25,8 @@ const authResponse = {
|
|
|
25
25
|
provider_id: 'prov-github',
|
|
26
26
|
client_name: 'github',
|
|
27
27
|
client_id: 'gh-id',
|
|
28
|
-
|
|
28
|
+
// SidekickDB: an example host.
|
|
29
|
+
redirect_to: 'https://api.example.com/runtime/oauth/callback',
|
|
29
30
|
meta: {},
|
|
30
31
|
use_shared_credentials: false,
|
|
31
32
|
},
|
|
@@ -48,7 +49,7 @@ const run = (opts: { json?: boolean }) =>
|
|
|
48
49
|
Effect.provide(
|
|
49
50
|
Layer.mergeAll(
|
|
50
51
|
Layer.succeed(CurrentApp, { appId: 'test-app', source: 'env' }),
|
|
51
|
-
Layer.succeed(
|
|
52
|
+
Layer.succeed(SidekickHttpAuthed, {} as any),
|
|
52
53
|
Logger.replace(
|
|
53
54
|
Logger.defaultLogger,
|
|
54
55
|
Logger.make(({ message }) => {
|
|
@@ -3,7 +3,7 @@ import { Effect, Layer, Logger } from 'effect';
|
|
|
3
3
|
import * as NodeContext from '@effect/platform-node/NodeContext';
|
|
4
4
|
import { GlobalOpts } from '../src/context/globalOpts.ts';
|
|
5
5
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
6
|
-
import {
|
|
6
|
+
import { SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
7
7
|
import { BadArgsError } from '../src/errors.ts';
|
|
8
8
|
|
|
9
9
|
// Prevent src/index.ts side-effect (program.parse) from running.
|
|
@@ -96,7 +96,7 @@ const run = (flags: Record<string, any>, { yes }: { yes: boolean }) =>
|
|
|
96
96
|
Layer.mergeAll(
|
|
97
97
|
Layer.succeed(GlobalOpts, { yes }),
|
|
98
98
|
Layer.succeed(CurrentApp, { appId: 'test-app', source: 'env' }),
|
|
99
|
-
Layer.succeed(
|
|
99
|
+
Layer.succeed(SidekickHttpAuthed, {} as any),
|
|
100
100
|
NodeContext.layer,
|
|
101
101
|
Logger.replace(
|
|
102
102
|
Logger.defaultLogger,
|
|
@@ -110,7 +110,7 @@ const run = (flags: Record<string, any>, { yes }: { yes: boolean }) =>
|
|
|
110
110
|
);
|
|
111
111
|
|
|
112
112
|
beforeEach(() => {
|
|
113
|
-
vi.stubEnv('
|
|
113
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.test');
|
|
114
114
|
prompts = [];
|
|
115
115
|
updatedClients = [];
|
|
116
116
|
logs = [];
|
|
@@ -491,8 +491,7 @@ describe('provider credential updates', () => {
|
|
|
491
491
|
await run(
|
|
492
492
|
{
|
|
493
493
|
name: 'clerk',
|
|
494
|
-
'publishable-key':
|
|
495
|
-
'pk_test_Z3VpZGluZy1wZWdhc3VzLTkzLmNsZXJrLmFjY291bnRzLmRldiQ',
|
|
494
|
+
'publishable-key': 'pk_test_ZXhhbXBsZS0xMi5jbGVyay5hY2NvdW50cy5kZXYk',
|
|
496
495
|
},
|
|
497
496
|
{ yes: true },
|
|
498
497
|
);
|
|
@@ -501,10 +500,9 @@ describe('provider credential updates', () => {
|
|
|
501
500
|
expect(updatedClients[0]).toMatchObject({
|
|
502
501
|
oauthClientId: 'clerk',
|
|
503
502
|
discoveryEndpoint:
|
|
504
|
-
'https://
|
|
503
|
+
'https://example-12.clerk.accounts.dev/.well-known/openid-configuration',
|
|
505
504
|
meta: {
|
|
506
|
-
clerkPublishableKey:
|
|
507
|
-
'pk_test_Z3VpZGluZy1wZWdhc3VzLTkzLmNsZXJrLmFjY291bnRzLmRldiQ',
|
|
505
|
+
clerkPublishableKey: 'pk_test_ZXhhbXBsZS0xMi5jbGVyay5hY2NvdW50cy5kZXYk',
|
|
508
506
|
},
|
|
509
507
|
});
|
|
510
508
|
});
|
|
@@ -2,7 +2,7 @@ import { test, expect, describe, vi, beforeEach } from 'vitest';
|
|
|
2
2
|
import { Effect, Layer, Logger } from 'effect';
|
|
3
3
|
import { GlobalOpts } from '../src/context/globalOpts.ts';
|
|
4
4
|
import { CurrentApp } from '../src/context/currentApp.ts';
|
|
5
|
-
import {
|
|
5
|
+
import { SidekickHttpAuthed } from '../src/lib/http.ts';
|
|
6
6
|
|
|
7
7
|
// -- mocks --
|
|
8
8
|
|
|
@@ -74,7 +74,7 @@ const { authOriginListCmd } = await import(
|
|
|
74
74
|
|
|
75
75
|
let logs: string[] = [];
|
|
76
76
|
|
|
77
|
-
type TestContext = GlobalOpts | CurrentApp |
|
|
77
|
+
type TestContext = GlobalOpts | CurrentApp | SidekickHttpAuthed;
|
|
78
78
|
|
|
79
79
|
const run = (
|
|
80
80
|
cmd: Effect.Effect<void, any, TestContext>,
|
|
@@ -86,7 +86,7 @@ const run = (
|
|
|
86
86
|
Layer.mergeAll(
|
|
87
87
|
Layer.succeed(GlobalOpts, { yes }),
|
|
88
88
|
Layer.succeed(CurrentApp, { appId: 'test-app', source: 'env' }),
|
|
89
|
-
Layer.succeed(
|
|
89
|
+
Layer.succeed(SidekickHttpAuthed, {} as any),
|
|
90
90
|
Logger.replace(
|
|
91
91
|
Logger.defaultLogger,
|
|
92
92
|
Logger.make(({ message }) => {
|
|
@@ -131,17 +131,17 @@ const websiteFlags = new Map([
|
|
|
131
131
|
|
|
132
132
|
const vercelFlags = new Map([
|
|
133
133
|
['type', 'vercel'],
|
|
134
|
-
['project', '
|
|
134
|
+
['project', 'sidekick-preview'],
|
|
135
135
|
]);
|
|
136
136
|
|
|
137
137
|
const netlifyFlags = new Map([
|
|
138
138
|
['type', 'netlify'],
|
|
139
|
-
['site', '
|
|
139
|
+
['site', 'sidekick-netlify'],
|
|
140
140
|
]);
|
|
141
141
|
|
|
142
142
|
const customSchemeFlags = new Map([
|
|
143
143
|
['type', 'custom-scheme'],
|
|
144
|
-
['scheme', '
|
|
144
|
+
['scheme', 'sidekick://'],
|
|
145
145
|
]);
|
|
146
146
|
|
|
147
147
|
// -- add: build-up with --yes --
|
|
@@ -236,24 +236,24 @@ describe('add: success', () => {
|
|
|
236
236
|
test('vercel origin -> creates vercel origin params', async () => {
|
|
237
237
|
await add(vercelFlags, { yes: true });
|
|
238
238
|
expect(addedOrigins).toEqual([
|
|
239
|
-
{ service: 'vercel', params: ['vercel.app', '
|
|
239
|
+
{ service: 'vercel', params: ['vercel.app', 'sidekick-preview'] },
|
|
240
240
|
]);
|
|
241
|
-
expect(logs.join('\n')).toContain('Origin added:
|
|
241
|
+
expect(logs.join('\n')).toContain('Origin added: sidekick-preview');
|
|
242
242
|
});
|
|
243
243
|
|
|
244
244
|
test('netlify origin -> creates netlify origin params', async () => {
|
|
245
245
|
await add(netlifyFlags, { yes: true });
|
|
246
246
|
expect(addedOrigins).toEqual([
|
|
247
|
-
{ service: 'netlify', params: ['
|
|
247
|
+
{ service: 'netlify', params: ['sidekick-netlify'] },
|
|
248
248
|
]);
|
|
249
249
|
});
|
|
250
250
|
|
|
251
251
|
test('custom scheme origin -> creates custom scheme origin params', async () => {
|
|
252
252
|
await add(customSchemeFlags, { yes: true });
|
|
253
253
|
expect(addedOrigins).toEqual([
|
|
254
|
-
{ service: 'custom-scheme', params: ['
|
|
254
|
+
{ service: 'custom-scheme', params: ['sidekick'] },
|
|
255
255
|
]);
|
|
256
|
-
expect(logs.join('\n')).toContain('Origin added:
|
|
256
|
+
expect(logs.join('\n')).toContain('Origin added: sidekick://');
|
|
257
257
|
});
|
|
258
258
|
});
|
|
259
259
|
|
|
@@ -16,7 +16,7 @@ const state = vi.hoisted(() => ({
|
|
|
16
16
|
promptResponses: [] as unknown[],
|
|
17
17
|
}));
|
|
18
18
|
|
|
19
|
-
// Mock at the SDK boundary: any `new
|
|
19
|
+
// Mock at the SDK boundary: any `new SidekickPlatformApi(...)` returns a stub
|
|
20
20
|
// whose `.backups(appId)` is the per-test fake manager.
|
|
21
21
|
vi.mock('@sidekickdb/platform', async (importOriginal) => {
|
|
22
22
|
const orig: any = await importOriginal();
|
|
@@ -105,7 +105,7 @@ const run = (effect: any, opts: { yes: boolean }) =>
|
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
beforeEach(() => {
|
|
108
|
-
vi.stubEnv('
|
|
108
|
+
vi.stubEnv('SIDEKICK_CLI_API_URI', 'https://api.sidekick.test');
|
|
109
109
|
logs = [];
|
|
110
110
|
state.manager = buildManager([]);
|
|
111
111
|
state.downloadResult = { entities: 3, files: 2, zipBytes: 1234 };
|