cozy-pouch-link 48.25.0 → 49.0.0

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.
Files changed (41) hide show
  1. package/dist/CozyPouchLink.js +593 -237
  2. package/dist/CozyPouchLink.spec.js +67 -42
  3. package/dist/PouchManager.js +317 -254
  4. package/dist/PouchManager.spec.js +91 -58
  5. package/dist/helpers.js +79 -0
  6. package/dist/helpers.spec.js +85 -1
  7. package/dist/jsonapi.js +54 -7
  8. package/dist/jsonapi.spec.js +57 -14
  9. package/dist/localStorage.js +646 -207
  10. package/dist/localStorage.spec.js +48 -0
  11. package/dist/mango.js +72 -20
  12. package/dist/mango.spec.js +1 -1
  13. package/dist/migrations/adapter.js +1 -1
  14. package/dist/platformWeb.js +120 -0
  15. package/dist/remote.js +39 -5
  16. package/dist/remote.spec.js +214 -0
  17. package/dist/replicateOnce.js +337 -0
  18. package/dist/startReplication.js +70 -45
  19. package/dist/startReplication.spec.js +374 -39
  20. package/dist/types.js +80 -0
  21. package/dist/utils.js +11 -2
  22. package/package.json +9 -5
  23. package/types/AccessToken.d.ts +16 -0
  24. package/types/CozyPouchLink.d.ts +228 -0
  25. package/types/PouchManager.d.ts +86 -0
  26. package/types/__tests__/fixtures.d.ts +48 -0
  27. package/types/__tests__/mocks.d.ts +4 -0
  28. package/types/helpers.d.ts +17 -0
  29. package/types/index.d.ts +1 -0
  30. package/types/jsonapi.d.ts +19 -0
  31. package/types/localStorage.d.ts +124 -0
  32. package/types/logger.d.ts +2 -0
  33. package/types/loop.d.ts +60 -0
  34. package/types/mango.d.ts +3 -0
  35. package/types/migrations/adapter.d.ts +18 -0
  36. package/types/platformWeb.d.ts +17 -0
  37. package/types/remote.d.ts +6 -0
  38. package/types/replicateOnce.d.ts +29 -0
  39. package/types/startReplication.d.ts +12 -0
  40. package/types/types.d.ts +104 -0
  41. package/types/utils.d.ts +3 -0
@@ -1,12 +1,8 @@
1
+ import MicroEE from 'microee'
1
2
  import { fetchRemoteLastSequence, fetchRemoteInstance } from './remote'
2
- import { getLastReplicatedDocID } from './localStorage'
3
3
 
4
- import { replicateAllDocs } from './startReplication'
5
-
6
- jest.mock('./localStorage', () => ({
7
- getLastReplicatedDocID: jest.fn(),
8
- persistLastReplicatedDocID: jest.fn()
9
- }))
4
+ import { replicateAllDocs, startReplication } from './startReplication'
5
+ import { insertBulkDocs } from './helpers'
10
6
 
