orgnote-api 0.42.1 → 0.42.5
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.
- package/api.d.ts +2 -1
- package/constants/i18n-keys.d.ts +13 -0
- package/constants/i18n-keys.js +6 -0
- package/models/client-update-store.d.ts +11 -0
- package/models/client-update-store.js +1 -0
- package/models/client-update.d.ts +10 -0
- package/models/client-update.js +1 -0
- package/models/default-commands.d.ts +2 -0
- package/models/default-commands.js +2 -0
- package/models/index.d.ts +2 -0
- package/models/index.js +2 -0
- package/models/notification-config.d.ts +3 -1
- package/models/sync-profile-config.d.ts +3 -0
- package/models/sync-profile-config.js +1 -0
- package/package.json +3 -1
- package/remote-api/api.d.ts +29 -0
- package/remote-api/api.js +56 -0
- package/sync/scan.js +17 -17
package/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InlineEmbeddedWidget, MultilineEmbeddedWidget, OrgLineClass, SyncStoreDefinition, BufferViewerStoreDefinition, CommandsStoreDefinition, CommandsGroupStoreDefinition, ModalStoreDefinition, SettingsStoreDefinition, SettingsUiStoreDefinition, MultipleUploadParams, UploadParams, CompletionStoreDefinition, PaneStoreDefinition, LayoutStoreDefinition, FileManagerStoreDefinition, UseScreenDetection, UseKeyboardState, NotificationsStoreDefinition, BufferStoreDefinition, BufferProviderStoreDefinition, Repositories, LogStoreDefinition, UseSystemInfo, ContextMenuStoreDefinition, QueueStoreDefinition, FileGuardStoreDefinition, FileWatcherStoreDefinition, BuildOrgNoteUrl, AuthStoreDefinition, FileSearchStoreDefinition, FileMetaStoreDefinition, FontStoreDefinition, EmbeddedBufferStoreDefinition, UseFileContent, UseAppResume } from './models/index.js';
|
|
1
|
+
import { InlineEmbeddedWidget, MultilineEmbeddedWidget, OrgLineClass, SyncStoreDefinition, BufferViewerStoreDefinition, CommandsStoreDefinition, CommandsGroupStoreDefinition, ModalStoreDefinition, SettingsStoreDefinition, SettingsUiStoreDefinition, MultipleUploadParams, UploadParams, CompletionStoreDefinition, PaneStoreDefinition, LayoutStoreDefinition, FileManagerStoreDefinition, UseScreenDetection, UseKeyboardState, NotificationsStoreDefinition, BufferStoreDefinition, BufferProviderStoreDefinition, Repositories, LogStoreDefinition, UseSystemInfo, ContextMenuStoreDefinition, QueueStoreDefinition, FileGuardStoreDefinition, FileWatcherStoreDefinition, BuildOrgNoteUrl, AuthStoreDefinition, FileSearchStoreDefinition, FileMetaStoreDefinition, FontStoreDefinition, EmbeddedBufferStoreDefinition, UseFileContent, UseAppResume, ClientUpdateStoreDefinition } from './models/index.js';
|
|
2
2
|
import { WebSocketClient } from './websocket/client.js';
|
|
3
3
|
import { WidgetType } from './models/widget-type.js';
|
|
4
4
|
import { NodeType } from 'org-mode-ast';
|
|
@@ -163,6 +163,7 @@ export interface OrgNoteApi {
|
|
|
163
163
|
* Also handles API token lifecycle (create, list, revoke).
|
|
164
164
|
*/
|
|
165
165
|
useSettings: SettingsStoreDefinition;
|
|
166
|
+
useClientUpdate: ClientUpdateStoreDefinition;
|
|
166
167
|
useConfig: ConfigStoreDefinition;
|
|
167
168
|
/**
|
|
168
169
|
* Access the [Quasar](https://quasar.dev/) framework globals ($q).
|
package/constants/i18n-keys.d.ts
CHANGED
|
@@ -189,6 +189,12 @@ export declare enum i18n {
|
|
|
189
189
|
GPG_EMAIL_INVALID = "gpg email invalid",
|
|
190
190
|
CLEAR_ALL_NOTIFICATIONS = "clear all notifications",
|
|
191
191
|
NO_NOTIFICATIONS = "no notifications",
|
|
192
|
+
SHOW_LATEST_CHANGES = "show latest changes",
|
|
193
|
+
LATEST_CHANGES_NOTIFICATION_DESCRIPTION = "open latest changes notification description",
|
|
194
|
+
NO_LATEST_CHANGES = "no latest changes",
|
|
195
|
+
UPDATED_TO_VERSION = "updated to version",
|
|
196
|
+
UPDATED_FROM_VERSION = "updated from version",
|
|
197
|
+
OPEN_RELEASE_NOTES = "open release notes",
|
|
192
198
|
GRAPH_TITLE = "graph.title",
|
|
193
199
|
GRAPH_DESCRIPTION = "graph.description",
|
|
194
200
|
GRAPH_EMPTY_TITLE = "graph.empty.title",
|
|
@@ -231,7 +237,9 @@ export declare enum i18n {
|
|
|
231
237
|
export declare const I18N: {
|
|
232
238
|
REPORT_BUG: DefaultCommands.REPORT_BUG;
|
|
233
239
|
OPEN_SYSTEM_INFO: DefaultCommands.OPEN_SYSTEM_INFO;
|
|
240
|
+
SHOW_LATEST_CHANGES: DefaultCommands.SHOW_LATEST_CHANGES;
|
|
234
241
|
SHOW_LOGS: DefaultCommands.SHOW_LOGS;
|
|
242
|
+
APPLY_PWA_UPDATE: DefaultCommands.APPLY_PWA_UPDATE;
|
|
235
243
|
CLEAR_LOGS: DefaultCommands.CLEAR_LOGS;
|
|
236
244
|
TOGGLE_SIDEBAR: DefaultCommands.TOGGLE_SIDEBAR;
|
|
237
245
|
CLOSE_SIDEBAR: DefaultCommands.CLOSE_SIDEBAR;
|
|
@@ -552,6 +560,11 @@ export declare const I18N: {
|
|
|
552
560
|
GPG_EMAIL_INVALID: i18n.GPG_EMAIL_INVALID;
|
|
553
561
|
CLEAR_ALL_NOTIFICATIONS: i18n.CLEAR_ALL_NOTIFICATIONS;
|
|
554
562
|
NO_NOTIFICATIONS: i18n.NO_NOTIFICATIONS;
|
|
563
|
+
LATEST_CHANGES_NOTIFICATION_DESCRIPTION: i18n.LATEST_CHANGES_NOTIFICATION_DESCRIPTION;
|
|
564
|
+
NO_LATEST_CHANGES: i18n.NO_LATEST_CHANGES;
|
|
565
|
+
UPDATED_TO_VERSION: i18n.UPDATED_TO_VERSION;
|
|
566
|
+
UPDATED_FROM_VERSION: i18n.UPDATED_FROM_VERSION;
|
|
567
|
+
OPEN_RELEASE_NOTES: i18n.OPEN_RELEASE_NOTES;
|
|
555
568
|
GRAPH_TITLE: i18n.GRAPH_TITLE;
|
|
556
569
|
GRAPH_DESCRIPTION: i18n.GRAPH_DESCRIPTION;
|
|
557
570
|
GRAPH_EMPTY_TITLE: i18n.GRAPH_EMPTY_TITLE;
|
package/constants/i18n-keys.js
CHANGED
|
@@ -200,6 +200,12 @@ export var i18n;
|
|
|
200
200
|
i18n["GPG_EMAIL_INVALID"] = "gpg email invalid";
|
|
201
201
|
i18n["CLEAR_ALL_NOTIFICATIONS"] = "clear all notifications";
|
|
202
202
|
i18n["NO_NOTIFICATIONS"] = "no notifications";
|
|
203
|
+
i18n["SHOW_LATEST_CHANGES"] = "show latest changes";
|
|
204
|
+
i18n["LATEST_CHANGES_NOTIFICATION_DESCRIPTION"] = "open latest changes notification description";
|
|
205
|
+
i18n["NO_LATEST_CHANGES"] = "no latest changes";
|
|
206
|
+
i18n["UPDATED_TO_VERSION"] = "updated to version";
|
|
207
|
+
i18n["UPDATED_FROM_VERSION"] = "updated from version";
|
|
208
|
+
i18n["OPEN_RELEASE_NOTES"] = "open release notes";
|
|
203
209
|
// Graph
|
|
204
210
|
i18n["GRAPH_TITLE"] = "graph.title";
|
|
205
211
|
i18n["GRAPH_DESCRIPTION"] = "graph.description";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { StoreDefinition } from './store.js';
|
|
3
|
+
import type { ChangelogRecord } from './client-update.js';
|
|
4
|
+
export interface ClientUpdateStore {
|
|
5
|
+
updateChangelog: ComputedRef<ChangelogRecord | null>;
|
|
6
|
+
unreadUpdateChangelog: ComputedRef<ChangelogRecord | null>;
|
|
7
|
+
syncUpdateChangelog: () => Promise<void>;
|
|
8
|
+
loadLatestChangelog: () => Promise<ChangelogRecord | null>;
|
|
9
|
+
markChangelogAsRead: () => void;
|
|
10
|
+
}
|
|
11
|
+
export type ClientUpdateStoreDefinition = StoreDefinition<ClientUpdateStore>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare enum DefaultCommands {
|
|
2
2
|
REPORT_BUG = "report bug",
|
|
3
3
|
OPEN_SYSTEM_INFO = "open system info",
|
|
4
|
+
SHOW_LATEST_CHANGES = "show latest changes",
|
|
4
5
|
SHOW_LOGS = "show logs",
|
|
6
|
+
APPLY_PWA_UPDATE = "apply pwa update",
|
|
5
7
|
CLEAR_LOGS = "clear logs",
|
|
6
8
|
TOGGLE_SIDEBAR = "toggle sidebar",
|
|
7
9
|
CLOSE_SIDEBAR = "close sidebar",
|
|
@@ -8,7 +8,9 @@ export var DefaultCommands;
|
|
|
8
8
|
// Global commands
|
|
9
9
|
DefaultCommands["REPORT_BUG"] = "report bug";
|
|
10
10
|
DefaultCommands["OPEN_SYSTEM_INFO"] = "open system info";
|
|
11
|
+
DefaultCommands["SHOW_LATEST_CHANGES"] = "show latest changes";
|
|
11
12
|
DefaultCommands["SHOW_LOGS"] = "show logs";
|
|
13
|
+
DefaultCommands["APPLY_PWA_UPDATE"] = "apply pwa update";
|
|
12
14
|
DefaultCommands["CLEAR_LOGS"] = "clear logs";
|
|
13
15
|
DefaultCommands["TOGGLE_SIDEBAR"] = "toggle sidebar";
|
|
14
16
|
DefaultCommands["CLOSE_SIDEBAR"] = "close sidebar";
|
package/models/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './user.js';
|
|
|
19
19
|
export * from './oauth-provider.js';
|
|
20
20
|
export * from './auth-state.js';
|
|
21
21
|
export * from './orgnote-config.js';
|
|
22
|
+
export * from './client-update.js';
|
|
22
23
|
export * from './sync-profile-config.js';
|
|
23
24
|
export * from './platform-specific.js';
|
|
24
25
|
export * from './css-utils.js';
|
|
@@ -60,6 +61,7 @@ export * from './extension-store.js';
|
|
|
60
61
|
export * from './file-system-store.js';
|
|
61
62
|
export * from './file-watcher-store.js';
|
|
62
63
|
export * from './settings-store.js';
|
|
64
|
+
export * from './client-update-store.js';
|
|
63
65
|
export * from './encryption-store.js';
|
|
64
66
|
export * from './ui-store.js';
|
|
65
67
|
export * from './sidebar-store.js';
|
package/models/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./user.js";
|
|
|
19
19
|
export * from "./oauth-provider.js";
|
|
20
20
|
export * from "./auth-state.js";
|
|
21
21
|
export * from "./orgnote-config.js";
|
|
22
|
+
export * from "./client-update.js";
|
|
22
23
|
export * from "./sync-profile-config.js";
|
|
23
24
|
export * from "./platform-specific.js";
|
|
24
25
|
export * from "./css-utils.js";
|
|
@@ -62,6 +63,7 @@ export * from "./extension-store.js";
|
|
|
62
63
|
export * from "./file-system-store.js";
|
|
63
64
|
export * from "./file-watcher-store.js";
|
|
64
65
|
export * from "./settings-store.js";
|
|
66
|
+
export * from "./client-update-store.js";
|
|
65
67
|
export * from "./encryption-store.js";
|
|
66
68
|
export * from "./ui-store.js";
|
|
67
69
|
export * from "./sidebar-store.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleVariant } from './style-variant.js';
|
|
2
|
-
export interface NotificationConfig {
|
|
2
|
+
export interface NotificationConfig<T = unknown> {
|
|
3
3
|
id?: string;
|
|
4
4
|
message: string;
|
|
5
5
|
description?: string;
|
|
@@ -11,5 +11,7 @@ export interface NotificationConfig {
|
|
|
11
11
|
icon?: string;
|
|
12
12
|
iconEnabled?: boolean;
|
|
13
13
|
onClick?: () => void;
|
|
14
|
+
actionCommand?: string;
|
|
15
|
+
actionPayload?: T;
|
|
14
16
|
stored?: boolean;
|
|
15
17
|
}
|
|
@@ -10,6 +10,7 @@ export declare const SyncProfileSchema: import("valibot").ObjectSchema<{
|
|
|
10
10
|
readonly debug: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, false>;
|
|
11
11
|
readonly backupDir: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
12
12
|
readonly backupCount: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, 3>;
|
|
13
|
+
readonly ignorePatterns: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, readonly []>;
|
|
13
14
|
}, undefined>;
|
|
14
15
|
export declare const SyncProfileConfigSchema: import("valibot").ObjectSchema<{
|
|
15
16
|
readonly accounts: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
@@ -23,6 +24,7 @@ export declare const SyncProfileConfigSchema: import("valibot").ObjectSchema<{
|
|
|
23
24
|
readonly debug: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, false>;
|
|
24
25
|
readonly backupDir: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
25
26
|
readonly backupCount: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, 3>;
|
|
27
|
+
readonly ignorePatterns: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, readonly []>;
|
|
26
28
|
}, undefined>, undefined>, readonly []>;
|
|
27
29
|
readonly root: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
28
30
|
readonly name: import("valibot").StringSchema<undefined>;
|
|
@@ -35,6 +37,7 @@ export declare const SyncProfileConfigSchema: import("valibot").ObjectSchema<{
|
|
|
35
37
|
readonly debug: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, false>;
|
|
36
38
|
readonly backupDir: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, "">;
|
|
37
39
|
readonly backupCount: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, 3>;
|
|
40
|
+
readonly ignorePatterns: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, readonly []>;
|
|
38
41
|
}, undefined>, undefined>, readonly []>;
|
|
39
42
|
}, undefined>;
|
|
40
43
|
export type SyncProfile = InferOutput<typeof SyncProfileSchema>;
|
|
@@ -10,6 +10,7 @@ export const SyncProfileSchema = object({
|
|
|
10
10
|
debug: optional(boolean(), false),
|
|
11
11
|
backupDir: optional(string(), ''),
|
|
12
12
|
backupCount: optional(number(), 3),
|
|
13
|
+
ignorePatterns: optional(array(string()), []),
|
|
13
14
|
});
|
|
14
15
|
export const SyncProfileConfigSchema = object({
|
|
15
16
|
accounts: optional(array(SyncProfileSchema), []),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orgnote-api",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.5",
|
|
4
4
|
"description": "Official API for creating extensions for OrgNote app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"openpgp": "6.3.0",
|
|
54
54
|
"org-mode-ast": "0.11.8",
|
|
55
55
|
"partysocket": "1.1.6",
|
|
56
|
+
"picomatch": "4.0.4",
|
|
56
57
|
"smol-toml": "1.5.2"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"@rollup/rollup-linux-arm64-gnu": "4.14.2",
|
|
62
63
|
"@types/diff-match-patch": "^1.0.36",
|
|
63
64
|
"@types/node": "22.14.1",
|
|
65
|
+
"@types/picomatch": "4.0.3",
|
|
64
66
|
"eslint": "9.25.1",
|
|
65
67
|
"eslint-plugin-sonarjs": "3.0.5",
|
|
66
68
|
"fix-esm-import-path": "1.10.1",
|
package/remote-api/api.d.ts
CHANGED
|
@@ -1120,6 +1120,13 @@ export declare class SyncApi extends BaseAPI {
|
|
|
1120
1120
|
* @export
|
|
1121
1121
|
*/
|
|
1122
1122
|
export declare const SystemInfoApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
1123
|
+
/**
|
|
1124
|
+
*
|
|
1125
|
+
* @summary GetLatestClientUpdate
|
|
1126
|
+
* @param {*} [options] Override http request option.
|
|
1127
|
+
* @throws {RequiredError}
|
|
1128
|
+
*/
|
|
1129
|
+
systemInfoClientUpdateLatestGet: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
1123
1130
|
/**
|
|
1124
1131
|
*
|
|
1125
1132
|
* @summary GetUpdatesFromVersion
|
|
@@ -1142,6 +1149,13 @@ export declare const SystemInfoApiAxiosParamCreator: (configuration?: Configurat
|
|
|
1142
1149
|
* @export
|
|
1143
1150
|
*/
|
|
1144
1151
|
export declare const SystemInfoApiFp: (configuration?: Configuration) => {
|
|
1152
|
+
/**
|
|
1153
|
+
*
|
|
1154
|
+
* @summary GetLatestClientUpdate
|
|
1155
|
+
* @param {*} [options] Override http request option.
|
|
1156
|
+
* @throws {RequiredError}
|
|
1157
|
+
*/
|
|
1158
|
+
systemInfoClientUpdateLatestGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ModelsOrgNoteClientUpdateInfo>>;
|
|
1145
1159
|
/**
|
|
1146
1160
|
*
|
|
1147
1161
|
* @summary GetUpdatesFromVersion
|
|
@@ -1164,6 +1178,13 @@ export declare const SystemInfoApiFp: (configuration?: Configuration) => {
|
|
|
1164
1178
|
* @export
|
|
1165
1179
|
*/
|
|
1166
1180
|
export declare const SystemInfoApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
1181
|
+
/**
|
|
1182
|
+
*
|
|
1183
|
+
* @summary GetLatestClientUpdate
|
|
1184
|
+
* @param {*} [options] Override http request option.
|
|
1185
|
+
* @throws {RequiredError}
|
|
1186
|
+
*/
|
|
1187
|
+
systemInfoClientUpdateLatestGet(options?: any): AxiosPromise<ModelsOrgNoteClientUpdateInfo>;
|
|
1167
1188
|
/**
|
|
1168
1189
|
*
|
|
1169
1190
|
* @summary GetUpdatesFromVersion
|
|
@@ -1188,6 +1209,14 @@ export declare const SystemInfoApiFactory: (configuration?: Configuration, baseP
|
|
|
1188
1209
|
* @extends {BaseAPI}
|
|
1189
1210
|
*/
|
|
1190
1211
|
export declare class SystemInfoApi extends BaseAPI {
|
|
1212
|
+
/**
|
|
1213
|
+
*
|
|
1214
|
+
* @summary GetLatestClientUpdate
|
|
1215
|
+
* @param {*} [options] Override http request option.
|
|
1216
|
+
* @throws {RequiredError}
|
|
1217
|
+
* @memberof SystemInfoApi
|
|
1218
|
+
*/
|
|
1219
|
+
systemInfoClientUpdateLatestGet(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ModelsOrgNoteClientUpdateInfo, any>>;
|
|
1191
1220
|
/**
|
|
1192
1221
|
*
|
|
1193
1222
|
* @summary GetUpdatesFromVersion
|
package/remote-api/api.js
CHANGED
|
@@ -1033,6 +1033,31 @@ export class SyncApi extends BaseAPI {
|
|
|
1033
1033
|
*/
|
|
1034
1034
|
export const SystemInfoApiAxiosParamCreator = function (configuration) {
|
|
1035
1035
|
return {
|
|
1036
|
+
/**
|
|
1037
|
+
*
|
|
1038
|
+
* @summary GetLatestClientUpdate
|
|
1039
|
+
* @param {*} [options] Override http request option.
|
|
1040
|
+
* @throws {RequiredError}
|
|
1041
|
+
*/
|
|
1042
|
+
systemInfoClientUpdateLatestGet: async (options = {}) => {
|
|
1043
|
+
const localVarPath = `/system-info/client-update/latest`;
|
|
1044
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1045
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1046
|
+
let baseOptions;
|
|
1047
|
+
if (configuration) {
|
|
1048
|
+
baseOptions = configuration.baseOptions;
|
|
1049
|
+
}
|
|
1050
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
1051
|
+
const localVarHeaderParameter = {};
|
|
1052
|
+
const localVarQueryParameter = {};
|
|
1053
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1054
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1055
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
1056
|
+
return {
|
|
1057
|
+
url: toPathString(localVarUrlObj),
|
|
1058
|
+
options: localVarRequestOptions,
|
|
1059
|
+
};
|
|
1060
|
+
},
|
|
1036
1061
|
/**
|
|
1037
1062
|
*
|
|
1038
1063
|
* @summary GetUpdatesFromVersion
|
|
@@ -1100,6 +1125,18 @@ export const SystemInfoApiAxiosParamCreator = function (configuration) {
|
|
|
1100
1125
|
export const SystemInfoApiFp = function (configuration) {
|
|
1101
1126
|
const localVarAxiosParamCreator = SystemInfoApiAxiosParamCreator(configuration);
|
|
1102
1127
|
return {
|
|
1128
|
+
/**
|
|
1129
|
+
*
|
|
1130
|
+
* @summary GetLatestClientUpdate
|
|
1131
|
+
* @param {*} [options] Override http request option.
|
|
1132
|
+
* @throws {RequiredError}
|
|
1133
|
+
*/
|
|
1134
|
+
async systemInfoClientUpdateLatestGet(options) {
|
|
1135
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.systemInfoClientUpdateLatestGet(options);
|
|
1136
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1137
|
+
const localVarOperationServerBasePath = operationServerMap['SystemInfoApi.systemInfoClientUpdateLatestGet']?.[localVarOperationServerIndex]?.url;
|
|
1138
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1139
|
+
},
|
|
1103
1140
|
/**
|
|
1104
1141
|
*
|
|
1105
1142
|
* @summary GetUpdatesFromVersion
|
|
@@ -1135,6 +1172,15 @@ export const SystemInfoApiFp = function (configuration) {
|
|
|
1135
1172
|
export const SystemInfoApiFactory = function (configuration, basePath, axios) {
|
|
1136
1173
|
const localVarFp = SystemInfoApiFp(configuration);
|
|
1137
1174
|
return {
|
|
1175
|
+
/**
|
|
1176
|
+
*
|
|
1177
|
+
* @summary GetLatestClientUpdate
|
|
1178
|
+
* @param {*} [options] Override http request option.
|
|
1179
|
+
* @throws {RequiredError}
|
|
1180
|
+
*/
|
|
1181
|
+
systemInfoClientUpdateLatestGet(options) {
|
|
1182
|
+
return localVarFp.systemInfoClientUpdateLatestGet(options).then((request) => request(axios, basePath));
|
|
1183
|
+
},
|
|
1138
1184
|
/**
|
|
1139
1185
|
*
|
|
1140
1186
|
* @summary GetUpdatesFromVersion
|
|
@@ -1164,6 +1210,16 @@ export const SystemInfoApiFactory = function (configuration, basePath, axios) {
|
|
|
1164
1210
|
* @extends {BaseAPI}
|
|
1165
1211
|
*/
|
|
1166
1212
|
export class SystemInfoApi extends BaseAPI {
|
|
1213
|
+
/**
|
|
1214
|
+
*
|
|
1215
|
+
* @summary GetLatestClientUpdate
|
|
1216
|
+
* @param {*} [options] Override http request option.
|
|
1217
|
+
* @throws {RequiredError}
|
|
1218
|
+
* @memberof SystemInfoApi
|
|
1219
|
+
*/
|
|
1220
|
+
systemInfoClientUpdateLatestGet(options) {
|
|
1221
|
+
return SystemInfoApiFp(this.configuration).systemInfoClientUpdateLatestGet(options).then((request) => request(this.axios, this.basePath));
|
|
1222
|
+
}
|
|
1167
1223
|
/**
|
|
1168
1224
|
*
|
|
1169
1225
|
* @summary GetUpdatesFromVersion
|
package/sync/scan.js
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
import { toAbsolutePath } from "../utils/to-absolute-path.js";
|
|
2
|
-
|
|
1
|
+
import { toAbsolutePath, toRelativePath } from "../utils/to-absolute-path.js";
|
|
2
|
+
import picomatch from 'picomatch';
|
|
3
|
+
const DEFAULT_IGNORE_PATTERNS = [
|
|
3
4
|
'.git',
|
|
5
|
+
'.jj',
|
|
6
|
+
'.hg',
|
|
7
|
+
'.svn',
|
|
4
8
|
'.DS_Store',
|
|
5
9
|
'node_modules',
|
|
6
10
|
'.sync-state',
|
|
7
11
|
'.Trash',
|
|
8
12
|
];
|
|
13
|
+
const compileMatchers = (patterns) => patterns.map((p) => picomatch(p, { dot: true }));
|
|
9
14
|
export async function scanLocalFiles(fs, rootPath, ignorePatterns = []) {
|
|
10
|
-
const
|
|
11
|
-
|
|
15
|
+
const allPatterns = [...DEFAULT_IGNORE_PATTERNS, ...ignorePatterns];
|
|
16
|
+
const matchers = compileMatchers(allPatterns);
|
|
17
|
+
return scanDir(fs, rootPath, matchers);
|
|
12
18
|
}
|
|
13
|
-
async function scanDir(fs,
|
|
14
|
-
const entries = await fs.readDir(
|
|
15
|
-
const filteredEntries = entries.filter((e) => !shouldIgnore(e.name,
|
|
16
|
-
const nestedResults = await Promise.all(filteredEntries.map((entry) => processEntry(fs, entry,
|
|
19
|
+
async function scanDir(fs, dirPath, matchers) {
|
|
20
|
+
const entries = await fs.readDir(dirPath);
|
|
21
|
+
const filteredEntries = entries.filter((e) => !shouldIgnore(e.name, toRelativePath(e.path), matchers));
|
|
22
|
+
const nestedResults = await Promise.all(filteredEntries.map((entry) => processEntry(fs, entry, matchers)));
|
|
17
23
|
return nestedResults.flat();
|
|
18
24
|
}
|
|
19
|
-
async function processEntry(fs, entry,
|
|
25
|
+
async function processEntry(fs, entry, matchers) {
|
|
20
26
|
if (entry.type === 'directory') {
|
|
21
|
-
return scanDir(fs, entry.path,
|
|
27
|
+
return scanDir(fs, entry.path, matchers);
|
|
22
28
|
}
|
|
23
29
|
return [toLocalFile(entry)];
|
|
24
30
|
}
|
|
@@ -27,13 +33,7 @@ const toLocalFile = (entry) => ({
|
|
|
27
33
|
mtime: entry.mtime,
|
|
28
34
|
size: entry.size,
|
|
29
35
|
});
|
|
30
|
-
const shouldIgnore = (name,
|
|
31
|
-
const matchPattern = (pattern, name) => {
|
|
32
|
-
if (!pattern.includes('*'))
|
|
33
|
-
return name === pattern;
|
|
34
|
-
const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$');
|
|
35
|
-
return regex.test(name);
|
|
36
|
-
};
|
|
36
|
+
const shouldIgnore = (name, relativePath, matchers) => matchers.some((match) => match(name) || match(relativePath));
|
|
37
37
|
export const findDeletedLocally = (localFiles, stateData) => {
|
|
38
38
|
const localPaths = new Set(localFiles.map((f) => f.path));
|
|
39
39
|
return Object.keys(stateData.files).filter((path) => !localPaths.has(path));
|