@app-connect/core 1.7.36 → 1.7.38

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.
Files changed (287) hide show
  1. package/README.md +17 -16
  2. package/dist/connector/developerPortal.d.ts +6 -0
  3. package/{connector → dist/connector}/developerPortal.js +29 -12
  4. package/dist/connector/mock.d.ts +1 -0
  5. package/{connector → dist/connector}/mock.js +33 -17
  6. package/dist/connector/proxy/engine.d.ts +10 -0
  7. package/dist/connector/proxy/engine.js +222 -0
  8. package/dist/connector/proxy/index.d.ts +5 -0
  9. package/dist/connector/proxy/index.js +511 -0
  10. package/dist/connector/registry.d.ts +1 -0
  11. package/dist/connector/registry.js +243 -0
  12. package/dist/handlers/admin.d.ts +1 -0
  13. package/{handlers → dist/handlers}/admin.js +137 -78
  14. package/dist/handlers/appointment.d.ts +9 -0
  15. package/{handlers → dist/handlers}/appointment.js +58 -29
  16. package/dist/handlers/auth.d.ts +9 -0
  17. package/{handlers → dist/handlers}/auth.js +68 -40
  18. package/dist/handlers/calldown.d.ts +10 -0
  19. package/dist/handlers/calldown.js +134 -0
  20. package/dist/handlers/contact.d.ts +1 -0
  21. package/{handlers → dist/handlers}/contact.js +61 -39
  22. package/dist/handlers/disposition.d.ts +1 -0
  23. package/{handlers → dist/handlers}/disposition.js +20 -10
  24. package/dist/handlers/log.d.ts +1 -0
  25. package/{handlers → dist/handlers}/log.js +91 -124
  26. package/dist/handlers/managedAuth.d.ts +1 -0
  27. package/{handlers → dist/handlers}/managedAuth.js +134 -61
  28. package/dist/handlers/managedOAuth.d.ts +13 -0
  29. package/{handlers → dist/handlers}/managedOAuth.js +102 -30
  30. package/dist/handlers/plugin.d.ts +1 -0
  31. package/{handlers → dist/handlers}/plugin.js +59 -27
  32. package/dist/handlers/user.d.ts +1 -0
  33. package/{handlers → dist/handlers}/user.js +45 -27
  34. package/dist/index.d.ts +1 -0
  35. package/{index.js → dist/index.js} +548 -450
  36. package/dist/jest.config.d.ts +1 -0
  37. package/dist/jest.config.js +65 -0
  38. package/dist/lib/analytics.d.ts +4 -0
  39. package/{lib → dist/lib}/analytics.js +8 -6
  40. package/dist/lib/authSession.d.ts +5 -0
  41. package/{lib → dist/lib}/authSession.js +15 -43
  42. package/dist/lib/cacheCleanup.d.ts +4 -0
  43. package/{lib → dist/lib}/cacheCleanup.js +5 -17
  44. package/dist/lib/callLogComposer.d.ts +109 -0
  45. package/{lib → dist/lib}/callLogComposer.js +157 -197
  46. package/dist/lib/callLogLookup.d.ts +6 -0
  47. package/{lib → dist/lib}/callLogLookup.js +12 -34
  48. package/dist/lib/constants.d.ts +6 -0
  49. package/dist/lib/constants.js +9 -0
  50. package/dist/lib/debugTracer.d.ts +17 -0
  51. package/{lib → dist/lib}/debugTracer.js +7 -83
  52. package/dist/lib/encode.d.ts +3 -0
  53. package/dist/lib/encode.js +50 -0
  54. package/dist/lib/errorHandler.d.ts +7 -0
  55. package/dist/lib/errorHandler.js +161 -0
  56. package/dist/lib/generalErrorMessage.d.ts +7 -0
  57. package/{lib → dist/lib}/generalErrorMessage.js +6 -6
  58. package/dist/lib/jwt.d.ts +4 -0
  59. package/dist/lib/jwt.js +18 -0
  60. package/dist/lib/logger.d.ts +24 -0
  61. package/dist/lib/logger.js +126 -0
  62. package/dist/lib/migrateCallLogsSchema.d.ts +32 -0
  63. package/dist/lib/migrateCallLogsSchema.js +339 -0
  64. package/dist/lib/oauth.d.ts +4 -0
  65. package/{lib → dist/lib}/oauth.js +157 -160
  66. package/dist/lib/ringcentral.d.ts +24 -0
  67. package/dist/lib/ringcentral.js +226 -0
  68. package/dist/lib/s3ErrorLogReport.d.ts +4 -0
  69. package/{lib → dist/lib}/s3ErrorLogReport.js +11 -23
  70. package/dist/lib/sharedSMSComposer.d.ts +7 -0
  71. package/{lib → dist/lib}/sharedSMSComposer.js +21 -107
  72. package/dist/lib/util.d.ts +7 -0
  73. package/{lib → dist/lib}/util.js +9 -20
  74. package/dist/mcp/lib/oauthError.d.ts +1 -0
  75. package/dist/mcp/lib/oauthError.js +25 -0
  76. package/dist/mcp/lib/validator.d.ts +1 -0
  77. package/{mcp → dist/mcp}/lib/validator.js +16 -20
  78. package/dist/mcp/lib/widgetSessionToken.d.ts +1 -0
  79. package/dist/mcp/lib/widgetSessionToken.js +46 -0
  80. package/dist/mcp/mcpHandler.d.ts +8 -0
  81. package/{mcp → dist/mcp}/mcpHandler.js +98 -88
  82. package/dist/mcp/tools/cancelAppointment.d.ts +1 -0
  83. package/{mcp → dist/mcp}/tools/cancelAppointment.js +7 -16
  84. package/dist/mcp/tools/checkAuthStatus.d.ts +1 -0
  85. package/{mcp → dist/mcp}/tools/checkAuthStatus.js +21 -14
  86. package/dist/mcp/tools/confirmAppointment.d.ts +1 -0
  87. package/{mcp → dist/mcp}/tools/confirmAppointment.js +7 -16
  88. package/dist/mcp/tools/createAppointment.d.ts +1 -0
  89. package/{mcp → dist/mcp}/tools/createAppointment.js +7 -19
  90. package/dist/mcp/tools/createCallLog.d.ts +1 -0
  91. package/{mcp → dist/mcp}/tools/createCallLog.js +18 -29
  92. package/dist/mcp/tools/createContact.d.ts +1 -0
  93. package/{mcp → dist/mcp}/tools/createContact.js +8 -20
  94. package/dist/mcp/tools/createMessageLog.d.ts +1 -0
  95. package/{mcp → dist/mcp}/tools/createMessageLog.js +14 -26
  96. package/dist/mcp/tools/doAuth.d.ts +1 -0
  97. package/{mcp → dist/mcp}/tools/doAuth.js +17 -13
  98. package/dist/mcp/tools/findContactByName.d.ts +1 -0
  99. package/{mcp → dist/mcp}/tools/findContactByName.js +9 -15
  100. package/dist/mcp/tools/findContactByPhone.d.ts +1 -0
  101. package/{mcp → dist/mcp}/tools/findContactByPhone.js +8 -15
  102. package/dist/mcp/tools/getCallLog.d.ts +1 -0
  103. package/{mcp → dist/mcp}/tools/getCallLog.js +12 -21
  104. package/dist/mcp/tools/getGoogleFilePicker.d.ts +1 -0
  105. package/{mcp → dist/mcp}/tools/getGoogleFilePicker.js +9 -18
  106. package/dist/mcp/tools/getHelp.d.ts +1 -0
  107. package/{mcp → dist/mcp}/tools/getHelp.js +5 -6
  108. package/dist/mcp/tools/getPublicConnectors.d.ts +1 -0
  109. package/{mcp → dist/mcp}/tools/getPublicConnectors.js +19 -18
  110. package/dist/mcp/tools/getSessionInfo.d.ts +1 -0
  111. package/{mcp → dist/mcp}/tools/getSessionInfo.js +10 -16
  112. package/dist/mcp/tools/index.d.ts +8 -0
  113. package/dist/mcp/tools/index.js +50 -0
  114. package/dist/mcp/tools/listAppointments.d.ts +1 -0
  115. package/{mcp → dist/mcp}/tools/listAppointments.js +7 -19
  116. package/dist/mcp/tools/logout.d.ts +1 -0
  117. package/{mcp → dist/mcp}/tools/logout.js +16 -14
  118. package/dist/mcp/tools/rcGetCallLogs.d.ts +1 -0
  119. package/{mcp → dist/mcp}/tools/rcGetCallLogs.js +10 -8
  120. package/dist/mcp/tools/updateAppointment.d.ts +1 -0
  121. package/{mcp → dist/mcp}/tools/updateAppointment.js +17 -22
  122. package/dist/mcp/tools/updateCallLog.d.ts +1 -0
  123. package/{mcp → dist/mcp}/tools/updateCallLog.js +16 -26
  124. package/dist/models/accountDataModel.d.ts +3 -0
  125. package/dist/models/accountDataModel.js +39 -0
  126. package/dist/models/adminConfigModel.d.ts +2 -0
  127. package/dist/models/adminConfigModel.js +39 -0
  128. package/dist/models/cacheModel.d.ts +2 -0
  129. package/{models → dist/models}/cacheModel.js +7 -3
  130. package/dist/models/callDownListModel.d.ts +2 -0
  131. package/{models → dist/models}/callDownListModel.js +8 -4
  132. package/dist/models/callLogModel.d.ts +2 -0
  133. package/dist/models/callLogModel.js +43 -0
  134. package/dist/models/dynamo/connectorSchema.d.ts +2 -0
  135. package/dist/models/dynamo/connectorSchema.js +141 -0
  136. package/dist/models/dynamo/lockSchema.d.ts +2 -0
  137. package/{models → dist/models}/dynamo/lockSchema.js +5 -7
  138. package/dist/models/dynamo/noteCacheSchema.d.ts +2 -0
  139. package/{models → dist/models}/dynamo/noteCacheSchema.js +4 -6
  140. package/dist/models/llmSessionModel.d.ts +2 -0
  141. package/dist/models/llmSessionModel.js +21 -0
  142. package/dist/models/messageLogModel.d.ts +2 -0
  143. package/{models → dist/models}/messageLogModel.js +8 -4
  144. package/dist/models/sequelize.d.ts +2 -0
  145. package/dist/models/sequelize.js +68 -0
  146. package/dist/models/userModel.d.ts +2 -0
  147. package/dist/models/userModel.js +49 -0
  148. package/dist/package.json +100 -0
  149. package/dist/releaseNotes.json +1222 -0
  150. package/dist/tsconfig.json +14 -0
  151. package/dist/types/admin.d.ts +141 -0
  152. package/dist/types/analytics.d.ts +14 -0
  153. package/dist/types/appointment.d.ts +50 -0
  154. package/dist/types/auth.d.ts +137 -0
  155. package/dist/types/authSession.d.ts +35 -0
  156. package/dist/types/cacheCleanup.d.ts +12 -0
  157. package/dist/types/calldown.d.ts +54 -0
  158. package/dist/types/common.d.ts +46 -0
  159. package/dist/types/connector.d.ts +165 -0
  160. package/dist/types/contact.d.ts +125 -0
  161. package/dist/types/errorHandler.d.ts +60 -0
  162. package/dist/types/index.d.ts +76 -0
  163. package/dist/types/json.d.ts +9 -0
  164. package/dist/types/jwt.d.ts +8 -0
  165. package/dist/types/logging.d.ts +224 -0
  166. package/dist/types/managedAuth.d.ts +114 -0
  167. package/dist/types/managedOAuth.d.ts +59 -0
  168. package/dist/types/manifest.d.ts +120 -0
  169. package/dist/types/migration.d.ts +15 -0
  170. package/dist/types/plugin.d.ts +74 -0
  171. package/dist/types/ringcentral.d.ts +61 -0
  172. package/dist/types/s3ErrorLogReport.d.ts +16 -0
  173. package/dist/types/sharedSMSComposer.d.ts +105 -0
  174. package/dist/types/user.d.ts +46 -0
  175. package/dist/types/util.d.ts +7 -0
  176. package/package.json +34 -6
  177. package/releaseNotes.json +13 -1
  178. package/.env.test +0 -5
  179. package/connector/proxy/engine.js +0 -165
  180. package/connector/proxy/index.js +0 -500
  181. package/connector/registry.js +0 -252
  182. package/docs/README.md +0 -50
  183. package/docs/architecture.md +0 -94
  184. package/docs/connectors.md +0 -116
  185. package/docs/handlers.md +0 -128
  186. package/docs/libraries.md +0 -98
  187. package/docs/models.md +0 -146
  188. package/docs/routes.md +0 -119
  189. package/docs/tests.md +0 -73
  190. package/handlers/calldown.js +0 -99
  191. package/jest.config.js +0 -57
  192. package/lib/constants.js +0 -9
  193. package/lib/encode.js +0 -30
  194. package/lib/errorHandler.js +0 -218
  195. package/lib/jwt.js +0 -18
  196. package/lib/logger.js +0 -190
  197. package/lib/migrateCallLogsSchema.js +0 -237
  198. package/lib/ringcentral.js +0 -267
  199. package/mcp/README.md +0 -420
  200. package/mcp/tools/index.js +0 -51
  201. package/mcp/ui/App/App.tsx +0 -358
  202. package/mcp/ui/App/components/AuthInfoForm.tsx +0 -113
  203. package/mcp/ui/App/components/AuthSuccess.tsx +0 -22
  204. package/mcp/ui/App/components/ConnectorList.tsx +0 -82
  205. package/mcp/ui/App/components/DebugPanel.tsx +0 -43
  206. package/mcp/ui/App/components/OAuthConnect.tsx +0 -270
  207. package/mcp/ui/App/lib/callTool.ts +0 -130
  208. package/mcp/ui/App/lib/debugLog.ts +0 -41
  209. package/mcp/ui/App/lib/developerPortal.ts +0 -111
  210. package/mcp/ui/App/main.css +0 -6
  211. package/mcp/ui/App/root.tsx +0 -13
  212. package/mcp/ui/dist/index.html +0 -53
  213. package/mcp/ui/vite.config.ts +0 -16
  214. package/models/accountDataModel.js +0 -34
  215. package/models/adminConfigModel.js +0 -35
  216. package/models/callLogModel.js +0 -39
  217. package/models/dynamo/connectorSchema.js +0 -146
  218. package/models/llmSessionModel.js +0 -17
  219. package/models/sequelize.js +0 -17
  220. package/models/userModel.js +0 -45
  221. package/test/connector/developerPortal.test.js +0 -166
  222. package/test/connector/mock.test.js +0 -131
  223. package/test/connector/proxy/engine.test.js +0 -211
  224. package/test/connector/proxy/index.test.js +0 -525
  225. package/test/connector/proxy/sample.json +0 -162
  226. package/test/connector/registry.test.js +0 -416
  227. package/test/handlers/admin.test.js +0 -960
  228. package/test/handlers/appointment.test.js +0 -260
  229. package/test/handlers/auth.test.js +0 -1096
  230. package/test/handlers/calldown.test.js +0 -310
  231. package/test/handlers/contact.test.js +0 -1014
  232. package/test/handlers/disposition.test.js +0 -396
  233. package/test/handlers/log.test.js +0 -1847
  234. package/test/handlers/managedAuth.test.js +0 -458
  235. package/test/handlers/managedOAuth.test.js +0 -262
  236. package/test/handlers/plugin.test.js +0 -429
  237. package/test/handlers/user.test.js +0 -381
  238. package/test/index.test.js +0 -301
  239. package/test/lib/analytics.test.js +0 -146
  240. package/test/lib/authSession.test.js +0 -173
  241. package/test/lib/cacheCleanup.test.js +0 -127
  242. package/test/lib/callLogComposer.test.js +0 -1231
  243. package/test/lib/debugTracer.test.js +0 -328
  244. package/test/lib/encode.test.js +0 -59
  245. package/test/lib/errorHandler.test.js +0 -246
  246. package/test/lib/generalErrorMessage.test.js +0 -82
  247. package/test/lib/jwt.test.js +0 -176
  248. package/test/lib/logger.test.js +0 -206
  249. package/test/lib/oauth.test.js +0 -359
  250. package/test/lib/ringcentral.test.js +0 -467
  251. package/test/lib/s3ErrorLogReport.test.js +0 -187
  252. package/test/lib/sharedSMSComposer.test.js +0 -1084
  253. package/test/lib/util.test.js +0 -329
  254. package/test/mcp/mcpHandler.test.js +0 -73
  255. package/test/mcp/mcpHandlerMore.test.js +0 -384
  256. package/test/mcp/tools/appointmentTools.test.js +0 -362
  257. package/test/mcp/tools/checkAuthStatus.test.js +0 -83
  258. package/test/mcp/tools/createCallLog.test.js +0 -436
  259. package/test/mcp/tools/createContact.test.js +0 -58
  260. package/test/mcp/tools/createMessageLog.test.js +0 -595
  261. package/test/mcp/tools/doAuth.test.js +0 -113
  262. package/test/mcp/tools/findContactByName.test.js +0 -275
  263. package/test/mcp/tools/findContactByPhone.test.js +0 -296
  264. package/test/mcp/tools/getCallLog.test.js +0 -298
  265. package/test/mcp/tools/getGoogleFilePicker.test.js +0 -281
  266. package/test/mcp/tools/getPublicConnectors.test.js +0 -107
  267. package/test/mcp/tools/getSessionInfo.test.js +0 -127
  268. package/test/mcp/tools/logout.test.js +0 -233
  269. package/test/mcp/tools/rcGetCallLogs.test.js +0 -56
  270. package/test/mcp/tools/updateCallLog.test.js +0 -360
  271. package/test/models/accountDataModel.test.js +0 -98
  272. package/test/models/callDownListModel.test.js +0 -125
  273. package/test/models/dynamo/connectorSchema.test.js +0 -189
  274. package/test/models/dynamo/lockSchema.test.js +0 -37
  275. package/test/models/dynamo/noteCacheSchema.test.js +0 -45
  276. package/test/models/llmSessionModel.test.js +0 -91
  277. package/test/models/models.test.js +0 -660
  278. package/test/routes/calldownRoutes.test.js +0 -224
  279. package/test/routes/coreRouterBroadRoutes.test.js +0 -855
  280. package/test/routes/dispositionRoutes.test.js +0 -192
  281. package/test/routes/managedAuthRoutes.test.js +0 -386
  282. package/test/routes/pluginRoutes.test.js +0 -262
  283. package/test/setup.js +0 -178
  284. /package/{mcp → dist/mcp}/ui/index.html +0 -0
  285. /package/{mcp → dist/mcp}/ui/package-lock.json +0 -0
  286. /package/{mcp → dist/mcp}/ui/package.json +0 -0
  287. /package/{mcp → dist/mcp}/ui/tsconfig.json +0 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "."
