Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/dialogflow-cx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const DialogFlowApi: any;
7 changes: 7 additions & 0 deletions lib/dialogflow-cx.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/dialogflow-cx.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

590 changes: 572 additions & 18 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"uglify-es": "^3.3.9"
},
"dependencies": {
"@google-cloud/dialogflow-cx": "^2.15.0",
"adm-zip": "^0.4.9",
"cryptiles": "^4.1.3",
"lodash.clonedeep": "^4.5.0",
Expand Down
6 changes: 6 additions & 0 deletions server/misc/Utilities.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/misc/Utilities.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/lib/dialogflow-cx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// tslint:disable-next-line: no-var-requires
export const DialogFlowApi = require('@google-cloud/dialogflow-cx');
7 changes: 7 additions & 0 deletions src/server/misc/Utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import cloneDeep = require('lodash.clonedeep');
import * as path from 'path';
import * as timers from 'timers';
import * as vm from 'vm';
import { DialogFlowApi } from '../../lib/dialogflow-cx';

import { AllowedInternalModules, requireNativeModule } from '../compiler/modules';

Expand Down Expand Up @@ -69,6 +70,12 @@ export class Utilities {

public static buildCustomRequire(files: { [s: string]: string }, appId: string, logSetting: number = 0, currentPath: string = '.' ): (mod: string) => {} {
return function _requirer(mod: string): any {
if (mod.includes('dialogflow-cx')) {
console.log('in');
console.log(DialogFlowApi);
return DialogFlowApi;
}

// Keep compatibility with apps importing apps-ts-definition
if (mod.startsWith('@rocket.chat/apps-ts-definition/')) {
mod = path.normalize(mod);
Expand Down