11
7
  jest.mock('./remote', () => ({
12
8
  fetchRemoteLastSequence: jest.fn(),
@@ -14,6 +10,7 @@ jest.mock('./remote', () => ({
14
10
  }))
15
11
 
16
12
  jest.mock('./helpers', () => ({
13
+ ...jest.requireActual('./helpers').default,
17
14
  insertBulkDocs: jest.fn()
18
15
  }))
19
16
 
@@ -27,49 +24,387 @@ const generateDocs = nDocs => {
27
24
  return docs
28
25
  }
29
26
 
30
- describe('replication through _all_docs', () => {
27
+ const storage = {
28
+ getLastReplicatedDocID: jest.fn(),
29
+ persistLastReplicatedDocID: jest.fn()
30
+ }
31
+
32
+ function ReplicationOnMock() {}
33
+ MicroEE.mixin(ReplicationOnMock)
34
+ const mockReplicationOn = new ReplicationOnMock()
35
+ mockReplicationOn.cancel = () => {
36
+ mockReplicationOn.emit('complete')
37
+ }
38
+
39
+ describe('startReplication', () => {
31
40
  beforeEach(() => {
41
+ jest.resetAllMocks()
32
42
  fetchRemoteLastSequence.mockResolvedValue('10-xyz')
33
43
  })
34
- it('should replicate all docs', async () => {
35
- getLastReplicatedDocID.mockReturnValue(null)
36
- const dummyDocs = generateDocs(2)
37
- fetchRemoteInstance.mockResolvedValue({ rows: dummyDocs })
38
-
39
- const rep = await replicateAllDocs(null, url)
40
- const expectedDocs = dummyDocs.map(doc => doc.doc)
41
- expect(rep).toEqual(expectedDocs)
42
- })
43
44
 
44
- it('should replicate all docs when it gets more docs than the batch limit', async () => {
45
- getLastReplicatedDocID.mockReturnValue(null)
46
- const dummyDocs = generateDocs(1002)
47
- fetchRemoteInstance.mockResolvedValueOnce({
48
- rows: dummyDocs.slice(0, 1001)
45
+ describe('replication through _all_docs', () => {
46
+ it('should replicate all docs', async () => {
47
+ storage.getLastReplicatedDocID.mockReturnValue(null)
48
+ const dummyDocs = generateDocs(2)
49
+ fetchRemoteInstance.mockResolvedValue({ rows: dummyDocs })
50
+
51
+ const rep = await replicateAllDocs({
52
+ db: null,
53
+ baseUrl: url,
54
+ doctype: undefined,
55
+ storage
56
+ })
57
+ const expectedDocs = dummyDocs.map(doc => doc.doc)
58
+ expect(rep).toEqual(expectedDocs)
59
+ expect(fetchRemoteInstance).toHaveBeenCalledTimes(1)
60
+ expect(insertBulkDocs).toHaveBeenCalledTimes(1)
49
61
  })
50
- fetchRemoteInstance.mockResolvedValueOnce({
51
- rows: dummyDocs.slice(1000, 1002)
62
+
63
+ it('should replicate all docs when it gets more docs than the batch limit', async () => {
64
+ storage.getLastReplicatedDocID.mockReturnValue(null)
65
+ const dummyDocs = generateDocs(1002)
66
+ fetchRemoteInstance.mockResolvedValueOnce({
67
+ rows: dummyDocs.slice(0, 1001)
68
+ })
69
+ fetchRemoteInstance.mockResolvedValueOnce({
70
+ rows: dummyDocs.slice(1000, 1002)
71
+ })
72
+
73
+ const rep = await replicateAllDocs({
74
+ db: null,
75
+ baseUrl: url,
76
+ doctype: undefined,
77
+ storage
78
+ })
79
+ const expectedDocs = dummyDocs.map(doc => doc.doc)
80
+ expect(rep).toEqual(expectedDocs)
81
+ expect(fetchRemoteInstance).toHaveBeenCalledTimes(2)
82
+ expect(insertBulkDocs).toHaveBeenCalledTimes(2)
52
83
  })
53
84
 
54
- const rep = await replicateAllDocs(null, url)
55
- const expectedDocs = dummyDocs.map(doc => doc.doc)
56
- expect(rep).toEqual(expectedDocs)
85
+ it('should replicate from the last saved doc id', async () => {
86
+ storage.getLastReplicatedDocID.mockReturnValue('5')
87
+ const dummyDocs = generateDocs(10)
88
+ fetchRemoteInstance.mockResolvedValue({ rows: dummyDocs.slice(5, 11) })
89
+
90
+ const rep = await replicateAllDocs({
91
+ db: null,
92
+ baseUrl: url,
93
+ doctype: undefined,
94
+ storage
95
+ })
96
+
97
+ const calledUrl = new URL(`${url}/_all_docs`)
98
+ expect(fetchRemoteInstance).toHaveBeenCalledWith(calledUrl, {
99
+ include_docs: true,
100
+ limit: 1000,
101
+ startkey_docid: '5'
102
+ })
103
+ expect(fetchRemoteInstance).toHaveBeenCalledTimes(1)
104
+ expect(insertBulkDocs).toHaveBeenCalledTimes(1)
105
+ const expectedDocs = dummyDocs.map(doc => doc.doc).slice(6, 11)
106
+ expect(rep).toEqual(expectedDocs)
107
+ })
57
108
  })
58
109
 
59
- it('should replicate from the last saved doc id', async () => {
60
- getLastReplicatedDocID.mockReturnValue('5')
61
- const dummyDocs = generateDocs(10)
62
- fetchRemoteInstance.mockResolvedValue({ rows: dummyDocs.slice(5, 11) })
110
+ describe('startReplication', () => {
111
+ it('should call replicateAllDocs on initial replication', async () => {
112
+ const replicationOptions = getReplicationOptionsMock()
113
+ replicationOptions.initialReplication = true
114
+
115
+ const getReplicationURL = () =>
116
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files'
63
117
 
64
- const rep = await replicateAllDocs(null, url)
118
+ const dummyDocs = generateDocs(2)
119
+ fetchRemoteInstance.mockResolvedValue({ rows: dummyDocs })
65
120
 
66
- const calledUrl = new URL(`${url}/_all_docs`)
67
- expect(fetchRemoteInstance).toHaveBeenCalledWith(calledUrl, {
68
- include_docs: true,
69
- limit: 1000,
70
- startkey_docid: '5'
121
+ const pouch = getPouchMock()
122
+
123
+ await startReplication(
124
+ pouch,
125
+ replicationOptions,
126
+ getReplicationURL,
127
+ storage
128
+ )
129
+
130
+ expect(fetchRemoteInstance).toHaveBeenCalledWith(
131
+ new URL(
132
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files/_all_docs'
133
+ ),
134
+ { include_docs: true, limit: 1000 }
135
+ )
136
+ expect(pouch.replicate.from).not.toHaveBeenCalled()
137
+ expect(pouch.replicate.to).not.toHaveBeenCalled()
138
+ expect(pouch.sync).not.toHaveBeenCalled()
139
+ })
140
+
141
+ it('should call Pouch replication on non-initial replications', async () => {
142
+ const replicationOptions = getReplicationOptionsMock()
143
+ replicationOptions.initialReplication = false
144
+
145
+ const getReplicationURL = () =>
146
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files'
147
+
148
+ const pouch = getPouchMock()
149
+
150
+ const promise = startReplication(
151
+ pouch,
152
+ replicationOptions,
153
+ getReplicationURL,
154
+ storage
155
+ )
156
+ mockReplicationOn.emit('complete')
157
+ await promise
158
+
159
+ expect(fetchRemoteInstance).not.toHaveBeenCalled()
160
+ expect(pouch.replicate.to).not.toHaveBeenCalled()
161
+ expect(pouch.sync).not.toHaveBeenCalled()
162
+ expect(pouch.replicate.from).toHaveBeenCalledWith(
163
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files',
164
+ { batch_size: 1000, selector: { cozyLocalOnly: { $exists: false } } }
165
+ )
166
+ })
167
+
168
+ it(`should call Pouch replication on initial replications AND strategy is 'toRemote'`, async () => {
169
+ const replicationOptions = getReplicationOptionsMock()
170
+ replicationOptions.initialReplication = true
171
+ replicationOptions.strategy = 'toRemote'
172
+
173
+ const getReplicationURL = () =>
174
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files'
175
+
176
+ const pouch = getPouchMock()
177
+
178
+ const promise = startReplication(
179
+ pouch,
180
+ replicationOptions,
181
+ getReplicationURL,
182
+ storage
183
+ )
184
+ mockReplicationOn.emit('complete')
185
+ await promise
186
+
187
+ expect(fetchRemoteInstance).not.toHaveBeenCalled()
188
+ expect(pouch.replicate.from).not.toHaveBeenCalled()
189
+ expect(pouch.sync).not.toHaveBeenCalled()
190
+ expect(pouch.replicate.to).toHaveBeenCalledWith(
191
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files',
192
+ { batch_size: 1000, selector: { cozyLocalOnly: { $exists: false } } }
193
+ )
194
+ })
195
+
196
+ it(`should handle error result when Pouch replication`, async () => {
197
+ const replicationOptions = getReplicationOptionsMock()
198
+ replicationOptions.initialReplication = false
199
+
200
+ const getReplicationURL = () =>
201
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files'
202
+
203
+ const pouch = getPouchMock()
204
+
205
+ const promise = startReplication(
206
+ pouch,
207
+ replicationOptions,
208
+ getReplicationURL,
209
+ storage
210
+ )
211
+ mockReplicationOn.emit('error', 'some_error_message')
212
+ await expect(promise).rejects.toEqual('some_error_message')
213
+ })
214
+
215
+ it(`should handle change event with Sync format and Replication format when Pouch replication`, async () => {
216
+ const replicationOptions = getReplicationOptionsMock()
217
+ replicationOptions.initialReplication = false
218
+
219
+ const getReplicationURL = () =>
220
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files'
221
+
222
+ const pouch = getPouchMock()
223
+
224
+ const promise = startReplication(
225
+ pouch,
226
+ replicationOptions,
227
+ getReplicationURL,
228
+ storage
229
+ )
230
+ // Sync format
231
+ mockReplicationOn.emit('change', {
232
+ change: {
233
+ docs: [
234
+ {
235
+ _id: 'SOME_DOCUMENT_ID_1',
236
+ some_property: 'some_value'
237
+ }
238
+ ]
239
+ }
240
+ })
241
+ // Replicaiton format
242
+ mockReplicationOn.emit('change', {
243
+ docs: [
244
+ {
245
+ _id: 'SOME_DOCUMENT_ID_2',
246
+ some_property: 'some_value'
247
+ }
248
+ ]
249
+ })
250
+ mockReplicationOn.emit('complete')
251
+ const result = await promise
252
+
253
+ expect(result).toStrictEqual([
254
+ {
255
+ _id: 'SOME_DOCUMENT_ID_1',
256
+ some_property: 'some_value'
257
+ },
258
+ {
259
+ _id: 'SOME_DOCUMENT_ID_2',
260
+ some_property: 'some_value'
261
+ }
262
+ ])
263
+ })
264
+
265
+ it(`should filter design document from change event when Pouch replication`, async () => {
266
+ const replicationOptions = getReplicationOptionsMock()
267
+ replicationOptions.initialReplication = false
268
+
269
+ const getReplicationURL = () =>
270
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files'
271
+
272
+ const pouch = getPouchMock()
273
+
274
+ const promise = startReplication(
275
+ pouch,
276
+ replicationOptions,
277
+ getReplicationURL,
278
+ storage
279
+ )
280
+ mockReplicationOn.emit('change', {
281
+ change: {
282
+ docs: [
283
+ {
284
+ _id: 'SOME_DOCUMENT_ID_1',
285
+ some_property: 'some_value'
286
+ },
287
+ {
288
+ _id: '_design_SOME_DOCUMENT_ID_2',
289
+ some_property: 'some_value'
290
+ }
291
+ ]
292
+ }
293
+ })
294
+ mockReplicationOn.emit('complete')
295
+ const result = await promise
296
+
297
+ expect(result).toStrictEqual([
298
+ {
299
+ _id: 'SOME_DOCUMENT_ID_1',
300
+ some_property: 'some_value'
301
+ }
302
+ ])
303
+ })
304
+
305
+ it(`should filter deleted document from change event when Pouch replication`, async () => {
306
+ const replicationOptions = getReplicationOptionsMock()
307
+ replicationOptions.initialReplication = false
308
+
309
+ const getReplicationURL = () =>
310
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files'
311
+
312
+ const pouch = getPouchMock()
313
+
314
+ const promise = startReplication(
315
+ pouch,
316
+ replicationOptions,
317
+ getReplicationURL,
318
+ storage
319
+ )
320
+ mockReplicationOn.emit('change', {
321
+ change: {
322
+ docs: [
323
+ {
324
+ _id: 'SOME_DOCUMENT_ID_1',
325
+ some_property: 'some_value'
326
+ },
327
+ {
328
+ _id: 'SOME_DOCUMENT_ID_2',
329
+ some_property: 'some_value',
330
+ _deleted: true
331
+ }
332
+ ]
333
+ }
334
+ })
335
+ mockReplicationOn.emit('complete')
336
+ const result = await promise
337
+
338
+ expect(result).toStrictEqual([
339
+ {
340
+ _id: 'SOME_DOCUMENT_ID_1',
341
+ some_property: 'some_value'
342
+ }
343
+ ])
344
+ })
345
+
346
+ it(`should allow to cancel promise when Pouch replication`, async () => {
347
+ const replicationOptions = getReplicationOptionsMock()
348
+ replicationOptions.initialReplication = false
349
+
350
+ const getReplicationURL = () =>
351
+ 'https://user:SOME_TOKEN@claude.mycozy.cloud/data/io.cozy.files'
352
+
353
+ const pouch = getPouchMock()
354
+
355
+ const promise = startReplication(
356
+ pouch,
357
+ replicationOptions,
358
+ getReplicationURL,
359
+ storage
360
+ )
361
+
362
+ expect(promise.cancel).toBeDefined()
363
+
364
+ promise.cancel()
365
+
366
+ // this change should be ignored
367
+ mockReplicationOn.emit('change', {
368
+ change: {
369
+ docs: [
370
+ {
371
+ _id: 'SOME_DOCUMENT_ID_1',
372
+ some_property: 'some_value'
373
+ },
374
+ {
375
+ _id: 'SOME_DOCUMENT_ID_2',
376
+ some_property: 'some_value',
377
+ _deleted: true
378
+ }
379
+ ]
380
+ }
381
+ })
382
+
383
+ const result = await promise
384
+
385
+ expect(result).toStrictEqual([])
71
386
  })
72
- const expectedDocs = dummyDocs.map(doc => doc.doc).slice(6, 11)
73
- expect(rep).toEqual(expectedDocs)
74
387
  })
75
388
  })
389
+
390
+ const getPouchMock = () => {
391
+ const pouch = {
392
+ replicate: {
393
+ from: jest.fn(),
394
+ to: jest.fn()
395
+ },
396
+ sync: jest.fn()
397
+ }
398
+ pouch.replicate.from.mockReturnValue(mockReplicationOn)
399
+ pouch.replicate.to.mockReturnValue(mockReplicationOn)
400
+ pouch.sync.mockReturnValue(mockReplicationOn)
401
+
402
+ return pouch
403
+ }
404
+
405
+ const getReplicationOptionsMock = () => ({
406
+ strategy: 'fromRemote',
407
+ initialReplication: false,
408
+ warmupQueries: {},
409
+ doctype: 'io.cozy.files'
410
+ })
package/dist/types.js ADDED
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ /**
9
+ * @typedef {Object} Cancelable
10
+ * @property {Function} [cancel] - Cancel the promise
11
+ */
12
+
13
+ /**
14
+ * @typedef {Promise & Cancelable} CancelablePromise
15
+ */
16
+
17
+ /**
18
+ * @typedef {CancelablePromise[] & Cancelable} CancelablePromises
19
+ */
20
+
21
+ /**
22
+ * @typedef {"synced"|"not_synced"|"not_complete"} SyncStatus
23
+ */
24
+
25
+ /**
26
+ * @typedef {object} SyncInfo
27
+ * @property {string} date - The date of the last synchronization
28
+ * @property {SyncStatus} status - The current synchronization status
29
+ */
30
+
31
+ /**
32
+ * @typedef {object} LocalStorage
33
+ * @property {function(string): Promise<string | null>} getItem
34
+ * @property {function(string, string): Promise<void>} setItem
35
+ * @property {function(string): Promise<void>} removeItem
36
+ */
37
+
38
+ /**
39
+ * @typedef {object} LinkPlatform
40
+ * @property {LocalStorage} storage Methods to access local storage
41
+ * @property {any} pouchAdapter PouchDB class (can be pouchdb-core or pouchdb-browser)
42
+ * @property {function(): Promise<boolean>} isOnline Method that check if the app is connected to internet
43
+ */
44
+
45
+ /**
46
+ * @typedef {Object} MangoPartialFilter
47
+ */
48
+
49
+ /**
50
+ * @typedef {object} MangoSelector
51
+ */
52
+
53
+ /**
54
+ * @typedef {Array<object>} MangoSort
55
+ */
56
+
57
+ /**
58
+ * @typedef {object} MangoQueryOptions
59
+ * @property {MangoSelector} [selector] Selector
60
+ * @property {MangoSort} [sort] The sorting parameters
61
+ * @property {Array<string>} [fields] The fields to return
62
+ * @property {Array<string>} [partialFilterFields] The partial filter fields
63
+ * @property {number|null} [limit] For pagination, the number of results to return
64
+ * @property {number|null} [skip] For skip-based pagination, the number of referenced files to skip
65
+ * @property {string|null} [indexId] The _id of the CouchDB index to use for this request
66
+ * @property {string|null} [bookmark] For bookmark-based pagination, the document _id to start from
67
+ * @property {Array<string>} [indexedFields]
68
+ * @property {string} [use_index] Name of the index to use
69
+ * @property {boolean} [execution_stats] If true, we request the stats from Couch
70
+ * @property {MangoPartialFilter|null} [partialFilter] An optional partial filter
71
+ */
72
+
73
+ /**
74
+ * @typedef {object} PouchDbIndex
75
+ * @property {string} id - The ddoc's id
76
+ * @property {string} name - The ddoc's name
77
+ * @property {'exists'|'created'} result - If the index has been created or if it already exists
78
+ */
79
+ var _default = {};
80
+ exports.default = _default;
package/dist/utils.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getPrefix = exports.getDatabaseName = void 0;
6
+ exports.formatAggregatedError = exports.getPrefix = exports.getDatabaseName = void 0;
7
7
 
8
8
  /**
9
9
  * Get the database name based on prefix and doctype
@@ -30,4 +30,13 @@ var getPrefix = function getPrefix(uri) {
30
30
  return uri.replace(/^https?:\/\//, '');
31
31
  };
32
32
 
33
- exports.getPrefix = getPrefix;
33
+ exports.getPrefix = getPrefix;
34
+
35
+ var formatAggregatedError = function formatAggregatedError(aggregatedError) {
36
+ var strings = aggregatedError.errors.map(function (e, index) {
37
+ return '\n[' + index + ']: ' + e.message + '\n' + e.stack;
38
+ });
39
+ return strings.join('\n');
40
+ };
41
+
42
+ exports.formatAggregatedError = formatAggregatedError;
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "cozy-pouch-link",
3
- "version": "48.25.0",
3
+ "version": "49.0.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
+ "types": "types/index.d.ts",
6
7
  "files": [
8
+ "types",
7
9
  "dist"
8
10
  ],
9
11
  "repository": {
@@ -11,7 +13,7 @@
11
13
  "url": "git+https://github.com/cozy/cozy-client.git"
12
14
  },
13
15
  "dependencies": {
14
- "cozy-client": "^48.25.0",
16
+ "cozy-client": "^49.0.0",
15
17
  "pouchdb-browser": "^7.2.2",
16
18
  "pouchdb-find": "^7.2.2"
17
19
  },
@@ -23,7 +25,8 @@
23
25
  "parcel": "1.12.4",
24
26
  "pouchdb-adapter-memory": "7.2.2",
25
27
  "react": "16.14.0",
26
- "react-dom": "16.14.0"
28
+ "react-dom": "16.14.0",
29
+ "typescript": "4.1.5"
27
30
  },
28
31
  "peerDependencies": {
29
32
  "@cozy/minilog": "1.0.0",
@@ -32,8 +35,9 @@
32
35
  "scripts": {
33
36
  "build": "../../bin/build",
34
37
  "watch": "yarn run build --watch",
35
- "prepublishOnly": "yarn run build"
38
+ "prepublishOnly": "yarn run build",
39
+ "typecheck": "tsc -p tsconfig.json"
36
40
  },
37
41
  "sideEffects": false,
38
- "gitHead": "2335cc461075ca1fc55519bcfce80d5a9dc74c0d"
42
+ "gitHead": "ddf825045c0640e383b7cf89f9937ef7d44e501d"
39
43
  }
@@ -0,0 +1,16 @@
1
+ export default class AccessToken {
2
+ static fromJSON(data: any): AccessToken;
3
+ constructor(opts: any);
4
+ tokenType: any;
5
+ accessToken: any;
6
+ refreshToken: any;
7
+ scope: any;
8
+ toAuthHeader(): string;
9
+ toBasicAuth(): string;
10
+ toJSON(): {
11
+ tokenType: any;
12
+ accessToken: any;
13
+ refreshToken: any;
14
+ scope: any;
15
+ };
16
+ }