@openworkers/api-types 1.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/LICENSE +21 -0
- package/package.json +25 -0
- package/types.d.ts +134 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 OpenWorkers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openworkers/api-types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"main": "./types.d.ts",
|
|
8
|
+
"types": "./types.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./types.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"description": "TypeScript types for OpenWorkers API",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"openworkers",
|
|
15
|
+
"types",
|
|
16
|
+
"typescript"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/openworkers/openworkers-api"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
}
|
|
25
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated TypeScript types from Zod schemas
|
|
3
|
+
* DO NOT EDIT THIS FILE MANUALLY
|
|
4
|
+
* Generated on: 2025-11-23T13:24:24.098Z
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Global types
|
|
8
|
+
export type hex = string;
|
|
9
|
+
export type uuid = string;
|
|
10
|
+
export type timestamp = number;
|
|
11
|
+
export type Dictionary<T> = Record<string, T>;
|
|
12
|
+
|
|
13
|
+
export type IResource = {
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
desc?: (string | null) | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ITimestamps = { createdAt: Date; updatedAt: Date };
|
|
22
|
+
|
|
23
|
+
export type ILoginResponse = { accessToken: string; refreshToken: string };
|
|
24
|
+
|
|
25
|
+
export type ISelf = {
|
|
26
|
+
id: string;
|
|
27
|
+
username: string;
|
|
28
|
+
avatarUrl?: (string | null) | undefined;
|
|
29
|
+
resourceLimits: IResourceLimits;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type IResourceLimits = {
|
|
33
|
+
environments: number;
|
|
34
|
+
secondPrecision: boolean;
|
|
35
|
+
workers: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type IEnvironment = {
|
|
39
|
+
createdAt: Date;
|
|
40
|
+
updatedAt: Date;
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
desc?: (string | null) | undefined;
|
|
44
|
+
values?: (IEnvironmentValue[] | null) | undefined;
|
|
45
|
+
workers?: (IResource[] | null) | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type IEnvironmentCreateInput = {
|
|
49
|
+
name: string;
|
|
50
|
+
desc?: (string | null) | undefined;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type IEnvironmentUpdateInput = {
|
|
54
|
+
id: string;
|
|
55
|
+
name?: string | undefined;
|
|
56
|
+
desc?: (string | null) | undefined;
|
|
57
|
+
values?: IEnvironmentValueUpdateInput[] | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type IEnvironmentValue = {
|
|
61
|
+
id: string;
|
|
62
|
+
key: string;
|
|
63
|
+
value: string;
|
|
64
|
+
secret: boolean;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type IEnvironmentValueUpdateInput =
|
|
68
|
+
| {
|
|
69
|
+
id: string;
|
|
70
|
+
key?: string | undefined;
|
|
71
|
+
value?: (string | null) | undefined;
|
|
72
|
+
secret?: boolean | undefined;
|
|
73
|
+
}
|
|
74
|
+
| {
|
|
75
|
+
id?: undefined | undefined;
|
|
76
|
+
key: string;
|
|
77
|
+
value: string;
|
|
78
|
+
secret: boolean | undefined;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type ICron = {
|
|
82
|
+
id: string;
|
|
83
|
+
value: string;
|
|
84
|
+
workerId: string;
|
|
85
|
+
lastRun?: (Date | null) | undefined;
|
|
86
|
+
nextRun?: (Date | null) | undefined;
|
|
87
|
+
createdAt: Date;
|
|
88
|
+
updatedAt: Date;
|
|
89
|
+
deletedAt?: (Date | null) | undefined;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type ICronCreateInput = { value: string; workerId: string };
|
|
93
|
+
|
|
94
|
+
export type ICronUpdateInput = { expression: string };
|
|
95
|
+
|
|
96
|
+
export type IDomain = {
|
|
97
|
+
name: string;
|
|
98
|
+
workerId: string;
|
|
99
|
+
userId: string;
|
|
100
|
+
createdAt: Date;
|
|
101
|
+
updatedAt: Date;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type IDomainCreateInput = { name: string; workerId: string };
|
|
105
|
+
|
|
106
|
+
export type IWorker = {
|
|
107
|
+
createdAt: Date;
|
|
108
|
+
updatedAt: Date;
|
|
109
|
+
id: string;
|
|
110
|
+
name: string;
|
|
111
|
+
desc?: (string | null) | undefined;
|
|
112
|
+
language: IWorkerLanguage;
|
|
113
|
+
script: string;
|
|
114
|
+
environment?: (IResource | undefined) | null;
|
|
115
|
+
crons?: ICron[] | undefined;
|
|
116
|
+
domains?: { name: string }[] | undefined;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export type IWorkerCreateInput = {
|
|
120
|
+
name: string;
|
|
121
|
+
desc?: (string | null) | undefined;
|
|
122
|
+
language: IWorkerLanguage;
|
|
123
|
+
script?: string | undefined;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type IWorkerUpdateInput = {
|
|
127
|
+
name?: string | undefined;
|
|
128
|
+
desc?: (string | null) | undefined;
|
|
129
|
+
script?: string | undefined;
|
|
130
|
+
environment?: (string | null) | undefined;
|
|
131
|
+
domains?: string[] | undefined;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export type IWorkerLanguage = 'javascript' | 'typescript';
|