@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
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NEXT_ACTIONSET_ID = void 0;
4
+ exports.createSignOutButton = createSignOutButton;
5
+ exports.createCloseButton = createCloseButton;
6
+ exports.createPlusButton = createPlusButton;
7
+ exports.createSettingsButton = createSettingsButton;
8
+ exports.createFeedbackButton = createFeedbackButton;
9
+ exports.createShareButton = createShareButton;
10
+ exports.createEditButton = createEditButton;
11
+ exports.createOpenButton = createOpenButton;
12
+ exports.createLearnMoreButton = createLearnMoreButton;
13
+ exports.createNewItemButton = createNewItemButton;
14
+ exports.createNextButton = createNextButton;
15
+ exports.createLoadMoreButton = createLoadMoreButton;
16
+ const ui_extensions_core_1 = require("@todoist/ui-extensions-core");
17
+ const __1 = require("..");
18
+ const constants_1 = require("../constants");
19
+ const _1 = require(".");
20
+ exports.NEXT_ACTIONSET_ID = 'NextActions';
21
+ function createSignOutButton(context, options) {
22
+ const { horizontalAlignment = 'right' } = options || {};
23
+ const signOutContainer = (0, ui_extensions_core_1.createTextButton)({
24
+ horizontalAlignment,
25
+ id: constants_1.CardActions.LogOut,
26
+ text: context.translationService.getTranslation(constants_1.Core.LOGOUT),
27
+ color: 'attention',
28
+ });
29
+ return signOutContainer;
30
+ }
31
+ function createCloseButton(context) {
32
+ return (0, _1.createIconImage)(context, {
33
+ imagePath: constants_1.CLOSE_IMAGE,
34
+ altText: context.translationService.getTranslation(constants_1.Core.CLOSE),
35
+ selectAction: (0, __1.createButtonSubmitAction)({ id: constants_1.CardActions.Close }),
36
+ });
37
+ }
38
+ function createPlusButton(context, id, data, title) {
39
+ return (0, _1.createIconImage)(context, {
40
+ imagePath: constants_1.PLUS_IMAGE,
41
+ altText: title !== null && title !== void 0 ? title : context.translationService.getTranslation(constants_1.Core.NEW_MEETING_TITLE),
42
+ selectAction: (0, __1.createButtonSubmitAction)({ id, data }),
43
+ });
44
+ }
45
+ function createSettingsButton(context, data) {
46
+ return (0, _1.createIconImage)(context, {
47
+ imagePath: constants_1.SETTINGS_IMAGE,
48
+ altText: context.translationService.getTranslation(constants_1.Core.SETTINGS_TITLE),
49
+ selectAction: (0, __1.createButtonSubmitAction)({ id: constants_1.CardActions.Settings, data }),
50
+ });
51
+ }
52
+ function createFeedbackButton(context, targetUrl) {
53
+ const button = new ui_extensions_core_1.OpenUrlAction();
54
+ button.url = targetUrl;
55
+ return (0, _1.createIconImage)(context, {
56
+ imagePath: constants_1.FEEDBACK_IMAGE,
57
+ altText: context.translationService.getTranslation(constants_1.Core.FEEDBACK_TITLE),
58
+ selectAction: button,
59
+ });
60
+ }
61
+ function createShareButton(context, id, data, title, textColor, isSubtle, imagePath) {
62
+ const shareButton = new ui_extensions_core_1.SubmitAction();
63
+ shareButton.id = id;
64
+ shareButton.data = data();
65
+ return (0, ui_extensions_core_1.createIconButton)({
66
+ action: shareButton,
67
+ buttonText: context.translationService.getTranslation(title !== null && title !== void 0 ? title : constants_1.Core.SHARE_TITLE),
68
+ iconUrl: context.createThemeBasedUrl(imagePath !== null && imagePath !== void 0 ? imagePath : constants_1.SHARE_IMAGE),
69
+ textColor,
70
+ isSubtle,
71
+ });
72
+ }
73
+ function createEditButton(context, request) {
74
+ const { id, data } = request;
75
+ const editButton = new ui_extensions_core_1.SubmitAction();
76
+ editButton.id = id;
77
+ editButton.data = data === null || data === void 0 ? void 0 : data();
78
+ return (0, ui_extensions_core_1.createIconButton)({
79
+ action: editButton,
80
+ buttonText: context.translationService.getTranslation(constants_1.Core.EDIT_TITLE),
81
+ iconUrl: context.createThemeBasedUrl(constants_1.EDIT_IMAGE),
82
+ });
83
+ }
84
+ function createOpenButton(context, url) {
85
+ const launchButton = new ui_extensions_core_1.OpenUrlAction();
86
+ launchButton.url = url;
87
+ return (0, ui_extensions_core_1.createIconButton)({
88
+ action: launchButton,
89
+ buttonText: context.translationService.getTranslation(constants_1.Core.LAUNCH_TITLE),
90
+ iconUrl: context.createThemeBasedUrl(constants_1.OPEN_IMAGE),
91
+ });
92
+ }
93
+ function createLearnMoreButton(context, url) {
94
+ const launchButton = new ui_extensions_core_1.OpenUrlAction();
95
+ launchButton.url = url;
96
+ return (0, ui_extensions_core_1.createIconButton)({
97
+ action: launchButton,
98
+ buttonText: context.translationService.getTranslation(constants_1.Core.LEARN_MORE),
99
+ iconUrl: context.createThemeBasedUrl(constants_1.QUESTION_IMAGE),
100
+ textColor: 'default',
101
+ isSubtle: true,
102
+ });
103
+ }
104
+ function createNewItemButton(context, id, newItemData, title) {
105
+ const newItemButton = new ui_extensions_core_1.SubmitAction();
106
+ newItemButton.id = id;
107
+ newItemButton.style = 'positive';
108
+ newItemButton.data = newItemData === null || newItemData === void 0 ? void 0 : newItemData();
109
+ return (0, ui_extensions_core_1.createIconButton)({
110
+ action: newItemButton,
111
+ buttonText: context.translationService.getTranslation(title !== null && title !== void 0 ? title : constants_1.Core.NEW_MEETING_BUTTON),
112
+ iconUrl: context.createThemeBasedUrl(constants_1.PLUS_ACCENT_IMAGE),
113
+ textColor: 'accent',
114
+ });
115
+ }
116
+ function createNextButton(context, data) {
117
+ const actionButton = new ui_extensions_core_1.SubmitAction();
118
+ actionButton.id = constants_1.CardActions.Next;
119
+ actionButton.title = context.translationService.getTranslation(constants_1.Core.NEXT_RESULTS);
120
+ actionButton.data = data();
121
+ actionButton.style = 'positive';
122
+ return actionButton;
123
+ }
124
+ function createLoadMoreButton(context, data) {
125
+ const actions = new ui_extensions_core_1.ActionSet();
126
+ actions.id = exports.NEXT_ACTIONSET_ID;
127
+ actions.spacing = 'medium';
128
+ actions.addAction(createNextButton(context, data));
129
+ return actions;
130
+ }
131
+ //# sourceMappingURL=stock-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stock-button.js","sourceRoot":"","sources":["../../src/ui/stock-button.ts"],"names":[],"mappings":";;;AAmCA,kDAcC;AAED,8CAMC;AAED,4CAWC;AAED,oDASC;AAED,oDASC;AAED,8CAoBC;AAED,4CAiBC;AAED,4CASC;AAED,sDAWC;AAED,kDAkBC;AAED,4CAUC;AAED,oDAWC;AA1MD,oEAWoC;AACpC,0BAA6C;AAC7C,4CAYqB;AAErB,wBAAmC;AAMtB,QAAA,iBAAiB,GAAG,aAAa,CAAA;AAE9C,SAAgB,mBAAmB,CAC/B,OAAyB,EACzB,OAAsD;IAEtD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aAAa,CAAC,KAAK,GAAG,UAAU,CAAA;IAChC,aAAa,CAAC,IAAI,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,EAAI,CAAA;IAEpC,OAAO,IAAA,qCAAgB,EAAC;QACpB,MAAM,EAAE,aAAa;QACrB,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,gBAAI,CAAC,kBAAkB,CAAC;QACvF,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,6BAAiB,CAAC;QACvD,SAAS,EAAE,QAAQ;KACtB,CAAC,CAAA;AACN,CAAC;AAED,SAAgB,gBAAgB,CAC5B,OAAyB,EACzB,IAAmC;IAEnC,MAAM,YAAY,GAAG,IAAI,iCAAY,EAAE,CAAA;IACvC,YAAY,CAAC,EAAE,GAAG,uBAAW,CAAC,IAAI,CAAA;IAClC,YAAY,CAAC,KAAK,GAAG,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,gBAAI,CAAC,YAAY,CAAC,CAAA;IACjF,YAAY,CAAC,IAAI,GAAG,IAAI,EAAE,CAAA;IAC1B,YAAY,CAAC,KAAK,GAAG,UAAU,CAAA;IAC/B,OAAO,YAAY,CAAA;AACvB,CAAC;AAED,SAAgB,oBAAoB,CAChC,OAAyB,EACzB,IAAmC;IAEnC,MAAM,OAAO,GAAG,IAAI,8BAAS,EAAE,CAAA;IAC/B,OAAO,CAAC,EAAE,GAAG,yBAAiB,CAAA;IAC9B,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAA;IAE1B,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IAElD,OAAO,OAAO,CAAA;AAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { TextBlock } from '@todoist/ui-extensions-core';
2
+ export declare function createSubtleTextBlock(options: {
3
+ text: string;
4
+ id?: string;
5
+ }): TextBlock;
6
+ export declare function createTitleTextBlock(options: {
7
+ text: string;
8
+ id?: string;
9
+ }): TextBlock;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSubtleTextBlock = createSubtleTextBlock;
4
+ exports.createTitleTextBlock = createTitleTextBlock;
5
+ const ui_extensions_core_1 = require("@todoist/ui-extensions-core");
6
+ function createSubtleTextBlock(options) {
7
+ const { id, text } = options;
8
+ const textBlock = new ui_extensions_core_1.TextBlock();
9
+ textBlock.id = id;
10
+ textBlock.text = text;
11
+ textBlock.wrap = true;
12
+ textBlock.isSubtle = true;
13
+ return textBlock;
14
+ }
15
+ function createTitleTextBlock(options) {
16
+ const { id, text } = options;
17
+ const textBlock = new ui_extensions_core_1.TextBlock();
18
+ textBlock.id = id;
19
+ textBlock.text = text;
20
+ textBlock.size = 'large';
21
+ textBlock.weight = 'bolder';
22
+ return textBlock;
23
+ }
24
+ //# sourceMappingURL=text-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-block.js","sourceRoot":"","sources":["../../src/ui/text-block.ts"],"names":[],"mappings":";;AAEA,sDASC;AAED,oDASC;AAtBD,oEAAuD;AAEvD,SAAgB,qBAAqB,CAAC,OAAsC;IACxE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IAC5B,MAAM,SAAS,GAAG,IAAI,8BAAS,EAAE,CAAA;IACjC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAA;IACjB,SAAS,CAAC,IAAI,GAAG,IAAI,CAAA;IACrB,SAAS,CAAC,IAAI,GAAG,IAAI,CAAA;IACrB,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAA;IAEzB,OAAO,SAAS,CAAA;AACpB,CAAC;AAED,SAAgB,oBAAoB,CAAC,OAAsC;IACvE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IAC5B,MAAM,SAAS,GAAG,IAAI,8BAAS,EAAE,CAAA;IACjC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAA;IACjB,SAAS,CAAC,IAAI,GAAG,IAAI,CAAA;IACrB,SAAS,CAAC,IAAI,GAAG,OAAO,CAAA;IACxB,SAAS,CAAC,MAAM,GAAG,QAAQ,CAAA;IAE3B,OAAO,SAAS,CAAA;AACpB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ThemeService, TranslationService } from '../services';
2
+ export type UIBuilderContext = {
3
+ translationService: TranslationService;
4
+ themeService: ThemeService;
5
+ createStaticUrl(path: string): string;
6
+ createThemeBasedUrl(pathFormat: string): string;
7
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ui-builder-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-builder-context.js","sourceRoot":"","sources":["../../src/ui/ui-builder-context.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { TodoistCardAction } from '@todoist/ui-extensions-core';
2
+ import type { ActionMetadata } from '../decorators';
3
+ export declare function isInitial(action: TodoistCardAction): boolean;
4
+ export declare function isSubmit(action: TodoistCardAction, actionId: ActionMetadata['actionId']): boolean;
5
+ export declare function isValidActionId(actionId: string | undefined, actionIdToCheck: ActionMetadata['actionId']): boolean;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInitial = isInitial;
4
+ exports.isSubmit = isSubmit;
5
+ exports.isValidActionId = isValidActionId;
6
+ function isInitial(action) {
7
+ return action.actionType === 'initial';
8
+ }
9
+ function isSubmit(action, actionId) {
10
+ if (action.actionType !== 'submit' || !action.actionId) {
11
+ return false;
12
+ }
13
+ return isValidActionId(action.actionId, actionId);
14
+ }
15
+ function isValidActionId(actionId, actionIdToCheck) {
16
+ if (!actionId) {
17
+ return false;
18
+ }
19
+ if (actionIdToCheck instanceof RegExp) {
20
+ return actionIdToCheck.exec(actionId) != null;
21
+ }
22
+ else if (Array.isArray(actionIdToCheck)) {
23
+ return actionIdToCheck.includes(actionId);
24
+ }
25
+ else {
26
+ return actionId === actionIdToCheck;
27
+ }
28
+ }
29
+ //# sourceMappingURL=action-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-utils.js","sourceRoot":"","sources":["../../src/utils/action-utils.ts"],"names":[],"mappings":";;AAGA,8BAEC;AAED,4BAMC;AAED,0CAeC;AA3BD,SAAgB,SAAS,CAAC,MAAyB;IAC/C,OAAO,MAAM,CAAC,UAAU,KAAK,SAAS,CAAA;AAC1C,CAAC;AAED,SAAgB,QAAQ,CAAC,MAAyB,EAAE,QAAoC;IACpF,IAAI,MAAM,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrD,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,OAAO,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACrD,CAAC;AAED,SAAgB,eAAe,CAC3B,QAA4B,EAC5B,eAA2C;IAE3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,IAAI,eAAe,YAAY,MAAM,EAAE,CAAC;QACpC,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjD,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QACxC,OAAO,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC7C,CAAC;SAAM,CAAC;QACJ,OAAO,QAAQ,KAAK,eAAe,CAAA;IACvC,CAAC;AACL,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ComposerAppendBridge, DisplayNotificationBridge, FinishedBridge, RequestTodoistSyncBridge, TodoistCardBridgeNotification } from '@todoist/ui-extensions-core';
2
+ export declare const DoistCardBridgeFactory: {
3
+ createComposerAppend(text: string): ComposerAppendBridge;
4
+ readonly finished: FinishedBridge;
5
+ createNotificationBridge(notification: TodoistCardBridgeNotification): DisplayNotificationBridge;
6
+ requestSync(onSuccessNotification?: TodoistCardBridgeNotification, onErrorNotification?: TodoistCardBridgeNotification): RequestTodoistSyncBridge;
7
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DoistCardBridgeFactory = void 0;
4
+ exports.DoistCardBridgeFactory = {
5
+ createComposerAppend(text) {
6
+ return {
7
+ bridgeActionType: 'composer.append',
8
+ text,
9
+ };
10
+ },
11
+ get finished() {
12
+ return {
13
+ bridgeActionType: 'finished',
14
+ };
15
+ },
16
+ createNotificationBridge(notification) {
17
+ return {
18
+ bridgeActionType: 'display.notification',
19
+ notification,
20
+ };
21
+ },
22
+ requestSync(onSuccessNotification, onErrorNotification) {
23
+ return {
24
+ bridgeActionType: 'request.sync',
25
+ onSuccessNotification,
26
+ onErrorNotification,
27
+ };
28
+ },
29
+ };
30
+ //# sourceMappingURL=card-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-bridge.js","sourceRoot":"","sources":["../../src/utils/card-bridge.ts"],"names":[],"mappings":";;;AAQa,QAAA,sBAAsB,GAAG;IAClC,oBAAoB,CAAC,IAAY;QAC7B,OAAO;YACH,gBAAgB,EAAE,iBAAiB;YACnC,IAAI;SACP,CAAA;IACL,CAAC;IAED,IAAI,QAAQ;QACR,OAAO;YACH,gBAAgB,EAAE,UAAU;SAC/B,CAAA;IACL,CAAC;IAED,wBAAwB,CACpB,YAA2C;QAE3C,OAAO;YACH,gBAAgB,EAAE,sBAAsB;YACxC,YAAY;SACf,CAAA;IACL,CAAC;IAED,WAAW,CACP,qBAAqD,EACrD,mBAAmD;QAEnD,OAAO;YACH,gBAAgB,EAAE,cAAc;YAChC,qBAAqB;YACrB,mBAAmB;SACtB,CAAA;IACL,CAAC;CACJ,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { TodoistCardContext } from '@todoist/ui-extensions-core';
2
+ export declare function getUserId(context: TodoistCardContext): number;
3
+ export declare function getUserId(id: string | number): number;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUserId = getUserId;
4
+ function getUserId(contextOrId) {
5
+ let id;
6
+ if (typeof contextOrId === 'object' && 'user' in contextOrId) {
7
+ id = contextOrId.user.id;
8
+ }
9
+ else {
10
+ id = contextOrId;
11
+ }
12
+ if (typeof id === 'number') {
13
+ return id;
14
+ }
15
+ const parsedId = parseInt(id, 10);
16
+ if (Number.isNaN(parsedId)) {
17
+ throw new Error(`Invalid user ID: cannot convert "${id}" to number`);
18
+ }
19
+ return parsedId;
20
+ }
21
+ //# sourceMappingURL=context-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-utils.js","sourceRoot":"","sources":["../../src/utils/context-utils.ts"],"names":[],"mappings":";;AAYA,8BAmBC;AAnBD,SAAgB,SAAS,CAAC,WAAiD;IACvE,IAAI,EAAmB,CAAA;IAEvB,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,MAAM,IAAI,WAAW,EAAE,CAAC;QAE3D,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAA;IAC5B,CAAC;SAAM,CAAC;QAEJ,EAAE,GAAG,WAAW,CAAA;IACpB,CAAC;IAED,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,EAAE,CAAA;IACb,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IACjC,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,oCAAoC,EAAE,aAAa,CAAC,CAAA;IACxE,CAAC;IACD,OAAO,QAAQ,CAAA;AACnB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Dayjs } from 'dayjs';
2
+ export type DateType = 'Today' | 'Tomorrow' | 'Other';
3
+ export declare function hasAuthTokenExpired(expiryDate?: Date): boolean;
4
+ export declare function hasValidTimezone(tz?: string): boolean;
5
+ export declare function getDayjs(date?: string | Date, stripTimezone?: boolean, tz?: string): Dayjs;
6
+ export declare function getDateString(date: string | Date): string;
7
+ export declare function getTimeString(date: string | Date): string;
8
+ export declare function toFullDate(date: string, time: string, tz: string): string;
9
+ export declare function getRelativeDateType(value?: Date | string): DateType;
10
+ export declare function getStartOfToday(): Date;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.hasAuthTokenExpired = hasAuthTokenExpired;
7
+ exports.hasValidTimezone = hasValidTimezone;
8
+ exports.getDayjs = getDayjs;
9
+ exports.getDateString = getDateString;
10
+ exports.getTimeString = getTimeString;
11
+ exports.toFullDate = toFullDate;
12
+ exports.getRelativeDateType = getRelativeDateType;
13
+ exports.getStartOfToday = getStartOfToday;
14
+ const dayjs_1 = __importDefault(require("dayjs"));
15
+ const advancedFormat_1 = __importDefault(require("dayjs/plugin/advancedFormat"));
16
+ const isToday_1 = __importDefault(require("dayjs/plugin/isToday"));
17
+ const isTomorrow_1 = __importDefault(require("dayjs/plugin/isTomorrow"));
18
+ const localizedFormat_1 = __importDefault(require("dayjs/plugin/localizedFormat"));
19
+ const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
20
+ const utc_1 = __importDefault(require("dayjs/plugin/utc"));
21
+ dayjs_1.default.extend(isTomorrow_1.default);
22
+ dayjs_1.default.extend(isToday_1.default);
23
+ dayjs_1.default.extend(timezone_1.default);
24
+ dayjs_1.default.extend(utc_1.default);
25
+ dayjs_1.default.extend(localizedFormat_1.default);
26
+ dayjs_1.default.extend(advancedFormat_1.default);
27
+ const DATE_FORMAT_WITH_YEAR = 'ddd, MMMM D YYYY';
28
+ const DATE_FORMAT = 'ddd, MMMM D';
29
+ function hasAuthTokenExpired(expiryDate) {
30
+ if (expiryDate === undefined) {
31
+ return false;
32
+ }
33
+ const now = getDayjs();
34
+ const expDate = getDayjs(expiryDate);
35
+ return now > expDate;
36
+ }
37
+ function hasValidTimezone(tz) {
38
+ if (!tz) {
39
+ return false;
40
+ }
41
+ try {
42
+ Intl.DateTimeFormat(undefined, { timeZone: tz });
43
+ return true;
44
+ }
45
+ catch (_a) {
46
+ return false;
47
+ }
48
+ }
49
+ function stripTimezoneInfo(date) {
50
+ return date.replace(/([+-](?:2[0-3]|[01][0-9]):[0-5][0-9])$/, '');
51
+ }
52
+ function getDayjs(date, stripTimezone = true, tz) {
53
+ if (!date)
54
+ date = new Date();
55
+ const dateString = date instanceof Date ? date.toISOString() : date;
56
+ const dateToParse = stripTimezone ? stripTimezoneInfo(dateString) : dateString;
57
+ return tz ? (0, dayjs_1.default)(dateToParse).tz(tz, stripTimezone) : (0, dayjs_1.default)(dateToParse);
58
+ }
59
+ function getDateString(date) {
60
+ const d = getDayjs(date);
61
+ const now = getDayjs(new Date());
62
+ const format = now.year() !== d.year() ? DATE_FORMAT_WITH_YEAR : DATE_FORMAT;
63
+ return d.format(format);
64
+ }
65
+ function getTimeString(date) {
66
+ const d = getDayjs(date);
67
+ return d.format('h:mm A');
68
+ }
69
+ function toFullDate(date, time, tz) {
70
+ const d = getDayjs(`${date} ${time}`, true, tz);
71
+ return d.format();
72
+ }
73
+ function getRelativeDateType(value) {
74
+ if (!value)
75
+ return 'Other';
76
+ const date = getDayjs(value);
77
+ if (date.isToday()) {
78
+ return 'Today';
79
+ }
80
+ if (date.isTomorrow()) {
81
+ return 'Tomorrow';
82
+ }
83
+ return 'Other';
84
+ }
85
+ function getStartOfToday() {
86
+ return getDayjs().startOf('day').toDate();
87
+ }
88
+ //# sourceMappingURL=dateUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateUtils.js","sourceRoot":"","sources":["../../src/utils/dateUtils.ts"],"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,EAAE,CAAC,CAAA;IAE/C,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AACrB,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAAqB;IACrD,IAAI,CAAC,KAAK;QAAE,OAAO,OAAO,CAAA;IAE1B,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE5B,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QACjB,OAAO,OAAO,CAAA;IAClB,CAAC;IAED,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;QACpB,OAAO,UAAU,CAAA;IACrB,CAAC;IAED,OAAO,OAAO,CAAA;AAClB,CAAC;AAED,SAAgB,eAAe;IAC3B,OAAO,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAA;AAC7C,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare function encrypt(text: string, key: string): string;
2
+ export declare function decrypt(encryptedText: string, key: string): string;
3
+ export declare function encryptState(guid: string, userId: number, expiryTime: number, key: string, externalUserId?: string, nonce?: string): string;
4
+ export declare function decryptState(encryptedState: string, key: string): {
5
+ guid: string;
6
+ userId: number;
7
+ expiry: number;
8
+ externalUserId?: string;
9
+ nonce?: string;
10
+ } | null;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encrypt = encrypt;
4
+ exports.decrypt = decrypt;
5
+ exports.encryptState = encryptState;
6
+ exports.decryptState = decryptState;
7
+ const node_crypto_1 = require("node:crypto");
8
+ const ALGORITHM = 'aes-256-cbc';
9
+ const IV_LENGTH = 16;
10
+ function encrypt(text, key) {
11
+ const keyBuffer = (0, node_crypto_1.createHash)('sha256').update(key).digest();
12
+ const iv = (0, node_crypto_1.randomBytes)(IV_LENGTH);
13
+ const cipher = (0, node_crypto_1.createCipheriv)(ALGORITHM, keyBuffer, iv);
14
+ let encrypted = cipher.update(text, 'utf8', 'hex');
15
+ encrypted += cipher.final('hex');
16
+ return `${iv.toString('hex')}:${encrypted}`;
17
+ }
18
+ function decrypt(encryptedText, key) {
19
+ const keyBuffer = (0, node_crypto_1.createHash)('sha256').update(key).digest();
20
+ const parts = encryptedText.split(':');
21
+ if (parts.length !== 2 || !parts[0] || !parts[1]) {
22
+ throw new Error('Invalid encrypted text format');
23
+ }
24
+ const iv = Buffer.from(parts[0], 'hex');
25
+ const encrypted = parts[1];
26
+ const decipher = (0, node_crypto_1.createDecipheriv)(ALGORITHM, keyBuffer, iv);
27
+ let decrypted = decipher.update(encrypted, 'hex', 'utf8');
28
+ decrypted += decipher.final('utf8');
29
+ return decrypted;
30
+ }
31
+ function encryptState(guid, userId, expiryTime, key, externalUserId, nonce) {
32
+ let plaintext = `${guid}.${userId}.${expiryTime}`;
33
+ if (externalUserId) {
34
+ plaintext += `.${externalUserId}`;
35
+ }
36
+ if (nonce) {
37
+ if (!externalUserId) {
38
+ plaintext += '.';
39
+ }
40
+ plaintext += `.${nonce}`;
41
+ }
42
+ return encrypt(plaintext, key);
43
+ }
44
+ function decryptState(encryptedState, key) {
45
+ try {
46
+ const decrypted = decrypt(encryptedState, key);
47
+ const parts = decrypted.split('.');
48
+ if (parts.length < 3 || parts.length > 5) {
49
+ return null;
50
+ }
51
+ const guid = parts[0];
52
+ const userIdStr = parts[1];
53
+ const expiryStr = parts[2];
54
+ const externalUserId = parts[3] && parts[3] !== '' ? parts[3] : undefined;
55
+ const nonce = parts[4] ? parts[4] : undefined;
56
+ if (!guid || !userIdStr || !expiryStr) {
57
+ return null;
58
+ }
59
+ const userId = Number.parseInt(userIdStr, 10);
60
+ const expiry = Number.parseInt(expiryStr, 10);
61
+ if (Number.isNaN(userId) || Number.isNaN(expiry)) {
62
+ return null;
63
+ }
64
+ return { guid, userId, expiry, externalUserId, nonce };
65
+ }
66
+ catch (_a) {
67
+ return null;
68
+ }
69
+ }
70
+ //# sourceMappingURL=encryption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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,KAAK,CAAC,CAAC,CAAC,CAAA;QAC1B,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAC1B,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACzE,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAE7C,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,OAAO,IAAI,CAAA;QACf,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;QAE7C,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAA;QACf,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;IAC1D,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,IAAI,CAAA;IACf,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Endpoints } from '../types';
2
+ export declare function useEndpoint(endpoint: Endpoints): string;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useEndpoint = useEndpoint;
4
+ function useEndpoint(endpoint) {
5
+ return endpoint;
6
+ }
7
+ //# sourceMappingURL=endpointUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpointUtils.js","sourceRoot":"","sources":["../../src/utils/endpointUtils.ts"],"names":[],"mappings":";;AASA,kCAEC;AAFD,SAAgB,WAAW,CAAC,QAAmB;IAC3C,OAAO,QAAQ,CAAA;AACnB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function isProduction(): boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isProduction = isProduction;
4
+ function isProduction() {
5
+ return process.env.NODE_ENV === 'production';
6
+ }
7
+ //# sourceMappingURL=envUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envUtils.js","sourceRoot":"","sources":["../../src/utils/envUtils.ts"],"names":[],"mappings":";;AAAA,oCAEC;AAFD,SAAgB,YAAY;IACxB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAA;AAChD,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare function isUnauthorizedError(error: unknown): boolean;
2
+ export declare function isForbiddenError(error: unknown): boolean;
3
+ export declare function isNotFoundError(error: unknown): boolean;
4
+ export declare function isRateLimitError(error: unknown): boolean;
5
+ export declare function getErrorCode(error: unknown): number | null;
6
+ export declare function getErrorMessage(error: unknown, defaultMessage?: string): string;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isUnauthorizedError = isUnauthorizedError;
4
+ exports.isForbiddenError = isForbiddenError;
5
+ exports.isNotFoundError = isNotFoundError;
6
+ exports.isRateLimitError = isRateLimitError;
7
+ exports.getErrorCode = getErrorCode;
8
+ exports.getErrorMessage = getErrorMessage;
9
+ const common_1 = require("@nestjs/common");
10
+ function isUnauthorizedError(error) {
11
+ return isHttpErrorCode(common_1.HttpStatus.UNAUTHORIZED, error);
12
+ }
13
+ function isForbiddenError(error) {
14
+ return isHttpErrorCode(common_1.HttpStatus.FORBIDDEN, error);
15
+ }
16
+ function isNotFoundError(error) {
17
+ return isHttpErrorCode(common_1.HttpStatus.NOT_FOUND, error);
18
+ }
19
+ function isRateLimitError(error) {
20
+ return isHttpErrorCode(common_1.HttpStatus.TOO_MANY_REQUESTS, error);
21
+ }
22
+ function isHttpErrorCode(expectedErrorCode, error) {
23
+ const actualErrorCode = getErrorCode(error);
24
+ if (!actualErrorCode)
25
+ return false;
26
+ return actualErrorCode === expectedErrorCode;
27
+ }
28
+ function getErrorCode(error) {
29
+ var _a;
30
+ if (!error)
31
+ return null;
32
+ if (error instanceof common_1.HttpException) {
33
+ return error.getStatus();
34
+ }
35
+ const axiosError = error;
36
+ if (axiosError.response) {
37
+ return axiosError.response.status;
38
+ }
39
+ const httpError = error;
40
+ return (_a = httpError.code) !== null && _a !== void 0 ? _a : null;
41
+ }
42
+ function getErrorMessage(error, defaultMessage = 'Internal Server Error') {
43
+ if (error instanceof Error)
44
+ return error.message;
45
+ if (typeof error === 'string')
46
+ return error;
47
+ if (error instanceof Object)
48
+ return JSON.stringify(error);
49
+ return defaultMessage;
50
+ }
51
+ //# sourceMappingURL=errorUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../../src/utils/errorUtils.ts"],"names":[],"mappings":";;AASA,kDAEC;AAED,4CAEC;AAED,0CAEC;AAED,4CAEC;AAUD,oCAcC;AAED,0CAQC;AAzDD,2CAA0D;AAS1D,SAAgB,mBAAmB,CAAC,KAAc;IAC9C,OAAO,eAAe,CAAC,mBAAU,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;AAC1D,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc;IAC3C,OAAO,eAAe,CAAC,mBAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;AACvD,CAAC;AAED,SAAgB,eAAe,CAAC,KAAc;IAC1C,OAAO,eAAe,CAAC,mBAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;AACvD,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc;IAC3C,OAAO,eAAe,CAAC,mBAAU,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;AAC/D,CAAC;AAED,SAAS,eAAe,CAAC,iBAAyB,EAAE,KAAc;IAC9D,MAAM,eAAe,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAE3C,IAAI,CAAC,eAAe;QAAE,OAAO,KAAK,CAAA;IAElC,OAAO,eAAe,KAAK,iBAAiB,CAAA;AAChD,CAAC;AAED,SAAgB,YAAY,CAAC,KAAc;;IACvC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvB,IAAI,KAAK,YAAY,sBAAa,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC,SAAS,EAAE,CAAA;IAC5B,CAAC;IAED,MAAM,UAAU,GAAG,KAA4B,CAAA;IAC/C,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACtB,OAAO,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAA;IACrC,CAAC;IAED,MAAM,SAAS,GAAG,KAAkB,CAAA;IAEpC,OAAO,MAAA,SAAS,CAAC,IAAI,mCAAI,IAAI,CAAA;AACjC,CAAC;AAED,SAAgB,eAAe,CAAC,KAAc,EAAE,cAAc,GAAG,uBAAuB;IACpF,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,CAAA;IAEhD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAE3C,IAAI,KAAK,YAAY,MAAM;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAEzD,OAAO,cAAc,CAAA;AACzB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { IncomingHttpHeaders } from 'node:http';
2
+ export declare const TWIST_HASHED_HEADER = "x-twist-hmac-sha256";
3
+ export declare const TODOIST_HASHED_HEADER = "x-todoist-hmac-sha256";
4
+ export declare const TODOIST_APP_TOKEN_HEADER = "x-todoist-apptoken";
5
+ export declare const TWIST_APP_TOKEN_HEADER = "x-twist-apptoken";
6
+ export declare function containsTwistOrTodoistHeaders(headers: IncomingHttpHeaders): boolean;
7
+ export declare function getHashedHeader(headers: IncomingHttpHeaders): string | string[] | undefined;
8
+ export declare function containsTwistOrTodoistAppTokenHeaders(headers: IncomingHttpHeaders): boolean;
9
+ export declare function getAppTokenHeader(headers: IncomingHttpHeaders): string | string[] | undefined;