@pgpmjs/migrate-client 0.1.2 → 0.1.3

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.
@@ -288,29 +288,49 @@ export type SqlActionSelect = {
288
288
  actorId?: boolean;
289
289
  };
290
290
  export interface MigrateFileFilter {
291
+ /** Filter by the object’s `id` field. */
291
292
  id?: UUIDFilter;
293
+ /** Filter by the object’s `databaseId` field. */
292
294
  databaseId?: UUIDFilter;
293
- upload?: StringFilter;
295
+ /** Filter by the object’s `upload` field. */
296
+ upload?: ConstructiveInternalTypeUploadFilter;
297
+ /** Checks for all expressions in this list. */
294
298
  and?: MigrateFileFilter[];
299
+ /** Checks for any expressions in this list. */
295
300
  or?: MigrateFileFilter[];
301
+ /** Negates the expression. */
296
302
  not?: MigrateFileFilter;
297
303
  }
298
304
  export interface SqlActionFilter {
305
+ /** Filter by the object’s `id` field. */
299
306
  id?: IntFilter;
307
+ /** Filter by the object’s `name` field. */
300
308
  name?: StringFilter;
309
+ /** Filter by the object’s `databaseId` field. */
301
310
  databaseId?: UUIDFilter;
311
+ /** Filter by the object’s `deploy` field. */
302
312
  deploy?: StringFilter;
313
+ /** Filter by the object’s `deps` field. */
303
314
  deps?: StringListFilter;
304
- payload?: JSONFilter;
315
+ /** Filter by the object’s `content` field. */
305
316
  content?: StringFilter;
317
+ /** Filter by the object’s `revert` field. */
306
318
  revert?: StringFilter;
319
+ /** Filter by the object’s `verify` field. */
307
320
  verify?: StringFilter;
321
+ /** Filter by the object’s `createdAt` field. */
308
322
  createdAt?: DatetimeFilter;
323
+ /** Filter by the object’s `action` field. */
309
324
  action?: StringFilter;
325
+ /** Filter by the object’s `actionId` field. */
310
326
  actionId?: UUIDFilter;
327
+ /** Filter by the object’s `actorId` field. */
311
328
  actorId?: UUIDFilter;
329
+ /** Checks for all expressions in this list. */
312
330
  and?: SqlActionFilter[];
331
+ /** Checks for any expressions in this list. */
313
332
  or?: SqlActionFilter[];
333
+ /** Negates the expression. */
314
334
  not?: SqlActionFilter;
315
335
  }
316
336
  export type MigrateFileOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC';
@@ -385,6 +405,41 @@ export interface RunMigrationInput {
385
405
  migration?: number;
386
406
  kind?: string;
387
407
  }
408
+ /** A filter to be used against ConstructiveInternalTypeUpload fields. All fields are combined with a logical ‘and.’ */
409
+ export interface ConstructiveInternalTypeUploadFilter {
410
+ /** Is null (if `true` is specified) or is not null (if `false` is specified). */
411
+ isNull?: boolean;
412
+ /** Equal to the specified value. */
413
+ equalTo?: ConstructiveInternalTypeUpload;
414
+ /** Not equal to the specified value. */
415
+ notEqualTo?: ConstructiveInternalTypeUpload;
416
+ /** Not equal to the specified value, treating null like an ordinary value. */
417
+ distinctFrom?: ConstructiveInternalTypeUpload;
418
+ /** Equal to the specified value, treating null like an ordinary value. */
419
+ notDistinctFrom?: ConstructiveInternalTypeUpload;
420
+ /** Included in the specified list. */
421
+ in?: ConstructiveInternalTypeUpload[];
422
+ /** Not included in the specified list. */
423
+ notIn?: ConstructiveInternalTypeUpload[];
424
+ /** Less than the specified value. */
425
+ lessThan?: ConstructiveInternalTypeUpload;
426
+ /** Less than or equal to the specified value. */
427
+ lessThanOrEqualTo?: ConstructiveInternalTypeUpload;
428
+ /** Greater than the specified value. */
429
+ greaterThan?: ConstructiveInternalTypeUpload;
430
+ /** Greater than or equal to the specified value. */
431
+ greaterThanOrEqualTo?: ConstructiveInternalTypeUpload;
432
+ /** Contains the specified JSON. */
433
+ contains?: ConstructiveInternalTypeUpload;
434
+ /** Contains the specified key. */
435
+ containsKey?: string;
436
+ /** Contains all of the specified keys. */
437
+ containsAllKeys?: string[];
438
+ /** Contains any of the specified keys. */
439
+ containsAnyKeys?: string[];
440
+ /** Contained by the specified JSON. */
441
+ containedBy?: ConstructiveInternalTypeUpload;
442
+ }
388
443
  export interface ExecuteSqlPayload {
389
444
  clientMutationId?: string | null;
390
445
  }
