@cognigy/rest-api-client 0.13.1 → 0.14.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/.eslintConfig.json +117 -0
- package/.eslintrc.json +2 -2
- package/CHANGELOG.md +12 -1
- package/build/apigroups/ResourcesAPIGroup_2_0.js +25 -4
- package/build/shared/charts/descriptors/allFields.js +8 -0
- package/build/shared/charts/descriptors/apps/getAppSessionPin.js +9 -9
- package/build/shared/charts/descriptors/apps/initAppSession.js +36 -53
- package/build/shared/charts/descriptors/apps/setAdaptiveCardAppState.js +5 -18
- package/build/shared/charts/descriptors/apps/setAppState.js +6 -6
- package/build/shared/charts/descriptors/apps/setHtmlAppState.js +85 -15
- package/build/shared/charts/descriptors/apps/utils/buildAppUrl.js +12 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnection.js +14 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +19 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAIProviderConnection.js +11 -0
- package/build/shared/charts/descriptors/index.js +9 -6
- package/build/shared/charts/descriptors/logic/switch/switch.js +3 -2
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +30 -7
- package/build/shared/charts/descriptors/message/question/question.js +200 -28
- package/build/shared/charts/descriptors/message/question/utils/evaluateQuestionAnswer.js +6 -0
- package/build/shared/charts/descriptors/message/say.js +33 -2
- package/build/shared/charts/descriptors/service/completeText.js +316 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +48 -2
- package/build/shared/charts/descriptors/service/index.js +3 -1
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +62 -26
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +93 -32
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +53 -0
- package/build/shared/charts/descriptors/voice/nodes/dtmf.js +5 -3
- package/build/shared/charts/descriptors/voice/nodes/play.js +14 -5
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +90 -8
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +6 -2
- package/build/shared/charts/descriptors/voice/utils/helper.js +11 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/agentAssist.js +2 -2
- package/build/shared/charts/descriptors/voicegateway/nodes/handover.js +5 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +20 -5
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +3 -3
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +150 -33
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +95 -7
- package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +18 -11
- package/build/shared/charts/descriptors/voicegateway2/utils/strip-nulls.js +4 -1
- package/build/shared/charts/helpers/generativeAI/getRephraseWithAIFields.js +100 -0
- package/build/shared/charts/helpers/generativeAI/rephraseSentenceWithAi.js +44 -0
- package/build/shared/constants.js +2 -1
- package/build/shared/errors/BadGatewayError.js +2 -1
- package/build/shared/errors/BadRequestError.js +2 -1
- package/build/shared/errors/ForbiddenError.js +2 -1
- package/build/shared/errors/GatewayTimeoutError.js +2 -1
- package/build/shared/errors/MethodNotAllowedError.js +2 -1
- package/build/shared/errors/NetworkError.js +2 -1
- package/build/shared/errors/PayloadTooLargeError.js +2 -1
- package/build/shared/errors/PaymentRequiredError.js +2 -1
- package/build/shared/errors/ServiceUnavailableError.js +2 -1
- package/build/shared/errors/UnauthorizedError.js +2 -1
- package/build/shared/errors/baseError.js +27 -4
- package/build/shared/errors/conflict.js +2 -1
- package/build/shared/errors/databaseConnectError.js +2 -2
- package/build/shared/errors/databaseQueryError.js +2 -2
- package/build/shared/errors/databaseRead.js +2 -2
- package/build/shared/errors/databaseWrite.js +2 -2
- package/build/shared/errors/exportError.js +2 -2
- package/build/shared/errors/fileRead.js +2 -2
- package/build/shared/errors/fileWrite.js +2 -2
- package/build/shared/errors/importError.js +1 -1
- package/build/shared/errors/inputOutputError.js +2 -2
- package/build/shared/errors/internalServerError.js +2 -1
- package/build/shared/errors/invalidArgument.js +2 -2
- package/build/shared/errors/missingArgument.js +2 -2
- package/build/shared/errors/notImplementedError.js +2 -1
- package/build/shared/errors/process.js +2 -2
- package/build/shared/errors/resourceNotFound.js +5 -1
- package/build/shared/errors/smtpConnectError.js +2 -2
- package/build/shared/errors/timeoutError.js +2 -2
- package/build/shared/interfaces/ai.js +16 -0
- package/build/shared/interfaces/analytics/IAnalyticsDataGoals.js +3 -0
- package/build/shared/interfaces/endpointInterface.js +1 -0
- package/build/shared/interfaces/filemanager/IRuntimeFile.js +30 -0
- package/build/shared/interfaces/filemanager/index.js +1 -0
- package/build/shared/interfaces/handover.js +40 -3
- package/build/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/build/shared/interfaces/messageAPI/handover.js +6 -0
- package/build/shared/interfaces/resources/IAgentAssistConfig.js +56 -0
- package/build/shared/interfaces/resources/IConnectionSchema.js +2 -1
- package/build/shared/interfaces/resources/IExtension.js +2 -1
- package/build/shared/interfaces/resources/IFlow.js +2 -1
- package/build/shared/interfaces/resources/ILexicon.js +15 -2
- package/build/shared/interfaces/resources/ILocale.js +25 -3
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +2 -1
- package/build/shared/interfaces/resources/TResourceType.js +3 -0
- package/build/shared/interfaces/resources/intent/IIntent.js +5 -2
- package/build/shared/interfaces/resources/intent/IIntentRelation.js +3 -1
- package/build/shared/interfaces/resources/settings/IAgentSettings.js +9 -4
- package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +136 -0
- package/build/shared/interfaces/resources/settings/ISharedSettings.js +1 -1
- package/build/shared/interfaces/resources/settings/index.js +7 -1
- package/build/shared/interfaces/resources/yesNoIntent/IYesNoItem.js +5 -5
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ICognigyLiveAgentMiddleware_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IAgentAssistConfig_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/ICreateAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IDeleteAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IIndexAgentAssistConfigsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IReadAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IUpdateAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/flow/v2.0/sentence/IGenerateSentencesRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/ITrainYesNoIntentsProjectRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntents_2_0.js +4 -4
- package/build/shared/interfaces/security/IACL.js +1 -1
- package/build/shared/interfaces/security/IPermission.js +2 -0
- package/build/shared/interfaces/security/IRole.js +4 -0
- package/package.json +2 -2
- package/types/index.d.ts +925 -388
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"eslint:recommended",
|
|
4
|
+
"plugin:node/recommended"
|
|
5
|
+
],
|
|
6
|
+
"plugins": [
|
|
7
|
+
"node",
|
|
8
|
+
"@typescript-eslint"
|
|
9
|
+
],
|
|
10
|
+
"rules": {
|
|
11
|
+
"block-scoped-var": "error",
|
|
12
|
+
"eqeqeq": "error",
|
|
13
|
+
"no-var": "error",
|
|
14
|
+
"prefer-const": "error",
|
|
15
|
+
"prefer-arrow-callback": "error",
|
|
16
|
+
"no-trailing-spaces": "error",
|
|
17
|
+
"quotes": [
|
|
18
|
+
"warn",
|
|
19
|
+
"double",
|
|
20
|
+
{
|
|
21
|
+
"avoidEscape": true
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"no-restricted-properties": [
|
|
25
|
+
"error",
|
|
26
|
+
{
|
|
27
|
+
"object": "describe",
|
|
28
|
+
"property": "only"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"object": "it",
|
|
32
|
+
"property": "only"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"object-curly-newline": [
|
|
36
|
+
"warn",
|
|
37
|
+
{
|
|
38
|
+
"ObjectPattern": {
|
|
39
|
+
"multiline": true,
|
|
40
|
+
"minProperties": 2
|
|
41
|
+
},
|
|
42
|
+
"ImportDeclaration": {
|
|
43
|
+
"multiline": true,
|
|
44
|
+
"minProperties": 3
|
|
45
|
+
},
|
|
46
|
+
"ExportDeclaration": {
|
|
47
|
+
"multiline": true,
|
|
48
|
+
"minProperties": 3
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"overrides": [
|
|
54
|
+
{
|
|
55
|
+
"files": [
|
|
56
|
+
"**/*.ts",
|
|
57
|
+
"**/*.tsx"
|
|
58
|
+
],
|
|
59
|
+
"parser": "@typescript-eslint/parser",
|
|
60
|
+
"extends": [
|
|
61
|
+
"plugin:@typescript-eslint/recommended"
|
|
62
|
+
],
|
|
63
|
+
"rules": {
|
|
64
|
+
"no-empty": [
|
|
65
|
+
"warn",
|
|
66
|
+
{
|
|
67
|
+
"allowEmptyCatch": true
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"brace-style": "off",
|
|
71
|
+
"@typescript-eslint/brace-style": [
|
|
72
|
+
"warn"
|
|
73
|
+
],
|
|
74
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
75
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
76
|
+
"@typescript-eslint/no-warning-comments": "off",
|
|
77
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
78
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
79
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
80
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
81
|
+
"@typescript-eslint/ban-types": "off",
|
|
82
|
+
"@typescript-eslint/camelcase": "off",
|
|
83
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
84
|
+
"node/no-missing-import": "off",
|
|
85
|
+
"node/no-empty-function": "off",
|
|
86
|
+
"node/no-unpublished-import": "off",
|
|
87
|
+
"node/no-unsupported-features/es-syntax": "off",
|
|
88
|
+
"node/no-missing-require": "off",
|
|
89
|
+
"node/shebang": "off",
|
|
90
|
+
"no-dupe-class-members": "off",
|
|
91
|
+
"require-atomic-updates": "off",
|
|
92
|
+
"node/no-extraneous-import": "off",
|
|
93
|
+
/* https://eslint.org/docs/rules/no-process-exit */
|
|
94
|
+
"no-process-exit": "error",
|
|
95
|
+
"indent": [
|
|
96
|
+
"error",
|
|
97
|
+
"tab",
|
|
98
|
+
{
|
|
99
|
+
"SwitchCase": 1
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"semi": [
|
|
103
|
+
"error",
|
|
104
|
+
"always"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"parserOptions": {
|
|
108
|
+
"ecmaVersion": 2020,
|
|
109
|
+
"sourceType": "module"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"ignorePatterns": [
|
|
114
|
+
"src/shared/*",
|
|
115
|
+
"build/*"
|
|
116
|
+
]
|
|
117
|
+
}
|
package/.eslintrc.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": [
|
|
3
3
|
"prettier",
|
|
4
|
-
"
|
|
4
|
+
"./.eslintConfig"
|
|
5
5
|
],
|
|
6
6
|
"plugins": [
|
|
7
7
|
"prettier"
|
|
8
8
|
],
|
|
9
9
|
"rules": {
|
|
10
|
-
|
|
10
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
11
11
|
"prettier/prettier": [
|
|
12
12
|
"error",
|
|
13
13
|
{
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
# 0.14.0
|
|
2
|
+
Released: February 7th, 2023
|
|
1
3
|
|
|
4
|
+
Released state of package up to date with Cognigy.AI v4.44.0
|
|
5
|
+
|
|
6
|
+
# 0.13.2
|
|
7
|
+
Released: December 21st, 2022
|
|
8
|
+
|
|
9
|
+
## Bugfixes
|
|
10
|
+
Removed Cognigy internal package dependencies.
|
|
11
|
+
|
|
12
|
+
---
|
|
2
13
|
|
|
3
14
|
# 0.13.1
|
|
4
15
|
Released: November 22nd, 2022
|
|
@@ -8,7 +19,7 @@ Updated changelog
|
|
|
8
19
|
# 0.13.0
|
|
9
20
|
Released: November 22nd, 2022
|
|
10
21
|
|
|
11
|
-
Released state of package up to date with Cognigy.AI v4.
|
|
22
|
+
Released state of package up to date with Cognigy.AI v4.39.1
|
|
12
23
|
|
|
13
24
|
# 0.12.0
|
|
14
25
|
|
|
@@ -86,7 +86,15 @@ const ResourcesAPIGroup_2_0 = (instance) => {
|
|
|
86
86
|
var { projectId } = _a, args = __rest(_a, ["projectId"]);
|
|
87
87
|
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/lexicons?${(0, query_1.stringifyQuery)({ projectId })}`, "PATCH", self)(args, options);
|
|
88
88
|
},
|
|
89
|
-
createLexicon: (
|
|
89
|
+
createLexicon: (_a, options) => {
|
|
90
|
+
var { shouldGenerateLexiconEntries, generateLexiconEntriesLimit, defaultSlot, languageCode } = _a, args = __rest(_a, ["shouldGenerateLexiconEntries", "generateLexiconEntriesLimit", "defaultSlot", "languageCode"]);
|
|
91
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/lexicons?${(0, query_1.stringifyQuery)({
|
|
92
|
+
shouldGenerateLexiconEntries,
|
|
93
|
+
generateLexiconEntriesLimit,
|
|
94
|
+
defaultSlot,
|
|
95
|
+
languageCode
|
|
96
|
+
})}`, "POST", self)(args, options);
|
|
97
|
+
},
|
|
90
98
|
readLexicon: ({ lexiconId, metaOnly }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/lexicons/${lexiconId}?${(0, query_1.stringifyQuery)({ metaOnly })}`, "GET", self)(undefined, options),
|
|
91
99
|
updateLexicon: (_a, options) => {
|
|
92
100
|
var { lexiconId } = _a, args = __rest(_a, ["lexiconId"]);
|
|
@@ -290,8 +298,11 @@ const ResourcesAPIGroup_2_0 = (instance) => {
|
|
|
290
298
|
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/flows/${flowId}/intents`, "PATCH", self)(args, options);
|
|
291
299
|
},
|
|
292
300
|
createIntent: (_a, options) => {
|
|
293
|
-
var { flowId } = _a, args = __rest(_a, ["flowId"]);
|
|
294
|
-
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/flows/${flowId}/intents
|
|
301
|
+
var { flowId, shouldGenerateSentences, generateSentenceLimit } = _a, args = __rest(_a, ["flowId", "shouldGenerateSentences", "generateSentenceLimit"]);
|
|
302
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/flows/${flowId}/intents?${(0, query_1.stringifyQuery)({
|
|
303
|
+
shouldGenerateSentences,
|
|
304
|
+
generateSentenceLimit
|
|
305
|
+
})}`, "POST", self)(args, options);
|
|
295
306
|
},
|
|
296
307
|
readIntent: (_a, options) => {
|
|
297
308
|
var { intentId, flowId } = _a, args = __rest(_a, ["intentId", "flowId"]);
|
|
@@ -357,6 +368,7 @@ const ResourcesAPIGroup_2_0 = (instance) => {
|
|
|
357
368
|
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/flows/${flowId}/intents/${intentId}/sentences/${sentenceId}`, "PATCH", self)(args, options);
|
|
358
369
|
},
|
|
359
370
|
deleteSentence: ({ sentenceId, intentId, flowId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/flows/${flowId}/intents/${intentId}/sentences/${sentenceId}`, "DELETE", self)(undefined, options),
|
|
371
|
+
generateSentences: ({ intentId, flowId, localeId, limit }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/flows/${flowId}/intents/${intentId}/sentences/generate?${(0, query_1.stringifyQuery)({ localeId, limit })}`, "POST", self)(undefined, options),
|
|
360
372
|
indexLearningSentences: (_a, options) => {
|
|
361
373
|
var { flowId, intentId } = _a, args = __rest(_a, ["flowId", "intentId"]);
|
|
362
374
|
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/flows/${flowId}/intents/learningsentences?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options);
|
|
@@ -478,6 +490,7 @@ const ResourcesAPIGroup_2_0 = (instance) => {
|
|
|
478
490
|
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/locales/${localeId}/yesnointents`, "GET", self)(args, options);
|
|
479
491
|
},
|
|
480
492
|
trainYesNoIntents: ({ localeId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/locales/${localeId}/yesnointents/train`, "POST", self)(undefined, options),
|
|
493
|
+
trainYesNoIntentsProject: ({ projectId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/locales/yesnointents/train`, "POST", self)(undefined, options),
|
|
481
494
|
updateYesNoIntents: (_a, options) => {
|
|
482
495
|
var { localeId, intentId } = _a, args = __rest(_a, ["localeId", "intentId"]);
|
|
483
496
|
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/locales/${localeId}/yesnointents/${intentId}`, "PATCH", self)(args, options);
|
|
@@ -506,7 +519,15 @@ const ResourcesAPIGroup_2_0 = (instance) => {
|
|
|
506
519
|
testTranslationSettings: (_a, options) => {
|
|
507
520
|
var { projectId } = _a, args = __rest(_a, ["projectId"]);
|
|
508
521
|
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/settings/translation/test`, "POST", self)(args, options);
|
|
509
|
-
}
|
|
522
|
+
},
|
|
523
|
+
indexAgentAssistConfigs: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/agentassistconfigs?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options),
|
|
524
|
+
createAgentAssistConfig: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/agentassistconfigs", "POST", self)(args, options),
|
|
525
|
+
readAgentAssistConfig: ({ configId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/agentassistconfigs/${configId}`, "GET", self)(undefined, options),
|
|
526
|
+
updateAgentAssistConfig: (_a, options) => {
|
|
527
|
+
var { configId } = _a, args = __rest(_a, ["configId"]);
|
|
528
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/agentassistconfigs/${configId}`, "PATCH", self)(args, options);
|
|
529
|
+
},
|
|
530
|
+
deleteAgentAssistConfig: ({ configId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/agentassistconfigs/${configId}`, "DELETE", self)(undefined, options)
|
|
510
531
|
};
|
|
511
532
|
};
|
|
512
533
|
exports.ResourcesAPIGroup_2_0 = ResourcesAPIGroup_2_0;
|
|
@@ -18,6 +18,13 @@ exports.ALL_FIELDS = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
18
18
|
description: "Lorem Ipsum Dolor Sit Amet lkj afsdlkj dfsalkj;sdf alkjdfs lkjdf salkjdf slkj; sdflkjsdf lkj;sd flkjdf sljksdf alk;j adsjlk; sdflkj;sdf lkj; fsadlkjsdflk;jsdf alkj; sdflkj;d sflk;j sdflkj;sdf lkj;",
|
|
19
19
|
params: { required: true },
|
|
20
20
|
},
|
|
21
|
+
{
|
|
22
|
+
key: "adaptivecard",
|
|
23
|
+
type: "adaptivecard",
|
|
24
|
+
label: "Adaptive Card",
|
|
25
|
+
description: "Create an Adaptive Card using this JSON editor",
|
|
26
|
+
defaultValue: '{"$schema":"http://adaptivecards.io/schemas/adaptive-card.json","type":"AdaptiveCard","version":"1.0","body":[]}'
|
|
27
|
+
},
|
|
21
28
|
{
|
|
22
29
|
key: "date",
|
|
23
30
|
type: "date",
|
|
@@ -192,6 +199,7 @@ exports.ALL_FIELDS = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
192
199
|
],
|
|
193
200
|
form: [
|
|
194
201
|
{ type: "field", key: "text" },
|
|
202
|
+
{ type: "field", key: "adaptivecard" },
|
|
195
203
|
{ type: "field", key: "select" },
|
|
196
204
|
{ type: "section", key: "dateFields" },
|
|
197
205
|
{ type: "section", key: "codeEditors" },
|
|
@@ -11,8 +11,8 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
|
11
11
|
*/
|
|
12
12
|
exports.GET_APP_SESSION_PIN = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
13
13
|
type: "getAppSessionPin",
|
|
14
|
-
defaultLabel: "Get
|
|
15
|
-
summary: "Get a new
|
|
14
|
+
defaultLabel: "Get xApp Session PIN",
|
|
15
|
+
summary: "Get a new xApp Session PIN.",
|
|
16
16
|
appearance: {
|
|
17
17
|
showIcon: false,
|
|
18
18
|
},
|
|
@@ -21,17 +21,17 @@ exports.GET_APP_SESSION_PIN = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
21
21
|
tokens: [
|
|
22
22
|
{
|
|
23
23
|
type: "input",
|
|
24
|
-
label: "
|
|
25
|
-
script: "input.
|
|
24
|
+
label: "xApp Session PIN",
|
|
25
|
+
script: "input.apps.session.pin || ''"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
type: "input",
|
|
29
|
-
label: "
|
|
29
|
+
label: "xApp PIN Page URL",
|
|
30
30
|
script: `
|
|
31
31
|
(() => {
|
|
32
|
-
if (!input.
|
|
33
|
-
const overrides = input.
|
|
34
|
-
return [input.
|
|
32
|
+
if (!input.apps.baseUrl) return '';
|
|
33
|
+
const overrides = input.apps.customization ? \`?overrides=\${encodeURIComponent(JSON.stringify(input.apps.customization))}\` : '';
|
|
34
|
+
return [input.apps.baseUrl, overrides].join('');
|
|
35
35
|
})()`
|
|
36
36
|
.split("\n")
|
|
37
37
|
.join(" "),
|
|
@@ -40,7 +40,7 @@ exports.GET_APP_SESSION_PIN = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
40
40
|
function: async ({ cognigy }) => {
|
|
41
41
|
const { api } = cognigy;
|
|
42
42
|
const appSessionPin = await api.getAppSessionPin();
|
|
43
|
-
api.addToInput("
|
|
43
|
+
api.addToInput("apps.session.pin", appSessionPin);
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
46
|
//# sourceMappingURL=getAppSessionPin.js.map
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.INIT_APP_SESSION = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const buildAppUrl_1 = require("./utils/buildAppUrl");
|
|
6
7
|
/**
|
|
7
8
|
* Node name: 'initAppSession'
|
|
8
9
|
*
|
|
@@ -11,8 +12,8 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
|
11
12
|
*/
|
|
12
13
|
exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
13
14
|
type: "initAppSession",
|
|
14
|
-
defaultLabel: "Init
|
|
15
|
-
summary: "Initializes a new
|
|
15
|
+
defaultLabel: "Init xApp Session",
|
|
16
|
+
summary: "Initializes a new xApp Session.",
|
|
16
17
|
appearance: {
|
|
17
18
|
showIcon: false,
|
|
18
19
|
},
|
|
@@ -68,7 +69,7 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
68
69
|
type: "cognigyText",
|
|
69
70
|
key: "pinEnterPinText",
|
|
70
71
|
label: "'Enter PIN' Text",
|
|
71
|
-
description: "This text asks the user to enter the
|
|
72
|
+
description: "This text asks the user to enter the xApp Session PIN.",
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
75
|
type: "cognigyText",
|
|
@@ -88,20 +89,26 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
88
89
|
key: "appSectionDescription",
|
|
89
90
|
label: " ",
|
|
90
91
|
params: {
|
|
91
|
-
text: "This section is used to customize content related to the '
|
|
92
|
+
text: "This section is used to customize content related to the 'xApp Screen' sections (Active xApp + xApp Overrides).",
|
|
92
93
|
},
|
|
93
94
|
},
|
|
94
95
|
{
|
|
95
96
|
type: "cognigyText",
|
|
96
97
|
key: "appLoadingText",
|
|
97
98
|
label: "'Loading' Text",
|
|
98
|
-
description: "This text is shown on the 'Loading Screen' when an
|
|
99
|
+
description: "This text is shown on the 'Loading Screen' when an xApp Page is launched.",
|
|
99
100
|
},
|
|
100
101
|
{
|
|
101
102
|
type: "cognigyText",
|
|
102
103
|
key: "appLaunchErrorText",
|
|
103
104
|
label: "'Launch Error' Text",
|
|
104
|
-
description: "This text is shown when an
|
|
105
|
+
description: "This text is shown when an xApp Page fails to load for any reason.",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: "cognigyText",
|
|
109
|
+
key: "appErrorText",
|
|
110
|
+
label: "'xApp Error' Text",
|
|
111
|
+
description: "This text is shown when an xApp Page encounters an Error and is halted.",
|
|
105
112
|
},
|
|
106
113
|
// Intermediate Screen
|
|
107
114
|
{
|
|
@@ -127,7 +134,7 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
127
134
|
value: "override",
|
|
128
135
|
},
|
|
129
136
|
{
|
|
130
|
-
label: "Replace with
|
|
137
|
+
label: "Replace with xApp",
|
|
131
138
|
value: "app",
|
|
132
139
|
},
|
|
133
140
|
],
|
|
@@ -150,8 +157,8 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
150
157
|
{
|
|
151
158
|
type: "cognigyText",
|
|
152
159
|
key: "intermediateScreenAppTemplateId",
|
|
153
|
-
label: "
|
|
154
|
-
description: "Select which
|
|
160
|
+
label: "xApp Template",
|
|
161
|
+
description: "Select which xApp Template should be used to replace the intermediate screen",
|
|
155
162
|
defaultValue: "",
|
|
156
163
|
condition: {
|
|
157
164
|
key: "intermediateScreenCustomizationType",
|
|
@@ -164,8 +171,8 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
164
171
|
{
|
|
165
172
|
type: "json",
|
|
166
173
|
key: "intermediateScreenAppTemplateData",
|
|
167
|
-
label: "
|
|
168
|
-
description: "Select which data should be provided to the
|
|
174
|
+
label: "xApp Template Data",
|
|
175
|
+
description: "Select which data should be provided to the xApp Template which replaces the intermediate screen",
|
|
169
176
|
defaultValue: "{}",
|
|
170
177
|
condition: {
|
|
171
178
|
key: "intermediateScreenCustomizationType",
|
|
@@ -196,7 +203,7 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
196
203
|
value: "override",
|
|
197
204
|
},
|
|
198
205
|
{
|
|
199
|
-
label: "Replace with
|
|
206
|
+
label: "Replace with xApp",
|
|
200
207
|
value: "app",
|
|
201
208
|
},
|
|
202
209
|
],
|
|
@@ -241,8 +248,8 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
241
248
|
{
|
|
242
249
|
type: "cognigyText",
|
|
243
250
|
key: "connectionScreenAppTemplateId",
|
|
244
|
-
label: "
|
|
245
|
-
description: "Select which
|
|
251
|
+
label: "xApp Template",
|
|
252
|
+
description: "Select which xApp Template should be used to replace the connection screen",
|
|
246
253
|
defaultValue: "",
|
|
247
254
|
condition: {
|
|
248
255
|
key: "connectionScreenCustomizationType",
|
|
@@ -255,22 +262,14 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
255
262
|
{
|
|
256
263
|
type: "json",
|
|
257
264
|
key: "connectionScreenAppTemplateData",
|
|
258
|
-
label: "
|
|
259
|
-
description: "Select which data should be provided to the
|
|
265
|
+
label: "xApp Template Data",
|
|
266
|
+
description: "Select which data should be provided to the xApp Template which replaces the connection screen",
|
|
260
267
|
defaultValue: "{}",
|
|
261
268
|
condition: {
|
|
262
269
|
key: "connectionScreenCustomizationType",
|
|
263
270
|
value: "app",
|
|
264
271
|
},
|
|
265
272
|
},
|
|
266
|
-
// OTHER
|
|
267
|
-
{
|
|
268
|
-
type: "cognigyText",
|
|
269
|
-
label: "App Shell Page Base URL",
|
|
270
|
-
description: "This field exists during development until this value is automatically assigned",
|
|
271
|
-
defaultValue: "http://static.test/",
|
|
272
|
-
key: "shellPageBaseURL",
|
|
273
|
-
},
|
|
274
273
|
],
|
|
275
274
|
sections: [
|
|
276
275
|
{
|
|
@@ -292,9 +291,9 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
292
291
|
defaultCollapsed: false,
|
|
293
292
|
},
|
|
294
293
|
{
|
|
295
|
-
label: "
|
|
294
|
+
label: "xApp Screens",
|
|
296
295
|
key: "appScreensSection",
|
|
297
|
-
fields: ["appLoadingText", "appLaunchErrorText"],
|
|
296
|
+
fields: ["appLoadingText", "appLaunchErrorText", "appErrorText"],
|
|
298
297
|
defaultCollapsed: false,
|
|
299
298
|
},
|
|
300
299
|
{
|
|
@@ -345,43 +344,25 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
345
344
|
type: "section",
|
|
346
345
|
key: "connectionScreenSection",
|
|
347
346
|
},
|
|
348
|
-
{
|
|
349
|
-
type: "field",
|
|
350
|
-
key: "shellPageBaseURL",
|
|
351
|
-
},
|
|
352
347
|
],
|
|
353
348
|
tags: ["basic", "apps"],
|
|
354
349
|
tokens: [
|
|
355
350
|
{
|
|
356
351
|
type: "input",
|
|
357
|
-
label: "
|
|
358
|
-
script: "input.
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
type: "input",
|
|
362
|
-
label: "App Session URL",
|
|
363
|
-
script: `
|
|
364
|
-
(() => {
|
|
365
|
-
if (!input.shellPageBaseURL) return '';
|
|
366
|
-
if (!input.appSessionToken) return '';
|
|
367
|
-
const overrides = input.shellPageOverrides ? \`&overrides=\${encodeURIComponent(JSON.stringify(input.shellPageOverrides))}\` : '';
|
|
368
|
-
return [input.shellPageBaseURL, '?token=', input.appSessionToken, overrides].join('');
|
|
369
|
-
})()`
|
|
370
|
-
.split("\n")
|
|
371
|
-
.join(" "),
|
|
352
|
+
label: "xApp Session URL",
|
|
353
|
+
script: "input.apps.url || ''"
|
|
372
354
|
},
|
|
373
355
|
],
|
|
374
356
|
function: async ({ cognigy, config }) => {
|
|
357
|
+
var _a;
|
|
375
358
|
const { api, input } = cognigy;
|
|
376
359
|
const {
|
|
377
|
-
// general
|
|
378
|
-
shellPageBaseURL,
|
|
379
360
|
// styling
|
|
380
361
|
backgroundColor, textColor, errorTextColor, logo, logoUrl,
|
|
381
362
|
// pin screen
|
|
382
363
|
pinEnterPinText, pinIncorrectText, pinUnavailableText,
|
|
383
364
|
// apps screen
|
|
384
|
-
appLoadingText, appLaunchErrorText,
|
|
365
|
+
appLoadingText, appLaunchErrorText, appErrorText,
|
|
385
366
|
// intermediate screen
|
|
386
367
|
intermediateScreenCustomizationType, intermediateScreenOverrideText, intermediateScreenAppTemplateId, intermediateScreenAppTemplateData,
|
|
387
368
|
// status screen
|
|
@@ -420,6 +401,7 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
420
401
|
const appScreenCustomization = {
|
|
421
402
|
loadingText: appLoadingText,
|
|
422
403
|
launchErrorText: appLaunchErrorText,
|
|
404
|
+
appErrorText: appErrorText,
|
|
423
405
|
};
|
|
424
406
|
const intermediateScreenCustomization = (() => {
|
|
425
407
|
switch (intermediateScreenCustomizationType) {
|
|
@@ -477,12 +459,13 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
477
459
|
appScreen: appScreenCustomization,
|
|
478
460
|
};
|
|
479
461
|
})();
|
|
480
|
-
if (!input.
|
|
481
|
-
const appSessionToken = await api.initAppSession(
|
|
482
|
-
api.addToInput("
|
|
462
|
+
if (!input.apps.session.token) {
|
|
463
|
+
const appSessionToken = await api.initAppSession();
|
|
464
|
+
api.addToInput("apps.session.token", appSessionToken);
|
|
483
465
|
}
|
|
484
|
-
|
|
485
|
-
api.addToInput("
|
|
466
|
+
const finalUrl = (0, buildAppUrl_1.buildAppUrl)(input.apps.baseUrl, (_a = input.apps.session) === null || _a === void 0 ? void 0 : _a.token, customization);
|
|
467
|
+
api.addToInput("apps.url", finalUrl);
|
|
468
|
+
api.addToInput("apps.customization", customization || null);
|
|
486
469
|
},
|
|
487
470
|
});
|
|
488
471
|
//# sourceMappingURL=initAppSession.js.map
|
|
@@ -11,8 +11,8 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
|
11
11
|
*/
|
|
12
12
|
exports.SET_ADAPTIVE_CARD_APP_STATE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
13
13
|
type: "setAdaptiveCardAppState",
|
|
14
|
-
defaultLabel: "Set AdaptiveCard
|
|
15
|
-
summary: "Shows an AdaptiveCard via an
|
|
14
|
+
defaultLabel: "Set AdaptiveCard xApp State",
|
|
15
|
+
summary: "Shows an AdaptiveCard via an xApp",
|
|
16
16
|
appearance: {
|
|
17
17
|
showIcon: false,
|
|
18
18
|
},
|
|
@@ -38,14 +38,6 @@ exports.SET_ADAPTIVE_CARD_APP_STATE = (0, createNodeDescriptor_1.createNodeDescr
|
|
|
38
38
|
description: "Alters the color of text that is rendered on the 'Primary Color' (e.g. button labels). Has to be a CSS-compatible color",
|
|
39
39
|
defaultValue: "",
|
|
40
40
|
},
|
|
41
|
-
// OTHER
|
|
42
|
-
{
|
|
43
|
-
type: "cognigyText",
|
|
44
|
-
label: "AdaptiveCard Template URL",
|
|
45
|
-
description: "This field exists during development until this value is automatically assigned",
|
|
46
|
-
defaultValue: "http://static.test/apps/adaptivecards/",
|
|
47
|
-
key: "appTemplateURL",
|
|
48
|
-
},
|
|
49
41
|
],
|
|
50
42
|
sections: [
|
|
51
43
|
{
|
|
@@ -58,17 +50,12 @@ exports.SET_ADAPTIVE_CARD_APP_STATE = (0, createNodeDescriptor_1.createNodeDescr
|
|
|
58
50
|
form: [
|
|
59
51
|
{ type: "field", key: "card" },
|
|
60
52
|
{ type: "section", key: "overrideSection" },
|
|
61
|
-
{ type: "field", key: "appTemplateURL" },
|
|
62
53
|
],
|
|
63
54
|
tags: ["basic", "apps"],
|
|
64
55
|
function: async ({ cognigy, config }) => {
|
|
65
|
-
const { api } = cognigy;
|
|
66
|
-
const { card, primaryColor, primaryContrastColor,
|
|
67
|
-
const appTemplateURL =
|
|
68
|
-
if (!!_appTemplateURL)
|
|
69
|
-
return _appTemplateURL;
|
|
70
|
-
return "http://static.test/apps/adaptivecards/";
|
|
71
|
-
})();
|
|
56
|
+
const { api, input } = cognigy;
|
|
57
|
+
const { card, primaryColor, primaryContrastColor, } = config;
|
|
58
|
+
const appTemplateURL = `${input.apps.baseUrl}/apps/adaptivecards/`;
|
|
72
59
|
api.setAppState(appTemplateURL, {
|
|
73
60
|
card,
|
|
74
61
|
primaryColor: primaryColor || undefined,
|
|
@@ -11,8 +11,8 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
|
11
11
|
*/
|
|
12
12
|
exports.SET_APP_STATE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
13
13
|
type: "setAppState",
|
|
14
|
-
defaultLabel: "Set
|
|
15
|
-
summary: "Set the state of an
|
|
14
|
+
defaultLabel: "Set xApp State",
|
|
15
|
+
summary: "Set the state of an xApp Template.",
|
|
16
16
|
appearance: {
|
|
17
17
|
showIcon: false,
|
|
18
18
|
},
|
|
@@ -20,8 +20,8 @@ exports.SET_APP_STATE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
20
20
|
{
|
|
21
21
|
key: "appTemplateId",
|
|
22
22
|
type: "cognigyText",
|
|
23
|
-
label: "
|
|
24
|
-
description: "Select which
|
|
23
|
+
label: "xApp Template",
|
|
24
|
+
description: "Select which xApp Template should be used",
|
|
25
25
|
params: {
|
|
26
26
|
required: true,
|
|
27
27
|
},
|
|
@@ -29,8 +29,8 @@ exports.SET_APP_STATE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
29
29
|
{
|
|
30
30
|
key: "appTemplateData",
|
|
31
31
|
type: "json",
|
|
32
|
-
label: "
|
|
33
|
-
description: "Select which data should be provided to the
|
|
32
|
+
label: "xApp Template Data",
|
|
33
|
+
description: "Select which data should be provided to the xApp Template",
|
|
34
34
|
defaultValue: "{}",
|
|
35
35
|
},
|
|
36
36
|
],
|