@cognigy/rest-api-client 2025.18.0 → 2025.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/build/authentication/AuthenticationAPI.js +1 -1
- package/build/authentication/OAuth2/OAuth2Authentication.js +10 -9
- package/build/connector/AxiosAdapter.js +2 -1
- package/build/shared/charts/descriptors/service/GPTPrompt.js +2 -2
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +2 -2
- package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +2 -2
- package/build/shared/generativeAI/utils/generativeAIPrompts.js +17 -446
- package/build/shared/generativeAI/utils/prompts/flowGeneration.js +168 -0
- package/build/shared/generativeAI/utils/prompts/generateNodeOutput.js +39 -0
- package/build/shared/generativeAI/utils/prompts/intentSentenceGeneration.js +15 -0
- package/build/shared/generativeAI/utils/prompts/lexiconGeneration.js +22 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +4 -0
- package/build/shared/interfaces/messageAPI/endpoints.js +3 -2
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +87 -77
- package/build/test.js +39 -0
- package/dist/esm/authentication/AuthenticationAPI.js +1 -1
- package/dist/esm/authentication/OAuth2/OAuth2Authentication.js +10 -9
- package/dist/esm/connector/AxiosAdapter.js +2 -1
- package/dist/esm/shared/charts/descriptors/service/GPTPrompt.js +1 -1
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +1 -1
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +1 -1
- package/dist/esm/shared/generativeAI/utils/generativeAIPrompts.js +16 -445
- package/dist/esm/shared/generativeAI/utils/prompts/flowGeneration.js +165 -0
- package/dist/esm/shared/generativeAI/utils/prompts/generateNodeOutput.js +36 -0
- package/dist/esm/shared/generativeAI/utils/prompts/intentSentenceGeneration.js +12 -0
- package/dist/esm/shared/generativeAI/utils/prompts/lexiconGeneration.js +19 -0
- package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +4 -0
- package/dist/esm/shared/interfaces/messageAPI/endpoints.js +3 -2
- package/dist/esm/shared/interfaces/resources/INodeDescriptorSet.js +88 -78
- package/dist/esm/shared/interfaces/restAPI/management/authentication/ICreateJWTToken.js +1 -0
- package/dist/esm/test.js +39 -0
- package/package.json +1 -1
- package/types/index.d.ts +20 -2
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flowGenerationWithDescriptionPrompt = exports.flowGenerationWithTranscriptPrompt = void 0;
|
|
4
|
+
const flowGenerationWithTranscriptPromptString = `Create a new bot called "@@name" based on the following transcript example between the bot and a user:
|
|
5
|
+
|
|
6
|
+
# Transcript:
|
|
7
|
+
|
|
8
|
+
@@text
|
|
9
|
+
|
|
10
|
+
Write the bot in @@lng. Consider the following list of constraints:
|
|
11
|
+
|
|
12
|
+
# Instructions:
|
|
13
|
+
|
|
14
|
+
## Do only use flow nodes of the following list. Do not use other nodes.
|
|
15
|
+
|
|
16
|
+
## The configurable parameters are listed in brackets:
|
|
17
|
+
- say "Say stuff and output something using {{Node.js Code}}"
|
|
18
|
+
- question (output: "context.variable", validation: "text|yesNo|number|email|url", options: "Option 1|Option 2|Option 3") "Ask question with {{Node.js Code}} support?"
|
|
19
|
+
- backendCall (output: "context.variable") "Call external API"
|
|
20
|
+
- code "Node.js Code"
|
|
21
|
+
- switch "Node.js Code"
|
|
22
|
+
- case
|
|
23
|
+
- default
|
|
24
|
+
- if "Node.js Code"
|
|
25
|
+
- then
|
|
26
|
+
- else
|
|
27
|
+
|
|
28
|
+
# Examples:
|
|
29
|
+
|
|
30
|
+
## Example flow in English:
|
|
31
|
+
|
|
32
|
+
- question (output: "context.email", validation: "email") "What is your email address?"
|
|
33
|
+
- question (output: "context.url", validation: "url") "And what is the URL?"
|
|
34
|
+
- code "function areDomainsSame(email, url) { let emailSplit = email.split('@'); let urlSplit = url.split('.'); if (emailSplit[1] === urlSplit[1]) { return true; } return false;} context.areDomainsSame = areDomainsSame(context.email, context.url);"
|
|
35
|
+
- if "context.areDomainsSame === true"
|
|
36
|
+
- then
|
|
37
|
+
- say "The domains are the same."
|
|
38
|
+
- else
|
|
39
|
+
- say "The domains are not the same."
|
|
40
|
+
|
|
41
|
+
## Example flow in German:
|
|
42
|
+
|
|
43
|
+
- say "Hallo, ich bin ein Faktenprüfer. Ich entlarve Mythen durch Fakten."
|
|
44
|
+
- question (output: "context.color", validation: "text", options: "rot|grün|blau") "Welche Farbe hat der Himmel?"
|
|
45
|
+
- switch "context.color"
|
|
46
|
+
- case "blau"
|
|
47
|
+
- say "Du hast recht, das ist eine Tatsache."
|
|
48
|
+
- case "rot"
|
|
49
|
+
- say "Ja tatsächlich, manchmal ist der Himmel sogar rot."
|
|
50
|
+
- default
|
|
51
|
+
- say "Nein, der Himmel ist tagsüber normalerweise blau."
|
|
52
|
+
|
|
53
|
+
## Example flow in Spanish:
|
|
54
|
+
|
|
55
|
+
- say "Hola, puedo conectarlo con nuestro equipo de soporte."
|
|
56
|
+
- question (output: "context.wantsSupport", validation: "yesNo") "¿Te gustaría contactar el soporte?"
|
|
57
|
+
- if "context.wantsSupport === true"
|
|
58
|
+
- then
|
|
59
|
+
- backendCall (output: "context.contactDetails") "call API to retrieve contact details of support"
|
|
60
|
+
- say "Aquí tienes. Por favor vea los detalles de contacto de nuestro soporte: {{context.contactDetails}}"
|
|
61
|
+
- else
|
|
62
|
+
- backendCall (output: "context.success") "call API to log decision"
|
|
63
|
+
|
|
64
|
+
# Additional information:
|
|
65
|
+
|
|
66
|
+
## Say nodes and question nodes execute Node.js in double curly braces, for example:
|
|
67
|
+
|
|
68
|
+
- say "This is a {{context.variable.toLowerCase()}}"
|
|
69
|
+
- question (output: "context.result", validation: "text") "Do you like {{"banana".toUpperCase()}}?"
|
|
70
|
+
|
|
71
|
+
## When using the option parameter then use human-readable text and more than one option.
|
|
72
|
+
## Only use a switch node when considering multiple options.
|
|
73
|
+
## When using a switch node then always use a default node as last resort.
|
|
74
|
+
## Do not use a backendCall if a Code Node can solve it.
|
|
75
|
+
## Dot not use "for" nodes to simulate a for-loop.
|
|
76
|
+
## Use a smallest amount of flow nodes possible.
|
|
77
|
+
|
|
78
|
+
## Return just a list of nodes following the required format and instructions, and nothing else.`;
|
|
79
|
+
exports.flowGenerationWithTranscriptPrompt = [
|
|
80
|
+
{
|
|
81
|
+
role: "system",
|
|
82
|
+
content: flowGenerationWithTranscriptPromptString,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
role: "user",
|
|
86
|
+
content: "Let's start."
|
|
87
|
+
}
|
|
88
|
+
];
|
|
89
|
+
const flowGenerationWithDescriptionPromptString = `Create a new bot called "@@name" with the following description:
|
|
90
|
+
"@@text" Write the bot in @@lng. Consider the following list of constraints:
|
|
91
|
+
|
|
92
|
+
# Instructions:
|
|
93
|
+
|
|
94
|
+
## Do only use flow nodes of the following list. Do not use other nodes.
|
|
95
|
+
|
|
96
|
+
## The configurable parameters are listed in brackets:
|
|
97
|
+
- say "Say stuff and output something using {{Node.js Code}}"
|
|
98
|
+
- question (output: "context.variable", validation: "text|yesNo|number|email|url", options: "Option 1|Option 2|Option 3") "Ask question with {{Node.js Code}} support?"
|
|
99
|
+
- backendCall (output: "context.variable") "Call external API"
|
|
100
|
+
- code "Node.js Code"
|
|
101
|
+
- switch "Node.js Code"
|
|
102
|
+
- case
|
|
103
|
+
- default
|
|
104
|
+
- if "Node.js Code"
|
|
105
|
+
- then
|
|
106
|
+
- else
|
|
107
|
+
|
|
108
|
+
# Examples:
|
|
109
|
+
|
|
110
|
+
## Example flow in English:
|
|
111
|
+
|
|
112
|
+
- question (output: "context.email", validation: "email") "What is your email address?"
|
|
113
|
+
- question (output: "context.url", validation: "url") "And what is the URL?"
|
|
114
|
+
- code "function areDomainsSame(email, url) { let emailSplit = email.split('@'); let urlSplit = url.split('.'); if (emailSplit[1] === urlSplit[1]) { return true; } return false;} context.areDomainsSame = areDomainsSame(context.email, context.url);"
|
|
115
|
+
- if "context.areDomainsSame === true"
|
|
116
|
+
- then
|
|
117
|
+
- say "The domains are the same."
|
|
118
|
+
- else
|
|
119
|
+
- say "The domains are not the same."
|
|
120
|
+
|
|
121
|
+
## Example flow in German:
|
|
122
|
+
|
|
123
|
+
- say "Hallo, ich bin ein Faktenprüfer. Ich entlarve Mythen durch Fakten."
|
|
124
|
+
- question (output: "context.color", validation: "text", options: "rot|grün|blau") "Welche Farbe hat der Himmel?"
|
|
125
|
+
- switch "context.color"
|
|
126
|
+
- case "blau"
|
|
127
|
+
- say "Du hast recht, das ist eine Tatsache."
|
|
128
|
+
- case "rot"
|
|
129
|
+
- say "Ja tatsächlich, manchmal ist der Himmel sogar rot."
|
|
130
|
+
- default
|
|
131
|
+
- say "Nein, der Himmel ist tagsüber normalerweise blau."
|
|
132
|
+
|
|
133
|
+
## Example flow in Spanish:
|
|
134
|
+
|
|
135
|
+
- say "Hola, puedo conectarlo con nuestro equipo de soporte."
|
|
136
|
+
- question (output: "context.wantsSupport", validation: "yesNo") "¿Te gustaría contactar el soporte?"
|
|
137
|
+
- if "context.wantsSupport === true"
|
|
138
|
+
- then
|
|
139
|
+
- backendCall (output: "context.contactDetails") "call API to retrieve contact details of support"
|
|
140
|
+
- say "Aquí tienes. Por favor vea los detalles de contacto de nuestro soporte: {{context.contactDetails}}"
|
|
141
|
+
- else
|
|
142
|
+
- backendCall (output: "context.success") "call API to log decision"
|
|
143
|
+
|
|
144
|
+
# Additional information:
|
|
145
|
+
|
|
146
|
+
## Say nodes and question nodes execute Node.js in double curly braces, for example:
|
|
147
|
+
- say "This is a {{context.variable.toLowerCase()}}"
|
|
148
|
+
- question (output: "context.result", validation: "text") "Do you like {{"banana".toUpperCase()}}?"
|
|
149
|
+
|
|
150
|
+
## When using the option parameter then use human-readable text and more than one option.
|
|
151
|
+
## Only use a switch node when considering multiple options.
|
|
152
|
+
## When using a switch node then always use a default node as last resort.
|
|
153
|
+
## Do not use a backendCall if a Code Node can solve it.
|
|
154
|
+
## Dot not use "for" nodes to simulate a for-loop.
|
|
155
|
+
## Use a smallest amount of flow nodes possible.
|
|
156
|
+
|
|
157
|
+
## Return just a list of nodes following the required format and instructions, and nothing else.`;
|
|
158
|
+
exports.flowGenerationWithDescriptionPrompt = [
|
|
159
|
+
{
|
|
160
|
+
role: "system",
|
|
161
|
+
content: flowGenerationWithDescriptionPromptString,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
role: "user",
|
|
165
|
+
content: "Let's start."
|
|
166
|
+
}
|
|
167
|
+
];
|
|
168
|
+
//# sourceMappingURL=flowGeneration.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateNodeOutputModifyAdaptiveCardPrompt = exports.generateNodeOutputCreateAdaptiveCardPrompt = exports.generateNodeOutputTextPrompt = void 0;
|
|
4
|
+
const generateNodeOutputTextPromptString = 'Create @@noOfSentencesToGenerate unique sentences based on the description: "@@description" in @@language and return them as a pipe-separated string.';
|
|
5
|
+
exports.generateNodeOutputTextPrompt = [
|
|
6
|
+
{
|
|
7
|
+
role: "system",
|
|
8
|
+
content: generateNodeOutputTextPromptString,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
role: "user",
|
|
12
|
+
content: "Let's start."
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
const generateNodeOutputCreateAdaptiveCardPromptString = 'Create an adaptiveCard based on the description: "@@description" in @@language. Return nothing but the Adaptive Card JSON object. Your Adaptive Card should accurately reflect the requirements described in the description, while still adhering to the Adaptive Card JSON specification.';
|
|
16
|
+
exports.generateNodeOutputCreateAdaptiveCardPrompt = [
|
|
17
|
+
{
|
|
18
|
+
role: "system",
|
|
19
|
+
content: generateNodeOutputCreateAdaptiveCardPromptString,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
role: "user",
|
|
23
|
+
content: "Let's start."
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
const generateNodeOutputModifyAdaptiveCardPromptString = 'Please modify the @@lastOutput Adaptive Card JSON based on the provided instruction "@@description". Return nothing but the Adaptive Card JSON object. The language of the Adaptive Card text should be @@language. Your modified Adaptive Card should accurately reflect the changes described in the description, while still adhering to the Adaptive Card JSON specification.';
|
|
27
|
+
exports.generateNodeOutputModifyAdaptiveCardPrompt = [
|
|
28
|
+
{
|
|
29
|
+
role: "system",
|
|
30
|
+
content: generateNodeOutputModifyAdaptiveCardPromptString,
|
|
31
|
+
},
|
|
32
|
+
// The user role is a workaround for Anthropic models which require a user message as per our implementation in llm-providers.
|
|
33
|
+
// However, the user role confuses gpt-3.5-turbo, which needs a more descriptive user message to generate the adaptive card.
|
|
34
|
+
{
|
|
35
|
+
role: "user",
|
|
36
|
+
content: "Let's start generating the adaptive card."
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
//# sourceMappingURL=generateNodeOutput.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.intentSentenceGenerationPrompt = void 0;
|
|
4
|
+
const intentSentenceGenerationPromptString = `For NLU model intent '@@name'<description> with the description '@@description'</description>. Create @@noOfSentencesToGenerate varied sentences other than the given examples<language> in @@language</language>. Return nothing but a JSON array of strings.\n<default-reply>Also, consider framing the sentences like a user question that a human would answer: @@defaultReply.\n</default-reply><example-sentences>Examples: @@exampleSentences \n</example-sentences>`;
|
|
5
|
+
exports.intentSentenceGenerationPrompt = [
|
|
6
|
+
{
|
|
7
|
+
role: "system",
|
|
8
|
+
content: intentSentenceGenerationPromptString,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
role: "user",
|
|
12
|
+
content: "Let's start."
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
//# sourceMappingURL=intentSentenceGeneration.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LEXICON_GENERATION_RESPONSE_EXAMPLE_NO_SYNONYMS = exports.LEXICON_GENERATION_RESPONSE_EXAMPLE = exports.LEXICON_GENERATION_PROMPT_SYNONYM_INSTRUCTIONS = exports.lexiconGenerationPrompt = void 0;
|
|
4
|
+
const lexiconGenerationPromptString = 'For the NLU model lexicon with the title "@@name" and the description "@@description",' +
|
|
5
|
+
' generate @@lexiconEntries varied words in "@@lng".@@synonymInstructions' +
|
|
6
|
+
'\n\nRespond with a valid JSON with the format following the example: `@@example`';
|
|
7
|
+
exports.lexiconGenerationPrompt = [
|
|
8
|
+
{
|
|
9
|
+
role: "system",
|
|
10
|
+
content: lexiconGenerationPromptString,
|
|
11
|
+
},
|
|
12
|
+
// The user role is a workaround for Anthropic models which require a user message as per our implementation in llm-providers.
|
|
13
|
+
// However, the user role confuses gpt-4.1, which needs a more descriptive user message to generate the lexicon entries.
|
|
14
|
+
{
|
|
15
|
+
role: "user",
|
|
16
|
+
content: "Let's start generating the lexicon entries."
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
exports.LEXICON_GENERATION_PROMPT_SYNONYM_INSTRUCTIONS = " For each word, also list all known synonyms. The number of synonyms for each word does not have to be the same.";
|
|
20
|
+
exports.LEXICON_GENERATION_RESPONSE_EXAMPLE = '[{"word": "test","synonyms": ["trial","attempt"]},{"word": "demo","synonyms": ["proof of concept"]}]';
|
|
21
|
+
exports.LEXICON_GENERATION_RESPONSE_EXAMPLE_NO_SYNONYMS = '[{"word": "test"},{"word": "demo"}]';
|
|
22
|
+
//# sourceMappingURL=lexiconGeneration.js.map
|
|
@@ -128,7 +128,7 @@ const callEvents = [
|
|
|
128
128
|
const callFailoverSettingsSchema = {
|
|
129
129
|
title: "callEventSettingsSchema",
|
|
130
130
|
type: "object",
|
|
131
|
-
additionalProperties:
|
|
131
|
+
additionalProperties: true,
|
|
132
132
|
properties: {
|
|
133
133
|
enabled: { type: "boolean" },
|
|
134
134
|
enabledForSpeech: { type: "boolean" },
|
|
@@ -160,7 +160,7 @@ const callFailoverSettingsSchema = {
|
|
|
160
160
|
exports.callEventSettingsSchema = {
|
|
161
161
|
title: "callEventSettingsSchema",
|
|
162
162
|
type: "object",
|
|
163
|
-
additionalProperties:
|
|
163
|
+
additionalProperties: true,
|
|
164
164
|
properties: {
|
|
165
165
|
enabled: { type: "boolean" },
|
|
166
166
|
action: { type: "string", enum: ["executeFlow", "inject", "transfer", "none"] },
|
|
@@ -715,6 +715,7 @@ exports.zoomContactCenterEndpointSettingsSchema = {
|
|
|
715
715
|
exports.anyEndpointSettingsSchema = {
|
|
716
716
|
title: "anyEndpointSettingsSchema",
|
|
717
717
|
type: "object",
|
|
718
|
+
additionalProperties: true,
|
|
718
719
|
properties: Object.assign({ action: { type: "string" }, accessScope: { type: "string" }, accessToken: { type: "string" }, appId: { type: "string" }, appSecret: { type: "string" }, backgroundImageUrl: { type: "string" }, basicAuthPassword: { type: "string" }, basicAuthUser: { type: "string" }, botUserId: { type: "string" }, colorScheme: { type: "string" }, connectionName: { type: "string" }, cpaasToken: { type: "string" }, customJSON: { type: "string" }, designTemplate: { type: "integer" }, disableHtmlContentSanitization: { type: "boolean" }, disableInputAutocomplete: { type: "boolean" }, disableUrlButtonSanitization: { type: "boolean" }, disableInputSanitization: { type: "boolean" }, disableSkipUriTags: { type: "boolean" }, enableAsyncCommunication: { type: "boolean" }, enableCollectMetadata: { type: "boolean" }, enableGenericHTMLStyling: { type: "boolean" }, enableDemoWebchat: { type: "boolean" }, enableFileUpload: { type: "boolean" }, enablePersistentMenu: { type: "boolean" }, enableRating: { type: "string", enum: ["always", "once", "onRequest"] }, enableSTT: { type: "boolean" }, enableTTS: { type: "boolean" }, enableTypingIndicator: { type: "boolean" }, enableFileAttachment: { type: "boolean" }, fileAttachmentMaxSize: { type: "number" }, facebookPageToken: { type: "string" }, finishOnKey: {
|
|
719
720
|
type: "string",
|
|
720
721
|
enum: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "#"]
|
|
@@ -12,8 +12,8 @@ const nodeAppearanceSchema = {
|
|
|
12
12
|
textColor: { type: "string", format: "color" },
|
|
13
13
|
contrastTextColor: { type: "string", format: "color" },
|
|
14
14
|
showIcon: { type: "boolean" },
|
|
15
|
-
variant: { type: "string", enum: ["regular", "mini", "hexagon"] }
|
|
16
|
-
}
|
|
15
|
+
variant: { type: "string", enum: ["regular", "mini", "hexagon"] }
|
|
16
|
+
}
|
|
17
17
|
};
|
|
18
18
|
const nodeBehaviorSchema = {
|
|
19
19
|
title: "nodeBehaviorSchema",
|
|
@@ -21,8 +21,8 @@ const nodeBehaviorSchema = {
|
|
|
21
21
|
additionalProperties: false,
|
|
22
22
|
properties: {
|
|
23
23
|
stopping: { type: "boolean" },
|
|
24
|
-
entrypoint: { type: "boolean" }
|
|
25
|
-
}
|
|
24
|
+
entrypoint: { type: "boolean" }
|
|
25
|
+
}
|
|
26
26
|
};
|
|
27
27
|
exports.nodePreviewTypes = [
|
|
28
28
|
"text",
|
|
@@ -38,8 +38,8 @@ const nodePreviewSchema = {
|
|
|
38
38
|
additionalProperties: false,
|
|
39
39
|
properties: {
|
|
40
40
|
key: { type: "string", minLength: 1, maxLength: 200 },
|
|
41
|
-
type: { type: "string", enum: [...exports.nodePreviewTypes] }
|
|
42
|
-
}
|
|
41
|
+
type: { type: "string", enum: [...exports.nodePreviewTypes] }
|
|
42
|
+
}
|
|
43
43
|
};
|
|
44
44
|
const nodeConstraintSchema = {
|
|
45
45
|
title: "nodeConstraintSchema",
|
|
@@ -48,13 +48,13 @@ const nodeConstraintSchema = {
|
|
|
48
48
|
properties: {
|
|
49
49
|
blacklist: {
|
|
50
50
|
type: "array",
|
|
51
|
-
items: { type: "string", minLength: 1, maxLength: 200 }
|
|
51
|
+
items: { type: "string", minLength: 1, maxLength: 200 }
|
|
52
52
|
},
|
|
53
53
|
whitelist: {
|
|
54
54
|
type: "array",
|
|
55
|
-
items: { type: "string", minLength: 1, maxLength: 200 }
|
|
56
|
-
}
|
|
57
|
-
}
|
|
55
|
+
items: { type: "string", minLength: 1, maxLength: 200 }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
58
|
};
|
|
59
59
|
const nodeConstraintsSchema = {
|
|
60
60
|
title: "nodeConstraintsSchema",
|
|
@@ -73,10 +73,10 @@ const nodeConstraintsSchema = {
|
|
|
73
73
|
properties: {
|
|
74
74
|
children: nodeConstraintSchema,
|
|
75
75
|
predecessor: nodeConstraintSchema,
|
|
76
|
-
successor: nodeConstraintSchema
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
76
|
+
successor: nodeConstraintSchema
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
80
|
};
|
|
81
81
|
const nodeDependenciesSchema = {
|
|
82
82
|
title: "nodeDependenciesSchema",
|
|
@@ -85,9 +85,9 @@ const nodeDependenciesSchema = {
|
|
|
85
85
|
properties: {
|
|
86
86
|
children: {
|
|
87
87
|
type: "array",
|
|
88
|
-
items: { type: "string", minLength: 1, maxLength: 200 }
|
|
89
|
-
}
|
|
90
|
-
}
|
|
88
|
+
items: { type: "string", minLength: 1, maxLength: 200 }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
91
|
};
|
|
92
92
|
exports.nodeFieldTypes = [
|
|
93
93
|
"adaptivecard",
|
|
@@ -157,7 +157,7 @@ exports.searchableNodeFieldTypes = [
|
|
|
157
157
|
"say",
|
|
158
158
|
"code",
|
|
159
159
|
"caseNode",
|
|
160
|
-
"select"
|
|
160
|
+
"select"
|
|
161
161
|
];
|
|
162
162
|
exports.nodeFieldSingleConditionSchema = {
|
|
163
163
|
title: "nodeFieldSingleConditionSchema",
|
|
@@ -174,11 +174,11 @@ exports.nodeFieldSingleConditionSchema = {
|
|
|
174
174
|
{ type: "number" },
|
|
175
175
|
{ type: "array", items: { type: "number" } },
|
|
176
176
|
{ type: "boolean" },
|
|
177
|
-
{ type: "array", items: { type: "boolean" } }
|
|
178
|
-
]
|
|
177
|
+
{ type: "array", items: { type: "boolean" } }
|
|
178
|
+
]
|
|
179
179
|
},
|
|
180
|
-
negate: { type: "boolean" }
|
|
181
|
-
}
|
|
180
|
+
negate: { type: "boolean" }
|
|
181
|
+
}
|
|
182
182
|
};
|
|
183
183
|
exports.nodeFieldANDConditionSchema = {
|
|
184
184
|
title: "nodeFieldANDConditionSchema",
|
|
@@ -186,8 +186,8 @@ exports.nodeFieldANDConditionSchema = {
|
|
|
186
186
|
additionalProperties: false,
|
|
187
187
|
required: ["and"],
|
|
188
188
|
properties: {
|
|
189
|
-
and: { type: "array", items: { $ref: "nodeFieldConditionSchema" } }
|
|
190
|
-
}
|
|
189
|
+
and: { type: "array", items: { $ref: "nodeFieldConditionSchema" } }
|
|
190
|
+
}
|
|
191
191
|
};
|
|
192
192
|
exports.nodeFieldORConditionSchema = {
|
|
193
193
|
title: "nodeFieldORConditionSchema",
|
|
@@ -195,8 +195,8 @@ exports.nodeFieldORConditionSchema = {
|
|
|
195
195
|
additionalProperties: false,
|
|
196
196
|
required: ["or"],
|
|
197
197
|
properties: {
|
|
198
|
-
or: { type: "array", items: { $ref: "nodeFieldConditionSchema" } }
|
|
199
|
-
}
|
|
198
|
+
or: { type: "array", items: { $ref: "nodeFieldConditionSchema" } }
|
|
199
|
+
}
|
|
200
200
|
};
|
|
201
201
|
// @ts-ignore
|
|
202
202
|
exports.nodeFieldConditionSchema = {
|
|
@@ -209,8 +209,8 @@ exports.nodeFieldConditionSchema = {
|
|
|
209
209
|
// @ts-ignore
|
|
210
210
|
exports.nodeFieldANDConditionSchema,
|
|
211
211
|
// @ts-ignore
|
|
212
|
-
exports.nodeFieldORConditionSchema
|
|
213
|
-
]
|
|
212
|
+
exports.nodeFieldORConditionSchema
|
|
213
|
+
]
|
|
214
214
|
};
|
|
215
215
|
exports.nodeOptionsResolverSchema = {
|
|
216
216
|
title: "nodeOptionsResolverSchema",
|
|
@@ -219,10 +219,10 @@ exports.nodeOptionsResolverSchema = {
|
|
|
219
219
|
properties: {
|
|
220
220
|
dependencies: {
|
|
221
221
|
type: "array",
|
|
222
|
-
items: { type: "string", minLength: 1, maxLength: 200 }
|
|
222
|
+
items: { type: "string", minLength: 1, maxLength: 200 }
|
|
223
223
|
},
|
|
224
|
-
resolverFunction: {}
|
|
225
|
-
}
|
|
224
|
+
resolverFunction: {}
|
|
225
|
+
}
|
|
226
226
|
};
|
|
227
227
|
exports.nodeFieldSchema = {
|
|
228
228
|
title: "nodeFieldSchema",
|
|
@@ -243,10 +243,10 @@ exports.nodeFieldSchema = {
|
|
|
243
243
|
deDE: { type: "string", maxLength: 200 },
|
|
244
244
|
jaJP: { type: "string", maxLength: 200 },
|
|
245
245
|
esES: { type: "string", maxLength: 200 },
|
|
246
|
-
koKR: { type: "string", maxLength: 200 }
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
]
|
|
246
|
+
koKR: { type: "string", maxLength: 200 }
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
250
|
},
|
|
251
251
|
condition: exports.nodeFieldConditionSchema,
|
|
252
252
|
defaultValue: {
|
|
@@ -256,8 +256,18 @@ exports.nodeFieldSchema = {
|
|
|
256
256
|
{ type: "number" },
|
|
257
257
|
{ type: "null" },
|
|
258
258
|
{ type: "object" },
|
|
259
|
-
{ type: "string" }
|
|
260
|
-
]
|
|
259
|
+
{ type: "string" }
|
|
260
|
+
]
|
|
261
|
+
},
|
|
262
|
+
fallbackValue: {
|
|
263
|
+
oneOf: [
|
|
264
|
+
{ type: "array" },
|
|
265
|
+
{ type: "boolean" },
|
|
266
|
+
{ type: "number" },
|
|
267
|
+
{ type: "null" },
|
|
268
|
+
{ type: "object" },
|
|
269
|
+
{ type: "string" }
|
|
270
|
+
]
|
|
261
271
|
},
|
|
262
272
|
description: {
|
|
263
273
|
oneOf: [
|
|
@@ -271,10 +281,10 @@ exports.nodeFieldSchema = {
|
|
|
271
281
|
deDE: { type: "string", maxLength: 200 },
|
|
272
282
|
jaJP: { type: "string", maxLength: 200 },
|
|
273
283
|
esES: { type: "string", maxLength: 200 },
|
|
274
|
-
koKR: { type: "string", maxLength: 200 }
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
]
|
|
284
|
+
koKR: { type: "string", maxLength: 200 }
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
]
|
|
278
288
|
},
|
|
279
289
|
params: { type: "object" },
|
|
280
290
|
optionsResolver: exports.nodeOptionsResolverSchema,
|
|
@@ -285,11 +295,11 @@ exports.nodeFieldSchema = {
|
|
|
285
295
|
lookupValue: { type: "string" },
|
|
286
296
|
fieldsToReset: {
|
|
287
297
|
type: "array",
|
|
288
|
-
items: { type: "string" }
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
298
|
+
items: { type: "string" }
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
293
303
|
};
|
|
294
304
|
exports.nodeSectionSchema = {
|
|
295
305
|
title: "nodeSectionSchema",
|
|
@@ -309,10 +319,10 @@ exports.nodeSectionSchema = {
|
|
|
309
319
|
deDE: { type: "string", maxLength: 200 },
|
|
310
320
|
jaJP: { type: "string", maxLength: 200 },
|
|
311
321
|
esES: { type: "string", maxLength: 200 },
|
|
312
|
-
koKR: { type: "string", maxLength: 200 }
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
]
|
|
322
|
+
koKR: { type: "string", maxLength: 200 }
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
]
|
|
316
326
|
},
|
|
317
327
|
description: {
|
|
318
328
|
oneOf: [
|
|
@@ -326,10 +336,10 @@ exports.nodeSectionSchema = {
|
|
|
326
336
|
deDE: { type: "string", maxLength: 200 },
|
|
327
337
|
jaJP: { type: "string", maxLength: 200 },
|
|
328
338
|
esES: { type: "string", maxLength: 200 },
|
|
329
|
-
koKR: { type: "string", maxLength: 200 }
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
]
|
|
339
|
+
koKR: { type: "string", maxLength: 200 }
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
]
|
|
333
343
|
},
|
|
334
344
|
condition: exports.nodeFieldConditionSchema,
|
|
335
345
|
defaultCollapsed: { type: "boolean" },
|
|
@@ -341,10 +351,10 @@ exports.nodeSectionSchema = {
|
|
|
341
351
|
items: {
|
|
342
352
|
type: "string",
|
|
343
353
|
minLength: 1,
|
|
344
|
-
maxLength: 200
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
354
|
+
maxLength: 200
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
348
358
|
};
|
|
349
359
|
exports.nodeFieldAndSectionFormElementSchema = {
|
|
350
360
|
title: "nodeFieldAndSectionFormElementSchema",
|
|
@@ -352,8 +362,8 @@ exports.nodeFieldAndSectionFormElementSchema = {
|
|
|
352
362
|
required: ["key", "type"],
|
|
353
363
|
properties: {
|
|
354
364
|
key: { type: "string", minLength: 1, maxLength: 200 },
|
|
355
|
-
type: { type: "string", enum: ["field", "section"] }
|
|
356
|
-
}
|
|
365
|
+
type: { type: "string", enum: ["field", "section"] }
|
|
366
|
+
}
|
|
357
367
|
};
|
|
358
368
|
exports.nodeDescriptorSchema = {
|
|
359
369
|
title: "nodeDescriptorSchema",
|
|
@@ -375,10 +385,10 @@ exports.nodeDescriptorSchema = {
|
|
|
375
385
|
deDE: { type: "string", maxLength: 200 },
|
|
376
386
|
jaJP: { type: "string", maxLength: 200 },
|
|
377
387
|
esES: { type: "string", maxLength: 200 },
|
|
378
|
-
koKR: { type: "string", maxLength: 200 }
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
]
|
|
388
|
+
koKR: { type: "string", maxLength: 200 }
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
]
|
|
382
392
|
},
|
|
383
393
|
summary: {
|
|
384
394
|
oneOf: [
|
|
@@ -392,10 +402,10 @@ exports.nodeDescriptorSchema = {
|
|
|
392
402
|
deDE: { type: "string", maxLength: 200 },
|
|
393
403
|
jaJP: { type: "string", maxLength: 200 },
|
|
394
404
|
esES: { type: "string", maxLength: 200 },
|
|
395
|
-
koKR: { type: "string", maxLength: 200 }
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
]
|
|
405
|
+
koKR: { type: "string", maxLength: 200 }
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
]
|
|
399
409
|
},
|
|
400
410
|
appearance: nodeAppearanceSchema,
|
|
401
411
|
behavior: nodeBehaviorSchema,
|
|
@@ -408,25 +418,25 @@ exports.nodeDescriptorSchema = {
|
|
|
408
418
|
type: "array",
|
|
409
419
|
items: { type: "string" },
|
|
410
420
|
uniqueItems: true,
|
|
411
|
-
minItems: 0
|
|
421
|
+
minItems: 0
|
|
412
422
|
},
|
|
413
423
|
tokens: {
|
|
414
424
|
type: "array",
|
|
415
425
|
items: ISnippet_1.snippetDataSchema,
|
|
416
|
-
uniqueItems: true
|
|
426
|
+
uniqueItems: true
|
|
417
427
|
},
|
|
418
428
|
sections: {
|
|
419
429
|
type: "array",
|
|
420
430
|
additionalItems: false,
|
|
421
|
-
items: exports.nodeSectionSchema
|
|
431
|
+
items: exports.nodeSectionSchema
|
|
422
432
|
},
|
|
423
433
|
form: {
|
|
424
434
|
type: "array",
|
|
425
435
|
additionalItems: false,
|
|
426
436
|
maxLength: 25,
|
|
427
|
-
items: exports.nodeFieldAndSectionFormElementSchema
|
|
428
|
-
}
|
|
429
|
-
}
|
|
437
|
+
items: exports.nodeFieldAndSectionFormElementSchema
|
|
438
|
+
}
|
|
439
|
+
}
|
|
430
440
|
};
|
|
431
441
|
exports.nodeDescriptorSetSchema = {
|
|
432
442
|
title: "nodeDescriptorSetSchema",
|
|
@@ -442,10 +452,10 @@ exports.nodeDescriptorSetSchema = {
|
|
|
442
452
|
descriptors: {
|
|
443
453
|
type: "array",
|
|
444
454
|
additionalItems: false,
|
|
445
|
-
items: exports.nodeDescriptorSchema
|
|
455
|
+
items: exports.nodeDescriptorSchema
|
|
446
456
|
},
|
|
447
457
|
resourceType: { type: "string", enum: TResourceType_1.chartableResourceTypes },
|
|
448
|
-
trustedCode: { type: "boolean" }
|
|
449
|
-
}
|
|
458
|
+
trustedCode: { type: "boolean" }
|
|
459
|
+
}
|
|
450
460
|
};
|
|
451
461
|
//# sourceMappingURL=INodeDescriptorSet.js.map
|
package/build/test.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* import { RestAPIClient, TRestAPIClient } from "./RestAPIClient";
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
const FormData = require("form-data");
|
|
4
|
+
|
|
5
|
+
const OAUTH_CLIENT_ID = "cognigy-ui";
|
|
6
|
+
const OAUTH_CLIENT_SECRET =
|
|
7
|
+
"KR7yxR3rAhZ9sEn923dZ5KeNs9SVuwBjHxXKpmqtvSNXw5xWz35Y5YRtTBt96Jaa";
|
|
8
|
+
const baseUrl = "https://api.test";
|
|
9
|
+
|
|
10
|
+
const instance = new RestAPIClient({
|
|
11
|
+
numberOfRetries: 2,
|
|
12
|
+
baseUrl,
|
|
13
|
+
versions: {
|
|
14
|
+
administration: "2.0",
|
|
15
|
+
external: "2.0",
|
|
16
|
+
metrics: "2.0",
|
|
17
|
+
resources: "2.0",
|
|
18
|
+
sessions: "2.0"
|
|
19
|
+
},
|
|
20
|
+
timeout: 10000
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
(async () => {
|
|
24
|
+
|
|
25
|
+
const base64SnapshotString = fs.readFileSync('./src/IDE/fixtures/snapshots/overrideSnapshotConnections_project.csnap')
|
|
26
|
+
const form = new FormData();
|
|
27
|
+
|
|
28
|
+
form.append("projectId", projectId);
|
|
29
|
+
form.append("file", base64SnapshotString, "snapshot.csnap");
|
|
30
|
+
|
|
31
|
+
const slot = await instance.uploadExtension({
|
|
32
|
+
projectId: "your-project-id"
|
|
33
|
+
fs.readFileSync('./src/IDE/fixtures/snapshots/overrideSnapshotConnections_project.csnap'),
|
|
34
|
+
user: "your-user-id",
|
|
35
|
+
});
|
|
36
|
+
console.log(slot);
|
|
37
|
+
})();
|
|
38
|
+
*/
|
|
39
|
+
//# sourceMappingURL=test.js.map
|