From 9fca3f2da837d48e34bf9324f1ce65775a608515 Mon Sep 17 00:00:00 2001 From: kube-js Date: Sun, 1 Sep 2019 21:37:54 +0100 Subject: [PATCH] fix: added new enveloped and paginated interfaces --- dist/interfaces/EnvelopedResponse.d.ts | 7 +++++++ dist/interfaces/EnvelopedResponse.js | 3 +++ dist/interfaces/EnvelopedResponse.js.map | 1 + dist/interfaces/PaginatedResults.d.ts | 12 ++++++++++++ dist/interfaces/PaginatedResults.js | 3 +++ dist/interfaces/PaginatedResults.js.map | 1 + dist/interfaces/cursorResult.d.ts | 1 + src/interfaces/CursorResult.ts | 1 + src/interfaces/EnvelopedResponse.ts | 7 +++++++ src/interfaces/PaginatedResults.ts | 13 +++++++++++++ 10 files changed, 49 insertions(+) create mode 100644 dist/interfaces/EnvelopedResponse.d.ts create mode 100644 dist/interfaces/EnvelopedResponse.js create mode 100644 dist/interfaces/EnvelopedResponse.js.map create mode 100644 dist/interfaces/PaginatedResults.d.ts create mode 100644 dist/interfaces/PaginatedResults.js create mode 100644 dist/interfaces/PaginatedResults.js.map create mode 100644 src/interfaces/EnvelopedResponse.ts create mode 100644 src/interfaces/PaginatedResults.ts diff --git a/dist/interfaces/EnvelopedResponse.d.ts b/dist/interfaces/EnvelopedResponse.d.ts new file mode 100644 index 0000000..e182bac --- /dev/null +++ b/dist/interfaces/EnvelopedResponse.d.ts @@ -0,0 +1,7 @@ +/// +import { OutgoingHttpHeaders } from "http"; +export interface EnvelopedResponse { + readonly status: number; + readonly body: T; + readonly headers: OutgoingHttpHeaders; +} diff --git a/dist/interfaces/EnvelopedResponse.js b/dist/interfaces/EnvelopedResponse.js new file mode 100644 index 0000000..8fa798f --- /dev/null +++ b/dist/interfaces/EnvelopedResponse.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=EnvelopedResponse.js.map \ No newline at end of file diff --git a/dist/interfaces/EnvelopedResponse.js.map b/dist/interfaces/EnvelopedResponse.js.map new file mode 100644 index 0000000..55ae436 --- /dev/null +++ b/dist/interfaces/EnvelopedResponse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"EnvelopedResponse.js","sourceRoot":"","sources":["../../src/interfaces/EnvelopedResponse.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/interfaces/PaginatedResults.d.ts b/dist/interfaces/PaginatedResults.d.ts new file mode 100644 index 0000000..8a37183 --- /dev/null +++ b/dist/interfaces/PaginatedResults.d.ts @@ -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 { + readonly data: I[]; + readonly pagination: PaginationMetadata; +} diff --git a/dist/interfaces/PaginatedResults.js b/dist/interfaces/PaginatedResults.js new file mode 100644 index 0000000..823b270 --- /dev/null +++ b/dist/interfaces/PaginatedResults.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=PaginatedResults.js.map \ No newline at end of file diff --git a/dist/interfaces/PaginatedResults.js.map b/dist/interfaces/PaginatedResults.js.map new file mode 100644 index 0000000..3fad7ab --- /dev/null +++ b/dist/interfaces/PaginatedResults.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PaginatedResults.js","sourceRoot":"","sources":["../../src/interfaces/PaginatedResults.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/interfaces/cursorResult.d.ts b/dist/interfaces/cursorResult.d.ts index dc56c32..bc70daa 100644 --- a/dist/interfaces/cursorResult.d.ts +++ b/dist/interfaces/cursorResult.d.ts @@ -4,4 +4,5 @@ export default interface CursorResult { readonly after: Cursor; readonly hasBefore: boolean; readonly hasAfter: boolean; + readonly totalCount?: number; } diff --git a/src/interfaces/CursorResult.ts b/src/interfaces/CursorResult.ts index 432b69e..778e65a 100644 --- a/src/interfaces/CursorResult.ts +++ b/src/interfaces/CursorResult.ts @@ -5,4 +5,5 @@ export default interface CursorResult { readonly after: Cursor; readonly hasBefore: boolean; readonly hasAfter: boolean; + readonly totalCount?: number; } \ No newline at end of file diff --git a/src/interfaces/EnvelopedResponse.ts b/src/interfaces/EnvelopedResponse.ts new file mode 100644 index 0000000..edbd8a0 --- /dev/null +++ b/src/interfaces/EnvelopedResponse.ts @@ -0,0 +1,7 @@ +import { OutgoingHttpHeaders } from "http"; + +export interface EnvelopedResponse { + readonly status: number; + readonly body: T; + readonly headers: OutgoingHttpHeaders; +} \ No newline at end of file diff --git a/src/interfaces/PaginatedResults.ts b/src/interfaces/PaginatedResults.ts new file mode 100644 index 0000000..b000c86 --- /dev/null +++ b/src/interfaces/PaginatedResults.ts @@ -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 { + readonly data: I[]; + readonly pagination: PaginationMetadata; +}