@a_team/prisma 1.0.23 → 2.0.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.
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@a_team/prisma",
3
- "version": "1.0.23",
3
+ "version": "2.0.0",
4
4
  "keywords": [],
5
5
  "scripts": {
6
+ "build": "tsc",
6
7
  "generate": "npx prisma generate",
7
8
  "format": "npx prisma format",
8
- "postinstall": "npx generate"
9
+ "postinstall": "npx prisma generate"
9
10
  },
10
11
  "repository": {
11
12
  "type": "git",
@@ -13,6 +14,14 @@
13
14
  },
14
15
  "author": "A.Team",
15
16
  "license": "ISC",
17
+ "main": "dist/index.js",
18
+ "types": "dist/index.d.ts",
19
+ "exports": {
20
+ ".": "./dist/index.js"
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
16
25
  "devDependencies": {
17
26
  "@prisma/client": "^5.17.0",
18
27
  "prisma": "^5.17.0",
package/.env.sample DELETED
@@ -1,4 +0,0 @@
1
- # Copy this file to .env and fill in the values
2
-
3
- # for example: mongodb+srv://xxx.mongodb.net/ATeamsSandbox?retryWrites=true&w=majority&readPreference=secondary"
4
- MONGODB_URL=
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v20.15.1
@@ -1,24 +0,0 @@
1
- // npx ts-node playground/contract.ts
2
-
3
- import { PrismaClient } from "@prisma/client";
4
-
5
- const prisma = new PrismaClient();
6
-
7
- async function main() {
8
- const contract = await prisma.contract.findUnique({
9
- where: { sid: "66cf64d100e0d700127facdf" },
10
- include: {
11
- mission: true,
12
- },
13
- });
14
- console.log(contract);
15
- }
16
-
17
- main()
18
- .then(async () => {
19
- await prisma.$disconnect();
20
- })
21
- .catch(async (e) => {
22
- console.error(e);
23
- await prisma.$disconnect();
24
- });
@@ -1,21 +0,0 @@
1
- // npx ts-node playground/contracts.ts
2
-
3
- import { PrismaClient } from "@prisma/client";
4
-
5
- const prisma = new PrismaClient();
6
-
7
- async function main() {
8
- const contracts = await prisma.contract.findMany({
9
- take: 5,
10
- });
11
- console.log(contracts);
12
- }
13
-
14
- main()
15
- .then(async () => {
16
- await prisma.$disconnect();
17
- })
18
- .catch(async (e) => {
19
- console.error(e);
20
- await prisma.$disconnect();
21
- });
@@ -1,28 +0,0 @@
1
- // npx ts-node playground/missionSpec.ts
2
-
3
- import { PrismaClient } from "@prisma/client";
4
-
5
- const prisma = new PrismaClient();
6
-
7
- async function main() {
8
- const missionSpec = await prisma.missionSpec.findUnique({
9
- where: { id: "66b3856aa504b6860c86f3ac" },
10
- select: {
11
- account: {
12
- select: {
13
- company: true,
14
- },
15
- },
16
- },
17
- });
18
- console.log(missionSpec);
19
- }
20
-
21
- main()
22
- .then(async () => {
23
- await prisma.$disconnect();
24
- })
25
- .catch(async (e) => {
26
- console.error(e);
27
- await prisma.$disconnect();
28
- });
@@ -1,21 +0,0 @@
1
- // npx ts-node playground/missionSpecs.ts
2
-
3
- import { PrismaClient } from "@prisma/client";
4
-
5
- const prisma = new PrismaClient();
6
-
7
- async function main() {
8
- const missionSpec = await prisma.missionSpec.findMany({
9
- take: 5,
10
- });
11
- console.log(missionSpec);
12
- }
13
-
14
- main()
15
- .then(async () => {
16
- await prisma.$disconnect();
17
- })
18
- .catch(async (e) => {
19
- console.error(e);
20
- await prisma.$disconnect();
21
- });
@@ -1,31 +0,0 @@
1
- type AccountsMember {
2
- user String @db.ObjectId
3
- accessLevel String?
4
- invitedAt DateTime? @db.Date
5
- }
6
-
7
- type AccountsWorkspace {
8
- name String
9
- description String?
10
- logo String?
11
- website String?
12
- }
13
-
14
- model Account {
15
- id String @id @default(auto()) @map("_id") @db.ObjectId
16
- clientCompany String? @db.ObjectId
17
- clientCompanyModel ClientCompany? @relation(fields: [clientCompany], references: [id])
18
- companyId String @map("company") @db.ObjectId
19
- company Company @relation(fields: [companyId], references: [id])
20
- members AccountsMember[]
21
- workspace AccountsWorkspace?
22
- billingAccount String? @db.ObjectId
23
- createdAt DateTime? @db.Date
24
- updatedAt DateTime? @db.Date
25
- deletedAt DateTime? @db.Date
26
- migrations String[]
27
- missions Mission[]
28
- missionSpecs MissionSpec[]
29
-
30
- @@map("accounts")
31
- }
@@ -1,16 +0,0 @@
1
- model ClientCompany {
2
- id String @id @default(auto()) @map("_id") @db.ObjectId
3
- createdAt DateTime? @db.Date
4
- author String? @db.ObjectId
5
- name String
6
- slug String?
7
- product String?
8
- website String?
9
- size String?
10
- description String?
11
- logo String?
12
- accounts Account[]
13
- missionSpecs MissionSpec[]
14
-
15
- @@map("clientCompanies")
16
- }
@@ -1,9 +0,0 @@
1
- type LocalHourRange {
2
- endTime Int?
3
- startTime Int?
4
- }
5
-
6
- type TimezoneObject {
7
- name String
8
- utcOffset Int
9
- }
@@ -1,32 +0,0 @@
1
- type StructuredEnrichment {
2
- name String?
3
- countryCode String?
4
- city String?
5
- timezone String?
6
- industries String[] @db.ObjectId
7
- companyStage String?
8
- logoUrl String?
9
- employeeRange String?
10
- fundingRange String?
11
- revenueRange String?
12
- }
13
-
14
- type CompanyEnrichment {
15
- structured StructuredEnrichment?
16
- }
17
-
18
- model Company {
19
- id String @id @default(auto()) @map("_id") @db.ObjectId
20
- accounts Account[]
21
- name String
22
- url String
23
- enrichment CompanyEnrichment
24
- createdBy String? @db.ObjectId
25
- createdAt DateTime? @db.Date
26
- updatedAt DateTime? @db.Date
27
- requiresDeepEnrichment Boolean?
28
-
29
- @@index([name, createdAt], map: "name_1_createdAt_-1")
30
- @@index([url], map: "url_1")
31
- @@map("companiesV2")
32
- }
@@ -1,41 +0,0 @@
1
- model Contract {
2
- sid String @id @default(auto()) @map("_id") @db.ObjectId
3
- status ContractStatus
4
- type ContractType
5
- downloadURL String
6
- createdAt DateTime @db.Date
7
- updatedAt DateTime @updatedAt @db.Date
8
- parties ContractParty[]
9
- missionId String? @map("mission") @db.ObjectId
10
- mission Mission? @relation(fields: [missionId], references: [mid])
11
- role String? @db.ObjectId
12
- custom Boolean?
13
-
14
- @@index([type, missionId, role, createdAt], map: "type_1_mission_1_role_1_createdAt_-1")
15
- @@index([parties.user, status, createdAt], map: "parties.user_1_status_1_createdAt_1")
16
- @@map("contracts")
17
- }
18
-
19
- enum ContractStatus {
20
- Created
21
- Completed
22
- }
23
-
24
- enum ContractType {
25
- TermsOfService
26
- MissionAgreement
27
- }
28
-
29
- type ContractParty {
30
- type ContractPartyType
31
- user String? @db.ObjectId
32
- ip String?
33
- signedAt DateTime? @db.Date
34
- accountId String? @db.ObjectId
35
- stripeClient String?
36
- }
37
-
38
- enum ContractPartyType {
39
- BillingCustomer
40
- MissionRole
41
- }
@@ -1,173 +0,0 @@
1
- type MissionRoleAvailability {
2
- date DateTime? @db.Date
3
- scheduledEndDate DateTime? @db.Date
4
- weeklyHoursAvailable Float
5
- }
6
-
7
- type MissionRoleCustomQuestion {
8
- id String @map("_id") @db.ObjectId
9
- createdAt DateTime? @db.Date
10
- isRequired Boolean?
11
- isVisible Boolean
12
- text String
13
- updatedAt DateTime? @db.Date
14
- }
15
-
16
- type MissionRolePreferredSkill {
17
- rating Int?
18
- talentSkillId String @db.ObjectId
19
- }
20
-
21
- type MissionRoleRequiredSkill {
22
- rating Int?
23
- talentSkillId String @db.ObjectId
24
- }
25
-
26
- type MissionRoleUtcOffsetRange {
27
- from TimezoneObject?
28
- to TimezoneObject?
29
- }
30
-
31
- type MissionRoleVisibility {
32
- visibilityStatus String
33
- }
34
-
35
- type MissionRoleWorkingHours {
36
- id String? @map("_id") @db.ObjectId
37
- daily LocalHourRange[]
38
- name String?
39
- numberOfMinutesOverlap Int?
40
- utcDaylightHours LocalHourRange[]
41
- utcOffset Int?
42
- utcStandardHours LocalHourRange[]
43
- }
44
-
45
- type MissionRole {
46
- id String @map("_id") @db.ObjectId
47
- availability MissionRoleAvailability?
48
- builderRateMax Float?
49
- builderRateMin Float?
50
- category String @db.ObjectId
51
- createdAt DateTime? @db.Date
52
- customQuestions MissionRoleCustomQuestion[]
53
- description String?
54
- fullName String?
55
- hasPerformanceIssue Boolean?
56
- headline String?
57
- hourlyRate Float?
58
- monthlyRate Float?
59
- isBadPerformance Boolean?
60
- isLead Boolean?
61
- locations String[]
62
- lookingForApplications Boolean?
63
- marginVAT Float?
64
- preferredSkills MissionRolePreferredSkill[]
65
- requiredSkills MissionRoleRequiredSkill[]
66
- setAsScheduledToEndAt DateTime? @db.Date
67
- showRateRangeToBuilders Boolean?
68
- status String?
69
- updatedAt DateTime? @db.Date
70
- user String? @db.ObjectId
71
- userAssignedAt DateTime? @db.Date
72
- utcOffsetRange MissionRoleUtcOffsetRange?
73
- visibility MissionRoleVisibility?
74
- workingHours MissionRoleWorkingHours?
75
- builderMonthlyRateMin Float?
76
- builderMonthlyRateMax Float?
77
- collectMonthlyRate Boolean?
78
- isFullTimeRetainer Boolean?
79
- }
80
-
81
- type MissionsManager {
82
- id String @map("_id") @db.ObjectId
83
- accessMode String
84
- excludeFromInvoiceEmails Boolean?
85
- excludeFromTeamPulseEmails Boolean?
86
- }
87
-
88
- type MissionsAttachedLink {
89
- URL String
90
- title String
91
- }
92
-
93
- type MissionsCompanyRequest {
94
- companyName String
95
- description String
96
- email String
97
- fullName String
98
- notes String?
99
- phoneNumber String
100
- role String
101
- websiteURL String
102
- }
103
-
104
- type MissionsInvoicing {
105
- purchaseOrderNumber String?
106
- }
107
-
108
- type MissionsTesting {
109
- expiresAt DateTime @db.Date
110
- type String
111
- }
112
-
113
- type WorkingHoursSchema {
114
- name String
115
- utcOffset Int
116
- daily LocalHourRange[]
117
- utcStandardHours LocalHourRange[]
118
- utcDaylightHours LocalHourRange[]
119
- }
120
-
121
- model Mission {
122
- mid String @id @default(auto()) @map("_id") @db.ObjectId
123
- accountId String? @db.ObjectId
124
- accountModel Account? @relation(fields: [accountId], references: [id])
125
- applyStatus String?
126
- attachedLinks MissionsAttachedLink[]
127
- automatedStatusesDisabled Boolean?
128
- automaticInvoicingPeriod String?
129
- bdOwners String[]
130
- billingPeriod String?
131
- clientMargin Float?
132
- companyRequest MissionsCompanyRequest?
133
- companyStory String?
134
- createdAt DateTime? @db.Date
135
- creatorUser String? @db.ObjectId
136
- creatorModel User? @relation("creator", fields: [creatorUser], references: [id])
137
- description String?
138
- expectedDurationMonths Int?
139
- hidden Boolean?
140
- hubspotDealId String?
141
- internalDescription String?
142
- internalMission Boolean?
143
- invoiceEmailGreeting String?
144
- invoicing MissionsInvoicing?
145
- lastDeployedAt DateTime? @db.Date
146
- logoURL String?
147
- mainManagerUserId String?
148
- managers MissionsManager[]
149
- migrations String[]
150
- missionSpecId String @unique @db.ObjectId
151
- missionSpec MissionSpec @relation(fields: [missionSpecId], references: [id])
152
- owner String? @db.ObjectId
153
- ownerModel User? @relation("ownerModel", fields: [owner], references: [id])
154
- promotedTags String[]
155
- publishedAt DateTime? @db.Date
156
- publisherUser String? @db.ObjectId
157
- roles MissionRole[]
158
- rolesMargin Float?
159
- setAsScheduledToEndAt DateTime? @db.Date
160
- shortCompanyDescription String?
161
- skipContracts Boolean?
162
- status String
163
- talentIndustries String[]
164
- testing MissionsTesting?
165
- title String
166
- updatedAt DateTime? @db.Date
167
- videoURL String?
168
- website String?
169
- contracts Contract[]
170
-
171
- @@unique([roles.id], map: "roles._id_1")
172
- @@map("missions")
173
- }
@@ -1,107 +0,0 @@
1
- model MissionSpec {
2
- id String @id @default(auto()) @map("_id") @db.ObjectId
3
- account Account? @relation(fields: [accountId], references: [id])
4
- accountId String? @db.ObjectId
5
- attachedLinks AttachedLink[]
6
- author User? @relation(fields: [authorId], references: [id], name: "author")
7
- authorId String? @map("author") @db.ObjectId
8
- clientCompany ClientCompany? @relation(fields: [clientCompanyId], references: [id])
9
- clientCompanyId String? @map("clientCompany") @db.ObjectId
10
- clientConfirmed Boolean?
11
- collaborators String[] @db.ObjectId
12
- companyDescription String?
13
- createdAt DateTime? @db.Date
14
- deletedAt DateTime? @db.Date
15
- description String?
16
- icon String?
17
- lastModifier User? @relation(fields: [lastModifierId], references: [id], name: "lastModifier")
18
- lastModifierId String? @map("lastModifier") @db.ObjectId
19
- logo String?
20
- metadata Metadata?
21
- mission Mission?
22
- platformId String? @db.ObjectId
23
- roles MissionSpecRole[]
24
- startDate DateTime? @db.Date
25
- status MissionSpecStatus
26
- statusChangedAt StatusTime?
27
- title String
28
- updatedAt DateTime? @db.Date
29
- v Int @map("__v")
30
- videoURL String?
31
- workingHours WorkingHours?
32
- workingHoursNumberOfMinutesOverlap Int?
33
-
34
- @@index([accountId], map: "accountId_1")
35
- @@index([authorId, deletedAt, platformId, createdAt], map: "author_1_deletedAt_1_platformId_1_createdAt_1")
36
- @@index([accountId, deletedAt, platformId, createdAt], map: "accountId_1_deletedAt_1_platformId_1_createdAt_1")
37
- @@map("missionSpecs")
38
- }
39
-
40
- type MissionSpecRole {
41
- id String @map("_id") @db.ObjectId
42
- builderRateMax Float? @db.Double
43
- builderRateMin Float? @db.Double
44
- margin Float? @db.Double
45
- category String? @db.ObjectId
46
- createdAt DateTime? @default(now()) @db.Date
47
- createdBy String? @db.ObjectId
48
- customQuestions ClientRoleQuestion[]
49
- description String?
50
- isLead Boolean @default(false)
51
- tags String[]
52
- locations String[]
53
- minimumCommitment Int?
54
- preferredSkills String[] @db.ObjectId
55
- requiredSkills String[] @db.ObjectId
56
- typicalHourlyRate Int?
57
- user String? @db.ObjectId
58
- }
59
-
60
- type AttachedLink {
61
- URL String
62
- title String
63
- }
64
-
65
- type Metadata {
66
- lastGeneratedAiDescriptionAt DateTime? @db.Date
67
- lastGeneratedAiDescription String?
68
- generatedFromGongCallAt DateTime? @db.Date
69
- landbotCustomerId String?
70
- bridgeType String?
71
- }
72
-
73
- enum MissionSpecStatus {
74
- spec
75
- formation
76
- proposal
77
- confirmed
78
- declined
79
- published
80
- }
81
-
82
- type StatusTime {
83
- spec DateTime? @db.Date
84
- formation DateTime? @db.Date
85
- proposal DateTime? @db.Date
86
- confirmed DateTime? @db.Date
87
- declined DateTime? @db.Date
88
- published DateTime? @db.Date
89
- }
90
-
91
- type WorkingHours {
92
- name String
93
- utcOffset Int
94
- daily LocalHourRange[]
95
- utcStandardHours LocalHourRange[]
96
- utcDaylightHours LocalHourRange[]
97
- numberOfMinutesOverlap Int?
98
- }
99
-
100
- type ClientRoleQuestion {
101
- id String? @map("_id") @db.ObjectId
102
- text String
103
- isRequired Boolean?
104
- isVisible Boolean?
105
- createdAt DateTime @db.Date
106
- updatedAt DateTime? @db.Date
107
- }
@@ -1,10 +0,0 @@
1
- model RoleCategory {
2
- id String @id @default(auto()) @map("_id") @db.ObjectId
3
- anchors String[]
4
- title String @unique(map: "title_1")
5
- deletedAt DateTime? @db.Date
6
- group String?
7
- talentCategoryIds String[]
8
-
9
- @@map("roleCategories")
10
- }
@@ -1,10 +0,0 @@
1
- datasource db {
2
- provider = "mongodb"
3
- url = env("MONGODB_URL")
4
- }
5
-
6
- generator client {
7
- provider = "prisma-client-js"
8
- binaryTargets = ["native", "darwin"]
9
- previewFeatures = ["prismaSchemaFolder"]
10
- }
@@ -1,13 +0,0 @@
1
- model TalentCategory {
2
- id String @id @default(auto()) @map("_id") @db.ObjectId
3
- textId String
4
- name String
5
- nodeType String
6
- parentTalentCategoryIds String[]
7
- aliases String[]
8
- isProgrammingLanguage Boolean?
9
- isVettingEligible Boolean?
10
- deletedAt DateTime? @db.Date
11
-
12
- @@map("talentCategories")
13
- }
@@ -1,8 +0,0 @@
1
- model TalentIndustry {
2
- id String @id @default(auto()) @map("_id") @db.ObjectId
3
- description String
4
- name String
5
- textId String @unique(map: "textId_1")
6
-
7
- @@map("talentIndustries")
8
- }
@@ -1,20 +0,0 @@
1
- model User {
2
- id String @id @default(auto()) @map("_id") @db.ObjectId
3
- firstName String?
4
- lastName String?
5
- username String? @unique(map: "username_1")
6
- email String? @unique(map: "email_1")
7
- isAdmin Boolean @default(false)
8
- createdMissionsModels Mission[] @relation("creator")
9
- ownedMissionsModels Mission[] @relation("ownerModel")
10
- type String
11
- pictureURL String?
12
- status String
13
- createdAt DateTime @db.Date
14
- titles String[]
15
- scrubbed String?
16
- authoredMissionSpecs MissionSpec[] @relation("author")
17
- modifiedMissionSpecs MissionSpec[] @relation("lastModifier")
18
-
19
- @@map("users")
20
- }
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2016",
4
- "module": "commonjs",
5
- "esModuleInterop": true,
6
- "forceConsistentCasingInFileNames": true,
7
- "strict": true
8
- }
9
- }