@powerlines/plugin-prisma 0.2.75 → 0.2.77
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/dist/api/client/client.gen.cjs +8 -175
- package/dist/api/client/client.gen.mjs +7 -174
- package/dist/api/client/index.cjs +18 -13
- package/dist/api/client/index.mjs +10 -5
- package/dist/api/client/utils.gen.cjs +13 -186
- package/dist/api/client/utils.gen.mjs +5 -178
- package/dist/api/client.gen.cjs +12 -8
- package/dist/api/client.gen.mjs +11 -7
- package/dist/api/core/auth.gen.cjs +2 -11
- package/dist/api/core/auth.gen.mjs +1 -9
- package/dist/api/core/bodySerializer.gen.cjs +4 -34
- package/dist/api/core/bodySerializer.gen.mjs +1 -30
- package/dist/api/core/params.gen.cjs +2 -64
- package/dist/api/core/params.gen.mjs +1 -62
- package/dist/api/core/pathSerializer.gen.cjs +7 -86
- package/dist/api/core/pathSerializer.gen.mjs +1 -79
- package/dist/api/core/queryKeySerializer.gen.cjs +4 -65
- package/dist/api/core/queryKeySerializer.gen.mjs +1 -61
- package/dist/api/core/serverSentEvents.gen.cjs +2 -94
- package/dist/api/core/serverSentEvents.gen.mjs +1 -92
- package/dist/api/core/utils.gen.cjs +6 -80
- package/dist/api/core/utils.gen.mjs +2 -76
- package/dist/api/sdk.gen.cjs +13 -255
- package/dist/api/sdk.gen.mjs +12 -254
- package/dist/api/types.gen.cjs +1 -0
- package/dist/api/types.gen.mjs +2 -0
- package/dist/auth.gen-BFteuMTV.cjs +17 -0
- package/dist/auth.gen-C4FxE4_3.mjs +11 -0
- package/dist/bodySerializer.gen-BLtxkFoA.cjs +50 -0
- package/dist/bodySerializer.gen-DBXNewIA.mjs +32 -0
- package/dist/client-BlRUW8mL.mjs +1 -0
- package/dist/client-DBAc9HV1.cjs +0 -0
- package/dist/client.gen-COMS1glH.mjs +8 -0
- package/dist/client.gen-CPQm4WCv.mjs +176 -0
- package/dist/client.gen-DPSMNZNm.cjs +181 -0
- package/dist/client.gen-JhYC1fDf.cjs +13 -0
- package/dist/get-schema-CKw6MiKb.mjs +78 -0
- package/dist/get-schema-CqMBOHOd.cjs +118 -0
- package/dist/helpers/get-schema.cjs +2 -80
- package/dist/helpers/get-schema.mjs +1 -76
- package/dist/helpers/index.cjs +6 -6
- package/dist/helpers/index.mjs +3 -3
- package/dist/helpers/prisma-postgres.cjs +2 -15
- package/dist/helpers/prisma-postgres.mjs +1 -13
- package/dist/helpers/schema-creator.cjs +2 -60
- package/dist/helpers/schema-creator.mjs +1 -58
- package/dist/index.cjs +107 -20
- package/dist/index.mjs +96 -8
- package/dist/params.gen-BM1l95BD.mjs +64 -0
- package/dist/params.gen-BtCSnwiV.cjs +70 -0
- package/dist/pathSerializer.gen-BEbuI0Vn.cjs +117 -0
- package/dist/pathSerializer.gen-m7BRzH23.mjs +81 -0
- package/dist/plugin-DE9fKOLA.cjs +0 -0
- package/dist/plugin-EFmNQLKA.mjs +1 -0
- package/dist/prisma-BzQJneyW.cjs +0 -0
- package/dist/prisma-CB-m5c-j.mjs +1 -0
- package/dist/prisma-postgres-CAOpTtWq.mjs +15 -0
- package/dist/prisma-postgres-dGaLzxF3.cjs +21 -0
- package/dist/queryKeySerializer.gen-4TWHHXn3.cjs +81 -0
- package/dist/queryKeySerializer.gen-BMMZAjVN.mjs +63 -0
- package/dist/schema-creator-Cfian3ih.mjs +60 -0
- package/dist/schema-creator-zmlwh4-l.cjs +66 -0
- package/dist/sdk.gen-B2his2jD.mjs +256 -0
- package/dist/sdk.gen-CAWIQ8BM.cjs +261 -0
- package/dist/serverSentEvents.gen-C4apQvDl.mjs +94 -0
- package/dist/serverSentEvents.gen-CiMMmhyQ.cjs +100 -0
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.mjs +4 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.mjs +2 -0
- package/dist/types/prisma.cjs +1 -0
- package/dist/types/prisma.mjs +2 -0
- package/dist/types-CmY9-4ff.cjs +0 -0
- package/dist/types-Dbwx-Khg.mjs +1 -0
- package/dist/types.gen-BN-p9nVT.cjs +0 -0
- package/dist/types.gen-CS2KiRfG.mjs +1 -0
- package/dist/utils.gen-Bk2pTkV1.cjs +101 -0
- package/dist/utils.gen-C-7sZa7Z.mjs +180 -0
- package/dist/utils.gen-DATakax-.cjs +227 -0
- package/dist/utils.gen-RO8GxC4i.mjs +78 -0
- package/package.json +6 -6
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/powerlines/src/plugin-utils/get-config-path.cjs +0 -49
- package/dist/powerlines/src/plugin-utils/get-config-path.mjs +0 -48
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -36
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -35
package/dist/api/sdk.gen.cjs
CHANGED
|
@@ -1,256 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
require('../serverSentEvents.gen-CiMMmhyQ.cjs');
|
|
2
|
+
require('../pathSerializer.gen-BEbuI0Vn.cjs');
|
|
3
|
+
require('../utils.gen-Bk2pTkV1.cjs');
|
|
4
|
+
require('../auth.gen-BFteuMTV.cjs');
|
|
5
|
+
require('../bodySerializer.gen-BLtxkFoA.cjs');
|
|
6
|
+
require('../utils.gen-DATakax-.cjs');
|
|
7
|
+
require('../client.gen-DPSMNZNm.cjs');
|
|
8
|
+
require('../params.gen-BtCSnwiV.cjs');
|
|
9
|
+
require('../queryKeySerializer.gen-4TWHHXn3.cjs');
|
|
10
|
+
require('../client-DBAc9HV1.cjs');
|
|
11
|
+
require('../client.gen-JhYC1fDf.cjs');
|
|
12
|
+
const require_sdk_gen = require('../sdk.gen-CAWIQ8BM.cjs');
|
|
2
13
|
|
|
3
|
-
|
|
4
|
-
var HeyApiClient = class {
|
|
5
|
-
client;
|
|
6
|
-
constructor(args) {
|
|
7
|
-
this.client = args?.client ?? require_api_client_gen.client;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
var HeyApiRegistry = class {
|
|
11
|
-
defaultKey = "default";
|
|
12
|
-
instances = /* @__PURE__ */ new Map();
|
|
13
|
-
get(key) {
|
|
14
|
-
const instance = this.instances.get(key ?? this.defaultKey);
|
|
15
|
-
if (!instance) throw new Error(`No SDK client found. Create one with "new PrismaClient()" to fix this error.`);
|
|
16
|
-
return instance;
|
|
17
|
-
}
|
|
18
|
-
set(value, key) {
|
|
19
|
-
this.instances.set(key ?? this.defaultKey, value);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
var PrismaClient = class PrismaClient extends HeyApiClient {
|
|
23
|
-
static __registry = new HeyApiRegistry();
|
|
24
|
-
constructor(args) {
|
|
25
|
-
super(args);
|
|
26
|
-
PrismaClient.__registry.set(this, args?.key);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Delete database connection string
|
|
30
|
-
*
|
|
31
|
-
* Deletes the database connection string with the given ID.
|
|
32
|
-
*/
|
|
33
|
-
deleteDatabaseConnectionString(options) {
|
|
34
|
-
return (options.client ?? this.client).delete({
|
|
35
|
-
url: "/v1/connections/{id}",
|
|
36
|
-
...options
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Delete database
|
|
41
|
-
*
|
|
42
|
-
* Deletes the database with the given ID.
|
|
43
|
-
*/
|
|
44
|
-
deleteDatabase(options) {
|
|
45
|
-
return (options.client ?? this.client).delete({
|
|
46
|
-
url: "/v1/databases/{databaseId}",
|
|
47
|
-
...options
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get database
|
|
52
|
-
*
|
|
53
|
-
* Returns the database with the given ID.
|
|
54
|
-
*/
|
|
55
|
-
getDatabase(options) {
|
|
56
|
-
return (options.client ?? this.client).get({
|
|
57
|
-
url: "/v1/databases/{databaseId}",
|
|
58
|
-
...options
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get list of database connections
|
|
63
|
-
*
|
|
64
|
-
* Returns all connections for the given database.
|
|
65
|
-
*/
|
|
66
|
-
listDatabaseConnections(options) {
|
|
67
|
-
return (options.client ?? this.client).get({
|
|
68
|
-
url: "/v1/databases/{databaseId}/connections",
|
|
69
|
-
...options
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Create database connection string
|
|
74
|
-
*
|
|
75
|
-
* Creates a new connection string for the given database.
|
|
76
|
-
*/
|
|
77
|
-
createDatabaseConnectionString(options) {
|
|
78
|
-
return (options.client ?? this.client).post({
|
|
79
|
-
url: "/v1/databases/{databaseId}/connections",
|
|
80
|
-
...options,
|
|
81
|
-
headers: {
|
|
82
|
-
"Content-Type": "application/json",
|
|
83
|
-
...options.headers
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get list of backups
|
|
89
|
-
*
|
|
90
|
-
* Returns backups for the specified database.
|
|
91
|
-
*/
|
|
92
|
-
listBackups(options) {
|
|
93
|
-
return (options.client ?? this.client).get({
|
|
94
|
-
url: "/v1/databases/{databaseId}/backups",
|
|
95
|
-
...options
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Get database usage metrics
|
|
100
|
-
*
|
|
101
|
-
* Returns usage metrics for the specified database.
|
|
102
|
-
*/
|
|
103
|
-
getDatabaseUsageMetrics(options) {
|
|
104
|
-
return (options.client ?? this.client).get({
|
|
105
|
-
url: "/v1/databases/{databaseId}/usage",
|
|
106
|
-
...options
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Get list of projects
|
|
111
|
-
*
|
|
112
|
-
* Returns the list of projects the token has access to.
|
|
113
|
-
*/
|
|
114
|
-
listProjects(options) {
|
|
115
|
-
return (options?.client ?? this.client).get({
|
|
116
|
-
url: "/v1/projects",
|
|
117
|
-
...options
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Create project with a postgres database
|
|
122
|
-
*
|
|
123
|
-
* Creates a new project with a postgres database.
|
|
124
|
-
*/
|
|
125
|
-
createProjectWithPostgresDatabase(options) {
|
|
126
|
-
return (options?.client ?? this.client).post({
|
|
127
|
-
url: "/v1/projects",
|
|
128
|
-
...options,
|
|
129
|
-
headers: {
|
|
130
|
-
"Content-Type": "application/json",
|
|
131
|
-
...options?.headers
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Delete project
|
|
137
|
-
*
|
|
138
|
-
* Deletes the project with the given ID.
|
|
139
|
-
*/
|
|
140
|
-
deleteProject(options) {
|
|
141
|
-
return (options.client ?? this.client).delete({
|
|
142
|
-
url: "/v1/projects/{id}",
|
|
143
|
-
...options
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Get project
|
|
148
|
-
*
|
|
149
|
-
* Returns the project with the given ID.
|
|
150
|
-
*/
|
|
151
|
-
getProject(options) {
|
|
152
|
-
return (options.client ?? this.client).get({
|
|
153
|
-
url: "/v1/projects/{id}",
|
|
154
|
-
...options
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Transfer project
|
|
159
|
-
*
|
|
160
|
-
* Transfer the project with the given ID to the new owner's workspace
|
|
161
|
-
*/
|
|
162
|
-
transferProject(options) {
|
|
163
|
-
return (options.client ?? this.client).post({
|
|
164
|
-
url: "/v1/projects/{id}/transfer",
|
|
165
|
-
...options,
|
|
166
|
-
headers: {
|
|
167
|
-
"Content-Type": "application/json",
|
|
168
|
-
...options.headers
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Get list of databases
|
|
174
|
-
*
|
|
175
|
-
* Returns databases for the given project.
|
|
176
|
-
*/
|
|
177
|
-
listDatabases(options) {
|
|
178
|
-
return (options.client ?? this.client).get({
|
|
179
|
-
url: "/v1/projects/{projectId}/databases",
|
|
180
|
-
...options
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Create database
|
|
185
|
-
*
|
|
186
|
-
* Creates a new database for the given project.
|
|
187
|
-
*/
|
|
188
|
-
createDatabase(options) {
|
|
189
|
-
return (options.client ?? this.client).post({
|
|
190
|
-
url: "/v1/projects/{projectId}/databases",
|
|
191
|
-
...options,
|
|
192
|
-
headers: {
|
|
193
|
-
"Content-Type": "application/json",
|
|
194
|
-
...options.headers
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Get list of integrations
|
|
200
|
-
*
|
|
201
|
-
* Returns integrations for the given workspace.
|
|
202
|
-
*/
|
|
203
|
-
listIntegrations(options) {
|
|
204
|
-
return (options.client ?? this.client).get({
|
|
205
|
-
url: "/v1/workspaces/{workspaceId}/integrations",
|
|
206
|
-
...options
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Revoke integration tokens
|
|
211
|
-
*
|
|
212
|
-
* Revokes the integration tokens with the given client ID.
|
|
213
|
-
*/
|
|
214
|
-
revokeIntegrationTokens(options) {
|
|
215
|
-
return (options.client ?? this.client).delete({
|
|
216
|
-
url: "/v1/workspaces/{workspaceId}/integrations/{clientId}",
|
|
217
|
-
...options
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Get Prisma Postgres regions
|
|
222
|
-
*
|
|
223
|
-
* Returns all available regions for Prisma Postgres.
|
|
224
|
-
*/
|
|
225
|
-
getPrismaPostgresRegions(options) {
|
|
226
|
-
return (options?.client ?? this.client).get({
|
|
227
|
-
url: "/v1/regions/postgres",
|
|
228
|
-
...options
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Get Prisma Accelerate regions
|
|
233
|
-
*
|
|
234
|
-
* Returns all available regions for Prisma Accelerate.
|
|
235
|
-
*/
|
|
236
|
-
getPrismaAccelerateRegions(options) {
|
|
237
|
-
return (options?.client ?? this.client).get({
|
|
238
|
-
url: "/v1/regions/accelerate",
|
|
239
|
-
...options
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Get list of workspaces
|
|
244
|
-
*
|
|
245
|
-
* Returns the list of workspaces the current token can access.
|
|
246
|
-
*/
|
|
247
|
-
listWorkspaces(options) {
|
|
248
|
-
return (options?.client ?? this.client).get({
|
|
249
|
-
url: "/v1/workspaces",
|
|
250
|
-
...options
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
//#endregion
|
|
256
|
-
exports.PrismaClient = PrismaClient;
|
|
14
|
+
exports.PrismaClient = require_sdk_gen.PrismaClient;
|
package/dist/api/sdk.gen.mjs
CHANGED
|
@@ -1,256 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../serverSentEvents.gen-C4apQvDl.mjs";
|
|
2
|
+
import "../pathSerializer.gen-m7BRzH23.mjs";
|
|
3
|
+
import "../utils.gen-RO8GxC4i.mjs";
|
|
4
|
+
import "../auth.gen-C4FxE4_3.mjs";
|
|
5
|
+
import "../bodySerializer.gen-DBXNewIA.mjs";
|
|
6
|
+
import "../utils.gen-C-7sZa7Z.mjs";
|
|
7
|
+
import "../client.gen-CPQm4WCv.mjs";
|
|
8
|
+
import "../params.gen-BM1l95BD.mjs";
|
|
9
|
+
import "../queryKeySerializer.gen-BMMZAjVN.mjs";
|
|
10
|
+
import "../client-BlRUW8mL.mjs";
|
|
11
|
+
import "../client.gen-COMS1glH.mjs";
|
|
12
|
+
import { t as PrismaClient } from "../sdk.gen-B2his2jD.mjs";
|
|
2
13
|
|
|
3
|
-
//#region src/api/sdk.gen.ts
|
|
4
|
-
var HeyApiClient = class {
|
|
5
|
-
client;
|
|
6
|
-
constructor(args) {
|
|
7
|
-
this.client = args?.client ?? client;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
var HeyApiRegistry = class {
|
|
11
|
-
defaultKey = "default";
|
|
12
|
-
instances = /* @__PURE__ */ new Map();
|
|
13
|
-
get(key) {
|
|
14
|
-
const instance = this.instances.get(key ?? this.defaultKey);
|
|
15
|
-
if (!instance) throw new Error(`No SDK client found. Create one with "new PrismaClient()" to fix this error.`);
|
|
16
|
-
return instance;
|
|
17
|
-
}
|
|
18
|
-
set(value, key) {
|
|
19
|
-
this.instances.set(key ?? this.defaultKey, value);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
var PrismaClient = class PrismaClient extends HeyApiClient {
|
|
23
|
-
static __registry = new HeyApiRegistry();
|
|
24
|
-
constructor(args) {
|
|
25
|
-
super(args);
|
|
26
|
-
PrismaClient.__registry.set(this, args?.key);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Delete database connection string
|
|
30
|
-
*
|
|
31
|
-
* Deletes the database connection string with the given ID.
|
|
32
|
-
*/
|
|
33
|
-
deleteDatabaseConnectionString(options) {
|
|
34
|
-
return (options.client ?? this.client).delete({
|
|
35
|
-
url: "/v1/connections/{id}",
|
|
36
|
-
...options
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Delete database
|
|
41
|
-
*
|
|
42
|
-
* Deletes the database with the given ID.
|
|
43
|
-
*/
|
|
44
|
-
deleteDatabase(options) {
|
|
45
|
-
return (options.client ?? this.client).delete({
|
|
46
|
-
url: "/v1/databases/{databaseId}",
|
|
47
|
-
...options
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get database
|
|
52
|
-
*
|
|
53
|
-
* Returns the database with the given ID.
|
|
54
|
-
*/
|
|
55
|
-
getDatabase(options) {
|
|
56
|
-
return (options.client ?? this.client).get({
|
|
57
|
-
url: "/v1/databases/{databaseId}",
|
|
58
|
-
...options
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get list of database connections
|
|
63
|
-
*
|
|
64
|
-
* Returns all connections for the given database.
|
|
65
|
-
*/
|
|
66
|
-
listDatabaseConnections(options) {
|
|
67
|
-
return (options.client ?? this.client).get({
|
|
68
|
-
url: "/v1/databases/{databaseId}/connections",
|
|
69
|
-
...options
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Create database connection string
|
|
74
|
-
*
|
|
75
|
-
* Creates a new connection string for the given database.
|
|
76
|
-
*/
|
|
77
|
-
createDatabaseConnectionString(options) {
|
|
78
|
-
return (options.client ?? this.client).post({
|
|
79
|
-
url: "/v1/databases/{databaseId}/connections",
|
|
80
|
-
...options,
|
|
81
|
-
headers: {
|
|
82
|
-
"Content-Type": "application/json",
|
|
83
|
-
...options.headers
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get list of backups
|
|
89
|
-
*
|
|
90
|
-
* Returns backups for the specified database.
|
|
91
|
-
*/
|
|
92
|
-
listBackups(options) {
|
|
93
|
-
return (options.client ?? this.client).get({
|
|
94
|
-
url: "/v1/databases/{databaseId}/backups",
|
|
95
|
-
...options
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Get database usage metrics
|
|
100
|
-
*
|
|
101
|
-
* Returns usage metrics for the specified database.
|
|
102
|
-
*/
|
|
103
|
-
getDatabaseUsageMetrics(options) {
|
|
104
|
-
return (options.client ?? this.client).get({
|
|
105
|
-
url: "/v1/databases/{databaseId}/usage",
|
|
106
|
-
...options
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Get list of projects
|
|
111
|
-
*
|
|
112
|
-
* Returns the list of projects the token has access to.
|
|
113
|
-
*/
|
|
114
|
-
listProjects(options) {
|
|
115
|
-
return (options?.client ?? this.client).get({
|
|
116
|
-
url: "/v1/projects",
|
|
117
|
-
...options
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Create project with a postgres database
|
|
122
|
-
*
|
|
123
|
-
* Creates a new project with a postgres database.
|
|
124
|
-
*/
|
|
125
|
-
createProjectWithPostgresDatabase(options) {
|
|
126
|
-
return (options?.client ?? this.client).post({
|
|
127
|
-
url: "/v1/projects",
|
|
128
|
-
...options,
|
|
129
|
-
headers: {
|
|
130
|
-
"Content-Type": "application/json",
|
|
131
|
-
...options?.headers
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Delete project
|
|
137
|
-
*
|
|
138
|
-
* Deletes the project with the given ID.
|
|
139
|
-
*/
|
|
140
|
-
deleteProject(options) {
|
|
141
|
-
return (options.client ?? this.client).delete({
|
|
142
|
-
url: "/v1/projects/{id}",
|
|
143
|
-
...options
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Get project
|
|
148
|
-
*
|
|
149
|
-
* Returns the project with the given ID.
|
|
150
|
-
*/
|
|
151
|
-
getProject(options) {
|
|
152
|
-
return (options.client ?? this.client).get({
|
|
153
|
-
url: "/v1/projects/{id}",
|
|
154
|
-
...options
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Transfer project
|
|
159
|
-
*
|
|
160
|
-
* Transfer the project with the given ID to the new owner's workspace
|
|
161
|
-
*/
|
|
162
|
-
transferProject(options) {
|
|
163
|
-
return (options.client ?? this.client).post({
|
|
164
|
-
url: "/v1/projects/{id}/transfer",
|
|
165
|
-
...options,
|
|
166
|
-
headers: {
|
|
167
|
-
"Content-Type": "application/json",
|
|
168
|
-
...options.headers
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Get list of databases
|
|
174
|
-
*
|
|
175
|
-
* Returns databases for the given project.
|
|
176
|
-
*/
|
|
177
|
-
listDatabases(options) {
|
|
178
|
-
return (options.client ?? this.client).get({
|
|
179
|
-
url: "/v1/projects/{projectId}/databases",
|
|
180
|
-
...options
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Create database
|
|
185
|
-
*
|
|
186
|
-
* Creates a new database for the given project.
|
|
187
|
-
*/
|
|
188
|
-
createDatabase(options) {
|
|
189
|
-
return (options.client ?? this.client).post({
|
|
190
|
-
url: "/v1/projects/{projectId}/databases",
|
|
191
|
-
...options,
|
|
192
|
-
headers: {
|
|
193
|
-
"Content-Type": "application/json",
|
|
194
|
-
...options.headers
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Get list of integrations
|
|
200
|
-
*
|
|
201
|
-
* Returns integrations for the given workspace.
|
|
202
|
-
*/
|
|
203
|
-
listIntegrations(options) {
|
|
204
|
-
return (options.client ?? this.client).get({
|
|
205
|
-
url: "/v1/workspaces/{workspaceId}/integrations",
|
|
206
|
-
...options
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Revoke integration tokens
|
|
211
|
-
*
|
|
212
|
-
* Revokes the integration tokens with the given client ID.
|
|
213
|
-
*/
|
|
214
|
-
revokeIntegrationTokens(options) {
|
|
215
|
-
return (options.client ?? this.client).delete({
|
|
216
|
-
url: "/v1/workspaces/{workspaceId}/integrations/{clientId}",
|
|
217
|
-
...options
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Get Prisma Postgres regions
|
|
222
|
-
*
|
|
223
|
-
* Returns all available regions for Prisma Postgres.
|
|
224
|
-
*/
|
|
225
|
-
getPrismaPostgresRegions(options) {
|
|
226
|
-
return (options?.client ?? this.client).get({
|
|
227
|
-
url: "/v1/regions/postgres",
|
|
228
|
-
...options
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Get Prisma Accelerate regions
|
|
233
|
-
*
|
|
234
|
-
* Returns all available regions for Prisma Accelerate.
|
|
235
|
-
*/
|
|
236
|
-
getPrismaAccelerateRegions(options) {
|
|
237
|
-
return (options?.client ?? this.client).get({
|
|
238
|
-
url: "/v1/regions/accelerate",
|
|
239
|
-
...options
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Get list of workspaces
|
|
244
|
-
*
|
|
245
|
-
* Returns the list of workspaces the current token can access.
|
|
246
|
-
*/
|
|
247
|
-
listWorkspaces(options) {
|
|
248
|
-
return (options?.client ?? this.client).get({
|
|
249
|
-
url: "/v1/workspaces",
|
|
250
|
-
...options
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
//#endregion
|
|
256
14
|
export { PrismaClient };
|
package/dist/api/types.gen.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../types.gen-BN-p9nVT.cjs');
|
package/dist/api/types.gen.mjs
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/api/core/auth.gen.ts
|
|
3
|
+
const getAuthToken = async (auth, callback) => {
|
|
4
|
+
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
5
|
+
if (!token) return;
|
|
6
|
+
if (auth.scheme === "bearer") return `Bearer ${token}`;
|
|
7
|
+
if (auth.scheme === "basic") return `Basic ${btoa(token)}`;
|
|
8
|
+
return token;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
Object.defineProperty(exports, 'getAuthToken', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return getAuthToken;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/api/core/auth.gen.ts
|
|
2
|
+
const getAuthToken = async (auth, callback) => {
|
|
3
|
+
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
4
|
+
if (!token) return;
|
|
5
|
+
if (auth.scheme === "bearer") return `Bearer ${token}`;
|
|
6
|
+
if (auth.scheme === "basic") return `Basic ${btoa(token)}`;
|
|
7
|
+
return token;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { getAuthToken as t };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/api/core/bodySerializer.gen.ts
|
|
3
|
+
const serializeFormDataPair = (data, key, value) => {
|
|
4
|
+
if (typeof value === "string" || value instanceof Blob) data.append(key, value);
|
|
5
|
+
else if (value instanceof Date) data.append(key, value.toISOString());
|
|
6
|
+
else data.append(key, JSON.stringify(value));
|
|
7
|
+
};
|
|
8
|
+
const serializeUrlSearchParamsPair = (data, key, value) => {
|
|
9
|
+
if (typeof value === "string") data.append(key, value);
|
|
10
|
+
else data.append(key, JSON.stringify(value));
|
|
11
|
+
};
|
|
12
|
+
const formDataBodySerializer = { bodySerializer: (body) => {
|
|
13
|
+
const data = new FormData();
|
|
14
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
15
|
+
if (value === void 0 || value === null) return;
|
|
16
|
+
if (Array.isArray(value)) value.forEach((v) => serializeFormDataPair(data, key, v));
|
|
17
|
+
else serializeFormDataPair(data, key, value);
|
|
18
|
+
});
|
|
19
|
+
return data;
|
|
20
|
+
} };
|
|
21
|
+
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
22
|
+
const urlSearchParamsBodySerializer = { bodySerializer: (body) => {
|
|
23
|
+
const data = new URLSearchParams();
|
|
24
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
25
|
+
if (value === void 0 || value === null) return;
|
|
26
|
+
if (Array.isArray(value)) value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));
|
|
27
|
+
else serializeUrlSearchParamsPair(data, key, value);
|
|
28
|
+
});
|
|
29
|
+
return data.toString();
|
|
30
|
+
} };
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
Object.defineProperty(exports, 'formDataBodySerializer', {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return formDataBodySerializer;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, 'jsonBodySerializer', {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return jsonBodySerializer;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, 'urlSearchParamsBodySerializer', {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () {
|
|
48
|
+
return urlSearchParamsBodySerializer;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/api/core/bodySerializer.gen.ts
|
|
2
|
+
const serializeFormDataPair = (data, key, value) => {
|
|
3
|
+
if (typeof value === "string" || value instanceof Blob) data.append(key, value);
|
|
4
|
+
else if (value instanceof Date) data.append(key, value.toISOString());
|
|
5
|
+
else data.append(key, JSON.stringify(value));
|
|
6
|
+
};
|
|
7
|
+
const serializeUrlSearchParamsPair = (data, key, value) => {
|
|
8
|
+
if (typeof value === "string") data.append(key, value);
|
|
9
|
+
else data.append(key, JSON.stringify(value));
|
|
10
|
+
};
|
|
11
|
+
const formDataBodySerializer = { bodySerializer: (body) => {
|
|
12
|
+
const data = new FormData();
|
|
13
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
14
|
+
if (value === void 0 || value === null) return;
|
|
15
|
+
if (Array.isArray(value)) value.forEach((v) => serializeFormDataPair(data, key, v));
|
|
16
|
+
else serializeFormDataPair(data, key, value);
|
|
17
|
+
});
|
|
18
|
+
return data;
|
|
19
|
+
} };
|
|
20
|
+
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
21
|
+
const urlSearchParamsBodySerializer = { bodySerializer: (body) => {
|
|
22
|
+
const data = new URLSearchParams();
|
|
23
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
24
|
+
if (value === void 0 || value === null) return;
|
|
25
|
+
if (Array.isArray(value)) value.forEach((v) => serializeUrlSearchParamsPair(data, key, v));
|
|
26
|
+
else serializeUrlSearchParamsPair(data, key, value);
|
|
27
|
+
});
|
|
28
|
+
return data.toString();
|
|
29
|
+
} };
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { jsonBodySerializer as n, urlSearchParamsBodySerializer as r, formDataBodySerializer as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { n as createConfig } from "./utils.gen-C-7sZa7Z.mjs";
|
|
2
|
+
import { t as createClient } from "./client.gen-CPQm4WCv.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/api/client.gen.ts
|
|
5
|
+
const client = createClient(createConfig({ throwOnError: true }));
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { client as t };
|