@theia/filesystem 1.26.0-next.7 → 1.26.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 (65) hide show
  1. package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.d.ts +1 -2
  2. package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.d.ts.map +1 -1
  3. package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.js +3 -4
  4. package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.js.map +1 -1
  5. package/lib/browser/file-service.d.ts +5 -0
  6. package/lib/browser/file-service.d.ts.map +1 -1
  7. package/lib/browser/file-service.js +5 -0
  8. package/lib/browser/file-service.js.map +1 -1
  9. package/lib/browser/file-tree/file-tree-decorator-adapter.d.ts +1 -1
  10. package/lib/browser/file-tree/file-tree-decorator-adapter.js +1 -1
  11. package/lib/browser/file-tree/file-tree-widget.js +1 -1
  12. package/lib/browser/file-tree/file-tree-widget.js.map +1 -1
  13. package/lib/browser/file-tree/file-tree.d.ts +1 -2
  14. package/lib/browser/file-tree/file-tree.d.ts.map +1 -1
  15. package/lib/browser/file-tree/file-tree.js.map +1 -1
  16. package/lib/browser/filesystem-frontend-module.d.ts.map +1 -1
  17. package/lib/browser/filesystem-frontend-module.js +0 -165
  18. package/lib/browser/filesystem-frontend-module.js.map +1 -1
  19. package/lib/browser/index.d.ts +0 -1
  20. package/lib/browser/index.d.ts.map +1 -1
  21. package/lib/browser/index.js +0 -1
  22. package/lib/browser/index.js.map +1 -1
  23. package/lib/browser/location/location-renderer.js +2 -2
  24. package/lib/browser/location/location-renderer.js.map +1 -1
  25. package/lib/common/files.d.ts +12 -3
  26. package/lib/common/files.d.ts.map +1 -1
  27. package/lib/common/files.js.map +1 -1
  28. package/lib/common/filesystem-utils.spec.js +49 -49
  29. package/lib/common/filesystem-utils.spec.js.map +1 -1
  30. package/lib/common/filesystem-watcher-protocol.d.ts +1 -22
  31. package/lib/common/filesystem-watcher-protocol.d.ts.map +1 -1
  32. package/lib/common/filesystem-watcher-protocol.js +1 -68
  33. package/lib/common/filesystem-watcher-protocol.js.map +1 -1
  34. package/lib/common/filesystem.d.ts +0 -229
  35. package/lib/common/filesystem.d.ts.map +1 -1
  36. package/lib/common/filesystem.js +1 -51
  37. package/lib/common/filesystem.js.map +1 -1
  38. package/package.json +4 -4
  39. package/src/browser/breadcrumbs/filepath-breadcrumbs-container.ts +1 -2
  40. package/src/browser/file-service.ts +5 -0
  41. package/src/browser/file-tree/file-tree-decorator-adapter.ts +1 -1
  42. package/src/browser/file-tree/file-tree-widget.tsx +1 -1
  43. package/src/browser/file-tree/file-tree.ts +1 -2
  44. package/src/browser/filesystem-frontend-module.ts +0 -162
  45. package/src/browser/index.ts +0 -1
  46. package/src/browser/location/location-renderer.tsx +2 -2
  47. package/src/common/files.ts +12 -3
  48. package/src/common/filesystem-utils.spec.ts +1 -1
  49. package/src/common/filesystem-watcher-protocol.ts +1 -67
  50. package/src/common/filesystem.ts +0 -262
  51. package/lib/browser/filesystem-watcher.d.ts +0 -134
  52. package/lib/browser/filesystem-watcher.d.ts.map +0 -1
  53. package/lib/browser/filesystem-watcher.js +0 -240
  54. package/lib/browser/filesystem-watcher.js.map +0 -1
  55. package/lib/node/node-file-upload.d.ts +0 -19
  56. package/lib/node/node-file-upload.d.ts.map +0 -1
  57. package/lib/node/node-file-upload.js +0 -55
  58. package/lib/node/node-file-upload.js.map +0 -1
  59. package/lib/node/nsfw-watcher/nsfw-filesystem-watcher.d.ts +0 -53
  60. package/lib/node/nsfw-watcher/nsfw-filesystem-watcher.d.ts.map +0 -1
  61. package/lib/node/nsfw-watcher/nsfw-filesystem-watcher.js +0 -197
  62. package/lib/node/nsfw-watcher/nsfw-filesystem-watcher.js.map +0 -1
  63. package/src/browser/filesystem-watcher.ts +0 -249
  64. package/src/node/node-file-upload.ts +0 -64
  65. package/src/node/nsfw-watcher/nsfw-filesystem-watcher.ts +0 -255
