orgnote-api 0.20.2 → 0.40.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 (283) hide show
  1. package/api.d.ts +93 -98
  2. package/constants/{command-groups.contant.d.ts → command-groups.d.ts} +2 -1
  3. package/constants/{command-groups.contant.js → command-groups.js} +2 -0
  4. package/constants/extension-errors.d.ts +9 -0
  5. package/constants/extension-errors.js +18 -0
  6. package/constants/file-guard-errors.d.ts +8 -0
  7. package/constants/file-guard-errors.js +18 -0
  8. package/constants/git-errors.d.ts +9 -0
  9. package/constants/git-errors.js +18 -0
  10. package/constants/i18n-keys.d.ts +371 -0
  11. package/constants/i18n-keys.js +158 -0
  12. package/constants/index.d.ts +9 -1
  13. package/constants/index.js +9 -1
  14. package/constants/oauth-providers.d.ts +1 -0
  15. package/constants/oauth-providers.js +1 -0
  16. package/constants/route-names.d.ts +36 -0
  17. package/constants/route-names.js +37 -0
  18. package/constants/route-paths.d.ts +5 -0
  19. package/constants/route-paths.js +4 -0
  20. package/constants/style-sizes.d.ts +1 -0
  21. package/constants/style-sizes.js +1 -0
  22. package/encryption/__tests__/encryption.spec.js +4 -5
  23. package/encryption/__tests__/note-encryption.spec.js +46 -348
  24. package/encryption/encryption.d.ts +9 -4
  25. package/encryption/encryption.js +25 -5
  26. package/encryption/note-encryption.d.ts +1 -1
  27. package/encryption/note-encryption.js +6 -6
  28. package/files-api.d.ts +0 -1
  29. package/index.d.ts +4 -1
  30. package/index.js +4 -1
  31. package/mappers/orgnode-to-note.d.ts +2 -2
  32. package/mappers/orgnode-to-note.js +3 -2
  33. package/models/auth-store.d.ts +3 -3
  34. package/models/buffer-store.d.ts +14 -0
  35. package/models/buffer.d.ts +24 -0
  36. package/models/colors.d.ts +1 -0
  37. package/models/command.d.ts +13 -8
  38. package/models/commands-group-store.d.ts +11 -0
  39. package/models/commands-store.d.ts +13 -0
  40. package/models/completion-store.d.ts +14 -0
  41. package/models/completion.d.ts +16 -7
  42. package/models/config-store.d.ts +9 -0
  43. package/models/confirmation-modal.d.ts +11 -0
  44. package/models/context-menu-store.d.ts +10 -0
  45. package/models/cron-store.d.ts +21 -0
  46. package/models/cron-task.d.ts +30 -0
  47. package/models/css-utils.d.ts +17 -0
  48. package/models/default-commands.d.ts +52 -3
  49. package/models/default-commands.js +59 -2
  50. package/models/encryption-store.d.ts +10 -0
  51. package/models/encryption-store.js +1 -0
  52. package/models/encryption.d.ts +54 -11
  53. package/models/encryption.js +28 -1
  54. package/models/extension-registry-store.d.ts +9 -0
  55. package/models/extension-registry-store.js +1 -0
  56. package/models/extension-store.d.ts +18 -0
  57. package/models/extension-store.js +1 -0
  58. package/models/extension.d.ts +96 -24
  59. package/models/extension.js +88 -1
  60. package/models/file-guard-store.d.ts +14 -0
  61. package/models/file-guard-store.js +1 -0
  62. package/models/file-guard.d.ts +27 -0
  63. package/models/file-guard.js +1 -0
  64. package/models/{file-cache.d.ts → file-info.d.ts} +1 -1
  65. package/models/file-info.js +1 -0
  66. package/models/file-manager-store.d.ts +10 -12
  67. package/models/file-opener-store.d.ts +6 -4
  68. package/models/file-system-manager-store.d.ts +13 -0
  69. package/models/file-system-manager-store.js +1 -0
  70. package/models/file-system-store.d.ts +19 -0
  71. package/models/file-system-store.js +1 -0
  72. package/models/file-system.d.ts +32 -5
  73. package/models/file-system.js +2 -0
  74. package/models/file-upload.d.ts +6 -0
  75. package/models/file-upload.js +1 -0
  76. package/models/file-watcher-store.d.ts +18 -0
  77. package/models/file-watcher-store.js +1 -0
  78. package/models/files-store.d.ts +2 -2
  79. package/models/git-store.d.ts +12 -0
  80. package/models/git-store.js +1 -0
  81. package/models/git.d.ts +47 -0
  82. package/models/git.js +1 -0
  83. package/models/i18n-keys.d.ts +2 -0
  84. package/models/i18n-keys.js +1 -0
  85. package/models/index.d.ts +56 -2
  86. package/models/index.js +59 -2
  87. package/models/layout-snapshot-repository.d.ts +14 -0
  88. package/models/layout-snapshot-repository.js +1 -0
  89. package/models/layout-store.d.ts +17 -0
  90. package/models/layout-store.js +1 -0
  91. package/models/layout.d.ts +16 -0
  92. package/models/layout.js +1 -0
  93. package/models/log-repository.d.ts +17 -0
  94. package/models/log-repository.js +1 -0
  95. package/models/log-store.d.ts +15 -0
  96. package/models/log-store.js +1 -0
  97. package/models/log.d.ts +12 -0
  98. package/models/log.js +1 -0
  99. package/models/logger.d.ts +8 -0
  100. package/models/logger.js +1 -0
  101. package/models/menu-action.d.ts +18 -0
  102. package/models/menu-action.js +1 -0
  103. package/models/modal-store.d.ts +16 -0
  104. package/models/modal-store.js +1 -0
  105. package/models/modal.d.ts +10 -2
  106. package/models/note.d.ts +30 -13
  107. package/models/notification-config.d.ts +14 -0
  108. package/models/notification-config.js +1 -0
  109. package/models/notifications-store.d.ts +20 -0
  110. package/models/notifications-store.js +1 -0
  111. package/models/oauth-provider.d.ts +2 -1
  112. package/models/orgnote-config.d.ts +80 -0
  113. package/models/orgnote-config.js +42 -0
  114. package/models/orgnote-url.d.ts +6 -0
  115. package/models/orgnote-url.js +1 -0
  116. package/models/pane-snapshot-repository.d.ts +0 -0
  117. package/models/pane-snapshot-repository.js +0 -0
  118. package/models/pane.d.ts +38 -0
  119. package/models/pane.js +1 -0
  120. package/models/panes-store.d.ts +30 -0
  121. package/models/panes-store.js +1 -0
  122. package/models/platform-detection.d.ts +11 -0
  123. package/models/platform-detection.js +1 -0
  124. package/models/platform-specific.d.ts +1 -0
  125. package/models/platform-specific.js +1 -0
  126. package/models/platform.d.ts +2 -0
  127. package/models/platform.js +1 -0
  128. package/models/queue-store.d.ts +49 -0
  129. package/models/queue-store.js +1 -0
  130. package/models/queue-task.d.ts +15 -0
  131. package/models/queue-task.js +1 -0
  132. package/models/repositories.d.ts +58 -38
  133. package/models/screen-detection.d.ts +10 -0
  134. package/models/screen-detection.js +1 -0
  135. package/models/settings-store.d.ts +12 -0
  136. package/models/settings-store.js +1 -0
  137. package/models/settings-ui-store.d.ts +7 -0
  138. package/models/settings-ui-store.js +1 -0
  139. package/models/sidebar-store.d.ts +22 -0
  140. package/models/sidebar-store.js +1 -0
  141. package/models/splash-screen.d.ts +13 -0
  142. package/models/splash-screen.js +1 -0
  143. package/models/store.d.ts +1 -1
  144. package/models/style-size.d.ts +2 -0
  145. package/models/style-size.js +1 -0
  146. package/models/style-variant.d.ts +1 -0
  147. package/models/style-variant.js +1 -0
  148. package/models/sync-store.d.ts +8 -6
  149. package/models/sync.d.ts +0 -5
  150. package/models/system-info.d.ts +47 -0
  151. package/models/system-info.js +1 -0
  152. package/models/theme-store.d.ts +16 -0
  153. package/models/theme-store.js +1 -0
  154. package/models/theme-variables.d.ts +4 -189
  155. package/models/theme-variables.js +2 -191
  156. package/models/toolbar-store.d.ts +9 -0
  157. package/models/toolbar-store.js +1 -0
  158. package/models/ui-store.d.ts +6 -0
  159. package/models/ui-store.js +1 -0
  160. package/models/user.d.ts +3 -4
  161. package/models/vue-component.d.ts +4 -2
  162. package/package-lock.json +5553 -0
  163. package/package.json +37 -26
  164. package/remote-api/api.d.ts +288 -669
  165. package/remote-api/api.js +199 -485
  166. package/remote-api/base.js +1 -1
  167. package/remote-api/common.d.ts +1 -1
  168. package/sync/__tests__/memory-state.spec.d.ts +1 -0
  169. package/sync/__tests__/memory-state.spec.js +49 -0
  170. package/sync/__tests__/plan.spec.d.ts +1 -0
  171. package/sync/__tests__/plan.spec.js +116 -0
  172. package/sync/create-sync-plan.d.ts +2 -0
  173. package/sync/create-sync-plan.js +13 -0
  174. package/sync/fetch.d.ts +8 -0
  175. package/sync/fetch.js +32 -0
  176. package/sync/index.d.ts +10 -0
  177. package/sync/index.js +9 -0
  178. package/sync/memory-state.d.ts +2 -0
  179. package/sync/memory-state.js +22 -0
  180. package/sync/operations/conflict.d.ts +10 -0
  181. package/sync/operations/conflict.js +56 -0
  182. package/sync/operations/delete-local.d.ts +2 -0
  183. package/sync/operations/delete-local.js +17 -0
  184. package/sync/operations/delete-remote.d.ts +2 -0
  185. package/sync/operations/delete-remote.js +26 -0
  186. package/sync/operations/download.d.ts +2 -0
  187. package/sync/operations/download.js +20 -0
  188. package/sync/operations/index.d.ts +5 -0
  189. package/sync/operations/index.js +5 -0
  190. package/sync/operations/synced-file.d.ts +14 -0
  191. package/sync/operations/synced-file.js +5 -0
  192. package/sync/operations/upload.d.ts +2 -0
  193. package/sync/operations/upload.js +30 -0
  194. package/sync/plan.d.ts +9 -0
  195. package/sync/plan.js +57 -0
  196. package/sync/recovery.d.ts +2 -0
  197. package/sync/recovery.js +6 -0
  198. package/sync/scan.d.ts +4 -0
  199. package/sync/scan.js +40 -0
  200. package/sync/types.d.ts +74 -0
  201. package/sync/types.js +7 -0
  202. package/sync/utils/__tests__/oldest-synced-at.spec.d.ts +1 -0
  203. package/sync/utils/__tests__/oldest-synced-at.spec.js +38 -0
  204. package/sync/utils/oldest-synced-at.d.ts +2 -0
  205. package/sync/utils/oldest-synced-at.js +9 -0
  206. package/types/index.d.ts +0 -0
  207. package/types/index.js +0 -0
  208. package/utils/__tests__/find-files-diff.spec.d.ts +1 -0
  209. package/{tools → utils}/__tests__/find-files-diff.spec.js +3 -3
  210. package/utils/__tests__/find-note-files-diff.spec.d.ts +1 -0
  211. package/{tools → utils}/__tests__/find-note-files-diff.spec.js +5 -5
  212. package/utils/__tests__/get-file-name.spec.d.ts +1 -0
  213. package/utils/__tests__/get-string-path.spec.d.ts +1 -0
  214. package/utils/__tests__/is-gpg-encrypted.spec.d.ts +1 -0
  215. package/utils/__tests__/is-org-file.spec.d.ts +1 -0
  216. package/utils/__tests__/join.spec.d.ts +1 -0
  217. package/utils/__tests__/join.spec.js +32 -0
  218. package/utils/__tests__/nullable-guards.spec.d.ts +1 -0
  219. package/utils/__tests__/nullable-guards.spec.js +44 -0
  220. package/utils/__tests__/parent-folder.spec.d.ts +1 -0
  221. package/utils/__tests__/read-org-files-recursively.spec.d.ts +1 -0
  222. package/utils/__tests__/split-path.spec.d.ts +1 -0
  223. package/utils/__tests__/to-absolute-path.spec.d.ts +1 -0
  224. package/utils/__tests__/to-absolute-path.spec.js +26 -0
  225. package/utils/__tests__/to-error.spec.d.ts +1 -0
  226. package/utils/__tests__/to-error.spec.js +112 -0
  227. package/utils/__tests__/with-root.spec.d.ts +1 -0
  228. package/utils/__tests__/with-root.spec.js +20 -0
  229. package/{tools → utils}/find-notes-files-diff.js +6 -3
  230. package/{tools → utils}/index.d.ts +4 -1
  231. package/{tools → utils}/index.js +4 -1
  232. package/utils/join-path.d.ts +1 -0
  233. package/utils/join-path.js +13 -0
  234. package/utils/nullable-guards.d.ts +2 -0
  235. package/utils/nullable-guards.js +6 -0
  236. package/utils/to-absolute-path.d.ts +2 -0
  237. package/utils/to-absolute-path.js +2 -0
  238. package/utils/to-error.d.ts +6 -0
  239. package/utils/to-error.js +33 -0
  240. package/utils/toml.d.ts +3 -0
  241. package/utils/toml.js +31 -0
  242. package/utils/with-root.d.ts +1 -0
  243. package/utils/with-root.js +6 -0
  244. package/websocket/client.d.ts +24 -0
  245. package/websocket/client.js +83 -0
  246. package/models/file-tree.d.ts +0 -12
  247. package/tools/__tests__/join.spec.js +0 -24
  248. package/tools/join-path.d.ts +0 -1
  249. package/tools/join-path.js +0 -7
  250. package/tools/mock-server.d.ts +0 -1
  251. package/tools/mock-server.js +0 -12
  252. /package/models/{file-cache.js → buffer-store.js} +0 -0
  253. /package/models/{file-tree.js → buffer.js} +0 -0
  254. /package/{tools/__tests__/find-files-diff.spec.d.ts → models/colors.js} +0 -0
  255. /package/{tools/__tests__/find-note-files-diff.spec.d.ts → models/commands-group-store.js} +0 -0
  256. /package/{tools/__tests__/get-file-name.spec.d.ts → models/commands-store.js} +0 -0
  257. /package/{tools/__tests__/get-string-path.spec.d.ts → models/completion-store.js} +0 -0
  258. /package/{tools/__tests__/is-gpg-encrypted.spec.d.ts → models/config-store.js} +0 -0
  259. /package/{tools/__tests__/is-org-file.spec.d.ts → models/confirmation-modal.js} +0 -0
  260. /package/{tools/__tests__/join.spec.d.ts → models/context-menu-store.js} +0 -0
  261. /package/{tools/__tests__/parent-folder.spec.d.ts → models/cron-store.js} +0 -0
  262. /package/{tools/__tests__/read-org-files-recursively.spec.d.ts → models/cron-task.js} +0 -0
  263. /package/{tools/__tests__/split-path.spec.d.ts → models/css-utils.js} +0 -0
  264. /package/{tools → utils}/__tests__/get-file-name.spec.js +0 -0
  265. /package/{tools → utils}/__tests__/get-string-path.spec.js +0 -0
  266. /package/{tools → utils}/__tests__/is-gpg-encrypted.spec.js +0 -0
  267. /package/{tools → utils}/__tests__/is-org-file.spec.js +0 -0
  268. /package/{tools → utils}/__tests__/parent-folder.spec.js +0 -0
  269. /package/{tools → utils}/__tests__/read-org-files-recursively.spec.js +0 -0
  270. /package/{tools → utils}/__tests__/split-path.spec.js +0 -0
  271. /package/{tools → utils}/find-notes-files-diff.d.ts +0 -0
  272. /package/{tools → utils}/get-file-name.d.ts +0 -0
  273. /package/{tools → utils}/get-file-name.js +0 -0
  274. /package/{tools → utils}/get-parent-dir.d.ts +0 -0
  275. /package/{tools → utils}/get-parent-dir.js +0 -0
  276. /package/{tools → utils}/get-string-path.d.ts +0 -0
  277. /package/{tools → utils}/get-string-path.js +0 -0
  278. /package/{tools → utils}/is-gpg-encrypted.d.ts +0 -0
  279. /package/{tools → utils}/is-gpg-encrypted.js +0 -0
  280. /package/{tools → utils}/is-org-file.d.ts +0 -0
  281. /package/{tools → utils}/is-org-file.js +0 -0
  282. /package/{tools → utils}/split-path.d.ts +0 -0
  283. /package/{tools → utils}/split-path.js +0 -0
