@m1212e/rumble 0.16.27 → 0.16.28

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/out/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as lazy } from "./lazy-CoMVcY4X.mjs";
2
- import { t as generateFromSchema } from "./generate-PDRNfY6V.mjs";
1
+ import { t as lazy } from "./lazy-BgeBy3-B.mjs";
2
+ import { t as generateFromSchema } from "./generate-B6JGM5pc.mjs";
3
3
  import { GraphQLError } from "graphql";
4
4
  import { EnvelopArmorPlugin } from "@escape.tech/graphql-armor";
5
5
  import { useDisableIntrospection } from "@graphql-yoga/plugin-disable-introspection";
@@ -19,7 +19,6 @@ import DrizzlePlugin from "@pothos/plugin-drizzle";
19
19
  import SmartSubscriptionsPlugin, { subscribeOptionsFromIterator } from "@pothos/plugin-smart-subscriptions";
20
20
  import TracingPlugin, { isRootField } from "@pothos/plugin-tracing";
21
21
  import { DateResolver, DateTimeISOResolver, JSONResolver } from "graphql-scalars";
22
-
23
22
  //#region lib/types/rumbleError.ts
24
23
  /**
25
24
  * An error that gets raised by rumble whenever something does not go according to plan.
@@ -37,7 +36,6 @@ var RumbleError = class extends Error {
37
36
  * E.g. the assert helpers issue these.
38
37
  */
39
38
  var RumbleErrorSafe = class extends GraphQLError {};
40
-
41
39
  //#endregion
42
40
  //#region lib/helpers/asserts.ts
