File tree 5 files changed +14
-8
lines changed
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
20
20
import { Omnivore } from ' @omnivore-app/api'
21
21
22
22
const omnivore = new Omnivore ({
23
- authToken : ' your api key' ,
23
+ apiKey : ' your api key' ,
24
24
baseUrl: ' https://api-prod.omnivore.app' ,
25
25
})
26
26
@@ -175,7 +175,7 @@ The `Omnivore` class accepts an options object with the following properties:
175
175
176
176
| Option | Default value | Type | Description |
177
177
| ----------- | --------------------------------- | -------- | ------------------------------------------------------------------------------------ |
178
- | ` authToken ` | ` undefined ` | ` string ` | API key required for authentication. |
178
+ | ` apiKey ` | ` undefined ` | ` string ` | API key required for authentication. |
179
179
| ` baseUrl ` | ` "https://api-prod.omnivore.app" ` | ` string ` | The base URL for sending API requests. This can be changed to a local-hosted server. |
180
180
| ` timeoutMs ` | ` 0 ` | ` number ` | Number of milliseconds to wait before timeout. |
181
181
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @omnivore-app/api" ,
3
- "version" : " 1.0.3 " ,
3
+ "version" : " 1.0.4 " ,
4
4
"description" : " Omnivore API Client Library for Node.js" ,
5
5
"main" : " ./dist/src/index.js" ,
6
6
"types" : " ./dist/src/index.d.ts" ,
Original file line number Diff line number Diff line change 8
8
} from './graphql'
9
9
10
10
export interface ClientOptions {
11
- authToken : string
11
+ apiKey : string
12
12
baseUrl ?: string
13
13
timeoutMs ?: number
14
14
}
@@ -98,6 +98,8 @@ export interface SearchItemResponse {
98
98
99
99
export interface ItemUpdatesParameters {
100
100
since : string
101
+ after ?: number
102
+ first ?: number
101
103
}
102
104
103
105
export type ItemUpdateReason = 'CREATED' | 'UPDATED' | 'DELETED'
@@ -153,7 +155,7 @@ export class Omnivore {
153
155
exchanges : [ fetchExchange ] ,
154
156
fetchOptions : ( ) => ( {
155
157
headers : {
156
- Authorization : clientOptions . authToken ,
158
+ Authorization : clientOptions . apiKey ,
157
159
} ,
158
160
timeout : clientOptions . timeoutMs || 0 ,
159
161
} ) ,
@@ -188,7 +190,10 @@ export class Omnivore {
188
190
params : ItemUpdatesParameters ,
189
191
) : Promise < ItemUpdatesResponse > => {
190
192
const { data, error } = await this . client
191
- . query ( UpdatesSinceQuery , params )
193
+ . query ( UpdatesSinceQuery , {
194
+ ...params ,
195
+ after : params . after ? String ( params . after ) : undefined ,
196
+ } )
192
197
. toPromise ( )
193
198
194
199
const updatesSince = data ?. updatesSince
Original file line number Diff line number Diff line change @@ -128,8 +128,8 @@ export const SearchQuery = graphql(
128
128
129
129
export const UpdatesSinceQuery = graphql (
130
130
`
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) {
133
133
__typename
134
134
... on UpdatesSinceSuccess {
135
135
edges {
Original file line number Diff line number Diff line change 7
7
ItemFormat ,
8
8
ItemType ,
9
9
ItemUpdateReason ,
10
+ ItemUpdatesParameters ,
10
11
ItemUpdatesResponse ,
11
12
Label ,
12
13
LibraryItemState ,
You can’t perform that action at this time.
0 commit comments