@pgpmjs/migrate-client 0.20.2 → 0.21.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.
@@ -39,15 +39,15 @@ export declare function createClient(config: OrmClientConfig): {
39
39
  } & import("./select-types").StrictSelect<S, import("./input-types").ExecuteSqlPayloadSelect>) => import("./query-builder").QueryBuilder<{
40
40
  executeSql: import("./select-types").InferSelectResult<import("./input-types").ExecuteSqlPayload, S> | null;
41
41
  }>;
42
- runMigration: <S extends import("./input-types").RunMigrationPayloadSelect>(args: import("./mutation").RunMigrationVariables, options: {
43
- select: S;
44
- } & import("./select-types").StrictSelect<S, import("./input-types").RunMigrationPayloadSelect>) => import("./query-builder").QueryBuilder<{
45
- runMigration: import("./select-types").InferSelectResult<import("./input-types").RunMigrationPayload, S> | null;
46
- }>;
47
42
  provisionBucket: <S extends import("./input-types").ProvisionBucketPayloadSelect>(args: import("./mutation").ProvisionBucketVariables, options: {
48
43
  select: S;
49
44
  } & import("./select-types").StrictSelect<S, import("./input-types").ProvisionBucketPayloadSelect>) => import("./query-builder").QueryBuilder<{
50
45
  provisionBucket: import("./select-types").InferSelectResult<import("./input-types").ProvisionBucketPayload, S> | null;
51
46
  }>;
47
+ runMigration: <S extends import("./input-types").RunMigrationPayloadSelect>(args: import("./mutation").RunMigrationVariables, options: {
48
+ select: S;
49
+ } & import("./select-types").StrictSelect<S, import("./input-types").RunMigrationPayloadSelect>) => import("./query-builder").QueryBuilder<{
50
+ runMigration: import("./select-types").InferSelectResult<import("./input-types").RunMigrationPayload, S> | null;
51
+ }>;
52
52
  };
53
53
  };
@@ -231,25 +231,25 @@ export interface UUIDListFilter {
231
231
  }
232
232
  export type ConstructiveInternalTypeUpload = unknown;
233
233
  export interface MigrateFile {
234
- id: string;
235
234
  databaseId?: string | null;
235
+ id: string;
236
236
  upload?: ConstructiveInternalTypeUpload | null;
237
237
  }
238
238
  export interface SqlAction {
239
- id: number;
240
- name?: string | null;
239
+ action?: string | null;
240
+ actionId?: string | null;
241
+ actorId?: string | null;
242
+ category?: string | null;
243
+ content?: string | null;
244
+ createdAt?: string | null;
241
245
  databaseId?: string | null;
242
246
  deploy?: string | null;
243
247
  deps?: string[] | null;
248
+ id: number;
249
+ name?: string | null;
244
250
  payload?: Record<string, unknown> | null;
245
- content?: string | null;
246
251
  revert?: string | null;
247
252
  verify?: string | null;
248
- createdAt?: string | null;
249
- category?: string | null;
250
- action?: string | null;
251
- actionId?: string | null;
252
- actorId?: string | null;
253
253
  }