43
41
  /**
@@ -118,7 +116,6 @@ const assertFirstEntryExists = (value) => {
118
116
  if (!v) throw new RumbleErrorSafe("Value not found but required (firstEntry)");
119
117
  return v;
120
118
  };
121
-
122
119
  //#endregion
123
120
  //#region lib/helpers/mapNullFieldsToUndefined.ts
124
121
  /**
@@ -182,11 +179,9 @@ where: { id: user.id },
182
179
  function mapNullFieldsToUndefined(obj) {
183
180
  return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, value === null ? void 0 : value]));
184
181
  }
185
-
186
182
  //#endregion
187
183
  //#region package.json
188
- var version = "0.16.27";
189
-
184
+ var version = "0.16.28";
190
185
  //#endregion
191
186
  //#region lib/helpers/mergeFilters.ts
192
187
  function mergeFilters(filterA, filterB) {
@@ -203,7 +198,6 @@ function mergeFilters(filterA, filterB) {
203
198
  with: filterA?.with || filterB?.with ? toMerged(filterA?.with ?? {}, filterB?.with ?? {}) : void 0
204
199
  };
205
200
  }
206
-
207
201
  //#endregion
208
202
  //#region lib/helpers/sqlTypes/types.ts
209
203
  const intLikeSQLTypeStrings = [
@@ -268,7 +262,6 @@ function isJSONLikeSQLTypeString(sqlType) {
268
262
  ...jsonLikeSQLTypeStrings
269
263
  ];
270
264
  const UnknownTypeRumbleError = (sqlType, additionalInfo) => new RumbleError(`RumbleError: Unknown SQL type '${sqlType}'. Please open an issue (https://github.com/m1212e/rumble/issues) so it can be added. (${additionalInfo})`);
271
-
272
265
  //#endregion
273
266
  //#region lib/helpers/sqlTypes/distinctValuesFromSQLType.ts
274
267
  function createDistinctValuesFromSQLType(sqlType) {
@@ -306,7 +299,6 @@ function createDistinctValuesFromSQLType(sqlType) {
306
299
  };
307
300
  throw UnknownTypeRumbleError(sqlType, "Distinct");
308
301
  }
309
-
310
302
  //#endregion
311
303
  //#region lib/helpers/tableHelpers.ts
312
304
  const drizzleNameSymbol = Symbol.for("drizzle:Name");
@@ -331,7 +323,6 @@ function tableHelper({ db, table }) {
331
323
  fullSchema
332
324
  };
333
325
  }
334
-
335
326
  //#endregion
336
327
  //#region lib/abilityBuilder.ts
337
328
  function isDynamicQueryFilter(filter) {
@@ -547,7 +538,6 @@ const createAbilityBuilder = ({ db, actions, defaultLimit, otel }) => {
547
538
  }
548
539
  };
549
540
  };
550
-
551
541
  //#endregion
552
542
  //#region lib/args/orderArg.ts
553
543
  const makeDefaultName$1 = (dbName) => `${capitalize(toCamelCase(dbName.toString()))}OrderInputArgument`;
@@ -594,7 +584,6 @@ const createOrderArgImplementer = ({ db, schemaBuilder }) => {
594
584
  };
595
585
  return orderArgImplementer;
596
586
  };
597
-
598
587
  //#endregion
599
588
  //#region lib/enum.ts
600
589
  /**
@@ -632,7 +621,6 @@ Please ensure that you use the enum at least once as a column of a table!`);
632
621
  };
633
622
  return enumImplementer;
634
623
  };
635
-
636
624
  //#endregion
637
625
  //#region lib/helpers/sqlTypes/mapSQLTypeToTSType.ts
638
626
  function mapSQLTypeToGraphQLType({ sqlType, fieldName }) {
@@ -649,7 +637,6 @@ function mapSQLTypeToGraphQLType({ sqlType, fieldName }) {
649
637
  if (ret !== void 0) return ret;
650
638
  throw UnknownTypeRumbleError(sqlType, "SQL to GQL");
651
639
  }
652
-
653
640
  //#endregion
654
641
  //#region lib/args/whereArg.ts
655
642
  const makeDefaultName = (dbName) => `${capitalize(toCamelCase(dbName.toString()))}WhereInputArgument`;
@@ -718,7 +705,6 @@ const createWhereArgImplementer = ({ db, schemaBuilder, enumImplementer }) => {
718
705
  };
719
706
  return whereArgImplementer;
720
707
  };
721
-
722
708
  //#endregion
723
709
  //#region lib/client/client.ts
724
710
  const clientCreatorImplementer = ({ builtSchema }) => {
@@ -742,7 +728,6 @@ const clientCreatorImplementer = ({ builtSchema }) => {
742
728
  };
743
729
  return clientCreator;
744
730
  };
745
-
746
731
  //#endregion
747
732
  //#region lib/context.ts
748
733
  const createContextFunction = ({ context: makeUserContext, abilityBuilder }) => {
@@ -755,7 +740,6 @@ const createContextFunction = ({ context: makeUserContext, abilityBuilder }) =>
755
740
  };
756
741
  };
757
742
  };
758
-
759
743
  //#endregion
760
744
  //#region lib/helpers/protoMapper.ts
761
745
  function deepSetProto(obj, proto = Object.prototype, seen = /* @__PURE__ */ new WeakSet()) {
@@ -765,7 +749,6 @@ function deepSetProto(obj, proto = Object.prototype, seen = /* @__PURE__ */ new
765
749
  Object.setPrototypeOf(obj, proto);
766
750
  for (const key of Object.keys(obj)) deepSetProto(obj[key], proto, seen);
767
751
  }
768
-
769
752
  //#endregion
770
753
  //#region lib/countQuery.ts
771
754
  const createCountQueryImplementer = ({ db, schemaBuilder, whereArgImplementer, makePubSubInstance }) => {
@@ -805,7 +788,6 @@ const createCountQueryImplementer = ({ db, schemaBuilder, whereArgImplementer, m
805
788
  });
806
789
  };
807
790
  };
808
-
809
791
  //#endregion
810
792
  //#region lib/helpers/sofaOpenAPIWebhookDocs.ts
811
793
  const sofaOpenAPIWebhookDocs = {
@@ -891,7 +873,6 @@ const sofaOpenAPIWebhookDocs = {
891
873
  }
892
874
  } }
893
875
  };
894
-
895
876
  //#endregion
896
877
  //#region lib/helpers/sqlTypes/mapDrizzleTypeToGraphQlType.ts
