@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/dist/index.js
CHANGED
|
@@ -55,14 +55,7 @@ program
|
|
|
55
55
|
process.exit(0);
|
|
56
56
|
}))
|
|
57
57
|
.addHelpOption(globalOption('-h --help', 'Print the help text for a command'))
|
|
58
|
-
.usage(`<command> ${chalk.dim('[options] [args]')}`)
|
|
59
|
-
.addHelpText('after', `
|
|
60
|
-
Names:
|
|
61
|
-
Every INSTANT_* environment variable can also be set as SIDEKICK_*, for
|
|
62
|
-
example SIDEKICK_CLI_API_URI or NEXT_PUBLIC_SIDEKICK_APP_ID, and the
|
|
63
|
-
instant.config, instant.schema, instant.perms and instant.email files can be
|
|
64
|
-
named sidekick.* instead. The SIDEKICK name wins when both exist.
|
|
65
|
-
`);
|
|
58
|
+
.usage(`<command> ${chalk.dim('[options] [args]')}`);
|
|
66
59
|
// Command List
|
|
67
60
|
export const initDef = program
|
|
68
61
|
.command('init')
|
|
@@ -101,7 +94,7 @@ export const appListDef = app
|
|
|
101
94
|
export const appDeleteDef = app
|
|
102
95
|
.command('delete')
|
|
103
96
|
.description('Delete an app from your SidekickDB account')
|
|
104
|
-
.option('-a --app <app-id>', 'App ID to delete. Defaults to *
|
|
97
|
+
.option('-a --app <app-id>', 'App ID to delete. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
105
98
|
.action(async (opts) => {
|
|
106
99
|
return runCommandEffect(appDeleteCommand(opts).pipe(Effect.provide(AuthLayerLive({
|
|
107
100
|
coerce: false,
|
|
@@ -115,7 +108,7 @@ export const authClientAddDef = authClient
|
|
|
115
108
|
.allowUnknownOption(true)
|
|
116
109
|
.option('--type <google|github|apple|linkedin>', 'Type of oauth client to add')
|
|
117
110
|
.option('--name <client name>', 'Custom name to identify the OAuth client (ex: google-web)')
|
|
118
|
-
.option('-a --app <app-id>', 'App ID to modify. Defaults to *
|
|
111
|
+
.option('-a --app <app-id>', 'App ID to modify. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
119
112
|
.addHelpText('after', `
|
|
120
113
|
Provider Specific Options:
|
|
121
114
|
Google:
|
|
@@ -157,7 +150,7 @@ Provider Specific Options:
|
|
|
157
150
|
});
|
|
158
151
|
export const authClientListDef = authClient
|
|
159
152
|
.command('list')
|
|
160
|
-
.option('-a --app <app-id>', 'App ID to list clients for. Defaults to *
|
|
153
|
+
.option('-a --app <app-id>', 'App ID to list clients for. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
161
154
|
.option('--json', 'Enable JSON output')
|
|
162
155
|
.allowUnknownOption(true)
|
|
163
156
|
.action((opts) => {
|
|
@@ -166,14 +159,14 @@ export const authClientListDef = authClient
|
|
|
166
159
|
coerceAuth: false,
|
|
167
160
|
appId: opts.app,
|
|
168
161
|
allowAdminToken: true,
|
|
169
|
-
// Silence "searching for
|
|
162
|
+
// Silence "searching for SidekickDB sdk.. logs for json output"
|
|
170
163
|
}).pipe(Layer.annotateLogs('silent', !!opts.json)))));
|
|
171
164
|
});
|
|
172
165
|
export const authClientDeleteDef = authClient
|
|
173
166
|
.command('delete')
|
|
174
167
|
.option('--id <client-id>', 'Client ID to delete')
|
|
175
168
|
.option('--name <client-name>', 'Client name to delete')
|
|
176
|
-
.option('-a --app <app-id>', 'App ID to delete a client from. Defaults to *
|
|
169
|
+
.option('-a --app <app-id>', 'App ID to delete a client from. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
177
170
|
.action((opts) => {
|
|
178
171
|
return runCommandEffect(authClientDeleteCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
179
172
|
coerce: false,
|
|
@@ -188,7 +181,7 @@ export const authClientUpdateDef = authClient
|
|
|
188
181
|
.allowUnknownOption(true)
|
|
189
182
|
.option('--id <client-id>', 'Client ID to update')
|
|
190
183
|
.option('--name <client-name>', 'Client name to update')
|
|
191
|
-
.option('-a --app <app-id>', 'App ID to update a client in. Defaults to *
|
|
184
|
+
.option('-a --app <app-id>', 'App ID to update a client in. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
192
185
|
.addHelpText('after', `
|
|
193
186
|
Provider Specific Options:
|
|
194
187
|
Google:
|
|
@@ -229,7 +222,7 @@ Provider Specific Options:
|
|
|
229
222
|
const authOrigin = auth.command('origin');
|
|
230
223
|
export const authOriginListDef = authOrigin
|
|
231
224
|
.command('list')
|
|
232
|
-
.option('-a --app <app-id>', 'App ID to list origins for. Defaults to *
|
|
225
|
+
.option('-a --app <app-id>', 'App ID to list origins for. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
233
226
|
.option('--json', 'Enable JSON output')
|
|
234
227
|
.action((opts) => {
|
|
235
228
|
return runCommandEffect(authOriginListCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
@@ -246,7 +239,7 @@ export const authOriginAddDef = authOrigin
|
|
|
246
239
|
.option('--project <name>', 'Vercel project name (for vercel type, e.g. my-project)')
|
|
247
240
|
.option('--site <name>', 'Netlify site name (for netlify type, e.g. my-site)')
|
|
248
241
|
.option('--scheme <scheme>', 'App scheme (for custom-scheme type, e.g. myapp://)')
|
|
249
|
-
.option('-a --app <app-id>', 'App ID to add an origin to. Defaults to *
|
|
242
|
+
.option('-a --app <app-id>', 'App ID to add an origin to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
250
243
|
.addHelpText('after', `
|
|
251
244
|
Origin Types:
|
|
252
245
|
website A standard website origin (e.g. example.com)
|
|
@@ -265,7 +258,7 @@ Origin Types:
|
|
|
265
258
|
export const authOriginDeleteDef = authOrigin
|
|
266
259
|
.command('delete')
|
|
267
260
|
.option('--id <origin-id>', 'Origin ID to delete')
|
|
268
|
-
.option('-a --app <app-id>', 'App ID to delete an origin from. Defaults to *
|
|
261
|
+
.option('-a --app <app-id>', 'App ID to delete an origin from. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
269
262
|
.action((opts) => {
|
|
270
263
|
return runCommandEffect(authOriginDeleteCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
271
264
|
coerce: false,
|
|
@@ -279,7 +272,7 @@ const webhooks = program
|
|
|
279
272
|
export const webhooksListDef = webhooks
|
|
280
273
|
.command('list')
|
|
281
274
|
.description('List webhooks for an app')
|
|
282
|
-
.option('-a --app <app-id>', 'App ID to list webhooks for. Defaults to *
|
|
275
|
+
.option('-a --app <app-id>', 'App ID to list webhooks for. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
283
276
|
.option('--json', 'Enable JSON output')
|
|
284
277
|
.action((opts) => {
|
|
285
278
|
return runCommandEffect(webhooksListCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
@@ -295,7 +288,7 @@ export const webhooksAddDef = webhooks
|
|
|
295
288
|
.option('--url <url>', 'HTTPS endpoint to deliver events to')
|
|
296
289
|
.option('--namespaces <e1,e2>', 'Comma-separated list of namespaces to listen on')
|
|
297
290
|
.option('--actions <a1,a2>', 'Comma-separated list of actions (create, update, delete)')
|
|
298
|
-
.option('-a --app <app-id>', 'App ID to add a webhook to. Defaults to *
|
|
291
|
+
.option('-a --app <app-id>', 'App ID to add a webhook to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
299
292
|
.action((opts) => {
|
|
300
293
|
return runCommandEffect(webhooksAddCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
301
294
|
coerce: false,
|
|
@@ -311,7 +304,7 @@ export const webhooksUpdateDef = webhooks
|
|
|
311
304
|
.option('--url <url>', 'New HTTPS endpoint')
|
|
312
305
|
.option('--namespaces <e1,e2>', 'New comma-separated namespaces')
|
|
313
306
|
.option('--actions <a1,a2>', 'New comma-separated actions (create, update, delete)')
|
|
314
|
-
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *
|
|
307
|
+
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
315
308
|
.action((opts) => {
|
|
316
309
|
return runCommandEffect(webhooksUpdateCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
317
310
|
coerce: false,
|
|
@@ -324,7 +317,7 @@ export const webhooksDeleteDef = webhooks
|
|
|
324
317
|
.command('delete')
|
|
325
318
|
.description('Delete a webhook')
|
|
326
319
|
.option('--id <webhook-id>', 'Webhook ID to delete')
|
|
327
|
-
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *
|
|
320
|
+
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
328
321
|
.action((opts) => {
|
|
329
322
|
return runCommandEffect(webhooksDeleteCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
330
323
|
coerce: false,
|
|
@@ -337,7 +330,7 @@ export const webhooksEnableDef = webhooks
|
|
|
337
330
|
.command('enable')
|
|
338
331
|
.description('Re-enable a disabled webhook')
|
|
339
332
|
.option('--id <webhook-id>', 'Webhook ID to enable')
|
|
340
|
-
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *
|
|
333
|
+
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
341
334
|
.action((opts) => {
|
|
342
335
|
return runCommandEffect(webhooksEnableCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
343
336
|
coerce: false,
|
|
@@ -351,7 +344,7 @@ export const webhooksDisableDef = webhooks
|
|
|
351
344
|
.description('Disable an active webhook')
|
|
352
345
|
.option('--id <webhook-id>', 'Webhook ID to disable')
|
|
353
346
|
.option('--reason <reason>', 'Human-readable reason stored on the webhook')
|
|
354
|
-
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *
|
|
347
|
+
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
355
348
|
.action((opts) => {
|
|
356
349
|
return runCommandEffect(webhooksDisableCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
357
350
|
coerce: false,
|
|
@@ -368,7 +361,7 @@ export const webhooksEventsListDef = webhooksEvents
|
|
|
368
361
|
.description('List recent events for a webhook (up to 100, newest first)')
|
|
369
362
|
.option('--webhook-id <webhook-id>', 'Webhook ID to inspect')
|
|
370
363
|
.option('--json', 'Enable JSON output')
|
|
371
|
-
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *
|
|
364
|
+
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
372
365
|
.action((opts) => {
|
|
373
366
|
return runCommandEffect(webhooksEventsListCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
374
367
|
coerce: false,
|
|
@@ -382,7 +375,7 @@ export const webhooksEventsResendDef = webhooksEvents
|
|
|
382
375
|
.description('Re-queue a webhook event for delivery')
|
|
383
376
|
.option('--webhook-id <webhook-id>', 'Webhook ID the event belongs to')
|
|
384
377
|
.option('--isn <isn>', 'Event ISN to resend')
|
|
385
|
-
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *
|
|
378
|
+
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
386
379
|
.action((opts) => {
|
|
387
380
|
return runCommandEffect(webhooksEventsResendCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
388
381
|
coerce: false,
|
|
@@ -396,7 +389,7 @@ export const webhooksEventsPayloadDef = webhooksEvents
|
|
|
396
389
|
.description('Print the JSON payload for a webhook event')
|
|
397
390
|
.option('--webhook-id <webhook-id>', 'Webhook ID the event belongs to')
|
|
398
391
|
.option('--isn <isn>', 'Event ISN to fetch')
|
|
399
|
-
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *
|
|
392
|
+
.option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
400
393
|
.action((opts) => {
|
|
401
394
|
return runCommandEffect(webhooksEventsPayloadCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
402
395
|
coerce: false,
|
|
@@ -411,7 +404,7 @@ const backup = program
|
|
|
411
404
|
export const backupListDef = backup
|
|
412
405
|
.command('list')
|
|
413
406
|
.description('List downloadable backups for an app')
|
|
414
|
-
.option('-a --app <app-id>', 'App ID to list backups for. Defaults to *
|
|
407
|
+
.option('-a --app <app-id>', 'App ID to list backups for. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
415
408
|
.option('--json', 'Output backups as JSON')
|
|
416
409
|
.action((opts) => {
|
|
417
410
|
return runCommandEffect(backupListCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
@@ -425,9 +418,9 @@ export const backupDownloadDef = backup
|
|
|
425
418
|
.command('download')
|
|
426
419
|
.description('Download a backup as a zip file')
|
|
427
420
|
.argument('[backup-id]', 'Backup ID to download. Defaults to an interactive picker')
|
|
428
|
-
.option('-a --app <app-id>', 'App ID to download a backup of. Defaults to *
|
|
421
|
+
.option('-a --app <app-id>', 'App ID to download a backup of. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
429
422
|
.option('--latest', 'Download the most recent backup')
|
|
430
|
-
.option('-o --out <path>', 'Output zip path. Defaults to
|
|
423
|
+
.option('-o --out <path>', 'Output zip path. Defaults to sidekick-backup-<timestamp>.zip')
|
|
431
424
|
.action((backupId, opts) => {
|
|
432
425
|
return runCommandEffect(backupDownloadCmd(backupId, opts).pipe(Effect.provide(WithAppLayer({
|
|
433
426
|
coerce: false,
|
|
@@ -442,7 +435,7 @@ const authEmail = auth
|
|
|
442
435
|
export const authEmailStatusDef = authEmail
|
|
443
436
|
.command('status')
|
|
444
437
|
.description('Get status for the custom magic code email template')
|
|
445
|
-
.option('-a --app <app-id>', 'App ID to push email settings to. Defaults to *
|
|
438
|
+
.option('-a --app <app-id>', 'App ID to push email settings to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
446
439
|
.option('--json', 'Output email status as JSON')
|
|
447
440
|
.action((opts) => {
|
|
448
441
|
runCommandEffect(emailStatusCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
@@ -454,8 +447,8 @@ export const authEmailStatusDef = authEmail
|
|
|
454
447
|
export const authEmailPushDef = authEmail
|
|
455
448
|
.command('push')
|
|
456
449
|
.description('Push the custom magic code email template.')
|
|
457
|
-
.option('-a --app <app-id>', 'App ID to push email settings to. Defaults to *
|
|
458
|
-
.option('-f --file <path>', 'Path to
|
|
450
|
+
.option('-a --app <app-id>', 'App ID to push email settings to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
451
|
+
.option('-f --file <path>', 'Path to sidekick.email.ts. Defaults to SIDEKICK_EMAIL_FILE_PATH or auto-discovery.')
|
|
459
452
|
.action((opts) => runCommandEffect(authEmailPushCmd({ file: opts.file }).pipe(Effect.provide(WithAppLayer({
|
|
460
453
|
coerce: false,
|
|
461
454
|
coerceAuth: false,
|
|
@@ -465,8 +458,8 @@ export const authEmailPushDef = authEmail
|
|
|
465
458
|
export const authEmailPullDef = authEmail
|
|
466
459
|
.command('pull')
|
|
467
460
|
.description('Pull the custom magic code email template.')
|
|
468
|
-
.option('-a --app <app-id>', 'App ID to pull email settings from. Defaults to *
|
|
469
|
-
.option('-f --file <path>', 'Path to
|
|
461
|
+
.option('-a --app <app-id>', 'App ID to pull email settings from. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
462
|
+
.option('-f --file <path>', 'Path to sidekick.email.ts. Defaults to SIDEKICK_EMAIL_FILE_PATH or auto-discovery.')
|
|
470
463
|
.action((opts) => runCommandEffect(authEmailPullCmd({ file: opts.file }).pipe(Effect.provide(WithAppLayer({
|
|
471
464
|
coerce: false,
|
|
472
465
|
coerceAuth: false,
|
|
@@ -476,7 +469,7 @@ export const authEmailPullDef = authEmail
|
|
|
476
469
|
export const authEmailResetDef = authEmail
|
|
477
470
|
.command('reset')
|
|
478
471
|
.description('Delete the custom magic code email template.')
|
|
479
|
-
.option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *
|
|
472
|
+
.option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
480
473
|
.action((opts) => runCommandEffect(authEmailResetCmd().pipe(Effect.provide(WithAppLayer({
|
|
481
474
|
coerce: false,
|
|
482
475
|
coerceAuth: false,
|
|
@@ -486,7 +479,7 @@ export const authEmailResetDef = authEmail
|
|
|
486
479
|
export const authEmailResendDef = authEmail
|
|
487
480
|
.command('resend')
|
|
488
481
|
.description('Resend the verification email')
|
|
489
|
-
.option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *
|
|
482
|
+
.option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
490
483
|
.action(() => {
|
|
491
484
|
runCommandEffect(resendEmailCmd.pipe(Effect.provide(WithAppLayer({
|
|
492
485
|
coerce: false,
|
|
@@ -498,7 +491,7 @@ export const authEmailVerifyDef = authEmail
|
|
|
498
491
|
.command('verify')
|
|
499
492
|
.description('Verify a custom email sender with a magic code')
|
|
500
493
|
.argument('<code>', 'The magic code to verify')
|
|
501
|
-
.option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *
|
|
494
|
+
.option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
502
495
|
.action((code, opts) => {
|
|
503
496
|
runCommandEffect(verifyCmd(code, opts).pipe(Effect.provide(WithAppLayer({
|
|
504
497
|
coerce: false,
|
|
@@ -543,7 +536,7 @@ export const infoDef = program
|
|
|
543
536
|
export const explorerDef = program
|
|
544
537
|
.command('explorer')
|
|
545
538
|
.description('Opens the Explorer in your browser')
|
|
546
|
-
.option('-a --app <app-id>', 'App ID to open the explorer to. Defaults to *
|
|
539
|
+
.option('-a --app <app-id>', 'App ID to open the explorer to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
547
540
|
.action(async (opts) => {
|
|
548
541
|
return runCommandEffect(explorerCmd(opts).pipe(Effect.provide(WithAppLayer({
|
|
549
542
|
coerce: true,
|
|
@@ -553,27 +546,27 @@ export const explorerDef = program
|
|
|
553
546
|
});
|
|
554
547
|
export const queryDef = program
|
|
555
548
|
.command('query')
|
|
556
|
-
.argument('<query>', '
|
|
557
|
-
.option('-a --app <app-id>', 'App ID to query. Defaults to *
|
|
549
|
+
.argument('<query>', 'SideQL query as JSON/JSON5')
|
|
550
|
+
.option('-a --app <app-id>', 'App ID to query. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
558
551
|
.option('--admin', 'Run the query as admin (bypasses permissions)')
|
|
559
552
|
.option('--as-email <email>', 'Run the query as a specific user by email')
|
|
560
553
|
.option('--as-guest', 'Run the query as an unauthenticated guest')
|
|
561
554
|
.option('--as-token <refresh-token>', 'Run the query as a user identified by refresh token')
|
|
562
|
-
.description('Run
|
|
555
|
+
.description('Run a SideQL query against your app.')
|
|
563
556
|
.action(async function (queryArg, opts) {
|
|
564
557
|
return runCommandEffect(queryCmd(queryArg, opts));
|
|
565
558
|
});
|
|
566
559
|
export const pullDef = program
|
|
567
560
|
.command('pull')
|
|
568
561
|
.argument('[schema|perms|all]', 'Which configuration to pull. Defaults to `all`')
|
|
569
|
-
.option('-a --app <app-id>', 'App ID to pull to. Defaults to *
|
|
562
|
+
.option('-a --app <app-id>', 'App ID to pull to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
570
563
|
.option('-p --package <react|react-native|core|admin|solid|svelte>', 'Which package to automatically install if there is not one installed already.')
|
|
571
564
|
.option('--experimental-type-preservation', "[Experimental] Preserve manual type changes like `status: i.json<'online' | 'offline'>()` when doing `sidekick-cli pull schema`")
|
|
572
565
|
.description('Pull schema and perm files from production.')
|
|
573
566
|
.addHelpText('after', `
|
|
574
567
|
Environment Variables:
|
|
575
|
-
|
|
576
|
-
|
|
568
|
+
SIDEKICK_SCHEMA_FILE_PATH Override schema file location (default: sidekick.schema.ts)
|
|
569
|
+
SIDEKICK_PERMS_FILE_PATH Override perms file location (default: sidekick.perms.ts)
|
|
577
570
|
`)
|
|
578
571
|
.action(async function (arg, inputOpts) {
|
|
579
572
|
return runCommandEffect(pullCommand(arg, inputOpts).pipe(Effect.provide(WithAppLayer({
|
|
@@ -585,15 +578,15 @@ Environment Variables:
|
|
|
585
578
|
export const pushDef = program
|
|
586
579
|
.command('push')
|
|
587
580
|
.argument('[schema|perms|all]', 'Which configuration to push. Defaults to `all`')
|
|
588
|
-
.option('-a --app <app-id>', 'App ID to push to. Defaults to *
|
|
581
|
+
.option('-a --app <app-id>', 'App ID to push to. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
589
582
|
.option('--skip-check-types', "Don't check types on the server when pushing schema")
|
|
590
583
|
.option('--rename [renames...]', 'List of full attribute names separated by a ":"\n Example:`push --rename posts.author:posts.creator stores.owner:stores.manager`')
|
|
591
584
|
.option('-p --package <react|react-native|core|admin|solid|svelte>', 'Which package to automatically install if there is not one installed already.')
|
|
592
585
|
.description('Push schema and perm files to production.')
|
|
593
586
|
.addHelpText('after', `
|
|
594
587
|
Environment Variables:
|
|
595
|
-
|
|
596
|
-
|
|
588
|
+
SIDEKICK_SCHEMA_FILE_PATH Override schema file location (default: sidekick.schema.ts)
|
|
589
|
+
SIDEKICK_PERMS_FILE_PATH Override perms file location (default: sidekick.perms.ts)
|
|
597
590
|
`)
|
|
598
591
|
.action(async function (arg, inputOpts) {
|
|
599
592
|
return runCommandEffect(pushCommand(arg, inputOpts).pipe(Effect.provide(WithAppLayer({
|
|
@@ -609,7 +602,7 @@ Environment Variables:
|
|
|
609
602
|
export const claimDef = program
|
|
610
603
|
.command('claim')
|
|
611
604
|
.description('Transfer a temporary app into your SidekickDB account')
|
|
612
|
-
.option('-a --app <app-id>', 'App to claim. Defaults to *
|
|
605
|
+
.option('-a --app <app-id>', 'App to claim. Defaults to *_SIDEKICK_APP_ID in .env')
|
|
613
606
|
.action(async function (opts) {
|
|
614
607
|
return runCommandEffect(claimCommand.pipe(Effect.provide(WithAppLayer({
|
|
615
608
|
coerce: false,
|
|
@@ -629,7 +622,7 @@ function globalOption(flags, description, argParser) {
|
|
|
629
622
|
// but we use it in `getLocalAndGlobalOptions`, to produce
|
|
630
623
|
// our own custom list of local and global options.
|
|
631
624
|
// For more info, see the original PR:
|
|
632
|
-
//
|
|
625
|
+
// upstream pull request #505
|
|
633
626
|
opt.__global = true;
|
|
634
627
|
return opt;
|
|
635
628
|
}
|