@whitewall/blip-sdk 0.0.152 → 0.0.154

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.
@@ -1,8 +1,8 @@
1
- import { type Envelope, type JsonObject, type MaybePromise, type Notification, type UnknownCommand, type UnknownMessage } from '../types/index.ts';
1
+ import { type Envelope, type Json, type MaybePromise, type Notification, type UnknownCommand, type UnknownMessage } from '../types/index.ts';
2
2
  import type { OpenConnectionSender } from './sender.ts';
3
3
  export type EventMap = {
4
4
  message: (message: UnknownMessage) => MaybePromise<void>;
5
- command: (command: UnknownCommand) => MaybePromise<string | JsonObject> | MaybePromise<void>;
5
+ command: (command: UnknownCommand) => MaybePromise<string | Json> | MaybePromise<void>;
6
6
  notification: (notification: Notification) => MaybePromise<void>;
7
7
  };
8
8
  export type Listener<K extends keyof EventMap> = {
@@ -1 +1 @@
1
- {"version":3,"file":"enveloperesolver.d.ts","sourceRoot":"","sources":["../../../src/sender/enveloperesolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,QAAQ,EAEb,KAAK,UAAU,EACf,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EAItB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD,MAAM,MAAM,QAAQ,GAAG;IACnB,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,YAAY,CAAC,IAAI,CAAC,CAAA;IACxD,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;IAC5F,YAAY,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,YAAY,CAAC,IAAI,CAAC,CAAA;CACnE,CAAA;AAED,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,QAAQ,IAAI;IAC7C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AAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAIjF,KAAK;IAQL,sBAAsB,CAAC,MAAM,EAAE,MAAM;IAM5C,OAAO,CAAC,uBAAuB;YAajB,IAAI;CAcrB"}
@@ -1,7 +1,8 @@
1
- export type JsonValue<D extends number = 8, // max depth
2
- A extends Array<0> = []> = null | boolean | number | string | (A['length'] extends D ? unknown : Array<JsonValue<D, [0, ...A]>>) | (A['length'] extends D ? unknown : {
3
- [k: string]: JsonValue<D, [0, ...A]>;
4
- });
5
- export type JsonObject = Record<string, JsonValue>;
1
+ export type Json = string | number | boolean | null | Array<Json> | {
2
+ [key: string]: Json;
3
+ };
4
+ export type JsonObject = {
5
+ [key: string]: Json;
6
+ };
6
7
  export type MaybePromise<T> = T | Promise<T>;
7
8
  //# sourceMappingURL=commons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../../src/types/commons.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,CACjB,CAAC,SAAS,MAAM,GAAG,CAAC,EAAE,YAAY;AAClC,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,IAErB,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAClE,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,OAAO,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAAA;AAElF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAElD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../../src/types/commons.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAC3F,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAChD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitewall/blip-sdk",
3
- "version": "0.0.152",
3
+ "version": "0.0.154",
4
4
  "description": "Blip API wrapper",
5
5
  "exports": {
6
6
  "types": "./dist/types/index.d.ts",
@@ -2,7 +2,7 @@ import {
2
2
  type CommonNotification,
3
3
  type Envelope,
4
4
  type FailedNotification,
5
- type JsonObject,
5
+ type Json,
6
6
  type MaybePromise,
7
7
  Node,
8
8
  type Notification,
@@ -18,7 +18,7 @@ import type { OpenConnectionSender } from './sender.ts'
18
18
 
19
19
  export type EventMap = {
20
20
  message: (message: UnknownMessage) => MaybePromise<void>
21
- command: (command: UnknownCommand) => MaybePromise<string | JsonObject> | MaybePromise<void>
21
+ command: (command: UnknownCommand) => MaybePromise<string | Json> | MaybePromise<void>
22
22
  notification: (notification: Notification) => MaybePromise<void>
23
23
  }
24
24
 
@@ -1,16 +1,3 @@
1
- // This type is weird because typescript doesn't like recursion types with generics
2
- // Error when done the clean way: Type instantiation is excessively deep and possibly infinite
3
- export type JsonValue<
4
- D extends number = 8, // max depth
5
- A extends Array<0> = [], // accumulator
6
- > =
7
- | null
8
- | boolean
9
- | number
10
- | string
11
- | (A['length'] extends D ? unknown : Array<JsonValue<D, [0, ...A]>>) // arrays
12
- | (A['length'] extends D ? unknown : { [k: string]: JsonValue<D, [0, ...A]> }) // objects
13
-
14
- export type JsonObject = Record<string, JsonValue>
15
-
1
+ export type Json = string | number | boolean | null | Array<Json> | { [key: string]: Json }
2
+ export type JsonObject = { [key: string]: Json }
16
3
  export type MaybePromise<T> = T | Promise<T>