Skip to content

Commit

Permalink
refactor: switch to prisma-extended-models
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Jun 6, 2024
1 parent fc9a6fa commit 027f5b9
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 26 deletions.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"external": [
"@prisma/client",
"graphql",
"@getcronit/pylon",
"uglify-js"
]
},
Expand All @@ -22,7 +21,7 @@
"@getcronit/pylon-cli": "*",
"@getcronit/pylon-server": "*",
"@devoxa/prisma-relay-cursor-connection": "^3.1.0",
"@netsnek/prisma-repository": "^0.0.40",
"@getcronit/prisma-extended-models": "^0.0.42",
"@prisma/client": "^5.2.0",
"deep-object-diff": "^1.1.9",
"dotenv": "^16.0.3",
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import * as oidcGoogle from "./services/oauth/google";

dotenv.config();

// Method to generate a random string

export const service = defineService(
{
Query: {
Expand Down
2 changes: 1 addition & 1 deletion src/repository/.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type {$Enums} from "@prisma/client";

import { Prisma } from "@prisma/client";
import { Repository, NullableGetFunction, NullablePaginateFunction } from "@netsnek/prisma-repository";
import { Repository, NullableGetFunction, NullablePaginateFunction } from "@getcronit/prisma-extended-models";

import {Organization as OrganizationModel} from "./models/Organization";
import {OAuthApp as OAuthAppModel} from "./models/OAuthApp";
Expand Down
2 changes: 1 addition & 1 deletion src/repository/models/Email.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectManager } from "@netsnek/prisma-repository";
import { ObjectManager } from "@getcronit/prisma-extended-models";

import { EmailRepository } from "../.generated";
import { client } from "../client";
Expand Down
15 changes: 8 additions & 7 deletions src/repository/models/EmailEnvelope.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { ObjectManager } from "@netsnek/prisma-repository";

import {client} from "../client";
import {EmailEnvelopeRepository} from "../.generated";
import { ObjectManager } from "@getcronit/prisma-extended-models";

import { client } from "../client";
import { EmailEnvelopeRepository } from "../.generated";

export class EmailEnvelope extends EmailEnvelopeRepository {

static objects = new ObjectManager<"EmailEnvelope", typeof EmailEnvelope>(client.emailEnvelope,EmailEnvelope);
static objects = new ObjectManager<"EmailEnvelope", typeof EmailEnvelope>(
client.emailEnvelope,
EmailEnvelope
);

// Custom logic here...
}
}
2 changes: 1 addition & 1 deletion src/repository/models/EmailTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectManager } from "@netsnek/prisma-repository";
import { ObjectManager } from "@getcronit/prisma-extended-models";
import { ServiceError, requireAuth } from "@getcronit/pylon";

import { client } from "../client";
Expand Down
2 changes: 1 addition & 1 deletion src/repository/models/OAuthApp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectManager } from "@netsnek/prisma-repository";
import { ObjectManager } from "@getcronit/prisma-extended-models";

import { client } from "../client";
import { OAuthAppRepository } from "../.generated";
Expand Down
2 changes: 1 addition & 1 deletion src/repository/models/OAuthConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectManager } from "@netsnek/prisma-repository";
import { ObjectManager } from "@getcronit/prisma-extended-models";

import * as oidcGoogle from "../../services/oauth/google";
import * as oidcAzure from "../../services/oauth/azure";
Expand Down
2 changes: 1 addition & 1 deletion src/repository/models/Organization.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectManager } from "@netsnek/prisma-repository";
import { ObjectManager } from "@getcronit/prisma-extended-models";

import { OrganizationRepository } from "../.generated";
import { client } from "../client";
Expand Down
2 changes: 1 addition & 1 deletion src/repository/models/SMTPConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectManager } from "@netsnek/prisma-repository";
import { ObjectManager } from "@getcronit/prisma-extended-models";

import { client } from "../client";
import { SMTPConfigRepository } from "../.generated";
Expand Down
2 changes: 1 addition & 1 deletion src/repository/models/User.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectManager } from "@netsnek/prisma-repository";
import { ObjectManager } from "@getcronit/prisma-extended-models";
import { requireAuth } from "@getcronit/pylon";

import { client } from "../client";
Expand Down
15 changes: 8 additions & 7 deletions src/repository/models/VariableDefinition.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { ObjectManager } from "@netsnek/prisma-repository";

import {client} from "../client";
import {VariableDefinitionRepository} from "../.generated";
import { ObjectManager } from "@getcronit/prisma-extended-models";

import { client } from "../client";
import { VariableDefinitionRepository } from "../.generated";

export class VariableDefinition extends VariableDefinitionRepository {

static objects = new ObjectManager<"VariableDefinition", typeof VariableDefinition>(client.variableDefinition,VariableDefinition);
static objects = new ObjectManager<
"VariableDefinition",
typeof VariableDefinition
>(client.variableDefinition, VariableDefinition);

// Custom logic here...
}
}

0 comments on commit 027f5b9

Please sign in to comment.