@whitewall/blip-sdk 0.0.152 → 0.0.153
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/dist/types/sender/enveloperesolver.d.ts +2 -2
- package/dist/types/sender/enveloperesolver.d.ts.map +1 -1
- package/dist/types/types/commons.d.ts +3 -5
- package/dist/types/types/commons.d.ts.map +1 -1
- package/dist/types/types/message.d.ts +2 -2
- package/dist/types/types/message.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/sender/enveloperesolver.ts +2 -2
- package/src/types/commons.ts +1 -15
- package/src/types/message.ts +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Envelope, type
|
|
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 |
|
|
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,
|
|
1
|
+
{"version":3,"file":"enveloperesolver.d.ts","sourceRoot":"","sources":["../../../src/sender/enveloperesolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,QAAQ,EAEb,KAAK,IAAI,EACT,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EAItB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,oBA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AAE,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAIjF,KAAK;IAQL,sBAAsB,CAAC,MAAM,EAAE,MAAM;IAM5C,OAAO,CAAC,uBAAuB;YAajB,IAAI;CAcrB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
});
|
|
5
|
-
export type JsonObject = Record<string, JsonValue>;
|
|
1
|
+
export type Json = string | number | boolean | null | Array<Json> | {
|
|
2
|
+
[key: string]: Json;
|
|
3
|
+
};
|
|
6
4
|
export type MaybePromise<T> = T | Promise<T>;
|
|
7
5
|
//# sourceMappingURL=commons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../../src/types/commons.ts"],"names":[],"mappings":"
|
|
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,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Json } from './commons.ts';
|
|
2
2
|
import type { TicketStatus } from './desk.ts';
|
|
3
3
|
import type { Envelope } from './envelope.ts';
|
|
4
4
|
import type { Identity } from './node.ts';
|
|
@@ -60,7 +60,7 @@ export interface MessageTypesContent {
|
|
|
60
60
|
'application/vnd.iris.ticket+json': Ticket<MessageTypes>;
|
|
61
61
|
'application/vnd.lime.redirect+json': Redirect<MessageTypes>;
|
|
62
62
|
'application/vnd.lime.media-link+json': MediaLink;
|
|
63
|
-
'application/json':
|
|
63
|
+
'application/json': Json;
|
|
64
64
|
'application/vnd.lime.reply+json': Reply<MessageTypes>;
|
|
65
65
|
'application/vnd.lime.select+json': Select;
|
|
66
66
|
'application/vnd.lime.chatstate+json': ChatState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/types/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/types/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B,MAAM,MAAM,MAAM,CAAC,IAAI,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,IAAI;IACpE,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,QAAQ,CAAA;IACvB,gBAAgB,EAAE,QAAQ,CAAA;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,aAAa,CAAC,EAAE,QAAQ,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,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U,eAAe,EACzB,MAAM,IAAI,KACX,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAA2B,CAAA;AAEvD,eAAO,MAAM,iBAAiB,GAAI,IAAI,SAAS,YAAY,EACvD,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,KACjD,QAAQ,CAAC,IAAI,CAGd,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
type CommonNotification,
|
|
3
3
|
type Envelope,
|
|
4
4
|
type FailedNotification,
|
|
5
|
-
type
|
|
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 |
|
|
21
|
+
command: (command: UnknownCommand) => MaybePromise<string | Json> | MaybePromise<void>
|
|
22
22
|
notification: (notification: Notification) => MaybePromise<void>
|
|
23
23
|
}
|
|
24
24
|
|
package/src/types/commons.ts
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
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 }
|
|
16
2
|
export type MaybePromise<T> = T | Promise<T>
|
package/src/types/message.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Json } from './commons.ts'
|
|
2
2
|
import type { TicketStatus } from './desk.ts'
|
|
3
3
|
import type { Envelope } from './envelope.ts'
|
|
4
4
|
import type { Identity } from './node.ts'
|
|
@@ -70,7 +70,7 @@ export interface MessageTypesContent {
|
|
|
70
70
|
'application/vnd.iris.ticket+json': Ticket<MessageTypes>
|
|
71
71
|
'application/vnd.lime.redirect+json': Redirect<MessageTypes>
|
|
72
72
|
'application/vnd.lime.media-link+json': MediaLink
|
|
73
|
-
'application/json':
|
|
73
|
+
'application/json': Json
|
|
74
74
|
'application/vnd.lime.reply+json': Reply<MessageTypes>
|
|
75
75
|
'application/vnd.lime.select+json': Select
|
|
76
76
|
'application/vnd.lime.chatstate+json': ChatState
|