package/remote-api/api.js CHANGED
@@ -17,26 +17,6 @@ import globalAxios from 'axios';
17
17
  import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from "./common.js";
18
18
  // @ts-ignore
19
19
  import { BASE_PATH, BaseAPI, operationServerMap } from "./base.js";
20
- export const HandlersCreatingNoteEncryptionTypeEnum = {
21
- GpgKeys: 'gpgKeys',
22
- GpgPassword: 'gpgPassword',
23
- Disabled: 'disabled'
24
- };
25
- /**
26
- *
27
- * @export
28
- * @enum {string}
29
- */
30
- export const ModelsCategory = {
31
- CategoryArticle: 'article',
32
- CategoryBook: 'book',
33
- CategorySchedule: 'schedule'
34
- };
35
- export const ModelsPublicNoteEncryptionTypeEnum = {
36
- GpgKeys: 'gpgKeys',
37
- GpgPassword: 'gpgPassword',
38
- Disabled: 'disabled'
39
- };
40
20
  /**
41
21
  * AuthApi - axios parameter creator
42
22
  * @export
@@ -612,36 +592,35 @@ export class AuthApi extends BaseAPI {
612
592
  }
613
593
  }
614
594
  /**
615
- * FilesApi - axios parameter creator
595
+ * EventsApi - axios parameter creator
616
596
  * @export
617
597
  */
