@todoist/ui-extensions-server 0.0.0-stage → 4.0.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.
Files changed (281) hide show
  1. package/README.md +2 -2
  2. package/dist/analytics/events.d.ts +8 -0
  3. package/dist/analytics/events.js +15 -0
  4. package/dist/analytics/events.js.map +1 -0
  5. package/dist/buffer/cloneBuffer.d.ts +1 -0
  6. package/dist/buffer/cloneBuffer.js +12 -0
  7. package/dist/buffer/cloneBuffer.js.map +1 -0
  8. package/dist/buffer/incomingMessageWithRawBody.d.ts +4 -0
  9. package/dist/buffer/incomingMessageWithRawBody.js +8 -0
  10. package/dist/buffer/incomingMessageWithRawBody.js.map +1 -0
  11. package/dist/buffer/index.d.ts +2 -0
  12. package/dist/buffer/index.js +19 -0
  13. package/dist/buffer/index.js.map +1 -0
  14. package/dist/config/configurationBase.d.ts +29 -0
  15. package/dist/config/configurationBase.js +58 -0
  16. package/dist/config/configurationBase.js.map +1 -0
  17. package/dist/constants/card-actions.d.ts +12 -0
  18. package/dist/constants/card-actions.js +17 -0
  19. package/dist/constants/card-actions.js.map +1 -0
  20. package/dist/constants/core-strings.d.ts +61 -0
  21. package/dist/constants/core-strings.js +66 -0
  22. package/dist/constants/core-strings.js.map +1 -0
  23. package/dist/constants/images.d.ts +25 -0
  24. package/dist/constants/images.js +29 -0
  25. package/dist/constants/images.js.map +1 -0
  26. package/dist/constants/index.d.ts +4 -0
  27. package/dist/constants/index.js +21 -0
  28. package/dist/constants/index.js.map +1 -0
  29. package/dist/constants/ui-constants.d.ts +1 -0
  30. package/dist/constants/ui-constants.js +5 -0
  31. package/dist/constants/ui-constants.js.map +1 -0
  32. package/dist/controllers/app.controller.d.ts +15 -0
  33. package/dist/controllers/app.controller.js +76 -0
  34. package/dist/controllers/app.controller.js.map +1 -0
  35. package/dist/controllers/auth.controller.d.ts +47 -0
  36. package/dist/controllers/auth.controller.js +348 -0
  37. package/dist/controllers/auth.controller.js.map +1 -0
  38. package/dist/controllers/index.d.ts +3 -0
  39. package/dist/controllers/index.js +20 -0
  40. package/dist/controllers/index.js.map +1 -0
  41. package/dist/controllers/ping.controller.d.ts +3 -0
  42. package/dist/controllers/ping.controller.js +30 -0
  43. package/dist/controllers/ping.controller.js.map +1 -0
  44. package/dist/decorators/action-decorators.d.ts +12 -0
  45. package/dist/decorators/action-decorators.js +12 -0
  46. package/dist/decorators/action-decorators.js.map +1 -0
  47. package/dist/decorators/app-token.decorator.d.ts +1 -0
  48. package/dist/decorators/app-token.decorator.js +12 -0
  49. package/dist/decorators/app-token.decorator.js.map +1 -0
  50. package/dist/decorators/index.d.ts +2 -0
  51. package/dist/decorators/index.js +19 -0
  52. package/dist/decorators/index.js.map +1 -0
  53. package/dist/decorators/typed-method-decorator.d.ts +1 -0
  54. package/dist/decorators/typed-method-decorator.js +3 -0
  55. package/dist/decorators/typed-method-decorator.js.map +1 -0
  56. package/dist/entities/User.d.ts +24 -0
  57. package/dist/entities/User.js +89 -0
  58. package/dist/entities/User.js.map +1 -0
  59. package/dist/entities/index.d.ts +1 -0
  60. package/dist/entities/index.js +18 -0
  61. package/dist/entities/index.js.map +1 -0
  62. package/dist/exceptions/index.d.ts +1 -0
  63. package/dist/exceptions/index.js +18 -0
  64. package/dist/exceptions/index.js.map +1 -0
  65. package/dist/exceptions/integration.exception.d.ts +32 -0
  66. package/dist/exceptions/integration.exception.js +17 -0
  67. package/dist/exceptions/integration.exception.js.map +1 -0
  68. package/dist/filters/index.d.ts +1 -0
  69. package/dist/filters/index.js +18 -0
  70. package/dist/filters/index.js.map +1 -0
  71. package/dist/filters/integration-exception.filter.d.ts +10 -0
  72. package/dist/filters/integration-exception.filter.js +83 -0
  73. package/dist/filters/integration-exception.filter.js.map +1 -0
  74. package/dist/guards/extensionVerification.guard.d.ts +6 -0
  75. package/dist/guards/extensionVerification.guard.js +55 -0
  76. package/dist/guards/extensionVerification.guard.js.map +1 -0
  77. package/dist/guards/index.d.ts +1 -0
  78. package/dist/guards/index.js +18 -0
  79. package/dist/guards/index.js.map +1 -0
  80. package/dist/index.d.ts +17 -0
  81. package/dist/index.js +34 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/interceptors/sentry.interceptor.d.ts +5 -0
  84. package/dist/interceptors/sentry.interceptor.js +30 -0
  85. package/dist/interceptors/sentry.interceptor.js.map +1 -0
  86. package/dist/logging/index.d.ts +1 -0
  87. package/dist/logging/index.js +18 -0
  88. package/dist/logging/index.js.map +1 -0
  89. package/dist/logging/json.logger.d.ts +7 -0
  90. package/dist/logging/json.logger.js +23 -0
  91. package/dist/logging/json.logger.js.map +1 -0
  92. package/dist/middleware/index.d.ts +1 -0
  93. package/dist/middleware/index.js +18 -0
  94. package/dist/middleware/index.js.map +1 -0
  95. package/dist/middleware/request-header.middleware.d.ts +8 -0
  96. package/dist/middleware/request-header.middleware.js +29 -0
  97. package/dist/middleware/request-header.middleware.js.map +1 -0
  98. package/dist/middleware/workflow-initial-action.middleware.d.ts +13 -0
  99. package/dist/middleware/workflow-initial-action.middleware.js +23 -0
  100. package/dist/middleware/workflow-initial-action.middleware.js.map +1 -0
  101. package/dist/modules/analytics.module.d.ts +5 -0
  102. package/dist/modules/analytics.module.js +37 -0
  103. package/dist/modules/analytics.module.js.map +1 -0
  104. package/dist/modules/app-token.module.d.ts +2 -0
  105. package/dist/modules/app-token.module.js +22 -0
  106. package/dist/modules/app-token.module.js.map +1 -0
  107. package/dist/modules/auth.module.d.ts +17 -0
  108. package/dist/modules/auth.module.js +44 -0
  109. package/dist/modules/auth.module.js.map +1 -0
  110. package/dist/modules/core.module.d.ts +4 -0
  111. package/dist/modules/core.module.js +38 -0
  112. package/dist/modules/core.module.js.map +1 -0
  113. package/dist/modules/error.module.d.ts +7 -0
  114. package/dist/modules/error.module.js +39 -0
  115. package/dist/modules/error.module.js.map +1 -0
  116. package/dist/modules/index.d.ts +3 -0
  117. package/dist/modules/index.js +20 -0
  118. package/dist/modules/index.js.map +1 -0
  119. package/dist/modules/request-headers.module.d.ts +2 -0
  120. package/dist/modules/request-headers.module.js +22 -0
  121. package/dist/modules/request-headers.module.js.map +1 -0
  122. package/dist/server.d.ts +11 -0
  123. package/dist/server.js +52 -0
  124. package/dist/server.js.map +1 -0
  125. package/dist/services/actions.service.d.ts +19 -0
  126. package/dist/services/actions.service.js +126 -0
  127. package/dist/services/actions.service.js.map +1 -0
  128. package/dist/services/adaptive-card.service.d.ts +57 -0
  129. package/dist/services/adaptive-card.service.js +284 -0
  130. package/dist/services/adaptive-card.service.js.map +1 -0
  131. package/dist/services/analytics.service.d.ts +7 -0
  132. package/dist/services/analytics.service.js +20 -0
  133. package/dist/services/analytics.service.js.map +1 -0
  134. package/dist/services/app-token.service.d.ts +6 -0
  135. package/dist/services/app-token.service.js +47 -0
  136. package/dist/services/app-token.service.js.map +1 -0
  137. package/dist/services/authentication-client.d.ts +42 -0
  138. package/dist/services/authentication-client.js +95 -0
  139. package/dist/services/authentication-client.js.map +1 -0
  140. package/dist/services/composer-append-formatting.service.d.ts +9 -0
  141. package/dist/services/composer-append-formatting.service.js +37 -0
  142. package/dist/services/composer-append-formatting.service.js.map +1 -0
  143. package/dist/services/composer-append-settings.service.d.ts +7 -0
  144. package/dist/services/composer-append-settings.service.js +39 -0
  145. package/dist/services/composer-append-settings.service.js.map +1 -0
  146. package/dist/services/errorCard.service.d.ts +14 -0
  147. package/dist/services/errorCard.service.js +129 -0
  148. package/dist/services/errorCard.service.js.map +1 -0
  149. package/dist/services/google-analytics.service.d.ts +10 -0
  150. package/dist/services/google-analytics.service.js +56 -0
  151. package/dist/services/google-analytics.service.js.map +1 -0
  152. package/dist/services/index.d.ts +15 -0
  153. package/dist/services/index.js +32 -0
  154. package/dist/services/index.js.map +1 -0
  155. package/dist/services/legacy-google-analytics.service.d.ts +10 -0
  156. package/dist/services/legacy-google-analytics.service.js +56 -0
  157. package/dist/services/legacy-google-analytics.service.js.map +1 -0
  158. package/dist/services/login.service.d.ts +31 -0
  159. package/dist/services/login.service.js +165 -0
  160. package/dist/services/login.service.js.map +1 -0
  161. package/dist/services/request-headers.service.d.ts +9 -0
  162. package/dist/services/request-headers.service.js +53 -0
  163. package/dist/services/request-headers.service.js.map +1 -0
  164. package/dist/services/state.service.d.ts +18 -0
  165. package/dist/services/state.service.js +96 -0
  166. package/dist/services/state.service.js.map +1 -0
  167. package/dist/services/theme.service.d.ts +5 -0
  168. package/dist/services/theme.service.js +28 -0
  169. package/dist/services/theme.service.js.map +1 -0
  170. package/dist/services/translation.service.d.ts +3 -0
  171. package/dist/services/translation.service.js +20 -0
  172. package/dist/services/translation.service.js.map +1 -0
  173. package/dist/services/user-database.service.d.ts +18 -0
  174. package/dist/services/user-database.service.js +87 -0
  175. package/dist/services/user-database.service.js.map +1 -0
  176. package/dist/tsconfig.build.tsbuildinfo +1 -0
  177. package/dist/types/auth.d.ts +8 -0
  178. package/dist/types/auth.js +3 -0
  179. package/dist/types/auth.js.map +1 -0
  180. package/dist/types/data.d.ts +12 -0
  181. package/dist/types/data.js +10 -0
  182. package/dist/types/data.js.map +1 -0
  183. package/dist/types/endpoints.d.ts +1 -0
  184. package/dist/types/endpoints.js +3 -0
  185. package/dist/types/endpoints.js.map +1 -0
  186. package/dist/types/error-card-options.d.ts +11 -0
  187. package/dist/types/error-card-options.js +3 -0
  188. package/dist/types/error-card-options.js.map +1 -0
  189. package/dist/types/error.d.ts +2 -0
  190. package/dist/types/error.js +12 -0
  191. package/dist/types/error.js.map +1 -0
  192. package/dist/types/index.d.ts +7 -0
  193. package/dist/types/index.js +24 -0
  194. package/dist/types/index.js.map +1 -0
  195. package/dist/types/logging.d.ts +1 -0
  196. package/dist/types/logging.js +3 -0
  197. package/dist/types/logging.js.map +1 -0
  198. package/dist/types/product.d.ts +1 -0
  199. package/dist/types/product.js +3 -0
  200. package/dist/types/product.js.map +1 -0
  201. package/dist/types/retry.d.ts +11 -0
  202. package/dist/types/retry.js +12 -0
  203. package/dist/types/retry.js.map +1 -0
  204. package/dist/ui/back-button.d.ts +7 -0
  205. package/dist/ui/back-button.js +33 -0
  206. package/dist/ui/back-button.js.map +1 -0
  207. package/dist/ui/button.d.ts +15 -0
  208. package/dist/ui/button.js +27 -0
  209. package/dist/ui/button.js.map +1 -0
  210. package/dist/ui/column.d.ts +4 -0
  211. package/dist/ui/column.js +23 -0
  212. package/dist/ui/column.js.map +1 -0
  213. package/dist/ui/container.d.ts +11 -0
  214. package/dist/ui/container.js +31 -0
  215. package/dist/ui/container.js.map +1 -0
  216. package/dist/ui/date-time-input.d.ts +17 -0
  217. package/dist/ui/date-time-input.js +59 -0
  218. package/dist/ui/date-time-input.js.map +1 -0
  219. package/dist/ui/index.d.ts +9 -0
  220. package/dist/ui/index.js +26 -0
  221. package/dist/ui/index.js.map +1 -0
  222. package/dist/ui/profile-details.d.ts +3 -0
  223. package/dist/ui/profile-details.js +16 -0
  224. package/dist/ui/profile-details.js.map +1 -0
  225. package/dist/ui/stock-button.d.ts +20 -0
  226. package/dist/ui/stock-button.js +131 -0
  227. package/dist/ui/stock-button.js.map +1 -0
  228. package/dist/ui/text-block.d.ts +9 -0
  229. package/dist/ui/text-block.js +24 -0
  230. package/dist/ui/text-block.js.map +1 -0
  231. package/dist/ui/ui-builder-context.d.ts +7 -0
  232. package/dist/ui/ui-builder-context.js +3 -0
  233. package/dist/ui/ui-builder-context.js.map +1 -0
  234. package/dist/utils/action-utils.d.ts +5 -0
  235. package/dist/utils/action-utils.js +29 -0
  236. package/dist/utils/action-utils.js.map +1 -0
  237. package/dist/utils/card-bridge.d.ts +7 -0
  238. package/dist/utils/card-bridge.js +30 -0
  239. package/dist/utils/card-bridge.js.map +1 -0
  240. package/dist/utils/context-utils.d.ts +3 -0
  241. package/dist/utils/context-utils.js +21 -0
  242. package/dist/utils/context-utils.js.map +1 -0
  243. package/dist/utils/dateUtils.d.ts +10 -0
  244. package/dist/utils/dateUtils.js +88 -0
  245. package/dist/utils/dateUtils.js.map +1 -0
  246. package/dist/utils/encryption.d.ts +10 -0
  247. package/dist/utils/encryption.js +70 -0
  248. package/dist/utils/encryption.js.map +1 -0
  249. package/dist/utils/endpointUtils.d.ts +2 -0
  250. package/dist/utils/endpointUtils.js +7 -0
  251. package/dist/utils/endpointUtils.js.map +1 -0
  252. package/dist/utils/envUtils.d.ts +1 -0
  253. package/dist/utils/envUtils.js +7 -0
  254. package/dist/utils/envUtils.js.map +1 -0
  255. package/dist/utils/errorUtils.d.ts +6 -0
  256. package/dist/utils/errorUtils.js +51 -0
  257. package/dist/utils/errorUtils.js.map +1 -0
  258. package/dist/utils/header-utils.d.ts +9 -0
  259. package/dist/utils/header-utils.js +24 -0
  260. package/dist/utils/header-utils.js.map +1 -0
  261. package/dist/utils/index.d.ts +13 -0
  262. package/dist/utils/index.js +30 -0
  263. package/dist/utils/index.js.map +1 -0
  264. package/dist/utils/logger.d.ts +10 -0
  265. package/dist/utils/logger.js +50 -0
  266. package/dist/utils/logger.js.map +1 -0
  267. package/dist/utils/paginationDataUtils.d.ts +6 -0
  268. package/dist/utils/paginationDataUtils.js +52 -0
  269. package/dist/utils/paginationDataUtils.js.map +1 -0
  270. package/dist/utils/urlUtils.d.ts +2 -0
  271. package/dist/utils/urlUtils.js +20 -0
  272. package/dist/utils/urlUtils.js.map +1 -0
  273. package/dist/utils/validationUtils.d.ts +3 -0
  274. package/dist/utils/validationUtils.js +22 -0
  275. package/dist/utils/validationUtils.js.map +1 -0
  276. package/package.json +63 -5
  277. package/views/authDetails.hbs +97 -0
  278. package/views/partials/errorBody.hbs +7 -0
  279. package/views/partials/errorTitle.hbs +1 -0
  280. package/views/partials/successBody.hbs +2 -0
  281. package/views/partials/successTitle.hbs +1 -0
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
1
+ # Core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ This package contains all the shared elements for all the extensions within this repository.
@@ -0,0 +1,8 @@
1
+ import { AnalyticsEvent } from '@todoist/integrations-common';
2
+ export declare const launchedEvent: AnalyticsEvent;
3
+ export declare const launchedNotAuthenticated: AnalyticsEvent;
4
+ export declare const loggedOutEvent: AnalyticsEvent;
5
+ export declare const authenticatedEvent: AnalyticsEvent;
6
+ export declare const profileEvent: AnalyticsEvent;
7
+ export declare const settingsOpenedEvent: AnalyticsEvent;
8
+ export declare const settingsSavedEvent: AnalyticsEvent;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.settingsSavedEvent = exports.settingsOpenedEvent = exports.profileEvent = exports.authenticatedEvent = exports.loggedOutEvent = exports.launchedNotAuthenticated = exports.launchedEvent = void 0;
4
+ const integrations_common_1 = require("@todoist/integrations-common");
5
+ exports.launchedEvent = integrations_common_1.eventsFactory.opened();
6
+ exports.launchedNotAuthenticated = integrations_common_1.eventsFactory.unauthenticated();
7
+ exports.loggedOutEvent = integrations_common_1.eventsFactory.deauthorized();
8
+ exports.authenticatedEvent = integrations_common_1.eventsFactory.authenticated();
9
+ exports.profileEvent = integrations_common_1.eventsFactory.navigate('profile');
10
+ exports.settingsOpenedEvent = integrations_common_1.eventsFactory.navigate('settings');
11
+ exports.settingsSavedEvent = {
12
+ category: 'interactions',
13
+ action: 'settings_saved',
14
+ };
15
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/analytics/events.ts"],"names":[],"mappings":";;;AAAA,sEAA4E;AAK/D,QAAA,aAAa,GAAG,mCAAa,CAAC,MAAM,EAAE,CAAA;AAKtC,QAAA,wBAAwB,GAAG,mCAAa,CAAC,eAAe,EAAE,CAAA;AAK1D,QAAA,cAAc,GAAG,mCAAa,CAAC,YAAY,EAAE,CAAA;AAK7C,QAAA,kBAAkB,GAAG,mCAAa,CAAC,aAAa,EAAE,CAAA;AAKlD,QAAA,YAAY,GAAG,mCAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;AAKhD,QAAA,mBAAmB,GAAG,mCAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;AAKxD,QAAA,kBAAkB,GAAmB;IAC9C,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,gBAAgB;CAC3B,CAAA"}
@@ -0,0 +1 @@
1
+ export declare function cloneBuffer(buf: Buffer): Buffer;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cloneBuffer = cloneBuffer;
4
+ function cloneBuffer(buf) {
5
+ if (!Buffer.isBuffer(buf)) {
6
+ throw new Error('Can only clone Buffer.');
7
+ }
8
+ const copy = Buffer.alloc(buf.length);
9
+ buf.copy(copy);
10
+ return copy;
11
+ }
12
+ //# sourceMappingURL=cloneBuffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloneBuffer.js","sourceRoot":"","sources":["../../src/buffer/cloneBuffer.ts"],"names":[],"mappings":";;AAAA,kCAQC;AARD,SAAgB,WAAW,CAAC,GAAW;IACnC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACrC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACd,OAAO,IAAI,CAAA;AACf,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IncomingMessage } from 'node:http';
2
+ export declare class IncomingMessageWithRawBody extends IncomingMessage {
3
+ rawBody?: Buffer;
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IncomingMessageWithRawBody = void 0;
4
+ const node_http_1 = require("node:http");
5
+ class IncomingMessageWithRawBody extends node_http_1.IncomingMessage {
6
+ }
7
+ exports.IncomingMessageWithRawBody = IncomingMessageWithRawBody;
8
+ //# sourceMappingURL=incomingMessageWithRawBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incomingMessageWithRawBody.js","sourceRoot":"","sources":["../../src/buffer/incomingMessageWithRawBody.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAE3C,MAAa,0BAA2B,SAAQ,2BAAe;CAE9D;AAFD,gEAEC"}
@@ -0,0 +1,2 @@
1
+ export * from './cloneBuffer';
2
+ export * from './incomingMessageWithRawBody';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./cloneBuffer"), exports);
18
+ __exportStar(require("./incomingMessageWithRawBody"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/buffer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B;AAC7B,+DAA4C"}
@@ -0,0 +1,29 @@
1
+ import type { EncryptionOptions } from 'typeorm-encrypted';
2
+ type AnalyticsVersion = 'GA4' | 'UA';
3
+ type DatabaseConfiguration = {
4
+ host: string;
5
+ port: number;
6
+ username: string;
7
+ password: string;
8
+ database: string;
9
+ encryption: EncryptionOptions;
10
+ };
11
+ export type BaseConfiguration = {
12
+ port: number;
13
+ extensionVerificationTokens: string[];
14
+ baseUrl: string;
15
+ analyticsVersion?: AnalyticsVersion;
16
+ googleTrackingId?: string;
17
+ googleMeasurementId?: string;
18
+ googleAPISecret?: string;
19
+ sentryDsn?: string;
20
+ database?: DatabaseConfiguration;
21
+ feedbackSurveyUrl?: string;
22
+ additionalLogging?: string[];
23
+ };
24
+ export type ConfigurationOptions = {
25
+ requiresDatabase: boolean;
26
+ };
27
+ export declare function getBaseConfiguration(options?: ConfigurationOptions): BaseConfiguration;
28
+ export declare function getBaseConfigurationWithDatabase(): BaseConfiguration;
29
+ export {};
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBaseConfiguration = getBaseConfiguration;
4
+ exports.getBaseConfigurationWithDatabase = getBaseConfigurationWithDatabase;
5
+ const utils_1 = require("../utils");
6
+ const DEFAULT_ANALYTICS_VERSION = 'GA4';
7
+ function getBaseConfiguration(options) {
8
+ var _a;
9
+ const { PORT, VERIFICATION_TOKENS, BASE_URL, ANALYTICS_VERSION, GOOGLE_TRACKING_ID, GOOGLE_MEASUREMENT_ID, GOOGLE_API_SECRET, SENTRY_DSN, FEEDBACK_SURVEY_URL, ADDITIONAL_LOGGING, } = process.env;
10
+ const baseUrl = (0, utils_1.validateEnv)(BASE_URL, 'BASE_URL');
11
+ const extensionVerificationTokens = (0, utils_1.validateEnv)(VERIFICATION_TOKENS, 'VERIFICATION_TOKENS');
12
+ const analyticsVersion = (0, utils_1.validateEnvWithOptions)(ANALYTICS_VERSION, 'ANALYTICS_VERSION', [
13
+ 'UA',
14
+ 'GA4',
15
+ ]);
16
+ return {
17
+ port: !PORT ? 3000 : parseInt(PORT, 10),
18
+ extensionVerificationTokens: extensionVerificationTokens.split(','),
19
+ baseUrl,
20
+ analyticsVersion: (analyticsVersion !== null && analyticsVersion !== void 0 ? analyticsVersion : DEFAULT_ANALYTICS_VERSION),
21
+ googleTrackingId: GOOGLE_TRACKING_ID,
22
+ googleMeasurementId: GOOGLE_MEASUREMENT_ID,
23
+ googleAPISecret: GOOGLE_API_SECRET,
24
+ sentryDsn: SENTRY_DSN,
25
+ feedbackSurveyUrl: FEEDBACK_SURVEY_URL,
26
+ database: getDatabaseValues((_a = options === null || options === void 0 ? void 0 : options.requiresDatabase) !== null && _a !== void 0 ? _a : false),
27
+ additionalLogging: ADDITIONAL_LOGGING === null || ADDITIONAL_LOGGING === void 0 ? void 0 : ADDITIONAL_LOGGING.split(','),
28
+ };
29
+ }
30
+ function getBaseConfigurationWithDatabase() {
31
+ return getBaseConfiguration({ requiresDatabase: true });
32
+ }
33
+ function getDatabaseValues(requiresDatabase) {
34
+ if (!requiresDatabase)
35
+ return undefined;
36
+ const { DB_HOST, DB_NAME, DB_PASSWORD, DB_PORT, DB_USERNAME, DB_ENCRYPTION_KEY, DB_ENCRYPTION_ALGORITHM, DB_ENCRYPTION_IV_LENGTH, } = process.env;
37
+ const dbPort = (0, utils_1.validateEnv)(DB_PORT, 'DB_PORT');
38
+ const host = (0, utils_1.validateEnv)(DB_HOST, 'DB_HOST');
39
+ const username = (0, utils_1.validateEnv)(DB_USERNAME, 'DB_USERNAME');
40
+ const password = (0, utils_1.validateEnv)(DB_PASSWORD, 'DB_PASSWORD');
41
+ const database = (0, utils_1.validateEnv)(DB_NAME, 'DB_NAME');
42
+ const encryptionKey = (0, utils_1.validateEnv)(DB_ENCRYPTION_KEY, 'DB_ENCRYPTION_KEY');
43
+ const algorithm = (0, utils_1.validateEnv)(DB_ENCRYPTION_ALGORITHM, 'DB_ENCRYPTION_ALGORITHM');
44
+ const encryptionLength = (0, utils_1.validateEnv)(DB_ENCRYPTION_IV_LENGTH, 'DB_ENCRYPTION_IV_LENGTH');
45
+ return {
46
+ host,
47
+ port: parseInt(dbPort, 10),
48
+ username,
49
+ password,
50
+ database,
51
+ encryption: {
52
+ key: encryptionKey,
53
+ algorithm,
54
+ ivLength: Number(encryptionLength),
55
+ },
56
+ };
57
+ }
58
+ //# sourceMappingURL=configurationBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurationBase.js","sourceRoot":"","sources":["../../src/config/configurationBase.ts"],"names":[],"mappings":";;AAkCA,oDAkCC;AAED,4EAEC;AAvED,oCAA8D;AAE9D,MAAM,yBAAyB,GAAG,KAAK,CAAA;AA+BvC,SAAgB,oBAAoB,CAAC,OAA8B;;IAC/D,MAAM,EACF,IAAI,EACJ,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,GACrB,GAAG,OAAO,CAAC,GAAG,CAAA;IAEf,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;IACjD,MAAM,2BAA2B,GAAG,IAAA,mBAAW,EAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAA;IAC3F,MAAM,gBAAgB,GAAG,IAAA,8BAAsB,EAAC,iBAAiB,EAAE,mBAAmB,EAAE;QACpF,IAAI;QACJ,KAAK;KACR,CAAC,CAAA;IAEF,OAAO;QACH,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACvC,2BAA2B,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,CAAC;QACnE,OAAO;QACP,gBAAgB,EAAE,CAAC,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,yBAAyB,CAAqB;QACrF,gBAAgB,EAAE,kBAAkB;QACpC,mBAAmB,EAAE,qBAAqB;QAC1C,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,UAAU;QACrB,iBAAiB,EAAE,mBAAmB;QACtC,QAAQ,EAAE,iBAAiB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,mCAAI,KAAK,CAAC;QAC/D,iBAAiB,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,KAAK,CAAC,GAAG,CAAC;KACpD,CAAA;AACL,CAAC;AAED,SAAgB,gCAAgC;IAC5C,OAAO,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAA;AAC3D,CAAC;AAED,SAAS,iBAAiB,CAAC,gBAAyB;IAChD,IAAI,CAAC,gBAAgB;QAAE,OAAO,SAAS,CAAA;IAEvC,MAAM,EACF,OAAO,EACP,OAAO,EACP,WAAW,EACX,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,GAC1B,GAAG,OAAO,CAAC,GAAG,CAAA;IAEf,MAAM,MAAM,GAAG,IAAA,mBAAW,EAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAC9C,MAAM,IAAI,GAAG,IAAA,mBAAW,EAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,IAAA,mBAAW,EAAC,WAAW,EAAE,aAAa,CAAC,CAAA;IACxD,MAAM,QAAQ,GAAG,IAAA,mBAAW,EAAC,WAAW,EAAE,aAAa,CAAC,CAAA;IACxD,MAAM,QAAQ,GAAG,IAAA,mBAAW,EAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAChD,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAA;IACzE,MAAM,SAAS,GAAG,IAAA,mBAAW,EAAC,uBAAuB,EAAE,yBAAyB,CAAC,CAAA;IACjF,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAAC,uBAAuB,EAAE,yBAAyB,CAAC,CAAA;IACxF,OAAO;QACH,IAAI;QACJ,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1B,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,UAAU,EAAE;YACR,GAAG,EAAE,aAAa;YAClB,SAAS;YACT,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC;SACrC;KACJ,CAAA;AACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare enum CardActions {
2
+ Continue = "Action.Continue",
3
+ LogOut = "Action.Logout",
4
+ GoHome = "Action.GoHome",
5
+ Retry = "Action.Retry",
6
+ Next = "Action.Next",
7
+ Previous = "Action.Previous",
8
+ Settings = "Action.Settings",
9
+ Close = "Action.Close",
10
+ CopySupportInfo = "Action.CopySupportInfo",
11
+ Confirm = "Action.Confirm"
12
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CardActions = void 0;
4
+ var CardActions;
5
+ (function (CardActions) {
6
+ CardActions["Continue"] = "Action.Continue";
7
+ CardActions["LogOut"] = "Action.Logout";
8
+ CardActions["GoHome"] = "Action.GoHome";
9
+ CardActions["Retry"] = "Action.Retry";
10
+ CardActions["Next"] = "Action.Next";
11
+ CardActions["Previous"] = "Action.Previous";
12
+ CardActions["Settings"] = "Action.Settings";
13
+ CardActions["Close"] = "Action.Close";
14
+ CardActions["CopySupportInfo"] = "Action.CopySupportInfo";
15
+ CardActions["Confirm"] = "Action.Confirm";
16
+ })(CardActions || (exports.CardActions = CardActions = {}));
17
+ //# sourceMappingURL=card-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-actions.js","sourceRoot":"","sources":["../../src/constants/card-actions.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAWX;AAXD,WAAY,WAAW;IACnB,2CAA4B,CAAA;IAC5B,uCAAwB,CAAA;IACxB,uCAAwB,CAAA;IACxB,qCAAsB,CAAA;IACtB,mCAAoB,CAAA;IACpB,2CAA4B,CAAA;IAC5B,2CAA4B,CAAA;IAC5B,qCAAsB,CAAA;IACtB,yDAA0C,CAAA;IAC1C,yCAA0B,CAAA;AAC9B,CAAC,EAXW,WAAW,2BAAX,WAAW,QAWtB"}
@@ -0,0 +1,61 @@
1
+ export declare enum Core {
2
+ ADD_CONVERSATION_PARTICIPANTS = "Add conversation participants",
3
+ ADD_THREAD_PARTICIPANTS = "Add thread participants",
4
+ BACK = "Go back",
5
+ CANCEL = "Cancel",
6
+ CLOSE = "Close",
7
+ CONFIRM = "Confirm",
8
+ CONTACT_US = "Contact us",
9
+ CONTINUE = "Continue after login",
10
+ COPY_SUPPORT_INFORMATION = "Copy support information",
11
+ CREATE_BUTTON = "Create",
12
+ CREATE_MEETING = "Create meeting",
13
+ SCHEDULE_BUTTON = "Schedule",
14
+ DATE_LABEL = "Date",
15
+ DONE = "Done",
16
+ EDIT_TITLE = "Edit",
17
+ ERROR_BODY = "Something went wrong",
18
+ ERROR_CONTENT = "Unfortunately, it looks like something went wrong.",
19
+ ERROR_TITLE = "Something went wrong",
20
+ GO_BACK = "Go back",
21
+ GO_BACK_TO_APP = "Go back to {0} and Continue.",
22
+ JOIN_MEETING_TITLE = "Join meeting",
23
+ LAUNCH_TITLE = "Join",
24
+ LEARN_MORE = "Learn more",
25
+ LOGOUT = "Log out",
26
+ LOG_IN_BUTTON = "Log in",
27
+ MEETING_SCHEDULED = "Your meeting has been scheduled.",
28
+ MEETING_CREATED = "Your meeting has been created.",
29
+ MEETING_NAME = "Meeting name",
30
+ NAME_LABEL = "Name",
31
+ NEW_MEETING_BUTTON = "Schedule",
32
+ NEW_MEETING_TITLE = "Schedule meeting",
33
+ NEXT_RESULTS = "Load more",
34
+ NO_MEETINGS = "You don\u2019t have any meetings scheduled.",
35
+ PROFILE_TITLE = "View account details",
36
+ REQUIRED_ERROR = "This is required",
37
+ RETRY = "Retry",
38
+ SETTINGS_TITLE = "View Settings",
39
+ FEEDBACK_TITLE = "Share feedback about this integration",
40
+ SAVE_TITLE = "Save",
41
+ SHARE_TITLE = "Share",
42
+ SHARE_TO_TWIST = "Share to Twist",
43
+ SHOW_MEETINGS = "Show meetings",
44
+ SUCCESS = "Success!",
45
+ TIME_LABEL = "Time",
46
+ TODAY = "Today",
47
+ TOMORROW = "Tomorrow",
48
+ TOPIC_LABEL = "Topic",
49
+ UNAUTHORIZED = "Unfortunately, something has gone wrong accessing your data, please try signing in again.",
50
+ VIEW = "View",
51
+ SIGNATURE_TITLE = "Signature",
52
+ SIGNATURE_ON = "Include a signature to help your team discover this integration.",
53
+ SIGNATURE_OFF = "Don't include a signature.",
54
+ YES = "Yes",
55
+ AUTHENTICATE = "Authenticate",
56
+ ALREADY_DONE = "Already done",
57
+ CANNOT_ACCESS_EXTENSION = "Sorry, you can\u2019t access this extension.",
58
+ PRO_USERS_ONLY = "This extension is available to Pro users only.",
59
+ UPGRADE_TO_PRO = "Upgrade to Pro",
60
+ PRICING_URL = "https://{0}.com/pricing"
61
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Core = void 0;
4
+ var Core;
5
+ (function (Core) {
6
+ Core["ADD_CONVERSATION_PARTICIPANTS"] = "Add conversation participants";
7
+ Core["ADD_THREAD_PARTICIPANTS"] = "Add thread participants";
8
+ Core["BACK"] = "Go back";
9
+ Core["CANCEL"] = "Cancel";
10
+ Core["CLOSE"] = "Close";
11
+ Core["CONFIRM"] = "Confirm";
12
+ Core["CONTACT_US"] = "Contact us";
13
+ Core["CONTINUE"] = "Continue after login";
14
+ Core["COPY_SUPPORT_INFORMATION"] = "Copy support information";
15
+ Core["CREATE_BUTTON"] = "Create";
16
+ Core["CREATE_MEETING"] = "Create meeting";
17
+ Core["SCHEDULE_BUTTON"] = "Schedule";
18
+ Core["DATE_LABEL"] = "Date";
19
+ Core["DONE"] = "Done";
20
+ Core["EDIT_TITLE"] = "Edit";
21
+ Core["ERROR_BODY"] = "Something went wrong";
22
+ Core["ERROR_CONTENT"] = "Unfortunately, it looks like something went wrong.";
23
+ Core["ERROR_TITLE"] = "Something went wrong";
24
+ Core["GO_BACK"] = "Go back";
25
+ Core["GO_BACK_TO_APP"] = "Go back to {0} and Continue.";
26
+ Core["JOIN_MEETING_TITLE"] = "Join meeting";
27
+ Core["LAUNCH_TITLE"] = "Join";
28
+ Core["LEARN_MORE"] = "Learn more";
29
+ Core["LOGOUT"] = "Log out";
30
+ Core["LOG_IN_BUTTON"] = "Log in";
31
+ Core["MEETING_SCHEDULED"] = "Your meeting has been scheduled.";
32
+ Core["MEETING_CREATED"] = "Your meeting has been created.";
33
+ Core["MEETING_NAME"] = "Meeting name";
34
+ Core["NAME_LABEL"] = "Name";
35
+ Core["NEW_MEETING_BUTTON"] = "Schedule";
36
+ Core["NEW_MEETING_TITLE"] = "Schedule meeting";
37
+ Core["NEXT_RESULTS"] = "Load more";
38
+ Core["NO_MEETINGS"] = "You don\u2019t have any meetings scheduled.";
39
+ Core["PROFILE_TITLE"] = "View account details";
40
+ Core["REQUIRED_ERROR"] = "This is required";
41
+ Core["RETRY"] = "Retry";
42
+ Core["SETTINGS_TITLE"] = "View Settings";
43
+ Core["FEEDBACK_TITLE"] = "Share feedback about this integration";
44
+ Core["SAVE_TITLE"] = "Save";
45
+ Core["SHARE_TITLE"] = "Share";
46
+ Core["SHARE_TO_TWIST"] = "Share to Twist";
47
+ Core["SHOW_MEETINGS"] = "Show meetings";
48
+ Core["SUCCESS"] = "Success!";
49
+ Core["TIME_LABEL"] = "Time";
50
+ Core["TODAY"] = "Today";
51
+ Core["TOMORROW"] = "Tomorrow";
52
+ Core["TOPIC_LABEL"] = "Topic";
53
+ Core["UNAUTHORIZED"] = "Unfortunately, something has gone wrong accessing your data, please try signing in again.";
54
+ Core["VIEW"] = "View";
55
+ Core["SIGNATURE_TITLE"] = "Signature";
56
+ Core["SIGNATURE_ON"] = "Include a signature to help your team discover this integration.";
57
+ Core["SIGNATURE_OFF"] = "Don't include a signature.";
58
+ Core["YES"] = "Yes";
59
+ Core["AUTHENTICATE"] = "Authenticate";
60
+ Core["ALREADY_DONE"] = "Already done";
61
+ Core["CANNOT_ACCESS_EXTENSION"] = "Sorry, you can\u2019t access this extension.";
62
+ Core["PRO_USERS_ONLY"] = "This extension is available to Pro users only.";
63
+ Core["UPGRADE_TO_PRO"] = "Upgrade to Pro";
64
+ Core["PRICING_URL"] = "https://{0}.com/pricing";
65
+ })(Core || (exports.Core = Core = {}));
66
+ //# sourceMappingURL=core-strings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-strings.js","sourceRoot":"","sources":["../../src/constants/core-strings.ts"],"names":[],"mappings":";;;AAAA,IAAY,IA4DX;AA5DD,WAAY,IAAI;IACZ,uEAA+D,CAAA;IAC/D,2DAAmD,CAAA;IACnD,wBAAgB,CAAA;IAChB,yBAAiB,CAAA;IACjB,uBAAe,CAAA;IACf,2BAAmB,CAAA;IACnB,iCAAyB,CAAA;IACzB,yCAAiC,CAAA;IACjC,6DAAqD,CAAA;IACrD,gCAAwB,CAAA;IACxB,yCAAiC,CAAA;IACjC,oCAA4B,CAAA;IAC5B,2BAAmB,CAAA;IACnB,qBAAa,CAAA;IACb,2BAAmB,CAAA;IACnB,2CAAmC,CAAA;IACnC,4EAAoE,CAAA;IACpE,4CAAoC,CAAA;IACpC,2BAAmB,CAAA;IACnB,uDAA+C,CAAA;IAC/C,2CAAmC,CAAA;IACnC,6BAAqB,CAAA;IACrB,iCAAyB,CAAA;IACzB,0BAAkB,CAAA;IAClB,gCAAwB,CAAA;IACxB,8DAAsD,CAAA;IACtD,0DAAkD,CAAA;IAClD,qCAA6B,CAAA;IAC7B,2BAAmB,CAAA;IACnB,uCAA+B,CAAA;IAC/B,8CAAsC,CAAA;IACtC,kCAA0B,CAAA;IAC1B,mEAAsD,CAAA;IACtD,8CAAsC,CAAA;IACtC,2CAAmC,CAAA;IACnC,uBAAe,CAAA;IACf,wCAAgC,CAAA;IAChC,gEAAwD,CAAA;IACxD,2BAAmB,CAAA;IACnB,6BAAqB,CAAA;IACrB,yCAAiC,CAAA;IACjC,uCAA+B,CAAA;IAC/B,4BAAoB,CAAA;IACpB,2BAAmB,CAAA;IACnB,uBAAe,CAAA;IACf,6BAAqB,CAAA;IACrB,6BAAqB,CAAA;IACrB,kHAA0G,CAAA;IAC1G,qBAAa,CAAA;IACb,qCAA6B,CAAA;IAC7B,yFAAiF,CAAA;IACjF,oDAA4C,CAAA;IAC5C,mBAAW,CAAA;IACX,qCAA6B,CAAA;IAC7B,qCAA6B,CAAA;IAC7B,gFAAmE,CAAA;IACnE,yEAAiE,CAAA;IACjE,yCAAiC,CAAA;IACjC,+CAAuC,CAAA;AAC3C,CAAC,EA5DW,IAAI,oBAAJ,IAAI,QA4Df"}
@@ -0,0 +1,25 @@
1
+ export declare const IMAGES_PATH = "/images";
2
+ export declare const SHARED_IMAGES_PATH = "/images/shared";
3
+ export declare const BACK_IMAGE = "/images/shared/Back-{0}.png";
4
+ export declare const CHECK_IMAGE = "/images/shared/Check-{0}.png";
5
+ export declare const CLOSE_IMAGE = "/images/shared/Close-{0}.png";
6
+ export declare const DELETE_IMAGE = "/images/shared/delete-{0}.png";
7
+ export declare const EDIT_IMAGE = "/images/shared/edit-{0}.png";
8
+ export declare const ERROR_IMAGE = "/images/shared/not-found-{0}.png";
9
+ export declare const OPEN_IMAGE = "/images/shared/Link-{0}.png";
10
+ export declare const PLUS_ACCENT_IMAGE = "/images/shared/Plus-accent-{0}.png";
11
+ export declare const PLUS_IMAGE = "/images/shared/Plus-{0}.png";
12
+ export declare const PROFILE_IMAGE = "/images/shared/Person-{0}.png";
13
+ export declare const QUESTION_IMAGE = "/images/shared/question-{0}.png";
14
+ export declare const SEARCH_IMAGE = "/images/shared/Search-{0}.png";
15
+ export declare const SETTINGS_IMAGE = "/images/shared/Settings-{0}.png";
16
+ export declare const FEEDBACK_IMAGE = "/images/shared/Feedback-{0}.png";
17
+ export declare const SHARE_IMAGE = "/images/shared/Share-{0}.png";
18
+ export declare const SPACING_IMAGE = "/images/shared/Spacing.png";
19
+ export declare const VIEW_IMAGE = "/images/shared/view-{0}.png";
20
+ export declare const VIEW_ACCENT_IMAGE = "/images/shared/view-accent-{0}.png";
21
+ export declare const PRO_ONLY_IMAGE = "/images/shared/Pro-only-{0}.png";
22
+ export declare const RETRY_IMAGE = "/images/shared/Retry-{0}.png";
23
+ export declare const NO_RESULTS_IMAGE = "/images/shared/No-results-{0}.png";
24
+ export declare const TASK_ICON_IMAGE = "/images/shared/Task-icon-{0}.png";
25
+ export declare const LIGHTBULB_IMAGE = "/images/shared/Lightbulb-{0}.png";
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LIGHTBULB_IMAGE = exports.TASK_ICON_IMAGE = exports.NO_RESULTS_IMAGE = exports.RETRY_IMAGE = exports.PRO_ONLY_IMAGE = exports.VIEW_ACCENT_IMAGE = exports.VIEW_IMAGE = exports.SPACING_IMAGE = exports.SHARE_IMAGE = exports.FEEDBACK_IMAGE = exports.SETTINGS_IMAGE = exports.SEARCH_IMAGE = exports.QUESTION_IMAGE = exports.PROFILE_IMAGE = exports.PLUS_IMAGE = exports.PLUS_ACCENT_IMAGE = exports.OPEN_IMAGE = exports.ERROR_IMAGE = exports.EDIT_IMAGE = exports.DELETE_IMAGE = exports.CLOSE_IMAGE = exports.CHECK_IMAGE = exports.BACK_IMAGE = exports.SHARED_IMAGES_PATH = exports.IMAGES_PATH = void 0;
4
+ exports.IMAGES_PATH = '/images';
5
+ exports.SHARED_IMAGES_PATH = `${exports.IMAGES_PATH}/shared`;
6
+ exports.BACK_IMAGE = `${exports.SHARED_IMAGES_PATH}/Back-{0}.png`;
7
+ exports.CHECK_IMAGE = `${exports.SHARED_IMAGES_PATH}/Check-{0}.png`;
8
+ exports.CLOSE_IMAGE = `${exports.SHARED_IMAGES_PATH}/Close-{0}.png`;
9
+ exports.DELETE_IMAGE = `${exports.SHARED_IMAGES_PATH}/delete-{0}.png`;
10
+ exports.EDIT_IMAGE = `${exports.SHARED_IMAGES_PATH}/edit-{0}.png`;
11
+ exports.ERROR_IMAGE = `${exports.SHARED_IMAGES_PATH}/not-found-{0}.png`;
12
+ exports.OPEN_IMAGE = `${exports.SHARED_IMAGES_PATH}/Link-{0}.png`;
13
+ exports.PLUS_ACCENT_IMAGE = `${exports.SHARED_IMAGES_PATH}/Plus-accent-{0}.png`;
14
+ exports.PLUS_IMAGE = `${exports.SHARED_IMAGES_PATH}/Plus-{0}.png`;
15
+ exports.PROFILE_IMAGE = `${exports.SHARED_IMAGES_PATH}/Person-{0}.png`;
16
+ exports.QUESTION_IMAGE = `${exports.SHARED_IMAGES_PATH}/question-{0}.png`;
17
+ exports.SEARCH_IMAGE = `${exports.SHARED_IMAGES_PATH}/Search-{0}.png`;
18
+ exports.SETTINGS_IMAGE = `${exports.SHARED_IMAGES_PATH}/Settings-{0}.png`;
19
+ exports.FEEDBACK_IMAGE = `${exports.SHARED_IMAGES_PATH}/Feedback-{0}.png`;
20
+ exports.SHARE_IMAGE = `${exports.SHARED_IMAGES_PATH}/Share-{0}.png`;
21
+ exports.SPACING_IMAGE = `${exports.SHARED_IMAGES_PATH}/Spacing.png`;
22
+ exports.VIEW_IMAGE = `${exports.SHARED_IMAGES_PATH}/view-{0}.png`;
23
+ exports.VIEW_ACCENT_IMAGE = `${exports.SHARED_IMAGES_PATH}/view-accent-{0}.png`;
24
+ exports.PRO_ONLY_IMAGE = `${exports.SHARED_IMAGES_PATH}/Pro-only-{0}.png`;
25
+ exports.RETRY_IMAGE = `${exports.SHARED_IMAGES_PATH}/Retry-{0}.png`;
26
+ exports.NO_RESULTS_IMAGE = `${exports.SHARED_IMAGES_PATH}/No-results-{0}.png`;
27
+ exports.TASK_ICON_IMAGE = `${exports.SHARED_IMAGES_PATH}/Task-icon-{0}.png`;
28
+ exports.LIGHTBULB_IMAGE = `${exports.SHARED_IMAGES_PATH}/Lightbulb-{0}.png`;
29
+ //# sourceMappingURL=images.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.js","sourceRoot":"","sources":["../../src/constants/images.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,SAAS,CAAA;AAEvB,QAAA,kBAAkB,GAAG,GAAG,mBAAW,SAAS,CAAA;AAE5C,QAAA,UAAU,GAAG,GAAG,0BAAkB,eAAe,CAAA;AACjD,QAAA,WAAW,GAAG,GAAG,0BAAkB,gBAAgB,CAAA;AACnD,QAAA,WAAW,GAAG,GAAG,0BAAkB,gBAAgB,CAAA;AACnD,QAAA,YAAY,GAAG,GAAG,0BAAkB,iBAAiB,CAAA;AACrD,QAAA,UAAU,GAAG,GAAG,0BAAkB,eAAe,CAAA;AACjD,QAAA,WAAW,GAAG,GAAG,0BAAkB,oBAAoB,CAAA;AACvD,QAAA,UAAU,GAAG,GAAG,0BAAkB,eAAe,CAAA;AACjD,QAAA,iBAAiB,GAAG,GAAG,0BAAkB,sBAAsB,CAAA;AAC/D,QAAA,UAAU,GAAG,GAAG,0BAAkB,eAAe,CAAA;AACjD,QAAA,aAAa,GAAG,GAAG,0BAAkB,iBAAiB,CAAA;AACtD,QAAA,cAAc,GAAG,GAAG,0BAAkB,mBAAmB,CAAA;AACzD,QAAA,YAAY,GAAG,GAAG,0BAAkB,iBAAiB,CAAA;AACrD,QAAA,cAAc,GAAG,GAAG,0BAAkB,mBAAmB,CAAA;AACzD,QAAA,cAAc,GAAG,GAAG,0BAAkB,mBAAmB,CAAA;AACzD,QAAA,WAAW,GAAG,GAAG,0BAAkB,gBAAgB,CAAA;AACnD,QAAA,aAAa,GAAG,GAAG,0BAAkB,cAAc,CAAA;AACnD,QAAA,UAAU,GAAG,GAAG,0BAAkB,eAAe,CAAA;AACjD,QAAA,iBAAiB,GAAG,GAAG,0BAAkB,sBAAsB,CAAA;AAC/D,QAAA,cAAc,GAAG,GAAG,0BAAkB,mBAAmB,CAAA;AACzD,QAAA,WAAW,GAAG,GAAG,0BAAkB,gBAAgB,CAAA;AACnD,QAAA,gBAAgB,GAAG,GAAG,0BAAkB,qBAAqB,CAAA;AAC7D,QAAA,eAAe,GAAG,GAAG,0BAAkB,oBAAoB,CAAA;AAC3D,QAAA,eAAe,GAAG,GAAG,0BAAkB,oBAAoB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './card-actions';
2
+ export * from './core-strings';
3
+ export * from './images';
4
+ export * from './ui-constants';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./card-actions"), exports);
18
+ __exportStar(require("./core-strings"), exports);
19
+ __exportStar(require("./images"), exports);
20
+ __exportStar(require("./ui-constants"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,iDAA8B;AAC9B,2CAAwB;AACxB,iDAA8B"}
@@ -0,0 +1 @@
1
+ export declare const ICON_SIZE = 24;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ICON_SIZE = void 0;
4
+ exports.ICON_SIZE = 24;
5
+ //# sourceMappingURL=ui-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-constants.js","sourceRoot":"","sources":["../../src/constants/ui-constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,EAAE,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { TodoistCardRequest, TodoistCardResponse } from '@todoist/ui-extensions-core';
2
+ import { ActionsService, AnalyticsService, ThemeService } from '../services';
3
+ import { AppTokenService } from '../services/app-token.service';
4
+ import type { AppAuthToken } from '../types';
5
+ export declare class AppController {
6
+ protected readonly analyticsService: AnalyticsService;
7
+ protected readonly themeService: ThemeService;
8
+ protected readonly actionsService: ActionsService;
9
+ protected readonly appTokenService: AppTokenService;
10
+ constructor(analyticsService: AnalyticsService, themeService: ThemeService, actionsService: ActionsService, appTokenService: AppTokenService);
11
+ private readonly logger;
12
+ process(request: TodoistCardRequest, appToken: AppAuthToken): Promise<TodoistCardResponse>;
13
+ settings(request: TodoistCardRequest, appToken: AppAuthToken): Promise<TodoistCardResponse>;
14
+ protected processRequest(request: TodoistCardRequest, appToken: AppAuthToken): Promise<TodoistCardResponse>;
15
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var AppController_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AppController = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const decorators_1 = require("../decorators");
19
+ const extensionVerification_guard_1 = require("../guards/extensionVerification.guard");
20
+ const services_1 = require("../services");
21
+ const app_token_service_1 = require("../services/app-token.service");
22
+ const utils_1 = require("../utils");
23
+ let AppController = AppController_1 = class AppController {
24
+ constructor(analyticsService, themeService, actionsService, appTokenService) {
25
+ this.analyticsService = analyticsService;
26
+ this.themeService = themeService;
27
+ this.actionsService = actionsService;
28
+ this.appTokenService = appTokenService;
29
+ this.logger = new utils_1.Logger(AppController_1.name, 'REQUEST_DEBUG');
30
+ }
31
+ process(request, appToken) {
32
+ this.logger.log({
33
+ endpoint: '/process',
34
+ request,
35
+ appToken,
36
+ });
37
+ return this.processRequest(request, appToken);
38
+ }
39
+ settings(request, appToken) {
40
+ return this.processRequest(request, appToken);
41
+ }
42
+ async processRequest(request, appToken) {
43
+ this.analyticsService.setUserId((0, utils_1.getUserId)(request.context));
44
+ this.themeService.theme = request.context.theme;
45
+ this.appTokenService.appToken = appToken;
46
+ return this.actionsService.processRequest(request);
47
+ }
48
+ };
49
+ exports.AppController = AppController;
50
+ __decorate([
51
+ (0, common_1.Post)((0, utils_1.useEndpoint)('process')),
52
+ (0, common_1.HttpCode)(200),
53
+ __param(0, (0, common_1.Body)()),
54
+ __param(1, (0, decorators_1.AppToken)()),
55
+ __metadata("design:type", Function),
56
+ __metadata("design:paramtypes", [Object, String]),
57
+ __metadata("design:returntype", Promise)
58
+ ], AppController.prototype, "process", null);
59
+ __decorate([
60
+ (0, common_1.Post)((0, utils_1.useEndpoint)('settings')),
61
+ (0, common_1.HttpCode)(200),
62
+ __param(0, (0, common_1.Body)()),
63
+ __param(1, (0, decorators_1.AppToken)()),
64
+ __metadata("design:type", Function),
65
+ __metadata("design:paramtypes", [Object, String]),
66
+ __metadata("design:returntype", Promise)
67
+ ], AppController.prototype, "settings", null);
68
+ exports.AppController = AppController = AppController_1 = __decorate([
69
+ (0, common_1.UseGuards)(extensionVerification_guard_1.ExtensionVerificationGuard),
70
+ (0, common_1.Controller)(),
71
+ __metadata("design:paramtypes", [services_1.AnalyticsService,
72
+ services_1.ThemeService,
73
+ services_1.ActionsService,
74
+ app_token_service_1.AppTokenService])
75
+ ], AppController);
76
+ //# sourceMappingURL=app.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../src/controllers/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4E;AAE5E,8CAAwC;AACxC,uFAAkF;AAClF,0CAA4E;AAC5E,qEAA+D;AAE/D,oCAAyD;AAIlD,IAAM,aAAa,qBAAnB,MAAM,aAAa;IACtB,YACuB,gBAAkC,EAClC,YAA0B,EAC1B,cAA8B,EAC9B,eAAgC;QAHhC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,oBAAe,GAAf,eAAe,CAAiB;QAEtC,WAAM,GAAG,IAAI,cAAM,CAAC,eAAa,CAAC,IAAI,EAAE,eAAe,CAAC,CAAA;IADtE,CAAC;IAKJ,OAAO,CACK,OAA2B,EACvB,QAAsB;QAElC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;YACZ,QAAQ,EAAE,UAAU;YACpB,OAAO;YACP,QAAQ;SACX,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACjD,CAAC;IAID,QAAQ,CACI,OAA2B,EACvB,QAAsB;QAElC,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACjD,CAAC;IAES,KAAK,CAAC,cAAc,CAC1B,OAA2B,EAC3B,QAAsB;QAEtB,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAA,iBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;QAC3D,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAA;QAC/C,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAExC,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;IACtD,CAAC;CACJ,CAAA;AA1CY,sCAAa;AAWtB;IAFC,IAAA,aAAI,EAAC,IAAA,mBAAW,EAAC,SAAS,CAAC,CAAC;IAC5B,IAAA,iBAAQ,EAAC,GAAG,CAAC;IAET,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,qBAAQ,GAAE,CAAA;;;;4CAQd;AAID;IAFC,IAAA,aAAI,EAAC,IAAA,mBAAW,EAAC,UAAU,CAAC,CAAC;IAC7B,IAAA,iBAAQ,EAAC,GAAG,CAAC;IAET,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,qBAAQ,GAAE,CAAA;;;;6CAGd;wBA9BQ,aAAa;IAFzB,IAAA,kBAAS,EAAC,wDAA0B,CAAC;IACrC,IAAA,mBAAU,GAAE;qCAGgC,2BAAgB;QACpB,uBAAY;QACV,yBAAc;QACb,mCAAe;GAL9C,aAAa,CA0CzB"}
@@ -0,0 +1,47 @@
1
+ import type { Response } from 'express';
2
+ import type { User } from '../entities';
3
+ import { AnalyticsService, AuthenticationClient, StateService, TranslationService, UserDatabaseService } from '../services';
4
+ export type AuthModel = {
5
+ isSuccess: boolean;
6
+ imageSrc: string;
7
+ altText?: string;
8
+ helpCenterLink?: string;
9
+ returnToApp?: string;
10
+ debugLogs?: string[];
11
+ debugInfo?: {
12
+ debugEnabled: boolean;
13
+ logsRetrieved: number;
14
+ };
15
+ };
16
+ export type AuthStrings = Omit<AuthModel, 'isSuccess' | 'returnToApp' | 'debugLogs' | 'debugInfo'>;
17
+ export type DoistApp = 'Todoist' | 'Twist';
18
+ export declare class TokenValidator {
19
+ validateToken: (token: string) => Promise<boolean>;
20
+ failureRedirectUrl: string;
21
+ constructor(validateToken: (token: string) => Promise<boolean>, failureRedirectUrl: string);
22
+ }
23
+ export declare class AuthController {
24
+ private readonly stateService;
25
+ private readonly authClient;
26
+ private readonly dbService;
27
+ private readonly analyticsService;
28
+ private readonly translationService;
29
+ static SUCCESS: string;
30
+ static ERROR: string;
31
+ static APP_NAME: string;
32
+ static DEBUG: string;
33
+ private successStrings?;
34
+ private errorStrings?;
35
+ private appName;
36
+ private tokenValidation?;
37
+ private debug;
38
+ constructor(stateService: StateService, authClient: AuthenticationClient, dbService: UserDatabaseService<User>, analyticsService: AnalyticsService, translationService: TranslationService);
39
+ private readonly logger;
40
+ getSuccessStrings(): AuthStrings;
41
+ getErrorStrings(): AuthStrings;
42
+ private addDebugLog;
43
+ auth(code: string, state: string, res: Response): Promise<void>;
44
+ success(encodedDebugLogs?: string): AuthModel;
45
+ error(encodedDebugLogs?: string): AuthModel;
46
+ private displayError;
47
+ }