@xapp/stentor-templates 1.52.116 → 1.53.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/lib/TemplateFactory.d.ts +9 -1
- package/lib/TemplateFactory.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/smbs/SMBTemplate.d.ts +24 -0
- package/lib/smbs/SMBTemplate.js +4 -0
- package/lib/smbs/SMBTemplate.js.map +1 -0
- package/lib/smbs/SMBTemplateFactory.d.ts +16 -0
- package/lib/smbs/SMBTemplateFactory.js +167 -0
- package/lib/smbs/SMBTemplateFactory.js.map +1 -0
- package/lib/smbs/constants.d.ts +23 -0
- package/lib/smbs/constants.js +89 -0
- package/lib/smbs/constants.js.map +1 -0
- package/lib/smbs/index.d.ts +4 -0
- package/lib/smbs/index.js +21 -0
- package/lib/smbs/index.js.map +1 -0
- package/package.json +14 -8
package/lib/TemplateFactory.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export declare abstract class TemplateFactory<T extends Template> {
|
|
|
18
18
|
/**
|
|
19
19
|
* Generate an App from the provided template with optional App is used to fill in
|
|
20
20
|
* already existing information that did not exist on the template.
|
|
21
|
+
*
|
|
22
|
+
* Used by the API to generate an App from a template.
|
|
21
23
|
*/
|
|
22
24
|
abstract generateApp(template: T, app?: OVAIApp): OVAIApp;
|
|
23
25
|
/**
|
|
@@ -36,19 +38,25 @@ export declare abstract class TemplateFactory<T extends Template> {
|
|
|
36
38
|
/**
|
|
37
39
|
* Generate intents and handlers for the templated app.
|
|
38
40
|
*
|
|
41
|
+
* Used by the API to generate intents and handlers for the app.
|
|
42
|
+
*
|
|
39
43
|
* @param template
|
|
40
44
|
* @param handlers
|
|
41
45
|
*/
|
|
42
|
-
abstract generateIntentsAndHandlers(template: T, handlers
|
|
46
|
+
abstract generateIntentsAndHandlers(template: T, handlers?: (Handler | Intent)[]): (Handler | Intent)[];
|
|
43
47
|
/**
|
|
44
48
|
* Generate entities for the templated app.
|
|
45
49
|
*
|
|
50
|
+
* Used by the API to generate entities for the app.
|
|
51
|
+
*
|
|
46
52
|
* @param template
|
|
47
53
|
*/
|
|
48
54
|
abstract generateEntities(template?: T): Entity[];
|
|
49
55
|
/**
|
|
50
56
|
* Generate test cases for the templated app.
|
|
51
57
|
*
|
|
58
|
+
* Used by the API to generate test cases for the app.
|
|
59
|
+
*
|
|
52
60
|
* @param template
|
|
53
61
|
*/
|
|
54
62
|
abstract generateUtterancesTests(template?: T): UtteranceTest[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateFactory.js","sourceRoot":"","sources":["../src/TemplateFactory.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAsB,eAAe;
|
|
1
|
+
{"version":3,"file":"TemplateFactory.js","sourceRoot":"","sources":["../src/TemplateFactory.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAsB,eAAe;CAwDpC;AAxDD,0CAwDC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -20,4 +20,5 @@ __exportStar(require("./onDemand"), exports);
|
|
|
20
20
|
__exportStar(require("./radio"), exports);
|
|
21
21
|
__exportStar(require("./TemplateFactory"), exports);
|
|
22
22
|
__exportStar(require("./Types"), exports);
|
|
23
|
+
__exportStar(require("./smbs"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,sDAAoC;AACpC,6CAA2B;AAC3B,0CAAwB;AACxB,oDAAkC;AAClC,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,sDAAoC;AACpC,6CAA2B;AAC3B,0CAAwB;AACxB,oDAAkC;AAClC,0CAAwB;AACxB,yCAAuB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
2
|
+
import { WebsiteData } from "@xapp/arachne-web-service";
|
|
3
|
+
import { Template } from "@xapp/ovai-lib";
|
|
4
|
+
import { App, Intent, Handler, Entity } from "stentor-models";
|
|
5
|
+
export interface ExportApp {
|
|
6
|
+
app?: App;
|
|
7
|
+
intents?: Intent[];
|
|
8
|
+
handlers?: Handler[];
|
|
9
|
+
entities?: Entity[];
|
|
10
|
+
}
|
|
11
|
+
export interface SMBTemplate extends Template {
|
|
12
|
+
/**
|
|
13
|
+
* The website data from ArachneWebService
|
|
14
|
+
*/
|
|
15
|
+
webdata?: WebsiteData;
|
|
16
|
+
/**
|
|
17
|
+
* The template retrieved from https://templates.xapp.ai
|
|
18
|
+
*/
|
|
19
|
+
template?: ExportApp;
|
|
20
|
+
/**
|
|
21
|
+
* No capture response, used when lead capture is not supported.
|
|
22
|
+
*/
|
|
23
|
+
noCaptureResponse?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SMBTemplate.js","sourceRoot":"","sources":["../../src/smbs/SMBTemplate.ts"],"names":[],"mappings":";AAAA,kCAAkC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
2
|
+
import { OVAIApp } from "@xapp/ovai-lib";
|
|
3
|
+
import { Handler, Content, Data, Forward, Redirect, Intent, Entity, UtteranceTest } from "stentor-models";
|
|
4
|
+
import { SMBTemplate } from "./SMBTemplate";
|
|
5
|
+
import { TemplateFactory } from "../TemplateFactory";
|
|
6
|
+
import { WebsiteData } from "@xapp/arachne-web-service";
|
|
7
|
+
export declare class SMBTemplateFactory extends TemplateFactory<SMBTemplate> {
|
|
8
|
+
generateTemplateFromWebsiteData(data: WebsiteData): Promise<SMBTemplate | undefined>;
|
|
9
|
+
generateApp(template: SMBTemplate, app?: OVAIApp): OVAIApp;
|
|
10
|
+
protected removeTemplateProperties?(template: SMBTemplate): Partial<OVAIApp>;
|
|
11
|
+
generateIntentsAndHandlers(template: SMBTemplate, handlers?: (Handler<Content, Data, Forward, Redirect> | Intent)[]): (Handler<Content, Data, Forward, Redirect> | Intent)[];
|
|
12
|
+
generateEntities(template?: SMBTemplate): Entity[];
|
|
13
|
+
generateUtterancesTests(template?: SMBTemplate): UtteranceTest[];
|
|
14
|
+
generateTemplate?(app: OVAIApp, handlers: (Handler<Content, Data, Forward, Redirect> | Intent)[]): SMBTemplate | undefined;
|
|
15
|
+
generateHandlers?(template: SMBTemplate, handlers?: (Handler<Content, Data, Forward, Redirect> | Intent)[]): (Handler<Content, Data, Forward, Redirect> | Intent)[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SMBTemplateFactory = void 0;
|
|
14
|
+
const stentor_utils_1 = require("stentor-utils");
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
const TemplateFactory_1 = require("../TemplateFactory");
|
|
17
|
+
class SMBTemplateFactory extends TemplateFactory_1.TemplateFactory {
|
|
18
|
+
generateTemplateFromWebsiteData(data) {
|
|
19
|
+
var _a;
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const category = (_a = data === null || data === void 0 ? void 0 : data.business) === null || _a === void 0 ? void 0 : _a.category;
|
|
22
|
+
if (!category) {
|
|
23
|
+
throw new Error("No category found for website data");
|
|
24
|
+
}
|
|
25
|
+
const template = {
|
|
26
|
+
templateType: category,
|
|
27
|
+
website: data.url,
|
|
28
|
+
webdata: data
|
|
29
|
+
};
|
|
30
|
+
const foundMatchingTemplate = constants_1.SMB_TEMPLATES.find((template) => template.id === category);
|
|
31
|
+
if (!foundMatchingTemplate) {
|
|
32
|
+
throw new Error(`No matching template found for category: ${category}`);
|
|
33
|
+
}
|
|
34
|
+
const templateData = yield fetch(foundMatchingTemplate.url)
|
|
35
|
+
.then((response) => {
|
|
36
|
+
return response.json();
|
|
37
|
+
});
|
|
38
|
+
template.template = templateData;
|
|
39
|
+
return template;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
generateApp(template, app) {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
44
|
+
const name = (_b = (_a = template.webdata) === null || _a === void 0 ? void 0 : _a.business) === null || _b === void 0 ? void 0 : _b.name;
|
|
45
|
+
const primaryColor = (_d = (_c = template.webdata) === null || _c === void 0 ? void 0 : _c.site) === null || _d === void 0 ? void 0 : _d.primaryColor;
|
|
46
|
+
const secondaryColor = (_f = (_e = template.webdata) === null || _e === void 0 ? void 0 : _e.site) === null || _f === void 0 ? void 0 : _f.secondaryColor;
|
|
47
|
+
const logo = (_h = (_g = template.webdata) === null || _g === void 0 ? void 0 : _g.site) === null || _h === void 0 ? void 0 : _h.logo;
|
|
48
|
+
const businessDescription = (_k = (_j = template.webdata) === null || _j === void 0 ? void 0 : _j.site) === null || _k === void 0 ? void 0 : _k.description;
|
|
49
|
+
const category = (_m = (_l = template.webdata) === null || _l === void 0 ? void 0 : _l.business) === null || _m === void 0 ? void 0 : _m.category;
|
|
50
|
+
let generatedApp = {
|
|
51
|
+
name,
|
|
52
|
+
businessDescription,
|
|
53
|
+
website: template.website,
|
|
54
|
+
templateType: template.templateType || category,
|
|
55
|
+
icon: logo,
|
|
56
|
+
websiteData: {
|
|
57
|
+
primaryColor,
|
|
58
|
+
secondaryColor,
|
|
59
|
+
},
|
|
60
|
+
appId: (app === null || app === void 0 ? void 0 : app.appId) || "",
|
|
61
|
+
organizationId: (app === null || app === void 0 ? void 0 : app.organizationId) || "",
|
|
62
|
+
};
|
|
63
|
+
if ((0, stentor_utils_1.existsAndNotEmpty)((_p = (_o = template.webdata) === null || _o === void 0 ? void 0 : _o.business) === null || _p === void 0 ? void 0 : _p.phoneNumbers)) {
|
|
64
|
+
// try to get phone number
|
|
65
|
+
const firstNumber = template.webdata.business.phoneNumbers[0].number;
|
|
66
|
+
if (firstNumber) {
|
|
67
|
+
generatedApp.leadsContactPhone = firstNumber;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if ((0, stentor_utils_1.existsAndNotEmpty)((_r = (_q = template.webdata) === null || _q === void 0 ? void 0 : _q.business) === null || _r === void 0 ? void 0 : _r.email)) {
|
|
71
|
+
// try to get email
|
|
72
|
+
const firstEmail = template.webdata.business.email[0].email;
|
|
73
|
+
if (firstEmail) {
|
|
74
|
+
generatedApp.leadsContact = firstEmail;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (app) {
|
|
78
|
+
generatedApp = Object.assign(Object.assign({}, app), generatedApp);
|
|
79
|
+
}
|
|
80
|
+
return generatedApp;
|
|
81
|
+
}
|
|
82
|
+
removeTemplateProperties(template) {
|
|
83
|
+
delete template.template;
|
|
84
|
+
delete template.webdata;
|
|
85
|
+
return template;
|
|
86
|
+
}
|
|
87
|
+
generateIntentsAndHandlers(template, handlers) {
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
89
|
+
if (handlers) {
|
|
90
|
+
throw new Error("Augmenting Handlers are not supported for this template.");
|
|
91
|
+
}
|
|
92
|
+
// no intents, just empty handlers
|
|
93
|
+
const cleanHandler = (handler) => {
|
|
94
|
+
// delete slots
|
|
95
|
+
const cleaned = Object.assign({}, handler);
|
|
96
|
+
cleaned.slots = [];
|
|
97
|
+
cleaned.utterancePatterns = [];
|
|
98
|
+
return cleaned;
|
|
99
|
+
};
|
|
100
|
+
const newHandlers = template.template.handlers.map(cleanHandler);
|
|
101
|
+
const contactCaptureHandler = newHandlers.find((handler) => {
|
|
102
|
+
return handler.intentId === "LeadGeneration";
|
|
103
|
+
});
|
|
104
|
+
if (!contactCaptureHandler) {
|
|
105
|
+
throw new Error("No LeadGeneration handler found in template.");
|
|
106
|
+
}
|
|
107
|
+
const contactCaptureContent = contactCaptureHandler === null || contactCaptureHandler === void 0 ? void 0 : contactCaptureHandler.content;
|
|
108
|
+
if (!contactCaptureContent) {
|
|
109
|
+
contactCaptureHandler.content = {};
|
|
110
|
+
}
|
|
111
|
+
let contactCaptureResponses = contactCaptureHandler === null || contactCaptureHandler === void 0 ? void 0 : contactCaptureHandler.content["LeadGeneration"];
|
|
112
|
+
if (!contactCaptureResponses) {
|
|
113
|
+
contactCaptureResponses = [];
|
|
114
|
+
contactCaptureHandler.content["LeadGeneration"] = contactCaptureResponses;
|
|
115
|
+
}
|
|
116
|
+
let noCaptureResponse = template.noCaptureResponse;
|
|
117
|
+
if (!noCaptureResponse) {
|
|
118
|
+
// create one from the webdata
|
|
119
|
+
let phone;
|
|
120
|
+
if ((0, stentor_utils_1.existsAndNotEmpty)((_b = (_a = template.webdata) === null || _a === void 0 ? void 0 : _a.business) === null || _b === void 0 ? void 0 : _b.phoneNumbers)) {
|
|
121
|
+
phone = template.webdata.business.phoneNumbers[0].number;
|
|
122
|
+
}
|
|
123
|
+
let email;
|
|
124
|
+
if ((0, stentor_utils_1.existsAndNotEmpty)((_d = (_c = template.webdata) === null || _c === void 0 ? void 0 : _c.business) === null || _d === void 0 ? void 0 : _d.email)) {
|
|
125
|
+
email = template.webdata.business.email[0].email;
|
|
126
|
+
}
|
|
127
|
+
if (phone && email) {
|
|
128
|
+
noCaptureResponse = `Sure, you can reach us at ${phone} or ${email}.`;
|
|
129
|
+
}
|
|
130
|
+
else if (phone || email) {
|
|
131
|
+
noCaptureResponse = `Sure, you can reach us at ${phone || email}.`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (!noCaptureResponse) {
|
|
135
|
+
throw new Error("No noCaptureResponse found in template and unable to generate");
|
|
136
|
+
}
|
|
137
|
+
const response = {
|
|
138
|
+
outputSpeech: {
|
|
139
|
+
ssml: `<speak>${noCaptureResponse}</speak>`,
|
|
140
|
+
displayText: `${noCaptureResponse}`,
|
|
141
|
+
suggestions: []
|
|
142
|
+
},
|
|
143
|
+
name: "No Capture Start",
|
|
144
|
+
tag: "ContactCaptureNoCaptureStart"
|
|
145
|
+
};
|
|
146
|
+
if ((_g = (_f = (_e = template.webdata) === null || _e === void 0 ? void 0 : _e.site) === null || _f === void 0 ? void 0 : _f.pages) === null || _g === void 0 ? void 0 : _g.contactUs) {
|
|
147
|
+
response.outputSpeech.suggestions.push({ title: "Contact Us", url: template.webdata.site.pages.contactUs });
|
|
148
|
+
}
|
|
149
|
+
contactCaptureResponses.push(response);
|
|
150
|
+
return newHandlers;
|
|
151
|
+
}
|
|
152
|
+
generateEntities(template) {
|
|
153
|
+
return [];
|
|
154
|
+
}
|
|
155
|
+
generateUtterancesTests(template) {
|
|
156
|
+
// no tests here
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
generateTemplate(app, handlers) {
|
|
160
|
+
throw new Error("Method not implemented.");
|
|
161
|
+
}
|
|
162
|
+
generateHandlers(template, handlers) {
|
|
163
|
+
throw new Error("generateHandlers is deprecated and not implemented.");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
exports.SMBTemplateFactory = SMBTemplateFactory;
|
|
167
|
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MBTemplateItem {
|
|
3
|
+
/**
|
|
4
|
+
* Name of the template
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* App ID of the template
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Template description
|
|
13
|
+
*/
|
|
14
|
+
description: string;
|
|
15
|
+
/**
|
|
16
|
+
* URL to download the templat, a JSON
|
|
17
|
+
*/
|
|
18
|
+
url: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Our small business templates
|
|
22
|
+
*/
|
|
23
|
+
export declare const SMB_TEMPLATES: SMBTemplateItem[];
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SMB_TEMPLATES = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Our small business templates
|
|
7
|
+
*/
|
|
8
|
+
exports.SMB_TEMPLATES = [
|
|
9
|
+
{
|
|
10
|
+
name: "Business Coaching",
|
|
11
|
+
id: "business-coaching",
|
|
12
|
+
description: "Business coaching, CEO coaching, mentorship",
|
|
13
|
+
url: "https://templates.xapp.ai/business-coaching.json"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "Consulting Services",
|
|
17
|
+
id: "consulting",
|
|
18
|
+
description: "Consulting Services",
|
|
19
|
+
url: "https://templates.xapp.ai/consulting.json"
|
|
20
|
+
},
|
|
21
|
+
/*
|
|
22
|
+
{
|
|
23
|
+
name: "Financial Services",
|
|
24
|
+
id: "financial-services",
|
|
25
|
+
description: "Financial Advisors, wealth management",
|
|
26
|
+
url: "https://templates.xapp.ai/financial-services.json"
|
|
27
|
+
}, */
|
|
28
|
+
{
|
|
29
|
+
name: "Cleaning Services",
|
|
30
|
+
id: "home-services-cleaning",
|
|
31
|
+
description: "Cleaning, pressure washing, window cleaning, carpet cleaning",
|
|
32
|
+
url: "https://templates.xapp.ai/home-services-cleaning.json"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Contractors (HVAC, Roofing, Plumbing, Remodeling, etc)",
|
|
36
|
+
id: "home-services-contractors",
|
|
37
|
+
description: "HVAC, Plumbing, Roofing, General Contracting, Remodeling",
|
|
38
|
+
url: "https://templates.xapp.ai/home-services-contractors.json"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "Landscaping & Outdoor Services",
|
|
42
|
+
id: "home-services-outdoor",
|
|
43
|
+
description: "Lawn care, gardening, landscaping, snow plowing, pressure washing, tree removal",
|
|
44
|
+
url: "https://templates.xapp.ai/home-services-outdoor.json"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "Insurance",
|
|
48
|
+
id: "insurance",
|
|
49
|
+
description: "Insurance agents, brokers",
|
|
50
|
+
url: "https://templates.xapp.ai/insurance.json"
|
|
51
|
+
},
|
|
52
|
+
/* {
|
|
53
|
+
name: "Legal Services",
|
|
54
|
+
id: "legal-services",
|
|
55
|
+
description: "Lawyers",
|
|
56
|
+
url: "https://templates.xapp.ai/legal-services.json"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "Life Coaching",
|
|
60
|
+
id: "life-coaching",
|
|
61
|
+
description: "Life coaches",
|
|
62
|
+
url: "https://templates.xapp.ai/life-coaching.json"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "Real Estate",
|
|
66
|
+
id: "real-estate",
|
|
67
|
+
description: "Real estate agents",
|
|
68
|
+
url: "https://templates.xapp.ai/real-estate.json"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "Technology Services",
|
|
72
|
+
id: "technology-services",
|
|
73
|
+
description: "Software development, IT services",
|
|
74
|
+
url: "https://templates.xapp.ai/technology-services.json"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "Travel",
|
|
78
|
+
id: "travel",
|
|
79
|
+
description: "Travel agents, brokers",
|
|
80
|
+
url: "https://templates.xapp.ai/travel.json"
|
|
81
|
+
}, */
|
|
82
|
+
{
|
|
83
|
+
name: "Everything Else",
|
|
84
|
+
id: "contact-capture",
|
|
85
|
+
description: "Non-specialized model, use if a more specific model isn't available.",
|
|
86
|
+
url: "https://templates.xapp.ai/contact-capture.json"
|
|
87
|
+
}
|
|
88
|
+
];
|
|
89
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/smbs/constants.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;AAwBlC;;GAEG;AACU,QAAA,aAAa,GAAsB;IAC5C;QACI,IAAI,EAAE,mBAAmB;QACzB,EAAE,EAAE,mBAAmB;QACvB,WAAW,EAAE,6CAA6C;QAC1D,GAAG,EAAE,kDAAkD;KAC1D;IACD;QACI,IAAI,EAAE,qBAAqB;QAC3B,EAAE,EAAE,YAAY;QAChB,WAAW,EAAE,qBAAqB;QAClC,GAAG,EAAE,2CAA2C;KACnD;IACD;;;;;;SAMK;IACL;QACI,IAAI,EAAE,mBAAmB;QACzB,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,8DAA8D;QAC3E,GAAG,EAAE,uDAAuD;KAC/D;IACD;QACI,IAAI,EAAE,wDAAwD;QAC9D,EAAE,EAAE,2BAA2B;QAC/B,WAAW,EAAE,0DAA0D;QACvE,GAAG,EAAE,0DAA0D;KAClE;IACD;QACI,IAAI,EAAE,gCAAgC;QACtC,EAAE,EAAE,uBAAuB;QAC3B,WAAW,EAAE,iFAAiF;QAC9F,GAAG,EAAE,sDAAsD;KAC9D;IACD;QACI,IAAI,EAAE,WAAW;QACjB,EAAE,EAAE,WAAW;QACf,WAAW,EAAE,2BAA2B;QACxC,GAAG,EAAE,0CAA0C;KAClD;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA6BQ;IACR;QACI,IAAI,EAAE,iBAAiB;QACvB,EAAE,EAAE,iBAAiB;QACrB,WAAW,EAAE,sEAAsE;QACnF,GAAG,EAAE,gDAAgD;KACxD;CACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
__exportStar(require("./SMBTemplate"), exports);
|
|
20
|
+
__exportStar(require("./SMBTemplateFactory"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/smbs/index.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;;;;;;;;;;;;;;AAGlC,8CAA4B;AAC5B,gDAA8B;AAC9B,uDAAqC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.53.1",
|
|
8
8
|
"description": "Custom App templates for OVAI stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"main": "lib/index",
|
|
@@ -12,13 +12,17 @@
|
|
|
12
12
|
"lib"
|
|
13
13
|
],
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": "^10 || ^12 || ^14 || ^16 || ^18 || ^20
|
|
15
|
+
"node": "^10 || ^12 || ^14 || ^16 || ^18 || ^20"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/chai": "4.3.11",
|
|
19
|
+
"@types/chai-as-promised": "7.1.8",
|
|
20
|
+
"@xapp/arachne-web-service": "1.6.2",
|
|
19
21
|
"@xapp/config": "0.2.3",
|
|
20
22
|
"chai": "4.4.1",
|
|
23
|
+
"chai-as-promised": "7.1.1",
|
|
21
24
|
"mocha": "10.3.0",
|
|
25
|
+
"puppeteer-core": "22.0.0",
|
|
22
26
|
"stentor-constants": "1.58.110",
|
|
23
27
|
"stentor-guards": "1.58.110",
|
|
24
28
|
"stentor-interaction-model": "1.58.110",
|
|
@@ -29,13 +33,15 @@
|
|
|
29
33
|
},
|
|
30
34
|
"dependencies": {
|
|
31
35
|
"@xapp/oc-studio-starter-template": "1.3.0",
|
|
32
|
-
"@xapp/ovai-lib": "1.
|
|
33
|
-
"@xapp/stentor-alexa-lib": "1.
|
|
34
|
-
"@xapp/stentor-app": "1.
|
|
35
|
-
"@xapp/stentor-handler-media": "1.
|
|
36
|
-
"@xapp/stentor-interaction-model-profiler": "1.
|
|
36
|
+
"@xapp/ovai-lib": "1.53.1",
|
|
37
|
+
"@xapp/stentor-alexa-lib": "1.53.1",
|
|
38
|
+
"@xapp/stentor-app": "1.53.1",
|
|
39
|
+
"@xapp/stentor-handler-media": "1.53.1",
|
|
40
|
+
"@xapp/stentor-interaction-model-profiler": "1.53.1"
|
|
37
41
|
},
|
|
38
42
|
"peerDependencies": {
|
|
43
|
+
"@xapp/arachne-web-service": "1.x",
|
|
44
|
+
"puppeteer-core": "x",
|
|
39
45
|
"stentor-constants": "1.x",
|
|
40
46
|
"stentor-guards": "1.x",
|
|
41
47
|
"stentor-interaction-model": "1.x",
|
|
@@ -47,5 +53,5 @@
|
|
|
47
53
|
"clean": "rm -rf ./lib/*",
|
|
48
54
|
"test": "mocha --recursive -r ts-node/register \"./src/**/*.test.ts\""
|
|
49
55
|
},
|
|
50
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "083c1a7bde4f7d670e7257a60ec0beb964889757"
|
|
51
57
|
}
|