@sidekickdb/cli 2.0.1 → 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.
Files changed (265) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/README.md +4 -4
  3. package/__tests__/appCommands.test.ts +8 -8
  4. package/__tests__/auth.test.ts +11 -65
  5. package/__tests__/authClientAddApple.test.ts +3 -3
  6. package/__tests__/authClientAddClerk.test.ts +8 -13
  7. package/__tests__/authClientAddGithub.test.ts +5 -5
  8. package/__tests__/authClientAddGoogle.test.ts +3 -3
  9. package/__tests__/authClientAddLinkedin.test.ts +3 -3
  10. package/__tests__/authClientList.test.ts +4 -3
  11. package/__tests__/authClientUpdate.test.ts +6 -8
  12. package/__tests__/authOriginManagement.test.ts +11 -11
  13. package/__tests__/backups.test.ts +2 -2
  14. package/__tests__/config.test.ts +34 -34
  15. package/__tests__/configAliases.test.ts +27 -215
  16. package/__tests__/configFileNames.test.ts +118 -0
  17. package/__tests__/e2e/cli.e2e.test.ts +102 -102
  18. package/__tests__/e2e/helpers.ts +5 -5
  19. package/__tests__/effectHelpers.ts +3 -3
  20. package/__tests__/emailVerification.test.ts +31 -0
  21. package/__tests__/oldConfigFiles.test.ts +254 -0
  22. package/__tests__/webhooks.test.ts +2 -2
  23. package/dist/auth/index.d.ts.map +1 -1
  24. package/dist/auth/index.js +6 -43
  25. package/dist/auth/index.js.map +1 -1
  26. package/dist/commands/app/delete.d.ts +2 -2
  27. package/dist/commands/app/delete.d.ts.map +1 -1
  28. package/dist/commands/app/delete.js +2 -2
  29. package/dist/commands/app/delete.js.map +1 -1
  30. package/dist/commands/app/list.d.ts +2 -2
  31. package/dist/commands/app/list.d.ts.map +1 -1
  32. package/dist/commands/app/list.js +2 -2
  33. package/dist/commands/app/list.js.map +1 -1
  34. package/dist/commands/auth/client/add.d.ts +1 -1
  35. package/dist/commands/auth/client/add.d.ts.map +1 -1
  36. package/dist/commands/auth/client/delete.d.ts +2 -2
  37. package/dist/commands/auth/client/delete.d.ts.map +1 -1
  38. package/dist/commands/auth/client/delete.js +2 -2
  39. package/dist/commands/auth/client/delete.js.map +1 -1
  40. package/dist/commands/auth/client/list.d.ts +1 -1
  41. package/dist/commands/auth/client/list.d.ts.map +1 -1
  42. package/dist/commands/auth/client/update.d.ts +1 -1
  43. package/dist/commands/auth/client/update.d.ts.map +1 -1
  44. package/dist/commands/auth/email/pull.d.ts +4 -4
  45. package/dist/commands/auth/email/pull.d.ts.map +1 -1
  46. package/dist/commands/auth/email/pull.js +5 -2
  47. package/dist/commands/auth/email/pull.js.map +1 -1
  48. package/dist/commands/auth/email/push.d.ts +2 -2
  49. package/dist/commands/auth/email/push.d.ts.map +1 -1
  50. package/dist/commands/auth/email/push.js +3 -3
  51. package/dist/commands/auth/email/push.js.map +1 -1
  52. package/dist/commands/auth/email/resend.d.ts +1 -1
  53. package/dist/commands/auth/email/resend.d.ts.map +1 -1
  54. package/dist/commands/auth/email/reset.d.ts +2 -2
  55. package/dist/commands/auth/email/reset.d.ts.map +1 -1
  56. package/dist/commands/auth/email/reset.js +3 -3
  57. package/dist/commands/auth/email/reset.js.map +1 -1
  58. package/dist/commands/auth/email/status.d.ts +4 -4
  59. package/dist/commands/auth/email/status.d.ts.map +1 -1
  60. package/dist/commands/auth/email/status.js +4 -4
  61. package/dist/commands/auth/email/status.js.map +1 -1
  62. package/dist/commands/auth/email/verify.d.ts +1 -1
  63. package/dist/commands/auth/email/verify.d.ts.map +1 -1
  64. package/dist/commands/auth/email/verify.js +1 -1
  65. package/dist/commands/auth/email/verify.js.map +1 -1
  66. package/dist/commands/auth/origin/add.d.ts +1 -1
  67. package/dist/commands/auth/origin/add.d.ts.map +1 -1
  68. package/dist/commands/auth/origin/delete.d.ts +1 -1
  69. package/dist/commands/auth/origin/delete.d.ts.map +1 -1
  70. package/dist/commands/auth/origin/list.d.ts +1 -1
  71. package/dist/commands/auth/origin/list.d.ts.map +1 -1
  72. package/dist/commands/claim.d.ts +2 -2
  73. package/dist/commands/claim.d.ts.map +1 -1
  74. package/dist/commands/claim.js +2 -2
  75. package/dist/commands/claim.js.map +1 -1
  76. package/dist/commands/info.js +2 -2
  77. package/dist/commands/info.js.map +1 -1
  78. package/dist/commands/init.d.ts +1 -1
  79. package/dist/commands/init.d.ts.map +1 -1
  80. package/dist/commands/init.js +3 -0
  81. package/dist/commands/init.js.map +1 -1
  82. package/dist/commands/initWithoutFiles.d.ts.map +1 -1
  83. package/dist/commands/initWithoutFiles.js +7 -3
  84. package/dist/commands/initWithoutFiles.js.map +1 -1
  85. package/dist/commands/login.d.ts +1 -1
  86. package/dist/commands/login.d.ts.map +1 -1
  87. package/dist/commands/pull.d.ts +1 -1
  88. package/dist/commands/pull.d.ts.map +1 -1
  89. package/dist/commands/pull.js +4 -0
  90. package/dist/commands/pull.js.map +1 -1
  91. package/dist/commands/push.d.ts +1 -1
  92. package/dist/commands/push.d.ts.map +1 -1
  93. package/dist/commands/push.js +4 -0
  94. package/dist/commands/push.js.map +1 -1
  95. package/dist/commands/query.d.ts +1 -1
  96. package/dist/commands/query.d.ts.map +1 -1
  97. package/dist/commands/query.js +2 -2
  98. package/dist/commands/query.js.map +1 -1
  99. package/dist/context/authToken.d.ts +2 -2
  100. package/dist/context/authToken.d.ts.map +1 -1
  101. package/dist/context/authToken.js +6 -4
  102. package/dist/context/authToken.js.map +1 -1
  103. package/dist/context/currentApp.d.ts +3 -3
  104. package/dist/context/currentApp.d.ts.map +1 -1
  105. package/dist/context/currentApp.js +20 -20
  106. package/dist/context/currentApp.js.map +1 -1
  107. package/dist/context/globalOpts.d.ts +1 -1
  108. package/dist/context/globalOpts.js +1 -1
  109. package/dist/context/globalOpts.js.map +1 -1
  110. package/dist/context/platformApi.d.ts +3 -3
  111. package/dist/context/platformApi.d.ts.map +1 -1
  112. package/dist/context/platformApi.js +3 -3
  113. package/dist/context/platformApi.js.map +1 -1
  114. package/dist/context/projectInfo.d.ts +4 -4
  115. package/dist/context/projectInfo.d.ts.map +1 -1
  116. package/dist/context/projectInfo.js +12 -18
  117. package/dist/context/projectInfo.js.map +1 -1
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +42 -49
  120. package/dist/index.js.map +1 -1
  121. package/dist/layer.d.ts +4 -4
  122. package/dist/layer.d.ts.map +1 -1
  123. package/dist/layer.js +7 -7
  124. package/dist/layer.js.map +1 -1
  125. package/dist/lib/backupDownload.js +1 -1
  126. package/dist/lib/backupDownload.js.map +1 -1
  127. package/dist/lib/config.d.ts +2 -2
  128. package/dist/lib/config.d.ts.map +1 -1
  129. package/dist/lib/config.js +21 -23
  130. package/dist/lib/config.js.map +1 -1
  131. package/dist/lib/createApp.d.ts +2 -2
  132. package/dist/lib/createApp.d.ts.map +1 -1
  133. package/dist/lib/createApp.js +2 -2
  134. package/dist/lib/createApp.js.map +1 -1
  135. package/dist/lib/email.d.ts +38 -6
  136. package/dist/lib/email.d.ts.map +1 -1
  137. package/dist/lib/email.js +22 -13
  138. package/dist/lib/email.js.map +1 -1
  139. package/dist/lib/handleEnv.js +4 -4
  140. package/dist/lib/handleEnv.js.map +1 -1
  141. package/dist/lib/http.d.ts +13 -13
  142. package/dist/lib/http.d.ts.map +1 -1
  143. package/dist/lib/http.js +12 -12
  144. package/dist/lib/http.js.map +1 -1
  145. package/dist/lib/login.d.ts +4 -4
  146. package/dist/lib/login.d.ts.map +1 -1
  147. package/dist/lib/login.js +4 -4
  148. package/dist/lib/login.js.map +1 -1
  149. package/dist/lib/oauth.d.ts +10 -10
  150. package/dist/lib/oauth.d.ts.map +1 -1
  151. package/dist/lib/oauth.js +7 -7
  152. package/dist/lib/oauth.js.map +1 -1
  153. package/dist/lib/platformApi.d.ts +2 -2
  154. package/dist/lib/platformApi.d.ts.map +1 -1
  155. package/dist/lib/platformApi.js +2 -2
  156. package/dist/lib/platformApi.js.map +1 -1
  157. package/dist/lib/pullPerms.d.ts +2 -2
  158. package/dist/lib/pullPerms.d.ts.map +1 -1
  159. package/dist/lib/pullPerms.js +7 -4
  160. package/dist/lib/pullPerms.js.map +1 -1
  161. package/dist/lib/pullSchema.d.ts +2 -2
  162. package/dist/lib/pullSchema.d.ts.map +1 -1
  163. package/dist/lib/pullSchema.js +8 -5
  164. package/dist/lib/pullSchema.js.map +1 -1
  165. package/dist/lib/pushPerms.d.ts +2 -2
  166. package/dist/lib/pushPerms.d.ts.map +1 -1
  167. package/dist/lib/pushPerms.js +6 -3
  168. package/dist/lib/pushPerms.js.map +1 -1
  169. package/dist/lib/pushSchema.d.ts +2 -2
  170. package/dist/lib/pushSchema.d.ts.map +1 -1
  171. package/dist/lib/pushSchema.js +18 -7
  172. package/dist/lib/pushSchema.js.map +1 -1
  173. package/dist/lib/webhooks.d.ts +1 -1
  174. package/dist/lib/webhooks.d.ts.map +1 -1
  175. package/dist/old.js +9 -9
  176. package/dist/old.js.map +1 -1
  177. package/dist/renderSchemaPlan.d.ts +2 -2
  178. package/dist/renderSchemaPlan.d.ts.map +1 -1
  179. package/dist/renderSchemaPlan.js.map +1 -1
  180. package/dist/util/findConfigCandidates.d.ts +0 -20
  181. package/dist/util/findConfigCandidates.d.ts.map +1 -1
  182. package/dist/util/findConfigCandidates.js +44 -63
  183. package/dist/util/findConfigCandidates.js.map +1 -1
  184. package/dist/util/getAppName.d.ts +2 -2
  185. package/dist/util/getAppName.d.ts.map +1 -1
  186. package/dist/util/getAppName.js +2 -2
  187. package/dist/util/getAppName.js.map +1 -1
  188. package/dist/util/isHeadlessEnvironment.js +1 -1
  189. package/dist/util/isHeadlessEnvironment.js.map +1 -1
  190. package/dist/util/loadConfig.d.ts.map +1 -1
  191. package/dist/util/loadConfig.js +4 -11
  192. package/dist/util/loadConfig.js.map +1 -1
  193. package/dist/util/loadEnv.d.ts.map +1 -1
  194. package/dist/util/loadEnv.js +0 -6
  195. package/dist/util/loadEnv.js.map +1 -1
  196. package/dist/util/oldConfigFiles.d.ts +30 -0
  197. package/dist/util/oldConfigFiles.d.ts.map +1 -0
  198. package/dist/util/oldConfigFiles.js +104 -0
  199. package/dist/util/oldConfigFiles.js.map +1 -0
  200. package/dist/util/projectDir.d.ts +1 -1
  201. package/dist/util/projectDir.d.ts.map +1 -1
  202. package/dist/util/projectDir.js +6 -9
  203. package/dist/util/projectDir.js.map +1 -1
  204. package/dist/util/sidekickConfig.d.ts +9 -0
  205. package/dist/util/sidekickConfig.d.ts.map +1 -0
  206. package/dist/util/sidekickConfig.js +18 -0
  207. package/dist/util/sidekickConfig.js.map +1 -0
  208. package/package.json +5 -6
  209. package/src/auth/index.ts +6 -54
  210. package/src/commands/app/delete.ts +2 -2
  211. package/src/commands/app/list.ts +2 -2
  212. package/src/commands/auth/client/delete.ts +2 -2
  213. package/src/commands/auth/email/pull.ts +5 -2
  214. package/src/commands/auth/email/push.ts +3 -3
  215. package/src/commands/auth/email/reset.ts +5 -3
  216. package/src/commands/auth/email/status.ts +4 -4
  217. package/src/commands/auth/email/verify.ts +1 -1
  218. package/src/commands/claim.ts +2 -2
  219. package/src/commands/info.ts +2 -2
  220. package/src/commands/init.ts +3 -0
  221. package/src/commands/initWithoutFiles.ts +13 -6
  222. package/src/commands/pull.ts +6 -0
  223. package/src/commands/push.ts +6 -0
  224. package/src/commands/query.ts +2 -2
  225. package/src/context/authToken.ts +9 -5
  226. package/src/context/currentApp.ts +20 -20
  227. package/src/context/globalOpts.ts +1 -1
  228. package/src/context/platformApi.ts +3 -3
  229. package/src/context/projectInfo.ts +13 -20
  230. package/src/index.ts +42 -52
  231. package/src/layer.ts +10 -10
  232. package/src/lib/backupDownload.ts +1 -1
  233. package/src/lib/config.ts +21 -23
  234. package/src/lib/createApp.ts +2 -2
  235. package/src/lib/email.ts +30 -15
  236. package/src/lib/handleEnv.ts +4 -4
  237. package/src/lib/http.ts +28 -24
  238. package/src/lib/login.ts +4 -4
  239. package/src/lib/oauth.ts +7 -7
  240. package/src/lib/platformApi.ts +2 -2
  241. package/src/lib/pullPerms.ts +7 -4
  242. package/src/lib/pullSchema.ts +9 -6
  243. package/src/lib/pushPerms.ts +6 -3
  244. package/src/lib/pushSchema.ts +19 -7
  245. package/src/old.js +9 -9
  246. package/src/renderSchemaPlan.ts +3 -3
  247. package/src/util/findConfigCandidates.ts +45 -71
  248. package/src/util/getAppName.ts +2 -2
  249. package/src/util/isHeadlessEnvironment.ts +1 -1
  250. package/src/util/loadConfig.ts +4 -12
  251. package/src/util/loadEnv.ts +0 -8
  252. package/src/util/oldConfigFiles.ts +132 -0
  253. package/src/util/projectDir.ts +7 -9
  254. package/src/util/sidekickConfig.ts +25 -0
  255. package/__tests__/legacyPackageCompat.test.ts +0 -104
  256. package/dist/util/envAliases.d.ts +0 -25
  257. package/dist/util/envAliases.d.ts.map +0 -1
  258. package/dist/util/envAliases.js +0 -47
  259. package/dist/util/envAliases.js.map +0 -1
  260. package/dist/util/instantConfig.d.ts +0 -9
  261. package/dist/util/instantConfig.d.ts.map +0 -1
  262. package/dist/util/instantConfig.js +0 -13
  263. package/dist/util/instantConfig.js.map +0 -1
  264. package/src/util/envAliases.ts +0 -53
  265. package/src/util/instantConfig.ts +0 -21