254
254
  export interface ConnectionResult<T> {
255
255
  nodes: T[];
@@ -269,61 +269,41 @@ export interface SqlActionRelations {
269
269
  export type MigrateFileWithRelations = MigrateFile & MigrateFileRelations;
270
270
  export type SqlActionWithRelations = SqlAction & SqlActionRelations;
271
271
  export type MigrateFileSelect = {
272
- id?: boolean;
273
272
  databaseId?: boolean;
273
+ id?: boolean;
274
274
  upload?: boolean;
275
275
  };
276
276
  export type SqlActionSelect = {
277
- id?: boolean;
278
- name?: boolean;
277
+ action?: boolean;
278
+ actionId?: boolean;
279
+ actorId?: boolean;
280
+ category?: boolean;
281
+ content?: boolean;
282
+ createdAt?: boolean;
279
283
  databaseId?: boolean;
280
284
  deploy?: boolean;
281
285
  deps?: boolean;
286
+ id?: boolean;
287
+ name?: boolean;
282
288
  payload?: boolean;
283
- content?: boolean;
284
289
  revert?: boolean;
285
290
  verify?: boolean;
286
- createdAt?: boolean;
287
- category?: boolean;
288
- action?: boolean;
289
- actionId?: boolean;
290
- actorId?: boolean;
291
291
  };
292
292
  export interface MigrateFileFilter {
293
- /** Filter by the object’s `id` field. */
294
- id?: UUIDFilter;
295
- /** Filter by the object’s `databaseId` field. */
296
- databaseId?: UUIDFilter;
297
- /** Filter by the object’s `upload` field. */
298
- upload?: ConstructiveInternalTypeUploadFilter;
299
293
  /** Checks for all expressions in this list. */
300
294
  and?: MigrateFileFilter[];
301
- /** Checks for any expressions in this list. */
302
- or?: MigrateFileFilter[];
295
+ /** Filter by the object’s `databaseId` field. */
296
+ databaseId?: UUIDFilter;
297
+ /** Filter by the object’s `id` field. */
298
+ id?: UUIDFilter;
303
299
  /** Negates the expression. */
304
300
  not?: MigrateFileFilter;
301
+ /** Checks for any expressions in this list. */
302
+ or?: MigrateFileFilter[];
303
+ /** Filter by the object’s `upload` field. */
304
+ upload?: ConstructiveInternalTypeUploadFilter;
305
305
  }
306
306
  export interface SqlActionFilter {
307
- /** Filter by the object’s `id` field. */
308
- id?: IntFilter;
309
- /** Filter by the object’s `name` field. */
310
- name?: StringFilter;
311
- /** Filter by the object’s `databaseId` field. */
312
- databaseId?: UUIDFilter;
313
- /** Filter by the object’s `deploy` field. */
314
- deploy?: StringFilter;
315
- /** Filter by the object’s `deps` field. */
316
- deps?: StringListFilter;
317
- /** Filter by the object’s `content` field. */
318
- content?: StringFilter;
319
- /** Filter by the object’s `revert` field. */
320
- revert?: StringFilter;
321
- /** Filter by the object’s `verify` field. */
322
- verify?: StringFilter;
323
- /** Filter by the object’s `createdAt` field. */
324
- createdAt?: DatetimeFilter;
325
- /** Filter by the object’s `category` field. */
326
- category?: StringFilter;
327
307
  /** Filter by the object’s `action` field. */
328
308
  action?: StringFilter;
329
309
  /** Filter by the object’s `actionId` field. */
@@ -332,13 +312,33 @@ export interface SqlActionFilter {
332
312
  actorId?: UUIDFilter;
333
313
  /** Checks for all expressions in this list. */
334
314
  and?: SqlActionFilter[];
335
- /** Checks for any expressions in this list. */
336
- or?: SqlActionFilter[];
315
+ /** Filter by the object’s `category` field. */
316
+ category?: StringFilter;
317
+ /** Filter by the object’s `content` field. */
318
+ content?: StringFilter;
319
+ /** Filter by the object’s `createdAt` field. */
320
+ createdAt?: DatetimeFilter;
321
+ /** Filter by the object’s `databaseId` field. */
322
+ databaseId?: UUIDFilter;
323
+ /** Filter by the object’s `deploy` field. */
324
+ deploy?: StringFilter;
325
+ /** Filter by the object’s `deps` field. */
326
+ deps?: StringListFilter;
327
+ /** Filter by the object’s `id` field. */
328
+ id?: IntFilter;
329
+ /** Filter by the object’s `name` field. */
330
+ name?: StringFilter;
337
331
  /** Negates the expression. */
338
332
  not?: SqlActionFilter;
333
+ /** Checks for any expressions in this list. */
334
+ or?: SqlActionFilter[];
335
+ /** Filter by the object’s `revert` field. */
336
+ revert?: StringFilter;
337
+ /** Filter by the object’s `verify` field. */
338
+ verify?: StringFilter;
339
339
  }
340
- export type MigrateFileOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'UPLOAD_ASC' | 'UPLOAD_DESC';
341
- export type SqlActionOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'DEPLOY_ASC' | 'DEPLOY_DESC' | 'DEPS_ASC' | 'DEPS_DESC' | 'PAYLOAD_ASC' | 'PAYLOAD_DESC' | 'CONTENT_ASC' | 'CONTENT_DESC' | 'REVERT_ASC' | 'REVERT_DESC' | 'VERIFY_ASC' | 'VERIFY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'CATEGORY_ASC' | 'CATEGORY_DESC' | 'ACTION_ASC' | 'ACTION_DESC' | 'ACTION_ID_ASC' | 'ACTION_ID_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC';
340
+ export type MigrateFileOrderBy = 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'ID_ASC' | 'ID_DESC' | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'UPLOAD_ASC' | 'UPLOAD_DESC';
341
+ export type SqlActionOrderBy = 'ACTION_ASC' | 'ACTION_DESC' | 'ACTION_ID_ASC' | 'ACTION_ID_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'CATEGORY_ASC' | 'CATEGORY_DESC' | 'CONTENT_ASC' | 'CONTENT_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'DEPLOY_ASC' | 'DEPLOY_DESC' | 'DEPS_ASC' | 'DEPS_DESC' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'NATURAL' | 'PAYLOAD_ASC' | 'PAYLOAD_DESC' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'REVERT_ASC' | 'REVERT_DESC' | 'VERIFY_ASC' | 'VERIFY_DESC';
342
342
  export interface CreateMigrateFileInput {
343
343
  clientMutationId?: string;
344
344
  migrateFile: {
@@ -363,33 +363,33 @@ export interface DeleteMigrateFileInput {
363
363
  export interface CreateSqlActionInput {
364
364
  clientMutationId?: string;
365
365
  sqlAction: {
366
- name?: string;
366
+ action?: string;
367
+ actionId?: string;
368
+ actorId?: string;
369
+ category?: string;
370
+ content?: string;
367
371
  databaseId?: string;
368
372
  deploy?: string;
369
373
  deps?: string[];
374
+ name?: string;
370
375
  payload?: Record<string, unknown>;
371
- content?: string;
372
376
  revert?: string;
373
377
  verify?: string;
374
- category?: string;
375
- action?: string;
376
- actionId?: string;
377
- actorId?: string;
378
378
  };
379
379
  }
380
380
  export interface SqlActionPatch {
381
- name?: string | null;
381
+ action?: string | null;
382
+ actionId?: string | null;
383
+ actorId?: string | null;
384
+ category?: string | null;
385
+ content?: string | null;
382
386
  databaseId?: string | null;
383
387
  deploy?: string | null;
384
388
  deps?: string[] | null;
389
+ name?: string | null;
385
390
  payload?: Record<string, unknown> | null;
386
- content?: string | null;
387
391
  revert?: string | null;
388
392
  verify?: string | null;
389
- category?: string | null;
390
- action?: string | null;
391
- actionId?: string | null;
392
- actorId?: string | null;
393
393
  }
394
394
  export interface UpdateSqlActionInput {
395
395
  clientMutationId?: string;
@@ -405,12 +405,6 @@ export interface ExecuteSqlInput {
405
405
  clientMutationId?: string;
406
406
  stmt?: string;
407
407
  }
408
- export interface RunMigrationInput {
409
- clientMutationId?: string;
410
- databaseId?: string;
411
- migration?: number;
412
- kind?: string;
413
- }
414
408
  export interface ProvisionBucketInput {
415
409
  /** The logical bucket key (e.g., "public", "private") */
416
410
  bucketKey: string;
@@ -420,63 +414,69 @@ export interface ProvisionBucketInput {
420
414
  */
421
415
  ownerId?: string;
422
416
  }
417
+ export interface RunMigrationInput {
418
+ clientMutationId?: string;
419
+ databaseId?: string;
420
+ kind?: string;
421
+ migration?: number;
422
+ }
423
423
  /** A filter to be used against ConstructiveInternalTypeUpload fields. All fields are combined with a logical ‘and.’ */
424
424
  export interface ConstructiveInternalTypeUploadFilter {
425
- /** Is null (if `true` is specified) or is not null (if `false` is specified). */
426
- isNull?: boolean;
427
- /** Equal to the specified value. */
428
- equalTo?: ConstructiveInternalTypeUpload;
429
- /** Not equal to the specified value. */
430
- notEqualTo?: ConstructiveInternalTypeUpload;
425
+ /** Contained by the specified JSON. */
426
+ containedBy?: ConstructiveInternalTypeUpload;
427
+ /** Contains the specified JSON. */
428
+ contains?: ConstructiveInternalTypeUpload;
429
+ /** Contains all of the specified keys. */
430
+ containsAllKeys?: string[];
431
+ /** Contains any of the specified keys. */
432
+ containsAnyKeys?: string[];
433
+ /** Contains the specified key. */
434
+ containsKey?: string;
431
435
  /** Not equal to the specified value, treating null like an ordinary value. */
432
436
  distinctFrom?: ConstructiveInternalTypeUpload;
433
- /** Equal to the specified value, treating null like an ordinary value. */
434
- notDistinctFrom?: ConstructiveInternalTypeUpload;
437
+ /** Equal to the specified value. */
438
+ equalTo?: ConstructiveInternalTypeUpload;
439
+ /** Greater than the specified value. */
440
+ greaterThan?: ConstructiveInternalTypeUpload;
441
+ /** Greater than or equal to the specified value. */
442
+ greaterThanOrEqualTo?: ConstructiveInternalTypeUpload;
435
443
  /** Included in the specified list. */
436
444
  in?: ConstructiveInternalTypeUpload[];
437
- /** Not included in the specified list. */
438
- notIn?: ConstructiveInternalTypeUpload[];
445
+ /** Is null (if `true` is specified) or is not null (if `false` is specified). */
446
+ isNull?: boolean;
439
447
  /** Less than the specified value. */
440
448
  lessThan?: ConstructiveInternalTypeUpload;
441
449
  /** Less than or equal to the specified value. */
442
450
  lessThanOrEqualTo?: ConstructiveInternalTypeUpload;
443
- /** Greater than the specified value. */
444
- greaterThan?: ConstructiveInternalTypeUpload;
445
- /** Greater than or equal to the specified value. */
446
- greaterThanOrEqualTo?: ConstructiveInternalTypeUpload;
447
- /** Contains the specified JSON. */
448
- contains?: ConstructiveInternalTypeUpload;
449
- /** Contains the specified key. */
450
- containsKey?: string;
451
- /** Contains all of the specified keys. */
452
- containsAllKeys?: string[];
453
- /** Contains any of the specified keys. */
454
- containsAnyKeys?: string[];
455
- /** Contained by the specified JSON. */
456
- containedBy?: ConstructiveInternalTypeUpload;
451
+ /** Equal to the specified value, treating null like an ordinary value. */
452
+ notDistinctFrom?: ConstructiveInternalTypeUpload;
453
+ /** Not equal to the specified value. */
454
+ notEqualTo?: ConstructiveInternalTypeUpload;
455
+ /** Not included in the specified list. */
456
+ notIn?: ConstructiveInternalTypeUpload[];
457
457
  }
458
458
  /** An input for mutations affecting `MigrateFile` */
459
459
  export interface MigrateFileInput {
460
- id?: string;
461
460
  databaseId?: string;
461
+ id?: string;
462
462
  upload?: ConstructiveInternalTypeUpload;
463
463
  }
464
464
  /** An input for mutations affecting `SqlAction` */
465
465
  export interface SqlActionInput {
466
- id?: number;
467
- name?: string;
466
+ action?: string;
467
+ actionId?: string;
468
+ actorId?: string;
469
+ category?: string;
470
+ content?: string;
471
+ createdAt?: string;
468
472
  databaseId?: string;
469
473
  deploy?: string;
470
474
  deps?: string[];
475
+ id?: number;
476
+ name?: string;
471
477
  payload?: Record<string, unknown>;
472
- content?: string;
473
478
  revert?: string;
474
479
  verify?: string;
475
- createdAt?: string;
476
- category?: string;
477
- action?: string;
478
- actionId?: string;
479
- actorId?: string;
480
480
  }
481
481
  export interface ExecuteSqlPayload {
482
482
  clientMutationId?: string | null;
@@ -484,33 +484,33 @@ export interface ExecuteSqlPayload {
484
484
  export type ExecuteSqlPayloadSelect = {
485
485
  clientMutationId?: boolean;
486
486
  };
487
- export interface RunMigrationPayload {
488
- clientMutationId?: string | null;
489
- }
490
- export type RunMigrationPayloadSelect = {
491
- clientMutationId?: boolean;
492
- };
493
487
  export interface ProvisionBucketPayload {
494
- /** Whether provisioning succeeded */
495
- success: boolean;
496
- /** The S3 bucket name that was provisioned */
497
- bucketName: string;
498
488
  /** The access type applied */
499
489
  accessType: string;
500
- /** The storage provider used */
501
- provider: string;
490
+ /** The S3 bucket name that was provisioned */
491
+ bucketName: string;
502
492
  /** The S3 endpoint (null for AWS S3 default) */
503
493
  endpoint?: string | null;
504
494
  /** Error message if provisioning failed */
505
495
  error?: string | null;
496
+ /** The storage provider used */
497
+ provider: string;
498
+ /** Whether provisioning succeeded */
499
+ success: boolean;
506
500
  }
507
501
  export type ProvisionBucketPayloadSelect = {
508
- success?: boolean;
509
- bucketName?: boolean;
510
502
  accessType?: boolean;
511
- provider?: boolean;
503
+ bucketName?: boolean;
512
504
  endpoint?: boolean;
513
505
  error?: boolean;
506
+ provider?: boolean;
507
+ success?: boolean;
508
+ };
509
+ export interface RunMigrationPayload {
510
+ clientMutationId?: string | null;
511
+ }
512
+ export type RunMigrationPayloadSelect = {
513
+ clientMutationId?: boolean;
514
514
  };
515
515
  export interface CreateMigrateFilePayload {
516
516
  clientMutationId?: string | null;
@@ -6,13 +6,10 @@
6
6
  import { OrmClient } from '../client';
7
7
  import { QueryBuilder } from '../query-builder';
8
8
  import type { InferSelectResult, StrictSelect } from '../select-types';
9
- import type { ExecuteSqlInput, RunMigrationInput, ProvisionBucketInput, ExecuteSqlPayload, RunMigrationPayload, ProvisionBucketPayload, ExecuteSqlPayloadSelect, RunMigrationPayloadSelect, ProvisionBucketPayloadSelect } from '../input-types';
9
+ import type { ExecuteSqlInput, ProvisionBucketInput, RunMigrationInput, ExecuteSqlPayload, ProvisionBucketPayload, RunMigrationPayload, ExecuteSqlPayloadSelect, ProvisionBucketPayloadSelect, RunMigrationPayloadSelect } from '../input-types';
10
10
  export interface ExecuteSqlVariables {
11
11
  input: ExecuteSqlInput;
12
12
  }
13
- export interface RunMigrationVariables {
14
- input: RunMigrationInput;
15
- }
16
13
  /**
17
14
  * Variables for provisionBucket
18
15
  * Provision an S3 bucket for a logical bucket in the database.
@@ -23,20 +20,23 @@ and lifecycle settings.
23
20
  export interface ProvisionBucketVariables {
24
21
  input: ProvisionBucketInput;
25
22
  }
23
+ export interface RunMigrationVariables {
24
+ input: RunMigrationInput;
25
+ }
26
26
  export declare function createMutationOperations(client: OrmClient): {
27
27
  executeSql: <S extends ExecuteSqlPayloadSelect>(args: ExecuteSqlVariables, options: {
28
28
  select: S;
29
29
  } & StrictSelect<S, ExecuteSqlPayloadSelect>) => QueryBuilder<{
30
30
  executeSql: InferSelectResult<ExecuteSqlPayload, S> | null;
31
31
  }>;
32
- runMigration: <S extends RunMigrationPayloadSelect>(args: RunMigrationVariables, options: {
33
- select: S;
34
- } & StrictSelect<S, RunMigrationPayloadSelect>) => QueryBuilder<{
35
- runMigration: InferSelectResult<RunMigrationPayload, S> | null;
36
- }>;
37
32
  provisionBucket: <S extends ProvisionBucketPayloadSelect>(args: ProvisionBucketVariables, options: {
38
33
  select: S;
39
34
  } & StrictSelect<S, ProvisionBucketPayloadSelect>) => QueryBuilder<{
40
35
  provisionBucket: InferSelectResult<ProvisionBucketPayload, S> | null;
41
36
  }>;
37
+ runMigration: <S extends RunMigrationPayloadSelect>(args: RunMigrationVariables, options: {
38
+ select: S;
39
+ } & StrictSelect<S, RunMigrationPayloadSelect>) => QueryBuilder<{
40
+ runMigration: InferSelectResult<RunMigrationPayload, S> | null;
41
+ }>;
42
42
  };
@@ -14,18 +14,6 @@ export function createMutationOperations(client) {
14
14
  },
15
15
  ], connectionFieldsMap, 'ExecuteSqlPayload'),
16
16
  }),
17
- runMigration: (args, options) => new QueryBuilder({
18
- client,
19
- operation: 'mutation',
20
- operationName: 'RunMigration',
21
- fieldName: 'runMigration',
22
- ...buildCustomDocument('mutation', 'RunMigration', 'runMigration', options.select, args, [
23
- {
24
- name: 'input',
25
- type: 'RunMigrationInput!',
26
- },
27
- ], connectionFieldsMap, 'RunMigrationPayload'),
28
- }),
29
17
  provisionBucket: (args, options) => new QueryBuilder({
30
18
  client,
31
19
  operation: 'mutation',
@@ -38,5 +26,17 @@ export function createMutationOperations(client) {
38
26
  },
39
27
  ], connectionFieldsMap, 'ProvisionBucketPayload'),
40
28
  }),
29
+ runMigration: (args, options) => new QueryBuilder({
30
+ client,
31
+ operation: 'mutation',
32
+ operationName: 'RunMigration',
33
+ fieldName: 'runMigration',
34
+ ...buildCustomDocument('mutation', 'RunMigration', 'runMigration', options.select, args, [
35
+ {
36
+ name: 'input',
37
+ type: 'RunMigrationInput!',
38
+ },
39
+ ], connectionFieldsMap, 'RunMigrationPayload'),
40
+ }),
41
41
  };
42
42
  }
@@ -39,15 +39,15 @@ export declare function createClient(config: OrmClientConfig): {
39
39
  } & import("./select-types").StrictSelect<S, import("./input-types").ExecuteSqlPayloadSelect>) => import("./query-builder").QueryBuilder<{
40
40
  executeSql: import("./select-types").InferSelectResult<import("./input-types").ExecuteSqlPayload, S> | null;
41
41
  }>;
42
- runMigration: <S extends import("./input-types").RunMigrationPayloadSelect>(args: import("./mutation").RunMigrationVariables, options: {
43
- select: S;
44
- } & import("./select-types").StrictSelect<S, import("./input-types").RunMigrationPayloadSelect>) => import("./query-builder").QueryBuilder<{
45
- runMigration: import("./select-types").InferSelectResult<import("./input-types").RunMigrationPayload, S> | null;
46
- }>;
47
42
  provisionBucket: <S extends import("./input-types").ProvisionBucketPayloadSelect>(args: import("./mutation").ProvisionBucketVariables, options: {
48
43
  select: S;
49
44
  } & import("./select-types").StrictSelect<S, import("./input-types").ProvisionBucketPayloadSelect>) => import("./query-builder").QueryBuilder<{
50
45
  provisionBucket: import("./select-types").InferSelectResult<import("./input-types").ProvisionBucketPayload, S> | null;
51
46
  }>;
47
+ runMigration: <S extends import("./input-types").RunMigrationPayloadSelect>(args: import("./mutation").RunMigrationVariables, options: {
48
+ select: S;
49
+ } & import("./select-types").StrictSelect<S, import("./input-types").RunMigrationPayloadSelect>) => import("./query-builder").QueryBuilder<{
50
+ runMigration: import("./select-types").InferSelectResult<import("./input-types").RunMigrationPayload, S> | null;
51
+ }>;
52
52
  };
53
53
  };
@@ -231,25 +231,25 @@ export interface UUIDListFilter {
231
231
  }
232
232
  export type ConstructiveInternalTypeUpload = unknown;
233
233
  export interface MigrateFile {
234
- id: string;
235
234
  databaseId?: string | null;
235
+ id: string;
236
236
  upload?: ConstructiveInternalTypeUpload | null;
237
237
  }
238
238
  export interface SqlAction {
239
- id: number;
240
- name?: string | null;
239
+ action?: string | null;
240
+ actionId?: string | null;
241
+ actorId?: string | null;
242
+ category?: string | null;
243
+ content?: string | null;
244
+ createdAt?: string | null;
241
245
  databaseId?: string | null;
242
246
  deploy?: string | null;
243
247
  deps?: string[] | null;
248
+ id: number;
249
+ name?: string | null;
244
250
  payload?: Record<string, unknown> | null;
245
- content?: string | null;
246
251
  revert?: string | null;
247
252
  verify?: string | null;
248
- createdAt?: string | null;
249
- category?: string | null;
250
- action?: string | null;
251
- actionId?: string | null;
252
- actorId?: string | null;
253
253
  }
254
254
  export interface ConnectionResult<T> {
255
255
  nodes: T[];
@@ -269,61 +269,41 @@ export interface SqlActionRelations {
269
269
  export type MigrateFileWithRelations = MigrateFile & MigrateFileRelations;
270
270
  export type SqlActionWithRelations = SqlAction & SqlActionRelations;
271
271
  export type MigrateFileSelect = {
272
- id?: boolean;
273
272
  databaseId?: boolean;
273
+ id?: boolean;
274
274
  upload?: boolean;
275
275
  };
276
276
  export type SqlActionSelect = {
277
- id?: boolean;
278
- name?: boolean;
277
+ action?: boolean;
278
+ actionId?: boolean;
279
+ actorId?: boolean;
280
+ category?: boolean;
281
+ content?: boolean;
282
+ createdAt?: boolean;
279
283
  databaseId?: boolean;
280
284
  deploy?: boolean;
281
285
  deps?: boolean;
286
+ id?: boolean;
287
+ name?: boolean;
282
288
  payload?: boolean;
283
- content?: boolean;
284
289
  revert?: boolean;
285
290
  verify?: boolean;
286
- createdAt?: boolean;
287
- category?: boolean;
288
- action?: boolean;
289
- actionId?: boolean;
290
- actorId?: boolean;
291
291
  };
292
292
  export interface MigrateFileFilter {
293
- /** Filter by the object’s `id` field. */
294
- id?: UUIDFilter;
295
- /** Filter by the object’s `databaseId` field. */
296
- databaseId?: UUIDFilter;
297
- /** Filter by the object’s `upload` field. */
298
- upload?: ConstructiveInternalTypeUploadFilter;
299
293
  /** Checks for all expressions in this list. */
300
294
  and?: MigrateFileFilter[];
301
- /** Checks for any expressions in this list. */
302
- or?: MigrateFileFilter[];
295
+ /** Filter by the object’s `databaseId` field. */
296
+ databaseId?: UUIDFilter;
297
+ /** Filter by the object’s `id` field. */
298
+ id?: UUIDFilter;
303
299
  /** Negates the expression. */
304
300
  not?: MigrateFileFilter;
301
+ /** Checks for any expressions in this list. */
302
+ or?: MigrateFileFilter[];
303
+ /** Filter by the object’s `upload` field. */
304
+ upload?: ConstructiveInternalTypeUploadFilter;
305
305
  }
306
306
  export interface SqlActionFilter {
307
- /** Filter by the object’s `id` field. */
308
- id?: IntFilter;
309
- /** Filter by the object’s `name` field. */
310
- name?: StringFilter;
311
- /** Filter by the object’s `databaseId` field. */
312
- databaseId?: UUIDFilter;
313
- /** Filter by the object’s `deploy` field. */
314
- deploy?: StringFilter;
315
- /** Filter by the object’s `deps` field. */
316
- deps?: StringListFilter;
317
- /** Filter by the object’s `content` field. */
318
- content?: StringFilter;
319
- /** Filter by the object’s `revert` field. */
320
- revert?: StringFilter;
321
- /** Filter by the object’s `verify` field. */
322
- verify?: StringFilter;
323
- /** Filter by the object’s `createdAt` field. */
324
- createdAt?: DatetimeFilter;
325
- /** Filter by the object’s `category` field. */
326
- category?: StringFilter;
327
307
  /** Filter by the object’s `action` field. */
328
308
  action?: StringFilter;
329
309
  /** Filter by the object’s `actionId` field. */
@@ -332,13 +312,33 @@ export interface SqlActionFilter {
332
312
  actorId?: UUIDFilter;
333
313
  /** Checks for all expressions in this list. */
334
314
  and?: SqlActionFilter[];
335
- /** Checks for any expressions in this list. */
336
- or?: SqlActionFilter[];
315
+ /** Filter by the object’s `category` field. */
316
+ category?: StringFilter;
317
+ /** Filter by the object’s `content` field. */
318
+ content?: StringFilter;
319
+ /** Filter by the object’s `createdAt` field. */
320
+ createdAt?: DatetimeFilter;
321
+ /** Filter by the object’s `databaseId` field. */
322
+ databaseId?: UUIDFilter;
323
+ /** Filter by the object’s `deploy` field. */
324
+ deploy?: StringFilter;
325
+ /** Filter by the object’s `deps` field. */
326
+ deps?: StringListFilter;
327
+ /** Filter by the object’s `id` field. */
328
+ id?: IntFilter;
329
+ /** Filter by the object’s `name` field. */
330
+ name?: StringFilter;
337
331
  /** Negates the expression. */
338
332
  not?: SqlActionFilter;
333
+ /** Checks for any expressions in this list. */
334
+ or?: SqlActionFilter[];
335
+ /** Filter by the object’s `revert` field. */
336
+ revert?: StringFilter;
337
+ /** Filter by the object’s `verify` field. */
338
+ verify?: StringFilter;
339
339
  }
340
- export type MigrateFileOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'UPLOAD_ASC' | 'UPLOAD_DESC';
341
- export type SqlActionOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'DEPLOY_ASC' | 'DEPLOY_DESC' | 'DEPS_ASC' | 'DEPS_DESC' | 'PAYLOAD_ASC' | 'PAYLOAD_DESC' | 'CONTENT_ASC' | 'CONTENT_DESC' | 'REVERT_ASC' | 'REVERT_DESC' | 'VERIFY_ASC' | 'VERIFY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'CATEGORY_ASC' | 'CATEGORY_DESC' | 'ACTION_ASC' | 'ACTION_DESC' | 'ACTION_ID_ASC' | 'ACTION_ID_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC';
340
+ export type MigrateFileOrderBy = 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'ID_ASC' | 'ID_DESC' | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'UPLOAD_ASC' | 'UPLOAD_DESC';
341
+ export type SqlActionOrderBy = 'ACTION_ASC' | 'ACTION_DESC' | 'ACTION_ID_ASC' | 'ACTION_ID_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'CATEGORY_ASC' | 'CATEGORY_DESC' | 'CONTENT_ASC' | 'CONTENT_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'DEPLOY_ASC' | 'DEPLOY_DESC' | 'DEPS_ASC' | 'DEPS_DESC' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'NATURAL' | 'PAYLOAD_ASC' | 'PAYLOAD_DESC' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'REVERT_ASC' | 'REVERT_DESC' | 'VERIFY_ASC' | 'VERIFY_DESC';
342
342
  export interface CreateMigrateFileInput {
343
343
  clientMutationId?: string;
344
344
  migrateFile: {
@@ -363,33 +363,33 @@ export interface DeleteMigrateFileInput {
363
363
  export interface CreateSqlActionInput {
364
364
  clientMutationId?: string;
365
365
  sqlAction: {
366
- name?: string;
366
+ action?: string;
367
+ actionId?: string;
368
+ actorId?: string;
369
+ category?: string;
370
+ content?: string;
367
371
  databaseId?: string;
368
372
  deploy?: string;
369
373
  deps?: string[];
374
+ name?: string;
370
375
  payload?: Record<string, unknown>;
371
- content?: string;
372
376
  revert?: string;
373
377
  verify?: string;
374
- category?: string;
375
- action?: string;
376
- actionId?: string;
377
- actorId?: string;
378
378
  };
379
379
  }
380
380
  export interface SqlActionPatch {
381
- name?: string | null;
381
+ action?: string | null;
382
+ actionId?: string | null;
383
+ actorId?: string | null;
384
+ category?: string | null;
385
+ content?: string | null;
382
386
  databaseId?: string | null;
383
387
  deploy?: string | null;
384
388
  deps?: string[] | null;
389
+ name?: string | null;
385
390
  payload?: Record<string, unknown> | null;
386
- content?: string | null;
387
391
  revert?: string | null;
388
392
  verify?: string | null;
389
- category?: string | null;
390
- action?: string | null;
391
- actionId?: string | null;
392
- actorId?: string | null;
393
393
  }
394
394
  export interface UpdateSqlActionInput {
395
395
  clientMutationId?: string;
@@ -405,12 +405,6 @@ export interface ExecuteSqlInput {
405
405
  clientMutationId?: string;
406
406
  stmt?: string;
407
407
  }
408
- export interface RunMigrationInput {
409
- clientMutationId?: string;
410
- databaseId?: string;
411
- migration?: number;
412
- kind?: string;
413
- }
414
408
  export interface ProvisionBucketInput {
415
409
  /** The logical bucket key (e.g., "public", "private") */
416
410
  bucketKey: string;
@@ -420,63 +414,69 @@ export interface ProvisionBucketInput {
420
414
  */
421
415
  ownerId?: string;
422
416
  }
417
+ export interface RunMigrationInput {
418
+ clientMutationId?: string;
419
+ databaseId?: string;
420
+ kind?: string;
421
+ migration?: number;
422
+ }
423
423
  /** A filter to be used against ConstructiveInternalTypeUpload fields. All fields are combined with a logical ‘and.’ */
424
424
  export interface ConstructiveInternalTypeUploadFilter {
425
- /** Is null (if `true` is specified) or is not null (if `false` is specified). */
426
- isNull?: boolean;
427
- /** Equal to the specified value. */
428
- equalTo?: ConstructiveInternalTypeUpload;
429
- /** Not equal to the specified value. */
430
- notEqualTo?: ConstructiveInternalTypeUpload;
425
+ /** Contained by the specified JSON. */
426
+ containedBy?: ConstructiveInternalTypeUpload;
427
+ /** Contains the specified JSON. */
428
+ contains?: ConstructiveInternalTypeUpload;
429
+ /** Contains all of the specified keys. */
430
+ containsAllKeys?: string[];
431
+ /** Contains any of the specified keys. */
432
+ containsAnyKeys?: string[];
433
+ /** Contains the specified key. */
434
+ containsKey?: string;
431
435
  /** Not equal to the specified value, treating null like an ordinary value. */
432
436
  distinctFrom?: ConstructiveInternalTypeUpload;
433
- /** Equal to the specified value, treating null like an ordinary value. */
434
- notDistinctFrom?: ConstructiveInternalTypeUpload;
437
+ /** Equal to the specified value. */
438
+ equalTo?: ConstructiveInternalTypeUpload;
439
+ /** Greater than the specified value. */
440
+ greaterThan?: ConstructiveInternalTypeUpload;
441
+ /** Greater than or equal to the specified value. */
442
+ greaterThanOrEqualTo?: ConstructiveInternalTypeUpload;
435
443
  /** Included in the specified list. */
436
444
  in?: ConstructiveInternalTypeUpload[];
437
- /** Not included in the specified list. */
438
- notIn?: ConstructiveInternalTypeUpload[];
445
+ /** Is null (if `true` is specified) or is not null (if `false` is specified). */
446
+ isNull?: boolean;
439
447
  /** Less than the specified value. */
440
448
  lessThan?: ConstructiveInternalTypeUpload;
441
449
  /** Less than or equal to the specified value. */
442
450
  lessThanOrEqualTo?: ConstructiveInternalTypeUpload;
443
- /** Greater than the specified value. */
444
- greaterThan?: ConstructiveInternalTypeUpload;
445
- /** Greater than or equal to the specified value. */
446
- greaterThanOrEqualTo?: ConstructiveInternalTypeUpload;
447
- /** Contains the specified JSON. */
448
- contains?: ConstructiveInternalTypeUpload;
449
- /** Contains the specified key. */
450
- containsKey?: string;
451
- /** Contains all of the specified keys. */
452
- containsAllKeys?: string[];
453
- /** Contains any of the specified keys. */
454
- containsAnyKeys?: string[];
455
- /** Contained by the specified JSON. */
456
- containedBy?: ConstructiveInternalTypeUpload;
451
+ /** Equal to the specified value, treating null like an ordinary value. */
452
+ notDistinctFrom?: ConstructiveInternalTypeUpload;
453
+ /** Not equal to the specified value. */
454
+ notEqualTo?: ConstructiveInternalTypeUpload;
455
+ /** Not included in the specified list. */
456
+ notIn?: ConstructiveInternalTypeUpload[];
457
457
  }
458
458
  /** An input for mutations affecting `MigrateFile` */
459
459
  export interface MigrateFileInput {
460
- id?: string;
461
460
  databaseId?: string;
461
+ id?: string;
462
462
  upload?: ConstructiveInternalTypeUpload;
463
463
  }
464
464
  /** An input for mutations affecting `SqlAction` */
465
465
  export interface SqlActionInput {
466
- id?: number;
467
- name?: string;
466
+ action?: string;
467
+ actionId?: string;
468
+ actorId?: string;
469
+ category?: string;
470
+ content?: string;
471
+ createdAt?: string;
468
472
  databaseId?: string;
469
473
  deploy?: string;
470
474
  deps?: string[];
475
+ id?: number;
476
+ name?: string;
471
477
  payload?: Record<string, unknown>;
472
- content?: string;
473
478
  revert?: string;
474
479
  verify?: string;
475
- createdAt?: string;
476
- category?: string;
477
- action?: string;
478
- actionId?: string;
479
- actorId?: string;
480
480
  }
481
481
  export interface ExecuteSqlPayload {
482
482
  clientMutationId?: string | null;
@@ -484,33 +484,33 @@ export interface ExecuteSqlPayload {
484
484
  export type ExecuteSqlPayloadSelect = {
485
485
  clientMutationId?: boolean;
486
486
  };
487
- export interface RunMigrationPayload {
488
- clientMutationId?: string | null;
489
- }
490
- export type RunMigrationPayloadSelect = {
491
- clientMutationId?: boolean;
492
- };
493
487
  export interface ProvisionBucketPayload {
494
- /** Whether provisioning succeeded */
495
- success: boolean;
496
- /** The S3 bucket name that was provisioned */
497
- bucketName: string;
498
488
  /** The access type applied */
499
489
  accessType: string;
500
- /** The storage provider used */
501
- provider: string;
490
+ /** The S3 bucket name that was provisioned */
491
+ bucketName: string;
502
492
  /** The S3 endpoint (null for AWS S3 default) */
503
493
  endpoint?: string | null;
504
494
  /** Error message if provisioning failed */
505
495
  error?: string | null;
496
+ /** The storage provider used */
497
+ provider: string;
498
+ /** Whether provisioning succeeded */
499
+ success: boolean;
506
500
  }
507
501
  export type ProvisionBucketPayloadSelect = {
508
- success?: boolean;
509
- bucketName?: boolean;
510
502
  accessType?: boolean;
511
- provider?: boolean;
503
+ bucketName?: boolean;
512
504
  endpoint?: boolean;
513
505
  error?: boolean;
506
+ provider?: boolean;
507
+ success?: boolean;
508
+ };
509
+ export interface RunMigrationPayload {
510
+ clientMutationId?: string | null;
511
+ }
512
+ export type RunMigrationPayloadSelect = {
513
+ clientMutationId?: boolean;
514
514
  };
515
515
  export interface CreateMigrateFilePayload {
516
516
  clientMutationId?: string | null;
@@ -6,13 +6,10 @@
6
6
  import { OrmClient } from '../client';
7
7
  import { QueryBuilder } from '../query-builder';
8
8
  import type { InferSelectResult, StrictSelect } from '../select-types';
9
- import type { ExecuteSqlInput, RunMigrationInput, ProvisionBucketInput, ExecuteSqlPayload, RunMigrationPayload, ProvisionBucketPayload, ExecuteSqlPayloadSelect, RunMigrationPayloadSelect, ProvisionBucketPayloadSelect } from '../input-types';
9
+ import type { ExecuteSqlInput, ProvisionBucketInput, RunMigrationInput, ExecuteSqlPayload, ProvisionBucketPayload, RunMigrationPayload, ExecuteSqlPayloadSelect, ProvisionBucketPayloadSelect, RunMigrationPayloadSelect } from '../input-types';
10
10
  export interface ExecuteSqlVariables {
11
11
  input: ExecuteSqlInput;
12
12
  }
13
- export interface RunMigrationVariables {
14
- input: RunMigrationInput;
15
- }
16
13
  /**
17
14
  * Variables for provisionBucket
18
15
  * Provision an S3 bucket for a logical bucket in the database.
@@ -23,20 +20,23 @@ and lifecycle settings.
23
20
  export interface ProvisionBucketVariables {
24
21
  input: ProvisionBucketInput;
25
22
  }
23
+ export interface RunMigrationVariables {
24
+ input: RunMigrationInput;
25
+ }
26
26
  export declare function createMutationOperations(client: OrmClient): {
27
27
  executeSql: <S extends ExecuteSqlPayloadSelect>(args: ExecuteSqlVariables, options: {
28
28
  select: S;
29
29
  } & StrictSelect<S, ExecuteSqlPayloadSelect>) => QueryBuilder<{
30
30
  executeSql: InferSelectResult<ExecuteSqlPayload, S> | null;
31
31
  }>;
32
- runMigration: <S extends RunMigrationPayloadSelect>(args: RunMigrationVariables, options: {
33
- select: S;
34
- } & StrictSelect<S, RunMigrationPayloadSelect>) => QueryBuilder<{
35
- runMigration: InferSelectResult<RunMigrationPayload, S> | null;
36
- }>;
37
32
  provisionBucket: <S extends ProvisionBucketPayloadSelect>(args: ProvisionBucketVariables, options: {
38
33
  select: S;
39
34
  } & StrictSelect<S, ProvisionBucketPayloadSelect>) => QueryBuilder<{
40
35
  provisionBucket: InferSelectResult<ProvisionBucketPayload, S> | null;
41
36
  }>;
37
+ runMigration: <S extends RunMigrationPayloadSelect>(args: RunMigrationVariables, options: {
38
+ select: S;
39
+ } & StrictSelect<S, RunMigrationPayloadSelect>) => QueryBuilder<{
40
+ runMigration: InferSelectResult<RunMigrationPayload, S> | null;
41
+ }>;
42
42
  };
@@ -17,18 +17,6 @@ function createMutationOperations(client) {
17
17
  },
18
18
  ], input_types_1.connectionFieldsMap, 'ExecuteSqlPayload'),
19
19
  }),
20
- runMigration: (args, options) => new query_builder_1.QueryBuilder({
21
- client,
22
- operation: 'mutation',
23
- operationName: 'RunMigration',
24
- fieldName: 'runMigration',
25
- ...(0, query_builder_1.buildCustomDocument)('mutation', 'RunMigration', 'runMigration', options.select, args, [
26
- {
27
- name: 'input',
28
- type: 'RunMigrationInput!',
29
- },
30
- ], input_types_1.connectionFieldsMap, 'RunMigrationPayload'),
31
- }),
32
20
  provisionBucket: (args, options) => new query_builder_1.QueryBuilder({
33
21
  client,
34
22
  operation: 'mutation',
@@ -41,5 +29,17 @@ function createMutationOperations(client) {
41
29
  },
42
30
  ], input_types_1.connectionFieldsMap, 'ProvisionBucketPayload'),
43
31
  }),
32
+ runMigration: (args, options) => new query_builder_1.QueryBuilder({
33
+ client,
34
+ operation: 'mutation',
35
+ operationName: 'RunMigration',
36
+ fieldName: 'runMigration',
37
+ ...(0, query_builder_1.buildCustomDocument)('mutation', 'RunMigration', 'runMigration', options.select, args, [
38
+ {
39
+ name: 'input',
40
+ type: 'RunMigrationInput!',
41
+ },
42
+ ], input_types_1.connectionFieldsMap, 'RunMigrationPayload'),
43
+ }),
44
44
  };
45
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/migrate-client",
3
- "version": "0.20.2",
3
+ "version": "0.21.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Typed GraphQL ORM client for the Constructive Migrate API (db_migrate schema)",
6
6
  "main": "index.js",
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@0no-co/graphql.web": "^1.1.2",
43
- "@constructive-io/graphql-query": "^3.32.2",
43
+ "@constructive-io/graphql-query": "^3.33.0",
44
44
  "@constructive-io/graphql-types": "^3.14.0",
45
45
  "gql-ast": "^3.13.0",
46
46
  "graphql": "16.13.0"
@@ -50,5 +50,5 @@
50
50
  "makage": "^0.3.0",
51
51
  "typescript": "^5.9.3"
52
52
  },
53
- "gitHead": "cd21f62bb64bdc7f4f40f6cef6af73f8f1c8f8dc"
53
+ "gitHead": "ec85fab7970e1dc55e1446a211414e45dfaa0a68"
54
54
  }