5
+ },
6
+ "include": [
7
+ "**/*.ts"
8
+ ],
9
+ "exclude": [
10
+ "node_modules",
11
+ "coverage",
12
+ "mcp/ui"
13
+ ]
14
+ }
@@ -0,0 +1,141 @@
1
+ import type { OAuthInfo } from './auth';
2
+ import type { ReturnMessage } from './common';
3
+ import type { ProxyConfig } from './connector';
4
+
5
+ export interface AdminConfigRecord {
6
+ id?: string;
7
+ adminAccessToken?: string;
8
+ adminRefreshToken?: string;
9
+ adminTokenExpiry?: Date | string | number;
10
+ userMappings?: AdminUserMapping[];
11
+ update(values: Record<string, unknown>): Promise<unknown>;
12
+ [key: string]: any;
13
+ }
14
+
15
+ export interface AdminUserMapping {
16
+ crmUserId?: string | number;
17
+ rcExtensionId?: string | number | Array<string | number>;
18
+ [key: string]: any;
19
+ }
20
+
21
+ export interface AdminHandlerUser {
22
+ id?: string | number;
23
+ platform: string;
24
+ hostname?: string;
25
+ accessToken?: string | null;
26
+ rcAccountId?: string | number;
27
+ platformAdditionalInfo?: {
28
+ proxyId?: string;
29
+ tokenUrl?: string;
30
+ [key: string]: unknown;
31
+ } | null;
32
+ [key: string]: any;
33
+ }
34
+
35
+ export interface RcExtensionInfo {
36
+ id: string | number;
37
+ name?: string;
38
+ firstName?: string;
39
+ lastName?: string;
40
+ email?: string;
41
+ extensionNumber?: string | number;
42
+ [key: string]: any;
43
+ }
44
+
45
+ export interface CrmUserInfo {
46
+ id: string | number;
47
+ name?: string;
48
+ email?: string;
49
+ [key: string]: any;
50
+ }
51
+
52
+ export interface AdminConnectorImplementation {
53
+ getAuthType(params: { proxyId?: string; proxyConfig?: ProxyConfig | null }): string | Promise<string>;
54
+ getBasicAuth(params: { apiKey?: unknown }): string;
55
+ getOauthInfo(params: { tokenUrl?: unknown; hostname?: unknown; proxyId?: string; proxyConfig?: ProxyConfig | null }): OAuthInfo | Promise<OAuthInfo>;
56
+ getUserList?(params: { user: AdminHandlerUser; authHeader: string; proxyConfig?: ProxyConfig | null }): CrmUserInfo[] | Promise<CrmUserInfo[]>;
57
+ getServerLoggingSettings?(params: { user: AdminHandlerUser }): unknown | Promise<unknown>;
58
+ updateServerLoggingSettings?(params: { user: AdminHandlerUser; additionalFieldValues?: unknown; oauthApp?: unknown }): { successful?: boolean; returnMessage?: ReturnMessage } | Promise<{ successful?: boolean; returnMessage?: ReturnMessage }>;
59
+ [key: string]: unknown;
60
+ }
61
+
62
+ export interface ValidateRcUserTokenParams {
63
+ rcAccessToken?: string;
64
+ }
65
+
66
+ export interface ValidateRcUserTokenResult {
67
+ rcAccountId: string;
68
+ rcExtensionId: string;
69
+ }
70
+
71
+ export interface ValidateAdminRoleParams {
72
+ rcAccessToken: string;
73
+ }
74
+
75
+ export interface ValidateAdminRoleResult {
76
+ isValidated: boolean;
77
+ rcAccountId: string | number;
78
+ }
79
+
80
+ export interface UpsertAdminSettingsParams {
81
+ hashedRcAccountId: string;
82
+ adminSettings: Record<string, unknown>;
83
+ }
84
+
85
+ export interface AdminSettingsParams {
86
+ hashedRcAccountId: string;
87
+ }
88
+
89
+ export interface UpdateAdminRcTokensParams {
90
+ hashedRcAccountId: string;
91
+ adminAccessToken?: string;
92
+ adminRefreshToken?: string;
93
+ adminTokenExpiry?: Date | string | number;
94
+ }
95
+
96
+ export interface ServerLoggingSettingsParams {
97
+ user: AdminHandlerUser;
98
+ }
99
+
100
+ export interface UpdateServerLoggingSettingsParams extends ServerLoggingSettingsParams {
101
+ additionalFieldValues?: unknown;
102
+ }
103
+
104
+ export interface AdminReportParams {
105
+ rcAccountId: string | number;
106
+ timezone?: string;
107
+ timeFrom?: string;
108
+ timeTo?: string;
109
+ groupBy?: string;
110
+ }
111
+
112
+ export interface UserReportParams extends AdminReportParams {
113
+ rcExtensionId?: string | number;
114
+ }
115
+
116
+ export interface UserMappingParams {
117
+ user: AdminHandlerUser;
118
+ hashedRcAccountId: string;
119
+ rcExtensionList: RcExtensionInfo[];
120
+ }
121
+
122
+ export interface UserMappingResultItem {
123
+ crmUser: {
124
+ id: string | number;
125
+ name: string;
126
+ email: string;
127
+ };
128
+ rcUser: Array<{
129
+ extensionId: string | number;
130
+ name: string;
131
+ extensionNumber: string | number;
132
+ email: string;
133
+ }>;
134
+ }
135
+
136
+ export interface RingCentralSdkLike {
137
+ refreshToken(params: Record<string, unknown>): Promise<Record<string, any>>;
138
+ getCallsAggregationData(params: Record<string, unknown>): Promise<Record<string, any>>;
139
+ getCallLogData(params: Record<string, unknown>): Promise<{ records: any[] }>;
140
+ getSMSData(params: Record<string, unknown>): Promise<{ records: any[] }>;
141
+ }
@@ -0,0 +1,14 @@
1
+ export interface AnalyticsTrackParams {
2
+ eventName: string;
3
+ interfaceName?: string;
4
+ connectorName?: string;
5
+ accountId?: string | number;
6
+ extensionId?: string | number;
7
+ success?: boolean;
8
+ requestDuration?: number;
9
+ userAgent?: string;
10
+ ip?: string;
11
+ author?: string;
12
+ eventAddedVia?: string;
13
+ extras?: Record<string, unknown> | null;
14
+ }
@@ -0,0 +1,50 @@
1
+ import type { AppConnectUser, ReturnMessage } from './common';
2
+
3
+ export interface AppointmentAuthParams {
4
+ platform: string;
5
+ userId: string | number;
6
+ }
7
+
8
+ export interface AppointmentAuthFailure {
9
+ successful: false;
10
+ returnMessage?: ReturnMessage;
11
+ isRevokeUserSession?: boolean;
12
+ [key: string]: unknown;
13
+ }
14
+
15
+ export interface AppointmentResolvedAuth {
16
+ successful: true;
17
+ user: AppConnectUser;
18
+ platformModule: any;
19
+ authHeader: string;
20
+ proxyConfig?: unknown | null;
21
+ [key: string]: unknown;
22
+ }
23
+
24
+ export type AppointmentAuthResult = AppointmentAuthFailure | AppointmentResolvedAuth;
25
+
26
+ export interface AppointmentHandlerResult {
27
+ successful: boolean;
28
+ returnMessage?: ReturnMessage;
29
+ isRevokeUserSession?: boolean;
30
+ [key: string]: unknown;
31
+ }
32
+
33
+ export interface ListAppointmentsParams extends AppointmentAuthParams {
34
+ range?: unknown;
35
+ mineOnly?: boolean;
36
+ forceSync?: boolean;
37
+ }
38
+
39
+ export interface AppointmentPayloadParams extends AppointmentAuthParams {
40
+ payload?: unknown;
41
+ }
42
+
43
+ export interface AppointmentPatchParams extends AppointmentAuthParams {
44
+ appointmentId: string | number;
45
+ patchBody?: unknown;
46
+ }
47
+
48
+ export interface AppointmentRecordParams extends AppointmentAuthParams {
49
+ appointmentId: string | number;
50
+ }
@@ -0,0 +1,137 @@
1
+ import type { JsonObject } from './json';
2
+ import type { ReturnMessage } from './common';
3
+
4
+ export interface OAuthInfo {
5
+ authUrl?: string;
6
+ accessTokenUri?: string;
7
+ authorizationUri?: string;
8
+ clientId?: string;
9
+ clientSecret?: string;
10
+ redirectUri?: string;
11
+ scope?: string;
12
+ scopes?: string[] | string;
13
+ customState?: string;
14
+ hostname?: string;
15
+ failMessage?: string;
16
+ [key: string]: unknown;
17
+ }
18
+
19
+ export interface OAuthRefreshResult {
20
+ accessToken?: unknown;
21
+ refreshToken?: unknown;
22
+ expires?: unknown;
23
+ [key: string]: unknown;
24
+ }
25
+
26
+ export interface OAuthTokenLike {
27
+ refresh(): Promise<OAuthRefreshResult>;
28
+ [key: string]: unknown;
29
+ }
30
+
31
+ export interface OAuthAppLike {
32
+ createToken(accessToken?: unknown, refreshToken?: unknown): OAuthTokenLike;
33
+ [key: string]: unknown;
34
+ }
35
+
36
+ export interface RefreshableOAuthUser {
37
+ id: string;
38
+ platform?: string;
39
+ accessToken?: unknown;
40
+ refreshToken?: unknown;
41
+ tokenExpiry?: unknown;
42
+ save(): Promise<unknown>;
43
+ [key: string]: unknown;
44
+ }
45
+
46
+ export interface PlatformUserInfo {
47
+ id?: string | number;
48
+ name?: string;
49
+ email?: string;
50
+ overridingHostname?: string;
51
+ additionalInfo?: JsonObject;
52
+ [key: string]: unknown;
53
+ }
54
+
55
+ export interface ConnectorAuthResult {
56
+ successful: boolean;
57
+ platformUserInfo?: PlatformUserInfo;
58
+ returnMessage?: ReturnMessage;
59
+ [key: string]: unknown;
60
+ }
61
+
62
+ export interface AuthHandlerResult {
63
+ userInfo?: unknown | null;
64
+ returnMessage?: ReturnMessage;
65
+ }
66
+
67
+ export interface OAuthCallbackQuery {
68
+ callbackUri: string;
69
+ apiUrl?: string;
70
+ username?: string;
71
+ proxyId?: string;
72
+ userEmail?: string;
73
+ rcAccountId?: string | number;
74
+ [key: string]: unknown;
75
+ }
76
+
77
+ export interface OAuthCallbackParams {
78
+ platform: string;
79
+ hostname?: string;
80
+ tokenUrl?: string;
81
+ query: OAuthCallbackQuery;
82
+ hashedRcExtensionId?: string;
83
+ isFromMCP?: boolean;
84
+ }
85
+
86
+ export interface ApiKeyLoginParams {
87
+ platform: string;
88
+ hostname?: string;
89
+ apiKey?: string;
90
+ proxyId?: string;
91
+ rcAccountId?: string | number;
92
+ rcExtensionId?: string | number;
93
+ connectorId?: string;
94
+ isPrivate?: boolean;
95
+ hashedRcExtensionId?: string;
96
+ additionalInfo?: Record<string, unknown>;
97
+ }
98
+
99
+ export interface SaveUserInfoParams {
100
+ platformUserInfo: PlatformUserInfo & {
101
+ id: string | number;
102
+ name?: string;
103
+ platformAdditionalInfo?: Record<string, unknown>;
104
+ };
105
+ platform: string;
106
+ hostname?: string;
107
+ accessToken?: unknown;
108
+ refreshToken?: unknown;
109
+ tokenExpiry?: unknown;
110
+ rcAccountId?: string | number;
111
+ hashedRcExtensionId?: string;
112
+ proxyId?: string;
113
+ [key: string]: unknown;
114
+ }
115
+
116
+ export interface LicenseStatusParams {
117
+ userId: string | number;
118
+ platform: string;
119
+ }
120
+
121
+ export interface AuthValidationParams {
122
+ platform: string;
123
+ userId: string | number;
124
+ }
125
+
126
+ export interface AuthValidationResult {
127
+ successful: boolean;
128
+ returnMessage?: ReturnMessage;
129
+ status?: number;
130
+ failReason: string;
131
+ [key: string]: unknown;
132
+ }
133
+
134
+ export interface RingcentralOAuthCallbackParams {
135
+ code: string;
136
+ rcAccountId?: string | number;
137
+ }
@@ -0,0 +1,35 @@
1
+ export type AuthSessionStatus =
2
+ | 'pending'
3
+ | 'completed'
4
+ | 'expired'
5
+ | (string & {});
6
+
7
+ export interface AuthSessionData {
8
+ platform?: string;
9
+ hostname?: string;
10
+ createdAt?: string;
11
+ updatedAt?: string;
12
+ status?: AuthSessionStatus;
13
+ jwtToken?: string;
14
+ rcExtensionId?: string;
15
+ openaiSessionId?: string;
16
+ [key: string]: unknown;
17
+ }
18
+
19
+ export type AuthSessionCreateData = Pick<AuthSessionData, 'platform' | 'hostname'> & Record<string, unknown>;
20
+
21
+ export interface AuthSessionUpdateData extends AuthSessionData {}
22
+
23
+ export interface AuthSessionRecord {
24
+ userId?: string;
25
+ status?: AuthSessionStatus;
26
+ data?: AuthSessionData | null;
27
+ expiry?: Date | null;
28
+ update(values: Record<string, unknown>): Promise<unknown>;
29
+ [key: string]: unknown;
30
+ }
31
+
32
+ export interface AuthSessionResult extends AuthSessionData {
33
+ sessionId?: string;
34
+ status?: AuthSessionStatus;
35
+ }
@@ -0,0 +1,12 @@
1
+ export interface CacheCleanupOptions {
2
+ now?: Date;
3
+ }
4
+
5
+ export interface AccountContactCleanupOptions extends CacheCleanupOptions {
6
+ retentionMonths?: number;
7
+ }
8
+
9
+ export interface AccountContactCutoffOptions {
10
+ now: Date;
11
+ retentionMonths: number;
12
+ }
@@ -0,0 +1,54 @@
1
+ import type { ReturnMessage } from './common';
2
+
3
+ export interface CallDownJwtData {
4
+ id?: string | number;
5
+ [key: string]: unknown;
6
+ }
7
+
8
+ export interface CallDownScheduleBody {
9
+ contactId?: string | number | null;
10
+ contactType?: string | null;
11
+ contactName?: string | null;
12
+ phoneNumber?: string | null;
13
+ scheduledAt?: string | number | Date | null;
14
+ [key: string]: unknown;
15
+ }
16
+
17
+ export interface CallDownScheduleParams {
18
+ jwtToken: string;
19
+ body: CallDownScheduleBody;
20
+ rcAccessToken?: string;
21
+ }
22
+
23
+ export interface CallDownScheduleResult {
24
+ id: string;
25
+ }
26
+
27
+ export interface CallDownListParams {
28
+ jwtToken: string;
29
+ status?: string | number | null;
30
+ }
31
+
32
+ export interface CallDownListResult {
33
+ items: unknown[];
34
+ }
35
+
36
+ export interface CallDownRecordParams {
37
+ jwtToken: string;
38
+ id: string;
39
+ }
40
+
41
+ export interface CallDownMarkCalledParams extends CallDownRecordParams {
42
+ lastCallAt?: string | number | Date | null;
43
+ }
44
+
45
+ export type CallDownUpdateData = Record<string, unknown>;
46
+
47
+ export interface CallDownUpdateParams extends CallDownRecordParams {
48
+ updateData: CallDownUpdateData;
49
+ }
50
+
51
+ export interface CallDownOperationResult {
52
+ successful: boolean;
53
+ returnMessage?: ReturnMessage;
54
+ }
@@ -0,0 +1,46 @@
1
+ import type { JsonObject, JsonValue } from './json';
2
+
3
+ export type MessageType =
4
+ | 'success'
5
+ | 'info'
6
+ | 'warning'
7
+ | 'danger'
8
+ | 'error'
9
+ | (string & {});
10
+
11
+ export interface ReturnMessage {
12
+ message?: string;
13
+ messageType?: MessageType;
14
+ ttl?: number;
15
+ [key: string]: JsonValue | undefined;
16
+ }
17
+
18
+ export interface UserSetting<TValue = unknown> {
19
+ value?: TValue;
20
+ isCustomizable?: boolean;
21
+ [key: string]: unknown;
22
+ }
23
+
24
+ export type UserSettings = Record<string, UserSetting>;
25
+
26
+ export interface AppConnectUser {
27
+ id: string;
28
+ rcAccountId?: string | number;
29
+ accountId?: string | number;
30
+ hashedRcExtensionId?: string;
31
+ crmPlatform?: string;
32
+ hostname?: string;
33
+ token?: string;
34
+ timezoneOffset?: string | number;
35
+ userSettings?: UserSettings;
36
+ platformAdditionalInfo?: JsonObject;
37
+ [key: string]: unknown;
38
+ }
39
+
40
+ export interface ContactInfo {
41
+ id?: string | number;
42
+ name?: string;
43
+ type?: string;
44
+ phoneNumber?: string;
45
+ [key: string]: unknown;
46
+ }
@@ -0,0 +1,165 @@
1
+ import type { JsonObject } from './json';
2
+
3
+ export type ConnectorInterfaceFunction = (...args: any[]) => unknown;
4
+
5
+ export interface ConnectorImplementation {
6
+ createCallLog?: ConnectorInterfaceFunction;
7
+ updateCallLog?: ConnectorInterfaceFunction;
8
+ getAuthType?: ConnectorInterfaceFunction;
9
+ [key: string]: unknown;
10
+ }
11
+
12
+ export type ConnectorManifest = JsonObject;
13
+
14
+ export interface ConnectorCapabilities {
15
+ platform: string;
16
+ originalMethods: string[];
17
+ composedMethods: string[];
18
+ registeredInterfaces: string[];
19
+ authType: string | null;
20
+ }
21
+
22
+ export interface DeveloperPortalConnectorSummary {
23
+ id?: string;
24
+ accountId?: string | number;
25
+ [key: string]: unknown;
26
+ }
27
+
28
+ export interface DeveloperPortalConnectorList {
29
+ connectors?: DeveloperPortalConnectorSummary[];
30
+ [key: string]: unknown;
31
+ }
32
+
33
+ export interface DeveloperPortalPrivateConnectorList {
34
+ privateConnectors: DeveloperPortalConnectorSummary[];
35
+ sharedConnectors: DeveloperPortalConnectorSummary[];
36
+ [key: string]: unknown;
37
+ }
38
+
39
+ export interface GetPrivateConnectorListParams {
40
+ rcAccountId?: string | number;
41
+ }
42
+
43
+ export interface GetConnectorManifestParams extends GetPrivateConnectorListParams {
44
+ connectorId: string;
45
+ isPrivate?: boolean;
46
+ }
47
+
48
+ export interface ProxyAuthConfig {
49
+ type?: string;
50
+ scheme?: string;
51
+ credentialTemplate?: string;
52
+ encode?: string;
53
+ headerName?: string;
54
+ [key: string]: unknown;
55
+ }
56
+
57
+ export interface ProxyResponseItemMapping {
58
+ idPath?: string;
59
+ namePath?: string;
60
+ phonePath?: string;
61
+ typePath?: string;
62
+ titlePath?: string;
63
+ companyPath?: string;
64
+ createdDatePath?: string;
65
+ mostRecentActivityDatePath?: string;
66
+ additionalInfoPath?: string;
67
+ [key: string]: unknown;
68
+ }
69
+
70
+ export interface ProxyResponseMapping {
71
+ listPath?: string;
72
+ item?: ProxyResponseItemMapping;
73
+ idPath?: string;
74
+ namePath?: string;
75
+ emailPath?: string;
76
+ typePath?: string;
77
+ subjectPath?: string;
78
+ notePath?: string;
79
+ fullBodyPath?: string;
80
+ timezoneNamePath?: string;
81
+ overridingApiKeyPath?: string;
82
+ messagePath?: string;
83
+ platformAdditionalInfoPaths?: Record<string, string>;
84
+ isLicenseValidPath?: string;
85
+ licenseStatusPath?: string;
86
+ licenseStatusDescriptionPath?: string;
87
+ [key: string]: unknown;
88
+ }
89
+
90
+ export interface ProxyOperationConfig {
91
+ method?: string;
92
+ url?: string;
93
+ headers?: Record<string, unknown>;
94
+ query?: unknown;
95
+ body?: unknown;
96
+ auth?: ProxyAuthConfig;
97
+ responseMapping?: ProxyResponseMapping;
98
+ [key: string]: unknown;
99
+ }
100
+
101
+ export interface ProxyRequestDefaults {
102
+ baseUrl?: string;
103
+ timeoutSeconds?: number;
104
+ defaultHeaders?: Record<string, unknown>;
105
+ [key: string]: unknown;
106
+ }
107
+
108
+ export interface ProxyConfig {
109
+ secretKey?: string;
110
+ auth?: ProxyAuthConfig;
111
+ meta?: {
112
+ logFormat?: string;
113
+ [key: string]: unknown;
114
+ };
115
+ requestDefaults?: ProxyRequestDefaults;
116
+ operations?: Record<string, ProxyOperationConfig>;
117
+ [key: string]: unknown;
118
+ }
119
+
120
+ export interface ProxyUserContext {
121
+ accessToken?: string;
122
+ id?: string;
123
+ hostname?: string;
124
+ timezoneName?: string;
125
+ timezoneOffset?: string | number;
126
+ platform?: string;
127
+ platformAdditionalInfo?: unknown;
128
+ refreshToken?: unknown;
129
+ tokenExpiry?: unknown;
130
+ [key: string]: unknown;
131
+ }
132
+
133
+ export interface PerformProxyRequestParams {
134
+ config: ProxyConfig;
135
+ opName: string;
136
+ inputs?: Record<string, any>;
137
+ user?: ProxyUserContext | null;
138
+ authHeader?: string;
139
+ }
140
+
141
+ export interface ProxyResponse<TData = unknown> {
142
+ data: TData;
143
+ [key: string]: unknown;
144
+ }
145
+
146
+ export interface ProxyContactInfo {
147
+ id: unknown;
148
+ name: unknown;
149
+ phone?: unknown;
150
+ type: unknown;
151
+ title: unknown;
152
+ company: unknown;
153
+ createdDate?: unknown;
154
+ mostRecentActivityDate?: unknown;
155
+ additionalInfo: unknown;
156
+ }
157
+
158
+ export interface MapProxyResponseParams {
159
+ config: ProxyConfig;
160
+ response: ProxyResponse;
161
+ }
162
+
163
+ export interface MapFindContactResponseParams extends MapProxyResponseParams {
164
+ opName?: string;
165
+ }