@@ -3,12 +3,12 @@ import { randomUUID } from 'node:crypto';
3
3
  import { Context, Data, Effect, Layer, Runtime, Schema, Option } from 'effect';
4
4
  import { UI } from '../ui/index.ts';
5
5
  import { handleEnv } from '../lib/handleEnv.ts';
6
- import { getBaseUrl, InstantHttpAuthed, withCommand } from '../lib/http.ts';
6
+ import { getBaseUrl, SidekickHttpAuthed, withCommand } from '../lib/http.ts';
7
7
  import { runUIEffect } from '../lib/ui.ts';
8
8
  import { AuthToken } from './authToken.ts';
9
9
  import { GlobalOpts } from './globalOpts.ts';
10
10
  import { PlatformApi } from './platformApi.ts';
11
- import { readInstantConfigFile } from '../util/instantConfig.ts';
11
+ import { readSidekickConfigFile } from '../util/sidekickConfig.ts';
12
12
  import { BadArgsError } from '../errors.ts';
13
13
 
14
14
  export type CurrentAppInfo = {
@@ -18,7 +18,7 @@ export type CurrentAppInfo = {
18
18
  };
19
19
 
20
20
  export class CurrentApp extends Context.Tag(
21
- 'instant-cli/new/context/currentApp',
21
+ 'sidekick-cli/new/context/currentApp',
22
22
  )<CurrentApp, CurrentAppInfo>() {}
23
23
 
24
24
  function isUUID(uuid: string) {
@@ -38,21 +38,21 @@ export class AppNotFoundError extends Data.TaggedError('AppNotFoundError')<{
38
38
  }> {}
39
39
 
40
40
  export const potentialEnvs: Record<string, string> = {
41
- catchall: 'INSTANT_APP_ID',
42
- next: 'NEXT_PUBLIC_INSTANT_APP_ID',
43
- svelte: 'PUBLIC_INSTANT_APP_ID',
44
- vite: 'VITE_INSTANT_APP_ID',
45
- expo: 'EXPO_PUBLIC_INSTANT_APP_ID',
46
- nuxt: 'NUXT_PUBLIC_INSTANT_APP_ID',
47
- bun: 'BUN_PUBLIC_INSTANT_APP_ID',
41
+ catchall: 'SIDEKICK_APP_ID',
42
+ next: 'NEXT_PUBLIC_SIDEKICK_APP_ID',
43
+ svelte: 'PUBLIC_SIDEKICK_APP_ID',
44
+ vite: 'VITE_SIDEKICK_APP_ID',
45
+ expo: 'EXPO_PUBLIC_SIDEKICK_APP_ID',
46
+ nuxt: 'NUXT_PUBLIC_SIDEKICK_APP_ID',
47
+ bun: 'BUN_PUBLIC_SIDEKICK_APP_ID',
48
48
  };
49
49
 
50
50
  const potentialAdminTokenEnvs = {
51
- default: 'INSTANT_APP_ADMIN_TOKEN',
52
- short: 'INSTANT_ADMIN_TOKEN',
51
+ default: 'SIDEKICK_APP_ADMIN_TOKEN',
52
+ short: 'SIDEKICK_ADMIN_TOKEN',
53
53
  } as const;
54
54
 
55
- // TODO: add instant.config.ts support
55
+ // TODO: add sidekick.config.ts support
56
56
  export const CurrentAppLive = (args: {
57
57
  appId?: string;
58
58
  coerce?: boolean;
@@ -70,9 +70,9 @@ export const CurrentAppLive = (args: {
70
70
  source: 'flag' as const,
71
71
  };
72
72
  } else {
73
- // Check for instant.config.ts
73
+ // Check for sidekick.config.ts
74
74
  const config = yield* Effect.tryPromise(() =>
75
- readInstantConfigFile(),
75
+ readSidekickConfigFile(),
76
76
  );
77
77
  if (!config) {
78
78
  return yield* new BadArgsError({
@@ -82,7 +82,7 @@ export const CurrentAppLive = (args: {
82
82
  const nameMatch = config?.apps?.[args.appId];
83
83
  if (!nameMatch?.id) {
84
84
  return yield* BadArgsError.make({
85
- message: 'App ID not found in app inside instant.config.ts',
85
+ message: 'App ID not found in app inside sidekick.config.ts',
86
86
  });
87
87
  }
88
88
  if (nameMatch) {
@@ -187,7 +187,7 @@ const createApp = Effect.fn(function* (title: string, orgId?: string) {
187
187
  const token = randomUUID();
188
188
  const app = { id, title, admin_token: token, org_id: orgId };
189
189
 
190
- const http = yield* InstantHttpAuthed;
190
+ const http = yield* SidekickHttpAuthed;
191
191
  yield* HttpClientRequest.post('/dash/apps').pipe(
192
192
  HttpClientRequest.bodyJson(app),
193
193
  Effect.flatMap(http.execute),
@@ -229,7 +229,7 @@ const promptImportOrCreateApp = Effect.gen(function* () {
229
229
  const getSimpleApi = Effect.gen(function* () {
230
230
  const effectRuntime = yield* Effect.runtime<never>();
231
231
 
232
- const http = yield* InstantHttpAuthed;
232
+ const http = yield* SidekickHttpAuthed;
233
233
  const dashData = yield* http
234
234
  .get('/dash')
235
235
  .pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(Schema.Any)));
@@ -244,7 +244,7 @@ const getSimpleApi = Effect.gen(function* () {
244
244
  return Runtime.runPromise(
245
245
  effectRuntime,
246
246
  createApp(title, orgId).pipe(
247
- Effect.provideService(InstantHttpAuthed, http),
247
+ Effect.provideService(SidekickHttpAuthed, http),
248
248
  ),
249
249
  );
250
250
  },
@@ -296,6 +296,6 @@ const getAdminToken = Effect.gen(function* () {
296
296
 
297
297
  const trackAppImport = (appId: string) =>
298
298
  Effect.gen(function* () {
299
- const http = (yield* InstantHttpAuthed).pipe(withCommand('init'));
299
+ const http = (yield* SidekickHttpAuthed).pipe(withCommand('init'));
300
300
  yield* http.post(`/dash/apps/${appId}/track-import`);
301
301
  });
@@ -2,7 +2,7 @@ import { Context, Layer } from 'effect';
2
2
  import { program } from '../program.ts';
3
3
 
4
4
  export class GlobalOpts extends Context.Tag(
5
- 'instant-cli/new/context/globalOpts',
5
+ 'sidekick-cli/new/context/globalOpts',
6
6
  )<
7
7
  GlobalOpts,
8
8
  {
@@ -1,4 +1,4 @@
1
- import { PlatformApi as InstantPlatformApi } from '@sidekickdb/platform';
1
+ import { PlatformApi as SidekickPlatformApi } from '@sidekickdb/platform';
2
2
  import { Data, Effect } from 'effect';
3
3
  import { getBaseUrl } from '../lib/http.ts';
4
4
 
@@ -8,11 +8,11 @@ export class PlatformApiError extends Data.TaggedError('PlatformApiError')<{
8
8
  }> {}
9
9
 
10
10
  export class PlatformApi extends Effect.Service<PlatformApi>()(
11
- 'instant-cli/new/context/platformApi',
11
+ 'sidekick-cli/new/context/platformApi',
12
12
  {
13
13
  effect: Effect.gen(function* () {
14
14
  const origin = yield* getBaseUrl;
15
- const apiClient = new InstantPlatformApi({
15
+ const apiClient = new SidekickPlatformApi({
16
16
  apiURI: origin,
17
17
  });
18
18
 
@@ -12,13 +12,13 @@ import { GlobalOpts } from './globalOpts.ts';
12
12
  import { BadArgsError } from '../errors.ts';
13
13
 
14
14
  export class ProjectInfo extends Context.Tag(
15
- 'instant-cli/new/context/projectInfo',
15
+ 'sidekick-cli/new/context/projectInfo',
16
16
  )<
17
17
  ProjectInfo,
18
18
  {
19
19
  pkgDir: string;
20
- projectType: 'node' | 'deno' | 'python';
21
- instantModuleName: string;
20
+ projectType: 'node' | 'deno';
21
+ sidekickModuleName: string;
22
22
  }
23
23
  >() {}
24
24
 
@@ -53,15 +53,16 @@ const getProjectInfo = (
53
53
  if (!projectDir) {
54
54
  return yield* new ProjectInfoError({
55
55
  message:
56
- "Couldn't find a project directory. Is there a package.json, deno.json, or pyproject.toml file?",
56
+ // SidekickDB: no Python projects, the Python SDK is removed.
57
+ "Couldn't find a project directory. Is there a package.json or deno.json file?",
57
58
  });
58
59
  }
59
60
 
60
- if (projectDir.type === 'deno' || projectDir.type === 'python') {
61
+ if (projectDir.type === 'deno') {
61
62
  return {
62
63
  pkgDir: projectDir.dir,
63
64
  projectType: projectDir.type,
64
- instantModuleName: '@sidekickdb/core',
65
+ sidekickModuleName: '@sidekickdb/core',
65
66
  };
66
67
  }
67
68
 
@@ -75,7 +76,7 @@ const getProjectInfo = (
75
76
  });
76
77
 
77
78
  yield* Effect.log('Checking for a SidekickDB SDK...');
78
- let moduleName = getInstantModuleName(pkgJson);
79
+ let moduleName = getSidekickModuleName(pkgJson);
79
80
  if (!moduleName && !coerce) {
80
81
  return yield* new ProjectInfoError({
81
82
  message:
@@ -179,13 +180,13 @@ const getProjectInfo = (
179
180
  return {
180
181
  pkgDir: projectDir.dir,
181
182
  projectType: projectDir.type,
182
- instantModuleName: moduleName,
183
+ sidekickModuleName: moduleName,
183
184
  };
184
185
  } else {
185
186
  return {
186
187
  pkgDir: projectDir.dir,
187
188
  projectType: projectDir.type,
188
- instantModuleName: moduleName!,
189
+ sidekickModuleName: moduleName!,
189
190
  };
190
191
  }
191
192
  });
@@ -195,10 +196,10 @@ export const ProjectInfoLive = (
195
196
  packageName?: keyof typeof PACKAGE_ALIAS_AND_FULL_NAMES,
196
197
  ) => Layer.effect(ProjectInfo, getProjectInfo(coerce, packageName));
197
198
 
198
- export function getInstantModuleName(pkgJson: PackageJson) {
199
+ export function getSidekickModuleName(pkgJson: PackageJson) {
199
200
  const deps = pkgJson.dependencies || {};
200
201
  const devDeps = pkgJson.devDependencies || {};
201
- const instantModuleName = [
202
+ const sidekickModuleName = [
202
203
  '@sidekickdb/react',
203
204
  '@sidekickdb/react-native',
204
205
  '@sidekickdb/core',
@@ -206,16 +207,8 @@ export function getInstantModuleName(pkgJson: PackageJson) {
206
207
  '@sidekickdb/solidjs',
207
208
  '@sidekickdb/svelte',
208
209
  '@sidekickdb/vue',
209
- // Legacy package names, so existing projects keep working
210
- '@instantdb/react',
211
- '@instantdb/react-native',
212
- '@instantdb/core',
213
- '@instantdb/admin',
214
- '@instantdb/solidjs',
215
- '@instantdb/svelte',
216
- '@instantdb/vue',
217
210
  ].find((name) => deps[name] || devDeps[name]);
218
- return instantModuleName;
211
+ return sidekickModuleName;
219
212
  }
220
213
 
221
214
  function getInstallCommand(packageManager: string, moduleName: string) {
package/src/index.ts CHANGED
@@ -69,17 +69,7 @@ program
69
69
  }),
70
70
  )
71
71
  .addHelpOption(globalOption('-h --help', 'Print the help text for a command'))
72
- .usage(`<command> ${chalk.dim('[options] [args]')}`)
73
- .addHelpText(
74
- 'after',
75
- `
76
- Names:
77
- Every INSTANT_* environment variable can also be set as SIDEKICK_*, for
78
- example SIDEKICK_CLI_API_URI or NEXT_PUBLIC_SIDEKICK_APP_ID, and the
79
- instant.config, instant.schema, instant.perms and instant.email files can be
80
- named sidekick.* instead. The SIDEKICK name wins when both exist.
81
- `,
82
- );
72
+ .usage(`<command> ${chalk.dim('[options] [args]')}`);
83
73
 
84
74
  // Command List
85
75
  export const initDef = program
@@ -145,7 +135,7 @@ export const appDeleteDef = app
145
135
  .description('Delete an app from your SidekickDB account')
146
136
  .option(
147
137
  '-a --app <app-id>',
148
- 'App ID to delete. Defaults to *_INSTANT_APP_ID in .env',
138
+ 'App ID to delete. Defaults to *_SIDEKICK_APP_ID in .env',
149
139
  )
150
140
  .action(async (opts) => {
151
141
  return runCommandEffect(
@@ -175,7 +165,7 @@ export const authClientAddDef = authClient
175
165
  )
176
166
  .option(
177
167
  '-a --app <app-id>',
178
- 'App ID to modify. Defaults to *_INSTANT_APP_ID in .env',
168
+ 'App ID to modify. Defaults to *_SIDEKICK_APP_ID in .env',
179
169
  )
180
170
  .addHelpText(
181
171
  'after',
@@ -229,7 +219,7 @@ export const authClientListDef = authClient
229
219
  .command('list')
230
220
  .option(
231
221
  '-a --app <app-id>',
232
- 'App ID to list clients for. Defaults to *_INSTANT_APP_ID in .env',
222
+ 'App ID to list clients for. Defaults to *_SIDEKICK_APP_ID in .env',
233
223
  )
234
224
  .option('--json', 'Enable JSON output')
235
225
  .allowUnknownOption(true)
@@ -242,7 +232,7 @@ export const authClientListDef = authClient
242
232
  coerceAuth: false,
243
233
  appId: opts.app,
244
234
  allowAdminToken: true,
245
- // Silence "searching for instant sdk.. logs for json output"
235
+ // Silence "searching for SidekickDB sdk.. logs for json output"
246
236
  }).pipe(Layer.annotateLogs('silent', !!opts.json)),
247
237
  ),
248
238
  ),
@@ -255,7 +245,7 @@ export const authClientDeleteDef = authClient
255
245
  .option('--name <client-name>', 'Client name to delete')
256
246
  .option(
257
247
  '-a --app <app-id>',
258
- 'App ID to delete a client from. Defaults to *_INSTANT_APP_ID in .env',
248
+ 'App ID to delete a client from. Defaults to *_SIDEKICK_APP_ID in .env',
259
249
  )
260
250
  .action((opts) => {
261
251
  return runCommandEffect(
@@ -280,7 +270,7 @@ export const authClientUpdateDef = authClient
280
270
  .option('--name <client-name>', 'Client name to update')
281
271
  .option(
282
272
  '-a --app <app-id>',
283
- 'App ID to update a client in. Defaults to *_INSTANT_APP_ID in .env',
273
+ 'App ID to update a client in. Defaults to *_SIDEKICK_APP_ID in .env',
284
274
  )
285
275
  .addHelpText(
286
276
  'after',
@@ -335,7 +325,7 @@ export const authOriginListDef = authOrigin
335
325
  .command('list')
336
326
  .option(
337
327
  '-a --app <app-id>',
338
- 'App ID to list origins for. Defaults to *_INSTANT_APP_ID in .env',
328
+ 'App ID to list origins for. Defaults to *_SIDEKICK_APP_ID in .env',
339
329
  )
340
330
  .option('--json', 'Enable JSON output')
341
331
  .action((opts) => {
@@ -371,7 +361,7 @@ export const authOriginAddDef = authOrigin
371
361
  )
372
362
  .option(
373
363
  '-a --app <app-id>',
374
- 'App ID to add an origin to. Defaults to *_INSTANT_APP_ID in .env',
364
+ 'App ID to add an origin to. Defaults to *_SIDEKICK_APP_ID in .env',
375
365
  )
376
366
  .addHelpText(
377
367
  'after',
@@ -403,7 +393,7 @@ export const authOriginDeleteDef = authOrigin
403
393
  .option('--id <origin-id>', 'Origin ID to delete')
404
394
  .option(
405
395
  '-a --app <app-id>',
406
- 'App ID to delete an origin from. Defaults to *_INSTANT_APP_ID in .env',
396
+ 'App ID to delete an origin from. Defaults to *_SIDEKICK_APP_ID in .env',
407
397
  )
408
398
  .action((opts) => {
409
399
  return runCommandEffect(
@@ -428,7 +418,7 @@ export const webhooksListDef = webhooks
428
418
  .description('List webhooks for an app')
429
419
  .option(
430
420
  '-a --app <app-id>',
431
- 'App ID to list webhooks for. Defaults to *_INSTANT_APP_ID in .env',
421
+ 'App ID to list webhooks for. Defaults to *_SIDEKICK_APP_ID in .env',
432
422
  )
433
423
  .option('--json', 'Enable JSON output')
434
424
  .action((opts) => {
@@ -460,7 +450,7 @@ export const webhooksAddDef = webhooks
460
450
  )
461
451
  .option(
462
452
  '-a --app <app-id>',
463
- 'App ID to add a webhook to. Defaults to *_INSTANT_APP_ID in .env',
453
+ 'App ID to add a webhook to. Defaults to *_SIDEKICK_APP_ID in .env',
464
454
  )
465
455
  .action((opts) => {
466
456
  return runCommandEffect(
@@ -489,7 +479,7 @@ export const webhooksUpdateDef = webhooks
489
479
  )
490
480
  .option(
491
481
  '-a --app <app-id>',
492
- 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',
482
+ 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env',
493
483
  )
494
484
  .action((opts) => {
495
485
  return runCommandEffect(
@@ -512,7 +502,7 @@ export const webhooksDeleteDef = webhooks
512
502
  .option('--id <webhook-id>', 'Webhook ID to delete')
513
503
  .option(
514
504
  '-a --app <app-id>',
515
- 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',
505
+ 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env',
516
506
  )
517
507
  .action((opts) => {
518
508
  return runCommandEffect(
@@ -535,7 +525,7 @@ export const webhooksEnableDef = webhooks
535
525
  .option('--id <webhook-id>', 'Webhook ID to enable')
536
526
  .option(
537
527
  '-a --app <app-id>',
538
- 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',
528
+ 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env',
539
529
  )
540
530
  .action((opts) => {
541
531
  return runCommandEffect(
@@ -559,7 +549,7 @@ export const webhooksDisableDef = webhooks
559
549
  .option('--reason <reason>', 'Human-readable reason stored on the webhook')
560
550
  .option(
561
551
  '-a --app <app-id>',
562
- 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',
552
+ 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env',
563
553
  )
564
554
  .action((opts) => {
565
555
  return runCommandEffect(
@@ -587,7 +577,7 @@ export const webhooksEventsListDef = webhooksEvents
587
577
  .option('--json', 'Enable JSON output')
588
578
  .option(
589
579
  '-a --app <app-id>',
590
- 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',
580
+ 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env',
591
581
  )
592
582
  .action((opts) => {
593
583
  return runCommandEffect(
@@ -611,7 +601,7 @@ export const webhooksEventsResendDef = webhooksEvents
611
601
  .option('--isn <isn>', 'Event ISN to resend')
612
602
  .option(
613
603
  '-a --app <app-id>',
614
- 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',
604
+ 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env',
615
605
  )
616
606
  .action((opts) => {
617
607
  return runCommandEffect(
@@ -635,7 +625,7 @@ export const webhooksEventsPayloadDef = webhooksEvents
635
625
  .option('--isn <isn>', 'Event ISN to fetch')
636
626
  .option(
637
627
  '-a --app <app-id>',
638
- 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',
628
+ 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env',
639
629
  )
640
630
  .action((opts) => {
641
631
  return runCommandEffect(
@@ -661,7 +651,7 @@ export const backupListDef = backup
661
651
  .description('List downloadable backups for an app')
662
652
  .option(
663
653
  '-a --app <app-id>',
664
- 'App ID to list backups for. Defaults to *_INSTANT_APP_ID in .env',
654
+ 'App ID to list backups for. Defaults to *_SIDEKICK_APP_ID in .env',
665
655
  )
666
656
  .option('--json', 'Output backups as JSON')
667
657
  .action((opts) => {
@@ -688,12 +678,12 @@ export const backupDownloadDef = backup
688
678
  )
689
679
  .option(
690
680
  '-a --app <app-id>',
691
- 'App ID to download a backup of. Defaults to *_INSTANT_APP_ID in .env',
681
+ 'App ID to download a backup of. Defaults to *_SIDEKICK_APP_ID in .env',
692
682
  )
693
683
  .option('--latest', 'Download the most recent backup')
694
684
  .option(
695
685
  '-o --out <path>',
696
- 'Output zip path. Defaults to instant-backup-<timestamp>.zip',
686
+ 'Output zip path. Defaults to sidekick-backup-<timestamp>.zip',
697
687
  )
698
688
  .action((backupId, opts) => {
699
689
  return runCommandEffect(
@@ -719,7 +709,7 @@ export const authEmailStatusDef = authEmail
719
709
  .description('Get status for the custom magic code email template')
720
710
  .option(
721
711
  '-a --app <app-id>',
722
- 'App ID to push email settings to. Defaults to *_INSTANT_APP_ID in .env',
712
+ 'App ID to push email settings to. Defaults to *_SIDEKICK_APP_ID in .env',
723
713
  )
724
714
  .option('--json', 'Output email status as JSON')
725
715
  .action((opts) => {
@@ -741,11 +731,11 @@ export const authEmailPushDef = authEmail
741
731
  .description('Push the custom magic code email template.')
742
732
  .option(
743
733
  '-a --app <app-id>',
744
- 'App ID to push email settings to. Defaults to *_INSTANT_APP_ID in .env',
734
+ 'App ID to push email settings to. Defaults to *_SIDEKICK_APP_ID in .env',
745
735
  )
746
736
  .option(
747
737
  '-f --file <path>',
748
- 'Path to instant.email.ts. Defaults to INSTANT_EMAIL_FILE_PATH or auto-discovery.',
738
+ 'Path to sidekick.email.ts. Defaults to SIDEKICK_EMAIL_FILE_PATH or auto-discovery.',
749
739
  )
750
740
  .action((opts) =>
751
741
  runCommandEffect(
@@ -767,11 +757,11 @@ export const authEmailPullDef = authEmail
767
757
  .description('Pull the custom magic code email template.')
768
758
  .option(
769
759
  '-a --app <app-id>',
770
- 'App ID to pull email settings from. Defaults to *_INSTANT_APP_ID in .env',
760
+ 'App ID to pull email settings from. Defaults to *_SIDEKICK_APP_ID in .env',
771
761
  )
772
762
  .option(
773
763
  '-f --file <path>',
774
- 'Path to instant.email.ts. Defaults to INSTANT_EMAIL_FILE_PATH or auto-discovery.',
764
+ 'Path to sidekick.email.ts. Defaults to SIDEKICK_EMAIL_FILE_PATH or auto-discovery.',
775
765
  )
776
766
  .action((opts) =>
777
767
  runCommandEffect(
@@ -793,7 +783,7 @@ export const authEmailResetDef = authEmail
793
783
  .description('Delete the custom magic code email template.')
794
784
  .option(
795
785
  '-a --app <app-id>',
796
- 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env',
786
+ 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env',
797
787
  )
798
788
  .action((opts) =>
799
789
  runCommandEffect(
@@ -815,7 +805,7 @@ export const authEmailResendDef = authEmail
815
805
  .description('Resend the verification email')
816
806
  .option(
817
807
  '-a --app <app-id>',
818
- 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env',
808
+ 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env',
819
809
  )
820
810
  .action(() => {
821
811
  runCommandEffect(
@@ -837,7 +827,7 @@ export const authEmailVerifyDef = authEmail
837
827
  .argument('<code>', 'The magic code to verify')
838
828
  .option(
839
829
  '-a --app <app-id>',
840
- 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env',
830
+ 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env',
841
831
  )
842
832
  .action((code, opts) => {
843
833
  runCommandEffect(
@@ -925,7 +915,7 @@ export const explorerDef = program
925
915
  .description('Opens the Explorer in your browser')
926
916
  .option(
927
917
  '-a --app <app-id>',
928
- 'App ID to open the explorer to. Defaults to *_INSTANT_APP_ID in .env',
918
+ 'App ID to open the explorer to. Defaults to *_SIDEKICK_APP_ID in .env',
929
919
  )
930
920
  .action(async (opts) => {
931
921
  return runCommandEffect(
@@ -943,10 +933,10 @@ export const explorerDef = program
943
933
 
944
934
  export const queryDef = program
945
935
  .command('query')
946
- .argument('<query>', 'InstaQL query as JSON/JSON5')
936
+ .argument('<query>', 'SideQL query as JSON/JSON5')
947
937
  .option(
948
938
  '-a --app <app-id>',
949
- 'App ID to query. Defaults to *_INSTANT_APP_ID in .env',
939
+ 'App ID to query. Defaults to *_SIDEKICK_APP_ID in .env',
950
940
  )
951
941
  .option('--admin', 'Run the query as admin (bypasses permissions)')
952
942
  .option('--as-email <email>', 'Run the query as a specific user by email')
@@ -955,7 +945,7 @@ export const queryDef = program
955
945
  '--as-token <refresh-token>',
956
946
  'Run the query as a user identified by refresh token',
957
947
  )
958
- .description('Run an InstaQL query against your app.')
948
+ .description('Run a SideQL query against your app.')
959
949
  .action(async function (queryArg, opts) {
960
950
  return runCommandEffect(queryCmd(queryArg, opts));
961
951
  });
@@ -968,7 +958,7 @@ export const pullDef = program
968
958
  )
969
959
  .option(
970
960
  '-a --app <app-id>',
971
- 'App ID to pull to. Defaults to *_INSTANT_APP_ID in .env',
961
+ 'App ID to pull to. Defaults to *_SIDEKICK_APP_ID in .env',
972
962
  )
973
963
  .option(
974
964
  '-p --package <react|react-native|core|admin|solid|svelte>',
@@ -983,8 +973,8 @@ export const pullDef = program
983
973
  'after',
984
974
  `
985
975
  Environment Variables:
986
- INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)
987
- INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)
976
+ SIDEKICK_SCHEMA_FILE_PATH Override schema file location (default: sidekick.schema.ts)
977
+ SIDEKICK_PERMS_FILE_PATH Override perms file location (default: sidekick.perms.ts)
988
978
  `,
989
979
  )
990
980
  .action(async function (arg, inputOpts) {
@@ -1014,7 +1004,7 @@ export const pushDef = program
1014
1004
  )
1015
1005
  .option(
1016
1006
  '-a --app <app-id>',
1017
- 'App ID to push to. Defaults to *_INSTANT_APP_ID in .env',
1007
+ 'App ID to push to. Defaults to *_SIDEKICK_APP_ID in .env',
1018
1008
  )
1019
1009
  .option(
1020
1010
  '--skip-check-types',
@@ -1033,8 +1023,8 @@ export const pushDef = program
1033
1023
  'after',
1034
1024
  `
1035
1025
  Environment Variables:
1036
- INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)
1037
- INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)
1026
+ SIDEKICK_SCHEMA_FILE_PATH Override schema file location (default: sidekick.schema.ts)
1027
+ SIDEKICK_PERMS_FILE_PATH Override perms file location (default: sidekick.perms.ts)
1038
1028
  `,
1039
1029
  )
1040
1030
  .action(async function (arg, inputOpts) {
@@ -1061,7 +1051,7 @@ export const claimDef = program
1061
1051
  .description('Transfer a temporary app into your SidekickDB account')
1062
1052
  .option(
1063
1053
  '-a --app <app-id>',
1064
- 'App to claim. Defaults to *_INSTANT_APP_ID in .env',
1054
+ 'App to claim. Defaults to *_SIDEKICK_APP_ID in .env',
1065
1055
  )
1066
1056
  .action(async function (opts) {
1067
1057
  return runCommandEffect(
@@ -1093,7 +1083,7 @@ function globalOption(
1093
1083
  // but we use it in `getLocalAndGlobalOptions`, to produce
1094
1084
  // our own custom list of local and global options.
1095
1085
  // For more info, see the original PR:
1096
- // https://github.com/instantdb/instant/pull/505
1086
+ // upstream pull request #505
1097
1087
  opt.__global = true;
1098
1088
  return opt;
1099
1089
  }
package/src/layer.ts CHANGED
@@ -13,9 +13,9 @@ import {
13
13
  ProjectInfoLive,
14
14
  } from './context/projectInfo.ts';
15
15
  import {
16
- InstantHttpAuthedLive,
17
- InstantHttpError,
18
- InstantHttpLive,
16
+ SidekickHttpAuthedLive,
17
+ SidekickHttpError,
18
+ SidekickHttpLive,
19
19
  } from './lib/http.ts';
20
20
  import { SimpleLogLayer } from './logging.ts';
21
21
  import { RequestError } from '@effect/platform/HttpClientError';
@@ -81,7 +81,7 @@ export const printRedErrors = Effect.catchAllCause((cause) =>
81
81
  }
82
82
 
83
83
  // Special error handling for specific error types
84
- if (theError instanceof InstantHttpError) {
84
+ if (theError instanceof SidekickHttpError) {
85
85
  if (theError?.message) {
86
86
  yield* Effect.logError(
87
87
  'Error making request to SidekickDB API: ' + theError.message,
@@ -147,15 +147,15 @@ const AuthTokenLayer = ({
147
147
  }) =>
148
148
  Layer.provide(AuthTokenLive({ allowAdminToken, coerce }), NodeContext.layer);
149
149
 
150
- const InstantHttpLayer = Layer.provide(InstantHttpLive, NodeHttpClient.layer);
150
+ const SidekickHttpLayer = Layer.provide(SidekickHttpLive, NodeHttpClient.layer);
151
151
 
152
- // Unauthenticated layer with InstantHttp + PlatformApi + GlobalOpts + NodeContext
152
+ // Unauthenticated layer with SidekickHttp + PlatformApi + GlobalOpts + NodeContext
153
153
  export const BaseLayerLive = Layer.provideMerge(
154
- Layer.mergeAll(InstantHttpLayer, PlatformApi.Default, GlobalOptsLive),
154
+ Layer.mergeAll(SidekickHttpLayer, PlatformApi.Default, GlobalOptsLive),
155
155
  NodeContext.layer,
156
156
  );
157
157
 
158
- // Authenticated layer extends BaseLayerLive with InstantHttpAuthed
158
+ // Authenticated layer extends BaseLayerLive with SidekickHttpAuthed
159
159
  export const AuthLayerLive = ({
160
160
  allowAdminToken = true,
161
161
  coerce = false,
@@ -165,10 +165,10 @@ export const AuthLayerLive = ({
165
165
  }) =>
166
166
  Layer.provideMerge(
167
167
  Layer.provideMerge(
168
- InstantHttpAuthedLive,
168
+ SidekickHttpAuthedLive,
169
169
  Layer.merge(
170
170
  AuthTokenLayer({ allowAdminToken, coerce }),
171
- InstantHttpLayer,
171
+ SidekickHttpLayer,
172
172
  ),
173
173
  ),
174
174
  BaseLayerLive,
@@ -16,7 +16,7 @@ import type {
16
16
  import version from '../version.js';
17
17
 
18
18
  // Set a user-agent or else cloudfront might block the request
19
- const userAgent = `instant-cli/${version}`;
19
+ const userAgent = `sidekick-cli/${version}`;
20
20
 
21
21
  export type {
22
22
  BackupDownloadProgress,