@yolk-sdk/emulators 0.1.0-canary.96

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 (333) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2135 -0
  3. package/dist/anthropic.d.mts +269 -0
  4. package/dist/anthropic.d.mts.map +1 -0
  5. package/dist/anthropic.mjs +177 -0
  6. package/dist/anthropic.mjs.map +1 -0
  7. package/dist/chat-completions.d.mts +288 -0
  8. package/dist/chat-completions.d.mts.map +1 -0
  9. package/dist/chat-completions.mjs +451 -0
  10. package/dist/chat-completions.mjs.map +1 -0
  11. package/dist/codex.d.mts +265 -0
  12. package/dist/codex.d.mts.map +1 -0
  13. package/dist/codex.mjs +199 -0
  14. package/dist/codex.mjs.map +1 -0
  15. package/dist/dropbox/api.d.mts +63 -0
  16. package/dist/dropbox/api.d.mts.map +1 -0
  17. package/dist/dropbox/api.mjs +565 -0
  18. package/dist/dropbox/api.mjs.map +1 -0
  19. package/dist/dropbox/state.d.mts +136 -0
  20. package/dist/dropbox/state.d.mts.map +1 -0
  21. package/dist/dropbox/state.mjs +209 -0
  22. package/dist/dropbox/state.mjs.map +1 -0
  23. package/dist/dropbox.d.mts +79 -0
  24. package/dist/dropbox.d.mts.map +1 -0
  25. package/dist/dropbox.mjs +124 -0
  26. package/dist/dropbox.mjs.map +1 -0
  27. package/dist/email-fixtures.d.mts +36 -0
  28. package/dist/email-fixtures.d.mts.map +1 -0
  29. package/dist/email-fixtures.mjs +1080 -0
  30. package/dist/email-fixtures.mjs.map +1 -0
  31. package/dist/email.d.mts +160 -0
  32. package/dist/email.d.mts.map +1 -0
  33. package/dist/email.mjs +608 -0
  34. package/dist/email.mjs.map +1 -0
  35. package/dist/emulator-compose.d.mts +40 -0
  36. package/dist/emulator-compose.d.mts.map +1 -0
  37. package/dist/emulator-compose.mjs +91 -0
  38. package/dist/emulator-compose.mjs.map +1 -0
  39. package/dist/emulator-http.d.mts +53 -0
  40. package/dist/emulator-http.d.mts.map +1 -0
  41. package/dist/emulator-http.mjs +117 -0
  42. package/dist/emulator-http.mjs.map +1 -0
  43. package/dist/emulator-kernel.d.mts +176 -0
  44. package/dist/emulator-kernel.d.mts.map +1 -0
  45. package/dist/emulator-kernel.mjs +413 -0
  46. package/dist/emulator-kernel.mjs.map +1 -0
  47. package/dist/fixture-route.d.mts +129 -0
  48. package/dist/fixture-route.d.mts.map +1 -0
  49. package/dist/fixture-route.mjs +257 -0
  50. package/dist/fixture-route.mjs.map +1 -0
  51. package/dist/fortnox/api.d.mts +92 -0
  52. package/dist/fortnox/api.d.mts.map +1 -0
  53. package/dist/fortnox/api.mjs +750 -0
  54. package/dist/fortnox/api.mjs.map +1 -0
  55. package/dist/fortnox/state.d.mts +533 -0
  56. package/dist/fortnox/state.d.mts.map +1 -0
  57. package/dist/fortnox/state.mjs +612 -0
  58. package/dist/fortnox/state.mjs.map +1 -0
  59. package/dist/fortnox.d.mts +128 -0
  60. package/dist/fortnox.d.mts.map +1 -0
  61. package/dist/fortnox.mjs +403 -0
  62. package/dist/fortnox.mjs.map +1 -0
  63. package/dist/gateway-evaluate-recordings.d.mts +12 -0
  64. package/dist/gateway-evaluate-recordings.d.mts.map +1 -0
  65. package/dist/gateway-evaluate-recordings.mjs +128 -0
  66. package/dist/gateway-evaluate-recordings.mjs.map +1 -0
  67. package/dist/gateway.d.mts +272 -0
  68. package/dist/gateway.d.mts.map +1 -0
  69. package/dist/gateway.mjs +400 -0
  70. package/dist/gateway.mjs.map +1 -0
  71. package/dist/github/api.d.mts +63 -0
  72. package/dist/github/api.d.mts.map +1 -0
  73. package/dist/github/api.mjs +527 -0
  74. package/dist/github/api.mjs.map +1 -0
  75. package/dist/github/state.d.mts +272 -0
  76. package/dist/github/state.d.mts.map +1 -0
  77. package/dist/github/state.mjs +303 -0
  78. package/dist/github/state.mjs.map +1 -0
  79. package/dist/github.d.mts +77 -0
  80. package/dist/github.d.mts.map +1 -0
  81. package/dist/github.mjs +180 -0
  82. package/dist/github.mjs.map +1 -0
  83. package/dist/google/calendar.d.mts +10 -0
  84. package/dist/google/calendar.d.mts.map +1 -0
  85. package/dist/google/calendar.mjs +252 -0
  86. package/dist/google/calendar.mjs.map +1 -0
  87. package/dist/google/drive.d.mts +8 -0
  88. package/dist/google/drive.d.mts.map +1 -0
  89. package/dist/google/drive.mjs +252 -0
  90. package/dist/google/drive.mjs.map +1 -0
  91. package/dist/google/gmail.d.mts +10 -0
  92. package/dist/google/gmail.d.mts.map +1 -0
  93. package/dist/google/gmail.mjs +591 -0
  94. package/dist/google/gmail.mjs.map +1 -0
  95. package/dist/google/shared.d.mts +107 -0
  96. package/dist/google/shared.d.mts.map +1 -0
  97. package/dist/google/shared.mjs +146 -0
  98. package/dist/google/shared.mjs.map +1 -0
  99. package/dist/google/state.d.mts +385 -0
  100. package/dist/google/state.d.mts.map +1 -0
  101. package/dist/google/state.mjs +496 -0
  102. package/dist/google/state.mjs.map +1 -0
  103. package/dist/google.d.mts +75 -0
  104. package/dist/google.d.mts.map +1 -0
  105. package/dist/google.mjs +210 -0
  106. package/dist/google.mjs.map +1 -0
  107. package/dist/linkedin-search/api.d.mts +45 -0
  108. package/dist/linkedin-search/api.d.mts.map +1 -0
  109. package/dist/linkedin-search/api.mjs +181 -0
  110. package/dist/linkedin-search/api.mjs.map +1 -0
  111. package/dist/linkedin-search/state.d.mts +123 -0
  112. package/dist/linkedin-search/state.d.mts.map +1 -0
  113. package/dist/linkedin-search/state.mjs +261 -0
  114. package/dist/linkedin-search/state.mjs.map +1 -0
  115. package/dist/linkedin-search.d.mts +69 -0
  116. package/dist/linkedin-search.d.mts.map +1 -0
  117. package/dist/linkedin-search.mjs +158 -0
  118. package/dist/linkedin-search.mjs.map +1 -0
  119. package/dist/mcp/api.d.mts +44 -0
  120. package/dist/mcp/api.d.mts.map +1 -0
  121. package/dist/mcp/api.mjs +557 -0
  122. package/dist/mcp/api.mjs.map +1 -0
  123. package/dist/mcp/recordings.d.mts +40 -0
  124. package/dist/mcp/recordings.d.mts.map +1 -0
  125. package/dist/mcp/recordings.mjs +2390 -0
  126. package/dist/mcp/recordings.mjs.map +1 -0
  127. package/dist/mcp/state.d.mts +71 -0
  128. package/dist/mcp/state.d.mts.map +1 -0
  129. package/dist/mcp/state.mjs +83 -0
  130. package/dist/mcp/state.mjs.map +1 -0
  131. package/dist/mcp.d.mts +84 -0
  132. package/dist/mcp.d.mts.map +1 -0
  133. package/dist/mcp.mjs +241 -0
  134. package/dist/mcp.mjs.map +1 -0
  135. package/dist/messages.d.mts +183 -0
  136. package/dist/messages.d.mts.map +1 -0
  137. package/dist/messages.mjs +532 -0
  138. package/dist/messages.mjs.map +1 -0
  139. package/dist/microsoft/api.d.mts +47 -0
  140. package/dist/microsoft/api.d.mts.map +1 -0
  141. package/dist/microsoft/api.mjs +178 -0
  142. package/dist/microsoft/api.mjs.map +1 -0
  143. package/dist/microsoft/calendar.d.mts +30 -0
  144. package/dist/microsoft/calendar.d.mts.map +1 -0
  145. package/dist/microsoft/calendar.mjs +271 -0
  146. package/dist/microsoft/calendar.mjs.map +1 -0
  147. package/dist/microsoft/drive.d.mts +36 -0
  148. package/dist/microsoft/drive.d.mts.map +1 -0
  149. package/dist/microsoft/drive.mjs +298 -0
  150. package/dist/microsoft/drive.mjs.map +1 -0
  151. package/dist/microsoft/graph.d.mts +198 -0
  152. package/dist/microsoft/graph.d.mts.map +1 -0
  153. package/dist/microsoft/graph.mjs +264 -0
  154. package/dist/microsoft/graph.mjs.map +1 -0
  155. package/dist/microsoft/mail.d.mts +48 -0
  156. package/dist/microsoft/mail.d.mts.map +1 -0
  157. package/dist/microsoft/mail.mjs +488 -0
  158. package/dist/microsoft/mail.mjs.map +1 -0
  159. package/dist/microsoft/state.d.mts +480 -0
  160. package/dist/microsoft/state.d.mts.map +1 -0
  161. package/dist/microsoft/state.mjs +625 -0
  162. package/dist/microsoft/state.mjs.map +1 -0
  163. package/dist/microsoft.d.mts +168 -0
  164. package/dist/microsoft.d.mts.map +1 -0
  165. package/dist/microsoft.mjs +483 -0
  166. package/dist/microsoft.mjs.map +1 -0
  167. package/dist/node.d.mts +47 -0
  168. package/dist/node.d.mts.map +1 -0
  169. package/dist/node.mjs +178 -0
  170. package/dist/node.mjs.map +1 -0
  171. package/dist/notion/api.d.mts +51 -0
  172. package/dist/notion/api.d.mts.map +1 -0
  173. package/dist/notion/api.mjs +507 -0
  174. package/dist/notion/api.mjs.map +1 -0
  175. package/dist/notion/state.d.mts +329 -0
  176. package/dist/notion/state.d.mts.map +1 -0
  177. package/dist/notion/state.mjs +432 -0
  178. package/dist/notion/state.mjs.map +1 -0
  179. package/dist/notion.d.mts +72 -0
  180. package/dist/notion.d.mts.map +1 -0
  181. package/dist/notion.mjs +127 -0
  182. package/dist/notion.mjs.map +1 -0
  183. package/dist/openai.d.mts +165 -0
  184. package/dist/openai.d.mts.map +1 -0
  185. package/dist/openai.mjs +141 -0
  186. package/dist/openai.mjs.map +1 -0
  187. package/dist/opencode-recordings.d.mts +7 -0
  188. package/dist/opencode-recordings.d.mts.map +1 -0
  189. package/dist/opencode-recordings.mjs +222 -0
  190. package/dist/opencode-recordings.mjs.map +1 -0
  191. package/dist/opencode.d.mts +70 -0
  192. package/dist/opencode.d.mts.map +1 -0
  193. package/dist/opencode.mjs +217 -0
  194. package/dist/opencode.mjs.map +1 -0
  195. package/dist/r2-fixtures.d.mts +36 -0
  196. package/dist/r2-fixtures.d.mts.map +1 -0
  197. package/dist/r2-fixtures.mjs +245 -0
  198. package/dist/r2-fixtures.mjs.map +1 -0
  199. package/dist/r2-guard.d.mts +43 -0
  200. package/dist/r2-guard.d.mts.map +1 -0
  201. package/dist/r2-guard.mjs +215 -0
  202. package/dist/r2-guard.mjs.map +1 -0
  203. package/dist/r2.d.mts +166 -0
  204. package/dist/r2.d.mts.map +1 -0
  205. package/dist/r2.mjs +517 -0
  206. package/dist/r2.mjs.map +1 -0
  207. package/dist/responses.d.mts +231 -0
  208. package/dist/responses.d.mts.map +1 -0
  209. package/dist/responses.mjs +556 -0
  210. package/dist/responses.mjs.map +1 -0
  211. package/dist/route-evidence.d.mts +45 -0
  212. package/dist/route-evidence.d.mts.map +1 -0
  213. package/dist/route-evidence.mjs +56 -0
  214. package/dist/route-evidence.mjs.map +1 -0
  215. package/dist/router.d.mts +93 -0
  216. package/dist/router.d.mts.map +1 -0
  217. package/dist/router.mjs +259 -0
  218. package/dist/router.mjs.map +1 -0
  219. package/dist/stateful-core.d.mts +17 -0
  220. package/dist/stateful-core.d.mts.map +1 -0
  221. package/dist/stateful-core.mjs +41 -0
  222. package/dist/stateful-core.mjs.map +1 -0
  223. package/dist/stateful-emulator.d.mts +565 -0
  224. package/dist/stateful-emulator.d.mts.map +1 -0
  225. package/dist/stateful-emulator.mjs +1228 -0
  226. package/dist/stateful-emulator.mjs.map +1 -0
  227. package/dist/stateful-secrets.d.mts +84 -0
  228. package/dist/stateful-secrets.d.mts.map +1 -0
  229. package/dist/stateful-secrets.mjs +216 -0
  230. package/dist/stateful-secrets.mjs.map +1 -0
  231. package/dist/subscription-usage-recordings.d.mts +9 -0
  232. package/dist/subscription-usage-recordings.d.mts.map +1 -0
  233. package/dist/subscription-usage-recordings.mjs +53 -0
  234. package/dist/subscription-usage-recordings.mjs.map +1 -0
  235. package/dist/subscription-usage.d.mts +53 -0
  236. package/dist/subscription-usage.d.mts.map +1 -0
  237. package/dist/subscription-usage.mjs +21 -0
  238. package/dist/subscription-usage.mjs.map +1 -0
  239. package/dist/telegram/api.d.mts +34 -0
  240. package/dist/telegram/api.d.mts.map +1 -0
  241. package/dist/telegram/api.mjs +257 -0
  242. package/dist/telegram/api.mjs.map +1 -0
  243. package/dist/telegram/state.d.mts +128 -0
  244. package/dist/telegram/state.d.mts.map +1 -0
  245. package/dist/telegram/state.mjs +154 -0
  246. package/dist/telegram/state.mjs.map +1 -0
  247. package/dist/telegram.d.mts +62 -0
  248. package/dist/telegram.d.mts.map +1 -0
  249. package/dist/telegram.mjs +127 -0
  250. package/dist/telegram.mjs.map +1 -0
  251. package/dist/todoist/api.d.mts +55 -0
  252. package/dist/todoist/api.d.mts.map +1 -0
  253. package/dist/todoist/api.mjs +415 -0
  254. package/dist/todoist/api.mjs.map +1 -0
  255. package/dist/todoist/state.d.mts +275 -0
  256. package/dist/todoist/state.d.mts.map +1 -0
  257. package/dist/todoist/state.mjs +345 -0
  258. package/dist/todoist/state.mjs.map +1 -0
  259. package/dist/todoist.d.mts +68 -0
  260. package/dist/todoist.d.mts.map +1 -0
  261. package/dist/todoist.mjs +181 -0
  262. package/dist/todoist.mjs.map +1 -0
  263. package/dist/xai.d.mts +267 -0
  264. package/dist/xai.d.mts.map +1 -0
  265. package/dist/xai.mjs +252 -0
  266. package/dist/xai.mjs.map +1 -0
  267. package/package.json +157 -0
  268. package/src/anthropic.ts +289 -0
  269. package/src/chat-completions.ts +924 -0
  270. package/src/codex.ts +296 -0
  271. package/src/dropbox/api.ts +1084 -0
  272. package/src/dropbox/state.ts +364 -0
  273. package/src/dropbox.ts +203 -0
  274. package/src/email-fixtures.ts +1297 -0
  275. package/src/email.ts +1108 -0
  276. package/src/emulator-compose.ts +147 -0
  277. package/src/emulator-http.ts +184 -0
  278. package/src/emulator-kernel.ts +844 -0
  279. package/src/fixture-route.ts +561 -0
  280. package/src/fortnox/api.ts +1352 -0
  281. package/src/fortnox/state.ts +798 -0
  282. package/src/fortnox.ts +801 -0
  283. package/src/gateway-evaluate-recordings.ts +153 -0
  284. package/src/gateway.ts +530 -0
  285. package/src/github/api.ts +986 -0
  286. package/src/github/state.ts +439 -0
  287. package/src/github.ts +271 -0
  288. package/src/google/calendar.ts +486 -0
  289. package/src/google/drive.ts +471 -0
  290. package/src/google/gmail.ts +1011 -0
  291. package/src/google/shared.ts +321 -0
  292. package/src/google/state.ts +686 -0
  293. package/src/google.ts +298 -0
  294. package/src/linkedin-search/api.ts +363 -0
  295. package/src/linkedin-search/state.ts +373 -0
  296. package/src/linkedin-search.ts +241 -0
  297. package/src/mcp/api.ts +995 -0
  298. package/src/mcp/recordings.ts +2665 -0
  299. package/src/mcp/state.ts +125 -0
  300. package/src/mcp.ts +319 -0
  301. package/src/messages.ts +844 -0
  302. package/src/microsoft/api.ts +426 -0
  303. package/src/microsoft/calendar.ts +491 -0
  304. package/src/microsoft/drive.ts +541 -0
  305. package/src/microsoft/graph.ts +550 -0
  306. package/src/microsoft/mail.ts +833 -0
  307. package/src/microsoft/state.ts +822 -0
  308. package/src/microsoft.ts +982 -0
  309. package/src/node.ts +293 -0
  310. package/src/notion/api.ts +976 -0
  311. package/src/notion/state.ts +512 -0
  312. package/src/notion.ts +210 -0
  313. package/src/openai.ts +198 -0
  314. package/src/opencode-recordings.ts +257 -0
  315. package/src/opencode.ts +271 -0
  316. package/src/r2-fixtures.ts +295 -0
  317. package/src/r2-guard.ts +323 -0
  318. package/src/r2.ts +890 -0
  319. package/src/responses.ts +901 -0
  320. package/src/route-evidence.ts +90 -0
  321. package/src/router.ts +490 -0
  322. package/src/stateful-core.ts +70 -0
  323. package/src/stateful-emulator.ts +2571 -0
  324. package/src/stateful-secrets.ts +299 -0
  325. package/src/subscription-usage-recordings.ts +77 -0
  326. package/src/subscription-usage.ts +68 -0
  327. package/src/telegram/api.ts +437 -0
  328. package/src/telegram/state.ts +229 -0
  329. package/src/telegram.ts +227 -0
  330. package/src/todoist/api.ts +736 -0
  331. package/src/todoist/state.ts +456 -0
  332. package/src/todoist.ts +316 -0
  333. package/src/xai.ts +341 -0
