@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,8 @@
1
+ export type AppAuthToken = string;
2
+ export type NonceValidationReason = 'expired' | 'not_found' | 'user_mismatch';
3
+ export type NonceValidationResult = {
4
+ isValid: true;
5
+ } | {
6
+ isValid: false;
7
+ reason: NonceValidationReason;
8
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export type BackButtonBehavior = 'LastPage' | 'PreviousPage';
2
+ export type PaginationData = {
3
+ previousPageTokens?: string[];
4
+ nextPageToken?: string;
5
+ pageNumber: number;
6
+ totalPageCount?: number;
7
+ };
8
+ export declare enum PaginationCardData {
9
+ PreviousPageTokens = "previousPageTokens",
10
+ NextPageToken = "nextPageToken",
11
+ PageNumber = "pageNumber"
12
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaginationCardData = void 0;
4
+ var PaginationCardData;
5
+ (function (PaginationCardData) {
6
+ PaginationCardData["PreviousPageTokens"] = "previousPageTokens";
7
+ PaginationCardData["NextPageToken"] = "nextPageToken";
8
+ PaginationCardData["PageNumber"] = "pageNumber";
9
+ })(PaginationCardData || (exports.PaginationCardData = PaginationCardData = {}));
10
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/types/data.ts"],"names":[],"mappings":";;;AA2CA,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,+DAAyC,CAAA;IACzC,qDAA+B,CAAA;IAC/B,+CAAyB,CAAA;AAC7B,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B"}
@@ -0,0 +1 @@
1
+ export type Endpoints = 'process' | 'settings';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/types/endpoints.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { RetryRequest } from './retry';
2
+ export type ErrorCardOptions = {
3
+ retryRequest?: RetryRequest;
4
+ errorId?: string;
5
+ helpCenterLink?: string;
6
+ showSignout?: boolean;
7
+ showGoHome?: boolean;
8
+ errorMessage?: string;
9
+ exceptionMessage?: string;
10
+ maximumDoistCardVersion?: number;
11
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=error-card-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-card-options.js","sourceRoot":"","sources":["../../src/types/error-card-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type AuthErrorType = 'CODE' | 'STATE' | 'UNKNOWNSTATE' | 'STATEEXPIRED' | 'CSRFDETECTED' | 'UNKNOWNERROR';
2
+ export declare const authErrorMessageMap: Map<AuthErrorType, string>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.authErrorMessageMap = void 0;
4
+ exports.authErrorMessageMap = new Map([
5
+ ['CODE', 'Code parameter cannot be empty'],
6
+ ['STATE', 'State parameter cannot be empty'],
7
+ ['UNKNOWNSTATE', 'Unknown state, cannot be paired to a user id'],
8
+ ['STATEEXPIRED', 'State has expired'],
9
+ ['CSRFDETECTED', 'OAuth CSRF attack detected: user identity mismatch'],
10
+ ['UNKNOWNERROR', 'An unknown error occurred during authentication'],
11
+ ]);
12
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":";;;AAOa,QAAA,mBAAmB,GAA+B,IAAI,GAAG,CAAC;IACnE,CAAC,MAAM,EAAE,gCAAgC,CAAC;IAC1C,CAAC,OAAO,EAAE,iCAAiC,CAAC;IAC5C,CAAC,cAAc,EAAE,8CAA8C,CAAC;IAChE,CAAC,cAAc,EAAE,mBAAmB,CAAC;IACrC,CAAC,cAAc,EAAE,oDAAoD,CAAC;IACtE,CAAC,cAAc,EAAE,iDAAiD,CAAC;CACtE,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ export * from './auth';
2
+ export * from './data';
3
+ export * from './endpoints';
4
+ export * from './error';
5
+ export * from './error-card-options';
6
+ export * from './logging';
7
+ export * from './retry';
@@ -0,0 +1,24 @@
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("./auth"), exports);
18
+ __exportStar(require("./data"), exports);
19
+ __exportStar(require("./endpoints"), exports);
20
+ __exportStar(require("./error"), exports);
21
+ __exportStar(require("./error-card-options"), exports);
22
+ __exportStar(require("./logging"), exports);
23
+ __exportStar(require("./retry"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,yCAAsB;AACtB,8CAA2B;AAC3B,0CAAuB;AACvB,uDAAoC;AACpC,4CAAyB;AACzB,0CAAuB"}
@@ -0,0 +1 @@
1
+ export type CustomLoggingCategory = 'GENERAL' | 'ANALYTICS' | 'REQUEST_DEBUG';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/types/logging.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export type DoistProduct = 'twist' | 'todoist';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.js","sourceRoot":"","sources":["../../src/types/product.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { TodoistCardAction } from '@todoist/ui-extensions-core';
2
+ export declare const ORIGINAL_DATA = "originalData";
3
+ export declare enum RetryAttributes {
4
+ ACTION_TYPE = "actionType",
5
+ COMMAND = "command",
6
+ ORIGINAL_DATA = "originalData",
7
+ ORIGINAL_INPUTS = "originalInputs"
8
+ }
9
+ export type RetryRequest = {
10
+ retryAction: TodoistCardAction;
11
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetryAttributes = exports.ORIGINAL_DATA = void 0;
4
+ exports.ORIGINAL_DATA = 'originalData';
5
+ var RetryAttributes;
6
+ (function (RetryAttributes) {
7
+ RetryAttributes["ACTION_TYPE"] = "actionType";
8
+ RetryAttributes["COMMAND"] = "command";
9
+ RetryAttributes["ORIGINAL_DATA"] = "originalData";
10
+ RetryAttributes["ORIGINAL_INPUTS"] = "originalInputs";
11
+ })(RetryAttributes || (exports.RetryAttributes = RetryAttributes = {}));
12
+ //# sourceMappingURL=retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/types/retry.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAG,cAAc,CAAA;AAE3C,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,6CAA0B,CAAA;IAC1B,sCAAmB,CAAA;IACnB,iDAA8B,CAAA;IAC9B,qDAAkC,CAAA;AACtC,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
@@ -0,0 +1,7 @@
1
+ import { CardElement, SubmitAction } from '@todoist/ui-extensions-core';
2
+ import type { UIBuilderContext } from './ui-builder-context';
3
+ export declare enum Items {
4
+ BackImage = "BackImage"
5
+ }
6
+ export declare function createBackAction(context: UIBuilderContext, pageNumber?: number, createBackButtonData?: () => Record<string, unknown>, actionId?: string): SubmitAction;
7
+ export declare function createBackImageButton(context: UIBuilderContext, pageNumber?: number, createBackButtonData?: () => Record<string, unknown>, actionId?: string): CardElement;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Items = void 0;
4
+ exports.createBackAction = createBackAction;
5
+ exports.createBackImageButton = createBackImageButton;
6
+ const ui_extensions_core_1 = require("@todoist/ui-extensions-core");
7
+ const constants_1 = require("../constants");
8
+ const _1 = require(".");
9
+ var Items;
10
+ (function (Items) {
11
+ Items["BackImage"] = "BackImage";
12
+ })(Items || (exports.Items = Items = {}));
13
+ function createBackAction(context, pageNumber, createBackButtonData, actionId) {
14
+ const backButton = new ui_extensions_core_1.SubmitAction();
15
+ backButton.associatedInputs = 'none';
16
+ backButton.title = context.translationService.getTranslation(constants_1.Core.GO_BACK);
17
+ backButton.data = createBackButtonData === null || createBackButtonData === void 0 ? void 0 : createBackButtonData();
18
+ backButton.id = actionId
19
+ ? actionId
20
+ : pageNumber === undefined || pageNumber <= 1
21
+ ? constants_1.CardActions.GoHome
22
+ : constants_1.CardActions.Previous;
23
+ return backButton;
24
+ }
25
+ function createBackImageButton(context, pageNumber, createBackButtonData, actionId) {
26
+ return (0, _1.createIconImage)(context, {
27
+ selectAction: createBackAction(context, pageNumber, createBackButtonData, actionId),
28
+ imagePath: constants_1.BACK_IMAGE,
29
+ altText: context.translationService.getTranslation(constants_1.Core.BACK),
30
+ imageId: Items.BackImage,
31
+ });
32
+ }
33
+ //# sourceMappingURL=back-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"back-button.js","sourceRoot":"","sources":["../../src/ui/back-button.ts"],"names":[],"mappings":";;;AAYA,4CAiBC;AAED,sDAYC;AA3CD,oEAAuE;AAEvE,4CAA4D;AAE5D,wBAAmC;AAInC,IAAY,KAEX;AAFD,WAAY,KAAK;IACb,gCAAuB,CAAA;AAC3B,CAAC,EAFW,KAAK,qBAAL,KAAK,QAEhB;AAED,SAAgB,gBAAgB,CAC5B,OAAyB,EACzB,UAAmB,EACnB,oBAAoD,EACpD,QAAiB;IAEjB,MAAM,UAAU,GAAG,IAAI,iCAAY,EAAE,CAAA;IACrC,UAAU,CAAC,gBAAgB,GAAG,MAAM,CAAA;IACpC,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,gBAAI,CAAC,OAAO,CAAC,CAAA;IAC1E,UAAU,CAAC,IAAI,GAAG,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,EAAI,CAAA;IAC1C,UAAU,CAAC,EAAE,GAAG,QAAQ;QACpB,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,UAAU,KAAK,SAAS,IAAI,UAAU,IAAI,CAAC;YAC3C,CAAC,CAAC,uBAAW,CAAC,MAAM;YACpB,CAAC,CAAC,uBAAW,CAAC,QAAQ,CAAA;IAE5B,OAAO,UAAU,CAAA;AACrB,CAAC;AAED,SAAgB,qBAAqB,CACjC,OAAyB,EACzB,UAAmB,EACnB,oBAAoD,EACpD,QAAiB;IAEjB,OAAO,IAAA,kBAAe,EAAC,OAAO,EAAE;QAC5B,YAAY,EAAE,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,QAAQ,CAAC;QACnF,SAAS,EAAE,sBAAU;QACrB,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,gBAAI,CAAC,IAAI,CAAC;QAC7D,OAAO,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC,CAAA;AACN,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Action, ActionStyle, AssociatedInputs, Image, SubmitAction } from '@todoist/ui-extensions-core';
2
+ import type { UIBuilderContext } from './ui-builder-context';
3
+ export declare function createButtonSubmitAction({ id, title, data, associatedInputs, style, }: {
4
+ id: string;
5
+ title?: string;
6
+ data?: () => Record<string, unknown>;
7
+ associatedInputs?: AssociatedInputs;
8
+ style?: ActionStyle;
9
+ }): SubmitAction;
10
+ export declare function createIconImage(context: UIBuilderContext, options: {
11
+ imagePath: string;
12
+ imageId?: string;
13
+ selectAction: Action;
14
+ altText?: string;
15
+ }): Image;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createButtonSubmitAction = createButtonSubmitAction;
4
+ exports.createIconImage = createIconImage;
5
+ const ui_extensions_core_1 = require("@todoist/ui-extensions-core");
6
+ const constants_1 = require("../constants");
7
+ function createButtonSubmitAction({ id, title, data, associatedInputs, style, }) {
8
+ const action = new ui_extensions_core_1.SubmitAction();
9
+ action.id = id;
10
+ action.data = data === null || data === void 0 ? void 0 : data();
11
+ action.title = title;
12
+ action.associatedInputs = associatedInputs !== null && associatedInputs !== void 0 ? associatedInputs : 'none';
13
+ action.style = style;
14
+ return action;
15
+ }
16
+ function createIconImage(context, options) {
17
+ const { imagePath, imageId, selectAction, altText } = options;
18
+ const image = new ui_extensions_core_1.Image();
19
+ image.url = context.createThemeBasedUrl(imagePath);
20
+ image.altText = altText;
21
+ image.id = imageId;
22
+ image.pixelWidth = constants_1.ICON_SIZE;
23
+ image.pixelHeight = constants_1.ICON_SIZE;
24
+ image.selectAction = selectAction;
25
+ return image;
26
+ }
27
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/ui/button.ts"],"names":[],"mappings":";;AAYA,4DAoBC;AAED,0CAqBC;AAvDD,oEAMoC;AAEpC,4CAAwC;AAIxC,SAAgB,wBAAwB,CAAC,EACrC,EAAE,EACF,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,KAAK,GAOR;IACG,MAAM,MAAM,GAAG,IAAI,iCAAY,EAAE,CAAA;IACjC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,MAAM,CAAC,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,EAAI,CAAA;IACtB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,MAAM,CAAC,gBAAgB,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,MAAM,CAAA;IACpD,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,OAAO,MAAM,CAAA;AACjB,CAAC;AAED,SAAgB,eAAe,CAC3B,OAAyB,EACzB,OAKC;IAED,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAE7D,MAAM,KAAK,GAAG,IAAI,0BAAK,EAAE,CAAA;IACzB,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAA;IAClD,KAAK,CAAC,OAAO,GAAG,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,GAAG,OAAO,CAAA;IAClB,KAAK,CAAC,UAAU,GAAG,qBAAS,CAAA;IAC5B,KAAK,CAAC,WAAW,GAAG,qBAAS,CAAA;IAE7B,KAAK,CAAC,YAAY,GAAG,YAAY,CAAA;IAEjC,OAAO,KAAK,CAAA;AAChB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Props } from '@todoist/ui-extensions-core';
2
+ import { CardElement, Column, ColumnSet } from '@todoist/ui-extensions-core';
3
+ export declare function autoColumn(items: CardElement[], columnOptions?: Props<Column>): Column;
4
+ export declare function autoColumnSet(items: CardElement[], columnOptions?: Props<Column>): ColumnSet;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.autoColumn = autoColumn;
4
+ exports.autoColumnSet = autoColumnSet;
5
+ const ui_extensions_core_1 = require("@todoist/ui-extensions-core");
6
+ function autoColumn(items, columnOptions) {
7
+ const column = ui_extensions_core_1.Column.from({
8
+ width: 'auto',
9
+ ...columnOptions,
10
+ });
11
+ items.forEach((item) => {
12
+ column.addItem(item);
13
+ });
14
+ return column;
15
+ }
16
+ function autoColumnSet(items, columnOptions) {
17
+ const columnSet = new ui_extensions_core_1.ColumnSet();
18
+ items.forEach((item) => {
19
+ columnSet.addColumn(autoColumn([item], columnOptions));
20
+ });
21
+ return columnSet;
22
+ }
23
+ //# sourceMappingURL=column.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column.js","sourceRoot":"","sources":["../../src/ui/column.ts"],"names":[],"mappings":";;AAGA,gCAUC;AAED,sCAMC;AApBD,oEAA4E;AAE5E,SAAgB,UAAU,CAAC,KAAoB,EAAE,aAA6B;IAC1E,MAAM,MAAM,GAAG,2BAAM,CAAC,IAAI,CAAC;QACvB,KAAK,EAAE,MAAM;QACb,GAAG,aAAa;KACnB,CAAC,CAAA;IAEF,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACjB,CAAC;AAED,SAAgB,aAAa,CAAC,KAAoB,EAAE,aAA6B;IAC7E,MAAM,SAAS,GAAG,IAAI,8BAAS,EAAE,CAAA;IACjC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAA;IAC1D,CAAC,CAAC,CAAA;IACF,OAAO,SAAS,CAAA;AACpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { CardElement, Column, HorizontalAlignment, Spacing } from '@todoist/ui-extensions-core';
2
+ export declare function columnSet(item: CardElement, options?: {
3
+ horizontalAlignment?: HorizontalAlignment;
4
+ spacing?: Spacing;
5
+ columnsBefore?: Column[];
6
+ }): CardElement;
7
+ export declare function pageActions(item: CardElement, options?: {
8
+ columnsBefore?: Column[];
9
+ horizontalAlignment?: HorizontalAlignment;
10
+ spacing?: Spacing;
11
+ }): CardElement;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.columnSet = columnSet;
4
+ exports.pageActions = pageActions;
5
+ const ui_extensions_core_1 = require("@todoist/ui-extensions-core");
6
+ function columnSet(item, options) {
7
+ const { horizontalAlignment, spacing, columnsBefore } = options !== null && options !== void 0 ? options : {};
8
+ const actionColumn = new ui_extensions_core_1.Column('auto');
9
+ actionColumn.addItem(item);
10
+ const actionColumns = new ui_extensions_core_1.ColumnSet();
11
+ if (horizontalAlignment !== undefined) {
12
+ actionColumns.horizontalAlignment = horizontalAlignment;
13
+ }
14
+ if (spacing !== undefined) {
15
+ actionColumns.spacing = spacing;
16
+ }
17
+ columnsBefore === null || columnsBefore === void 0 ? void 0 : columnsBefore.forEach((column) => {
18
+ actionColumns.addColumn(column);
19
+ });
20
+ actionColumns.addColumn(actionColumn);
21
+ return actionColumns;
22
+ }
23
+ function pageActions(item, options) {
24
+ const { columnsBefore, horizontalAlignment, spacing } = options !== null && options !== void 0 ? options : {};
25
+ return columnSet(item, {
26
+ horizontalAlignment: horizontalAlignment !== null && horizontalAlignment !== void 0 ? horizontalAlignment : 'right',
27
+ spacing: spacing !== null && spacing !== void 0 ? spacing : 'medium',
28
+ columnsBefore,
29
+ });
30
+ }
31
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/ui/container.ts"],"names":[],"mappings":";;AAQA,8BA4BC;AAED,kCAeC;AArDD,oEAMoC;AAEpC,SAAgB,SAAS,CACrB,IAAiB,EACjB,OAIC;IAED,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAA;IAErE,MAAM,YAAY,GAAG,IAAI,2BAAM,CAAC,MAAM,CAAC,CAAA;IACvC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1B,MAAM,aAAa,GAAG,IAAI,8BAAS,EAAE,CAAA;IACrC,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACpC,aAAa,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;IAC3D,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACxB,aAAa,CAAC,OAAO,GAAG,OAAO,CAAA;IACnC,CAAC;IAED,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAC9B,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,aAAa,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA;IAErC,OAAO,aAAa,CAAA;AACxB,CAAC;AAED,SAAgB,WAAW,CACvB,IAAiB,EACjB,OAIC;IAED,MAAM,EAAE,aAAa,EAAE,mBAAmB,EAAE,OAAO,EAAE,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAA;IAErE,OAAO,SAAS,CAAC,IAAI,EAAE;QACnB,mBAAmB,EAAE,mBAAmB,aAAnB,mBAAmB,cAAnB,mBAAmB,GAAI,OAAO;QACnD,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,QAAQ;QAC5B,aAAa;KAChB,CAAC,CAAA;AACN,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { DateInput, TimeInput } from '@todoist/ui-extensions-core';
2
+ type DateTimeInputOptions = {
3
+ id: string;
4
+ timezone: string;
5
+ defaultToToday?: boolean;
6
+ min?: Date;
7
+ max?: Date;
8
+ isRequired?: boolean;
9
+ label?: string;
10
+ errorMessage?: string;
11
+ defaultToNow?: boolean;
12
+ defaultDate?: Date | string;
13
+ defaultTime?: Date | string;
14
+ };
15
+ export declare function createDateInput(options?: DateTimeInputOptions): DateInput;
16
+ export declare function createTimeInput(options?: DateTimeInputOptions): TimeInput;
17
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDateInput = createDateInput;
4
+ exports.createTimeInput = createTimeInput;
5
+ const ui_extensions_core_1 = require("@todoist/ui-extensions-core");
6
+ const dateUtils_1 = require("../utils/dateUtils");
7
+ const DATE_FORMAT = 'YYYY-MM-DD';
8
+ const TIME_FORMAT = 'HH:mm';
9
+ function createDateInput(options) {
10
+ const input = new ui_extensions_core_1.DateInput();
11
+ if (options) {
12
+ const { min, max, id, isRequired, label, errorMessage, defaultToToday, defaultDate, timezone, } = options;
13
+ input.id = id;
14
+ if (min)
15
+ input.min = (0, dateUtils_1.getDayjs)(min, false, timezone).format(DATE_FORMAT);
16
+ if (max)
17
+ input.max = (0, dateUtils_1.getDayjs)(max, false, timezone).format(DATE_FORMAT);
18
+ if (isRequired)
19
+ input.isRequired = isRequired;
20
+ if (label)
21
+ input.label = label;
22
+ if (errorMessage)
23
+ input.errorMessage = errorMessage;
24
+ if (defaultToToday && !defaultDate)
25
+ input.defaultValue = (0, dateUtils_1.getDayjs)().format(DATE_FORMAT);
26
+ if (defaultDate)
27
+ input.defaultValue = (0, dateUtils_1.getDayjs)(defaultDate, false, timezone).format(DATE_FORMAT);
28
+ }
29
+ return input;
30
+ }
31
+ function createTimeInput(options) {
32
+ const input = new ui_extensions_core_1.TimeInput();
33
+ if (options) {
34
+ const { min, max, id, defaultToNow, errorMessage, isRequired, label, defaultTime, timezone, } = options;
35
+ input.id = id;
36
+ if (min)
37
+ input.min = (0, dateUtils_1.getDayjs)(min, false, timezone).format(TIME_FORMAT);
38
+ if (max)
39
+ input.max = (0, dateUtils_1.getDayjs)(max, false, timezone).format(TIME_FORMAT);
40
+ if (isRequired)
41
+ input.isRequired = isRequired;
42
+ if (label)
43
+ input.label = label;
44
+ if (errorMessage)
45
+ input.errorMessage = errorMessage;
46
+ if (defaultToNow && !defaultTime)
47
+ input.defaultValue = (0, dateUtils_1.getDayjs)(undefined, false, timezone).format(TIME_FORMAT);
48
+ if (defaultTime) {
49
+ if (defaultTime instanceof Date) {
50
+ input.defaultValue = (0, dateUtils_1.getDayjs)(defaultTime, false, timezone).format(TIME_FORMAT);
51
+ }
52
+ else {
53
+ input.defaultValue = defaultTime;
54
+ }
55
+ }
56
+ }
57
+ return input;
58
+ }
59
+ //# sourceMappingURL=date-time-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-time-input.js","sourceRoot":"","sources":["../../src/ui/date-time-input.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ export * from './back-button';
2
+ export * from './button';
3
+ export * from './column';
4
+ export * from './container';
5
+ export * from './date-time-input';
6
+ export * from './profile-details';
7
+ export * from './stock-button';
8
+ export * from './text-block';
9
+ export * from './ui-builder-context';
@@ -0,0 +1,26 @@
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("./back-button"), exports);
18
+ __exportStar(require("./button"), exports);
19
+ __exportStar(require("./column"), exports);
20
+ __exportStar(require("./container"), exports);
21
+ __exportStar(require("./date-time-input"), exports);
22
+ __exportStar(require("./profile-details"), exports);
23
+ __exportStar(require("./stock-button"), exports);
24
+ __exportStar(require("./text-block"), exports);
25
+ __exportStar(require("./ui-builder-context"), exports);
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B;AAC7B,2CAAwB;AACxB,2CAAwB;AACxB,8CAA2B;AAC3B,oDAAiC;AACjC,oDAAiC;AACjC,iDAA8B;AAC9B,+CAA4B;AAC5B,uDAAoC"}
@@ -0,0 +1,3 @@
1
+ import { CardElement } from '@todoist/ui-extensions-core';
2
+ import type { User } from '..';
3
+ export declare function createProfileDetails(user: User, detailsWithNameTemplate: string, detailsWithoutNameTemplate: string): CardElement;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createProfileDetails = createProfileDetails;
4
+ const integrations_common_1 = require("@todoist/integrations-common");
5
+ const ui_extensions_core_1 = require("@todoist/ui-extensions-core");
6
+ function createProfileDetails(user, detailsWithNameTemplate, detailsWithoutNameTemplate) {
7
+ var _a, _b;
8
+ const text = user.name && user.emailAddress
9
+ ? (0, integrations_common_1.formatString)(detailsWithNameTemplate, user.name, user.emailAddress)
10
+ : (0, integrations_common_1.formatString)(detailsWithoutNameTemplate, (_b = (_a = user.emailAddress) !== null && _a !== void 0 ? _a : user.name) !== null && _b !== void 0 ? _b : user.externalUserId);
11
+ const profileDetails = new ui_extensions_core_1.TextBlock(text);
12
+ profileDetails.spacing = 'medium';
13
+ profileDetails.wrap = true;
14
+ return profileDetails;
15
+ }
16
+ //# sourceMappingURL=profile-details.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-details.js","sourceRoot":"","sources":["../../src/ui/profile-details.ts"],"names":[],"mappings":";;AAKA,oDAiBC;AAtBD,sEAA2D;AAC3D,oEAAoE;AAIpE,SAAgB,oBAAoB,CAChC,IAAU,EACV,uBAA+B,EAC/B,0BAAkC;;IAElC,MAAM,IAAI,GACN,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,YAAY;QAC1B,CAAC,CAAC,IAAA,kCAAY,EAAC,uBAAuB,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC;QACrE,CAAC,CAAC,IAAA,kCAAY,EACR,0BAA0B,EAC1B,MAAA,MAAA,IAAI,CAAC,YAAY,mCAAI,IAAI,CAAC,IAAI,mCAAI,IAAI,CAAC,cAAc,CACxD,CAAA;IACX,MAAM,cAAc,GAAG,IAAI,8BAAS,CAAC,IAAI,CAAC,CAAA;IAC1C,cAAc,CAAC,OAAO,GAAG,QAAQ,CAAA;IACjC,cAAc,CAAC,IAAI,GAAG,IAAI,CAAA;IAE1B,OAAO,cAAc,CAAA;AACzB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Action, CardElement, HorizontalAlignment, Image, TextColor } from '@todoist/ui-extensions-core';
2
+ import type { UIBuilderContext } from './ui-builder-context';
3
+ export declare const NEXT_ACTIONSET_ID = "NextActions";
4
+ export declare function createSignOutButton(context: UIBuilderContext, options?: {
5
+ horizontalAlignment: HorizontalAlignment;
6
+ }): CardElement;
7
+ export declare function createCloseButton(context: UIBuilderContext): Image;
8
+ export declare function createPlusButton(context: UIBuilderContext, id: string, data?: () => Record<string, unknown>, title?: string): Image;
9
+ export declare function createSettingsButton(context: UIBuilderContext, data?: () => Record<string, unknown>): Image;
10
+ export declare function createFeedbackButton(context: UIBuilderContext, targetUrl: string): Image;
11
+ export declare function createShareButton(context: UIBuilderContext, id: string, data: () => Record<string, unknown>, title?: string, textColor?: TextColor, isSubtle?: boolean, imagePath?: string): CardElement;
12
+ export declare function createEditButton(context: UIBuilderContext, request: {
13
+ id: string;
14
+ data?: () => Record<string, unknown>;
15
+ }): CardElement;
16
+ export declare function createOpenButton(context: UIBuilderContext, url: string): CardElement;
17
+ export declare function createLearnMoreButton(context: UIBuilderContext, url: string): CardElement;
18
+ export declare function createNewItemButton(context: UIBuilderContext, id: string, newItemData?: () => Record<string, unknown>, title?: string): CardElement;
19
+ export declare function createNextButton(context: UIBuilderContext, data: () => Record<string, unknown>): Action;
20
+ export declare function createLoadMoreButton(context: UIBuilderContext, data: () => Record<string, unknown>): CardElement;