1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
10 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
11 | return new (P || (P = Promise))(function (resolve, reject) {
|
12 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
13 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
14 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
15 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
16 | });
|
17 | };
|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
19 | exports.SharePointActivityHandler = void 0;
|
20 | const botbuilder_core_1 = require("botbuilder-core");
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | class SharePointActivityHandler extends botbuilder_core_1.ActivityHandler {
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | onInvokeActivity(context) {
|
35 | const _super = Object.create(null, {
|
36 | onInvokeActivity: { get: () => super.onInvokeActivity }
|
37 | });
|
38 | return __awaiter(this, void 0, void 0, function* () {
|
39 | try {
|
40 | if (!context.activity.name && context.activity.channelId === 'sharepoint') {
|
41 | throw new Error('NotImplemented');
|
42 | }
|
43 | else {
|
44 | switch (context.activity.name) {
|
45 | case 'cardExtension/getCardView':
|
46 | return botbuilder_core_1.ActivityHandler.createInvokeResponse(yield this.onSharePointTaskGetCardViewAsync(context, context.activity.value));
|
47 | case 'cardExtension/getQuickView':
|
48 | return botbuilder_core_1.ActivityHandler.createInvokeResponse(yield this.onSharePointTaskGetQuickViewAsync(context, context.activity.value));
|
49 | case 'cardExtension/getPropertyPaneConfiguration':
|
50 | return botbuilder_core_1.ActivityHandler.createInvokeResponse(yield this.onSharePointTaskGetPropertyPaneConfigurationAsync(context, context.activity.value));
|
51 | case 'cardExtension/setPropertyPaneConfiguration':
|
52 | return botbuilder_core_1.ActivityHandler.createInvokeResponse(yield this.onSharePointTaskSetPropertyPaneConfigurationAsync(context, context.activity.value));
|
53 | case 'cardExtension/handleAction':
|
54 | return botbuilder_core_1.ActivityHandler.createInvokeResponse(yield this.onSharePointTaskHandleActionAsync(context, context.activity.value));
|
55 | default:
|
56 | return _super.onInvokeActivity.call(this, context);
|
57 | }
|
58 | }
|
59 | }
|
60 | catch (err) {
|
61 | if (err.message === 'NotImplemented') {
|
62 | return { status: 501 };
|
63 | }
|
64 | else if (err.message === 'BadRequest') {
|
65 | return { status: 400 };
|
66 | }
|
67 | throw err;
|
68 | }
|
69 | });
|
70 | }
|
71 | |
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | onSharePointTaskGetCardViewAsync(_context, _aceRequest) {
|
79 | return __awaiter(this, void 0, void 0, function* () {
|
80 | throw new Error('NotImplemented');
|
81 | });
|
82 | }
|
83 | |
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 | onSharePointTaskGetQuickViewAsync(_context, _aceRequest) {
|
91 | return __awaiter(this, void 0, void 0, function* () {
|
92 | throw new Error('NotImplemented');
|
93 | });
|
94 | }
|
95 | |
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | onSharePointTaskGetPropertyPaneConfigurationAsync(_context, _aceRequest) {
|
103 | return __awaiter(this, void 0, void 0, function* () {
|
104 | throw new Error('NotImplemented');
|
105 | });
|
106 | }
|
107 | |
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | onSharePointTaskSetPropertyPaneConfigurationAsync(_context, _aceRequest) {
|
115 | return __awaiter(this, void 0, void 0, function* () {
|
116 | throw new Error('NotImplemented');
|
117 | });
|
118 | }
|
119 | |
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | onSharePointTaskHandleActionAsync(_context, _aceRequest) {
|
127 | return __awaiter(this, void 0, void 0, function* () {
|
128 | throw new Error('NotImplemented');
|
129 | });
|
130 | }
|
131 | }
|
132 | exports.SharePointActivityHandler = SharePointActivityHandler;
|
133 |
|
\ | No newline at end of file |