@@ -81,7 +81,9 @@ export class MigrateFileModel {
81
81
  });
82
82
  }
83
83
  delete(args) {
84
- const { document, variables } = buildDeleteByPkDocument('MigrateFile', 'deleteMigrateFile', 'migrateFile', args.where.id, 'DeleteMigrateFileInput', 'id', args.select, connectionFieldsMap);
84
+ const { document, variables } = buildDeleteByPkDocument('MigrateFile', 'deleteMigrateFile', 'migrateFile', {
85
+ id: args.where.id,
86
+ }, 'DeleteMigrateFileInput', args.select, connectionFieldsMap);
85
87
  return new QueryBuilder({
86
88
  client: this.client,
87
89
  operation: 'mutation',
@@ -81,7 +81,9 @@ export class SqlActionModel {
81
81
  });
82
82
  }
83
83
  delete(args) {
84
- const { document, variables } = buildDeleteByPkDocument('SqlAction', 'deleteSqlAction', 'sqlAction', args.where.id, 'DeleteSqlActionInput', 'id', args.select, connectionFieldsMap);
84
+ const { document, variables } = buildDeleteByPkDocument('SqlAction', 'deleteSqlAction', 'sqlAction', {
85
+ id: args.where.id,
86
+ }, 'DeleteSqlActionInput', args.select, connectionFieldsMap);
85
87
  return new QueryBuilder({
86
88
  client: this.client,
87
89
  operation: 'mutation',
@@ -78,7 +78,11 @@ export declare function buildDeleteDocument<TWhere extends {
78
78
  document: string;
79
79
  variables: Record<string, unknown>;
80
80
  };
81
- export declare function buildDeleteByPkDocument<TSelect = undefined>(operationName: string, mutationField: string, entityField: string, id: string | number, inputTypeName: string, idFieldName: string, select?: TSelect, connectionFieldsMap?: Record<string, Record<string, string>>): {
81
+ export declare function buildDeleteByPkDocument<TSelect = undefined>(operationName: string, mutationField: string, entityField: string, keys: Record<string, unknown>, inputTypeName: string, select?: TSelect, connectionFieldsMap?: Record<string, Record<string, string>>): {
82
+ document: string;
83
+ variables: Record<string, unknown>;
84
+ };
85
+ export declare function buildJunctionRemoveDocument(operationName: string, mutationField: string, keys: Record<string, unknown>, inputTypeName: string): {
82
86
  document: string;
83
87
  variables: Record<string, unknown>;
84
88
  };
@@ -361,7 +361,7 @@ export function buildDeleteDocument(operationName, mutationField, entityField, w
361
361
  },
362
362
  };
363
363
  }
364
- export function buildDeleteByPkDocument(operationName, mutationField, entityField, id, inputTypeName, idFieldName, select, connectionFieldsMap) {
364
+ export function buildDeleteByPkDocument(operationName, mutationField, entityField, keys, inputTypeName, select, connectionFieldsMap) {
365
365
  const entitySelections = select
366
366
  ? buildSelections(select, connectionFieldsMap, operationName)
367
367
  : [t.field({ name: 'id' })];
@@ -378,9 +378,20 @@ export function buildDeleteByPkDocument(operationName, mutationField, entityFiel
378
378
  ],
379
379
  }),
380
380
  variables: {
381
- input: {
382
- [idFieldName]: id,
383
- },
381
+ input: keys,
382
+ },
383
+ };
384
+ }
385
+ export function buildJunctionRemoveDocument(operationName, mutationField, keys, inputTypeName) {
386
+ return {
387
+ document: buildInputMutationDocument({
388
+ operationName,
389
+ mutationField,
390
+ inputTypeName,
391
+ resultSelections: [t.field({ name: 'clientMutationId' })],
392
+ }),
393
+ variables: {
394
+ input: keys,
384
395
  },
385
396
  };
386
397
  }
@@ -288,29 +288,49 @@ export type SqlActionSelect = {
288
288
  actorId?: boolean;
289
289
  };
290
290
  export interface MigrateFileFilter {
291
+ /** Filter by the object’s `id` field. */
291
292
  id?: UUIDFilter;
293
+ /** Filter by the object’s `databaseId` field. */
292
294
  databaseId?: UUIDFilter;
293
- upload?: StringFilter;
295
+ /** Filter by the object’s `upload` field. */
296
+ upload?: ConstructiveInternalTypeUploadFilter;
297
+ /** Checks for all expressions in this list. */
294
298
  and?: MigrateFileFilter[];
299
+ /** Checks for any expressions in this list. */
295
300
  or?: MigrateFileFilter[];
301
+ /** Negates the expression. */
296
302
  not?: MigrateFileFilter;
297
303
  }
298
304
  export interface SqlActionFilter {
305
+ /** Filter by the object’s `id` field. */
299
306
  id?: IntFilter;
307
+ /** Filter by the object’s `name` field. */
300
308
  name?: StringFilter;
309
+ /** Filter by the object’s `databaseId` field. */
301
310
  databaseId?: UUIDFilter;
311
+ /** Filter by the object’s `deploy` field. */
302
312
  deploy?: StringFilter;
313
+ /** Filter by the object’s `deps` field. */
303
314
  deps?: StringListFilter;
304
- payload?: JSONFilter;
315
+ /** Filter by the object’s `content` field. */
305
316
  content?: StringFilter;
317
+ /** Filter by the object’s `revert` field. */
306
318
  revert?: StringFilter;
319
+ /** Filter by the object’s `verify` field. */
307
320
  verify?: StringFilter;
321
+ /** Filter by the object’s `createdAt` field. */
308
322
  createdAt?: DatetimeFilter;
323
+ /** Filter by the object’s `action` field. */
309
324
  action?: StringFilter;
325
+ /** Filter by the object’s `actionId` field. */
310
326
  actionId?: UUIDFilter;
327
+ /** Filter by the object’s `actorId` field. */
311
328
  actorId?: UUIDFilter;
329
+ /** Checks for all expressions in this list. */
312
330
  and?: SqlActionFilter[];
331
+ /** Checks for any expressions in this list. */
313
332
  or?: SqlActionFilter[];
333
+ /** Negates the expression. */
314
334
  not?: SqlActionFilter;
315
335
  }
316
336
  export type MigrateFileOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC';
@@ -385,6 +405,41 @@ export interface RunMigrationInput {
385
405
  migration?: number;
386
406
  kind?: string;
387
407
  }
408
+ /** A filter to be used against ConstructiveInternalTypeUpload fields. All fields are combined with a logical ‘and.’ */
409
+ export interface ConstructiveInternalTypeUploadFilter {
410
+ /** Is null (if `true` is specified) or is not null (if `false` is specified). */
411
+ isNull?: boolean;
412
+ /** Equal to the specified value. */
413
+ equalTo?: ConstructiveInternalTypeUpload;
414
+ /** Not equal to the specified value. */
415
+ notEqualTo?: ConstructiveInternalTypeUpload;
416
+ /** Not equal to the specified value, treating null like an ordinary value. */
417
+ distinctFrom?: ConstructiveInternalTypeUpload;
418
+ /** Equal to the specified value, treating null like an ordinary value. */
419
+ notDistinctFrom?: ConstructiveInternalTypeUpload;
420
+ /** Included in the specified list. */
421
+ in?: ConstructiveInternalTypeUpload[];
422
+ /** Not included in the specified list. */
423
+ notIn?: ConstructiveInternalTypeUpload[];
424
+ /** Less than the specified value. */
425
+ lessThan?: ConstructiveInternalTypeUpload;
426
+ /** Less than or equal to the specified value. */
427
+ lessThanOrEqualTo?: ConstructiveInternalTypeUpload;
428
+ /** Greater than the specified value. */
429
+ greaterThan?: ConstructiveInternalTypeUpload;
430
+ /** Greater than or equal to the specified value. */
431
+ greaterThanOrEqualTo?: ConstructiveInternalTypeUpload;
432
+ /** Contains the specified JSON. */
433
+ contains?: ConstructiveInternalTypeUpload;
434
+ /** Contains the specified key. */
435
+ containsKey?: string;
436
+ /** Contains all of the specified keys. */
437
+ containsAllKeys?: string[];
438
+ /** Contains any of the specified keys. */
439
+ containsAnyKeys?: string[];
440
+ /** Contained by the specified JSON. */
441
+ containedBy?: ConstructiveInternalTypeUpload;
442
+ }
388
443
  export interface ExecuteSqlPayload {
389
444
  clientMutationId?: string | null;
390
445
  }
@@ -84,7 +84,9 @@ class MigrateFileModel {
84
84
  });
