@powerlines/plugin-prisma 0.4.30 → 0.4.32

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 (56) hide show
  1. package/README.md +1 -1
  2. package/dist/client-generator-AkVOcQPr.mjs +146 -0
  3. package/dist/client-generator-BAc2oiYI.cjs +152 -0
  4. package/dist/client-generator-RH_xLnP1.cjs +152 -0
  5. package/dist/client-generator-cWEc7gzT.mjs +146 -0
  6. package/dist/get-schema-Dq1-Jwvo.cjs +138 -0
  7. package/dist/helpers/client-generator.cjs +4 -0
  8. package/dist/helpers/client-generator.mjs +3 -0
  9. package/dist/helpers/get-schema.cjs +2 -80
  10. package/dist/helpers/get-schema.mjs +24 -4
  11. package/dist/helpers/index.cjs +6 -4
  12. package/dist/helpers/index.mjs +3 -2
  13. package/dist/helpers/schema-creator.cjs +1 -1
  14. package/dist/helpers/typed-sql.cjs +38 -0
  15. package/dist/helpers/typed-sql.mjs +36 -0
  16. package/dist/index.cjs +71 -42
  17. package/dist/index.mjs +68 -38
  18. package/dist/types/index.cjs +2 -0
  19. package/dist/types/index.mjs +3 -0
  20. package/package.json +45 -249
  21. package/dist/_virtual/_rolldown/runtime.cjs +0 -29
  22. package/dist/_virtual/_rolldown/runtime.mjs +0 -3
  23. package/dist/api/client/client.gen.cjs +0 -176
  24. package/dist/api/client/client.gen.mjs +0 -175
  25. package/dist/api/client/index.cjs +0 -15
  26. package/dist/api/client/index.mjs +0 -7
  27. package/dist/api/client/types.gen.cjs +0 -0
  28. package/dist/api/client/types.gen.mjs +0 -1
  29. package/dist/api/client/utils.gen.cjs +0 -187
  30. package/dist/api/client/utils.gen.mjs +0 -179
  31. package/dist/api/client.gen.cjs +0 -10
  32. package/dist/api/client.gen.mjs +0 -9
  33. package/dist/api/core/auth.gen.cjs +0 -13
  34. package/dist/api/core/auth.gen.mjs +0 -11
  35. package/dist/api/core/bodySerializer.gen.cjs +0 -36
  36. package/dist/api/core/bodySerializer.gen.mjs +0 -32
  37. package/dist/api/core/params.gen.cjs +0 -66
  38. package/dist/api/core/params.gen.mjs +0 -64
  39. package/dist/api/core/pathSerializer.gen.cjs +0 -88
  40. package/dist/api/core/pathSerializer.gen.mjs +0 -81
  41. package/dist/api/core/queryKeySerializer.gen.cjs +0 -67
  42. package/dist/api/core/queryKeySerializer.gen.mjs +0 -63
  43. package/dist/api/core/serverSentEvents.gen.cjs +0 -96
  44. package/dist/api/core/serverSentEvents.gen.mjs +0 -94
  45. package/dist/api/core/types.gen.cjs +0 -0
  46. package/dist/api/core/types.gen.mjs +0 -1
  47. package/dist/api/core/utils.gen.cjs +0 -82
  48. package/dist/api/core/utils.gen.mjs +0 -78
  49. package/dist/api/sdk.gen.cjs +0 -405
  50. package/dist/api/sdk.gen.mjs +0 -404
  51. package/dist/api/types.gen.cjs +0 -0
  52. package/dist/api/types.gen.mjs +0 -1
  53. package/dist/generator.cjs +0 -15
  54. package/dist/generator.mjs +0 -15
  55. package/dist/helpers/prisma-postgres.cjs +0 -17
  56. package/dist/helpers/prisma-postgres.mjs +0 -15
