@based/functions 1.2.0 → 1.2.2

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.
@@ -2,10 +2,7 @@ import { Context, HttpSession } from './context';
2
2
  import { BasedFunctionClient } from './client';
3
3
  import { BasedDataStream } from './stream';
4
4
  import { Authorize } from './auth';
5
- export type ObservableUpdateFunction<K = any> = {
6
- (data: K, checksum?: number, diff?: any, fromChecksum?: number, isDeflate?: boolean, rawData?: K, err?: any): void;
7
- __internalObs__?: true;
8
- };
5
+ export type ObservableUpdateFunction<K = any> = (data: K, checksum?: number, err?: any, cache?: Uint8Array, diff?: any, fromChecksum?: number, isDeflate?: boolean) => void;
9
6
  export type ObserveErrorListener = (err: any) => void;
10
7
  export type HttpHeaders = {
11
8
  [header: string]: number | string | (string | number)[];
package/dist/geo.d.ts CHANGED
@@ -2,7 +2,7 @@ export type CountryCode = 'AF' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ'
2
2
  type Char = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
3
3
  export type GeoRegionISO = `${Char}${Char}` | `${Char}${Char}${Char}`;
4
4
  export type Geo = {
5
- country: CountryCode;
5
+ country: CountryCode | 'unknown';
6
6
  /**
7
7
  Ip formatted as ipv6
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/functions",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/functions.ts CHANGED
@@ -3,21 +3,16 @@ import { BasedFunctionClient } from './client'
3
3
  import { BasedDataStream } from './stream'
4
4
  import { Authorize } from './auth'
5
5
 
6
- export type ObservableUpdateFunction<K = any> = {
7
- (
8
- data: K,
9
- checksum?: number,
10
- diff?: any,
11
- fromChecksum?: number,
12
- isDeflate?: boolean,
13
- rawData?: K,
14
- // todo fix there errors TODO: make extra package 'errors' for client and server
15
- err?: any
16
- ): void
17
- __internalObs__?: true
18
- }
6
+ export type ObservableUpdateFunction<K = any> = (
7
+ data: K,
8
+ checksum?: number,
9
+ err?: any,
10
+ cache?: Uint8Array,
11
+ diff?: any,
12
+ fromChecksum?: number,
13
+ isDeflate?: boolean
14
+ ) => void
19
15
 
20
- // TODO: use error package
21
16
  export type ObserveErrorListener = (err: any) => void
22
17
 
23
18
  export type HttpHeaders = {
package/src/geo.ts CHANGED
@@ -290,7 +290,7 @@ type Char =
290
290
  export type GeoRegionISO = `${Char}${Char}` | `${Char}${Char}${Char}`
291
291
 
292
292
  export type Geo = {
293
- country: CountryCode
293
+ country: CountryCode | 'unknown'
294
294
  /**
295
295
  Ip formatted as ipv6
296
296