@@ -1,134 +0,0 @@
1
- import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
2
- import { Emitter, WaitUntilEvent } from '@theia/core/lib/common/event';
3
- import URI from '@theia/core/lib/common/uri';
4
- import { FileChangeType } from '../common/files';
5
- import { FileService } from './file-service';
6
- export { FileChangeType };
7
- export interface FileChange {
8
- uri: URI;
9
- type: FileChangeType;
10
- }
11
- export declare namespace FileChange {
12
- function isUpdated(change: FileChange, uri: URI): boolean;
13
- function isAdded(change: FileChange, uri: URI): boolean;
14
- function isDeleted(change: FileChange, uri: URI): boolean;
15
- function isAffected(change: FileChange, uri: URI): boolean;
16
- function isChanged(change: FileChange, uri: URI): boolean;
17
- }
18
- /**
19
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileChangesEvent` instead
20
- */
21
- export declare type FileChangeEvent = FileChange[];
22
- export declare namespace FileChangeEvent {
23
- function isUpdated(event: FileChangeEvent, uri: URI): boolean;
24
- function isAdded(event: FileChangeEvent, uri: URI): boolean;
25
- function isDeleted(event: FileChangeEvent, uri: URI): boolean;
26
- function isAffected(event: FileChangeEvent, uri: URI): boolean;
27
- function isChanged(event: FileChangeEvent, uri: URI): boolean;
28
- }
29
- /**
30
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `UserFileOperationEvent` instead
31
- */
32
- export interface FileMoveEvent extends WaitUntilEvent {
33
- sourceUri: URI;
34
- targetUri: URI;
35
- }
36
- export declare namespace FileMoveEvent {
37
- function isRename({ sourceUri, targetUri }: FileMoveEvent): boolean;
38
- }
39
- /**
40
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `UserFileOperationEvent` instead
41
- */
42
- export interface FileEvent extends WaitUntilEvent {
43
- uri: URI;
44
- }
45
- export declare class FileOperationEmitter<E extends WaitUntilEvent> implements Disposable {
46
- protected readonly onWillEmitter: Emitter<E>;
47
- readonly onWill: import("@theia/core/lib/common/event").Event<E>;
48
- protected readonly onDidFailEmitter: Emitter<E>;
49
- readonly onDidFail: import("@theia/core/lib/common/event").Event<E>;
50
- protected readonly onDidEmitter: Emitter<E>;
51
- readonly onDid: import("@theia/core/lib/common/event").Event<E>;
52
- protected readonly toDispose: DisposableCollection;
53
- dispose(): void;
54
- fireWill(event: Pick<E, Exclude<keyof E, 'waitUntil'>>): Promise<void>;
55
- fireDid(failed: boolean, event: Pick<E, Exclude<keyof E, 'waitUntil'>>): Promise<void>;
56
- }
57
- /**
58
- * React to file system events, including calls originating from the
59
- * application or event coming from the system's filesystem directly
60
- * (actual file watching).
61
- *
62
- * `on(will|did)(create|rename|delete)` events solely come from application
63
- * usage, not from actual filesystem.
64
- *
65
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.watch` instead
66
- */
67
- export declare class FileSystemWatcher implements Disposable {
68
- protected readonly toDispose: DisposableCollection;
69
- protected readonly toRestartAll: DisposableCollection;
70
- protected readonly onFileChangedEmitter: Emitter<FileChangeEvent>;
71
- /**
72
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onDidFilesChange` instead
73
- */
74
- readonly onFilesChanged: import("@theia/core/lib/common/event").Event<FileChangeEvent>;
75
- protected readonly fileCreateEmitter: FileOperationEmitter<FileEvent>;
76
- /**
77
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onWillRunUserOperation` instead
78
- */
79
- readonly onWillCreate: import("@theia/core/lib/common/event").Event<FileEvent>;
80
- /**
81
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onDidFailUserOperation` instead
82
- */
83
- readonly onDidFailCreate: import("@theia/core/lib/common/event").Event<FileEvent>;
84
- /**
85
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908),
86
- * instead use `FileService.onDidRunUserOperation` for events triggered by user gestures
87
- * or `FileService.onDidRunOperation` triggered by user gestures and programmatically
88
- */
89
- readonly onDidCreate: import("@theia/core/lib/common/event").Event<FileEvent>;
90
- protected readonly fileDeleteEmitter: FileOperationEmitter<FileEvent>;
91
- /**
92
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onWillRunUserOperation` instead
93
- */
94
- readonly onWillDelete: import("@theia/core/lib/common/event").Event<FileEvent>;
95
- /**
96
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onDidFailUserOperation` instead
97
- */
98
- readonly onDidFailDelete: import("@theia/core/lib/common/event").Event<FileEvent>;
99
- /**
100
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908),
101
- * instead use `FileService.onDidRunUserOperation` for events triggered by user gestures
102
- * or `FileService.onDidRunOperation` triggered by user gestures and programmatically
103
- */
104
- readonly onDidDelete: import("@theia/core/lib/common/event").Event<FileEvent>;
105
- protected readonly fileMoveEmitter: FileOperationEmitter<FileMoveEvent>;
106
- /**
107
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onWillRunUserOperation` instead
108
- */
109
- readonly onWillMove: import("@theia/core/lib/common/event").Event<FileMoveEvent>;
110
- /**
111
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onDidFailUserOperation` instead
112
- */
113
- readonly onDidFailMove: import("@theia/core/lib/common/event").Event<FileMoveEvent>;
114
- /**
115
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908),
116
- * instead use `FileService.onDidRunUserOperation` for events triggered by user gestures
117
- * or `FileService.onDidRunOperation` triggered by user gestures and programmatically
118
- */
119
- readonly onDidMove: import("@theia/core/lib/common/event").Event<FileMoveEvent>;
120
- protected readonly fileService: FileService;
121
- protected init(): void;
122
- /**
123
- * Stop watching.
124
- */
125
- dispose(): void;
126
- /**
127
- * Start file watching under the given uri.
128
- *
129
- * Resolve when watching is started.
130
- * Return a disposable to stop file watching under the given uri.
131
- */
132
- watchFileChanges(uri: URI): Promise<Disposable>;
133
- }
134
- //# sourceMappingURL=filesystem-watcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filesystem-watcher.d.ts","sourceRoot":"","sources":["../../src/browser/filesystem-watcher.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACH,cAAc,EACjB,CAAC;AAEF,MAAM,WAAW,UAAU;IACvB,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,cAAc,CAAC;CACxB;AACD,yBAAiB,UAAU,CAAC;IACxB,SAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/D;IACD,SAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE7D;IACD,SAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/D;IACD,SAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAEhE;IACD,SAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/D;CACJ;AAED;;GAEG;AACH,oBAAY,eAAe,GAAG,UAAU,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G,OAAO,CAAC,UAAU,CAAC;CAIxD"}
@@ -1,240 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.FileSystemWatcher = exports.FileOperationEmitter = exports.FileMoveEvent = exports.FileChangeEvent = exports.FileChange = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const disposable_1 = require("@theia/core/lib/common/disposable");
30
- const event_1 = require("@theia/core/lib/common/event");
31
- const file_service_1 = require("./file-service");
32
- var FileChange;
33
- (function (FileChange) {
34
- function isUpdated(change, uri) {
35
- return change.type === 0 /* UPDATED */ && uri.toString() === change.uri.toString();
36
- }
37
- FileChange.isUpdated = isUpdated;
38
- function isAdded(change, uri) {
39
- return change.type === 1 /* ADDED */ && uri.toString() === change.uri.toString();
40
- }
41
- FileChange.isAdded = isAdded;
42
- function isDeleted(change, uri) {
43
- return change.type === 2 /* DELETED */ && change.uri.isEqualOrParent(uri);
44
- }
45
- FileChange.isDeleted = isDeleted;
46
- function isAffected(change, uri) {
47
- return isDeleted(change, uri) || uri.toString() === change.uri.toString();
48
- }
49
- FileChange.isAffected = isAffected;
50
- function isChanged(change, uri) {
51
- return !isDeleted(change, uri) && uri.toString() === change.uri.toString();
52
- }
53
- FileChange.isChanged = isChanged;
54
- })(FileChange = exports.FileChange || (exports.FileChange = {}));
55
- var FileChangeEvent;
56
- (function (FileChangeEvent) {
57
- function isUpdated(event, uri) {
58
- return event.some(change => FileChange.isUpdated(change, uri));
59
- }
60
- FileChangeEvent.isUpdated = isUpdated;
61
- function isAdded(event, uri) {
62
- return event.some(change => FileChange.isAdded(change, uri));
63
- }
64
- FileChangeEvent.isAdded = isAdded;
65
- function isDeleted(event, uri) {
66
- return event.some(change => FileChange.isDeleted(change, uri));
67
- }
68
- FileChangeEvent.isDeleted = isDeleted;
69
- function isAffected(event, uri) {
70
- return event.some(change => FileChange.isAffected(change, uri));
71
- }
72
- FileChangeEvent.isAffected = isAffected;
73
- function isChanged(event, uri) {
74
- return !isDeleted(event, uri) && event.some(change => FileChange.isChanged(change, uri));
75
- }
76
- FileChangeEvent.isChanged = isChanged;
77
- })(FileChangeEvent = exports.FileChangeEvent || (exports.FileChangeEvent = {}));
78
- var FileMoveEvent;
79
- (function (FileMoveEvent) {
80
- function isRename({ sourceUri, targetUri }) {
81
- return sourceUri.parent.toString() === targetUri.parent.toString();
82
- }
83
- FileMoveEvent.isRename = isRename;
84
- })(FileMoveEvent = exports.FileMoveEvent || (exports.FileMoveEvent = {}));
85
- class FileOperationEmitter {
86
- constructor() {
87
- this.onWillEmitter = new event_1.Emitter();
88
- this.onWill = this.onWillEmitter.event;
89
- this.onDidFailEmitter = new event_1.Emitter();
90
- this.onDidFail = this.onDidFailEmitter.event;
91
- this.onDidEmitter = new event_1.Emitter();
92
- this.onDid = this.onDidEmitter.event;
93
- this.toDispose = new disposable_1.DisposableCollection(this.onWillEmitter, this.onDidFailEmitter, this.onDidEmitter);
94
- }
95
- dispose() {
96
- this.toDispose.dispose();
97
- }
98
- async fireWill(event) {
99
- await event_1.WaitUntilEvent.fire(this.onWillEmitter, event);
100
- }
101
- async fireDid(failed, event) {
102
- const onDidEmitter = failed ? this.onDidFailEmitter : this.onDidEmitter;
103
- await event_1.WaitUntilEvent.fire(onDidEmitter, event);
104
- }
105
- }
106
- exports.FileOperationEmitter = FileOperationEmitter;
107
- /**
108
- * React to file system events, including calls originating from the
109
- * application or event coming from the system's filesystem directly
110
- * (actual file watching).
111
- *
112
- * `on(will|did)(create|rename|delete)` events solely come from application
113
- * usage, not from actual filesystem.
114
- *
115
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.watch` instead
116
- */
117
- let FileSystemWatcher = class FileSystemWatcher {
118
- constructor() {
119
- this.toDispose = new disposable_1.DisposableCollection();
120
- this.toRestartAll = new disposable_1.DisposableCollection();
121
- this.onFileChangedEmitter = new event_1.Emitter();
122
- /**
123
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onDidFilesChange` instead
124
- */
125
- this.onFilesChanged = this.onFileChangedEmitter.event;
126
- this.fileCreateEmitter = new FileOperationEmitter();
127
- /**
128
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onWillRunUserOperation` instead
129
- */
130
- this.onWillCreate = this.fileCreateEmitter.onWill;
131
- /**
132
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onDidFailUserOperation` instead
133
- */
134
- this.onDidFailCreate = this.fileCreateEmitter.onDidFail;
135
- /**
136
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908),
137
- * instead use `FileService.onDidRunUserOperation` for events triggered by user gestures
138
- * or `FileService.onDidRunOperation` triggered by user gestures and programmatically
139
- */
140
- this.onDidCreate = this.fileCreateEmitter.onDid;
141
- this.fileDeleteEmitter = new FileOperationEmitter();
142
- /**
143
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onWillRunUserOperation` instead
144
- */
145
- this.onWillDelete = this.fileDeleteEmitter.onWill;
146
- /**
147
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onDidFailUserOperation` instead
148
- */
149
- this.onDidFailDelete = this.fileDeleteEmitter.onDidFail;
150
- /**
151
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908),
152
- * instead use `FileService.onDidRunUserOperation` for events triggered by user gestures
153
- * or `FileService.onDidRunOperation` triggered by user gestures and programmatically
154
- */
155
- this.onDidDelete = this.fileDeleteEmitter.onDid;
156
- this.fileMoveEmitter = new FileOperationEmitter();
157
- /**
158
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onWillRunUserOperation` instead
159
- */
160
- this.onWillMove = this.fileMoveEmitter.onWill;
161
- /**
162
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.onDidFailUserOperation` instead
163
- */
164
- this.onDidFailMove = this.fileMoveEmitter.onDidFail;
165
- /**
166
- * @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908),
167
- * instead use `FileService.onDidRunUserOperation` for events triggered by user gestures
168
- * or `FileService.onDidRunOperation` triggered by user gestures and programmatically
169
- */
170
- this.onDidMove = this.fileMoveEmitter.onDid;
171
- }
172
- init() {
173
- this.toDispose.push(this.onFileChangedEmitter);
174
- this.toDispose.push(this.fileDeleteEmitter);
175
- this.toDispose.push(this.fileMoveEmitter);
176
- this.toDispose.push(this.fileService.onWillRunUserOperation(event => {
177
- if (event.operation === 0 /* CREATE */) {
178
- this.fileCreateEmitter.fireWill({ uri: event.target });
179
- }
180
- else if (event.operation === 1 /* DELETE */) {
181
- this.fileDeleteEmitter.fireWill({ uri: event.target });
182
- }
183
- else if (event.operation === 2 /* MOVE */ && event.source) {
184
- this.fileMoveEmitter.fireWill({ sourceUri: event.source, targetUri: event.target });
185
- }
186
- }));
187
- this.toDispose.push(this.fileService.onDidFailUserOperation(event => {
188
- if (event.operation === 0 /* CREATE */) {
189
- this.fileCreateEmitter.fireDid(true, { uri: event.target });
190
- }
191
- else if (event.operation === 1 /* DELETE */) {
192
- this.fileDeleteEmitter.fireDid(true, { uri: event.target });
193
- }
194
- else if (event.operation === 2 /* MOVE */ && event.source) {
195
- this.fileMoveEmitter.fireDid(true, { sourceUri: event.source, targetUri: event.target });
196
- }
197
- }));
198
- this.toDispose.push(this.fileService.onDidRunUserOperation(event => {
199
- if (event.operation === 0 /* CREATE */) {
200
- this.fileCreateEmitter.fireDid(false, { uri: event.target });
201
- }
202
- else if (event.operation === 1 /* DELETE */) {
203
- this.fileDeleteEmitter.fireDid(false, { uri: event.target });
204
- }
205
- else if (event.operation === 2 /* MOVE */ && event.source) {
206
- this.fileMoveEmitter.fireDid(false, { sourceUri: event.source, targetUri: event.target });
207
- }
208
- }));
209
- }
210
- /**
211
- * Stop watching.
212
- */
213
- dispose() {
214
- this.toDispose.dispose();
215
- }
216
- /**
217
- * Start file watching under the given uri.
218
- *
219
- * Resolve when watching is started.
220
- * Return a disposable to stop file watching under the given uri.
221
- */
222
- async watchFileChanges(uri) {
223
- return this.fileService.watch(uri);
224
- }
225
- };
226
- __decorate([
227
- (0, inversify_1.inject)(file_service_1.FileService),
228
- __metadata("design:type", file_service_1.FileService)
229
- ], FileSystemWatcher.prototype, "fileService", void 0);
230
- __decorate([
231
- (0, inversify_1.postConstruct)(),
232
- __metadata("design:type", Function),
233
- __metadata("design:paramtypes", []),
234
- __metadata("design:returntype", void 0)
235
- ], FileSystemWatcher.prototype, "init", null);
236
- FileSystemWatcher = __decorate([
237
- (0, inversify_1.injectable)()
238
- ], FileSystemWatcher);
239
- exports.FileSystemWatcher = FileSystemWatcher;
240
- //# sourceMappingURL=filesystem-watcher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filesystem-watcher.js","sourceRoot":"","sources":["../../src/browser/filesystem-watcher.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;AAEhF,4DAAiF;AACjF,kEAAqF;AACrF,wDAAuE;AAGvE,iDAA6C;AAU7C,IAAiB,UAAU,CAgB1B;AAhBD,WAAiB,UAAU;IACvB,SAAgB,SAAS,CAAC,MAAkB,EAAE,GAAQ;QAClD,OAAO,MAAM,CAAC,IAAI,oBAA2B,IAAI,GAAG,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC9F,CAAC;IAFe,oBAAS,YAExB,CAAA;IACD,SAAgB,OAAO,CAAC,MAAkB,EAAE,GAAQ;QAChD,OAAO,MAAM,CAAC,IAAI,kBAAyB,IAAI,GAAG,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC5F,CAAC;IAFe,kBAAO,UAEtB,CAAA;IACD,SAAgB,SAAS,CAAC,MAAkB,EAAE,GAAQ;QAClD,OAAO,MAAM,CAAC,IAAI,oBAA2B,IAAI,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IACrF,CAAC;IAFe,oBAAS,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AE,CAAC,CAAC;aAC7F;QACL,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;IAED;;OAEG;IACH,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB,CAAC,GAAQ;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;CAEJ,CAAA;AAtDG;IADC,IAAA,kBAAM,EAAC,0BAAW,CAAC;8BACY,0BAAW;sDAAC;AAG5C;IADC,IAAA,yBAAa,GAAE;;;;6CAiCf;AA/FQ,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;GACA,iBAAiB,CAkH7B;AAlHY,8CAAiB"}
@@ -1,19 +0,0 @@
1
- import { Disposable } from '@theia/core/lib/common/disposable';
2
- /**
3
- * @deprecated since 1.17.0
4
- */
5
- export declare class NodeFileUpload implements Disposable {
6
- readonly uri: string;
7
- readonly size: number;
8
- readonly id: string;
9
- readonly fsPath: string;
10
- readonly uploadPath: string;
11
- protected _uploadedBytes: number;
12
- get uploadedBytes(): number;
13
- constructor(uri: string, size: number);
14
- create(): Promise<void>;
15
- append(chunk: ArrayBuffer): Promise<void>;
16
- rename(): Promise<void>;
17
- dispose(): void;
18
- }
19
- //# sourceMappingURL=node-file-upload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-file-upload.d.ts","sourceRoot":"","sources":["../../src/node/node-file-upload.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D;;GAEG;AACH,qBAAa,cAAe,YAAW,UAAU;IAWzC,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAVzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,cAAc,SAAK;IAC7B,IAAI,aAAa,IAAI,MAAM,CAE1B;gBAGY,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM;IAOnB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7B,OAAO,IAAI,IAAI;CAIlB"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.NodeFileUpload = void 0;
19
- const path = require("path");
20
- const crypto = require("crypto");
21
- const fs = require("@theia/core/shared/fs-extra");
22
- const buffer_1 = require("buffer");
23
- const file_uri_1 = require("@theia/core/lib/node/file-uri");
24
- /**
25
- * @deprecated since 1.17.0
26
- */
27
- class NodeFileUpload {
28
- constructor(uri, size) {
29
- this.uri = uri;
30
- this.size = size;
31
- this._uploadedBytes = 0;
32
- this.fsPath = file_uri_1.FileUri.fsPath(uri);
33
- this.id = 'theia_upload_' + crypto.randomBytes(16).toString('hex');
34
- this.uploadPath = path.join(path.dirname(this.fsPath), this.id);
35
- }
36
- get uploadedBytes() {
37
- return this._uploadedBytes;
38
- }
39
- async create() {
40
- await fs.outputFile(this.uploadPath, '');
41
- }
42
- async append(chunk) {
43
- await fs.appendFile(this.uploadPath, buffer_1.Buffer.from(chunk));
44
- this._uploadedBytes += chunk.byteLength;
45
- }
46
- async rename() {
47
- await fs.move(this.uploadPath, this.fsPath, { overwrite: true });
48
- this.dispose = () => Promise.resolve();
49
- }
50
- dispose() {
51
- fs.unlink(this.uploadPath).catch(() => { });
52
- }
53
- }
54
- exports.NodeFileUpload = NodeFileUpload;
55
- //# sourceMappingURL=node-file-upload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-file-upload.js","sourceRoot":"","sources":["../../src/node/node-file-upload.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,6BAA6B;AAC7B,iCAAiC;AACjC,kDAAkD;AAClD,mCAAgC;AAEhC,4DAAwD;AAExD;;GAEG;AACH,MAAa,cAAc;IAUvB,YACa,GAAW,EACX,IAAY;QADZ,QAAG,GAAH,GAAG,CAAQ;QACX,SAAI,GAAJ,IAAI,CAAQ;QAPf,mBAAc,GAAG,CAAC,CAAC;QASzB,IAAI,CAAC,MAAM,GAAG,kBAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,GAAG,eAAe,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAXD,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAWD,KAAK,CAAC,MAAM;QACR,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAkB;QAC3B,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,eAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,UAAU,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,MAAM;QACR,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO;QACH,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAc,CAAC,CAAC,CAAC;IAC3D,CAAC;CAEJ;AArCD,wCAqCC"}
@@ -1,53 +0,0 @@
1
- import * as nsfw from '@theia/core/shared/nsfw';
2
- import { IMinimatch } from 'minimatch';
3
- import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
4
- import { FileChangeType, FileSystemWatcherClient, FileSystemWatcherServer, WatchOptions } from '../../common/filesystem-watcher-protocol';
5
- import { FileChangeCollection } from '../file-change-collection';
6
- /**
7
- * @deprecated since 1.6.0
8
- */
9
- export interface WatcherOptions {
10
- ignored: IMinimatch[];
11
- }
12
- /**
13
- * @deprecated since 1.6.0 use `NsfwFileSystemWatcherService` instead.
14
- */
15
- export declare class NsfwFileSystemWatcherServer implements FileSystemWatcherServer {
16
- protected client: FileSystemWatcherClient | undefined;
17
- protected watcherSequence: number;
18
- protected readonly watchers: Map<number, Disposable>;
19
- protected readonly watcherOptions: Map<number, WatcherOptions>;
20
- protected readonly toDispose: DisposableCollection;
21
- protected changes: FileChangeCollection;
22
- protected readonly options: {
23
- verbose: boolean;
24
- info: (message: string, ...args: any[]) => void;
25
- error: (message: string, ...args: any[]) => void;
26
- nsfwOptions: nsfw.Options;
27
- };
28
- constructor(options?: {
29
- verbose?: boolean;
30
- nsfwOptions?: nsfw.Options;
31
- info?: (message: string, ...args: any[]) => void;
32
- error?: (message: string, ...args: any[]) => void;
33
- });
34
- dispose(): void;
35
- watchFileChanges(uri: string, options?: WatchOptions): Promise<number>;
36
- protected start(watcherId: number, basePath: string, rawOptions: WatchOptions | undefined, toDisposeWatcher: DisposableCollection): Promise<void>;
37
- unwatchFileChanges(watcherId: number): Promise<void>;
38
- setClient(client: FileSystemWatcherClient | undefined): void;
39
- protected pushAdded(watcherId: number, path: string): void;
40
- protected pushUpdated(watcherId: number, path: string): void;
41
- protected pushDeleted(watcherId: number, path: string): void;
42
- protected pushFileChange(watcherId: number, path: string, type: FileChangeType): void;
43
- protected resolvePath(directory: string, file: string): string;
44
- /**
45
- * Fires file changes to clients.
46
- * It is debounced in the case if the filesystem is spamming to avoid overwhelming clients with events.
47
- */
48
- protected readonly fireDidFilesChanged: () => void;
49
- protected doFireDidFilesChanged(): void;
50
- protected isIgnored(watcherId: number, path: string): boolean;
51
- protected debug(message: string, ...params: any[]): void;
52
- }
53
- //# sourceMappingURL=nsfw-filesystem-watcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nsfw-filesystem-watcher.d.ts","sourceRoot":"","sources":["../../../src/node/nsfw-watcher/nsfw-filesystem-watcher.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAa,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAErF,OAAO,EACH,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,YA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