@yaakapp/api 0.0.1
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/lib/index.d.ts +4 -0
- package/lib/index.js +9 -0
- package/lib/models.d.ts +116 -0
- package/lib/models.js +2 -0
- package/package.json +15 -0
- package/src/index.ts +8 -0
- package/src/models.ts +134 -0
- package/tsconfig.json +15 -0
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
package/lib/models.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export interface BaseModel {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly createdAt: string;
|
|
4
|
+
readonly updatedAt: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Workspace extends BaseModel {
|
|
7
|
+
readonly model: 'workspace';
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
variables: EnvironmentVariable[];
|
|
11
|
+
settingValidateCertificates: boolean;
|
|
12
|
+
settingFollowRedirects: boolean;
|
|
13
|
+
settingRequestTimeout: number;
|
|
14
|
+
}
|
|
15
|
+
export interface EnvironmentVariable {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface Folder extends BaseModel {
|
|
21
|
+
readonly workspaceId: string;
|
|
22
|
+
readonly model: 'folder';
|
|
23
|
+
folderId: string | null;
|
|
24
|
+
sortPriority: number;
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
27
|
+
export interface Environment extends BaseModel {
|
|
28
|
+
readonly workspaceId: string;
|
|
29
|
+
readonly model: 'environment';
|
|
30
|
+
name: string;
|
|
31
|
+
variables: EnvironmentVariable[];
|
|
32
|
+
}
|
|
33
|
+
export interface HttpHeader {
|
|
34
|
+
name: string;
|
|
35
|
+
value: string;
|
|
36
|
+
enabled?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface HttpUrlParameter {
|
|
39
|
+
name: string;
|
|
40
|
+
value: string;
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface GrpcMetadataEntry {
|
|
44
|
+
name: string;
|
|
45
|
+
value: string;
|
|
46
|
+
enabled?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface GrpcRequest extends BaseModel {
|
|
49
|
+
readonly workspaceId: string;
|
|
50
|
+
readonly model: 'grpc_request';
|
|
51
|
+
folderId: string | null;
|
|
52
|
+
sortPriority: number;
|
|
53
|
+
name: string;
|
|
54
|
+
url: string;
|
|
55
|
+
service: string | null;
|
|
56
|
+
method: string | null;
|
|
57
|
+
message: string;
|
|
58
|
+
authentication: Record<string, string | number | boolean | null | undefined>;
|
|
59
|
+
authenticationType: string | null;
|
|
60
|
+
metadata: GrpcMetadataEntry[];
|
|
61
|
+
}
|
|
62
|
+
export interface GrpcEvent extends BaseModel {
|
|
63
|
+
readonly workspaceId: string;
|
|
64
|
+
readonly requestId: string;
|
|
65
|
+
readonly connectionId: string;
|
|
66
|
+
readonly model: 'grpc_event';
|
|
67
|
+
content: string;
|
|
68
|
+
status: number | null;
|
|
69
|
+
error: string | null;
|
|
70
|
+
eventType: 'info' | 'error' | 'client_message' | 'server_message' | 'connection_start' | 'connection_end';
|
|
71
|
+
metadata: Record<string, string>;
|
|
72
|
+
}
|
|
73
|
+
export interface GrpcConnection extends BaseModel {
|
|
74
|
+
readonly workspaceId: string;
|
|
75
|
+
readonly requestId: string;
|
|
76
|
+
readonly model: 'grpc_connection';
|
|
77
|
+
service: string;
|
|
78
|
+
method: string;
|
|
79
|
+
elapsed: number;
|
|
80
|
+
elapsedConnection: number;
|
|
81
|
+
status: number;
|
|
82
|
+
url: string;
|
|
83
|
+
error: string | null;
|
|
84
|
+
trailers: Record<string, string>;
|
|
85
|
+
}
|
|
86
|
+
export interface HttpRequest extends BaseModel {
|
|
87
|
+
readonly workspaceId: string;
|
|
88
|
+
readonly model: 'http_request';
|
|
89
|
+
folderId: string | null;
|
|
90
|
+
sortPriority: number;
|
|
91
|
+
name: string;
|
|
92
|
+
url: string;
|
|
93
|
+
urlParameters: HttpUrlParameter[];
|
|
94
|
+
body: Record<string, unknown>;
|
|
95
|
+
bodyType: string | null;
|
|
96
|
+
authentication: Record<string, string | number | boolean | null | undefined>;
|
|
97
|
+
authenticationType: string | null;
|
|
98
|
+
method: string;
|
|
99
|
+
headers: HttpHeader[];
|
|
100
|
+
}
|
|
101
|
+
export interface HttpResponse extends BaseModel {
|
|
102
|
+
readonly workspaceId: string;
|
|
103
|
+
readonly model: 'http_response';
|
|
104
|
+
readonly requestId: string;
|
|
105
|
+
readonly bodyPath: string | null;
|
|
106
|
+
readonly contentLength: number | null;
|
|
107
|
+
readonly error: string;
|
|
108
|
+
readonly status: number;
|
|
109
|
+
readonly elapsed: number;
|
|
110
|
+
readonly elapsedHeaders: number;
|
|
111
|
+
readonly statusReason: string;
|
|
112
|
+
readonly version: string;
|
|
113
|
+
readonly remoteAddr: string;
|
|
114
|
+
readonly url: string;
|
|
115
|
+
readonly headers: HttpHeader[];
|
|
116
|
+
}
|
package/lib/models.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yaakapp/api",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"typings": "./lib/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"prepublish": "tsc"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@types/node": "^22.0.0"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"typescript": "^5.5.4"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/index.ts
ADDED
package/src/models.ts
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export interface BaseModel {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly createdAt: string;
|
|
4
|
+
readonly updatedAt: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Workspace extends BaseModel {
|
|
8
|
+
readonly model: 'workspace';
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
variables: EnvironmentVariable[];
|
|
12
|
+
settingValidateCertificates: boolean;
|
|
13
|
+
settingFollowRedirects: boolean;
|
|
14
|
+
settingRequestTimeout: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface EnvironmentVariable {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
enabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Folder extends BaseModel {
|
|
24
|
+
readonly workspaceId: string;
|
|
25
|
+
readonly model: 'folder';
|
|
26
|
+
folderId: string | null;
|
|
27
|
+
sortPriority: number;
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Environment extends BaseModel {
|
|
32
|
+
readonly workspaceId: string;
|
|
33
|
+
readonly model: 'environment';
|
|
34
|
+
name: string;
|
|
35
|
+
variables: EnvironmentVariable[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface HttpHeader {
|
|
39
|
+
name: string;
|
|
40
|
+
value: string;
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface HttpUrlParameter {
|
|
45
|
+
name: string;
|
|
46
|
+
value: string;
|
|
47
|
+
enabled?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface GrpcMetadataEntry {
|
|
51
|
+
name: string;
|
|
52
|
+
value: string;
|
|
53
|
+
enabled?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface GrpcRequest extends BaseModel {
|
|
57
|
+
readonly workspaceId: string;
|
|
58
|
+
readonly model: 'grpc_request';
|
|
59
|
+
folderId: string | null;
|
|
60
|
+
sortPriority: number;
|
|
61
|
+
name: string;
|
|
62
|
+
url: string;
|
|
63
|
+
service: string | null;
|
|
64
|
+
method: string | null;
|
|
65
|
+
message: string;
|
|
66
|
+
authentication: Record<string, string | number | boolean | null | undefined>;
|
|
67
|
+
authenticationType: string | null;
|
|
68
|
+
metadata: GrpcMetadataEntry[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface GrpcEvent extends BaseModel {
|
|
72
|
+
readonly workspaceId: string;
|
|
73
|
+
readonly requestId: string;
|
|
74
|
+
readonly connectionId: string;
|
|
75
|
+
readonly model: 'grpc_event';
|
|
76
|
+
content: string;
|
|
77
|
+
status: number | null;
|
|
78
|
+
error: string | null;
|
|
79
|
+
eventType:
|
|
80
|
+
| 'info'
|
|
81
|
+
| 'error'
|
|
82
|
+
| 'client_message'
|
|
83
|
+
| 'server_message'
|
|
84
|
+
| 'connection_start'
|
|
85
|
+
| 'connection_end';
|
|
86
|
+
metadata: Record<string, string>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface GrpcConnection extends BaseModel {
|
|
90
|
+
readonly workspaceId: string;
|
|
91
|
+
readonly requestId: string;
|
|
92
|
+
readonly model: 'grpc_connection';
|
|
93
|
+
service: string;
|
|
94
|
+
method: string;
|
|
95
|
+
elapsed: number;
|
|
96
|
+
elapsedConnection: number;
|
|
97
|
+
status: number;
|
|
98
|
+
url: string;
|
|
99
|
+
error: string | null;
|
|
100
|
+
trailers: Record<string, string>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface HttpRequest extends BaseModel {
|
|
104
|
+
readonly workspaceId: string;
|
|
105
|
+
readonly model: 'http_request';
|
|
106
|
+
folderId: string | null;
|
|
107
|
+
sortPriority: number;
|
|
108
|
+
name: string;
|
|
109
|
+
url: string;
|
|
110
|
+
urlParameters: HttpUrlParameter[];
|
|
111
|
+
body: Record<string, unknown>;
|
|
112
|
+
bodyType: string | null;
|
|
113
|
+
authentication: Record<string, string | number | boolean | null | undefined>;
|
|
114
|
+
authenticationType: string | null;
|
|
115
|
+
method: string;
|
|
116
|
+
headers: HttpHeader[];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface HttpResponse extends BaseModel {
|
|
120
|
+
readonly workspaceId: string;
|
|
121
|
+
readonly model: 'http_response';
|
|
122
|
+
readonly requestId: string;
|
|
123
|
+
readonly bodyPath: string | null;
|
|
124
|
+
readonly contentLength: number | null;
|
|
125
|
+
readonly error: string;
|
|
126
|
+
readonly status: number;
|
|
127
|
+
readonly elapsed: number;
|
|
128
|
+
readonly elapsedHeaders: number;
|
|
129
|
+
readonly statusReason: string;
|
|
130
|
+
readonly version: string;
|
|
131
|
+
readonly remoteAddr: string;
|
|
132
|
+
readonly url: string;
|
|
133
|
+
readonly headers: HttpHeader[];
|
|
134
|
+
}
|
package/tsconfig.json
ADDED