@memori.ai/memori-api-client 6.19.0 → 6.21.0
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 +4 -2
- package/dist/engine/dialog.js +24 -4
- package/dist/engine/dialog.js.map +1 -1
- package/dist/engine.d.ts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/types.d.ts +10 -0
- package/esm/engine/dialog.d.ts +4 -2
- package/esm/engine/dialog.js +24 -4
- package/esm/engine/dialog.js.map +1 -1
- package/esm/engine.d.ts +6 -2
- package/esm/index.d.ts +6 -2
- package/esm/types.d.ts +10 -0
- package/package.json +1 -1
- package/src/engine/dialog.ts +35 -4
- package/src/types.ts +30 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [6.21.0](https://github.com/memori-ai/memori-api-client/compare/v6.20.0...v6.21.0) (2026-04-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add scorm support and additional properties to types ([17941ca](https://github.com/memori-ai/memori-api-client/commit/17941ca846e582dc0effd3f023b085f944af87dd))
|
|
9
|
+
|
|
10
|
+
## [6.20.0](https://github.com/memori-ai/memori-api-client/compare/v6.19.0...v6.20.0) (2026-03-16)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add PlaceSpecs type and integrate into postTextEnteredEvent ([e860231](https://github.com/memori-ai/memori-api-client/commit/e860231f5ec6574b1a02d896b88feba2b96520f4))
|
|
16
|
+
|
|
3
17
|
## [6.19.0](https://github.com/memori-ai/memori-api-client/compare/v6.18.1...v6.19.0) (2026-02-09)
|
|
4
18
|
|
|
5
19
|
|
package/dist/engine/dialog.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { DialogState, Medium, ResponseSpec } from '../types';
|
|
1
|
+
import { DialogState, Medium, PlaceSpecs, ResponseSpec } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
3
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
4
4
|
sessionId: string;
|
|
5
5
|
text: string;
|
|
6
|
+
dateUTC?: string | null | undefined;
|
|
7
|
+
place?: PlaceSpecs | null | undefined;
|
|
6
8
|
}) => Promise<ResponseSpec & {
|
|
7
9
|
currentState: DialogState;
|
|
8
10
|
}>;
|
package/dist/engine/dialog.js
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const apiFetcher_1 = require("../apiFetcher");
|
|
4
|
+
function buildTextEnteredBody(params) {
|
|
5
|
+
const { text, dateUTC, place } = params;
|
|
6
|
+
const body = { text };
|
|
7
|
+
if (dateUTC != null && dateUTC !== '') {
|
|
8
|
+
body.dateUTC = dateUTC;
|
|
9
|
+
}
|
|
10
|
+
if (place != null && typeof place === 'object') {
|
|
11
|
+
const placeBody = {};
|
|
12
|
+
if (place.placeName != null)
|
|
13
|
+
placeBody.placeName = place.placeName;
|
|
14
|
+
if (place.latitude != null)
|
|
15
|
+
placeBody.latitude = place.latitude;
|
|
16
|
+
if (place.longitude != null)
|
|
17
|
+
placeBody.longitude = place.longitude;
|
|
18
|
+
if (place.uncertaintyKm != null)
|
|
19
|
+
placeBody.uncertaintyKm = place.uncertaintyKm;
|
|
20
|
+
if (Object.keys(placeBody).length > 0) {
|
|
21
|
+
body.place = placeBody;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return body;
|
|
25
|
+
}
|
|
4
26
|
exports.default = (apiUrl) => ({
|
|
5
|
-
postTextEnteredEvent: async ({ sessionId, text, }) => (0, apiFetcher_1.apiFetcher)(`/TextEnteredEvent/${sessionId}`, {
|
|
27
|
+
postTextEnteredEvent: async ({ sessionId, text, dateUTC, place, }) => (0, apiFetcher_1.apiFetcher)(`/TextEnteredEvent/${sessionId}`, {
|
|
6
28
|
method: 'POST',
|
|
7
29
|
apiUrl,
|
|
8
|
-
body: {
|
|
9
|
-
text,
|
|
10
|
-
},
|
|
30
|
+
body: buildTextEnteredBody({ text, dateUTC, place }),
|
|
11
31
|
}),
|
|
12
32
|
postTextEnteredEventExtended: async ({ sessionId, text, questionsAndAnswersHistory, }) => (0, apiFetcher_1.apiFetcher)(`/ExtendedTextEnteredEvent/${sessionId}`, {
|
|
13
33
|
method: 'POST',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/engine/dialog.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAQ3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;
|
|
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,GAAG,OAAO,CAAC;KACxB;IACD,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9C,MAAM,SAAS,GAAuD,EAAE,CAAC;QACzE,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI;YAAE,SAAS,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACnE,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI;YAAE,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAChE,IAAI,KAAK,CAAC,SAAS,IAA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D,IAAA,uBAAU,EAAC,qBAAqB,SAAS,EAAE,EAAE;QAC3C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;CAC9B,CAAC,CAAC"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -649,9 +649,11 @@ declare const _default: (apiUrl: string) => {
|
|
|
649
649
|
intentSlotID: string;
|
|
650
650
|
}>;
|
|
651
651
|
};
|
|
652
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
652
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
653
653
|
sessionId: string;
|
|
654
654
|
text: string;
|
|
655
|
+
dateUTC?: string | null | undefined;
|
|
656
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
655
657
|
}) => Promise<import("./types").ResponseSpec & {
|
|
656
658
|
currentState: import("./types").DialogState;
|
|
657
659
|
}>;
|
|
@@ -693,9 +695,11 @@ declare const _default: (apiUrl: string) => {
|
|
|
693
695
|
postPlaceSelectedEvent: (sessionId: string) => Promise<import("./types").ResponseSpec>;
|
|
694
696
|
postTagSelectedEvent: (sessionId: string) => Promise<import("./types").ResponseSpec>;
|
|
695
697
|
dialog: {
|
|
696
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
698
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
697
699
|
sessionId: string;
|
|
698
700
|
text: string;
|
|
701
|
+
dateUTC?: string | null | undefined;
|
|
702
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
699
703
|
}) => Promise<import("./types").ResponseSpec & {
|
|
700
704
|
currentState: import("./types").DialogState;
|
|
701
705
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -658,9 +658,11 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
658
658
|
intentSlotID: string;
|
|
659
659
|
}>;
|
|
660
660
|
};
|
|
661
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
661
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
662
662
|
sessionId: string;
|
|
663
663
|
text: string;
|
|
664
|
+
dateUTC?: string | null | undefined;
|
|
665
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
664
666
|
}) => Promise<import("./types").ResponseSpec & {
|
|
665
667
|
currentState: import("./types").DialogState;
|
|
666
668
|
}>;
|
|
@@ -702,9 +704,11 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
702
704
|
postPlaceSelectedEvent: (sessionId: string) => Promise<import("./types").ResponseSpec>;
|
|
703
705
|
postTagSelectedEvent: (sessionId: string) => Promise<import("./types").ResponseSpec>;
|
|
704
706
|
dialog: {
|
|
705
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
707
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
706
708
|
sessionId: string;
|
|
707
709
|
text: string;
|
|
710
|
+
dateUTC?: string | null | undefined;
|
|
711
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
708
712
|
}) => Promise<import("./types").ResponseSpec & {
|
|
709
713
|
currentState: import("./types").DialogState;
|
|
710
714
|
}>;
|
package/dist/types.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export declare type Memori = {
|
|
|
100
100
|
alwaysAnswerWithCompletion?: boolean;
|
|
101
101
|
disableAIContentCollection?: boolean;
|
|
102
102
|
requireLoginToken?: boolean;
|
|
103
|
+
scorm?: boolean;
|
|
103
104
|
};
|
|
104
105
|
export declare type CompletionConfig = {
|
|
105
106
|
completionConfigID: string;
|
|
@@ -140,6 +141,12 @@ export declare type Venue = {
|
|
|
140
141
|
longitude: number;
|
|
141
142
|
uncertainty?: number;
|
|
142
143
|
};
|
|
144
|
+
export declare type PlaceSpecs = {
|
|
145
|
+
placeName?: string | null;
|
|
146
|
+
latitude?: number | null;
|
|
147
|
+
longitude?: number | null;
|
|
148
|
+
uncertaintyKm?: number | null;
|
|
149
|
+
};
|
|
143
150
|
export declare type NominatimItem = {
|
|
144
151
|
place_id: number;
|
|
145
152
|
lat: number;
|
|
@@ -320,10 +327,13 @@ export declare type Tenant = {
|
|
|
320
327
|
adminCount?: number;
|
|
321
328
|
userCount?: number;
|
|
322
329
|
memoriCount?: number;
|
|
330
|
+
scormMemoriCount?: number;
|
|
331
|
+
ScormMemoriCount?: number;
|
|
323
332
|
disableRegistration?: boolean;
|
|
324
333
|
maxMemoriPerAdmin?: number;
|
|
325
334
|
maxMemoriPerUser?: number;
|
|
326
335
|
maxTotalMemori?: number;
|
|
336
|
+
maxScormMemori?: number;
|
|
327
337
|
maxAdmins?: number;
|
|
328
338
|
maxUsers?: number;
|
|
329
339
|
maxFreeSessions?: number;
|
package/esm/engine/dialog.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { DialogState, Medium, ResponseSpec } from '../types';
|
|
1
|
+
import { DialogState, Medium, PlaceSpecs, ResponseSpec } from '../types';
|
|
2
2
|
declare const _default: (apiUrl: string) => {
|
|
3
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
3
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
4
4
|
sessionId: string;
|
|
5
5
|
text: string;
|
|
6
|
+
dateUTC?: string | null | undefined;
|
|
7
|
+
place?: PlaceSpecs | null | undefined;
|
|
6
8
|
}) => Promise<ResponseSpec & {
|
|
7
9
|
currentState: DialogState;
|
|
8
10
|
}>;
|
package/esm/engine/dialog.js
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import { apiFetcher } from '../apiFetcher';
|
|
2
|
+
function buildTextEnteredBody(params) {
|
|
3
|
+
const { text, dateUTC, place } = params;
|
|
4
|
+
const body = { text };
|
|
5
|
+
if (dateUTC != null && dateUTC !== '') {
|
|
6
|
+
body.dateUTC = dateUTC;
|
|
7
|
+
}
|
|
8
|
+
if (place != null && typeof place === 'object') {
|
|
9
|
+
const placeBody = {};
|
|
10
|
+
if (place.placeName != null)
|
|
11
|
+
placeBody.placeName = place.placeName;
|
|
12
|
+
if (place.latitude != null)
|
|
13
|
+
placeBody.latitude = place.latitude;
|
|
14
|
+
if (place.longitude != null)
|
|
15
|
+
placeBody.longitude = place.longitude;
|
|
16
|
+
if (place.uncertaintyKm != null)
|
|
17
|
+
placeBody.uncertaintyKm = place.uncertaintyKm;
|
|
18
|
+
if (Object.keys(placeBody).length > 0) {
|
|
19
|
+
body.place = placeBody;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return body;
|
|
23
|
+
}
|
|
2
24
|
export default (apiUrl) => ({
|
|
3
|
-
postTextEnteredEvent: async ({ sessionId, text, }) => apiFetcher(`/TextEnteredEvent/${sessionId}`, {
|
|
25
|
+
postTextEnteredEvent: async ({ sessionId, text, dateUTC, place, }) => apiFetcher(`/TextEnteredEvent/${sessionId}`, {
|
|
4
26
|
method: 'POST',
|
|
5
27
|
apiUrl,
|
|
6
|
-
body: {
|
|
7
|
-
text,
|
|
8
|
-
},
|
|
28
|
+
body: buildTextEnteredBody({ text, dateUTC, place }),
|
|
9
29
|
}),
|
|
10
30
|
postTextEnteredEventExtended: async ({ sessionId, text, questionsAndAnswersHistory, }) => apiFetcher(`/ExtendedTextEnteredEvent/${sessionId}`, {
|
|
11
31
|
method: 'POST',
|
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,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;
|
|
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,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AAM,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
|
@@ -649,9 +649,11 @@ declare const _default: (apiUrl: string) => {
|
|
|
649
649
|
intentSlotID: string;
|
|
650
650
|
}>;
|
|
651
651
|
};
|
|
652
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
652
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
653
653
|
sessionId: string;
|
|
654
654
|
text: string;
|
|
655
|
+
dateUTC?: string | null | undefined;
|
|
656
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
655
657
|
}) => Promise<import("./types").ResponseSpec & {
|
|
656
658
|
currentState: import("./types").DialogState;
|
|
657
659
|
}>;
|
|
@@ -693,9 +695,11 @@ declare const _default: (apiUrl: string) => {
|
|
|
693
695
|
postPlaceSelectedEvent: (sessionId: string) => Promise<import("./types").ResponseSpec>;
|
|
694
696
|
postTagSelectedEvent: (sessionId: string) => Promise<import("./types").ResponseSpec>;
|
|
695
697
|
dialog: {
|
|
696
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
698
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
697
699
|
sessionId: string;
|
|
698
700
|
text: string;
|
|
701
|
+
dateUTC?: string | null | undefined;
|
|
702
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
699
703
|
}) => Promise<import("./types").ResponseSpec & {
|
|
700
704
|
currentState: import("./types").DialogState;
|
|
701
705
|
}>;
|
package/esm/index.d.ts
CHANGED
|
@@ -658,9 +658,11 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
658
658
|
intentSlotID: string;
|
|
659
659
|
}>;
|
|
660
660
|
};
|
|
661
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
661
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
662
662
|
sessionId: string;
|
|
663
663
|
text: string;
|
|
664
|
+
dateUTC?: string | null | undefined;
|
|
665
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
664
666
|
}) => Promise<import("./types").ResponseSpec & {
|
|
665
667
|
currentState: import("./types").DialogState;
|
|
666
668
|
}>;
|
|
@@ -702,9 +704,11 @@ declare const api: (backendEndpoint?: string, engineEndpoint?: string) => {
|
|
|
702
704
|
postPlaceSelectedEvent: (sessionId: string) => Promise<import("./types").ResponseSpec>;
|
|
703
705
|
postTagSelectedEvent: (sessionId: string) => Promise<import("./types").ResponseSpec>;
|
|
704
706
|
dialog: {
|
|
705
|
-
postTextEnteredEvent: ({ sessionId, text, }: {
|
|
707
|
+
postTextEnteredEvent: ({ sessionId, text, dateUTC, place, }: {
|
|
706
708
|
sessionId: string;
|
|
707
709
|
text: string;
|
|
710
|
+
dateUTC?: string | null | undefined;
|
|
711
|
+
place?: import("./types").PlaceSpecs | null | undefined;
|
|
708
712
|
}) => Promise<import("./types").ResponseSpec & {
|
|
709
713
|
currentState: import("./types").DialogState;
|
|
710
714
|
}>;
|
package/esm/types.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export declare type Memori = {
|
|
|
100
100
|
alwaysAnswerWithCompletion?: boolean;
|
|
101
101
|
disableAIContentCollection?: boolean;
|
|
102
102
|
requireLoginToken?: boolean;
|
|
103
|
+
scorm?: boolean;
|
|
103
104
|
};
|
|
104
105
|
export declare type CompletionConfig = {
|
|
105
106
|
completionConfigID: string;
|
|
@@ -140,6 +141,12 @@ export declare type Venue = {
|
|
|
140
141
|
longitude: number;
|
|
141
142
|
uncertainty?: number;
|
|
142
143
|
};
|
|
144
|
+
export declare type PlaceSpecs = {
|
|
145
|
+
placeName?: string | null;
|
|
146
|
+
latitude?: number | null;
|
|
147
|
+
longitude?: number | null;
|
|
148
|
+
uncertaintyKm?: number | null;
|
|
149
|
+
};
|
|
143
150
|
export declare type NominatimItem = {
|
|
144
151
|
place_id: number;
|
|
145
152
|
lat: number;
|
|
@@ -320,10 +327,13 @@ export declare type Tenant = {
|
|
|
320
327
|
adminCount?: number;
|
|
321
328
|
userCount?: number;
|
|
322
329
|
memoriCount?: number;
|
|
330
|
+
scormMemoriCount?: number;
|
|
331
|
+
ScormMemoriCount?: number;
|
|
323
332
|
disableRegistration?: boolean;
|
|
324
333
|
maxMemoriPerAdmin?: number;
|
|
325
334
|
maxMemoriPerUser?: number;
|
|
326
335
|
maxTotalMemori?: number;
|
|
336
|
+
maxScormMemori?: number;
|
|
327
337
|
maxAdmins?: number;
|
|
328
338
|
maxUsers?: number;
|
|
329
339
|
maxFreeSessions?: number;
|
package/package.json
CHANGED
package/src/engine/dialog.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DialogState, Medium, ResponseSpec } from '../types';
|
|
1
|
+
import { DialogState, Medium, PlaceSpecs, ResponseSpec } from '../types';
|
|
2
2
|
import { apiFetcher } from '../apiFetcher';
|
|
3
3
|
|
|
4
4
|
/******************
|
|
@@ -7,26 +7,57 @@ import { apiFetcher } from '../apiFetcher';
|
|
|
7
7
|
* *
|
|
8
8
|
******************/
|
|
9
9
|
|
|
10
|
+
function buildTextEnteredBody(params: {
|
|
11
|
+
text: string;
|
|
12
|
+
dateUTC?: string | null;
|
|
13
|
+
place?: PlaceSpecs | null;
|
|
14
|
+
}) {
|
|
15
|
+
const { text, dateUTC, place } = params;
|
|
16
|
+
const body: {
|
|
17
|
+
text: string;
|
|
18
|
+
dateUTC?: string;
|
|
19
|
+
place?: Record<string, number | string | null | undefined>;
|
|
20
|
+
} = { text };
|
|
21
|
+
if (dateUTC != null && dateUTC !== '') {
|
|
22
|
+
body.dateUTC = dateUTC;
|
|
23
|
+
}
|
|
24
|
+
if (place != null && typeof place === 'object') {
|
|
25
|
+
const placeBody: Record<string, number | string | null | undefined> = {};
|
|
26
|
+
if (place.placeName != null) placeBody.placeName = place.placeName;
|
|
27
|
+
if (place.latitude != null) placeBody.latitude = place.latitude;
|
|
28
|
+
if (place.longitude != null) placeBody.longitude = place.longitude;
|
|
29
|
+
if (place.uncertaintyKm != null) placeBody.uncertaintyKm = place.uncertaintyKm;
|
|
30
|
+
if (Object.keys(placeBody).length > 0) {
|
|
31
|
+
body.place = placeBody;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return body;
|
|
35
|
+
}
|
|
36
|
+
|
|
10
37
|
export default (apiUrl: string) => ({
|
|
11
38
|
/**
|
|
12
39
|
* Submits a Text Entered event to the session's Dialog State Machine.
|
|
13
40
|
* @param {object} params
|
|
14
41
|
* @param {string} params.sessionId The session ID
|
|
15
42
|
* @param {string} params.text The text entered by the user
|
|
43
|
+
* @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.
|
|
44
|
+
* @param {PlaceSpecs} [params.place] Optional. Geographical context for the message (placeName, latitude, longitude, uncertaintyKm). latitude and longitude must be sent together if used.
|
|
16
45
|
*/
|
|
17
46
|
postTextEnteredEvent: async ({
|
|
18
47
|
sessionId,
|
|
19
48
|
text,
|
|
49
|
+
dateUTC,
|
|
50
|
+
place,
|
|
20
51
|
}: {
|
|
21
52
|
sessionId: string;
|
|
22
53
|
text: string;
|
|
54
|
+
dateUTC?: string | null;
|
|
55
|
+
place?: PlaceSpecs | null;
|
|
23
56
|
}) =>
|
|
24
57
|
apiFetcher(`/TextEnteredEvent/${sessionId}`, {
|
|
25
58
|
method: 'POST',
|
|
26
59
|
apiUrl,
|
|
27
|
-
body: {
|
|
28
|
-
text,
|
|
29
|
-
},
|
|
60
|
+
body: buildTextEnteredBody({ text, dateUTC, place }),
|
|
30
61
|
}) as Promise<
|
|
31
62
|
ResponseSpec & {
|
|
32
63
|
currentState: DialogState;
|
package/src/types.ts
CHANGED
|
@@ -123,6 +123,12 @@ export declare type Memori = {
|
|
|
123
123
|
alwaysAnswerWithCompletion?: boolean;
|
|
124
124
|
disableAIContentCollection?: boolean;
|
|
125
125
|
requireLoginToken?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* If True the Memori is a SCORM Memori.
|
|
128
|
+
* Once enabled, this flag cannot be reverted through update operations.
|
|
129
|
+
* To remove SCORM status, the Memori must be deleted.
|
|
130
|
+
*/
|
|
131
|
+
scorm?: boolean;
|
|
126
132
|
};
|
|
127
133
|
|
|
128
134
|
export declare type CompletionConfig = {
|
|
@@ -315,6 +321,21 @@ export declare type Venue = {
|
|
|
315
321
|
uncertainty?: number;
|
|
316
322
|
};
|
|
317
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Geographical context for a message (e.g. Text Entered event).
|
|
326
|
+
* All fields are optional. When using coordinates, latitude and longitude must be provided together.
|
|
327
|
+
*/
|
|
328
|
+
export declare type PlaceSpecs = {
|
|
329
|
+
/** Place name (e.g. "London"); if lat/lon are omitted, the backend may geocode from this. */
|
|
330
|
+
placeName?: string | null;
|
|
331
|
+
/** Latitude; must be sent together with longitude when using coordinates. */
|
|
332
|
+
latitude?: number | null;
|
|
333
|
+
/** Longitude; must be sent together with latitude when using coordinates. */
|
|
334
|
+
longitude?: number | null;
|
|
335
|
+
/** Radius of uncertainty in km (e.g. 20.0). */
|
|
336
|
+
uncertaintyKm?: number | null;
|
|
337
|
+
};
|
|
338
|
+
|
|
318
339
|
export declare type NominatimItem = {
|
|
319
340
|
place_id: number;
|
|
320
341
|
lat: number;
|
|
@@ -564,10 +585,19 @@ export declare type Tenant = {
|
|
|
564
585
|
adminCount?: number;
|
|
565
586
|
userCount?: number;
|
|
566
587
|
memoriCount?: number;
|
|
588
|
+
/**
|
|
589
|
+
* Number of SCORM Memori in this Tenant.
|
|
590
|
+
*/
|
|
591
|
+
scormMemoriCount?: number;
|
|
592
|
+
/**
|
|
593
|
+
* Alias kept for backend payloads that expose PascalCase.
|
|
594
|
+
*/
|
|
595
|
+
ScormMemoriCount?: number;
|
|
567
596
|
disableRegistration?: boolean;
|
|
568
597
|
maxMemoriPerAdmin?: number;
|
|
569
598
|
maxMemoriPerUser?: number;
|
|
570
599
|
maxTotalMemori?: number;
|
|
600
|
+
maxScormMemori?: number;
|
|
571
601
|
maxAdmins?: number;
|
|
572
602
|
maxUsers?: number;
|
|
573
603
|
maxFreeSessions?: number;
|