@openworkers/api-types 1.0.8 → 1.1.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 (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +122 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openworkers/api-types",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
package/types.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * Auto-generated TypeScript types from Zod schemas
3
3
  * DO NOT EDIT THIS FILE MANUALLY
4
- * Generated on: 2025-12-24T16:13:59.121Z
4
+ * Generated on: 2025-12-29T10:47:19.977Z
5
+ * Repository: https://github.com/openworkers/openworkers-api.git
6
+ * Version: 1.1.0
7
+ * Build: 2987946df86176d11d09b57c31b7b1b93fc2310d
5
8
  */
6
9
 
7
10
  // Global types
@@ -26,14 +29,16 @@ export type ISelf = {
26
29
  id: string;
27
30
  username: string;
28
31
  avatarUrl?: (string | null) | undefined;
29
- resourceLimits: IResourceLimits;
32
+ limits: IResourceLimits;
30
33
  };
31
34
 
32
35
  export type IResourceLimits = {
33
- databases: number;
36
+ workers: number;
34
37
  environments: number;
38
+ databases: number;
39
+ kv: number;
40
+ storage: number;
35
41
  secondPrecision: boolean;
36
- workers: number;
37
42
  };
38
43
 
39
44
  export type IEnvironment = {
@@ -62,7 +67,7 @@ export type IEnvironmentValue = {
62
67
  id: string;
63
68
  key: string;
64
69
  value: string;
65
- secret: boolean;
70
+ type: 'var' | 'secret' | 'assets' | 'storage' | 'kv' | 'database';
66
71
  };
67
72
 
68
73
  export type IEnvironmentValueUpdateInput =
@@ -70,24 +75,27 @@ export type IEnvironmentValueUpdateInput =
70
75
  id: string;
71
76
  key?: string | undefined;
72
77
  value?: (string | null) | undefined;
73
- secret?: boolean | undefined;
78
+ type?:
79
+ | ('var' | 'secret' | 'assets' | 'storage' | 'kv' | 'database')
80
+ | undefined;
74
81
  }
75
82
  | {
76
83
  id?: undefined | undefined;
77
84
  key: string;
78
85
  value: string;
79
- secret: boolean | undefined;
86
+ type:
87
+ | ('var' | 'secret' | 'assets' | 'storage' | 'kv' | 'database')
88
+ | undefined;
80
89
  };
81
90
 
82
91
  export type ICron = {
92
+ createdAt: Date;
93
+ updatedAt: Date;
83
94
  id: string;
84
95
  value: string;
85
96
  workerId: string;
86
97
  lastRun?: (Date | null) | undefined;
87
98
  nextRun?: (Date | null) | undefined;
88
- createdAt: Date;
89
- updatedAt: Date;
90
- deletedAt?: (Date | null) | undefined;
91
99
  };
92
100
 
93
101
  export type ICronCreateInput = { value: string; workerId: string };
@@ -95,11 +103,11 @@ export type ICronCreateInput = { value: string; workerId: string };
95
103
  export type ICronUpdateInput = { expression: string };
96
104
 
97
105
  export type IDomain = {
106
+ createdAt: Date;
107
+ updatedAt: Date;
98
108
  name: string;
99
109
  workerId: string;
100
110
  userId: string;
101
- createdAt: Date;
102
- updatedAt: Date;
103
111
  };
104
112
 
105
113
  export type IDomainCreateInput = { name: string; workerId: string };
@@ -119,7 +127,7 @@ export type IWorker = {
119
127
 
120
128
  export type IWorkerCreateInput = {
121
129
  name: string;
122
- desc?: (string | null) | undefined;
130
+ desc?: string | undefined;
123
131
  language: IWorkerLanguage;
124
132
  script?: string | undefined;
125
133
  };
@@ -134,10 +142,108 @@ export type IWorkerUpdateInput = {
134
142
 
135
143
  export type IWorkerLanguage = 'javascript' | 'typescript';
136
144
 
137
- export type IDatabase = IResource;
145
+ export type IDatabase = {
146
+ createdAt: Date;
147
+ updatedAt: Date;
148
+ id: string;
149
+ name: string;
150
+ desc?: (string | null) | undefined;
151
+ provider: 'platform' | 'postgres';
152
+ maxRows: number;
153
+ timeoutSeconds: number;
154
+ };
138
155
 
139
- export type IDatabaseCreateInput = {
156
+ export type IDatabaseCreateInput =
157
+ | {
158
+ name: string;
159
+ desc?: string | undefined;
160
+ provider: 'platform';
161
+ maxRows: number;
162
+ timeoutSeconds: number;
163
+ }
164
+ | {
165
+ name: string;
166
+ desc?: string | undefined;
167
+ provider: 'postgres';
168
+ connectionString: string;
169
+ maxRows: number;
170
+ timeoutSeconds: number;
171
+ };
172
+
173
+ export type IColumnDefinition = {
140
174
  name: string;
175
+ type: string;
176
+ primaryKey?: boolean | undefined;
177
+ notNull?: boolean | undefined;
178
+ unique?: boolean | undefined;
179
+ default?: string | undefined;
180
+ };
181
+
182
+ export type IColumnInfo = {
183
+ name: string;
184
+ type: string;
185
+ nullable: boolean;
186
+ defaultValue: string | null;
187
+ primaryKey: boolean;
188
+ };
189
+
190
+ export type ITableInfo = { name: string; rowCount: number };
191
+
192
+ export type ITableDetails = { name: string; columns: IColumnInfo[] };
193
+
194
+ export type ICreateTableInput = { name: string; columns: IColumnDefinition[] };
195
+
196
+ export type IKvNamespace = IResource;
197
+
198
+ export type IKvNamespaceCreateInput = {
199
+ name: string;
200
+ desc?: string | undefined;
201
+ };
202
+
203
+ export type IKvNamespaceUpdateInput = {
204
+ name?: string | undefined;
205
+ desc?: (string | null) | undefined;
206
+ };
207
+
208
+ export type IStorageConfig = {
209
+ createdAt: Date;
210
+ updatedAt: Date;
211
+ id: string;
212
+ name: string;
213
+ desc?: (string | null) | undefined;
214
+ mode: 'shared' | 'custom';
215
+ bucket?: string | undefined;
216
+ prefix?: (string | null) | undefined;
217
+ accessKeyId?: string | undefined;
218
+ secretAccessKey?: string | undefined;
219
+ endpoint?: (string | null) | undefined;
220
+ region?: (string | null) | undefined;
221
+ publicUrl?: (string | null) | undefined;
222
+ };
223
+
224
+ export type IStorageConfigCreateInput =
225
+ | { name: string; desc?: string | undefined; mode: 'shared' }
226
+ | {
227
+ name: string;
228
+ desc?: string | undefined;
229
+ mode: 'custom';
230
+ bucket: string;
231
+ prefix?: string | undefined;
232
+ accessKeyId: string;
233
+ secretAccessKey: string;
234
+ endpoint?: string | undefined;
235
+ region?: string | undefined;
236
+ publicUrl?: string | undefined;
237
+ };
238
+
239
+ export type IStorageConfigUpdateInput = {
240
+ name?: string | undefined;
141
241
  desc?: (string | null) | undefined;
142
- maxRows?: number | undefined;
242
+ bucket?: string | undefined;
243
+ prefix?: (string | null) | undefined;
244
+ accessKeyId?: string | undefined;
245
+ secretAccessKey?: string | undefined;
246
+ endpoint?: (string | null) | undefined;
247
+ region?: (string | null) | undefined;
248
+ publicUrl?: (string | null) | undefined;
143
249
  };