85
85
  }
86
86
  delete(args) {
87
- const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('MigrateFile', 'deleteMigrateFile', 'migrateFile', args.where.id, 'DeleteMigrateFileInput', 'id', args.select, input_types_1.connectionFieldsMap);
87
+ const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('MigrateFile', 'deleteMigrateFile', 'migrateFile', {
88
+ id: args.where.id,
89
+ }, 'DeleteMigrateFileInput', args.select, input_types_1.connectionFieldsMap);
88
90
  return new query_builder_1.QueryBuilder({
89
91
  client: this.client,
90
92
  operation: 'mutation',
@@ -84,7 +84,9 @@ class SqlActionModel {
84
84
  });
85
85
  }
86
86
  delete(args) {
87
- const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('SqlAction', 'deleteSqlAction', 'sqlAction', args.where.id, 'DeleteSqlActionInput', 'id', args.select, input_types_1.connectionFieldsMap);
87
+ const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('SqlAction', 'deleteSqlAction', 'sqlAction', {
88
+ id: args.where.id,
89
+ }, 'DeleteSqlActionInput', args.select, input_types_1.connectionFieldsMap);
88
90
  return new query_builder_1.QueryBuilder({
89
91
  client: this.client,
90
92
  operation: 'mutation',
@@ -78,7 +78,11 @@ export declare function buildDeleteDocument<TWhere extends {
78
78
  document: string;
79
79
  variables: Record<string, unknown>;
80
80
  };
81
- export declare function buildDeleteByPkDocument<TSelect = undefined>(operationName: string, mutationField: string, entityField: string, id: string | number, inputTypeName: string, idFieldName: string, select?: TSelect, connectionFieldsMap?: Record<string, Record<string, string>>): {
81
+ export declare function buildDeleteByPkDocument<TSelect = undefined>(operationName: string, mutationField: string, entityField: string, keys: Record<string, unknown>, inputTypeName: string, select?: TSelect, connectionFieldsMap?: Record<string, Record<string, string>>): {
82
+ document: string;
83
+ variables: Record<string, unknown>;
84
+ };
85
+ export declare function buildJunctionRemoveDocument(operationName: string, mutationField: string, keys: Record<string, unknown>, inputTypeName: string): {
82
86
  document: string;
83
87
  variables: Record<string, unknown>;
84
88
  };
@@ -43,6 +43,7 @@ exports.buildUpdateByPkDocument = buildUpdateByPkDocument;
43
43
  exports.buildFindOneDocument = buildFindOneDocument;
44
44
  exports.buildDeleteDocument = buildDeleteDocument;
45
45
  exports.buildDeleteByPkDocument = buildDeleteByPkDocument;
46
+ exports.buildJunctionRemoveDocument = buildJunctionRemoveDocument;
46
47
  exports.buildCustomDocument = buildCustomDocument;
47
48
  /**
48
49
  * Query Builder - Builds and executes GraphQL operations
@@ -408,7 +409,7 @@ function buildDeleteDocument(operationName, mutationField, entityField, where, i
408
409
  },
409
410
  };
410
411
  }
411
- function buildDeleteByPkDocument(operationName, mutationField, entityField, id, inputTypeName, idFieldName, select, connectionFieldsMap) {
412
+ function buildDeleteByPkDocument(operationName, mutationField, entityField, keys, inputTypeName, select, connectionFieldsMap) {
412
413
  const entitySelections = select
413
414
  ? buildSelections(select, connectionFieldsMap, operationName)
414
415
  : [t.field({ name: 'id' })];
@@ -425,9 +426,20 @@ function buildDeleteByPkDocument(operationName, mutationField, entityField, id,
425
426
  ],
426
427
  }),
427
428
  variables: {
428
- input: {
429
- [idFieldName]: id,
430
- },
429
+ input: keys,
430
+ },
431
+ };
432
+ }
433
+ function buildJunctionRemoveDocument(operationName, mutationField, keys, inputTypeName) {
434
+ return {
435
+ document: buildInputMutationDocument({
436
+ operationName,
437
+ mutationField,
438
+ inputTypeName,
439
+ resultSelections: [t.field({ name: 'clientMutationId' })],
440
+ }),
441
+ variables: {
442
+ input: keys,
431
443
  },
432
444
  };
433
445
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/migrate-client",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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",
@@ -49,5 +49,5 @@
49
49
  "makage": "^0.1.12",
50
50
  "typescript": "^5.9.3"
51
51
  },
52
- "gitHead": "b0ff4ed0025af0e5df91d8e3535c347e4cde6438"
52
+ "gitHead": "bfc62d3bf8b8374dea67536cfea9d16cbe0575ac"
53
53
  }