@m1212e/rumble 0.20.0 → 0.21.2

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.d.mts CHANGED
@@ -4162,11 +4162,15 @@ type ExtractPathParamsWithPattern<TPath extends string> = Pipe<TPath, [Strings.S
4162
4162
  //#endregion
4163
4163
  //#region lib/types/rumbleInput.d.ts
4164
4164
  type CustomRumblePothosConfig = Omit<ConstructorParameters<typeof SchemaBuilder>[0], "smartSubscriptions" | "drizzle">;
4165
- type RumbleInput<UserContext extends Record<string, any>, DB extends DrizzleInstance, RequestEvent extends Record<string, any>, Action extends string, PothosConfig extends CustomRumblePothosConfig> = {
4165
+ type RumbleInput<UserContext extends Record<string, any>, DB extends DrizzleInstance, RequestEvent extends Record<string, any>, Action extends string, PothosConfig extends CustomRumblePothosConfig, Schema extends Record<string, any> = Record<string, any>> = {
4166
4166
  /**
4167
4167
  * Your drizzle database instance
4168
4168
  */
4169
4169
  db: DB;
4170
+ /**
4171
+ * The drizzle schema object (the same one passed to `defineRelations`).
4172
+ */
4173
+ schema: Schema;
4170
4174
  /**
4171
4175
  * A function for providing context for each request based on the incoming HTTP Request.
4172
4176
  * The type of the parameter equals the HTTPRequest type of your chosen server.
@@ -4243,7 +4247,9 @@ type RumbleInput<UserContext extends Record<string, any>, DB extends DrizzleInst
4243
4247
  };
4244
4248
  //#endregion
4245
4249
  //#region lib/rumble.d.ts
4246
- declare const rumble: <UserContext extends Record<string, any>, DB extends DrizzleInstance, RequestEvent extends Record<string, any>, PothosConfig extends CustomRumblePothosConfig, Action extends string = "read" | "update" | "delete">(rumbleInput: RumbleInput<UserContext, DB, RequestEvent, Action, PothosConfig>) => {
4250
+ declare const rumble: <UserContext extends Record<string, any>, DB extends DrizzleInstance, RequestEvent extends Record<string, any>, PothosConfig extends CustomRumblePothosConfig, Schema extends Record<string, any>, Action extends string = "read" | "update" | "delete">(rumbleInput: RumbleInput<UserContext, DB, RequestEvent, Action, PothosConfig> & {
4251
+ schema: Schema;
4252
+ }) => {
4247
4253
  /**
4248
4254
  * The ability builder. Use it to declare whats allowed for each entity in your DB.
4249
4255
  *
@@ -4720,17 +4726,19 @@ declare const rumble: <UserContext extends Record<string, any>, DB extends Drizz
4720
4726
  * The other helpers use this helper internally so in most cases you do not have to
4721
4727
  * call this helper directly, unless you need the reference to an enum type
4722
4728
  */
4723
- enum_: <EnumColumn extends import("drizzle-orm/pg-core").PgEnumColumn<any>, RefName_2 extends string>({
4724
- enum: enumObject,
4725
- enumColumn,
4726
- refName
4727
- }: {
4729
+ enum_: <TsName extends keyof { [K in keyof Schema as Schema[K] extends import("drizzle-orm/pg-core").PgEnum<any> | import("drizzle-orm/pg-core").PgEnumObject<any> ? K : never]: Schema[K] }, EnumColumn extends import("drizzle-orm").Column, RefName_2 extends string>(args: {
4728
4730
  refName?: RefName_2 | undefined;
4729
4731
  } & ({
4730
- enum: import("drizzle-orm/pg-core").PgEnum<any>;
4732
+ enum: import("drizzle-orm/pg-core").PgEnum<any> | import("drizzle-orm/pg-core").PgEnumObject<any>;
4733
+ tsName?: never;
4734
+ enumColumn?: never;
4735
+ } | {
4736
+ tsName: TsName;
4737
+ enum?: never;
4731
4738
  enumColumn?: never;
4732
4739
  } | {
4733
4740
  enumColumn: EnumColumn;
4741
+ tsName?: never;
4734
4742
  enum?: never;
4735
4743
  })) => PothosSchemaTypes.EnumRef<PothosSchemaTypes.ExtendDefaultTypes<{
4736
4744
  Context: Awaited<UserContext & {