@memberjunction/telephony-adapters 0.0.0 → 6.1.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/LICENSE +183 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/resolvers/RingCentralTelephonyResolver.d.ts +20 -0
- package/dist/resolvers/RingCentralTelephonyResolver.d.ts.map +1 -0
- package/dist/resolvers/RingCentralTelephonyResolver.js +83 -0
- package/dist/resolvers/RingCentralTelephonyResolver.js.map +1 -0
- package/dist/resolvers/TeamsMeetingsResolver.d.ts +21 -0
- package/dist/resolvers/TeamsMeetingsResolver.d.ts.map +1 -0
- package/dist/resolvers/TeamsMeetingsResolver.js +87 -0
- package/dist/resolvers/TeamsMeetingsResolver.js.map +1 -0
- package/dist/resolvers/TelephonyResolver.d.ts +20 -0
- package/dist/resolvers/TelephonyResolver.d.ts.map +1 -0
- package/dist/resolvers/TelephonyResolver.js +83 -0
- package/dist/resolvers/TelephonyResolver.js.map +1 -0
- package/dist/resolvers/VonageTelephonyResolver.d.ts +20 -0
- package/dist/resolvers/VonageTelephonyResolver.d.ts.map +1 -0
- package/dist/resolvers/VonageTelephonyResolver.js +83 -0
- package/dist/resolvers/VonageTelephonyResolver.js.map +1 -0
- package/dist/resolvers/index.d.ts +10 -0
- package/dist/resolvers/index.d.ts.map +1 -0
- package/dist/resolvers/index.js +10 -0
- package/dist/resolvers/index.js.map +1 -0
- package/dist/server-extensions/RingCentralTelephonyExtension.d.ts +14 -0
- package/dist/server-extensions/RingCentralTelephonyExtension.d.ts.map +1 -0
- package/dist/server-extensions/RingCentralTelephonyExtension.js +81 -0
- package/dist/server-extensions/RingCentralTelephonyExtension.js.map +1 -0
- package/dist/server-extensions/TeamsMeetingsExtension.d.ts +17 -0
- package/dist/server-extensions/TeamsMeetingsExtension.d.ts.map +1 -0
- package/dist/server-extensions/TeamsMeetingsExtension.js +109 -0
- package/dist/server-extensions/TeamsMeetingsExtension.js.map +1 -0
- package/dist/server-extensions/TwilioTelephonyExtension.d.ts +14 -0
- package/dist/server-extensions/TwilioTelephonyExtension.d.ts.map +1 -0
- package/dist/server-extensions/TwilioTelephonyExtension.js +88 -0
- package/dist/server-extensions/TwilioTelephonyExtension.js.map +1 -0
- package/dist/server-extensions/VonageTelephonyExtension.d.ts +14 -0
- package/dist/server-extensions/VonageTelephonyExtension.d.ts.map +1 -0
- package/dist/server-extensions/VonageTelephonyExtension.js +89 -0
- package/dist/server-extensions/VonageTelephonyExtension.js.map +1 -0
- package/dist/sessionManager.d.ts +26 -0
- package/dist/sessionManager.d.ts.map +1 -0
- package/dist/sessionManager.js +38 -0
- package/dist/sessionManager.js.map +1 -0
- package/dist/telephony/RingCentralTelephonyService.d.ts +79 -0
- package/dist/telephony/RingCentralTelephonyService.d.ts.map +1 -0
- package/dist/telephony/RingCentralTelephonyService.js +225 -0
- package/dist/telephony/RingCentralTelephonyService.js.map +1 -0
- package/dist/telephony/TeamsMeetingsRouter.d.ts +21 -0
- package/dist/telephony/TeamsMeetingsRouter.d.ts.map +1 -0
- package/dist/telephony/TeamsMeetingsRouter.js +84 -0
- package/dist/telephony/TeamsMeetingsRouter.js.map +1 -0
- package/dist/telephony/TeamsMeetingsService.d.ts +76 -0
- package/dist/telephony/TeamsMeetingsService.d.ts.map +1 -0
- package/dist/telephony/TeamsMeetingsService.js +157 -0
- package/dist/telephony/TeamsMeetingsService.js.map +1 -0
- package/dist/telephony/TwilioTelephonyRouter.d.ts +30 -0
- package/dist/telephony/TwilioTelephonyRouter.d.ts.map +1 -0
- package/dist/telephony/TwilioTelephonyRouter.js +137 -0
- package/dist/telephony/TwilioTelephonyRouter.js.map +1 -0
- package/dist/telephony/TwilioTelephonyService.d.ts +91 -0
- package/dist/telephony/TwilioTelephonyService.d.ts.map +1 -0
- package/dist/telephony/TwilioTelephonyService.js +191 -0
- package/dist/telephony/TwilioTelephonyService.js.map +1 -0
- package/dist/telephony/VonageTelephonyRouter.d.ts +24 -0
- package/dist/telephony/VonageTelephonyRouter.d.ts.map +1 -0
- package/dist/telephony/VonageTelephonyRouter.js +175 -0
- package/dist/telephony/VonageTelephonyRouter.js.map +1 -0
- package/dist/telephony/VonageTelephonyService.d.ts +62 -0
- package/dist/telephony/VonageTelephonyService.d.ts.map +1 -0
- package/dist/telephony/VonageTelephonyService.js +162 -0
- package/dist/telephony/VonageTelephonyService.js.map +1 -0
- package/dist/telephony/calendar-scheduler.d.ts +41 -0
- package/dist/telephony/calendar-scheduler.d.ts.map +1 -0
- package/dist/telephony/calendar-scheduler.js +98 -0
- package/dist/telephony/calendar-scheduler.js.map +1 -0
- package/dist/telephony/index.d.ts +21 -0
- package/dist/telephony/index.d.ts.map +1 -0
- package/dist/telephony/index.js +26 -0
- package/dist/telephony/index.js.map +1 -0
- package/dist/telephony/ringcentral-runtime.d.ts +11 -0
- package/dist/telephony/ringcentral-runtime.d.ts.map +1 -0
- package/dist/telephony/ringcentral-runtime.js +20 -0
- package/dist/telephony/ringcentral-runtime.js.map +1 -0
- package/dist/telephony/teams-meetings-runtime.d.ts +11 -0
- package/dist/telephony/teams-meetings-runtime.d.ts.map +1 -0
- package/dist/telephony/teams-meetings-runtime.js +20 -0
- package/dist/telephony/teams-meetings-runtime.js.map +1 -0
- package/dist/telephony/teamsAcsMediaRegistry.d.ts +35 -0
- package/dist/telephony/teamsAcsMediaRegistry.d.ts.map +1 -0
- package/dist/telephony/teamsAcsMediaRegistry.js +86 -0
- package/dist/telephony/teamsAcsMediaRegistry.js.map +1 -0
- package/dist/telephony/telephony-runtime.d.ts +14 -0
- package/dist/telephony/telephony-runtime.d.ts.map +1 -0
- package/dist/telephony/telephony-runtime.js +23 -0
- package/dist/telephony/telephony-runtime.js.map +1 -0
- package/dist/telephony/twilioMediaRegistry.d.ts +60 -0
- package/dist/telephony/twilioMediaRegistry.d.ts.map +1 -0
- package/dist/telephony/twilioMediaRegistry.js +109 -0
- package/dist/telephony/twilioMediaRegistry.js.map +1 -0
- package/dist/telephony/vonage-runtime.d.ts +11 -0
- package/dist/telephony/vonage-runtime.d.ts.map +1 -0
- package/dist/telephony/vonage-runtime.js +20 -0
- package/dist/telephony/vonage-runtime.js.map +1 -0
- package/dist/telephony/vonageMediaRegistry.d.ts +38 -0
- package/dist/telephony/vonageMediaRegistry.d.ts.map +1 -0
- package/dist/telephony/vonageMediaRegistry.js +113 -0
- package/dist/telephony/vonageMediaRegistry.js.map +1 -0
- package/dist/types.d.ts +123 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +27 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -8
- package/README.md +0 -45
package/LICENSE
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2024 MariaDB plc, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB plc.
|
|
5
|
+
|
|
6
|
+
-----------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
|
|
10
|
+
Licensor: Blue Cypress, Inc.
|
|
11
|
+
|
|
12
|
+
Licensed Work: MemberJunction.
|
|
13
|
+
The Licensed Work is (c) 2023-2026 Blue Cypress, Inc.
|
|
14
|
+
|
|
15
|
+
Additional Use Grant: Subject to the terms of this License, Licensor grants
|
|
16
|
+
you the following additional rights to make Production
|
|
17
|
+
Use of the Licensed Work.
|
|
18
|
+
|
|
19
|
+
1. Internal Use
|
|
20
|
+
|
|
21
|
+
You may make production use of the Licensed Work for
|
|
22
|
+
your own internal business or organizational operations.
|
|
23
|
+
|
|
24
|
+
2. Nonprofit Use
|
|
25
|
+
|
|
26
|
+
If you are a Nonprofit, you may make production use of
|
|
27
|
+
the Licensed Work for the operations and activities of
|
|
28
|
+
your Organizational Family.
|
|
29
|
+
|
|
30
|
+
3. MemberJunction Certified Program Use
|
|
31
|
+
|
|
32
|
+
If you are authorized by Licensor under the
|
|
33
|
+
MemberJunction Certified Program to provide professional
|
|
34
|
+
services using the Licensed Work, you may make
|
|
35
|
+
production use of the Licensed Work in providing such
|
|
36
|
+
professional services to a client, provided that:
|
|
37
|
+
|
|
38
|
+
(a) the Licensed Work is deployed in, and the applicable
|
|
39
|
+
production use occurs within, an environment owned,
|
|
40
|
+
leased, licensed, subscribed to, or otherwise controlled
|
|
41
|
+
by that client; and
|
|
42
|
+
|
|
43
|
+
(b) the production use is for that client's own internal
|
|
44
|
+
business or organizational operations or is otherwise
|
|
45
|
+
independently permitted to that client under this
|
|
46
|
+
Additional Use Grant.
|
|
47
|
+
|
|
48
|
+
4. Definitions Applicable to the Additional Use Grant
|
|
49
|
+
|
|
50
|
+
"Affiliate" means, with respect to a specified Person,
|
|
51
|
+
any other Person that directly or indirectly Controls,
|
|
52
|
+
is Controlled by, or is under common Control with such
|
|
53
|
+
specified Person.
|
|
54
|
+
|
|
55
|
+
"Control" (including the terms "Controls," "Controlled
|
|
56
|
+
by," and "under common Control with") means the direct
|
|
57
|
+
or indirect possession of the power to direct or cause
|
|
58
|
+
the direction of the management and policies of a
|
|
59
|
+
Person, whether through ownership of voting interests,
|
|
60
|
+
by contract, or otherwise.
|
|
61
|
+
|
|
62
|
+
"Organizational Family" means, with respect to a Person,
|
|
63
|
+
(a) such Person and its Affiliates, and (b) any
|
|
64
|
+
nonprofit organization, governmental entity, chapter,
|
|
65
|
+
division, local affiliate, regional affiliate, state
|
|
66
|
+
affiliate, national affiliate, or other entity that is
|
|
67
|
+
formally affiliated with such Person through governing
|
|
68
|
+
documents, a charter, bylaws, a membership agreement, or
|
|
69
|
+
another written organizational instrument, and is
|
|
70
|
+
recognized under such documents as part of the same
|
|
71
|
+
organizational structure.
|
|
72
|
+
|
|
73
|
+
"Nonprofit" means a Person recognized by the Internal
|
|
74
|
+
Revenue Service as exempt from federal income taxation
|
|
75
|
+
under Section 501(c)(3), 501(c)(4), 501(c)(5), or
|
|
76
|
+
501(c)(6) of the Internal Revenue Code, or a foreign
|
|
77
|
+
organization recognized under substantially equivalent
|
|
78
|
+
laws.
|
|
79
|
+
|
|
80
|
+
A Person claiming eligibility as a Nonprofit shall, upon
|
|
81
|
+
Licensor's reasonable request, provide documentation
|
|
82
|
+
reasonably sufficient to demonstrate that it qualifies
|
|
83
|
+
as a Nonprofit. If such Person materially misrepresents,
|
|
84
|
+
or is unable to demonstrate, its qualification as a
|
|
85
|
+
Nonprofit, the rights granted to such Person under
|
|
86
|
+
Section 2 of this Additional Use Grant shall terminate.
|
|
87
|
+
|
|
88
|
+
"MemberJunction Certified Program" means Licensor's
|
|
89
|
+
then-current program for certifying and authorizing a
|
|
90
|
+
Person to provide professional services using the
|
|
91
|
+
Licensed Work.
|
|
92
|
+
|
|
93
|
+
"Person" means any individual, corporation, limited
|
|
94
|
+
liability company, partnership, association, nonprofit
|
|
95
|
+
organization, governmental entity, or other legal or
|
|
96
|
+
organizational entity.
|
|
97
|
+
|
|
98
|
+
Change Date: Four (4) years from the date the Licensed Work is first
|
|
99
|
+
made available.
|
|
100
|
+
|
|
101
|
+
Change License: MIT License.
|
|
102
|
+
|
|
103
|
+
For information about alternative licensing arrangements for the Licensed
|
|
104
|
+
Work, please contact Blue Cypress, Inc.
|
|
105
|
+
|
|
106
|
+
-----------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
Terms
|
|
109
|
+
|
|
110
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
111
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
112
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
113
|
+
production use.
|
|
114
|
+
|
|
115
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
116
|
+
available distribution of a specific version of the Licensed Work under this
|
|
117
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
118
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
119
|
+
above terminate.
|
|
120
|
+
|
|
121
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
122
|
+
currently in effect as described in this License, you must purchase a
|
|
123
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
124
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
125
|
+
|
|
126
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
127
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
128
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
129
|
+
for each version of the Licensed Work released by Licensor.
|
|
130
|
+
|
|
131
|
+
You must conspicuously display this License on each original or modified copy
|
|
132
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
133
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
134
|
+
License apply to your use of that work.
|
|
135
|
+
|
|
136
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
137
|
+
terminate your rights under this License for the current and all other
|
|
138
|
+
versions of the Licensed Work.
|
|
139
|
+
|
|
140
|
+
This License does not grant you any right in any trademark or logo of
|
|
141
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
142
|
+
Licensor as expressly required by this License).
|
|
143
|
+
|
|
144
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
145
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
146
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
147
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
148
|
+
TITLE.
|
|
149
|
+
|
|
150
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
151
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
152
|
+
as long as you comply with the Covenants of Licensor below.
|
|
153
|
+
|
|
154
|
+
-----------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
Covenants of Licensor
|
|
157
|
+
|
|
158
|
+
In consideration of the right to use this License's text and the "Business
|
|
159
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
160
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
161
|
+
|
|
162
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
163
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
164
|
+
where "compatible" means that software provided under the Change License
|
|
165
|
+
can be included in a program with software provided under GPL Version 2.0
|
|
166
|
+
or a later version. Licensor may specify additional Change Licenses without
|
|
167
|
+
limitation.
|
|
168
|
+
|
|
169
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
170
|
+
impose any additional restriction on the right granted in this License, as
|
|
171
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
172
|
+
|
|
173
|
+
3. To specify a Change Date.
|
|
174
|
+
|
|
175
|
+
4. Not to modify this License in any other way.
|
|
176
|
+
|
|
177
|
+
-----------------------------------------------------------------------------
|
|
178
|
+
|
|
179
|
+
Notice
|
|
180
|
+
|
|
181
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
182
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
183
|
+
under an Open Source License, as stated in this License.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @memberjunction/telephony-adapters
|
|
3
|
+
*
|
|
4
|
+
* Telephony and meeting platform adapters for MemberJunction AI agents.
|
|
5
|
+
* Provides Twilio, Vonage, RingCentral, and Microsoft Teams integrations
|
|
6
|
+
* built on the MJServer Extension framework (@memberjunction/server-extensions-core).
|
|
7
|
+
*/
|
|
8
|
+
import { type ServerExtensionConfig } from '@memberjunction/server-extensions-core';
|
|
9
|
+
export * from './types.js';
|
|
10
|
+
export * from './sessionManager.js';
|
|
11
|
+
export * from './telephony/index.js';
|
|
12
|
+
export { TwilioTelephonyExtension } from './server-extensions/TwilioTelephonyExtension.js';
|
|
13
|
+
export { VonageTelephonyExtension } from './server-extensions/VonageTelephonyExtension.js';
|
|
14
|
+
export { RingCentralTelephonyExtension } from './server-extensions/RingCentralTelephonyExtension.js';
|
|
15
|
+
export { TeamsMeetingsExtension } from './server-extensions/TeamsMeetingsExtension.js';
|
|
16
|
+
export * from './resolvers/index.js';
|
|
17
|
+
/**
|
|
18
|
+
* Absolute paths to the resolver files for use with buildSchema / createMJServer.
|
|
19
|
+
*/
|
|
20
|
+
export declare const RESOLVER_PATHS: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Default server-extension declarations for @memberjunction/telephony-adapters.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MJ_SERVER_EXTENSIONS: ServerExtensionConfig[];
|
|
25
|
+
/**
|
|
26
|
+
* Tree-shaking prevention function.
|
|
27
|
+
*
|
|
28
|
+
* Import and call this function from your application's entry point to ensure
|
|
29
|
+
* the @RegisterClass decorators on the telephony extensions fire at module load time.
|
|
30
|
+
* Also registers alias driver keys ('twilio-telephony', 'vonage-telephony', etc.).
|
|
31
|
+
*/
|
|
32
|
+
export declare function LoadTelephonyAdapters(): void;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAQzG,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,sDAAsD,CAAC;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAGvF,cAAc,sBAAsB,CAAC;AAIrC;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,EAElC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,qBAAqB,EA6BvD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAO5C"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @memberjunction/telephony-adapters
|
|
3
|
+
*
|
|
4
|
+
* Telephony and meeting platform adapters for MemberJunction AI agents.
|
|
5
|
+
* Provides Twilio, Vonage, RingCentral, and Microsoft Teams integrations
|
|
6
|
+
* built on the MJServer Extension framework (@memberjunction/server-extensions-core).
|
|
7
|
+
*/
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { resolve } from 'node:path';
|
|
10
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
11
|
+
import { BaseServerExtension } from '@memberjunction/server-extensions-core';
|
|
12
|
+
import { TwilioTelephonyExtension } from './server-extensions/TwilioTelephonyExtension.js';
|
|
13
|
+
import { VonageTelephonyExtension } from './server-extensions/VonageTelephonyExtension.js';
|
|
14
|
+
import { RingCentralTelephonyExtension } from './server-extensions/RingCentralTelephonyExtension.js';
|
|
15
|
+
import { TeamsMeetingsExtension } from './server-extensions/TeamsMeetingsExtension.js';
|
|
16
|
+
// ── Types ──────────────────────────────────────────────────────────────────
|
|
17
|
+
export * from './types.js';
|
|
18
|
+
export * from './sessionManager.js';
|
|
19
|
+
// ── Telephony Services, Registries & Routers ──────────────────────────────
|
|
20
|
+
export * from './telephony/index.js';
|
|
21
|
+
// ── Server Extensions ──────────────────────────────────────────────────────
|
|
22
|
+
export { TwilioTelephonyExtension } from './server-extensions/TwilioTelephonyExtension.js';
|
|
23
|
+
export { VonageTelephonyExtension } from './server-extensions/VonageTelephonyExtension.js';
|
|
24
|
+
export { RingCentralTelephonyExtension } from './server-extensions/RingCentralTelephonyExtension.js';
|
|
25
|
+
export { TeamsMeetingsExtension } from './server-extensions/TeamsMeetingsExtension.js';
|
|
26
|
+
// ── Resolvers ──────────────────────────────────────────────────────────────
|
|
27
|
+
export * from './resolvers/index.js';
|
|
28
|
+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
29
|
+
/**
|
|
30
|
+
* Absolute paths to the resolver files for use with buildSchema / createMJServer.
|
|
31
|
+
*/
|
|
32
|
+
export const RESOLVER_PATHS = [
|
|
33
|
+
resolve(__dirname, 'resolvers/*Resolver.{js,ts}'),
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* Default server-extension declarations for @memberjunction/telephony-adapters.
|
|
37
|
+
*/
|
|
38
|
+
export const MJ_SERVER_EXTENSIONS = [
|
|
39
|
+
{
|
|
40
|
+
Enabled: false,
|
|
41
|
+
DriverClass: 'TwilioTelephonyExtension',
|
|
42
|
+
RootPath: '/telephony/twilio',
|
|
43
|
+
Phase: 'pre-auth',
|
|
44
|
+
Settings: {},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
Enabled: false,
|
|
48
|
+
DriverClass: 'VonageTelephonyExtension',
|
|
49
|
+
RootPath: '/telephony/vonage',
|
|
50
|
+
Phase: 'pre-auth',
|
|
51
|
+
Settings: {},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
Enabled: false,
|
|
55
|
+
DriverClass: 'RingCentralTelephonyExtension',
|
|
56
|
+
RootPath: '/telephony/ringcentral',
|
|
57
|
+
Phase: 'pre-auth',
|
|
58
|
+
Settings: {},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
Enabled: false,
|
|
62
|
+
DriverClass: 'TeamsMeetingsExtension',
|
|
63
|
+
RootPath: '/meetings/teams',
|
|
64
|
+
Phase: 'pre-auth',
|
|
65
|
+
Settings: {},
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* Tree-shaking prevention function.
|
|
70
|
+
*
|
|
71
|
+
* Import and call this function from your application's entry point to ensure
|
|
72
|
+
* the @RegisterClass decorators on the telephony extensions fire at module load time.
|
|
73
|
+
* Also registers alias driver keys ('twilio-telephony', 'vonage-telephony', etc.).
|
|
74
|
+
*/
|
|
75
|
+
export function LoadTelephonyAdapters() {
|
|
76
|
+
// Register alias driver names for convenience in configuration
|
|
77
|
+
const factory = MJGlobal.Instance.ClassFactory;
|
|
78
|
+
factory.Register(BaseServerExtension, TwilioTelephonyExtension, 'twilio-telephony');
|
|
79
|
+
factory.Register(BaseServerExtension, VonageTelephonyExtension, 'vonage-telephony');
|
|
80
|
+
factory.Register(BaseServerExtension, RingCentralTelephonyExtension, 'ringcentral-telephony');
|
|
81
|
+
factory.Register(BaseServerExtension, TeamsMeetingsExtension, 'teams-meetings');
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAA8B,MAAM,wCAAwC,CAAC;AAEzG,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,sDAAsD,CAAC;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,8EAA8E;AAC9E,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AAEpC,6EAA6E;AAC7E,cAAc,sBAAsB,CAAC;AAErC,8EAA8E;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE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ACpF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,uBAAuB,CAAC,CAAC;IAC9F,OAAO,CAAC,QAAQ,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview GraphQL surface for OUTBOUND RingCentral telephony: `PlaceRingCentralCall`.
|
|
3
|
+
*
|
|
4
|
+
* @module @memberjunction/telephony-adapters
|
|
5
|
+
*/
|
|
6
|
+
import { TelephonyResolverContext } from '../types.js';
|
|
7
|
+
/** Result of an outbound RingCentral place-call attempt. */
|
|
8
|
+
export declare class PlaceRingCentralCallResult {
|
|
9
|
+
Success: boolean;
|
|
10
|
+
ErrorMessage?: string;
|
|
11
|
+
/** The placed RingCentral telephony session id. */
|
|
12
|
+
SessionId: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class RingCentralTelephonyResolver {
|
|
15
|
+
/**
|
|
16
|
+
* Places an outbound call from the given agent identity to a destination number.
|
|
17
|
+
*/
|
|
18
|
+
PlaceRingCentralCall(agentIdentityId: string, toNumber: string, context?: TelephonyResolverContext): Promise<PlaceRingCentralCallResult>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=RingCentralTelephonyResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RingCentralTelephonyResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/RingCentralTelephonyResolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,wBAAwB,EAA4C,MAAM,aAAa,CAAC;AAGjG,4DAA4D;AAC5D,qBACa,0BAA0B;IAEnC,OAAO,EAAG,OAAO,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,mDAAmD;IAEnD,SAAS,EAAG,MAAM,CAAC;CACtB;AAED,qBACa,4BAA4B;IACrC;;OAEG;IAEG,oBAAoB,CACgB,eAAe,EAAE,MAAM,EAC9B,QAAQ,EAAE,MAAM,EACxC,OAAO,GAAE,wBAA6B,GAC9C,OAAO,CAAC,0BAA0B,CAAC;CAuBzC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview GraphQL surface for OUTBOUND RingCentral telephony: `PlaceRingCentralCall`.
|
|
3
|
+
*
|
|
4
|
+
* @module @memberjunction/telephony-adapters
|
|
5
|
+
*/
|
|
6
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
13
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
14
|
+
};
|
|
15
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
16
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
17
|
+
};
|
|
18
|
+
import { Resolver, Mutation, Arg, Ctx, ObjectType, Field } from 'type-graphql';
|
|
19
|
+
import { LogError } from '@memberjunction/core';
|
|
20
|
+
import { getUserFromPayload, getReadWriteProvider } from '../types.js';
|
|
21
|
+
import { GetRingCentralTelephonyService } from '../telephony/ringcentral-runtime.js';
|
|
22
|
+
/** Result of an outbound RingCentral place-call attempt. */
|
|
23
|
+
let PlaceRingCentralCallResult = class PlaceRingCentralCallResult {
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
Field(() => Boolean),
|
|
27
|
+
__metadata("design:type", Boolean)
|
|
28
|
+
], PlaceRingCentralCallResult.prototype, "Success", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
Field(() => String, { nullable: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], PlaceRingCentralCallResult.prototype, "ErrorMessage", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
Field(() => String),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], PlaceRingCentralCallResult.prototype, "SessionId", void 0);
|
|
37
|
+
PlaceRingCentralCallResult = __decorate([
|
|
38
|
+
ObjectType()
|
|
39
|
+
], PlaceRingCentralCallResult);
|
|
40
|
+
export { PlaceRingCentralCallResult };
|
|
41
|
+
let RingCentralTelephonyResolver = class RingCentralTelephonyResolver {
|
|
42
|
+
/**
|
|
43
|
+
* Places an outbound call from the given agent identity to a destination number.
|
|
44
|
+
*/
|
|
45
|
+
async PlaceRingCentralCall(agentIdentityId, toNumber, context = {}) {
|
|
46
|
+
const failure = (msg) => ({ Success: false, ErrorMessage: msg, SessionId: '' });
|
|
47
|
+
try {
|
|
48
|
+
const user = getUserFromPayload(context.userPayload);
|
|
49
|
+
if (!user) {
|
|
50
|
+
return failure('Unable to determine current user.');
|
|
51
|
+
}
|
|
52
|
+
const service = GetRingCentralTelephonyService();
|
|
53
|
+
if (!service) {
|
|
54
|
+
return failure('RingCentral telephony is not configured on this server.');
|
|
55
|
+
}
|
|
56
|
+
const provider = getReadWriteProvider(context.providers);
|
|
57
|
+
if (!provider) {
|
|
58
|
+
return failure('Database provider is not available.');
|
|
59
|
+
}
|
|
60
|
+
const sessionId = await service.PlaceOutboundCall(agentIdentityId, toNumber, user, provider);
|
|
61
|
+
return { Success: true, SessionId: sessionId };
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
65
|
+
LogError(`PlaceRingCentralCall failed: ${msg}`);
|
|
66
|
+
return failure(msg);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
__decorate([
|
|
71
|
+
Mutation(() => PlaceRingCentralCallResult),
|
|
72
|
+
__param(0, Arg('agentIdentityId', () => String)),
|
|
73
|
+
__param(1, Arg('toNumber', () => String)),
|
|
74
|
+
__param(2, Ctx()),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], RingCentralTelephonyResolver.prototype, "PlaceRingCentralCall", null);
|
|
79
|
+
RingCentralTelephonyResolver = __decorate([
|
|
80
|
+
Resolver()
|
|
81
|
+
], RingCentralTelephonyResolver);
|
|
82
|
+
export { RingCentralTelephonyResolver };
|
|
83
|
+
//# sourceMappingURL=RingCentralTelephonyResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RingCentralTelephonyResolver.js","sourceRoot":"","sources":["../../src/resolvers/RingCentralTelephonyResolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;;;;;;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAqB,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAA4B,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,4DAA4D;AAErD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;CAUtC,CAAA;AARG;IADC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;;2DACH;AAGlB;IADC,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gEAClB;AAItB;IADC,KAAK,CAAC,GAAG,EAAE,CAA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E,CAAC,CAAC;YAChD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;IACL,CAAC;CACJ,CAAA;AA3BS;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;IAEtC,WAAA,GAAG,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;IACpC,WAAA,GAAG,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,GAAG,EAAE,CAAA;;;;wEAuBT;AA/BQ,4BAA4B;IADxC,QAAQ,EAAE;GACE,4BAA4B,CAgCxC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview GraphQL surface for Teams meeting joins: `StartTeamsMeetingSession`.
|
|
3
|
+
*
|
|
4
|
+
* @module @memberjunction/telephony-adapters
|
|
5
|
+
*/
|
|
6
|
+
import { TelephonyResolverContext } from '../types.js';
|
|
7
|
+
/** Result of a Teams meeting join attempt. */
|
|
8
|
+
export declare class StartTeamsMeetingResult {
|
|
9
|
+
Success: boolean;
|
|
10
|
+
ErrorMessage?: string;
|
|
11
|
+
/** The Graph call id the bot joined (the bridge's external connection id), when successful. */
|
|
12
|
+
CallId: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class TeamsMeetingsResolver {
|
|
15
|
+
/**
|
|
16
|
+
* Has the given agent identity join a Teams meeting by URL, connecting the pinned agent over the realtime
|
|
17
|
+
* bridge. Returns the Graph call id.
|
|
18
|
+
*/
|
|
19
|
+
StartTeamsMeetingSession(agentIdentityId: string, joinUrl: string, context?: TelephonyResolverContext): Promise<StartTeamsMeetingResult>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=TeamsMeetingsResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamsMeetingsResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/TeamsMeetingsResolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,wBAAwB,EAA4C,MAAM,aAAa,CAAC;AAGjG,8CAA8C;AAC9C,qBACa,uBAAuB;IAEhC,OAAO,EAAG,OAAO,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,+FAA+F;IAE/F,MAAM,EAAG,MAAM,CAAC;CACnB;AAED,qBACa,qBAAqB;IAC9B;;;OAGG;IAEG,wBAAwB,CACY,eAAe,EAAE,MAAM,EAC/B,OAAO,EAAE,MAAM,EACtC,OAAO,GAAE,wBAA6B,GAC9C,OAAO,CAAC,uBAAuB,CAAC;CA0BtC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview GraphQL surface for Teams meeting joins: `StartTeamsMeetingSession`.
|
|
3
|
+
*
|
|
4
|
+
* @module @memberjunction/telephony-adapters
|
|
5
|
+
*/
|
|
6
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
13
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
14
|
+
};
|
|
15
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
16
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
17
|
+
};
|
|
18
|
+
import { Resolver, Mutation, Arg, Ctx, ObjectType, Field } from 'type-graphql';
|
|
19
|
+
import { LogError } from '@memberjunction/core';
|
|
20
|
+
import { getUserFromPayload, getReadWriteProvider } from '../types.js';
|
|
21
|
+
import { GetTeamsMeetingsService } from '../telephony/teams-meetings-runtime.js';
|
|
22
|
+
/** Result of a Teams meeting join attempt. */
|
|
23
|
+
let StartTeamsMeetingResult = class StartTeamsMeetingResult {
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
Field(() => Boolean),
|
|
27
|
+
__metadata("design:type", Boolean)
|
|
28
|
+
], StartTeamsMeetingResult.prototype, "Success", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
Field(() => String, { nullable: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], StartTeamsMeetingResult.prototype, "ErrorMessage", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
Field(() => String),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], StartTeamsMeetingResult.prototype, "CallId", void 0);
|
|
37
|
+
StartTeamsMeetingResult = __decorate([
|
|
38
|
+
ObjectType()
|
|
39
|
+
], StartTeamsMeetingResult);
|
|
40
|
+
export { StartTeamsMeetingResult };
|
|
41
|
+
let TeamsMeetingsResolver = class TeamsMeetingsResolver {
|
|
42
|
+
/**
|
|
43
|
+
* Has the given agent identity join a Teams meeting by URL, connecting the pinned agent over the realtime
|
|
44
|
+
* bridge. Returns the Graph call id.
|
|
45
|
+
*/
|
|
46
|
+
async StartTeamsMeetingSession(agentIdentityId, joinUrl, context = {}) {
|
|
47
|
+
const failure = (msg) => ({ Success: false, ErrorMessage: msg, CallId: '' });
|
|
48
|
+
try {
|
|
49
|
+
const user = getUserFromPayload(context.userPayload);
|
|
50
|
+
if (!user) {
|
|
51
|
+
return failure('Unable to determine current user.');
|
|
52
|
+
}
|
|
53
|
+
const service = GetTeamsMeetingsService();
|
|
54
|
+
if (!service) {
|
|
55
|
+
return failure('Teams meetings are not configured on this server.');
|
|
56
|
+
}
|
|
57
|
+
const provider = getReadWriteProvider(context.providers);
|
|
58
|
+
if (!provider) {
|
|
59
|
+
return failure('Database provider is not available.');
|
|
60
|
+
}
|
|
61
|
+
const result = await service.JoinMeetingByUrl(agentIdentityId, joinUrl, user, provider);
|
|
62
|
+
if (!result.accepted) {
|
|
63
|
+
return failure(result.reason ?? 'The meeting join was not accepted.');
|
|
64
|
+
}
|
|
65
|
+
return { Success: true, CallId: result.callId ?? '' };
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
69
|
+
LogError(`StartTeamsMeetingSession failed: ${msg}`);
|
|
70
|
+
return failure(msg);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__decorate([
|
|
75
|
+
Mutation(() => StartTeamsMeetingResult),
|
|
76
|
+
__param(0, Arg('agentIdentityId', () => String)),
|
|
77
|
+
__param(1, Arg('joinUrl', () => String)),
|
|
78
|
+
__param(2, Ctx()),
|
|
79
|
+
__metadata("design:type", Function),
|
|
80
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
81
|
+
__metadata("design:returntype", Promise)
|
|
82
|
+
], TeamsMeetingsResolver.prototype, "StartTeamsMeetingSession", null);
|
|
83
|
+
TeamsMeetingsResolver = __decorate([
|
|
84
|
+
Resolver()
|
|
85
|
+
], TeamsMeetingsResolver);
|
|
86
|
+
export { TeamsMeetingsResolver };
|
|
87
|
+
//# sourceMappingURL=TeamsMeetingsResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamsMeetingsResolver.js","sourceRoot":"","sources":["../../src/resolvers/TeamsMeetingsResolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;;;;;;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAqB,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAA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M,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;YACxF,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACnB,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,oCAAoC,CAAC,CAAC;YAC1E,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAC1D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnE,QAAQ,CAAC,oCAAoC,GAAG,EAAE,CAAC,CAAC;YACpD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;IACL,CAAC;CACJ,CAAA;AA9BS;IADL,QAAQ,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC;IAEnC,WAAA,GAAG,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;IACpC,WAAA,GAAG,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;IAC5B,WAAA,GAAG,EAAE,CAAA;;;;qEA0BT;AAnCQ,qBAAqB;IADjC,QAAQ,EAAE;GACE,qBAAqB,CAoCjC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview GraphQL surface for OUTBOUND telephony: `PlaceTwilioCall`.
|
|
3
|
+
*
|
|
4
|
+
* @module @memberjunction/telephony-adapters
|
|
5
|
+
*/
|
|
6
|
+
import { TelephonyResolverContext } from '../types.js';
|
|
7
|
+
/** Result of an outbound place-call attempt. */
|
|
8
|
+
export declare class PlaceCallResult {
|
|
9
|
+
Success: boolean;
|
|
10
|
+
ErrorMessage?: string;
|
|
11
|
+
/** The placed Twilio Call SID. */
|
|
12
|
+
CallSid: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class TelephonyResolver {
|
|
15
|
+
/**
|
|
16
|
+
* Places an outbound call from the given agent identity to a destination number.
|
|
17
|
+
*/
|
|
18
|
+
PlaceTwilioCall(agentIdentityId: string, toNumber: string, context?: TelephonyResolverContext): Promise<PlaceCallResult>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=TelephonyResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelephonyResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/TelephonyResolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,wBAAwB,EAA4C,MAAM,aAAa,CAAC;AAGjG,gDAAgD;AAChD,qBACa,eAAe;IAExB,OAAO,EAAG,OAAO,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,kCAAkC;IAElC,OAAO,EAAG,MAAM,CAAC;CACpB;AAED,qBACa,iBAAiB;IAC1B;;OAEG;IAEG,eAAe,CACqB,eAAe,EAAE,MAAM,EAC9B,QAAQ,EAAE,MAAM,EACxC,OAAO,GAAE,wBAA6B,GAC9C,OAAO,CAAC,eAAe,CAAC;CAuB9B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview GraphQL surface for OUTBOUND telephony: `PlaceTwilioCall`.
|
|
3
|
+
*
|
|
4
|
+
* @module @memberjunction/telephony-adapters
|
|
5
|
+
*/
|
|
6
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
13
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
14
|
+
};
|
|
15
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
16
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
17
|
+
};
|
|
18
|
+
import { Resolver, Mutation, Arg, Ctx, ObjectType, Field } from 'type-graphql';
|
|
19
|
+
import { LogError } from '@memberjunction/core';
|
|
20
|
+
import { getUserFromPayload, getReadWriteProvider } from '../types.js';
|
|
21
|
+
import { GetTwilioTelephonyService } from '../telephony/telephony-runtime.js';
|
|
22
|
+
/** Result of an outbound place-call attempt. */
|
|
23
|
+
let PlaceCallResult = class PlaceCallResult {
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
Field(() => Boolean),
|
|
27
|
+
__metadata("design:type", Boolean)
|
|
28
|
+
], PlaceCallResult.prototype, "Success", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
Field(() => String, { nullable: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], PlaceCallResult.prototype, "ErrorMessage", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
Field(() => String),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], PlaceCallResult.prototype, "CallSid", void 0);
|
|
37
|
+
PlaceCallResult = __decorate([
|
|
38
|
+
ObjectType()
|
|
39
|
+
], PlaceCallResult);
|
|
40
|
+
export { PlaceCallResult };
|
|
41
|
+
let TelephonyResolver = class TelephonyResolver {
|
|
42
|
+
/**
|
|
43
|
+
* Places an outbound call from the given agent identity to a destination number.
|
|
44
|
+
*/
|
|
45
|
+
async PlaceTwilioCall(agentIdentityId, toNumber, context = {}) {
|
|
46
|
+
const failure = (msg) => ({ Success: false, ErrorMessage: msg, CallSid: '' });
|
|
47
|
+
try {
|
|
48
|
+
const user = getUserFromPayload(context.userPayload);
|
|
49
|
+
if (!user) {
|
|
50
|
+
return failure('Unable to determine current user.');
|
|
51
|
+
}
|
|
52
|
+
const service = GetTwilioTelephonyService();
|
|
53
|
+
if (!service) {
|
|
54
|
+
return failure('Twilio telephony is not configured on this server.');
|
|
55
|
+
}
|
|
56
|
+
const provider = getReadWriteProvider(context.providers);
|
|
57
|
+
if (!provider) {
|
|
58
|
+
return failure('Database provider is not available.');
|
|
59
|
+
}
|
|
60
|
+
const callSid = await service.PlaceOutboundCall(agentIdentityId, toNumber, user, provider);
|
|
61
|
+
return { Success: true, CallSid: callSid };
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
65
|
+
LogError(`PlaceTwilioCall failed: ${msg}`);
|
|
66
|
+
return failure(msg);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
__decorate([
|
|
71
|
+
Mutation(() => PlaceCallResult),
|
|
72
|
+
__param(0, Arg('agentIdentityId', () => String)),
|
|
73
|
+
__param(1, Arg('toNumber', () => String)),
|
|
74
|
+
__param(2, Ctx()),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], TelephonyResolver.prototype, "PlaceTwilioCall", null);
|
|
79
|
+
TelephonyResolver = __decorate([
|
|
80
|
+
Resolver()
|
|
81
|
+
], TelephonyResolver);
|
|
82
|
+
export { TelephonyResolver };
|
|
83
|
+
//# sourceMappingURL=TelephonyResolver.js.map
|