618
- export const FilesApiAxiosParamCreator = function (configuration) {
598
+ export const EventsApiAxiosParamCreator = function (configuration) {
619
599
  return {
620
600
  /**
621
- * Upload files.
622
- * @summary Upload files
623
- * @param {FilesUploadPostRequest} filesUploadPostRequest
601
+ * Generic WebSocket endpoint for real-time user events (sync, notifications, etc). Requires `Upgrade: websocket` header.
602
+ * @summary WebSocket Events Channel
603
+ * @param {string} [token] Auth token (alternative to Authorization header)
624
604
  * @param {*} [options] Override http request option.
625
605
  * @throws {RequiredError}
626
606
  */
627
- filesUploadPost: async (filesUploadPostRequest, options = {}) => {
628
- // verify required parameter 'filesUploadPostRequest' is not null or undefined
629
- assertParamExists('filesUploadPost', 'filesUploadPostRequest', filesUploadPostRequest);
630
- const localVarPath = `/files/upload`;
607
+ wsV1EventsGet: async (token, options = {}) => {
608
+ const localVarPath = `/ws/v1/events`;
631
609
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
632
610
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
633
611
  let baseOptions;
634
612
  if (configuration) {
635
613
  baseOptions = configuration.baseOptions;
636
614
  }
637
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
615
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
638
616
  const localVarHeaderParameter = {};
639
617
  const localVarQueryParameter = {};
640
- localVarHeaderParameter['Content-Type'] = 'application/json';
618
+ if (token !== undefined) {
619
+ localVarQueryParameter['token'] = token;
620
+ }
641
621
  setSearchParams(localVarUrlObj, localVarQueryParameter);
642
622
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
643
623
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
644
- localVarRequestOptions.data = serializeDataIfNeeded(filesUploadPostRequest, localVarRequestOptions, configuration);
645
624
  return {
646
625
  url: toPathString(localVarUrlObj),
647
626
  options: localVarRequestOptions,
@@ -650,200 +629,134 @@ export const FilesApiAxiosParamCreator = function (configuration) {
650
629
  };
651
630
  };
652
631
  /**
653
- * FilesApi - functional programming interface
632
+ * EventsApi - functional programming interface
654
633
  * @export
655
634
  */
656
- export const FilesApiFp = function (configuration) {
657
- const localVarAxiosParamCreator = FilesApiAxiosParamCreator(configuration);
635
+ export const EventsApiFp = function (configuration) {
636
+ const localVarAxiosParamCreator = EventsApiAxiosParamCreator(configuration);
658
637
  return {
659
638
  /**
660
- * Upload files.
661
- * @summary Upload files
662
- * @param {FilesUploadPostRequest} filesUploadPostRequest
639
+ * Generic WebSocket endpoint for real-time user events (sync, notifications, etc). Requires `Upgrade: websocket` header.
640
+ * @summary WebSocket Events Channel
641
+ * @param {string} [token] Auth token (alternative to Authorization header)
663
642
  * @param {*} [options] Override http request option.
664
643
  * @throws {RequiredError}
665
644
  */
666
- async filesUploadPost(filesUploadPostRequest, options) {
667
- const localVarAxiosArgs = await localVarAxiosParamCreator.filesUploadPost(filesUploadPostRequest, options);
645
+ async wsV1EventsGet(token, options) {
646
+ const localVarAxiosArgs = await localVarAxiosParamCreator.wsV1EventsGet(token, options);
668
647
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
669
- const localVarOperationServerBasePath = operationServerMap['FilesApi.filesUploadPost']?.[localVarOperationServerIndex]?.url;
648
+ const localVarOperationServerBasePath = operationServerMap['EventsApi.wsV1EventsGet']?.[localVarOperationServerIndex]?.url;
670
649
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
671
650
  },
672
651
  };
673
652
  };
674
653
  /**
675
- * FilesApi - factory interface
654
+ * EventsApi - factory interface
676
655
  * @export
677
656
  */
678
- export const FilesApiFactory = function (configuration, basePath, axios) {
679
- const localVarFp = FilesApiFp(configuration);
657
+ export const EventsApiFactory = function (configuration, basePath, axios) {
658
+ const localVarFp = EventsApiFp(configuration);
680
659
  return {
681
660
  /**
682
- * Upload files.
683
- * @summary Upload files
684
- * @param {FilesUploadPostRequest} filesUploadPostRequest
661
+ * Generic WebSocket endpoint for real-time user events (sync, notifications, etc). Requires `Upgrade: websocket` header.
662
+ * @summary WebSocket Events Channel
663
+ * @param {string} [token] Auth token (alternative to Authorization header)
685
664
  * @param {*} [options] Override http request option.
686
665
  * @throws {RequiredError}
687
666
  */
688
- filesUploadPost(filesUploadPostRequest, options) {
689
- return localVarFp.filesUploadPost(filesUploadPostRequest, options).then((request) => request(axios, basePath));
667
+ wsV1EventsGet(token, options) {
668
+ return localVarFp.wsV1EventsGet(token, options).then((request) => request(axios, basePath));
690
669
  },
691
670
  };
692
671
  };
693
672
  /**
694
- * FilesApi - object-oriented interface
673
+ * EventsApi - object-oriented interface
695
674
  * @export
696
- * @class FilesApi
675
+ * @class EventsApi
697
676
  * @extends {BaseAPI}
698
677
  */
699
- export class FilesApi extends BaseAPI {
678
+ export class EventsApi extends BaseAPI {
700
679
  /**
701
- * Upload files.
702
- * @summary Upload files
703
- * @param {FilesUploadPostRequest} filesUploadPostRequest
680
+ * Generic WebSocket endpoint for real-time user events (sync, notifications, etc). Requires `Upgrade: websocket` header.
681
+ * @summary WebSocket Events Channel
682
+ * @param {string} [token] Auth token (alternative to Authorization header)
704
683
  * @param {*} [options] Override http request option.
705
684
  * @throws {RequiredError}
706
- * @memberof FilesApi
685
+ * @memberof EventsApi
707
686
  */
708
- filesUploadPost(filesUploadPostRequest, options) {
709
- return FilesApiFp(this.configuration).filesUploadPost(filesUploadPostRequest, options).then((request) => request(this.axios, this.basePath));
687
+ wsV1EventsGet(token, options) {
688
+ return EventsApiFp(this.configuration).wsV1EventsGet(token, options).then((request) => request(this.axios, this.basePath));
710
689
  }
711
690
  }
712
691
  /**
713
- * NotesApi - axios parameter creator
692
+ * SyncApi - axios parameter creator
714
693
  * @export
715
694
  */
716
- export const NotesApiAxiosParamCreator = function (configuration) {
695
+ export const SyncApiAxiosParamCreator = function (configuration) {
717
696
  return {
718
697
  /**
719
- * Force delete all user notes. This operation is irreversible
720
- * @summary Drop all user notes
698
+ * Returns file changes since the specified timestamp
699
+ * @summary Get file changes
700
+ * @param {number} [since] Unix timestamp in milliseconds for incremental sync
701
+ * @param {number} [limit] Maximum number of changes to return (default: 100, max: 500)
702
+ * @param {string} [cursor] Pagination cursor
721
703
  * @param {*} [options] Override http request option.
722
704
  * @throws {RequiredError}
723
705
  */
724
- allNotesDelete: async (options = {}) => {
725
- const localVarPath = `/all-notes`;
706
+ syncChangesGet: async (since, limit, cursor, options = {}) => {
707
+ const localVarPath = `/sync/changes`;
726
708
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
727
709
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
728
710
  let baseOptions;
729
711
  if (configuration) {
730
712
  baseOptions = configuration.baseOptions;
731
713
  }
732
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
714
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
733
715
  const localVarHeaderParameter = {};
734
716
  const localVarQueryParameter = {};
735
- setSearchParams(localVarUrlObj, localVarQueryParameter);
736
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
737
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
738
- return {
739
- url: toPathString(localVarUrlObj),
740
- options: localVarRequestOptions,
741
- };
742
- },
743
- /**
744
- * Bulk update or insert notes
745
- * @summary Upsert notes
746
- * @param {Array<HandlersCreatingNote>} notes List of crated notes
747
- * @param {*} [options] Override http request option.
748
- * @throws {RequiredError}
749
- */
750
- notesBulkUpsertPut: async (notes, options = {}) => {
751
- // verify required parameter 'notes' is not null or undefined
752
- assertParamExists('notesBulkUpsertPut', 'notes', notes);
753
- const localVarPath = `/notes/bulk-upsert`;
754
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
755
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
756
- let baseOptions;
757
- if (configuration) {
758
- baseOptions = configuration.baseOptions;
717
+ if (since !== undefined) {
718
+ localVarQueryParameter['since'] = since;
759
719
  }
760
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
761
- const localVarHeaderParameter = {};
762
- const localVarQueryParameter = {};
763
- localVarHeaderParameter['Content-Type'] = 'application/json';
764
- setSearchParams(localVarUrlObj, localVarQueryParameter);
765
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
766
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
767
- localVarRequestOptions.data = serializeDataIfNeeded(notes, localVarRequestOptions, configuration);
768
- return {
769
- url: toPathString(localVarUrlObj),
770
- options: localVarRequestOptions,
771
- };
772
- },
773
- /**
774
- * Mark notes as deleted by provided list of ids
775
- * @summary Delete notes
776
- * @param {Array<string>} ids List of ids of deleted notes
777
- * @param {*} [options] Override http request option.
778
- * @throws {RequiredError}
779
- */
780
- notesDelete: async (ids, options = {}) => {
781
- // verify required parameter 'ids' is not null or undefined
782
- assertParamExists('notesDelete', 'ids', ids);
783
- const localVarPath = `/notes`;
784
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
785
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
786
- let baseOptions;
787
- if (configuration) {
788
- baseOptions = configuration.baseOptions;
720
+ if (limit !== undefined) {
721
+ localVarQueryParameter['limit'] = limit;
722
+ }
723
+ if (cursor !== undefined) {
724
+ localVarQueryParameter['cursor'] = cursor;
789
725
  }
790
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
791
- const localVarHeaderParameter = {};
792
- const localVarQueryParameter = {};
793
- localVarHeaderParameter['Content-Type'] = 'application/json';
794
726
  setSearchParams(localVarUrlObj, localVarQueryParameter);
795
727
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
796
728
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
797
- localVarRequestOptions.data = serializeDataIfNeeded(ids, localVarRequestOptions, configuration);
798
729
  return {
799
730
  url: toPathString(localVarUrlObj),
800
731
  options: localVarRequestOptions,
801
732
  };
802
733
  },
803
734
  /**
804
- * Get all notes with optional filter
805
- * @summary Get notes
806
- * @param {number} [limit]
807
- * @param {number} [offset]
808
- * @param {string} [userId] User id of which notes to load
809
- * @param {string} [searchText]
810
- * @param {boolean} [my] Load all my own notes (user will be used from provided token)
811
- * @param {string} [from]
812
- * @param {boolean} [includeDeleted]
735
+ * Soft delete a file (creates tombstone for sync)
736
+ * @summary Delete a file
737
+ * @param {string} path File path
738
+ * @param {number} [version] Expected version for optimistic locking
813
739
  * @param {*} [options] Override http request option.
814
740
  * @throws {RequiredError}
815
741
  */
816
- notesGet: async (limit, offset, userId, searchText, my, from, includeDeleted, options = {}) => {
817
- const localVarPath = `/notes/`;
742
+ syncFilesDelete: async (path, version, options = {}) => {
743
+ // verify required parameter 'path' is not null or undefined
744
+ assertParamExists('syncFilesDelete', 'path', path);
745
+ const localVarPath = `/sync/files`;
818
746
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
819
747
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
820
748
  let baseOptions;
821
749
  if (configuration) {
822
750
  baseOptions = configuration.baseOptions;
823
751
  }
824
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
752
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
825
753
  const localVarHeaderParameter = {};
826
754
  const localVarQueryParameter = {};
827
- if (limit !== undefined) {
828
- localVarQueryParameter['limit'] = limit;
829
- }
830
- if (offset !== undefined) {
831
- localVarQueryParameter['offset'] = offset;
832
- }
833
- if (userId !== undefined) {
834
- localVarQueryParameter['userId'] = userId;
835
- }
836
- if (searchText !== undefined) {
837
- localVarQueryParameter['searchText'] = searchText;
838
- }
839
- if (my !== undefined) {
840
- localVarQueryParameter['my'] = my;
755
+ if (path !== undefined) {
756
+ localVarQueryParameter['path'] = path;
841
757
  }
842
- if (from !== undefined) {
843
- localVarQueryParameter['from'] = from;
844
- }
845
- if (includeDeleted !== undefined) {
846
- localVarQueryParameter['includeDeleted'] = includeDeleted;
758
+ if (version !== undefined) {
759
+ localVarQueryParameter['version'] = version;
847
760
  }
848
761
  setSearchParams(localVarUrlObj, localVarQueryParameter);
849
762
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -854,17 +767,16 @@ export const NotesApiAxiosParamCreator = function (configuration) {
854
767
  };
855
768
  },
856
769
  /**
857
- * get note by id
858
- * @summary Get note
859
- * @param {string} id Note ID
770
+ * Download file content by path
771
+ * @summary Download a file
772
+ * @param {string} path File path
860
773
  * @param {*} [options] Override http request option.
861
774
  * @throws {RequiredError}
862
775
  */
863
- notesIdGet: async (id, options = {}) => {
864
- // verify required parameter 'id' is not null or undefined
865
- assertParamExists('notesIdGet', 'id', id);
866
- const localVarPath = `/notes/{id}`
867
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
776
+ syncFilesGet: async (path, options = {}) => {
777
+ // verify required parameter 'path' is not null or undefined
778
+ assertParamExists('syncFilesGet', 'path', path);
779
+ const localVarPath = `/sync/files`;
868
780
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
869
781
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
870
782
  let baseOptions;
@@ -874,69 +786,60 @@ export const NotesApiAxiosParamCreator = function (configuration) {
874
786
  const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
875
787
  const localVarHeaderParameter = {};
876
788
  const localVarQueryParameter = {};
877
- setSearchParams(localVarUrlObj, localVarQueryParameter);
878
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
879
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
880
- return {
881
- url: toPathString(localVarUrlObj),
882
- options: localVarRequestOptions,
883
- };
884
- },
885
- /**
886
- * Create note
887
- * @summary Create note
888
- * @param {HandlersCreatingNote} note Note model
889
- * @param {*} [options] Override http request option.
890
- * @throws {RequiredError}
891
- */
892
- notesPost: async (note, options = {}) => {
893
- // verify required parameter 'note' is not null or undefined
894
- assertParamExists('notesPost', 'note', note);
895
- const localVarPath = `/notes/`;
896
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
897
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
898
- let baseOptions;
899
- if (configuration) {
900
- baseOptions = configuration.baseOptions;
789
+ if (path !== undefined) {
790
+ localVarQueryParameter['path'] = path;
901
791
  }
902
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
903
- const localVarHeaderParameter = {};
904
- const localVarQueryParameter = {};
905
- localVarHeaderParameter['Content-Type'] = 'application/json';
906
792
  setSearchParams(localVarUrlObj, localVarQueryParameter);
907
793
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
908
794
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
909
- localVarRequestOptions.data = serializeDataIfNeeded(note, localVarRequestOptions, configuration);
910
795
  return {
911
796
  url: toPathString(localVarUrlObj),
912
797
  options: localVarRequestOptions,
913
798
  };
914
799
  },
915
800
  /**
916
- * Synchronize notes with specific timestamp
917
- * @summary Synchronize notes
918
- * @param {HandlersSyncNotesRequest} data Sync notes request
801
+ * Upload a file to sync storage with content-addressable deduplication
802
+ * @summary Upload a file
803
+ * @param {string} filePath Relative file path
804
+ * @param {File} file File content
805
+ * @param {string} [xContentHash] SHA-256 hash for verification
806
+ * @param {number} [expectedVersion] Expected version for optimistic locking
919
807
  * @param {*} [options] Override http request option.
920
808
  * @throws {RequiredError}
921
809
  */
922
- notesSyncPost: async (data, options = {}) => {
923
- // verify required parameter 'data' is not null or undefined
924
- assertParamExists('notesSyncPost', 'data', data);
925
- const localVarPath = `/notes/sync`;
810
+ syncFilesPut: async (filePath, file, xContentHash, expectedVersion, options = {}) => {
811
+ // verify required parameter 'filePath' is not null or undefined
812
+ assertParamExists('syncFilesPut', 'filePath', filePath);
813
+ // verify required parameter 'file' is not null or undefined
814
+ assertParamExists('syncFilesPut', 'file', file);
815
+ const localVarPath = `/sync/files`;
926
816
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
927
817
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
928
818
  let baseOptions;
929
819
  if (configuration) {
930
820
  baseOptions = configuration.baseOptions;
931
821
  }
932
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
822
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
933
823
  const localVarHeaderParameter = {};
934
824
  const localVarQueryParameter = {};
935
- localVarHeaderParameter['Content-Type'] = 'application/json';
825
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
826
+ if (xContentHash != null) {
827
+ localVarHeaderParameter['X-Content-Hash'] = String(xContentHash);
828
+ }
829
+ if (filePath !== undefined) {
830
+ localVarFormParams.append('filePath', filePath);
831
+ }
832
+ if (file !== undefined) {
833
+ localVarFormParams.append('file', file);
834
+ }
835
+ if (expectedVersion !== undefined) {
836
+ localVarFormParams.append('expectedVersion', expectedVersion);
837
+ }
838
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
936
839
  setSearchParams(localVarUrlObj, localVarQueryParameter);
937
840
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
938
841
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
939
- localVarRequestOptions.data = serializeDataIfNeeded(data, localVarRequestOptions, configuration);
842
+ localVarRequestOptions.data = localVarFormParams;
940
843
  return {
941
844
  url: toPathString(localVarUrlObj),
942
845
  options: localVarRequestOptions,
@@ -945,282 +848,183 @@ export const NotesApiAxiosParamCreator = function (configuration) {
945
848
  };
946
849
  };
947
850
  /**
948
- * NotesApi - functional programming interface
851
+ * SyncApi - functional programming interface
949
852
  * @export
950
853
  */
951
- export const NotesApiFp = function (configuration) {
952
- const localVarAxiosParamCreator = NotesApiAxiosParamCreator(configuration);
854
+ export const SyncApiFp = function (configuration) {
855
+ const localVarAxiosParamCreator = SyncApiAxiosParamCreator(configuration);
953
856
  return {
954
857
  /**
955
- * Force delete all user notes. This operation is irreversible
956
- * @summary Drop all user notes
858
+ * Returns file changes since the specified timestamp
859
+ * @summary Get file changes
860
+ * @param {number} [since] Unix timestamp in milliseconds for incremental sync
861
+ * @param {number} [limit] Maximum number of changes to return (default: 100, max: 500)
862
+ * @param {string} [cursor] Pagination cursor
957
863
  * @param {*} [options] Override http request option.
958
864
  * @throws {RequiredError}
959
865
  */
960
- async allNotesDelete(options) {
961
- const localVarAxiosArgs = await localVarAxiosParamCreator.allNotesDelete(options);
866
+ async syncChangesGet(since, limit, cursor, options) {
867
+ const localVarAxiosArgs = await localVarAxiosParamCreator.syncChangesGet(since, limit, cursor, options);
962
868
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
963
- const localVarOperationServerBasePath = operationServerMap['NotesApi.allNotesDelete']?.[localVarOperationServerIndex]?.url;
869
+ const localVarOperationServerBasePath = operationServerMap['SyncApi.syncChangesGet']?.[localVarOperationServerIndex]?.url;
964
870
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
965
871
  },
966
872
  /**
967
- * Bulk update or insert notes
968
- * @summary Upsert notes
969
- * @param {Array<HandlersCreatingNote>} notes List of crated notes
873
+ * Soft delete a file (creates tombstone for sync)
874
+ * @summary Delete a file
875
+ * @param {string} path File path
876
+ * @param {number} [version] Expected version for optimistic locking
970
877
  * @param {*} [options] Override http request option.
971
878
  * @throws {RequiredError}
972
879
  */
973
- async notesBulkUpsertPut(notes, options) {
974
- const localVarAxiosArgs = await localVarAxiosParamCreator.notesBulkUpsertPut(notes, options);
880
+ async syncFilesDelete(path, version, options) {
881
+ const localVarAxiosArgs = await localVarAxiosParamCreator.syncFilesDelete(path, version, options);
975
882
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
976
- const localVarOperationServerBasePath = operationServerMap['NotesApi.notesBulkUpsertPut']?.[localVarOperationServerIndex]?.url;
883
+ const localVarOperationServerBasePath = operationServerMap['SyncApi.syncFilesDelete']?.[localVarOperationServerIndex]?.url;
977
884
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
978
885
  },
979
886
  /**
980
- * Mark notes as deleted by provided list of ids
981
- * @summary Delete notes
982
- * @param {Array<string>} ids List of ids of deleted notes
887
+ * Download file content by path
888
+ * @summary Download a file
889
+ * @param {string} path File path
983
890
  * @param {*} [options] Override http request option.
984
891
  * @throws {RequiredError}
985
892
  */
986
- async notesDelete(ids, options) {
987
- const localVarAxiosArgs = await localVarAxiosParamCreator.notesDelete(ids, options);
893
+ async syncFilesGet(path, options) {
894
+ const localVarAxiosArgs = await localVarAxiosParamCreator.syncFilesGet(path, options);
988
895
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
989
- const localVarOperationServerBasePath = operationServerMap['NotesApi.notesDelete']?.[localVarOperationServerIndex]?.url;
896
+ const localVarOperationServerBasePath = operationServerMap['SyncApi.syncFilesGet']?.[localVarOperationServerIndex]?.url;
990
897
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
991
898
  },
992
899
  /**
993
- * Get all notes with optional filter
994
- * @summary Get notes
995
- * @param {number} [limit]
996
- * @param {number} [offset]
997
- * @param {string} [userId] User id of which notes to load
998
- * @param {string} [searchText]
999
- * @param {boolean} [my] Load all my own notes (user will be used from provided token)
1000
- * @param {string} [from]
1001
- * @param {boolean} [includeDeleted]
900
+ * Upload a file to sync storage with content-addressable deduplication
901
+ * @summary Upload a file
902
+ * @param {string} filePath Relative file path
903
+ * @param {File} file File content
904
+ * @param {string} [xContentHash] SHA-256 hash for verification
905
+ * @param {number} [expectedVersion] Expected version for optimistic locking
1002
906
  * @param {*} [options] Override http request option.
1003
907
  * @throws {RequiredError}
1004
908
  */
1005
- async notesGet(limit, offset, userId, searchText, my, from, includeDeleted, options) {
1006
- const localVarAxiosArgs = await localVarAxiosParamCreator.notesGet(limit, offset, userId, searchText, my, from, includeDeleted, options);
909
+ async syncFilesPut(filePath, file, xContentHash, expectedVersion, options) {
910
+ const localVarAxiosArgs = await localVarAxiosParamCreator.syncFilesPut(filePath, file, xContentHash, expectedVersion, options);
1007
911
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1008
- const localVarOperationServerBasePath = operationServerMap['NotesApi.notesGet']?.[localVarOperationServerIndex]?.url;
1009
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1010
- },
1011
- /**
1012
- * get note by id
1013
- * @summary Get note
1014
- * @param {string} id Note ID
1015
- * @param {*} [options] Override http request option.
1016
- * @throws {RequiredError}
1017
- */
1018
- async notesIdGet(id, options) {
1019
- const localVarAxiosArgs = await localVarAxiosParamCreator.notesIdGet(id, options);
1020
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1021
- const localVarOperationServerBasePath = operationServerMap['NotesApi.notesIdGet']?.[localVarOperationServerIndex]?.url;
1022
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1023
- },
1024
- /**
1025
- * Create note
1026
- * @summary Create note
1027
- * @param {HandlersCreatingNote} note Note model
1028
- * @param {*} [options] Override http request option.
1029
- * @throws {RequiredError}
1030
- */
1031
- async notesPost(note, options) {
1032
- const localVarAxiosArgs = await localVarAxiosParamCreator.notesPost(note, options);
1033
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1034
- const localVarOperationServerBasePath = operationServerMap['NotesApi.notesPost']?.[localVarOperationServerIndex]?.url;
1035
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1036
- },
1037
- /**
1038
- * Synchronize notes with specific timestamp
1039
- * @summary Synchronize notes
1040
- * @param {HandlersSyncNotesRequest} data Sync notes request
1041
- * @param {*} [options] Override http request option.
1042
- * @throws {RequiredError}
1043
- */
1044
- async notesSyncPost(data, options) {
1045
- const localVarAxiosArgs = await localVarAxiosParamCreator.notesSyncPost(data, options);
1046
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1047
- const localVarOperationServerBasePath = operationServerMap['NotesApi.notesSyncPost']?.[localVarOperationServerIndex]?.url;
912
+ const localVarOperationServerBasePath = operationServerMap['SyncApi.syncFilesPut']?.[localVarOperationServerIndex]?.url;
1048
913
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1049
914
  },
1050
915
  };
1051
916
  };
1052
917
  /**
1053
- * NotesApi - factory interface
918
+ * SyncApi - factory interface
1054
919
  * @export
1055
920
  */
1056
- export const NotesApiFactory = function (configuration, basePath, axios) {
1057
- const localVarFp = NotesApiFp(configuration);
921
+ export const SyncApiFactory = function (configuration, basePath, axios) {
922
+ const localVarFp = SyncApiFp(configuration);
1058
923
  return {
1059
924
  /**
1060
- * Force delete all user notes. This operation is irreversible
1061
- * @summary Drop all user notes
1062
- * @param {*} [options] Override http request option.
1063
- * @throws {RequiredError}
1064
- */
1065
- allNotesDelete(options) {
1066
- return localVarFp.allNotesDelete(options).then((request) => request(axios, basePath));
1067
- },
1068
- /**
1069
- * Bulk update or insert notes
1070
- * @summary Upsert notes
1071
- * @param {Array<HandlersCreatingNote>} notes List of crated notes
1072
- * @param {*} [options] Override http request option.
1073
- * @throws {RequiredError}
1074
- */
1075
- notesBulkUpsertPut(notes, options) {
1076
- return localVarFp.notesBulkUpsertPut(notes, options).then((request) => request(axios, basePath));
1077
- },
1078
- /**
1079
- * Mark notes as deleted by provided list of ids
1080
- * @summary Delete notes
1081
- * @param {Array<string>} ids List of ids of deleted notes
1082
- * @param {*} [options] Override http request option.
1083
- * @throws {RequiredError}
1084
- */
1085
- notesDelete(ids, options) {
1086
- return localVarFp.notesDelete(ids, options).then((request) => request(axios, basePath));
1087
- },
1088
- /**
1089
- * Get all notes with optional filter
1090
- * @summary Get notes
1091
- * @param {number} [limit]
1092
- * @param {number} [offset]
1093
- * @param {string} [userId] User id of which notes to load
1094
- * @param {string} [searchText]
1095
- * @param {boolean} [my] Load all my own notes (user will be used from provided token)
1096
- * @param {string} [from]
1097
- * @param {boolean} [includeDeleted]
925
+ * Returns file changes since the specified timestamp
926
+ * @summary Get file changes
927
+ * @param {number} [since] Unix timestamp in milliseconds for incremental sync
928
+ * @param {number} [limit] Maximum number of changes to return (default: 100, max: 500)
929
+ * @param {string} [cursor] Pagination cursor
1098
930
  * @param {*} [options] Override http request option.
1099
931
  * @throws {RequiredError}
1100
932
  */
1101
- notesGet(limit, offset, userId, searchText, my, from, includeDeleted, options) {
1102
- return localVarFp.notesGet(limit, offset, userId, searchText, my, from, includeDeleted, options).then((request) => request(axios, basePath));
933
+ syncChangesGet(since, limit, cursor, options) {
934
+ return localVarFp.syncChangesGet(since, limit, cursor, options).then((request) => request(axios, basePath));
1103
935
  },
1104
936
  /**
1105
- * get note by id
1106
- * @summary Get note
1107
- * @param {string} id Note ID
937
+ * Soft delete a file (creates tombstone for sync)
938
+ * @summary Delete a file
939
+ * @param {string} path File path
940
+ * @param {number} [version] Expected version for optimistic locking
1108
941
  * @param {*} [options] Override http request option.
1109
942
  * @throws {RequiredError}
1110
943
  */
1111
- notesIdGet(id, options) {
1112
- return localVarFp.notesIdGet(id, options).then((request) => request(axios, basePath));
944
+ syncFilesDelete(path, version, options) {
945
+ return localVarFp.syncFilesDelete(path, version, options).then((request) => request(axios, basePath));
1113
946
  },
1114
947
  /**
1115
- * Create note
1116
- * @summary Create note
1117
- * @param {HandlersCreatingNote} note Note model
948
+ * Download file content by path
949
+ * @summary Download a file
950
+ * @param {string} path File path
1118
951
  * @param {*} [options] Override http request option.
1119
952
  * @throws {RequiredError}
1120
953
  */
1121
- notesPost(note, options) {
1122
- return localVarFp.notesPost(note, options).then((request) => request(axios, basePath));
954
+ syncFilesGet(path, options) {
955
+ return localVarFp.syncFilesGet(path, options).then((request) => request(axios, basePath));
1123
956
  },
1124
957
  /**
1125
- * Synchronize notes with specific timestamp
1126
- * @summary Synchronize notes
1127
- * @param {HandlersSyncNotesRequest} data Sync notes request
958
+ * Upload a file to sync storage with content-addressable deduplication
959
+ * @summary Upload a file
960
+ * @param {string} filePath Relative file path
961
+ * @param {File} file File content
962
+ * @param {string} [xContentHash] SHA-256 hash for verification
963
+ * @param {number} [expectedVersion] Expected version for optimistic locking
1128
964
  * @param {*} [options] Override http request option.
1129
965
  * @throws {RequiredError}
1130
966
  */
1131
- notesSyncPost(data, options) {
1132
- return localVarFp.notesSyncPost(data, options).then((request) => request(axios, basePath));
967
+ syncFilesPut(filePath, file, xContentHash, expectedVersion, options) {
968
+ return localVarFp.syncFilesPut(filePath, file, xContentHash, expectedVersion, options).then((request) => request(axios, basePath));
1133
969
  },
1134
970
  };
1135
971
  };
1136
972
  /**
1137
- * NotesApi - object-oriented interface
973
+ * SyncApi - object-oriented interface
1138
974
  * @export
1139
- * @class NotesApi
975
+ * @class SyncApi
1140
976
  * @extends {BaseAPI}
1141
977
  */
1142
- export class NotesApi extends BaseAPI {
1143
- /**
1144
- * Force delete all user notes. This operation is irreversible
1145
- * @summary Drop all user notes
1146
- * @param {*} [options] Override http request option.
1147
- * @throws {RequiredError}
1148
- * @memberof NotesApi
1149
- */
1150
- allNotesDelete(options) {
1151
- return NotesApiFp(this.configuration).allNotesDelete(options).then((request) => request(this.axios, this.basePath));
1152
- }
1153
- /**
1154
- * Bulk update or insert notes
1155
- * @summary Upsert notes
1156
- * @param {Array<HandlersCreatingNote>} notes List of crated notes
1157
- * @param {*} [options] Override http request option.
1158
- * @throws {RequiredError}
1159
- * @memberof NotesApi
1160
- */
1161
- notesBulkUpsertPut(notes, options) {
1162
- return NotesApiFp(this.configuration).notesBulkUpsertPut(notes, options).then((request) => request(this.axios, this.basePath));
1163
- }
1164
- /**
1165
- * Mark notes as deleted by provided list of ids
1166
- * @summary Delete notes
1167
- * @param {Array<string>} ids List of ids of deleted notes
1168
- * @param {*} [options] Override http request option.
1169
- * @throws {RequiredError}
1170
- * @memberof NotesApi
1171
- */
1172
- notesDelete(ids, options) {
1173
- return NotesApiFp(this.configuration).notesDelete(ids, options).then((request) => request(this.axios, this.basePath));
1174
- }
978
+ export class SyncApi extends BaseAPI {
1175
979
  /**
1176
- * Get all notes with optional filter
1177
- * @summary Get notes
1178
- * @param {number} [limit]
1179
- * @param {number} [offset]
1180
- * @param {string} [userId] User id of which notes to load
1181
- * @param {string} [searchText]
1182
- * @param {boolean} [my] Load all my own notes (user will be used from provided token)
1183
- * @param {string} [from]
1184
- * @param {boolean} [includeDeleted]
980
+ * Returns file changes since the specified timestamp
981
+ * @summary Get file changes
982
+ * @param {number} [since] Unix timestamp in milliseconds for incremental sync
983
+ * @param {number} [limit] Maximum number of changes to return (default: 100, max: 500)
984
+ * @param {string} [cursor] Pagination cursor
1185
985
  * @param {*} [options] Override http request option.
1186
986
  * @throws {RequiredError}
1187
- * @memberof NotesApi
987
+ * @memberof SyncApi
1188
988
  */
1189
- notesGet(limit, offset, userId, searchText, my, from, includeDeleted, options) {
1190
- return NotesApiFp(this.configuration).notesGet(limit, offset, userId, searchText, my, from, includeDeleted, options).then((request) => request(this.axios, this.basePath));
989
+ syncChangesGet(since, limit, cursor, options) {
990
+ return SyncApiFp(this.configuration).syncChangesGet(since, limit, cursor, options).then((request) => request(this.axios, this.basePath));
1191
991
  }
1192
992
  /**
1193
- * get note by id
1194
- * @summary Get note
1195
- * @param {string} id Note ID
993
+ * Soft delete a file (creates tombstone for sync)
994
+ * @summary Delete a file
995
+ * @param {string} path File path
996
+ * @param {number} [version] Expected version for optimistic locking
1196
997
  * @param {*} [options] Override http request option.
1197
998
  * @throws {RequiredError}
1198
- * @memberof NotesApi
999
+ * @memberof SyncApi
1199
1000
  */
1200
- notesIdGet(id, options) {
1201
- return NotesApiFp(this.configuration).notesIdGet(id, options).then((request) => request(this.axios, this.basePath));
1001
+ syncFilesDelete(path, version, options) {
1002
+ return SyncApiFp(this.configuration).syncFilesDelete(path, version, options).then((request) => request(this.axios, this.basePath));
1202
1003
  }
1203
1004
  /**
1204
- * Create note
1205
- * @summary Create note
1206
- * @param {HandlersCreatingNote} note Note model
1005
+ * Download file content by path
1006
+ * @summary Download a file
1007
+ * @param {string} path File path
1207
1008
  * @param {*} [options] Override http request option.
1208
1009
  * @throws {RequiredError}
1209
- * @memberof NotesApi
1010
+ * @memberof SyncApi
1210
1011
  */
1211
- notesPost(note, options) {
1212
- return NotesApiFp(this.configuration).notesPost(note, options).then((request) => request(this.axios, this.basePath));
1012
+ syncFilesGet(path, options) {
1013
+ return SyncApiFp(this.configuration).syncFilesGet(path, options).then((request) => request(this.axios, this.basePath));
1213
1014
  }
1214
1015
  /**
1215
- * Synchronize notes with specific timestamp
1216
- * @summary Synchronize notes
1217
- * @param {HandlersSyncNotesRequest} data Sync notes request
1016
+ * Upload a file to sync storage with content-addressable deduplication
1017
+ * @summary Upload a file
1018
+ * @param {string} filePath Relative file path
1019
+ * @param {File} file File content
1020
+ * @param {string} [xContentHash] SHA-256 hash for verification
1021
+ * @param {number} [expectedVersion] Expected version for optimistic locking
1218
1022
  * @param {*} [options] Override http request option.
1219
1023
  * @throws {RequiredError}
1220
- * @memberof NotesApi
1024
+ * @memberof SyncApi
1221
1025
  */
1222
- notesSyncPost(data, options) {
1223
- return NotesApiFp(this.configuration).notesSyncPost(data, options).then((request) => request(this.axios, this.basePath));
1026
+ syncFilesPut(filePath, file, xContentHash, expectedVersion, options) {
1027
+ return SyncApiFp(this.configuration).syncFilesPut(filePath, file, xContentHash, expectedVersion, options).then((request) => request(this.axios, this.basePath));
1224
1028
  }
1225
1029
  }
1226
1030
  /**
@@ -1383,93 +1187,3 @@ export class SystemInfoApi extends BaseAPI {
1383
1187
  return SystemInfoApiFp(this.configuration).systemInfoVersionGet(version, options).then((request) => request(this.axios, this.basePath));
1384
1188
  }
1385
1189
  }
1386
- /**
1387
- * TagsApi - axios parameter creator
1388
- * @export
1389
- */
1390
- export const TagsApiAxiosParamCreator = function (configuration) {
1391
- return {
1392
- /**
1393
- * Return list of al registered tags
1394
- * @summary Get tags
1395
- * @param {*} [options] Override http request option.
1396
- * @throws {RequiredError}
1397
- */
1398
- tagsGet: async (options = {}) => {
1399
- const localVarPath = `/tags`;
1400
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1401
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1402
- let baseOptions;
1403
- if (configuration) {
1404
- baseOptions = configuration.baseOptions;
1405
- }
1406
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1407
- const localVarHeaderParameter = {};
1408
- const localVarQueryParameter = {};
1409
- setSearchParams(localVarUrlObj, localVarQueryParameter);
1410
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1411
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1412
- return {
1413
- url: toPathString(localVarUrlObj),
1414
- options: localVarRequestOptions,
1415
- };
1416
- },
1417
- };
1418
- };
1419
- /**
1420
- * TagsApi - functional programming interface
1421
- * @export
1422
- */
1423
- export const TagsApiFp = function (configuration) {
1424
- const localVarAxiosParamCreator = TagsApiAxiosParamCreator(configuration);
1425
- return {
1426
- /**
1427
- * Return list of al registered tags
1428
- * @summary Get tags
1429
- * @param {*} [options] Override http request option.
1430
- * @throws {RequiredError}
1431
- */
1432
- async tagsGet(options) {
1433
- const localVarAxiosArgs = await localVarAxiosParamCreator.tagsGet(options);
1434
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1435
- const localVarOperationServerBasePath = operationServerMap['TagsApi.tagsGet']?.[localVarOperationServerIndex]?.url;
1436
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1437
- },
1438
- };
1439
- };
1440
- /**
1441
- * TagsApi - factory interface
1442
- * @export
1443
- */
1444
- export const TagsApiFactory = function (configuration, basePath, axios) {
1445
- const localVarFp = TagsApiFp(configuration);
1446
- return {
1447
- /**
1448
- * Return list of al registered tags
1449
- * @summary Get tags
1450
- * @param {*} [options] Override http request option.
1451
- * @throws {RequiredError}
1452
- */
1453
- tagsGet(options) {
1454
- return localVarFp.tagsGet(options).then((request) => request(axios, basePath));
1455
- },
1456
- };
1457
- };
1458
- /**
1459
- * TagsApi - object-oriented interface
1460
- * @export
1461
- * @class TagsApi
1462
- * @extends {BaseAPI}
1463
- */
1464
- export class TagsApi extends BaseAPI {
1465
- /**
1466
- * Return list of al registered tags
1467
- * @summary Get tags
1468
- * @param {*} [options] Override http request option.
1469
- * @throws {RequiredError}
1470
- * @memberof TagsApi
1471
- */
1472
- tagsGet(options) {
1473
- return TagsApiFp(this.configuration).tagsGet(options).then((request) => request(this.axios, this.basePath));
1474
- }
1475
- }