File tree Expand file tree Collapse file tree 5 files changed +14
-8
lines changed Expand file tree Collapse file tree 5 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Import the `Omnivore` class and create a new instance with your **API Key** and
2020import { Omnivore } from ' @omnivore-app/api'
2121
2222const omnivore = new Omnivore ({
23- authToken : ' your api key' ,
23+ apiKey : ' your api key' ,
2424 baseUrl: ' https://api-prod.omnivore.app' ,
2525})
2626
@@ -175,7 +175,7 @@ The `Omnivore` class accepts an options object with the following properties:
175175
176176| Option | Default value | Type | Description |
177177| ----------- | --------------------------------- | -------- | ------------------------------------------------------------------------------------ |
178- | ` authToken ` | ` undefined ` | ` string ` | API key required for authentication. |
178+ | ` apiKey ` | ` undefined ` | ` string ` | API key required for authentication. |
179179| ` baseUrl ` | ` "https://api-prod.omnivore.app" ` | ` string ` | The base URL for sending API requests. This can be changed to a local-hosted server. |
180180| ` timeoutMs ` | ` 0 ` | ` number ` | Number of milliseconds to wait before timeout. |
181181
Original file line number Diff line number Diff line change 11{
22 "name" : " @omnivore-app/api" ,
3- "version" : " 1.0.3 " ,
3+ "version" : " 1.0.4 " ,
44 "description" : " Omnivore API Client Library for Node.js" ,
55 "main" : " ./dist/src/index.js" ,
66 "types" : " ./dist/src/index.d.ts" ,
Original file line number Diff line number Diff line change 88} from './graphql'
99
1010export interface ClientOptions {
11- authToken : string
11+ apiKey : string
1212 baseUrl ?: string
1313 timeoutMs ?: number
1414}
@@ -98,6 +98,8 @@ export interface SearchItemResponse {
9898
9999export interface ItemUpdatesParameters {
100100 since : string
101+ after ?: number
102+ first ?: number
101103}
102104
103105export type ItemUpdateReason = 'CREATED' | 'UPDATED' | 'DELETED'
@@ -153,7 +155,7 @@ export class Omnivore {
153155 exchanges : [ fetchExchange ] ,
154156 fetchOptions : ( ) => ( {
155157 headers : {
156- Authorization : clientOptions . authToken ,
158+ Authorization : clientOptions . apiKey ,
157159 } ,
158160 timeout : clientOptions . timeoutMs || 0 ,
159161 } ) ,
@@ -188,7 +190,10 @@ export class Omnivore {
188190 params : ItemUpdatesParameters ,
189191 ) : Promise < ItemUpdatesResponse > => {
190192 const { data, error } = await this . client
191- . query ( UpdatesSinceQuery , params )
193+ . query ( UpdatesSinceQuery , {
194+ ...params ,
195+ after : params . after ? String ( params . after ) : undefined ,
196+ } )
192197 . toPromise ( )
193198
194199 const updatesSince = data ?. updatesSince
Original file line number Diff line number Diff line change @@ -128,8 +128,8 @@ export const SearchQuery = graphql(
128128
129129export const UpdatesSinceQuery = graphql (
130130 `
131- query UpdatesSince($since: Date!) {
132- updatesSince(since: $since) {
131+ query UpdatesSince($after: String, $first: Int, $ since: Date!) {
132+ updatesSince(after: $after, first: $first, since: $since) {
133133 __typename
134134 ... on UpdatesSinceSuccess {
135135 edges {
Original file line number Diff line number Diff line change 77 ItemFormat ,
88 ItemType ,
99 ItemUpdateReason ,
10+ ItemUpdatesParameters ,
1011 ItemUpdatesResponse ,
1112 Label ,
1213 LibraryItemState ,
You can’t perform that action at this time.
0 commit comments