@@ -0,0 +1,275 @@
1
+ import * as Schema from "effect/Schema";
2
+
3
+ //#region src/todoist/state.d.ts
4
+ /** A task due as the fixtures answer it. */
5
+ declare const TodoistEmulatorDue: Schema.Struct<{
6
+ readonly date: Schema.String;
7
+ readonly timezone: Schema.NullOr<Schema.String>;
8
+ readonly string: Schema.String;
9
+ readonly lang: Schema.String;
10
+ readonly is_recurring: Schema.Boolean;
11
+ }>;
12
+ type TodoistEmulatorDue = typeof TodoistEmulatorDue.Type;
13
+ /** A stored project, in the fixtures' API v1 wire shape. Deleted projects are removed. */
14
+ declare const TodoistEmulatorProject: Schema.Struct<{
15
+ readonly id: Schema.String;
16
+ readonly name: Schema.String;
17
+ readonly parent_id: Schema.NullOr<Schema.String>;
18
+ readonly child_order: Schema.Int;
19
+ readonly color: Schema.String;
20
+ readonly description: Schema.String;
21
+ readonly is_archived: Schema.Boolean;
22
+ readonly is_deleted: Schema.Boolean;
23
+ readonly is_favorite: Schema.Boolean;
24
+ readonly is_frozen: Schema.Boolean;
25
+ readonly is_shared: Schema.Boolean;
26
+ readonly is_collapsed: Schema.Boolean;
27
+ readonly can_assign_tasks: Schema.Boolean;
28
+ readonly inbox_project: Schema.Boolean;
29
+ readonly view_style: Schema.String;
30
+ readonly default_order: Schema.Int;
31
+ readonly created_at: Schema.String;
32
+ readonly updated_at: Schema.String;
33
+ }>;
34
+ type TodoistEmulatorProject = typeof TodoistEmulatorProject.Type;
35
+ /** A stored task, in the fixtures' API v1 wire shape. */
36
+ declare const TodoistEmulatorTask: Schema.Struct<{
37
+ readonly id: Schema.String;
38
+ readonly user_id: Schema.String;
39
+ readonly project_id: Schema.String;
40
+ readonly section_id: Schema.Null;
41
+ readonly parent_id: Schema.Null;
42
+ readonly added_by_uid: Schema.String;
43
+ readonly assigned_by_uid: Schema.Null;
44
+ readonly responsible_uid: Schema.Null; /** Label NAMES, as the fixtures answer them. */
45
+ readonly labels: Schema.$Array<Schema.String>;
46
+ readonly deadline: Schema.Null;
47
+ readonly duration: Schema.Null; /** `true` once closed: a closed task is no longer active. */
48
+ readonly checked: Schema.Boolean;
49
+ readonly is_deleted: Schema.Boolean;
50
+ readonly added_at: Schema.String;
51
+ readonly completed_at: Schema.NullOr<Schema.String>;
52
+ readonly updated_at: Schema.String;
53
+ readonly due: Schema.NullOr<Schema.Struct<{
54
+ readonly date: Schema.String;
55
+ readonly timezone: Schema.NullOr<Schema.String>;
56
+ readonly string: Schema.String;
57
+ readonly lang: Schema.String;
58
+ readonly is_recurring: Schema.Boolean;
59
+ }>>;
60
+ readonly priority: Schema.Int;
61
+ readonly child_order: Schema.Int;
62
+ readonly content: Schema.String;
63
+ readonly description: Schema.String;
64
+ readonly note_count: Schema.Int;
65
+ readonly day_order: Schema.Int;
66
+ readonly is_collapsed: Schema.Boolean;
67
+ }>;
68
+ type TodoistEmulatorTask = typeof TodoistEmulatorTask.Type;
69
+ /** A personal label, in the fixtures' wire shape. */
70
+ declare const TodoistEmulatorLabel: Schema.Struct<{
71
+ readonly id: Schema.String;
72
+ readonly name: Schema.String;
73
+ readonly color: Schema.String;
74
+ readonly order: Schema.Int;
75
+ readonly is_favorite: Schema.Boolean;
76
+ }>;
77
+ type TodoistEmulatorLabel = typeof TodoistEmulatorLabel.Type;
78
+ declare const Counters: Schema.Struct<{
79
+ /** Next number in created project ids (`6XEmuProject0001`). */readonly nextProjectNumber: Schema.Int; /** Next number in created task ids (`6XEmuTask0000001`). */
80
+ readonly nextTaskNumber: Schema.Int; /** Next `error_extra.event_id` number of a 404 answer. */
81
+ readonly nextEventNumber: Schema.Int;
82
+ }>;
83
+ /** The whole emulator state (JSON-compatible; what `snapshot()` returns). */
84
+ declare const TodoistEmulatorStateSchema: Schema.Struct<{
85
+ readonly userId: Schema.String;
86
+ readonly projects: Schema.$Array<Schema.Struct<{
87
+ readonly id: Schema.String;
88
+ readonly name: Schema.String;
89
+ readonly parent_id: Schema.NullOr<Schema.String>;
90
+ readonly child_order: Schema.Int;
91
+ readonly color: Schema.String;
92
+ readonly description: Schema.String;
93
+ readonly is_archived: Schema.Boolean;
94
+ readonly is_deleted: Schema.Boolean;
95
+ readonly is_favorite: Schema.Boolean;
96
+ readonly is_frozen: Schema.Boolean;
97
+ readonly is_shared: Schema.Boolean;
98
+ readonly is_collapsed: Schema.Boolean;
99
+ readonly can_assign_tasks: Schema.Boolean;
100
+ readonly inbox_project: Schema.Boolean;
101
+ readonly view_style: Schema.String;
102
+ readonly default_order: Schema.Int;
103
+ readonly created_at: Schema.String;
104
+ readonly updated_at: Schema.String;
105
+ }>>;
106
+ readonly tasks: Schema.$Array<Schema.Struct<{
107
+ readonly id: Schema.String;
108
+ readonly user_id: Schema.String;
109
+ readonly project_id: Schema.String;
110
+ readonly section_id: Schema.Null;
111
+ readonly parent_id: Schema.Null;
112
+ readonly added_by_uid: Schema.String;
113
+ readonly assigned_by_uid: Schema.Null;
114
+ readonly responsible_uid: Schema.Null; /** Label NAMES, as the fixtures answer them. */
115
+ readonly labels: Schema.$Array<Schema.String>;
116
+ readonly deadline: Schema.Null;
117
+ readonly duration: Schema.Null; /** `true` once closed: a closed task is no longer active. */
118
+ readonly checked: Schema.Boolean;
119
+ readonly is_deleted: Schema.Boolean;
120
+ readonly added_at: Schema.String;
121
+ readonly completed_at: Schema.NullOr<Schema.String>;
122
+ readonly updated_at: Schema.String;
123
+ readonly due: Schema.NullOr<Schema.Struct<{
124
+ readonly date: Schema.String;
125
+ readonly timezone: Schema.NullOr<Schema.String>;
126
+ readonly string: Schema.String;
127
+ readonly lang: Schema.String;
128
+ readonly is_recurring: Schema.Boolean;
129
+ }>>;
130
+ readonly priority: Schema.Int;
131
+ readonly child_order: Schema.Int;
132
+ readonly content: Schema.String;
133
+ readonly description: Schema.String;
134
+ readonly note_count: Schema.Int;
135
+ readonly day_order: Schema.Int;
136
+ readonly is_collapsed: Schema.Boolean;
137
+ }>>;
138
+ readonly labels: Schema.$Array<Schema.Struct<{
139
+ readonly id: Schema.String;
140
+ readonly name: Schema.String;
141
+ readonly color: Schema.String;
142
+ readonly order: Schema.Int;
143
+ readonly is_favorite: Schema.Boolean;
144
+ }>>;
145
+ readonly counters: Schema.Struct<{
146
+ /** Next number in created project ids (`6XEmuProject0001`). */readonly nextProjectNumber: Schema.Int; /** Next number in created task ids (`6XEmuTask0000001`). */
147
+ readonly nextTaskNumber: Schema.Int; /** Next `error_extra.event_id` number of a 404 answer. */
148
+ readonly nextEventNumber: Schema.Int;
149
+ }>;
150
+ }>;
151
+ /**
152
+ * The emulator state. The container is mutable (route handlers replace whole entity lists);
153
+ * every entity is replaced, never edited in place.
154
+ */
155
+ type TodoistEmulatorState = {
156
+ userId: string;
157
+ projects: ReadonlyArray<TodoistEmulatorProject>;
158
+ tasks: ReadonlyArray<TodoistEmulatorTask>;
159
+ labels: ReadonlyArray<TodoistEmulatorLabel>;
160
+ counters: typeof Counters.Type;
161
+ };
162
+ /** A seeded project: `id` and `name` are required; the rest default to the fixture values. */
163
+ declare const TodoistEmulatorProjectSeed: Schema.Struct<{
164
+ readonly id: Schema.String;
165
+ readonly name: Schema.String;
166
+ readonly parent_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
167
+ readonly child_order: Schema.optionalKey<Schema.Int>;
168
+ readonly created_at: Schema.optionalKey<Schema.String>;
169
+ readonly updated_at: Schema.optionalKey<Schema.String>;
170
+ }>;
171
+ type TodoistEmulatorProjectSeed = typeof TodoistEmulatorProjectSeed.Type;
172
+ /** A seeded active task: `id`, `project_id`, and `content` are required. */
173
+ declare const TodoistEmulatorTaskSeed: Schema.Struct<{
174
+ readonly id: Schema.String;
175
+ readonly project_id: Schema.String;
176
+ readonly content: Schema.String;
177
+ readonly labels: Schema.optionalKey<Schema.$Array<Schema.String>>;
178
+ readonly child_order: Schema.optionalKey<Schema.Int>;
179
+ readonly added_at: Schema.optionalKey<Schema.String>;
180
+ readonly updated_at: Schema.optionalKey<Schema.String>;
181
+ readonly due: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
182
+ readonly date: Schema.String;
183
+ readonly timezone: Schema.NullOr<Schema.String>;
184
+ readonly string: Schema.String;
185
+ readonly lang: Schema.String;
186
+ readonly is_recurring: Schema.Boolean;
187
+ }>>>;
188
+ }>;
189
+ type TodoistEmulatorTaskSeed = typeof TodoistEmulatorTaskSeed.Type;
190
+ /** Account-variance profiles for the default seed. */
191
+ declare const TodoistEmulatorProfile: Schema.Literals<readonly ["default", "empty"]>;
192
+ type TodoistEmulatorProfile = typeof TodoistEmulatorProfile.Type;
193
+ /**
194
+ * A typed seed. Start from `profile` (default `'default'`, the fixture entities; `'empty'` keeps
195
+ * only the work project); every other key, when given, replaces that part of the profile.
196
+ */
197
+ declare const TodoistEmulatorSeed: Schema.Struct<{
198
+ readonly profile: Schema.optionalKey<Schema.Literals<readonly ["default", "empty"]>>;
199
+ readonly userId: Schema.optionalKey<Schema.String>;
200
+ readonly projects: Schema.optionalKey<Schema.$Array<Schema.Struct<{
201
+ readonly id: Schema.String;
202
+ readonly name: Schema.String;
203
+ readonly parent_id: Schema.optionalKey<Schema.NullOr<Schema.String>>;
204
+ readonly child_order: Schema.optionalKey<Schema.Int>;
205
+ readonly created_at: Schema.optionalKey<Schema.String>;
206
+ readonly updated_at: Schema.optionalKey<Schema.String>;
207
+ }>>>;
208
+ readonly tasks: Schema.optionalKey<Schema.$Array<Schema.Struct<{
209
+ readonly id: Schema.String;
210
+ readonly project_id: Schema.String;
211
+ readonly content: Schema.String;
212
+ readonly labels: Schema.optionalKey<Schema.$Array<Schema.String>>;
213
+ readonly child_order: Schema.optionalKey<Schema.Int>;
214
+ readonly added_at: Schema.optionalKey<Schema.String>;
215
+ readonly updated_at: Schema.optionalKey<Schema.String>;
216
+ readonly due: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
217
+ readonly date: Schema.String;
218
+ readonly timezone: Schema.NullOr<Schema.String>;
219
+ readonly string: Schema.String;
220
+ readonly lang: Schema.String;
221
+ readonly is_recurring: Schema.Boolean;
222
+ }>>>;
223
+ }>>>;
224
+ readonly labels: Schema.optionalKey<Schema.$Array<Schema.Struct<{
225
+ readonly id: Schema.String;
226
+ readonly name: Schema.String;
227
+ readonly color: Schema.String;
228
+ readonly order: Schema.Int;
229
+ readonly is_favorite: Schema.Boolean;
230
+ }>>>;
231
+ }>;
232
+ type TodoistEmulatorSeed = typeof TodoistEmulatorSeed.Type;
233
+ /** Ids are opaque strings in the characters the conformance seeds accept. */
234
+ declare const todoistIdPattern: RegExp;
235
+ /** Prefix of every id the emulator mints; seeds may not use it, so ids never collide. */
236
+ declare const todoistReservedIdPrefix = "6XEmu";
237
+ /** Prefix of project ids the emulator mints (`6XEmuProject0001`). */
238
+ declare const todoistMintedProjectPrefix = "6XEmuProject";
239
+ /** Prefix of task ids the emulator mints (`6XEmuTask0000001`). */
240
+ declare const todoistMintedTaskPrefix = "6XEmuTask";
241
+ /** True for an id minted with `prefix`, that is, created through the recorded create flow. */
242
+ declare const isTodoistMintedId: (id: string, prefix: string) => boolean;
243
+ /**
244
+ * The paging project the paging fixture lists with `limit=2` (the only seeded project whose task
245
+ * listing a fixture records).
246
+ */
247
+ declare const todoistPagingProjectId = "6XSyntheticPage0";
248
+ /** A project in wire key order (the fixtures' order and default values). */
249
+ declare const makeTodoistProject: (fields: {
250
+ readonly id: string;
251
+ readonly name: string;
252
+ readonly parentId: string | null;
253
+ readonly childOrder: number;
254
+ readonly createdAt: string;
255
+ readonly updatedAt: string;
256
+ }) => TodoistEmulatorProject;
257
+ /** An active task in wire key order (the fixtures' order and default values). */
258
+ declare const makeTodoistTask: (fields: {
259
+ readonly id: string;
260
+ readonly userId: string;
261
+ readonly projectId: string;
262
+ readonly content: string;
263
+ readonly labels: ReadonlyArray<string>;
264
+ readonly addedAt: string;
265
+ readonly updatedAt: string;
266
+ readonly due: TodoistEmulatorDue | null;
267
+ readonly childOrder: number;
268
+ }) => TodoistEmulatorTask;
269
+ /** Decode and build a seed; a string is the reason it is invalid. */
270
+ declare const buildTodoistSeedState: (input: unknown) => TodoistEmulatorState | string;
271
+ /** Decode a full state (a restored snapshot); a string is the reason it is invalid. */
272
+ declare const decodeTodoistState: (input: unknown) => TodoistEmulatorState | string;
273
+ //#endregion
274
+ export { TodoistEmulatorDue, TodoistEmulatorLabel, TodoistEmulatorProfile, TodoistEmulatorProject, TodoistEmulatorProjectSeed, TodoistEmulatorSeed, TodoistEmulatorState, TodoistEmulatorStateSchema, TodoistEmulatorTask, TodoistEmulatorTaskSeed, buildTodoistSeedState, decodeTodoistState, isTodoistMintedId, makeTodoistProject, makeTodoistTask, todoistIdPattern, todoistMintedProjectPrefix, todoistMintedTaskPrefix, todoistPagingProjectId, todoistReservedIdPrefix };
275
+ //# sourceMappingURL=state.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.mts","names":[],"sources":["../../src/todoist/state.ts"],"mappings":";;;;cAiBa,kBAAA,EAAkB,MAAA,CAAA,MAAA;EAAA;;;;;;KAQnB,kBAAA,UAA4B,kBAAA,CAAmB,IAAI;;cAGlD,sBAAA,EAAsB,MAAA,CAAA,MAAA;EAAA;;;;;;;;;;;;;;;;;;;KAqBvB,sBAAA,UAAgC,sBAAA,CAAuB,IAAI;;cAG1D,mBAAA,EAAmB,MAAA,CAAA,MAAA;EAAA;;;;;;;yCAL9B;EAAA;;;;;;;;;;;;;;;;;;;;;;;KAkCU,mBAAA,UAA6B,mBAAA,CAAoB,IAAI;;cAGpD,oBAAA,EAAoB,MAAA,CAAA,MAAA;EAAA;;;;;;KAQrB,oBAAA,UAA8B,oBAAA,CAAqB,IAAI;AAAA,cAI7D,QAAA,EAAQ,MAAA,CAAA,MAAA;;;;;;cAUD,0BAAA,EAA0B,MAAA,CAAA,MAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAY3B,oBAAA;EACV,MAAA;EACA,QAAA,EAAU,aAAA,CAAc,sBAAA;EACxB,KAAA,EAAO,aAAA,CAAc,mBAAA;EACrB,MAAA,EAAQ,aAAA,CAAc,oBAAA;EACtB,QAAA,SAAiB,QAAA,CAAS,IAAA;AAAA;;cAIf,0BAAA,EAA0B,MAAA,CAAA,MAAA;EAAA;;;;;;;KAS3B,0BAAA,UAAoC,0BAAA,CAA2B,IAAI;;cAGlE,uBAAA,EAAuB,MAAA,CAAA,MAAA;EAAA;;;;;;;;;;;;;;;KAWxB,uBAAA,UAAiC,uBAAA,CAAwB,IAAI;;cAG5D,sBAAA,EAAsB,MAAA,CAAA,QAAA;AAAA,KAEvB,sBAAA,UAAgC,sBAAA,CAAuB,IAAI;;;;;cAM1D,mBAAA,EAAmB,MAAA,CAAA,MAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAQpB,mBAAA,UAA6B,mBAAA,CAAoB,IAAI;;cAYpD,gBAAA,EAAgB,MAA0B;;cAG1C,uBAAA;;cAGA,0BAAA;;cAGA,uBAAA;;cAGA,iBAAA,GAAqB,EAAA,UAAY,MAAc;;;;;cAY/C,sBAAA;;cAgEA,kBAAA,GAAsB,MAAA;EAAA,SACxB,EAAA;EAAA,SACA,IAAA;EAAA,SACA,QAAA;EAAA,SACA,UAAA;EAAA,SACA,SAAA;EAAA,SACA,SAAA;AAAA,MACP,sBAmBF;;cAGW,eAAA,GAAmB,MAAA;EAAA,SACrB,EAAA;EAAA,SACA,MAAA;EAAA,SACA,SAAA;EAAA,SACA,OAAA;EAAA,SACA,MAAA,EAAQ,aAAA;EAAA,SACR,OAAA;EAAA,SACA,SAAA;EAAA,SACA,GAAA,EAAK,kBAAA;EAAA,SACL,UAAA;AAAA,MACP,mBAAA;;cAsIS,qBAAA,GAAyB,KAAA,cAAiB,oBAAoB;;cAS9D,kBAAA,GAAsB,KAAA,cAAiB,oBAAoB"}
@@ -0,0 +1,345 @@
1
+ import { Result } from "effect";
2
+ import * as Schema from "effect/Schema";
3
+ //#region src/todoist/state.ts
4
+ /**
5
+ * Todoist emulator state: the typed entities, the seed input, the default seed, and the profiles
6
+ * (internal; re-exported by `src/todoist.ts`).
7
+ *
8
+ * Entity shapes and the default entities are copied as data from the synthetic Todoist
9
+ * conformance fixtures (the same user, project, task, and label ids as
10
+ * `todoistConformanceFixtureSeeds`), never imported from SDK code. Where no fixture records a
11
+ * value, the default is synthesized and says so: the work and paging projects themselves (the
12
+ * fixtures name only their ids) are the fixture project shape with synthetic names and
13
+ * `parent_id: null`.
14
+ *
15
+ * @experimental
16
+ */
17
+ /** A task due as the fixtures answer it. */
18
+ const TodoistEmulatorDue = Schema.Struct({
19
+ date: Schema.String,
20
+ timezone: Schema.NullOr(Schema.String),
21
+ string: Schema.String,
22
+ lang: Schema.String,
23
+ is_recurring: Schema.Boolean
24
+ });
25
+ /** A stored project, in the fixtures' API v1 wire shape. Deleted projects are removed. */
26
+ const TodoistEmulatorProject = Schema.Struct({
27
+ id: Schema.String,
28
+ name: Schema.String,
29
+ parent_id: Schema.NullOr(Schema.String),
30
+ child_order: Schema.Int,
31
+ color: Schema.String,
32
+ description: Schema.String,
33
+ is_archived: Schema.Boolean,
34
+ is_deleted: Schema.Boolean,
35
+ is_favorite: Schema.Boolean,
36
+ is_frozen: Schema.Boolean,
37
+ is_shared: Schema.Boolean,
38
+ is_collapsed: Schema.Boolean,
39
+ can_assign_tasks: Schema.Boolean,
40
+ inbox_project: Schema.Boolean,
41
+ view_style: Schema.String,
42
+ default_order: Schema.Int,
43
+ created_at: Schema.String,
44
+ updated_at: Schema.String
45
+ });
46
+ /** A stored task, in the fixtures' API v1 wire shape. */
47
+ const TodoistEmulatorTask = Schema.Struct({
48
+ id: Schema.String,
49
+ user_id: Schema.String,
50
+ project_id: Schema.String,
51
+ section_id: Schema.Null,
52
+ parent_id: Schema.Null,
53
+ added_by_uid: Schema.String,
54
+ assigned_by_uid: Schema.Null,
55
+ responsible_uid: Schema.Null,
56
+ /** Label NAMES, as the fixtures answer them. */
57
+ labels: Schema.Array(Schema.String),
58
+ deadline: Schema.Null,
59
+ duration: Schema.Null,
60
+ /** `true` once closed: a closed task is no longer active. */
61
+ checked: Schema.Boolean,
62
+ is_deleted: Schema.Boolean,
63
+ added_at: Schema.String,
64
+ completed_at: Schema.NullOr(Schema.String),
65
+ updated_at: Schema.String,
66
+ due: Schema.NullOr(TodoistEmulatorDue),
67
+ priority: Schema.Int,
68
+ child_order: Schema.Int,
69
+ content: Schema.String,
70
+ description: Schema.String,
71
+ note_count: Schema.Int,
72
+ day_order: Schema.Int,
73
+ is_collapsed: Schema.Boolean
74
+ });
75
+ /** A personal label, in the fixtures' wire shape. */
76
+ const TodoistEmulatorLabel = Schema.Struct({
77
+ id: Schema.String,
78
+ name: Schema.String,
79
+ color: Schema.String,
80
+ order: Schema.Int,
81
+ is_favorite: Schema.Boolean
82
+ });
83
+ const Counter = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
84
+ const Counters = Schema.Struct({
85
+ /** Next number in created project ids (`6XEmuProject0001`). */
86
+ nextProjectNumber: Counter,
87
+ /** Next number in created task ids (`6XEmuTask0000001`). */
88
+ nextTaskNumber: Counter,
89
+ /** Next `error_extra.event_id` number of a 404 answer. */
90
+ nextEventNumber: Counter
91
+ });
92
+ /** The whole emulator state (JSON-compatible; what `snapshot()` returns). */
93
+ const TodoistEmulatorStateSchema = Schema.Struct({
94
+ userId: Schema.String,
95
+ projects: Schema.Array(TodoistEmulatorProject),
96
+ tasks: Schema.Array(TodoistEmulatorTask),
97
+ labels: Schema.Array(TodoistEmulatorLabel),
98
+ counters: Counters
99
+ });
100
+ /** A seeded project: `id` and `name` are required; the rest default to the fixture values. */
101
+ const TodoistEmulatorProjectSeed = Schema.Struct({
102
+ id: Schema.String,
103
+ name: Schema.String,
104
+ parent_id: Schema.optionalKey(Schema.NullOr(Schema.String)),
105
+ child_order: Schema.optionalKey(Schema.Int),
106
+ created_at: Schema.optionalKey(Schema.String),
107
+ updated_at: Schema.optionalKey(Schema.String)
108
+ });
109
+ /** A seeded active task: `id`, `project_id`, and `content` are required. */
110
+ const TodoistEmulatorTaskSeed = Schema.Struct({
111
+ id: Schema.String,
112
+ project_id: Schema.String,
113
+ content: Schema.String,
114
+ labels: Schema.optionalKey(Schema.Array(Schema.String)),
115
+ child_order: Schema.optionalKey(Schema.Int),
116
+ added_at: Schema.optionalKey(Schema.String),
117
+ updated_at: Schema.optionalKey(Schema.String),
118
+ due: Schema.optionalKey(Schema.NullOr(TodoistEmulatorDue))
119
+ });
120
+ /** Account-variance profiles for the default seed. */
121
+ const TodoistEmulatorProfile = Schema.Literals(["default", "empty"]);
122
+ /**
123
+ * A typed seed. Start from `profile` (default `'default'`, the fixture entities; `'empty'` keeps
124
+ * only the work project); every other key, when given, replaces that part of the profile.
125
+ */
126
+ const TodoistEmulatorSeed = Schema.Struct({
127
+ profile: Schema.optionalKey(TodoistEmulatorProfile),
128
+ userId: Schema.optionalKey(Schema.String),
129
+ projects: Schema.optionalKey(Schema.Array(TodoistEmulatorProjectSeed)),
130
+ tasks: Schema.optionalKey(Schema.Array(TodoistEmulatorTaskSeed)),
131
+ labels: Schema.optionalKey(Schema.Array(TodoistEmulatorLabel))
132
+ });
133
+ const strict = { onExcessProperty: "error" };
134
+ const decodeSeedInput = Schema.decodeUnknownResult(TodoistEmulatorSeed, strict);
135
+ const decodeStateInput = Schema.decodeUnknownResult(TodoistEmulatorStateSchema, strict);
136
+ const issueMessage = (issue) => new Schema.SchemaError(issue).message;
137
+ /** Ids are opaque strings in the characters the conformance seeds accept. */
138
+ const todoistIdPattern = /^[A-Za-z0-9_-]{1,64}$/;
139
+ /** Prefix of every id the emulator mints; seeds may not use it, so ids never collide. */
140
+ const todoistReservedIdPrefix = "6XEmu";
141
+ /** Prefix of project ids the emulator mints (`6XEmuProject0001`). */
142
+ const todoistMintedProjectPrefix = `${todoistReservedIdPrefix}Project`;
143
+ /** Prefix of task ids the emulator mints (`6XEmuTask0000001`). */
144
+ const todoistMintedTaskPrefix = `${todoistReservedIdPrefix}Task`;
145
+ /** True for an id minted with `prefix`, that is, created through the recorded create flow. */
146
+ const isTodoistMintedId = (id, prefix) => id.startsWith(prefix);
147
+ const userId = "10000001";
148
+ const workProjectId = "6XSyntheticWork0";
149
+ /**
150
+ * The paging project the paging fixture lists with `limit=2` (the only seeded project whose task
151
+ * listing a fixture records).
152
+ */
153
+ const todoistPagingProjectId = "6XSyntheticPage0";
154
+ const pagingProjectId = todoistPagingProjectId;
155
+ /** Fixture timestamp of the seeded tasks (`tasks-paging.ts`, `task-labels.ts`). */
156
+ const seededAt = "2026-09-20T10:00:00.000000Z";
157
+ const defaultProjects = [{
158
+ id: workProjectId,
159
+ name: "Synthetic work project",
160
+ child_order: 1
161
+ }, {
162
+ id: pagingProjectId,
163
+ name: "Synthetic paging project",
164
+ child_order: 2
165
+ }];
166
+ const pagingTask = (id, content, order) => ({
167
+ id,
168
+ project_id: pagingProjectId,
169
+ content,
170
+ child_order: order
171
+ });
172
+ const defaultTasks = [
173
+ pagingTask("6XSynPagingTask1", "Synthetic paging task one", 1),
174
+ pagingTask("6XSynPagingTask2", "Synthetic paging task two", 2),
175
+ pagingTask("6XSynPagingTask3", "Synthetic paging task three", 3),
176
+ {
177
+ id: "6XSyntheticLabel",
178
+ project_id: workProjectId,
179
+ content: "Synthetic labeled task",
180
+ labels: ["synthetic-errand", "synthetic-waiting"],
181
+ child_order: 1
182
+ }
183
+ ];
184
+ const label = (id, name, order) => ({
185
+ id,
186
+ name,
187
+ color: "charcoal",
188
+ order,
189
+ is_favorite: false
190
+ });
191
+ const defaultLabels = [
192
+ label("2100000001", "synthetic-errand", 1),
193
+ label("2100000002", "synthetic-waiting", 2),
194
+ label("2100000003", "synthetic-someday", 3)
195
+ ];
196
+ const profileEntities = (profile) => {
197
+ switch (profile) {
198
+ case "default": return {
199
+ userId,
200
+ projects: defaultProjects,
201
+ tasks: defaultTasks,
202
+ labels: defaultLabels
203
+ };
204
+ case "empty": return {
205
+ userId,
206
+ projects: defaultProjects.slice(0, 1),
207
+ tasks: [],
208
+ labels: []
209
+ };
210
+ }
211
+ };
212
+ /** A project in wire key order (the fixtures' order and default values). */
213
+ const makeTodoistProject = (fields) => ({
214
+ id: fields.id,
215
+ name: fields.name,
216
+ parent_id: fields.parentId,
217
+ child_order: fields.childOrder,
218
+ color: "charcoal",
219
+ description: "",
220
+ is_archived: false,
221
+ is_deleted: false,
222
+ is_favorite: false,
223
+ is_frozen: false,
224
+ is_shared: false,
225
+ is_collapsed: false,
226
+ can_assign_tasks: false,
227
+ inbox_project: false,
228
+ view_style: "list",
229
+ default_order: 0,
230
+ created_at: fields.createdAt,
231
+ updated_at: fields.updatedAt
232
+ });
233
+ /** An active task in wire key order (the fixtures' order and default values). */
234
+ const makeTodoistTask = (fields) => ({
235
+ id: fields.id,
236
+ user_id: fields.userId,
237
+ project_id: fields.projectId,
238
+ section_id: null,
239
+ parent_id: null,
240
+ added_by_uid: fields.userId,
241
+ assigned_by_uid: null,
242
+ responsible_uid: null,
243
+ labels: fields.labels,
244
+ deadline: null,
245
+ duration: null,
246
+ checked: false,
247
+ is_deleted: false,
248
+ added_at: fields.addedAt,
249
+ completed_at: null,
250
+ updated_at: fields.updatedAt,
251
+ due: fields.due,
252
+ priority: 1,
253
+ child_order: fields.childOrder,
254
+ content: fields.content,
255
+ description: "",
256
+ note_count: 0,
257
+ day_order: -1,
258
+ is_collapsed: false
259
+ });
260
+ const duplicate = (values) => values.find((value, index) => values.indexOf(value) !== index);
261
+ /** Integrity problems a decoded seed can still have (ids, duplicates, dangling references). */
262
+ const seedProblem = (entities) => {
263
+ const projectIds = entities.projects.map((project) => project.id);
264
+ const taskIds = entities.tasks.map((task) => task.id);
265
+ const labelIds = entities.labels.map((item) => item.id);
266
+ const invalid = [
267
+ ...projectIds,
268
+ ...taskIds,
269
+ ...labelIds
270
+ ].find((id) => !todoistIdPattern.test(id));
271
+ if (invalid !== void 0) return `id ${JSON.stringify(invalid)} is not 1-64 of [A-Za-z0-9_-]`;
272
+ const reserved = [
273
+ ...projectIds,
274
+ ...taskIds,
275
+ ...labelIds
276
+ ].find((id) => id.startsWith(todoistReservedIdPrefix));
277
+ if (reserved !== void 0) return `id ${reserved} uses the prefix ${todoistReservedIdPrefix}, reserved for ids the emulator mints`;
278
+ const duplicates = [
279
+ ["project id", duplicate(projectIds)],
280
+ ["task id", duplicate(taskIds)],
281
+ ["label id", duplicate(labelIds)],
282
+ ["label name", duplicate(entities.labels.map((item) => item.name))]
283
+ ];
284
+ for (const [name, value] of duplicates) if (value !== void 0) return `duplicate ${name} ${value}`;
285
+ const orphan = entities.projects.find((project) => project.parent_id !== void 0 && project.parent_id !== null && !projectIds.includes(project.parent_id));
286
+ if (orphan !== void 0) return `project ${orphan.id} references a missing parent project`;
287
+ const task = entities.tasks.find((candidate) => !projectIds.includes(candidate.project_id));
288
+ if (task !== void 0) return `task ${task.id} references missing project ${task.project_id}`;
289
+ const names = entities.labels.map((item) => item.name);
290
+ const unlabeled = entities.tasks.find((candidate) => (candidate.labels ?? []).some((name) => !names.includes(name)));
291
+ return unlabeled === void 0 ? void 0 : `task ${unlabeled.id} carries a label that is not a seeded personal label`;
292
+ };
293
+ const stateFromSeed = (seed) => {
294
+ const profile = profileEntities(seed.profile ?? "default");
295
+ const entities = {
296
+ userId: seed.userId ?? profile.userId,
297
+ projects: seed.projects ?? profile.projects,
298
+ tasks: seed.tasks ?? profile.tasks,
299
+ labels: seed.labels ?? profile.labels
300
+ };
301
+ const problem = seedProblem(entities);
302
+ if (problem !== void 0) return problem;
303
+ return {
304
+ userId: entities.userId,
305
+ projects: entities.projects.map((project, index) => makeTodoistProject({
306
+ id: project.id,
307
+ name: project.name,
308
+ parentId: project.parent_id ?? null,
309
+ childOrder: project.child_order ?? index + 1,
310
+ createdAt: project.created_at ?? seededAt,
311
+ updatedAt: project.updated_at ?? project.created_at ?? seededAt
312
+ })),
313
+ tasks: entities.tasks.map((task, index) => makeTodoistTask({
314
+ id: task.id,
315
+ userId: entities.userId,
316
+ projectId: task.project_id,
317
+ content: task.content,
318
+ labels: task.labels ?? [],
319
+ addedAt: task.added_at ?? seededAt,
320
+ updatedAt: task.updated_at ?? task.added_at ?? seededAt,
321
+ due: task.due ?? null,
322
+ childOrder: task.child_order ?? index + 1
323
+ })),
324
+ labels: entities.labels,
325
+ counters: {
326
+ nextProjectNumber: 1,
327
+ nextTaskNumber: 1,
328
+ nextEventNumber: 1
329
+ }
330
+ };
331
+ };
332
+ /** Decode and build a seed; a string is the reason it is invalid. */
333
+ const buildTodoistSeedState = (input) => {
334
+ const decoded = decodeSeedInput(input);
335
+ return Result.isFailure(decoded) ? issueMessage(decoded.failure.issue) : stateFromSeed(decoded.success);
336
+ };
337
+ /** Decode a full state (a restored snapshot); a string is the reason it is invalid. */
338
+ const decodeTodoistState = (input) => {
339
+ const decoded = decodeStateInput(input);
340
+ return Result.isFailure(decoded) ? issueMessage(decoded.failure.issue) : { ...decoded.success };
341
+ };
342
+ //#endregion
343
+ export { TodoistEmulatorDue, TodoistEmulatorLabel, TodoistEmulatorProfile, TodoistEmulatorProject, TodoistEmulatorProjectSeed, TodoistEmulatorSeed, TodoistEmulatorStateSchema, TodoistEmulatorTask, TodoistEmulatorTaskSeed, buildTodoistSeedState, decodeTodoistState, isTodoistMintedId, makeTodoistProject, makeTodoistTask, todoistIdPattern, todoistMintedProjectPrefix, todoistMintedTaskPrefix, todoistPagingProjectId, todoistReservedIdPrefix };
344
+
345
+ //# sourceMappingURL=state.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.mjs","names":[],"sources":["../../src/todoist/state.ts"],"sourcesContent":["/**\n * Todoist emulator state: the typed entities, the seed input, the default seed, and the profiles\n * (internal; re-exported by `src/todoist.ts`).\n *\n * Entity shapes and the default entities are copied as data from the synthetic Todoist\n * conformance fixtures (the same user, project, task, and label ids as\n * `todoistConformanceFixtureSeeds`), never imported from SDK code. Where no fixture records a\n * value, the default is synthesized and says so: the work and paging projects themselves (the\n * fixtures name only their ids) are the fixture project shape with synthetic names and\n * `parent_id: null`.\n *\n * @experimental\n */\nimport { Result } from 'effect'\nimport * as Schema from 'effect/Schema'\n\n/** A task due as the fixtures answer it. */\nexport const TodoistEmulatorDue = Schema.Struct({\n date: Schema.String,\n timezone: Schema.NullOr(Schema.String),\n string: Schema.String,\n lang: Schema.String,\n is_recurring: Schema.Boolean\n})\n\nexport type TodoistEmulatorDue = typeof TodoistEmulatorDue.Type\n\n/** A stored project, in the fixtures' API v1 wire shape. Deleted projects are removed. */\nexport const TodoistEmulatorProject = Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n parent_id: Schema.NullOr(Schema.String),\n child_order: Schema.Int,\n color: Schema.String,\n description: Schema.String,\n is_archived: Schema.Boolean,\n is_deleted: Schema.Boolean,\n is_favorite: Schema.Boolean,\n is_frozen: Schema.Boolean,\n is_shared: Schema.Boolean,\n is_collapsed: Schema.Boolean,\n can_assign_tasks: Schema.Boolean,\n inbox_project: Schema.Boolean,\n view_style: Schema.String,\n default_order: Schema.Int,\n created_at: Schema.String,\n updated_at: Schema.String\n})\n\nexport type TodoistEmulatorProject = typeof TodoistEmulatorProject.Type\n\n/** A stored task, in the fixtures' API v1 wire shape. */\nexport const TodoistEmulatorTask = Schema.Struct({\n id: Schema.String,\n user_id: Schema.String,\n project_id: Schema.String,\n section_id: Schema.Null,\n parent_id: Schema.Null,\n added_by_uid: Schema.String,\n assigned_by_uid: Schema.Null,\n responsible_uid: Schema.Null,\n /** Label NAMES, as the fixtures answer them. */\n labels: Schema.Array(Schema.String),\n deadline: Schema.Null,\n duration: Schema.Null,\n /** `true` once closed: a closed task is no longer active. */\n checked: Schema.Boolean,\n is_deleted: Schema.Boolean,\n added_at: Schema.String,\n completed_at: Schema.NullOr(Schema.String),\n updated_at: Schema.String,\n due: Schema.NullOr(TodoistEmulatorDue),\n priority: Schema.Int,\n child_order: Schema.Int,\n content: Schema.String,\n description: Schema.String,\n note_count: Schema.Int,\n day_order: Schema.Int,\n is_collapsed: Schema.Boolean\n})\n\nexport type TodoistEmulatorTask = typeof TodoistEmulatorTask.Type\n\n/** A personal label, in the fixtures' wire shape. */\nexport const TodoistEmulatorLabel = Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n color: Schema.String,\n order: Schema.Int,\n is_favorite: Schema.Boolean\n})\n\nexport type TodoistEmulatorLabel = typeof TodoistEmulatorLabel.Type\n\nconst Counter = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))\n\nconst Counters = Schema.Struct({\n /** Next number in created project ids (`6XEmuProject0001`). */\n nextProjectNumber: Counter,\n /** Next number in created task ids (`6XEmuTask0000001`). */\n nextTaskNumber: Counter,\n /** Next `error_extra.event_id` number of a 404 answer. */\n nextEventNumber: Counter\n})\n\n/** The whole emulator state (JSON-compatible; what `snapshot()` returns). */\nexport const TodoistEmulatorStateSchema = Schema.Struct({\n userId: Schema.String,\n projects: Schema.Array(TodoistEmulatorProject),\n tasks: Schema.Array(TodoistEmulatorTask),\n labels: Schema.Array(TodoistEmulatorLabel),\n counters: Counters\n})\n\n/**\n * The emulator state. The container is mutable (route handlers replace whole entity lists);\n * every entity is replaced, never edited in place.\n */\nexport type TodoistEmulatorState = {\n userId: string\n projects: ReadonlyArray<TodoistEmulatorProject>\n tasks: ReadonlyArray<TodoistEmulatorTask>\n labels: ReadonlyArray<TodoistEmulatorLabel>\n counters: typeof Counters.Type\n}\n\n/** A seeded project: `id` and `name` are required; the rest default to the fixture values. */\nexport const TodoistEmulatorProjectSeed = Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n parent_id: Schema.optionalKey(Schema.NullOr(Schema.String)),\n child_order: Schema.optionalKey(Schema.Int),\n created_at: Schema.optionalKey(Schema.String),\n updated_at: Schema.optionalKey(Schema.String)\n})\n\nexport type TodoistEmulatorProjectSeed = typeof TodoistEmulatorProjectSeed.Type\n\n/** A seeded active task: `id`, `project_id`, and `content` are required. */\nexport const TodoistEmulatorTaskSeed = Schema.Struct({\n id: Schema.String,\n project_id: Schema.String,\n content: Schema.String,\n labels: Schema.optionalKey(Schema.Array(Schema.String)),\n child_order: Schema.optionalKey(Schema.Int),\n added_at: Schema.optionalKey(Schema.String),\n updated_at: Schema.optionalKey(Schema.String),\n due: Schema.optionalKey(Schema.NullOr(TodoistEmulatorDue))\n})\n\nexport type TodoistEmulatorTaskSeed = typeof TodoistEmulatorTaskSeed.Type\n\n/** Account-variance profiles for the default seed. */\nexport const TodoistEmulatorProfile = Schema.Literals(['default', 'empty'])\n\nexport type TodoistEmulatorProfile = typeof TodoistEmulatorProfile.Type\n\n/**\n * A typed seed. Start from `profile` (default `'default'`, the fixture entities; `'empty'` keeps\n * only the work project); every other key, when given, replaces that part of the profile.\n */\nexport const TodoistEmulatorSeed = Schema.Struct({\n profile: Schema.optionalKey(TodoistEmulatorProfile),\n userId: Schema.optionalKey(Schema.String),\n projects: Schema.optionalKey(Schema.Array(TodoistEmulatorProjectSeed)),\n tasks: Schema.optionalKey(Schema.Array(TodoistEmulatorTaskSeed)),\n labels: Schema.optionalKey(Schema.Array(TodoistEmulatorLabel))\n})\n\nexport type TodoistEmulatorSeed = typeof TodoistEmulatorSeed.Type\n\nconst strict = { onExcessProperty: 'error' } as const\n\nconst decodeSeedInput = Schema.decodeUnknownResult(TodoistEmulatorSeed, strict)\n\nconst decodeStateInput = Schema.decodeUnknownResult(TodoistEmulatorStateSchema, strict)\n\nconst issueMessage = (issue: Schema.SchemaError['issue']): string =>\n new Schema.SchemaError(issue).message\n\n/** Ids are opaque strings in the characters the conformance seeds accept. */\nexport const todoistIdPattern = /^[A-Za-z0-9_-]{1,64}$/\n\n/** Prefix of every id the emulator mints; seeds may not use it, so ids never collide. */\nexport const todoistReservedIdPrefix = '6XEmu'\n\n/** Prefix of project ids the emulator mints (`6XEmuProject0001`). */\nexport const todoistMintedProjectPrefix = `${todoistReservedIdPrefix}Project`\n\n/** Prefix of task ids the emulator mints (`6XEmuTask0000001`). */\nexport const todoistMintedTaskPrefix = `${todoistReservedIdPrefix}Task`\n\n/** True for an id minted with `prefix`, that is, created through the recorded create flow. */\nexport const isTodoistMintedId = (id: string, prefix: string): boolean => id.startsWith(prefix)\n\n// Default entities, copied from the fixtures.\n\nconst userId = '10000001'\n\nconst workProjectId = '6XSyntheticWork0'\n\n/**\n * The paging project the paging fixture lists with `limit=2` (the only seeded project whose task\n * listing a fixture records).\n */\nexport const todoistPagingProjectId = '6XSyntheticPage0'\n\nconst pagingProjectId = todoistPagingProjectId\n\n/** Fixture timestamp of the seeded tasks (`tasks-paging.ts`, `task-labels.ts`). */\nconst seededAt = '2026-09-20T10:00:00.000000Z'\n\nconst defaultProjects: ReadonlyArray<TodoistEmulatorProjectSeed> = [\n // Synthesized: the fixtures name only the ids of these two projects.\n { id: workProjectId, name: 'Synthetic work project', child_order: 1 },\n { id: pagingProjectId, name: 'Synthetic paging project', child_order: 2 }\n]\n\nconst pagingTask = (id: string, content: string, order: number): TodoistEmulatorTaskSeed => ({\n id,\n project_id: pagingProjectId,\n content,\n child_order: order\n})\n\nconst defaultTasks: ReadonlyArray<TodoistEmulatorTaskSeed> = [\n pagingTask('6XSynPagingTask1', 'Synthetic paging task one', 1),\n pagingTask('6XSynPagingTask2', 'Synthetic paging task two', 2),\n pagingTask('6XSynPagingTask3', 'Synthetic paging task three', 3),\n {\n id: '6XSyntheticLabel',\n project_id: workProjectId,\n content: 'Synthetic labeled task',\n labels: ['synthetic-errand', 'synthetic-waiting'],\n child_order: 1\n }\n]\n\nconst label = (id: string, name: string, order: number): TodoistEmulatorLabel => ({\n id,\n name,\n color: 'charcoal',\n order,\n is_favorite: false\n})\n\nconst defaultLabels: ReadonlyArray<TodoistEmulatorLabel> = [\n label('2100000001', 'synthetic-errand', 1),\n label('2100000002', 'synthetic-waiting', 2),\n label('2100000003', 'synthetic-someday', 3)\n]\n\ntype ProfileEntities = {\n readonly userId: string\n readonly projects: ReadonlyArray<TodoistEmulatorProjectSeed>\n readonly tasks: ReadonlyArray<TodoistEmulatorTaskSeed>\n readonly labels: ReadonlyArray<TodoistEmulatorLabel>\n}\n\nconst profileEntities = (profile: TodoistEmulatorProfile): ProfileEntities => {\n switch (profile) {\n case 'default':\n return { userId, projects: defaultProjects, tasks: defaultTasks, labels: defaultLabels }\n case 'empty':\n return { userId, projects: defaultProjects.slice(0, 1), tasks: [], labels: [] }\n }\n}\n\n/** A project in wire key order (the fixtures' order and default values). */\nexport const makeTodoistProject = (fields: {\n readonly id: string\n readonly name: string\n readonly parentId: string | null\n readonly childOrder: number\n readonly createdAt: string\n readonly updatedAt: string\n}): TodoistEmulatorProject => ({\n id: fields.id,\n name: fields.name,\n parent_id: fields.parentId,\n child_order: fields.childOrder,\n color: 'charcoal',\n description: '',\n is_archived: false,\n is_deleted: false,\n is_favorite: false,\n is_frozen: false,\n is_shared: false,\n is_collapsed: false,\n can_assign_tasks: false,\n inbox_project: false,\n view_style: 'list',\n default_order: 0,\n created_at: fields.createdAt,\n updated_at: fields.updatedAt\n})\n\n/** An active task in wire key order (the fixtures' order and default values). */\nexport const makeTodoistTask = (fields: {\n readonly id: string\n readonly userId: string\n readonly projectId: string\n readonly content: string\n readonly labels: ReadonlyArray<string>\n readonly addedAt: string\n readonly updatedAt: string\n readonly due: TodoistEmulatorDue | null\n readonly childOrder: number\n}): TodoistEmulatorTask => ({\n id: fields.id,\n user_id: fields.userId,\n project_id: fields.projectId,\n section_id: null,\n parent_id: null,\n added_by_uid: fields.userId,\n assigned_by_uid: null,\n responsible_uid: null,\n labels: fields.labels,\n deadline: null,\n duration: null,\n checked: false,\n is_deleted: false,\n added_at: fields.addedAt,\n completed_at: null,\n updated_at: fields.updatedAt,\n due: fields.due,\n priority: 1,\n child_order: fields.childOrder,\n content: fields.content,\n description: '',\n note_count: 0,\n day_order: -1,\n is_collapsed: false\n})\n\nconst duplicate = (values: ReadonlyArray<string>): string | undefined =>\n values.find((value, index) => values.indexOf(value) !== index)\n\n/** Integrity problems a decoded seed can still have (ids, duplicates, dangling references). */\nconst seedProblem = (entities: ProfileEntities): string | undefined => {\n const projectIds = entities.projects.map(project => project.id)\n const taskIds = entities.tasks.map(task => task.id)\n const labelIds = entities.labels.map(item => item.id)\n\n const invalid = [...projectIds, ...taskIds, ...labelIds].find(id => !todoistIdPattern.test(id))\n\n if (invalid !== undefined) return `id ${JSON.stringify(invalid)} is not 1-64 of [A-Za-z0-9_-]`\n\n // Minted ids come from counters that start at 1: a seeded id in their namespace could collide.\n const reserved = [...projectIds, ...taskIds, ...labelIds].find(id =>\n id.startsWith(todoistReservedIdPrefix)\n )\n\n if (reserved !== undefined) {\n return (\n `id ${reserved} uses the prefix ${todoistReservedIdPrefix}, ` +\n 'reserved for ids the emulator mints'\n )\n }\n\n const duplicates: ReadonlyArray<readonly [string, string | undefined]> = [\n ['project id', duplicate(projectIds)],\n ['task id', duplicate(taskIds)],\n ['label id', duplicate(labelIds)],\n ['label name', duplicate(entities.labels.map(item => item.name))]\n ]\n\n for (const [name, value] of duplicates) {\n if (value !== undefined) return `duplicate ${name} ${value}`\n }\n\n const orphan = entities.projects.find(\n project =>\n project.parent_id !== undefined &&\n project.parent_id !== null &&\n !projectIds.includes(project.parent_id)\n )\n\n if (orphan !== undefined) {\n return `project ${orphan.id} references a missing parent project`\n }\n\n const task = entities.tasks.find(candidate => !projectIds.includes(candidate.project_id))\n\n if (task !== undefined) return `task ${task.id} references missing project ${task.project_id}`\n\n const names = entities.labels.map(item => item.name)\n\n const unlabeled = entities.tasks.find(candidate =>\n (candidate.labels ?? []).some(name => !names.includes(name))\n )\n\n return unlabeled === undefined\n ? undefined\n : `task ${unlabeled.id} carries a label that is not a seeded personal label`\n}\n\nconst stateFromSeed = (seed: TodoistEmulatorSeed): TodoistEmulatorState | string => {\n const profile = profileEntities(seed.profile ?? 'default')\n\n const entities: ProfileEntities = {\n userId: seed.userId ?? profile.userId,\n projects: seed.projects ?? profile.projects,\n tasks: seed.tasks ?? profile.tasks,\n labels: seed.labels ?? profile.labels\n }\n\n const problem = seedProblem(entities)\n\n if (problem !== undefined) return problem\n\n return {\n userId: entities.userId,\n projects: entities.projects.map((project, index) =>\n makeTodoistProject({\n id: project.id,\n name: project.name,\n parentId: project.parent_id ?? null,\n childOrder: project.child_order ?? index + 1,\n createdAt: project.created_at ?? seededAt,\n updatedAt: project.updated_at ?? project.created_at ?? seededAt\n })\n ),\n tasks: entities.tasks.map((task, index) =>\n makeTodoistTask({\n id: task.id,\n userId: entities.userId,\n projectId: task.project_id,\n content: task.content,\n labels: task.labels ?? [],\n addedAt: task.added_at ?? seededAt,\n updatedAt: task.updated_at ?? task.added_at ?? seededAt,\n due: task.due ?? null,\n childOrder: task.child_order ?? index + 1\n })\n ),\n labels: entities.labels,\n counters: { nextProjectNumber: 1, nextTaskNumber: 1, nextEventNumber: 1 }\n }\n}\n\n/** Decode and build a seed; a string is the reason it is invalid. */\nexport const buildTodoistSeedState = (input: unknown): TodoistEmulatorState | string => {\n const decoded = decodeSeedInput(input)\n\n return Result.isFailure(decoded)\n ? issueMessage(decoded.failure.issue)\n : stateFromSeed(decoded.success)\n}\n\n/** Decode a full state (a restored snapshot); a string is the reason it is invalid. */\nexport const decodeTodoistState = (input: unknown): TodoistEmulatorState | string => {\n const decoded = decodeStateInput(input)\n\n return Result.isFailure(decoded) ? issueMessage(decoded.failure.issue) : { ...decoded.success }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAa,qBAAqB,OAAO,OAAO;CAC9C,MAAM,OAAO;CACb,UAAU,OAAO,OAAO,OAAO,MAAM;CACrC,QAAQ,OAAO;CACf,MAAM,OAAO;CACb,cAAc,OAAO;AACvB,CAAC;;AAKD,MAAa,yBAAyB,OAAO,OAAO;CAClD,IAAI,OAAO;CACX,MAAM,OAAO;CACb,WAAW,OAAO,OAAO,OAAO,MAAM;CACtC,aAAa,OAAO;CACpB,OAAO,OAAO;CACd,aAAa,OAAO;CACpB,aAAa,OAAO;CACpB,YAAY,OAAO;CACnB,aAAa,OAAO;CACpB,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,cAAc,OAAO;CACrB,kBAAkB,OAAO;CACzB,eAAe,OAAO;CACtB,YAAY,OAAO;CACnB,eAAe,OAAO;CACtB,YAAY,OAAO;CACnB,YAAY,OAAO;AACrB,CAAC;;AAKD,MAAa,sBAAsB,OAAO,OAAO;CAC/C,IAAI,OAAO;CACX,SAAS,OAAO;CAChB,YAAY,OAAO;CACnB,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,cAAc,OAAO;CACrB,iBAAiB,OAAO;CACxB,iBAAiB,OAAO;;CAExB,QAAQ,OAAO,MAAM,OAAO,MAAM;CAClC,UA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