@@ -1,405 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_api_client_gen = require('./client.gen.cjs');
3
-
4
- //#region src/api/sdk.gen.ts
5
- var HeyApiClient = class {
6
- client;
7
- constructor(args) {
8
- this.client = args?.client ?? require_api_client_gen.client;
9
- }
10
- };
11
- var HeyApiRegistry = class {
12
- defaultKey = "default";
13
- instances = /* @__PURE__ */ new Map();
14
- get(key) {
15
- const instance = this.instances.get(key ?? this.defaultKey);
16
- if (!instance) throw new Error(`No SDK client found. Create one with "new PrismaClient()" to fix this error.`);
17
- return instance;
18
- }
19
- set(value, key) {
20
- this.instances.set(key ?? this.defaultKey, value);
21
- }
22
- };
23
- var PrismaClient = class PrismaClient extends HeyApiClient {
24
- static __registry = new HeyApiRegistry();
25
- constructor(args) {
26
- super(args);
27
- PrismaClient.__registry.set(this, args?.key);
28
- }
29
- /**
30
- * List connections
31
- *
32
- * Returns all connections the actor has access to, with optional database filter.
33
- */
34
- listConnections(options) {
35
- return (options?.client ?? this.client).get({
36
- url: "/v1/connections",
37
- ...options
38
- });
39
- }
40
- /**
41
- * Create connection
42
- *
43
- * Creates a new connection for the specified database.
44
- */
45
- createConnection(options) {
46
- return (options?.client ?? this.client).post({
47
- url: "/v1/connections",
48
- ...options,
49
- headers: {
50
- "Content-Type": "application/json",
51
- ...options?.headers
52
- }
53
- });
54
- }
55
- /**
56
- * Delete connection
57
- *
58
- * Deletes the connection with the given ID.
59
- */
60
- deleteConnection(options) {
61
- return (options.client ?? this.client).delete({
62
- url: "/v1/connections/{id}",
63
- ...options
64
- });
65
- }
66
- /**
67
- * Get connection
68
- *
69
- * Returns the connection with the given ID.
70
- */
71
- getConnection(options) {
72
- return (options.client ?? this.client).get({
73
- url: "/v1/connections/{id}",
74
- ...options
75
- });
76
- }
77
- /**
78
- * List databases
79
- *
80
- * Returns all databases the token has access to. Optionally filter by project ID.
81
- */
82
- listDatabases(options) {
83
- return (options?.client ?? this.client).get({
84
- url: "/v1/databases",
85
- ...options
86
- });
87
- }
88
- /**
89
- * Create database
90
- *
91
- * Creates a new database in the specified project.
92
- */
93
- createDatabase(options) {
94
- return (options?.client ?? this.client).post({
95
- url: "/v1/databases",
96
- ...options,
97
- headers: {
98
- "Content-Type": "application/json",
99
- ...options?.headers
100
- }
101
- });
102
- }
103
- /**
104
- * Delete database
105
- *
106
- * Deletes the database with the given ID.
107
- */
108
- deleteDatabase(options) {
109
- return (options.client ?? this.client).delete({
110
- url: "/v1/databases/{databaseId}",
111
- ...options
112
- });
113
- }
114
- /**
115
- * Get database
116
- *
117
- * Returns the database with the given ID.
118
- */
119
- getDatabase(options) {
120
- return (options.client ?? this.client).get({
121
- url: "/v1/databases/{databaseId}",
122
- ...options
123
- });
124
- }
125
- /**
126
- * Update database
127
- *
128
- * Updates the database with the given ID.
129
- */
130
- updateDatabase(options) {
131
- return (options.client ?? this.client).patch({
132
- url: "/v1/databases/{databaseId}",
133
- ...options,
134
- headers: {
135
- "Content-Type": "application/json",
136
- ...options.headers
137
- }
138
- });
139
- }
140
- /**
141
- * Get list of database connections
142
- *
143
- * Returns all connections for the given database.
144
- */
145
- listDatabaseConnections(options) {
146
- return (options.client ?? this.client).get({
147
- url: "/v1/databases/{databaseId}/connections",
148
- ...options
149
- });
150
- }
151
- /**
152
- * Create database connection string
153
- *
154
- * Creates a new connection string for the given database.
155
- */
156
- createDatabaseConnectionString(options) {
157
- return (options.client ?? this.client).post({
158
- url: "/v1/databases/{databaseId}/connections",
159
- ...options,
160
- headers: {
161
- "Content-Type": "application/json",
162
- ...options.headers
163
- }
164
- });
165
- }
166
- /**
167
- * Get list of backups
168
- *
169
- * Returns backups for the specified database.
170
- */
171
- listBackups(options) {
172
- return (options.client ?? this.client).get({
173
- url: "/v1/databases/{databaseId}/backups",
174
- ...options
175
- });
176
- }
177
- /**
178
- * Get database usage metrics
179
- *
180
- * Returns usage metrics for the specified database.
181
- */
182
- getDatabaseUsageMetrics(options) {
183
- return (options.client ?? this.client).get({
184
- url: "/v1/databases/{databaseId}/usage",
185
- ...options
186
- });
187
- }
188
- /**
189
- * Get list of projects
190
- *
191
- * Returns the list of projects the token has access to.
192
- */
193
- listProjects(options) {
194
- return (options?.client ?? this.client).get({
195
- url: "/v1/projects",
196
- ...options
197
- });
198
- }
199
- /**
200
- * Create project with a postgres database
201
- *
202
- * Creates a new project with a postgres database.
203
- */
204
- createProjectWithPostgresDatabase(options) {
205
- return (options?.client ?? this.client).post({
206
- url: "/v1/projects",
207
- ...options,
208
- headers: {
209
- "Content-Type": "application/json",
210
- ...options?.headers
211
- }
212
- });
213
- }
214
- /**
215
- * Delete project
216
- *
217
- * Deletes the project with the given ID.
218
- */
219
- deleteProject(options) {
220
- return (options.client ?? this.client).delete({
221
- url: "/v1/projects/{id}",
222
- ...options
223
- });
224
- }
225
- /**
226
- * Get project
227
- *
228
- * Returns the project with the given ID.
229
- */
230
- getProject(options) {
231
- return (options.client ?? this.client).get({
232
- url: "/v1/projects/{id}",
233
- ...options
234
- });
235
- }
236
- /**
237
- * Update project
238
- *
239
- * Updates the project with the given ID.
240
- */
241
- updateProject(options) {
242
- return (options.client ?? this.client).patch({
243
- url: "/v1/projects/{id}",
244
- ...options,
245
- headers: {
246
- "Content-Type": "application/json",
247
- ...options.headers
248
- }
249
- });
250
- }
251
- /**
252
- * Transfer project
253
- *
254
- * Transfer the project with the given ID to the new owner's workspace
255
- */
256
- transferProject(options) {
257
- return (options.client ?? this.client).post({
258
- url: "/v1/projects/{id}/transfer",
259
- ...options,
260
- headers: {
261
- "Content-Type": "application/json",
262
- ...options.headers
263
- }
264
- });
265
- }
266
- /**
267
- * Get list of databases
268
- *
269
- * Returns databases for the given project.
270
- */
271
- listDatabases2(options) {
272
- return (options.client ?? this.client).get({
273
- url: "/v1/projects/{projectId}/databases",
274
- ...options
275
- });
276
- }
277
- /**
278
- * Create database
279
- *
280
- * Creates a new database for the given project.
281
- */
282
- createDatabase2(options) {
283
- return (options.client ?? this.client).post({
284
- url: "/v1/projects/{projectId}/databases",
285
- ...options,
286
- headers: {
287
- "Content-Type": "application/json",
288
- ...options.headers
289
- }
290
- });
291
- }
292
- /**
293
- * Get list of integrations
294
- *
295
- * Returns integrations filtered by workspace ID.
296
- */
297
- listIntegrations(options) {
298
- return (options.client ?? this.client).get({
299
- url: "/v1/integrations",
300
- ...options
301
- });
302
- }
303
- /**
304
- * Delete integration
305
- *
306
- * Revokes the integration tokens by integration ID.
307
- */
308
- deleteIntegration(options) {
309
- return (options.client ?? this.client).delete({
310
- url: "/v1/integrations/{id}",
311
- ...options
312
- });
313
- }
314
- /**
315
- * Get integration by ID
316
- *
317
- * Returns a single integration by its ID.
318
- */
319
- getIntegrationById(options) {
320
- return (options.client ?? this.client).get({
321
- url: "/v1/integrations/{id}",
322
- ...options
323
- });
324
- }
325
- /**
326
- * Get list of integrations
327
- *
328
- * Returns integrations for the given workspace.
329
- */
330
- listIntegrations2(options) {
331
- return (options.client ?? this.client).get({
332
- url: "/v1/workspaces/{workspaceId}/integrations",
333
- ...options
334
- });
335
- }
336
- /**
337
- * Revoke integration tokens
338
- *
339
- * Revokes the integration tokens with the given client ID.
340
- */
341
- revokeIntegrationTokens(options) {
342
- return (options.client ?? this.client).delete({
343
- url: "/v1/workspaces/{workspaceId}/integrations/{clientId}",
344
- ...options
345
- });
346
- }
347
- /**
348
- * Get all regions
349
- *
350
- * Returns all available regions across products. Optionally filter by product.
351
- */
352
- getAllRegions(options) {
353
- return (options?.client ?? this.client).get({
354
- url: "/v1/regions",
355
- ...options
356
- });
357
- }
358
- /**
359
- * Get Prisma Postgres regions
360
- *
361
- * Returns all available regions for Prisma Postgres.
362
- */
363
- getPrismaPostgresRegions(options) {
364
- return (options?.client ?? this.client).get({
365
- url: "/v1/regions/postgres",
366
- ...options
367
- });
368
- }
369
- /**
370
- * Get Prisma Accelerate regions
371
- *
372
- * Returns all available regions for Prisma Accelerate.
373
- */
374
- getPrismaAccelerateRegions(options) {
375
- return (options?.client ?? this.client).get({
376
- url: "/v1/regions/accelerate",
377
- ...options
378
- });
379
- }
380
- /**
381
- * Get list of workspaces
382
- *
383
- * Returns the list of workspaces the current token can access.
384
- */
385
- listWorkspaces(options) {
386
- return (options?.client ?? this.client).get({
387
- url: "/v1/workspaces",
388
- ...options
389
- });
390
- }
391
- /**
392
- * Get workspace
393
- *
394
- * Returns the workspace with the given ID.
395
- */
396
- getWorkspace(options) {
397
- return (options.client ?? this.client).get({
398
- url: "/v1/workspaces/{id}",
399
- ...options
400
- });
401
- }
402
- };
403
-
404
- //#endregion
405
- exports.PrismaClient = PrismaClient;