@the-inkwell/shared 0.1.30 → 0.1.31

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-inkwell/shared",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "Shared code for Inkwell",
5
5
  "license": "ISC",
6
6
  "author": "Inkwell (Rob Yedlin)",
@@ -1,3 +1,4 @@
1
+ import { ListResponse } from '../../shared'
1
2
  import { AdminPerson } from '../persons'
2
3
 
3
4
  export type AdminCandidacy = {
@@ -27,6 +28,10 @@ export type AdminCandidacy = {
27
28
  updatedAt: string
28
29
  }
29
30
 
31
+ export type AdminCandidacyResponse = AdminCandidacy
32
+
33
+ export type AdminCandidacyListResponse = ListResponse<AdminCandidacy>
34
+
30
35
  /*
31
36
  model Candidacy {
32
37
  id String @id @default(uuid())
@@ -1,4 +1,4 @@
1
- import { ListResponse } from '../../shared'
1
+ import { ListRequest, ListResponse } from '../../shared'
2
2
  import { AdminCandidacy } from '../candidacies'
3
3
 
4
4
  // main model
@@ -81,14 +81,9 @@ export type AdminPersonRequestParams = Pick<AdminPerson, 'id'>
81
81
 
82
82
  // list
83
83
 
84
- export type AdminPersonsListRequest = {
85
- take: number
86
- skip: number
87
- orderBy: any // TODO add this
88
- where: any // TODO add this
89
- }
84
+ export type AdminPersonListRequest = ListRequest
90
85
 
91
- export type AdminPersonsListResponse = ListResponse<AdminPerson>
86
+ export type AdminPersonListResponse = ListResponse<AdminPerson>
92
87
 
93
88
  // create
94
89
 
@@ -2,3 +2,14 @@ export type ListResponse<T> = {
2
2
  count: number
3
3
  results: T[]
4
4
  }
5
+
6
+ export type ListRequest<
7
+ TAdditional = any,
8
+ TSort = any,
9
+ TFilter = any
10
+ > = TAdditional & {
11
+ take: number
12
+ skip: number
13
+ sort: TSort
14
+ filter: TFilter
15
+ }