897
878
  function buildPothosResponseTypeFromGraphQLType({ builder, sqlType, fieldName, nullable }) {
@@ -923,7 +904,6 @@ function buildPothosResponseTypeFromGraphQLType({ builder, sqlType, fieldName, n
923
904
  default: throw new RumbleError(`Unsupported object type ${gqlType} for column ${fieldName}`);
924
905
  }
925
906
  }
926
-
927
907
  //#endregion
928
908
  //#region lib/helpers/determineDialectFromSchema.ts
929
909
  function determineDBDialectFromSchema(schema) {
@@ -942,7 +922,6 @@ function determineDBDialectFromSchema(schema) {
942
922
  function isPostgresDB(db) {
943
923
  return determineDBDialectFromSchema(db._.relations) === "postgres";
944
924
  }
945
-
946
925
  //#endregion
947
926
  //#region lib/search.ts
948
927
  async function initSearchIfApplicable(input) {
@@ -988,7 +967,6 @@ function adjustQueryArgsForSearch({ search, args, tableSchema, abilities }) {
988
967
  }), sql.raw(" OR "))})` }] };
989
968
  }
990
969
  }
991
-
992
970
  //#endregion
993
971
  //#region lib/object.ts
994
972
  const isProbablyAConfigObject = (t) => {
@@ -1162,7 +1140,6 @@ const createObjectImplementer = ({ db, search, schemaBuilder, makePubSubInstance
1162
1140
  });
1163
1141
  };
1164
1142
  };
1165
-
1166
1143
  //#endregion
1167
1144
  //#region lib/pubsub.ts
1168
1145
  const SUBSCRIPTION_NOTIFIER_RUMBLE_PREFIX = "RUMBLE_SUBSCRIPTION_NOTIFICATION";
@@ -1227,7 +1204,6 @@ const createPubSubInstance = ({ subscriptions }) => {
1227
1204
  makePubSubInstance
1228
1205
  };
1229
1206
  };
1230
-
1231
1207
  //#endregion
1232
1208
  //#region lib/query.ts
1233
1209
  const createQueryImplementer = ({ db, schemaBuilder, search, whereArgImplementer, orderArgImplementer, makePubSubInstance }) => {
@@ -1312,7 +1288,6 @@ const createQueryImplementer = ({ db, schemaBuilder, search, whereArgImplementer
1312
1288
  });
1313
1289
  };
1314
1290
  };
1315
-
1316
1291
  //#endregion
1317
1292
  //#region lib/args/whereArgsImplementer.ts
1318
1293
  function implementDefaultWhereInputArgs(schemaBuilder) {
@@ -1405,11 +1380,9 @@ function implementDefaultWhereInputArgs(schemaBuilder) {
1405
1380
  NOT: t.field({ type: DateWhereInputArgument })
1406
1381
  }) });
1407
1382
  }
1408
-
1409
1383
  //#endregion
1410
1384
  //#region lib/runtimeFiltersPlugin/filterTypes.ts
1411
1385
  const pluginName = "RuntimeFiltersPlugin";
1412
-
1413
1386
  //#endregion
1414
1387
  //#region lib/runtimeFiltersPlugin/runtimeFiltersPlugin.ts
1415
1388
  const applyFiltersKey = "applyFilters";
@@ -1475,7 +1448,6 @@ function registerRuntimeFiltersPlugin() {
1475
1448
  registered = true;
1476
1449
  }
1477
1450
  }
1478
-
1479
1451
  //#endregion
1480
1452
  //#region lib/schemaBuilder.ts
1481
1453
  const createSchemaBuilder = ({ db, disableDefaultObjects, pubsub, pothosConfig, otel }) => {
@@ -1519,7 +1491,6 @@ const createSchemaBuilder = ({ db, disableDefaultObjects, pubsub, pothosConfig,
1519
1491
  if (!disableDefaultObjects?.mutation) schemaBuilder.mutationType({});
1520
1492
  return { schemaBuilder };
1521
1493
  };
1522
-
1523
1494
  //#endregion
1524
1495
  //#region lib/rumble.ts
1525
1496
  const rumble = (rumbleInput) => {
@@ -1678,7 +1649,7 @@ export const db = drizzle(
1678
1649
  countQuery
1679
1650
  };
1680
1651
  };
1681
-
1682
1652
  //#endregion
1683
1653
  export { RumbleError, RumbleErrorSafe, assertFindFirstExists, assertFirstEntryExists, mapNullFieldsToUndefined, rumble };
1654
+
1684
1655
  //# sourceMappingURL=index.mjs.map