pryv 2.4.6 → 2.4.7

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.
package/README.md CHANGED
@@ -199,7 +199,7 @@ try {
199
199
  ```js
200
200
  let count = 0;
201
201
  // the following will be called on each API method result it was provided for
202
- function handleResult(result) { console.log('Got result ' + count++ + ': ' + JSON.stringify(result)); }
202
+ function handleResult(result, apiCall) { console.log('Got result ' + count++ + ': ' + JSON.stringify(result) + ' For call ' + JSON.stringify(apiCall)); }
203
203
 
204
204
  function progress(percentage) { console.log('Processed: ' + percentage + '%'); }
205
205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pryv",
3
- "version": "2.4.6",
3
+ "version": "2.4.7",
4
4
  "description": "Pryv JavaScript library",
5
5
  "keywords": [
6
6
  "Pryv",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git://github.com/pryv/lib-js"
15
+ "url": "git://github.com/pryv/lib-js.git"
16
16
  },
17
17
  "license": "BSD-3-Clause",
18
18
  "author": "Pryv S.A. <info@pryv.com> (https://pryv.com)",
package/src/Connection.js CHANGED
@@ -193,7 +193,8 @@ class Connection {
193
193
  if (arrayOfAPICalls[i + cursor].handleResult) {
194
194
  await arrayOfAPICalls[i + cursor].handleResult.call(
195
195
  null,
196
- resRequest.results[i]
196
+ resRequest.results[i],
197
+ thisBatch[i] // request
197
198
  );
198
199
  }
199
200
  }
package/src/index.d.ts CHANGED
@@ -530,7 +530,7 @@ declare module 'pryv' {
530
530
  APICallMethods[K]['res'] & PossibleError;
531
531
 
532
532
  export type APICallResultHandler<K extends keyof APICallMethods> = (
533
- result: APICallResult<K>,
533
+ result: APICallResult<K>, apicall: APICall<K>
534
534
  ) => Promise<any>;
535
535
  export type StreamedEventsHandler = (event: Event) => void;
536
536
 
@@ -129,8 +129,9 @@ describe('Connection', () => {
129
129
  conn.options.chunkSize = 2;
130
130
 
131
131
  let resultsReceivedCount = 0;
132
- function oneMoreResult (res) {
132
+ function oneMoreResult (res, apiCall) {
133
133
  expect(res.events).to.exist;
134
+ expect(apiCall.method).to.equal('events.get');
134
135
  resultsReceivedCount++;
135
136
  }
136
137