@memori.ai/memori-api-client 6.23.0 → 6.24.1
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/CHANGELOG.md +14 -0
- package/dist/engine/dialog.d.ts +15 -1
- package/dist/engine/dialog.js +13 -0
- package/dist/engine/dialog.js.map +1 -1
- package/dist/engine.d.ts +28 -0
- package/dist/index.d.ts +28 -0
- package/dist/types.d.ts +5 -0
- package/esm/engine/dialog.d.ts +15 -1
- package/esm/engine/dialog.js +13 -0
- package/esm/engine/dialog.js.map +1 -1
- package/esm/engine.d.ts +28 -0
- package/esm/index.d.ts +28 -0
- package/esm/types.d.ts +5 -0
- package/package.json +1 -1
- package/src/engine/dialog.ts +60 -1
- package/src/types.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [6.24.1](https://github.com/memori-ai/memori-api-client/compare/v6.24.0...v6.24.1) (2026-06-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Changes
|
|
7
|
+
|
|
8
|
+
* streamline postTextEnteredEventAsync method and update documentation for clarity ([c0585f3](https://github.com/memori-ai/memori-api-client/commit/c0585f343a09d4cc04164341b7d90ae028fa53c8))
|
|
9
|
+
|
|
10
|
+
## [6.24.0](https://github.com/memori-ai/memori-api-client/compare/v6.23.0...v6.24.0) (2026-06-17)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add TextEnteredAsyncResponse type and asynchronous text entry methods ([0568d64](https://github.com/memori-ai/memori-api-client/commit/0568d64cfd5399366116eabadd3fe33c353921ff))
|
|
16
|
+
|
|
3
17
|
## [6.23.0](https://github.com/memori-ai/memori-api-client/compare/v6.22.0...v6.23.0) (2026-04-30)
|
|
4
18
|
|
|
5
19
|
|
package/dist/engine/dialog.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DialogState, Medium, PlaceSpecs, ResponseSpec } from '../types';
|
|
1
|
+
import { DialogState, Medium, PlaceSpecs, ResponseSpec, TextEnteredAsyncResponse } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
3
|
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
4
4
|
sessionId: string;
|
|
@@ -8,6 +8,12 @@ declare const _default: (apiUrl: string) => {
|
|
|
8
8
|
}) => Promise<ResponseSpec & {
|
|
9
9
|
currentState: DialogState;
|
|
10
10
|
}>;
|
|
11
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
12
|
+
sessionId: string;
|
|
13
|
+
text: string;
|
|
14
|
+
dateUTC?: string | null | undefined;
|
|
15
|
+
place?: PlaceSpecs | null | undefined;
|
|
16
|
+
}) => Promise<TextEnteredAsyncResponse>;
|
|
11
17
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
12
18
|
sessionId: string;
|
|
13
19
|
text: string;
|
|
@@ -18,6 +24,14 @@ declare const _default: (apiUrl: string) => {
|
|
|
18
24
|
}) => Promise<ResponseSpec & {
|
|
19
25
|
currentState: DialogState;
|
|
20
26
|
}>;
|
|
27
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
28
|
+
sessionId: string;
|
|
29
|
+
text: string;
|
|
30
|
+
questionsAndAnswersHistory: {
|
|
31
|
+
question: string;
|
|
32
|
+
answer: string;
|
|
33
|
+
}[];
|
|
34
|
+
}) => Promise<TextEnteredAsyncResponse>;
|
|
21
35
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
22
36
|
sessionId: string;
|
|
23
37
|
placeName: string;
|
package/dist/engine/dialog.js
CHANGED
|
@@ -29,6 +29,11 @@ exports.default = (apiUrl) => ({
|
|
|
29
29
|
apiUrl,
|
|
30
30
|
body: buildTextEnteredBody({ text, dateUTC, place }),
|
|
31
31
|
}),
|
|
32
|
+
postEnterTextAsync: async ({ sessionId, text, dateUTC, place, }) => (0, apiFetcher_1.apiFetcher)(`/TextEnteredEventAsync/${sessionId}`, {
|
|
33
|
+
method: 'POST',
|
|
34
|
+
apiUrl,
|
|
35
|
+
body: buildTextEnteredBody({ text, dateUTC, place }),
|
|
36
|
+
}),
|
|
32
37
|
postTextEnteredEventExtended: async ({ sessionId, text, questionsAndAnswersHistory, }) => (0, apiFetcher_1.apiFetcher)(`/ExtendedTextEnteredEvent/${sessionId}`, {
|
|
33
38
|
method: 'POST',
|
|
34
39
|
apiUrl,
|
|
@@ -37,6 +42,14 @@ exports.default = (apiUrl) => ({
|
|
|
37
42
|
questionsAndAnswersHistory,
|
|
38
43
|
},
|
|
39
44
|
}),
|
|
45
|
+
postExtendedEnterTextAsync: async ({ sessionId, text, questionsAndAnswersHistory, }) => (0, apiFetcher_1.apiFetcher)(`/ExtendedEnterTextAsync/${sessionId}`, {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
apiUrl,
|
|
48
|
+
body: {
|
|
49
|
+
text,
|
|
50
|
+
questionsAndAnswersHistory,
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
40
53
|
postPlaceChangedEvent: async ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }) => (0, apiFetcher_1.apiFetcher)(`/PlaceChangedEvent/${sessionId}`, {
|
|
41
54
|
method: 'POST',
|
|
42
55
|
apiUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/engine/dialog.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAQ3C,SAAS,oBAAoB,CAAC,MAI7B;IACC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IACxC,MAAM,IAAI,GAIN,EAAE,IAAI,EAAE,CAAC;IACb,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,KAAK,EAAE,EAAE;QACrC,IAAI,CAAC,OAAO,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AAE,EAAE,CACnE,IAAA,uBAAU,EAAC,wBAAwB,SAAS,EAAE,EAAE;QAC9C,MAAM,EAAE,MAAM;QACd,MAAM;QACN,IAAI,EAAE,EAAE,MAAM,EAAE;KACjB,CAIA;IAQH,yBAAyB,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CACvE,IAAA,uBAAU,EAAC,0BAA0B,SAAS,EAAE,EAAE;QAChD,MAAM,EAAE,MAAM;QACd,MAAM;QACN,IAAI,EAAE,EAAE,QAAQ,EAAE;KACnB,CAIA;IAMH,qBAAqB,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACjD,IAAA,uBAAU,EAAC,sBAAsB,SAAS,EAAE,EAAE;QAC5C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;IAM7B,sBAAsB,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CAClD,IAAA,uBAAU,EAAC,uBAAuB,SAAS,EAAE,EAAE;QAC7C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;IAM7B,oBAAoB,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CAChD,IAAA,uBAAU,EAAC,qBAAqB,SAAS,EAAE,EAAE;QAC3C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;CAC9B,CAAC,CAAC"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -657,6 +657,12 @@ declare const _default: (apiUrl: string) => {
|
|
|
657
657
|
}) => Promise<import("./types").ResponseSpec & {
|
|
658
658
|
currentState: import("./types").DialogState;
|
|
659
659
|
}>;
|
|
660
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
661
|
+
sessionId: string;
|
|
662
|
+
text: string;
|
|
663
|
+
dateUTC?: string | null | undefined;
|
|
664
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
665
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
660
666
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
661
667
|
sessionId: string;
|
|
662
668
|
text: string;
|
|
@@ -667,6 +673,14 @@ declare const _default: (apiUrl: string) => {
|
|
|
667
673
|
}) => Promise<import("./types").ResponseSpec & {
|
|
668
674
|
currentState: import("./types").DialogState;
|
|
669
675
|
}>;
|
|
676
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
677
|
+
sessionId: string;
|
|
678
|
+
text: string;
|
|
679
|
+
questionsAndAnswersHistory: {
|
|
680
|
+
question: string;
|
|
681
|
+
answer: string;
|
|
682
|
+
}[];
|
|
683
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
670
684
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
671
685
|
sessionId: string;
|
|
672
686
|
placeName: string;
|
|
@@ -703,6 +717,12 @@ declare const _default: (apiUrl: string) => {
|
|
|
703
717
|
}) => Promise<import("./types").ResponseSpec & {
|
|
704
718
|
currentState: import("./types").DialogState;
|
|
705
719
|
}>;
|
|
720
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
721
|
+
sessionId: string;
|
|
722
|
+
text: string;
|
|
723
|
+
dateUTC?: string | null | undefined;
|
|
724
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
725
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
706
726
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
707
727
|
sessionId: string;
|
|
708
728
|
text: string;
|
|
@@ -713,6 +733,14 @@ declare const _default: (apiUrl: string) => {
|
|
|
713
733
|
}) => Promise<import("./types").ResponseSpec & {
|
|
714
734
|
currentState: import("./types").DialogState;
|
|
715
735
|
}>;
|
|
736
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
737
|
+
sessionId: string;
|
|
738
|
+
text: string;
|
|
739
|
+
questionsAndAnswersHistory: {
|
|
740
|
+
question: string;
|
|
741
|
+
answer: string;
|
|
742
|
+
}[];
|
|
743
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
716
744
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
717
745
|
sessionId: string;
|
|
718
746
|
placeName: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -666,6 +666,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
666
666
|
}) => Promise<import("./types").ResponseSpec & {
|
|
667
667
|
currentState: import("./types").DialogState;
|
|
668
668
|
}>;
|
|
669
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
670
|
+
sessionId: string;
|
|
671
|
+
text: string;
|
|
672
|
+
dateUTC?: string | null | undefined;
|
|
673
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
674
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
669
675
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
670
676
|
sessionId: string;
|
|
671
677
|
text: string;
|
|
@@ -676,6 +682,14 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
676
682
|
}) => Promise<import("./types").ResponseSpec & {
|
|
677
683
|
currentState: import("./types").DialogState;
|
|
678
684
|
}>;
|
|
685
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
686
|
+
sessionId: string;
|
|
687
|
+
text: string;
|
|
688
|
+
questionsAndAnswersHistory: {
|
|
689
|
+
question: string;
|
|
690
|
+
answer: string;
|
|
691
|
+
}[];
|
|
692
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
679
693
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
680
694
|
sessionId: string;
|
|
681
695
|
placeName: string;
|
|
@@ -712,6 +726,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
712
726
|
}) => Promise<import("./types").ResponseSpec & {
|
|
713
727
|
currentState: import("./types").DialogState;
|
|
714
728
|
}>;
|
|
729
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
730
|
+
sessionId: string;
|
|
731
|
+
text: string;
|
|
732
|
+
dateUTC?: string | null | undefined;
|
|
733
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
734
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
715
735
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
716
736
|
sessionId: string;
|
|
717
737
|
text: string;
|
|
@@ -722,6 +742,14 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
722
742
|
}) => Promise<import("./types").ResponseSpec & {
|
|
723
743
|
currentState: import("./types").DialogState;
|
|
724
744
|
}>;
|
|
745
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
746
|
+
sessionId: string;
|
|
747
|
+
text: string;
|
|
748
|
+
questionsAndAnswersHistory: {
|
|
749
|
+
question: string;
|
|
750
|
+
answer: string;
|
|
751
|
+
}[];
|
|
752
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
725
753
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
726
754
|
sessionId: string;
|
|
727
755
|
placeName: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export declare type ResponseSpec = {
|
|
|
10
10
|
resultCode: number;
|
|
11
11
|
resultMessage: string;
|
|
12
12
|
};
|
|
13
|
+
export declare type TextEnteredAsyncResponse = {
|
|
14
|
+
resultCode: number;
|
|
15
|
+
resultMessage: string;
|
|
16
|
+
correlationID: string;
|
|
17
|
+
};
|
|
13
18
|
export declare type MemoriConfig = {
|
|
14
19
|
memoriConfigID: string;
|
|
15
20
|
useCase: string;
|
package/esm/engine/dialog.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DialogState, Medium, PlaceSpecs, ResponseSpec } from '../types';
|
|
1
|
+
import { DialogState, Medium, PlaceSpecs, ResponseSpec, TextEnteredAsyncResponse } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
3
|
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
4
4
|
sessionId: string;
|
|
@@ -8,6 +8,12 @@ declare const _default: (apiUrl: string) => {
|
|
|
8
8
|
}) => Promise<ResponseSpec & {
|
|
9
9
|
currentState: DialogState;
|
|
10
10
|
}>;
|
|
11
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
12
|
+
sessionId: string;
|
|
13
|
+
text: string;
|
|
14
|
+
dateUTC?: string | null | undefined;
|
|
15
|
+
place?: PlaceSpecs | null | undefined;
|
|
16
|
+
}) => Promise<TextEnteredAsyncResponse>;
|
|
11
17
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
12
18
|
sessionId: string;
|
|
13
19
|
text: string;
|
|
@@ -18,6 +24,14 @@ declare const _default: (apiUrl: string) => {
|
|
|
18
24
|
}) => Promise<ResponseSpec & {
|
|
19
25
|
currentState: DialogState;
|
|
20
26
|
}>;
|
|
27
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
28
|
+
sessionId: string;
|
|
29
|
+
text: string;
|
|
30
|
+
questionsAndAnswersHistory: {
|
|
31
|
+
question: string;
|
|
32
|
+
answer: string;
|
|
33
|
+
}[];
|
|
34
|
+
}) => Promise<TextEnteredAsyncResponse>;
|
|
21
35
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
22
36
|
sessionId: string;
|
|
23
37
|
placeName: string;
|
package/esm/engine/dialog.js
CHANGED
|
@@ -27,6 +27,11 @@ export default (apiUrl) => ({
|
|
|
27
27
|
apiUrl,
|
|
28
28
|
body: buildTextEnteredBody({ text, dateUTC, place }),
|
|
29
29
|
}),
|
|
30
|
+
postEnterTextAsync: async ({ sessionId, text, dateUTC, place, }) => apiFetcher(`/TextEnteredEventAsync/${sessionId}`, {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
apiUrl,
|
|
33
|
+
body: buildTextEnteredBody({ text, dateUTC, place }),
|
|
34
|
+
}),
|
|
30
35
|
postTextEnteredEventExtended: async ({ sessionId, text, questionsAndAnswersHistory, }) => apiFetcher(`/ExtendedTextEnteredEvent/${sessionId}`, {
|
|
31
36
|
method: 'POST',
|
|
32
37
|
apiUrl,
|
|
@@ -35,6 +40,14 @@ export default (apiUrl) => ({
|
|
|
35
40
|
questionsAndAnswersHistory,
|
|
36
41
|
},
|
|
37
42
|
}),
|
|
43
|
+
postExtendedEnterTextAsync: async ({ sessionId, text, questionsAndAnswersHistory, }) => apiFetcher(`/ExtendedEnterTextAsync/${sessionId}`, {
|
|
44
|
+
method: 'POST',
|
|
45
|
+
apiUrl,
|
|
46
|
+
body: {
|
|
47
|
+
text,
|
|
48
|
+
questionsAndAnswersHistory,
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
38
51
|
postPlaceChangedEvent: async ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }) => apiFetcher(`/PlaceChangedEvent/${sessionId}`, {
|
|
39
52
|
method: 'POST',
|
|
40
53
|
apiUrl,
|
package/esm/engine/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/engine/dialog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,SAAS,oBAAoB,CAAC,MAI7B;IACC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IACxC,MAAM,IAAI,GAIN,EAAE,IAAI,EAAE,CAAC;IACb,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,KAAK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E,MAAc,EAAE,EAAE,CACnE,UAAU,CAAC,wBAAwB,SAAS,EAAE,EAAE;QAC9C,MAAM,EAAE,MAAM;QACd,MAAM;QACN,IAAI,EAAE,EAAE,MAAM,EAAE;KACjB,CAIA;IAQH,yBAAyB,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CACvE,UAAU,CAAC,0BAA0B,SAAS,EAAE,EAAE;QAChD,MAAM,EAAE,MAAM;QACd,MAAM;QACN,IAAI,EAAE,EAAE,QAAQ,EAAE;KACnB,CAIA;IAMH,qBAAqB,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACjD,UAAU,CAAC,sBAAsB,SAAS,EAAE,EAAE;QAC5C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;IAM7B,sBAAsB,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CAClD,UAAU,CAAC,uBAAuB,SAAS,EAAE,EAAE;QAC7C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;IAM7B,oBAAoB,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CAChD,UAAU,CAAC,qBAAqB,SAAS,EAAE,EAAE;QAC3C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;CAC9B,CAAC,CAAC"}
|
package/esm/engine.d.ts
CHANGED
|
@@ -657,6 +657,12 @@ declare const _default: (apiUrl: string) => {
|
|
|
657
657
|
}) => Promise<import("./types").ResponseSpec & {
|
|
658
658
|
currentState: import("./types").DialogState;
|
|
659
659
|
}>;
|
|
660
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
661
|
+
sessionId: string;
|
|
662
|
+
text: string;
|
|
663
|
+
dateUTC?: string | null | undefined;
|
|
664
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
665
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
660
666
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
661
667
|
sessionId: string;
|
|
662
668
|
text: string;
|
|
@@ -667,6 +673,14 @@ declare const _default: (apiUrl: string) => {
|
|
|
667
673
|
}) => Promise<import("./types").ResponseSpec & {
|
|
668
674
|
currentState: import("./types").DialogState;
|
|
669
675
|
}>;
|
|
676
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
677
|
+
sessionId: string;
|
|
678
|
+
text: string;
|
|
679
|
+
questionsAndAnswersHistory: {
|
|
680
|
+
question: string;
|
|
681
|
+
answer: string;
|
|
682
|
+
}[];
|
|
683
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
670
684
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
671
685
|
sessionId: string;
|
|
672
686
|
placeName: string;
|
|
@@ -703,6 +717,12 @@ declare const _default: (apiUrl: string) => {
|
|
|
703
717
|
}) => Promise<import("./types").ResponseSpec & {
|
|
704
718
|
currentState: import("./types").DialogState;
|
|
705
719
|
}>;
|
|
720
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
721
|
+
sessionId: string;
|
|
722
|
+
text: string;
|
|
723
|
+
dateUTC?: string | null | undefined;
|
|
724
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
725
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
706
726
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
707
727
|
sessionId: string;
|
|
708
728
|
text: string;
|
|
@@ -713,6 +733,14 @@ declare const _default: (apiUrl: string) => {
|
|
|
713
733
|
}) => Promise<import("./types").ResponseSpec & {
|
|
714
734
|
currentState: import("./types").DialogState;
|
|
715
735
|
}>;
|
|
736
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
737
|
+
sessionId: string;
|
|
738
|
+
text: string;
|
|
739
|
+
questionsAndAnswersHistory: {
|
|
740
|
+
question: string;
|
|
741
|
+
answer: string;
|
|
742
|
+
}[];
|
|
743
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
716
744
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
717
745
|
sessionId: string;
|
|
718
746
|
placeName: string;
|
package/esm/index.d.ts
CHANGED
|
@@ -666,6 +666,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
666
666
|
}) => Promise<import("./types").ResponseSpec & {
|
|
667
667
|
currentState: import("./types").DialogState;
|
|
668
668
|
}>;
|
|
669
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
670
|
+
sessionId: string;
|
|
671
|
+
text: string;
|
|
672
|
+
dateUTC?: string | null | undefined;
|
|
673
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
674
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
669
675
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
670
676
|
sessionId: string;
|
|
671
677
|
text: string;
|
|
@@ -676,6 +682,14 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
676
682
|
}) => Promise<import("./types").ResponseSpec & {
|
|
677
683
|
currentState: import("./types").DialogState;
|
|
678
684
|
}>;
|
|
685
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
686
|
+
sessionId: string;
|
|
687
|
+
text: string;
|
|
688
|
+
questionsAndAnswersHistory: {
|
|
689
|
+
question: string;
|
|
690
|
+
answer: string;
|
|
691
|
+
}[];
|
|
692
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
679
693
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
680
694
|
sessionId: string;
|
|
681
695
|
placeName: string;
|
|
@@ -712,6 +726,12 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
712
726
|
}) => Promise<import("./types").ResponseSpec & {
|
|
713
727
|
currentState: import("./types").DialogState;
|
|
714
728
|
}>;
|
|
729
|
+
postEnterTextAsync: ({ sessionId, text, dateUTC, place, }: {
|
|
730
|
+
sessionId: string;
|
|
731
|
+
text: string;
|
|
732
|
+
dateUTC?: string | null | undefined;
|
|
733
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
734
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
715
735
|
postTextEnteredEventExtended: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
716
736
|
sessionId: string;
|
|
717
737
|
text: string;
|
|
@@ -722,6 +742,14 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
722
742
|
}) => Promise<import("./types").ResponseSpec & {
|
|
723
743
|
currentState: import("./types").DialogState;
|
|
724
744
|
}>;
|
|
745
|
+
postExtendedEnterTextAsync: ({ sessionId, text, questionsAndAnswersHistory, }: {
|
|
746
|
+
sessionId: string;
|
|
747
|
+
text: string;
|
|
748
|
+
questionsAndAnswersHistory: {
|
|
749
|
+
question: string;
|
|
750
|
+
answer: string;
|
|
751
|
+
}[];
|
|
752
|
+
}) => Promise<import("./types").TextEnteredAsyncResponse>;
|
|
725
753
|
postPlaceChangedEvent: ({ sessionId, placeName, latitude, longitude, uncertaintyKm, }: {
|
|
726
754
|
sessionId: string;
|
|
727
755
|
placeName: string;
|
package/esm/types.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export declare type ResponseSpec = {
|
|
|
10
10
|
resultCode: number;
|
|
11
11
|
resultMessage: string;
|
|
12
12
|
};
|
|
13
|
+
export declare type TextEnteredAsyncResponse = {
|
|
14
|
+
resultCode: number;
|
|
15
|
+
resultMessage: string;
|
|
16
|
+
correlationID: string;
|
|
17
|
+
};
|
|
13
18
|
export declare type MemoriConfig = {
|
|
14
19
|
memoriConfigID: string;
|
|
15
20
|
useCase: string;
|
package/package.json
CHANGED
package/src/engine/dialog.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DialogState, Medium, PlaceSpecs, ResponseSpec } from '../types';
|
|
1
|
+
import { DialogState, Medium, PlaceSpecs, ResponseSpec, TextEnteredAsyncResponse } from '../types';
|
|
2
2
|
import { apiFetcher } from '../apiFetcher';
|
|
3
3
|
|
|
4
4
|
/******************
|
|
@@ -35,6 +35,7 @@ function buildTextEnteredBody(params: {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export default (apiUrl: string) => ({
|
|
38
|
+
|
|
38
39
|
/**
|
|
39
40
|
* Submits a Text Entered event to the session's Dialog State Machine.
|
|
40
41
|
* @param {object} params
|
|
@@ -64,6 +65,34 @@ export default (apiUrl: string) => ({
|
|
|
64
65
|
}
|
|
65
66
|
>,
|
|
66
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Submits a Text Entered event to the session's Dialog State Machine
|
|
70
|
+
* (fire-and-forget, returns 200 immediately).
|
|
71
|
+
* Identical to postTextEnteredEvent, except the immediate HTTP 200 response is a
|
|
72
|
+
* TextEnteredAsyncResponse with resultCode, resultMessage, and correlationID.
|
|
73
|
+
* @param {object} params
|
|
74
|
+
* @param {string} params.sessionId The session ID
|
|
75
|
+
* @param {string} params.text The text entered by the user
|
|
76
|
+
* @param {string} [params.dateUTC] Optional. Current date/time in UTC, ISO 8601 (e.g. 2026-03-16T12:00:00.000Z). If present, the backend updates the session's current date before processing.
|
|
77
|
+
* @param {PlaceSpecs} [params.place] Optional. Geographical context for the message (placeName, latitude, longitude, uncertaintyKm). latitude and longitude must be sent together if used.
|
|
78
|
+
*/
|
|
79
|
+
postEnterTextAsync: async ({
|
|
80
|
+
sessionId,
|
|
81
|
+
text,
|
|
82
|
+
dateUTC,
|
|
83
|
+
place,
|
|
84
|
+
}: {
|
|
85
|
+
sessionId: string;
|
|
86
|
+
text: string;
|
|
87
|
+
dateUTC?: string | null;
|
|
88
|
+
place?: PlaceSpecs | null;
|
|
89
|
+
}) =>
|
|
90
|
+
apiFetcher(`/TextEnteredEventAsync/${sessionId}`, {
|
|
91
|
+
method: 'POST',
|
|
92
|
+
apiUrl,
|
|
93
|
+
body: buildTextEnteredBody({ text, dateUTC, place }),
|
|
94
|
+
}) as Promise<TextEnteredAsyncResponse>,
|
|
95
|
+
|
|
67
96
|
/**
|
|
68
97
|
* Submits a Text Entered event to the session's Dialog State Machine.
|
|
69
98
|
* @param {object} params
|
|
@@ -96,6 +125,36 @@ export default (apiUrl: string) => ({
|
|
|
96
125
|
}
|
|
97
126
|
>,
|
|
98
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Submits a Text Entered event to the session's Dialog State Machine asynchronously.
|
|
130
|
+
* Identical to postTextEnteredEventExtended, except the immediate HTTP 200 response
|
|
131
|
+
* is a TextEnteredAsyncResponse with resultCode, resultMessage, and correlationID.
|
|
132
|
+
* @param {object} params
|
|
133
|
+
* @param {string} params.sessionId The session ID
|
|
134
|
+
* @param {string} params.text The text entered by the user
|
|
135
|
+
* @param {object} params.questionsAndAnswers The questions and answers to submit
|
|
136
|
+
*/
|
|
137
|
+
postExtendedEnterTextAsync: async ({
|
|
138
|
+
sessionId,
|
|
139
|
+
text,
|
|
140
|
+
questionsAndAnswersHistory,
|
|
141
|
+
}: {
|
|
142
|
+
sessionId: string;
|
|
143
|
+
text: string;
|
|
144
|
+
questionsAndAnswersHistory: {
|
|
145
|
+
question: string;
|
|
146
|
+
answer: string;
|
|
147
|
+
}[];
|
|
148
|
+
}) =>
|
|
149
|
+
apiFetcher(`/ExtendedEnterTextAsync/${sessionId}`, {
|
|
150
|
+
method: 'POST',
|
|
151
|
+
apiUrl,
|
|
152
|
+
body: {
|
|
153
|
+
text,
|
|
154
|
+
questionsAndAnswersHistory,
|
|
155
|
+
},
|
|
156
|
+
}) as Promise<TextEnteredAsyncResponse>,
|
|
157
|
+
|
|
99
158
|
/**
|
|
100
159
|
* Submits a Place Changed event to the session's Dialog State Machine.
|
|
101
160
|
* @param {object} params
|
package/src/types.ts
CHANGED
|
@@ -12,6 +12,12 @@ export declare type ResponseSpec = {
|
|
|
12
12
|
resultMessage: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
export declare type TextEnteredAsyncResponse = {
|
|
16
|
+
resultCode: number;
|
|
17
|
+
resultMessage: string;
|
|
18
|
+
correlationID: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
15
21
|
export declare type MemoriConfig = {
|
|
16
22
|
memoriConfigID: string;
|
|
17
23
|
useCase: string;
|