@odvi/create-dtt-framework 0.1.15 → 0.1.17

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.
@@ -106,7 +106,7 @@ export const createCommand = new Command('create')
106
106
  packageJson.name = projectName;
107
107
  packageJson.version = '0.1.0';
108
108
  packageJson.dtt = {
109
- version: '0.1.14' // Current framework version
109
+ version: '0.1.16' // Current framework version
110
110
  };
111
111
  await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });
112
112
  spinner.succeed('Project configured');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odvi/create-dtt-framework",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "CLI tool to scaffold new projects with DTT Framework",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odvi/dtt-framework",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -40,6 +40,9 @@ const envSchema = z.object({
40
40
  SYNOLOGY_HOST: z.string().url().optional(),
41
41
  SYNOLOGY_USERNAME: z.string().optional(),
42
42
  SYNOLOGY_PASSWORD: z.string().optional(),
43
+
44
+ // UploadThing (optional)
45
+ UPLOADTHING_TOKEN: z.string().optional(),
43
46
  })
44
47
 
45
48
  export const env = envSchema.parse(process.env)
@@ -5,6 +5,8 @@ class NextBankClient {
5
5
  private username: string
6
6
  private password: string
7
7
 
8
+ // this is for testing purposes only
9
+
8
10
  constructor() {
9
11
  this.apiUrl = env.NEXTBANK_API ?? ''
10
12
  this.username = env.NEXTBANK_API_USERNAME ?? ''
@@ -0,0 +1,89 @@
1
+ import { UTApi } from 'uploadthing/server'
2
+ import { env } from '@/config/env'
3
+
4
+ export class UploadThingClient {
5
+ private api: UTApi | null = null
6
+
7
+ constructor() {
8
+ // UTApi automatically reads UPLOADTHING_TOKEN from environment
9
+ // Only initialize if token is configured
10
+ if (env.UPLOADTHING_TOKEN) {
11
+ this.api = new UTApi()
12
+ }
13
+ }
14
+
15
+ /**
16
+ * Check if the client is configured
17
+ */
18
+ isConfigured(): boolean {
19
+ return this.api !== null
20
+ }
21
+
22
+ /**
23
+ * Get the underlying UTApi instance
24
+ */
25
+ getApi(): UTApi {
26
+ if (!this.api) {
27
+ throw new Error('UploadThing is not configured. Set UPLOADTHING_TOKEN environment variable.')
28
+ }
29
+ return this.api
30
+ }
31
+
32
+ /**
33
+ * List files from UploadThing
34
+ */
35
+ async listFiles(options?: { limit?: number; offset?: number }) {
36
+ const api = this.getApi()
37
+ return api.listFiles(options)
38
+ }
39
+
40
+ /**
41
+ * Delete a file by its key
42
+ */
43
+ async deleteFile(fileKey: string) {
44
+ const api = this.getApi()
45
+ return api.deleteFiles(fileKey)
46
+ }
47
+
48
+ /**
49
+ * Delete multiple files by their keys
50
+ */
51
+ async deleteFiles(fileKeys: string[]) {
52
+ const api = this.getApi()
53
+ return api.deleteFiles(fileKeys)
54
+ }
55
+
56
+ /**
57
+ * Get file URLs by their keys
58
+ */
59
+ async getFileUrls(fileKeys: string[]) {
60
+ const api = this.getApi()
61
+ return api.getFileUrls(fileKeys)
62
+ }
63
+
64
+ /**
65
+ * Rename a file
66
+ */
67
+ async renameFile(fileKey: string, newName: string) {
68
+ const api = this.getApi()
69
+ return api.renameFiles({ [fileKey]: newName })
70
+ }
71
+
72
+ /**
73
+ * Rename multiple files
74
+ */
75
+ async renameFiles(updates: Record<string, string>) {
76
+ const api = this.getApi()
77
+ return api.renameFiles(updates)
78
+ }
79
+
80
+ /**
81
+ * Get usage info for the app
82
+ */
83
+ async getUsageInfo() {
84
+ const api = this.getApi()
85
+ return api.getUsageInfo()
86
+ }
87
+ }
88
+
89
+ export const uploadThingClient = new UploadThingClient()