@microsoft/agents-hosting-dialogs 1.0.0 → 1.0.7-g73d3d58001
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/src/agentStateSet.d.ts +30 -27
- package/dist/src/agentStateSet.js +30 -27
- package/dist/src/agentStateSet.js.map +1 -1
- package/dist/src/choices/findValues.d.ts +21 -12
- package/dist/src/choices/findValues.js +8 -5
- package/dist/src/choices/findValues.js.map +1 -1
- package/dist/src/componentDialog.d.ts +117 -95
- package/dist/src/componentDialog.js +106 -84
- package/dist/src/componentDialog.js.map +1 -1
- package/dist/src/dialog.d.ts +15 -10
- package/dist/src/dialog.js +15 -10
- package/dist/src/dialog.js.map +1 -1
- package/dist/src/dialogContainer.d.ts +5 -2
- package/dist/src/dialogContainer.js +5 -2
- package/dist/src/dialogContainer.js.map +1 -1
- package/dist/src/dialogContext.d.ts +33 -12
- package/dist/src/dialogContext.js +33 -13
- package/dist/src/dialogContext.js.map +1 -1
- package/dist/src/dialogInstance.d.ts +11 -11
- package/dist/src/dialogReason.d.ts +13 -13
- package/dist/src/dialogReason.js +13 -13
- package/dist/src/dialogReason.js.map +1 -1
- package/dist/src/dialogSet.d.ts +12 -7
- package/dist/src/dialogSet.js +10 -5
- package/dist/src/dialogSet.js.map +1 -1
- package/dist/src/dialogTurnResult.d.ts +1 -0
- package/dist/src/dialogTurnStateConstants.d.ts +1 -0
- package/dist/src/dialogTurnStateConstants.js +1 -0
- package/dist/src/dialogTurnStateConstants.js.map +1 -1
- package/dist/src/dialogTurnStatus.d.ts +1 -0
- package/dist/src/dialogTurnStatus.js +1 -0
- package/dist/src/dialogTurnStatus.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/memory/dialogPath.d.ts +8 -8
- package/dist/src/memory/dialogPath.js +8 -8
- package/dist/src/memory/dialogStateManager.d.ts +9 -4
- package/dist/src/memory/dialogStateManager.js +9 -4
- package/dist/src/memory/dialogStateManager.js.map +1 -1
- package/dist/src/memory/turnPath.d.ts +12 -12
- package/dist/src/memory/turnPath.js +12 -12
- package/dist/src/prompts/activityPrompt.d.ts +4 -0
- package/dist/src/prompts/activityPrompt.js +4 -0
- package/dist/src/prompts/activityPrompt.js.map +1 -1
- package/dist/src/prompts/attachmentPrompt.d.ts +1 -0
- package/dist/src/prompts/attachmentPrompt.js +1 -0
- package/dist/src/prompts/attachmentPrompt.js.map +1 -1
- package/dist/src/prompts/choicePrompt.d.ts +4 -0
- package/dist/src/prompts/choicePrompt.js +1 -0
- package/dist/src/prompts/choicePrompt.js.map +1 -1
- package/dist/src/prompts/confirmPrompt.d.ts +4 -1
- package/dist/src/prompts/confirmPrompt.js +1 -0
- package/dist/src/prompts/confirmPrompt.js.map +1 -1
- package/dist/src/prompts/datetimePrompt.d.ts +1 -0
- package/dist/src/prompts/datetimePrompt.js +1 -0
- package/dist/src/prompts/datetimePrompt.js.map +1 -1
- package/dist/src/prompts/numberPrompt.d.ts +1 -0
- package/dist/src/prompts/numberPrompt.js +1 -0
- package/dist/src/prompts/numberPrompt.js.map +1 -1
- package/dist/src/prompts/prompt.d.ts +24 -8
- package/dist/src/prompts/prompt.js +8 -0
- package/dist/src/prompts/prompt.js.map +1 -1
- package/dist/src/prompts/promptCultureModels.d.ts +16 -1
- package/dist/src/prompts/promptCultureModels.js +4 -1
- package/dist/src/prompts/promptCultureModels.js.map +1 -1
- package/dist/src/prompts/textPrompt.d.ts +3 -0
- package/dist/src/prompts/textPrompt.js +3 -0
- package/dist/src/prompts/textPrompt.js.map +1 -1
- package/dist/src/recognizer.d.ts +3 -0
- package/dist/src/recognizer.js +1 -0
- package/dist/src/recognizer.js.map +1 -1
- package/dist/src/recognizerResult.d.ts +5 -4
- package/dist/src/recognizerResult.js +5 -4
- package/dist/src/recognizerResult.js.map +1 -1
- package/dist/src/stringUtils.d.ts +4 -3
- package/dist/src/stringUtils.js +4 -3
- package/dist/src/stringUtils.js.map +1 -1
- package/dist/src/waterfallDialog.d.ts +11 -4
- package/dist/src/waterfallDialog.js +11 -4
- package/dist/src/waterfallDialog.js.map +1 -1
- package/package.json +2 -2
- package/src/agentStateSet.ts +30 -27
- package/src/choices/findValues.ts +21 -12
- package/src/componentDialog.ts +127 -97
- package/src/dialog.ts +15 -10
- package/src/dialogContainer.ts +5 -2
- package/src/dialogContext.ts +41 -15
- package/src/dialogInstance.ts +11 -11
- package/src/dialogReason.ts +13 -13
- package/src/dialogSet.ts +12 -7
- package/src/dialogTurnResult.ts +1 -0
- package/src/dialogTurnStateConstants.ts +1 -0
- package/src/dialogTurnStatus.ts +1 -0
- package/src/index.ts +3 -0
- package/src/memory/dialogPath.ts +8 -8
- package/src/memory/dialogStateManager.ts +9 -4
- package/src/memory/turnPath.ts +12 -12
- package/src/prompts/activityPrompt.ts +4 -0
- package/src/prompts/attachmentPrompt.ts +1 -0
- package/src/prompts/choicePrompt.ts +4 -0
- package/src/prompts/confirmPrompt.ts +4 -1
- package/src/prompts/datetimePrompt.ts +1 -0
- package/src/prompts/numberPrompt.ts +1 -0
- package/src/prompts/prompt.ts +24 -8
- package/src/prompts/promptCultureModels.ts +16 -1
- package/src/prompts/textPrompt.ts +3 -0
- package/src/recognizer.ts +3 -0
- package/src/recognizerResult.ts +5 -4
- package/src/stringUtils.ts +4 -3
- package/src/waterfallDialog.ts +11 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirmPrompt.js","sourceRoot":"","sources":["../../../src/prompts/confirmPrompt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,gFAAiE;AAEjE,wCAA2E;AAC3E,qCAAoG;AACpG,+DAA2D;
|
|
1
|
+
{"version":3,"file":"confirmPrompt.js","sourceRoot":"","sources":["../../../src/prompts/confirmPrompt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,gFAAiE;AAEjE,wCAA2E;A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QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAhKD,sCAgKC"}
|
|
@@ -24,6 +24,7 @@ export interface DateTimeResolution {
|
|
|
24
24
|
*
|
|
25
25
|
* @remarks
|
|
26
26
|
* By default the prompt will return to the calling dialog a {@link DateTimeResolution | DateTimeResolution[] }.
|
|
27
|
+
*
|
|
27
28
|
*/
|
|
28
29
|
export declare class DateTimePrompt extends Prompt<DateTimeResolution[]> {
|
|
29
30
|
/**
|
|
@@ -46,6 +46,7 @@ const agents_activity_1 = require("@microsoft/agents-activity");
|
|
|
46
46
|
*
|
|
47
47
|
* @remarks
|
|
48
48
|
* By default the prompt will return to the calling dialog a {@link DateTimeResolution | DateTimeResolution[] }.
|
|
49
|
+
*
|
|
49
50
|
*/
|
|
50
51
|
class DateTimePrompt extends prompt_1.Prompt {
|
|
51
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetimePrompt.js","sourceRoot":"","sources":["../../../src/prompts/datetimePrompt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,mFAAoE;AAEpE,qCAAyF;AACzF,gEAAiE;AAwBjE
|
|
1
|
+
{"version":3,"file":"datetimePrompt.js","sourceRoot":"","sources":["../../../src/prompts/datetimePrompt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,mFAAoE;AAEpE,qCAAyF;AACzF,gEAAiE;AAwBjE;;;;;;GAMG;AACH,MAAa,cAAe,SAAQ,eAA4B;IAM9D;;;;;;SAMK;IACL,YAAa,QAAgB,EAAE,SAAiD,EAAE,aAAsB;QACtG,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;QAC1B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,CAAC;IAED;;;;;;;;;;;SAWK;IACK,KAAK,CAAC,QAAQ,CACtB,OAAoB,EACpB,KAAU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@remarks
|
|
11
11
|
* By default the prompt will return to the calling dialog a `number` representing the users input.
|
|
12
|
+
*
|
|
12
13
|
*/
|
|
13
14
|
export declare class NumberPrompt extends Prompt<number> {
|
|
14
15
|
/**
|
|
@@ -53,6 +53,7 @@ Object.values(locales).forEach((locale) => globalize_1.default.load(locale));
|
|
|
53
53
|
*
|
|
54
54
|
* @remarks
|
|
55
55
|
* By default the prompt will return to the calling dialog a `number` representing the users input.
|
|
56
|
+
*
|
|
56
57
|
*/
|
|
57
58
|
class NumberPrompt extends prompt_1.Prompt {
|
|
58
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberPrompt.js","sourceRoot":"","sources":["../../../src/prompts/numberPrompt.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0DAAiC;AACjC,gFAAoE;AACpE,iDAAkC;AAElC,qCAAyF;AACzF,gEAAuD;AAEvD,qDAAqD;AACrD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,mBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAElE
|
|
1
|
+
{"version":3,"file":"numberPrompt.js","sourceRoot":"","sources":["../../../src/prompts/numberPrompt.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0DAAiC;AACjC,gFAAoE;AACpE,iDAAkC;AAElC,qCAAyF;AACzF,gEAAuD;AAEvD,qDAAqD;AACrD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,mBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAElE;;;;;;GAMG;AACH,MAAa,YAAa,SAAQ,eAAc;IAM9C;;;;;;SAMK;IACL,YAAa,QAAgB,EAAE,SA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YAChC,MAAM,MAAM,GAAG,IAAA,mBAAS,EAAC,IAAI,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC,CAAA;YACtE,IAAI,YAAuC,CAAA;YAC3C,IAAI,CAAC;gBACH,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,CAAA;YACtC,CAAC;YAAC,MAAM,CAAC;gBACP,YAAY,GAAG,IAAA,mBAAS,EAAC,IAAI,CAAC,+BAA+B,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EAAE,CAAA;YAC9F,CAAC;YAED,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAC/C,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAED;;;SAGK;IACG,+BAA+B,CAAE,OAAe;QACtD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;IAC1C,CAAC;CACF;AAhGD,oCAgGC"}
|
|
@@ -88,7 +88,10 @@ export interface PromptRecognizerResult<T> {
|
|
|
88
88
|
value?: T;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* Function signature for providing a custom prompt validator.
|
|
92
|
+
*
|
|
93
|
+
* @param T Type of recognizer result being validated.
|
|
94
|
+
* @param prompt Contextual information containing the recognizer result and original options passed to the prompt.
|
|
92
95
|
*
|
|
93
96
|
* @remarks
|
|
94
97
|
* The validator should be an asynchronous function that returns `true` if
|
|
@@ -103,8 +106,7 @@ export interface PromptRecognizerResult<T> {
|
|
|
103
106
|
* ```typescript
|
|
104
107
|
* type PromptValidator<T> = (prompt: PromptValidatorContext<T>) => Promise<boolean>;
|
|
105
108
|
* ```
|
|
106
|
-
*
|
|
107
|
-
* @param prompt Contextual information containing the recognizer result and original options passed to the prompt.
|
|
109
|
+
*
|
|
108
110
|
*/
|
|
109
111
|
export type PromptValidator<T> = (prompt: PromptValidatorContext<T>) => Promise<boolean>;
|
|
110
112
|
/**
|
|
@@ -118,14 +120,16 @@ export interface PromptValidatorContext<T> {
|
|
|
118
120
|
*
|
|
119
121
|
* @remarks
|
|
120
122
|
* The validator can use this to re-prompt the user.
|
|
123
|
+
*
|
|
121
124
|
*/
|
|
122
125
|
readonly context: TurnContext;
|
|
123
126
|
/**
|
|
124
127
|
* Result returned from the prompts recognizer function.
|
|
125
128
|
*
|
|
126
129
|
* @remarks
|
|
127
|
-
* The {@link
|
|
128
|
-
* anything and then the value can be retrieved from {@link
|
|
130
|
+
* The {@link PromptRecognizerResult.succeeded | recognized.succeeded} field can be checked to determine of the recognizer found
|
|
131
|
+
* anything and then the value can be retrieved from {@link PromptRecognizerResult.value | recognized.value}.
|
|
132
|
+
*
|
|
129
133
|
*/
|
|
130
134
|
readonly recognized: PromptRecognizerResult<T>;
|
|
131
135
|
/**
|
|
@@ -133,6 +137,7 @@ export interface PromptValidatorContext<T> {
|
|
|
133
137
|
*
|
|
134
138
|
* @remarks
|
|
135
139
|
* The validator can use this to persist things like turn counts or other state information.
|
|
140
|
+
*
|
|
136
141
|
*/
|
|
137
142
|
readonly state: object;
|
|
138
143
|
/**
|
|
@@ -140,12 +145,14 @@ export interface PromptValidatorContext<T> {
|
|
|
140
145
|
*
|
|
141
146
|
* @remarks
|
|
142
147
|
* The validator can extend this interface to support additional prompt options.
|
|
148
|
+
*
|
|
143
149
|
*/
|
|
144
150
|
readonly options: PromptOptions;
|
|
145
151
|
/**
|
|
146
152
|
* A count of the number of times the prompt has been executed.
|
|
147
153
|
*
|
|
148
154
|
* A number indicating how many times the prompt was invoked (starting at 1 for the first time it was invoked).
|
|
155
|
+
*
|
|
149
156
|
*/
|
|
150
157
|
readonly attemptCount: number;
|
|
151
158
|
}
|
|
@@ -171,9 +178,11 @@ export declare abstract class Prompt<T> extends Dialog {
|
|
|
171
178
|
* @param options Optional. PromptOptions,
|
|
172
179
|
* additional information to pass to the prompt being started.
|
|
173
180
|
* @returns A `Promise` representing the asynchronous operation.
|
|
181
|
+
*
|
|
174
182
|
* @remarks
|
|
175
183
|
* If the task is successful, the result indicates whether the prompt is still
|
|
176
184
|
* active after the turn has been processed by the prompt.
|
|
185
|
+
*
|
|
177
186
|
*/
|
|
178
187
|
beginDialog(dialogContext: DialogContext, options: PromptOptions): Promise<DialogTurnResult>;
|
|
179
188
|
/**
|
|
@@ -181,11 +190,13 @@ export declare abstract class Prompt<T> extends Dialog {
|
|
|
181
190
|
*
|
|
182
191
|
* @param dialogContext The DialogContext for the current turn of conversation.
|
|
183
192
|
* @returns A `Promise` representing the asynchronous operation.
|
|
193
|
+
*
|
|
184
194
|
* @remarks
|
|
185
195
|
* If the task is successful, the result indicates whether the dialog is still
|
|
186
196
|
* active after the turn has been processed by the dialog.
|
|
187
197
|
* The prompt generally continues to receive the user's replies until it accepts the
|
|
188
198
|
* user's reply as valid input for the prompt.
|
|
199
|
+
*
|
|
189
200
|
*/
|
|
190
201
|
continueDialog(dialogContext: DialogContext): Promise<DialogTurnResult>;
|
|
191
202
|
/**
|
|
@@ -194,10 +205,12 @@ export declare abstract class Prompt<T> extends Dialog {
|
|
|
194
205
|
* @param dialogContext The DialogContext for the current turn of conversation.
|
|
195
206
|
* @param event DialogEvent, the event being raised.
|
|
196
207
|
* @returns Whether the event is handled by the current dialog and further processing should stop.
|
|
208
|
+
*
|
|
197
209
|
* @remarks
|
|
198
210
|
* This is a good place to perform interception of an event as returning `true` will prevent
|
|
199
211
|
* any further bubbling of the event to the dialogs parents and will also prevent any child
|
|
200
212
|
* dialogs from performing their default processing.
|
|
213
|
+
*
|
|
201
214
|
*/
|
|
202
215
|
protected onPreBubbleEvent(dialogContext: DialogContext, event: DialogEvent): Promise<boolean>;
|
|
203
216
|
/**
|
|
@@ -209,9 +222,11 @@ export declare abstract class Prompt<T> extends Dialog {
|
|
|
209
222
|
* @param _result Optional, value returned from the previous dialog on the stack.
|
|
210
223
|
* The type of the value returned is dependent on the previous dialog.
|
|
211
224
|
* @returns A Promise representing the asynchronous operation.
|
|
225
|
+
*
|
|
212
226
|
* @remarks
|
|
213
227
|
* If the task is successful, the result indicates whether the dialog is still
|
|
214
228
|
* active after the turn has been processed by the dialog.
|
|
229
|
+
*
|
|
215
230
|
*/
|
|
216
231
|
resumeDialog(dialogContext: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult>;
|
|
217
232
|
/**
|
|
@@ -236,12 +251,13 @@ export declare abstract class Prompt<T> extends Dialog {
|
|
|
236
251
|
/**
|
|
237
252
|
* Called to recognize an utterance received from the user.
|
|
238
253
|
*
|
|
239
|
-
* @remarks
|
|
240
|
-
* The Prompt class filters out non-message activities so its safe to assume that the users
|
|
241
|
-
* utterance can be retrieved from `context.activity.text`.
|
|
242
254
|
* @param context Context for the current turn of conversation with the user.
|
|
243
255
|
* @param state Additional state being persisted for the prompt.
|
|
244
256
|
* @param options Options that the prompt was started with in the call to `DialogContext.prompt()`.
|
|
257
|
+
*
|
|
258
|
+
* @remarks
|
|
259
|
+
* The Prompt class filters out non-message activities so its safe to assume that the users
|
|
260
|
+
* utterance can be retrieved from `context.activity.text`.
|
|
245
261
|
*/
|
|
246
262
|
protected abstract onRecognize(context: TurnContext, state: object, options: PromptOptions): Promise<PromptRecognizerResult<T>>;
|
|
247
263
|
/**
|
|
@@ -64,9 +64,11 @@ class Prompt extends dialog_1.Dialog {
|
|
|
64
64
|
* @param options Optional. PromptOptions,
|
|
65
65
|
* additional information to pass to the prompt being started.
|
|
66
66
|
* @returns A `Promise` representing the asynchronous operation.
|
|
67
|
+
*
|
|
67
68
|
* @remarks
|
|
68
69
|
* If the task is successful, the result indicates whether the prompt is still
|
|
69
70
|
* active after the turn has been processed by the prompt.
|
|
71
|
+
*
|
|
70
72
|
*/
|
|
71
73
|
async beginDialog(dialogContext, options) {
|
|
72
74
|
// Ensure prompts have input hint set
|
|
@@ -90,11 +92,13 @@ class Prompt extends dialog_1.Dialog {
|
|
|
90
92
|
*
|
|
91
93
|
* @param dialogContext The DialogContext for the current turn of conversation.
|
|
92
94
|
* @returns A `Promise` representing the asynchronous operation.
|
|
95
|
+
*
|
|
93
96
|
* @remarks
|
|
94
97
|
* If the task is successful, the result indicates whether the dialog is still
|
|
95
98
|
* active after the turn has been processed by the dialog.
|
|
96
99
|
* The prompt generally continues to receive the user's replies until it accepts the
|
|
97
100
|
* user's reply as valid input for the prompt.
|
|
101
|
+
*
|
|
98
102
|
*/
|
|
99
103
|
async continueDialog(dialogContext) {
|
|
100
104
|
// Don't do anything for non-message activities
|
|
@@ -147,10 +151,12 @@ class Prompt extends dialog_1.Dialog {
|
|
|
147
151
|
* @param dialogContext The DialogContext for the current turn of conversation.
|
|
148
152
|
* @param event DialogEvent, the event being raised.
|
|
149
153
|
* @returns Whether the event is handled by the current dialog and further processing should stop.
|
|
154
|
+
*
|
|
150
155
|
* @remarks
|
|
151
156
|
* This is a good place to perform interception of an event as returning `true` will prevent
|
|
152
157
|
* any further bubbling of the event to the dialogs parents and will also prevent any child
|
|
153
158
|
* dialogs from performing their default processing.
|
|
159
|
+
*
|
|
154
160
|
*/
|
|
155
161
|
async onPreBubbleEvent(dialogContext, event) {
|
|
156
162
|
if (event.name === 'activityReceived' && dialogContext.context.activity.type === agents_activity_1.ActivityTypes.Message) {
|
|
@@ -170,9 +176,11 @@ class Prompt extends dialog_1.Dialog {
|
|
|
170
176
|
* @param _result Optional, value returned from the previous dialog on the stack.
|
|
171
177
|
* The type of the value returned is dependent on the previous dialog.
|
|
172
178
|
* @returns A Promise representing the asynchronous operation.
|
|
179
|
+
*
|
|
173
180
|
* @remarks
|
|
174
181
|
* If the task is successful, the result indicates whether the dialog is still
|
|
175
182
|
* active after the turn has been processed by the dialog.
|
|
183
|
+
*
|
|
176
184
|
*/
|
|
177
185
|
async resumeDialog(dialogContext, _reason, _result) {
|
|
178
186
|
// Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/prompts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,GAAG,CAAC,gBAAgB,CAAA;YAChD,CAAC;YAED,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;gBACpB,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;oBACvB,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;gBACjE,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAA;gBACtC,CAAC;YACH,CAAC;YAED,OAAO,MAAM,CAAA;QACf,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,SAAS,GAAG,4BAAU,CAAC,cAAc,CAAA;YAEzC,OAAO,GAAG,CAAA;QACZ,CAAC;IACH,CAAC;CACF;AA5RD,wBA4RC"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
export interface PromptCultureModel {
|
|
7
7
|
/**
|
|
8
8
|
* The locale identifier for this culture model.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
9
11
|
* This follows the standard IETF language tag format (e.g., "en-US", "fr-FR", "ja-JP").
|
|
10
12
|
* Used to identify the target language and region for localization.
|
|
11
13
|
*
|
|
@@ -19,6 +21,8 @@ export interface PromptCultureModel {
|
|
|
19
21
|
locale: string;
|
|
20
22
|
/**
|
|
21
23
|
* The separator string used to delimit items in a list when presenting choices.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
22
26
|
* This is typically used between items in the middle of a list, not before the final item.
|
|
23
27
|
*
|
|
24
28
|
* @example
|
|
@@ -29,6 +33,8 @@ export interface PromptCultureModel {
|
|
|
29
33
|
separator: string;
|
|
30
34
|
/**
|
|
31
35
|
* The conjunction string used before the final item in a two-item list.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
32
38
|
* This is used when presenting exactly two choices to the user.
|
|
33
39
|
*
|
|
34
40
|
* @example
|
|
@@ -41,6 +47,8 @@ export interface PromptCultureModel {
|
|
|
41
47
|
inlineOr: string;
|
|
42
48
|
/**
|
|
43
49
|
* The conjunction string used before the final item in a list of three or more items.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
44
52
|
* This combines with the separator to create properly formatted choice lists.
|
|
45
53
|
*
|
|
46
54
|
* @example
|
|
@@ -53,6 +61,8 @@ export interface PromptCultureModel {
|
|
|
53
61
|
inlineOrMore: string;
|
|
54
62
|
/**
|
|
55
63
|
* The affirmative response word in the target language.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
56
66
|
* Used in confirmation prompts and boolean choice scenarios.
|
|
57
67
|
*
|
|
58
68
|
* @example
|
|
@@ -65,6 +75,8 @@ export interface PromptCultureModel {
|
|
|
65
75
|
yesInLanguage: string;
|
|
66
76
|
/**
|
|
67
77
|
* The negative response word in the target language.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
68
80
|
* Used in confirmation prompts and boolean choice scenarios.
|
|
69
81
|
*
|
|
70
82
|
* @example
|
|
@@ -128,8 +140,11 @@ export declare class PromptCultureModels {
|
|
|
128
140
|
*
|
|
129
141
|
* @param cultureCode The locale string to normalize (e.g., "en-US").
|
|
130
142
|
* @returns The normalized locale string.
|
|
131
|
-
*
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* This is mostly a copy/paste from https://github.com/microsoft/Recognizers-Text/blob/master/JavaScript/packages/recognizers-text/src/culture.ts#L39
|
|
132
146
|
* This doesn't directly use Recognizers-Text's MapToNearestLanguage because if they add language support before we do, it will break our prompts.
|
|
147
|
+
*
|
|
133
148
|
*/
|
|
134
149
|
static mapToNearestLanguage(cultureCode: string): string;
|
|
135
150
|
/**
|
|
@@ -20,8 +20,11 @@ class PromptCultureModels {
|
|
|
20
20
|
*
|
|
21
21
|
* @param cultureCode The locale string to normalize (e.g., "en-US").
|
|
22
22
|
* @returns The normalized locale string.
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* This is mostly a copy/paste from https://github.com/microsoft/Recognizers-Text/blob/master/JavaScript/packages/recognizers-text/src/culture.ts#L39
|
|
24
26
|
* This doesn't directly use Recognizers-Text's MapToNearestLanguage because if they add language support before we do, it will break our prompts.
|
|
27
|
+
*
|
|
25
28
|
*/
|
|
26
29
|
static mapToNearestLanguage(cultureCode) {
|
|
27
30
|
if (cultureCode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptCultureModels.js","sourceRoot":"","sources":["../../../src/prompts/promptCultureModels.ts"],"names":[],"mappings":";;;AAAA,8EAA2D;
|
|
1
|
+
{"version":3,"file":"promptCultureModels.js","sourceRoot":"","sources":["../../../src/prompts/promptCultureModels.ts"],"names":[],"mappings":";;;AAAA,8EAA2D;AAkG3D;;GAEG;AACH,MAAa,mBAAmB;IA6G9B;;;;;SAKK;IACG,MAAM,CAAC,wBAAwB;QACrC,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACjE,CAAC;IAED;;;;;;;;;;SAUK;IACL,MAAM,CAAC,oBAAoB,CAAE,WAAmB;QAC9C,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,GAAG,WAAW,CAAC,WAAW,EAAE,CAAA;YACvC,MAAM,qBAAqB,GAAG,IAAI,CAAC,wBAAwB,EAAE,CAAA;YAE7D,IAAI,qBAAqB,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;gBACnD,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;gBAEtD,qBAAqB,CAAC,OAAO,CAAC,UAAU,oBAAoB;oBAC1D,IAAI,oBAAoB,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;wBACnD,WAAW,GAAG,oBAAoB,CAAA;oBACpC,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;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Y,EAAE,IAAI;CACnB,CAAA;AAED;;GAEG;AACI,4BAAQ,GAAuB;IACpC,MAAM,EAAE,gCAAO,CAAC,QAAQ;IACxB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,OAAO;IACjB,YAAY,EAAE,QAAQ;IACtB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,KAAK;CACpB,CAAA;AAED;;GAEG;AACI,8BAAU,GAAuB;IACtC,MAAM,EAAE,gCAAO,CAAC,UAAU;IAC1B,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE,OAAO;IACrB,aAAa,EAAE,KAAK;IACpB,YAAY,EAAE,KAAK;CACpB,CAAA;AAED;;GAEG;AACI,2BAAO,GAAuB;IACnC,MAAM,EAAE,gCAAO,CAAC,OAAO;IACvB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,IAAI;CACnB,CAAA;AA0CD;;;;KAIK;AACE,wCAAoB,GAAG,GAAyB,EAAE,CAAC;IACxD,mBAAmB,CAAC,OAAO;IAC3B,mBAAmB,CAAC,KAAK;IACzB,mBAAmB,CAAC,OAAO;IAC3B,mBAAmB,CAAC,MAAM;IAC1B,mBAAmB,CAAC,MAAM;IAC1B,mBAAmB,CAAC,OAAO;IAC3B,mBAAmB,CAAC,QAAQ;IAC5B,mBAAmB,CAAC,UAAU;IAC9B,mBAAmB,CAAC,OAAO;CAC5B,CAAA"}
|
|
@@ -11,6 +11,7 @@ import { DialogEvent } from '../dialogEvent';
|
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
13
|
* By default the prompt will return to the calling dialog a `string` representing the users reply.
|
|
14
|
+
*
|
|
14
15
|
*/
|
|
15
16
|
export declare class TextPrompt extends Prompt<string> {
|
|
16
17
|
constructor(dialogId?: string, validator?: PromptValidator<string>);
|
|
@@ -45,10 +46,12 @@ export declare class TextPrompt extends Prompt<string> {
|
|
|
45
46
|
* turn of conversation.
|
|
46
47
|
* @param _event DialogEvent, the event being raised.
|
|
47
48
|
* @returns Whether the event is handled by the current dialog and further processing should stop.
|
|
49
|
+
*
|
|
48
50
|
* @remarks
|
|
49
51
|
* This is a good place to perform interception of an event as returning `true` will prevent
|
|
50
52
|
* any further bubbling of the event to the dialogs parents and will also prevent any child
|
|
51
53
|
* dialogs from performing their default processing.
|
|
54
|
+
*
|
|
52
55
|
*/
|
|
53
56
|
protected onPreBubbleEvent(_dc: DialogContext, _event: DialogEvent): Promise<boolean>;
|
|
54
57
|
}
|
|
@@ -8,6 +8,7 @@ const agents_activity_1 = require("@microsoft/agents-activity");
|
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
10
|
* By default the prompt will return to the calling dialog a `string` representing the users reply.
|
|
11
|
+
*
|
|
11
12
|
*/
|
|
12
13
|
class TextPrompt extends prompt_1.Prompt {
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
@@ -55,10 +56,12 @@ class TextPrompt extends prompt_1.Prompt {
|
|
|
55
56
|
* turn of conversation.
|
|
56
57
|
* @param _event DialogEvent, the event being raised.
|
|
57
58
|
* @returns Whether the event is handled by the current dialog and further processing should stop.
|
|
59
|
+
*
|
|
58
60
|
* @remarks
|
|
59
61
|
* This is a good place to perform interception of an event as returning `true` will prevent
|
|
60
62
|
* any further bubbling of the event to the dialogs parents and will also prevent any child
|
|
61
63
|
* dialogs from performing their default processing.
|
|
64
|
+
*
|
|
62
65
|
*/
|
|
63
66
|
async onPreBubbleEvent(_dc, _event) {
|
|
64
67
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textPrompt.js","sourceRoot":"","sources":["../../../src/prompts/textPrompt.ts"],"names":[],"mappings":";;;AAKA,qCAAyF;AAGzF,gEAAuD;AAEvD
|
|
1
|
+
{"version":3,"file":"textPrompt.js","sourceRoot":"","sources":["../../../src/prompts/textPrompt.ts"],"names":[],"mappings":";;;AAKA,qCAAyF;AAGzF,gEAAuD;AAEvD;;;;;;GAMG;AACH,MAAa,UAAW,SAAQ,eAAc;IAC5C,qEAAqE;IACrE,YAAa,QAAiB,EAAE,SAAmC;QACjE,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;IAC5B,CAAC;IAED;;;;;;;;;;;SAWK;IACK,KAAK,CAAC,QAAQ,CACtB,OAAoB,EACpB,KAAU,EACV,OAAsB,EACtB,OAAgB;QAEhB,IAAI,OAAO,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACnC,MAAM,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,EAAE,4BAAU,CAAC,cAAc,CAAC,CAAA;QACvF,CAAC;aAAM,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YAC1B,MAAM,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,4BAAU,CAAC,cAAc,CAAC,CAAA;QAClF,CAAC;IACH,CAAC;IAED;;;;;;;;;SASK;IACK,KAAK,CAAC,WAAW,CACzB,OAAoB,EACpB,MAAW,EACX,QAAuB;QAEvB,MAAM,KAAK,GAAW,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAA;QAE3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;IAC1G,CAAC;IAED;;;;;;;;;;;;;SAaK;IACK,KAAK,CAAC,gBAAgB,CAAE,GAAkB,EAAE,MAAmB;QACvE,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AApED,gCAoEC"}
|
package/dist/src/recognizer.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { RecognizerResult } from './recognizerResult';
|
|
|
13
13
|
* This interface defines the configuration properties that can be used to customize
|
|
14
14
|
* the behavior and identification of a recognizer. Recognizers use this configuration
|
|
15
15
|
* to set up their basic properties and operational parameters.
|
|
16
|
+
*
|
|
16
17
|
*/
|
|
17
18
|
export interface RecognizerConfiguration {
|
|
18
19
|
/**
|
|
@@ -22,6 +23,7 @@ export interface RecognizerConfiguration {
|
|
|
22
23
|
* The id property allows you to distinguish between multiple recognizer instances
|
|
23
24
|
* and can be useful for logging, debugging, and telemetry purposes. If not provided,
|
|
24
25
|
* the recognizer will operate without a specific identifier.
|
|
26
|
+
*
|
|
25
27
|
*/
|
|
26
28
|
id?: string;
|
|
27
29
|
}
|
|
@@ -32,6 +34,7 @@ export interface RecognizerConfiguration {
|
|
|
32
34
|
* Recognizers process user input, such as text or speech, and return structured data representing
|
|
33
35
|
* the recognized intents, entities, and other relevant information. This class provides a foundation
|
|
34
36
|
* for creating custom recognizers by defining common methods and properties.
|
|
37
|
+
*
|
|
35
38
|
*/
|
|
36
39
|
export declare class Recognizer extends Configurable implements RecognizerConfiguration {
|
|
37
40
|
/**
|
package/dist/src/recognizer.js
CHANGED
|
@@ -14,6 +14,7 @@ const recognizerResult_1 = require("./recognizerResult");
|
|
|
14
14
|
* Recognizers process user input, such as text or speech, and return structured data representing
|
|
15
15
|
* the recognized intents, entities, and other relevant information. This class provides a foundation
|
|
16
16
|
* for creating custom recognizers by defining common methods and properties.
|
|
17
|
+
*
|
|
17
18
|
*/
|
|
18
19
|
class Recognizer extends configurable_1.Configurable {
|
|
19
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizer.js","sourceRoot":"","sources":["../../src/recognizer.ts"],"names":[],"mappings":";;;;;;AAKA,iDAA6C;AAE7C,uDAA8B;AAC9B,yDAA0E;
|
|
1
|
+
{"version":3,"file":"recognizer.js","sourceRoot":"","sources":["../../src/recognizer.ts"],"names":[],"mappings":";;;;;;AAKA,iDAA6C;AAE7C,uDAA8B;AAC9B,yDAA0E;AAwB1E;;;;;;;;GAQG;AACH,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AAC;IAES,+CAA+C,CAAE,gBAAkC;QAC3F,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAA;QACjF,MAAM,oBAAoB,GAA8B,EAAE,CAAA;QAC1D,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;YACnC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChC,oBAAoB,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACjG,CAAC;CACF;AAhHD,gCAgHC"}
|
|
@@ -29,7 +29,11 @@ export interface RecognizerResult {
|
|
|
29
29
|
[propName: string]: any;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Finds the intent with the highest confidence score from a recognizer result.
|
|
33
|
+
*
|
|
34
|
+
* @param result - The recognizer result containing intents and their scores
|
|
35
|
+
* @returns An object containing the top-scoring intent name and its confidence score
|
|
36
|
+
* @throws {Error} Throws an error if the result is empty or doesn't contain intents
|
|
33
37
|
*
|
|
34
38
|
* @remarks
|
|
35
39
|
* This function iterates through all intents in the recognizer result and returns
|
|
@@ -51,9 +55,6 @@ export interface RecognizerResult {
|
|
|
51
55
|
* // Returns: { intent: "BookFlight", score: 0.95 }
|
|
52
56
|
* ```
|
|
53
57
|
*
|
|
54
|
-
* @param result - The recognizer result containing intents and their scores
|
|
55
|
-
* @returns An object containing the top-scoring intent name and its confidence score
|
|
56
|
-
* @throws {Error} Throws an error if the result is empty or doesn't contain intents
|
|
57
58
|
*/
|
|
58
59
|
export declare const getTopScoringIntent: (result: RecognizerResult) => {
|
|
59
60
|
intent: string;
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTopScoringIntent = void 0;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Finds the intent with the highest confidence score from a recognizer result.
|
|
6
|
+
*
|
|
7
|
+
* @param result - The recognizer result containing intents and their scores
|
|
8
|
+
* @returns An object containing the top-scoring intent name and its confidence score
|
|
9
|
+
* @throws {Error} Throws an error if the result is empty or doesn't contain intents
|
|
6
10
|
*
|
|
7
11
|
* @remarks
|
|
8
12
|
* This function iterates through all intents in the recognizer result and returns
|
|
@@ -24,9 +28,6 @@ exports.getTopScoringIntent = void 0;
|
|
|
24
28
|
* // Returns: { intent: "BookFlight", score: 0.95 }
|
|
25
29
|
* ```
|
|
26
30
|
*
|
|
27
|
-
* @param result - The recognizer result containing intents and their scores
|
|
28
|
-
* @returns An object containing the top-scoring intent name and its confidence score
|
|
29
|
-
* @throws {Error} Throws an error if the result is empty or doesn't contain intents
|
|
30
31
|
*/
|
|
31
32
|
const getTopScoringIntent = (result) => {
|
|
32
33
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizerResult.js","sourceRoot":"","sources":["../../src/recognizerResult.ts"],"names":[],"mappings":";;;AAoCA
|
|
1
|
+
{"version":3,"file":"recognizerResult.js","sourceRoot":"","sources":["../../src/recognizerResult.ts"],"names":[],"mappings":";;;AAoCA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,MAAM,mBAAmB,GAAG,CAAC,MAAwB,EAAqC,EAAE;;IACjG,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAED,IAAI,SAAS,GAAG,EAAE,CAAA;IAClB,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAA;IACjB,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAClE,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,CAAC,CAAC,CAAA;QAChC,IAAI,CAAC,SAAS,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;YACnC,SAAS,GAAG,UAAU,CAAA;YACtB,QAAQ,GAAG,KAAK,CAAA;QAClB,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,QAAQ;KAChB,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,mBAAmB,uBAmB/B"}
|
|
@@ -17,12 +17,13 @@ export declare class StringUtils {
|
|
|
17
17
|
/**
|
|
18
18
|
* UniqueHash - create a unique hash from a string.
|
|
19
19
|
*
|
|
20
|
+
* @param text Text to hash.
|
|
21
|
+
* @returns A string which is an unique hash.
|
|
22
|
+
*
|
|
20
23
|
* @remarks
|
|
21
24
|
* The source for this function was derived from the following article:
|
|
22
|
-
*
|
|
23
25
|
* https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
|
|
24
|
-
*
|
|
25
|
-
* @returns A string which is an unique hash.
|
|
26
|
+
*
|
|
26
27
|
*/
|
|
27
28
|
static hash(text: string): string;
|
|
28
29
|
/**
|
package/dist/src/stringUtils.js
CHANGED
|
@@ -26,12 +26,13 @@ class StringUtils {
|
|
|
26
26
|
/**
|
|
27
27
|
* UniqueHash - create a unique hash from a string.
|
|
28
28
|
*
|
|
29
|
+
* @param text Text to hash.
|
|
30
|
+
* @returns A string which is an unique hash.
|
|
31
|
+
*
|
|
29
32
|
* @remarks
|
|
30
33
|
* The source for this function was derived from the following article:
|
|
31
|
-
*
|
|
32
34
|
* https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
|
|
33
|
-
*
|
|
34
|
-
* @returns A string which is an unique hash.
|
|
35
|
+
*
|
|
35
36
|
*/
|
|
36
37
|
static hash(text) {
|
|
37
38
|
const length = text.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringUtils.js","sourceRoot":"","sources":["../../src/stringUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAa,WAAW;IACtB;;;;;;SAMK;IACL,MAAM,CAAC,QAAQ,CAAE,IAAY,EAAE,MAAc;QAC3C,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;QACjB,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAA;IACvC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"stringUtils.js","sourceRoot":"","sources":["../../src/stringUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAa,WAAW;IACtB;;;;;;SAMK;IACL,MAAM,CAAC,QAAQ,CAAE,IAAY,EAAE,MAAc;QAC3C,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;QACjB,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAA;IACvC,CAAC;IAED;;;;;;;;;;SAUK;IACL,MAAM,CAAC,IAAI,CAAE,IAAY;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC1B,IAAI,IAAI,GAAG,CAAC,CAAA;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC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