-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from js-items/develop
fix: added new enveloped and paginated interfaces
- Loading branch information
Showing
10 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// <reference types="node" /> | ||
import { OutgoingHttpHeaders } from "http"; | ||
export interface EnvelopedResponse<T> { | ||
readonly status: number; | ||
readonly body: T; | ||
readonly headers: OutgoingHttpHeaders; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Item from './Item'; | ||
export interface PaginationMetadata { | ||
readonly hasAfter: boolean; | ||
readonly hasBefore: boolean; | ||
readonly after: string | null; | ||
readonly before: string | null; | ||
readonly totalCount: number; | ||
} | ||
export interface PaginatedResponse<I extends Item> { | ||
readonly data: I[]; | ||
readonly pagination: PaginationMetadata; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { OutgoingHttpHeaders } from "http"; | ||
|
||
export interface EnvelopedResponse<T> { | ||
readonly status: number; | ||
readonly body: T; | ||
readonly headers: OutgoingHttpHeaders; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Item from './Item'; | ||
|
||
export interface PaginationMetadata { | ||
readonly hasAfter: boolean; | ||
readonly hasBefore: boolean; | ||
readonly after: string | null; | ||
readonly before: string | null; | ||
readonly totalCount: number; | ||
} | ||
export interface PaginatedResponse<I extends Item> { | ||
readonly data: I[]; | ||
readonly pagination: PaginationMetadata; | ||
} |