@sinoia/hubdoc-tools 1.3.4 → 1.3.6
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/dist/plugins/alfresco/index.d.ts +26 -0
- package/dist/plugins/alfresco/index.d.ts.map +1 -0
- package/dist/plugins/alfresco/index.js +405 -0
- package/dist/plugins/alfresco/index.js.map +1 -0
- package/dist/plugins/aws-s3/index.d.ts +23 -0
- package/dist/plugins/aws-s3/index.d.ts.map +1 -0
- package/dist/plugins/aws-s3/index.js +383 -0
- package/dist/plugins/aws-s3/index.js.map +1 -0
- package/dist/plugins/azure-blob/index.d.ts +23 -0
- package/dist/plugins/azure-blob/index.d.ts.map +1 -0
- package/dist/plugins/azure-blob/index.js +340 -0
- package/dist/plugins/azure-blob/index.js.map +1 -0
- package/dist/plugins/box/index.d.ts +26 -0
- package/dist/plugins/box/index.d.ts.map +1 -0
- package/dist/plugins/box/index.js +387 -0
- package/dist/plugins/box/index.js.map +1 -0
- package/dist/plugins/dropbox/index.d.ts +27 -0
- package/dist/plugins/dropbox/index.d.ts.map +1 -0
- package/dist/plugins/dropbox/index.js +375 -0
- package/dist/plugins/dropbox/index.js.map +1 -0
- package/dist/plugins/googledrive/index.d.ts +27 -0
- package/dist/plugins/googledrive/index.d.ts.map +1 -0
- package/dist/plugins/googledrive/index.js +383 -0
- package/dist/plugins/googledrive/index.js.map +1 -0
- package/dist/plugins/nuxeo/index.d.ts +24 -0
- package/dist/plugins/nuxeo/index.d.ts.map +1 -0
- package/dist/plugins/nuxeo/index.js +405 -0
- package/dist/plugins/nuxeo/index.js.map +1 -0
- package/dist/plugins/onedrive/index.d.ts +25 -0
- package/dist/plugins/onedrive/index.d.ts.map +1 -0
- package/dist/plugins/onedrive/index.js +362 -0
- package/dist/plugins/onedrive/index.js.map +1 -0
- package/dist/plugins/opentext/index.d.ts +26 -0
- package/dist/plugins/opentext/index.d.ts.map +1 -0
- package/dist/plugins/opentext/index.js +440 -0
- package/dist/plugins/opentext/index.js.map +1 -0
- package/dist/plugins/sharepoint/index.d.ts +27 -0
- package/dist/plugins/sharepoint/index.d.ts.map +1 -0
- package/dist/plugins/sharepoint/index.js +397 -0
- package/dist/plugins/sharepoint/index.js.map +1 -0
- package/package.json +7 -2
- package/plugins/aws-s3/index.ts +2 -2
- package/plugins/sharepoint/index.ts +1 -1
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const axios_1 = __importDefault(require("axios"));
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
class SharePointPlugin {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.name = 'sharepoint';
|
|
12
|
+
this.version = '1.0.0';
|
|
13
|
+
this.description = 'SharePoint Online document source';
|
|
14
|
+
this.supportedOperations = ['import', 'export', 'both'];
|
|
15
|
+
this.baseUrl = 'https://graph.microsoft.com/v1.0';
|
|
16
|
+
}
|
|
17
|
+
async testConnection(config) {
|
|
18
|
+
try {
|
|
19
|
+
const client = this.createApiClient(config);
|
|
20
|
+
const siteInfo = await this.getSiteInfo(client, config.siteUrl);
|
|
21
|
+
return !!siteInfo.id;
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error(`SharePoint connection test failed: ${error.message}`);
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async scan(config, options) {
|
|
29
|
+
this.config = config;
|
|
30
|
+
this.apiClient = this.createApiClient(this.config);
|
|
31
|
+
const sources = [];
|
|
32
|
+
const errors = [];
|
|
33
|
+
let totalSize = 0;
|
|
34
|
+
try {
|
|
35
|
+
const limit = this.config.limit || options?.limit;
|
|
36
|
+
console.log(`🔍 Scanning SharePoint site${limit ? ` (limit: ${limit})` : ''}...`);
|
|
37
|
+
// Get site information
|
|
38
|
+
const siteInfo = await this.getSiteInfo(this.apiClient, this.config.siteUrl);
|
|
39
|
+
// Get drive ID (default drive or specified drive)
|
|
40
|
+
const driveId = this.config.driveId || await this.getDefaultDriveId(siteInfo.id);
|
|
41
|
+
// Scan items starting from root or specified folder
|
|
42
|
+
const startingFolderId = this.config.folderId || 'root';
|
|
43
|
+
const items = await this.scanDriveFolder(driveId, startingFolderId, '');
|
|
44
|
+
let processedCount = 0;
|
|
45
|
+
for (const item of items) {
|
|
46
|
+
if (item.file) {
|
|
47
|
+
const source = {
|
|
48
|
+
id: item.id,
|
|
49
|
+
name: item.name,
|
|
50
|
+
path: this.getItemPath(item),
|
|
51
|
+
size: item.size || 0,
|
|
52
|
+
mimeType: item.file.mimeType,
|
|
53
|
+
lastModified: new Date(item.lastModifiedDateTime),
|
|
54
|
+
metadata: {
|
|
55
|
+
sharepointId: item.id,
|
|
56
|
+
driveId: driveId,
|
|
57
|
+
createdAt: item.createdDateTime,
|
|
58
|
+
createdBy: item.createdBy.user.displayName,
|
|
59
|
+
modifiedBy: item.lastModifiedBy.user.displayName,
|
|
60
|
+
webUrl: item.webUrl,
|
|
61
|
+
quickXorHash: item.file.hashes?.quickXorHash,
|
|
62
|
+
sha1Hash: item.file.hashes?.sha1Hash
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
// Apply filters
|
|
66
|
+
if (this.shouldIncludeSource(source, options)) {
|
|
67
|
+
sources.push(source);
|
|
68
|
+
totalSize += source.size;
|
|
69
|
+
processedCount++;
|
|
70
|
+
// Check limit
|
|
71
|
+
if (limit && processedCount >= limit) {
|
|
72
|
+
console.log(`📏 Reached limit of ${limit} files`);
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
sources,
|
|
80
|
+
totalCount: sources.length,
|
|
81
|
+
totalSize,
|
|
82
|
+
errors
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return {
|
|
87
|
+
sources: [],
|
|
88
|
+
totalCount: 0,
|
|
89
|
+
totalSize: 0,
|
|
90
|
+
errors: [`SharePoint scan failed: ${error.message}`]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async scanDriveFolder(driveId, folderId, parentPath) {
|
|
95
|
+
if (!this.apiClient)
|
|
96
|
+
throw new Error('API client not initialized');
|
|
97
|
+
const allItems = [];
|
|
98
|
+
let nextLink = null;
|
|
99
|
+
try {
|
|
100
|
+
do {
|
|
101
|
+
const url = nextLink || `/drives/${driveId}/items/${folderId}/children`;
|
|
102
|
+
const response = await this.apiClient.get(url, {
|
|
103
|
+
params: nextLink ? {} : {
|
|
104
|
+
$expand: 'thumbnails',
|
|
105
|
+
$select: 'id,name,size,lastModifiedDateTime,createdDateTime,file,folder,createdBy,lastModifiedBy,parentReference,webUrl'
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
const items = response.data.value || [];
|
|
109
|
+
for (const item of items) {
|
|
110
|
+
const itemPath = parentPath ? `${parentPath}/${item.name}` : item.name;
|
|
111
|
+
if (item.file) {
|
|
112
|
+
// Add path information to the item
|
|
113
|
+
item.fullPath = itemPath;
|
|
114
|
+
allItems.push(item);
|
|
115
|
+
}
|
|
116
|
+
else if (item.folder) {
|
|
117
|
+
// Recursively scan subfolders
|
|
118
|
+
const subItems = await this.scanDriveFolder(driveId, item.id, itemPath);
|
|
119
|
+
allItems.push(...subItems);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
nextLink = response.data['@odata.nextLink'] || null;
|
|
123
|
+
} while (nextLink);
|
|
124
|
+
return allItems;
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
if (error.response?.status === 404) {
|
|
128
|
+
console.warn(`Warning: Folder not found: ${folderId}`);
|
|
129
|
+
return [];
|
|
130
|
+
}
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async import(config, sources, targetDir, options) {
|
|
135
|
+
this.config = config;
|
|
136
|
+
this.apiClient = this.createApiClient(this.config);
|
|
137
|
+
const results = [];
|
|
138
|
+
const batchSize = options?.batchSize || 5;
|
|
139
|
+
// Process in batches to respect API limits
|
|
140
|
+
for (let i = 0; i < sources.length; i += batchSize) {
|
|
141
|
+
const batch = sources.slice(i, i + batchSize);
|
|
142
|
+
for (const source of batch) {
|
|
143
|
+
const result = await this.importSingle(source, targetDir);
|
|
144
|
+
results.push(result);
|
|
145
|
+
// Small delay to respect rate limits
|
|
146
|
+
await this.sleep(200);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return results;
|
|
150
|
+
}
|
|
151
|
+
async importSingle(source, targetDir) {
|
|
152
|
+
try {
|
|
153
|
+
if (!this.apiClient)
|
|
154
|
+
throw new Error('API client not initialized');
|
|
155
|
+
const targetPath = path_1.default.join(targetDir, source.path);
|
|
156
|
+
const targetDirectory = path_1.default.dirname(targetPath);
|
|
157
|
+
await fs_extra_1.default.ensureDir(targetDirectory);
|
|
158
|
+
// Get the drive ID from metadata
|
|
159
|
+
const driveId = source.metadata?.driveId;
|
|
160
|
+
if (!driveId) {
|
|
161
|
+
throw new Error('Drive ID not found in source metadata');
|
|
162
|
+
}
|
|
163
|
+
// Download file content from SharePoint
|
|
164
|
+
const response = await this.apiClient.get(`/drives/${driveId}/items/${source.id}/content`, {
|
|
165
|
+
responseType: 'stream'
|
|
166
|
+
});
|
|
167
|
+
const writer = fs_extra_1.default.createWriteStream(targetPath);
|
|
168
|
+
response.data.pipe(writer);
|
|
169
|
+
return new Promise((resolve) => {
|
|
170
|
+
writer.on('finish', () => {
|
|
171
|
+
resolve({
|
|
172
|
+
success: true,
|
|
173
|
+
source,
|
|
174
|
+
localPath: targetPath,
|
|
175
|
+
bytesTransferred: source.size
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
writer.on('error', (error) => {
|
|
179
|
+
resolve({
|
|
180
|
+
success: false,
|
|
181
|
+
source,
|
|
182
|
+
error: error.message
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
return {
|
|
189
|
+
success: false,
|
|
190
|
+
source,
|
|
191
|
+
error: error.message
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
async export(config, localSources, options) {
|
|
196
|
+
this.config = config;
|
|
197
|
+
this.apiClient = this.createApiClient(this.config);
|
|
198
|
+
const results = [];
|
|
199
|
+
try {
|
|
200
|
+
// Get site and drive information
|
|
201
|
+
const siteInfo = await this.getSiteInfo(this.apiClient, this.config.siteUrl);
|
|
202
|
+
const driveId = this.config.driveId || await this.getDefaultDriveId(siteInfo.id);
|
|
203
|
+
const rootFolderId = this.config.folderId || 'root';
|
|
204
|
+
for (const source of localSources) {
|
|
205
|
+
try {
|
|
206
|
+
// Determine target folder
|
|
207
|
+
let targetFolderId = rootFolderId;
|
|
208
|
+
if (options?.preserveStructure && source.path.includes('/')) {
|
|
209
|
+
const folderPath = path_1.default.dirname(source.path);
|
|
210
|
+
targetFolderId = await this.createFolderStructure(driveId, folderPath, rootFolderId);
|
|
211
|
+
}
|
|
212
|
+
// Read local file
|
|
213
|
+
const fileContent = await fs_extra_1.default.readFile(source.id);
|
|
214
|
+
// Normalize filename to NFC to handle accented characters consistently across platforms
|
|
215
|
+
const fileName = (options?.preserveStructure ? path_1.default.basename(source.path) : source.name).normalize('NFC');
|
|
216
|
+
// Upload file to SharePoint using simple upload (for files < 4MB)
|
|
217
|
+
// For larger files, we should use resumable upload sessions
|
|
218
|
+
const uploadUrl = `/drives/${driveId}/items/${targetFolderId}:/${fileName}:/content`;
|
|
219
|
+
await this.apiClient.put(uploadUrl, fileContent, {
|
|
220
|
+
headers: {
|
|
221
|
+
'Content-Type': source.mimeType || 'application/octet-stream'
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
const targetPath = options?.preserveStructure ? source.path : source.name;
|
|
225
|
+
results.push({
|
|
226
|
+
success: true,
|
|
227
|
+
targetPath,
|
|
228
|
+
source,
|
|
229
|
+
bytesTransferred: source.size
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
results.push({
|
|
234
|
+
success: false,
|
|
235
|
+
targetPath: options?.targetPath || '',
|
|
236
|
+
source,
|
|
237
|
+
error: error.message
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
// If we can't get site/drive info, fail all exports
|
|
244
|
+
for (const source of localSources) {
|
|
245
|
+
results.push({
|
|
246
|
+
success: false,
|
|
247
|
+
targetPath: options?.targetPath || '',
|
|
248
|
+
source,
|
|
249
|
+
error: `Failed to initialize SharePoint connection: ${error.message}`
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return results;
|
|
254
|
+
}
|
|
255
|
+
async getSiteInfo(client, siteUrl) {
|
|
256
|
+
// Extract hostname and site path from URL
|
|
257
|
+
const url = new URL(siteUrl);
|
|
258
|
+
const hostname = url.hostname;
|
|
259
|
+
const sitePath = url.pathname;
|
|
260
|
+
const response = await client.get(`/sites/${hostname}:${sitePath}`);
|
|
261
|
+
return response.data;
|
|
262
|
+
}
|
|
263
|
+
async getDefaultDriveId(siteId) {
|
|
264
|
+
if (!this.apiClient)
|
|
265
|
+
throw new Error('API client not initialized');
|
|
266
|
+
const response = await this.apiClient.get(`/sites/${siteId}/drive`);
|
|
267
|
+
return response.data.id;
|
|
268
|
+
}
|
|
269
|
+
async createFolderStructure(driveId, folderPath, parentId) {
|
|
270
|
+
if (!this.apiClient)
|
|
271
|
+
throw new Error('API client not initialized');
|
|
272
|
+
const parts = folderPath.split('/').filter(part => part.length > 0);
|
|
273
|
+
let currentParentId = parentId;
|
|
274
|
+
for (const folderName of parts) {
|
|
275
|
+
try {
|
|
276
|
+
// Check if folder already exists
|
|
277
|
+
const searchUrl = `/drives/${driveId}/items/${currentParentId}/children`;
|
|
278
|
+
const response = await this.apiClient.get(searchUrl, {
|
|
279
|
+
params: {
|
|
280
|
+
$filter: `name eq '${folderName}' and folder ne null`
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
const existingFolder = response.data.value[0];
|
|
284
|
+
if (existingFolder) {
|
|
285
|
+
currentParentId = existingFolder.id;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
// Create new folder
|
|
289
|
+
const createResponse = await this.apiClient.post(`/drives/${driveId}/items/${currentParentId}/children`, {
|
|
290
|
+
name: folderName,
|
|
291
|
+
folder: {},
|
|
292
|
+
'@microsoft.graph.conflictBehavior': 'rename'
|
|
293
|
+
});
|
|
294
|
+
currentParentId = createResponse.data.id;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
throw new Error(`Failed to create folder structure: ${error.message}`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return currentParentId;
|
|
302
|
+
}
|
|
303
|
+
getConfigSchema() {
|
|
304
|
+
return {
|
|
305
|
+
type: 'object',
|
|
306
|
+
properties: {
|
|
307
|
+
siteUrl: {
|
|
308
|
+
type: 'string',
|
|
309
|
+
description: 'SharePoint site URL (e.g., https://contoso.sharepoint.com/sites/mysite)',
|
|
310
|
+
required: true
|
|
311
|
+
},
|
|
312
|
+
accessToken: {
|
|
313
|
+
type: 'string',
|
|
314
|
+
description: 'Microsoft Graph API access token with SharePoint permissions',
|
|
315
|
+
required: true
|
|
316
|
+
},
|
|
317
|
+
driveId: {
|
|
318
|
+
type: 'string',
|
|
319
|
+
description: 'Specific drive ID to scan (optional, uses default site drive)',
|
|
320
|
+
required: false
|
|
321
|
+
},
|
|
322
|
+
folderId: {
|
|
323
|
+
type: 'string',
|
|
324
|
+
description: 'Starting folder ID (optional, defaults to drive root)',
|
|
325
|
+
required: false
|
|
326
|
+
},
|
|
327
|
+
limit: {
|
|
328
|
+
type: 'number',
|
|
329
|
+
description: 'Maximum number of documents to scan (useful for testing)',
|
|
330
|
+
required: false
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
required: ['siteUrl', 'accessToken']
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
async initialize(config) {
|
|
337
|
+
this.config = config;
|
|
338
|
+
if (!this.config.siteUrl || !this.config.accessToken) {
|
|
339
|
+
throw new Error('SharePoint site URL and access token are required');
|
|
340
|
+
}
|
|
341
|
+
this.apiClient = this.createApiClient(this.config);
|
|
342
|
+
}
|
|
343
|
+
async destroy() {
|
|
344
|
+
this.config = undefined;
|
|
345
|
+
this.apiClient = undefined;
|
|
346
|
+
}
|
|
347
|
+
createApiClient(config) {
|
|
348
|
+
return axios_1.default.create({
|
|
349
|
+
baseURL: this.baseUrl,
|
|
350
|
+
headers: {
|
|
351
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
352
|
+
'Content-Type': 'application/json'
|
|
353
|
+
},
|
|
354
|
+
timeout: 30000
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
getItemPath(item) {
|
|
358
|
+
// Use the full path if available from scanning
|
|
359
|
+
if (item.fullPath) {
|
|
360
|
+
return item.fullPath;
|
|
361
|
+
}
|
|
362
|
+
// Construct path from parent reference
|
|
363
|
+
if (item.parentReference?.path) {
|
|
364
|
+
const pathParts = item.parentReference.path
|
|
365
|
+
.split('/root:/')
|
|
366
|
+
.pop()
|
|
367
|
+
?.split('/') || [];
|
|
368
|
+
pathParts.push(item.name);
|
|
369
|
+
return pathParts.filter(part => part.length > 0).join('/');
|
|
370
|
+
}
|
|
371
|
+
return item.name;
|
|
372
|
+
}
|
|
373
|
+
shouldIncludeSource(source, options) {
|
|
374
|
+
// Apply size filter
|
|
375
|
+
if (options?.filters?.maxSize && source.size > options.filters.maxSize) {
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
// Apply date range filter
|
|
379
|
+
if (options?.filters?.dateRange) {
|
|
380
|
+
const { from, to } = options.filters.dateRange;
|
|
381
|
+
if (from && source.lastModified < from)
|
|
382
|
+
return false;
|
|
383
|
+
if (to && source.lastModified > to)
|
|
384
|
+
return false;
|
|
385
|
+
}
|
|
386
|
+
// Apply MIME type filter
|
|
387
|
+
if (options?.filters?.mimeTypes && !options.filters.mimeTypes.includes(source.mimeType)) {
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
392
|
+
sleep(ms) {
|
|
393
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
exports.default = SharePointPlugin;
|
|
397
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../plugins/sharepoint/index.ts"],"names":[],"mappings":";;;;;AAAA,kDAA6C;AAC7C,wDAA0B;AAC1B,gDAAwB;AAwDxB,MAAqB,gBAAgB;IAArC;QACW,SAAI,GAAG,YAAY,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,gBAAW,GAAG,mCAAmC,CAAC;QAClD,wBAAmB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;QAIpD,YAAO,GAAG,kCAAkC,CAAC;IA0bhE,CAAC;IAxbC,KAAK,CAAC,cAAc,CAAC,MAAoB;QACvC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,MAA0B,CAAC,CAAC;YAChE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAG,MAA2B,CAAC,OAAO,CAAC,CAAC;YACtF,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO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E;gBAAE,OAAO,KAAK,CAAC;QACnD,CAAC;QAED,yBAAyB;QACzB,IAAI,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxF,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,KAAK,CAAC,EAAU;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAlcD,mCAkcC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinoia/hubdoc-tools",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Professional command-line tool for HubDoc document management and bulk import/export",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,12 +19,17 @@
|
|
|
19
19
|
"require": "./dist/index.js",
|
|
20
20
|
"import": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
+
"./plugins/*": {
|
|
23
|
+
"types": "./dist/plugins/*/index.d.ts",
|
|
24
|
+
"require": "./dist/plugins/*/index.js",
|
|
25
|
+
"import": "./dist/plugins/*/index.js"
|
|
26
|
+
},
|
|
22
27
|
"./package.json": "./package.json"
|
|
23
28
|
},
|
|
24
29
|
"scripts": {
|
|
25
30
|
"build": "npm run build:main && npm run build:plugins",
|
|
26
31
|
"build:main": "tsc --project tsconfig.main.json && tsc-alias",
|
|
27
|
-
"build:plugins": "tsc --project tsconfig.plugins.json && npm run copy:plugin-manifests",
|
|
32
|
+
"build:plugins": "tsc --project tsconfig.plugins.json && tsc-alias && npm run copy:plugin-manifests",
|
|
28
33
|
"copy:plugin-manifests": "for dir in plugins/*/; do name=$(basename \"$dir\"); [ -f \"$dir/plugin.json\" ] && mkdir -p \"dist/plugins/$name\" && cp \"$dir/plugin.json\" \"dist/plugins/$name/\" || true; done",
|
|
29
34
|
"dev": "ts-node -r tsconfig-paths/register src/cli.ts",
|
|
30
35
|
"start": "node dist/cli.js",
|
package/plugins/aws-s3/index.ts
CHANGED
|
@@ -191,12 +191,12 @@ export default class S3Plugin implements DocumentSourcePlugin {
|
|
|
191
191
|
return pump();
|
|
192
192
|
};
|
|
193
193
|
await pump();
|
|
194
|
-
} else if (typeof response.Body.pipe === 'function') {
|
|
194
|
+
} else if (typeof (response.Body as any).pipe === 'function') {
|
|
195
195
|
// Node.js stream
|
|
196
196
|
(response.Body as any).pipe(writer);
|
|
197
197
|
} else {
|
|
198
198
|
// Buffer or Uint8Array
|
|
199
|
-
writer.write(response.Body as
|
|
199
|
+
writer.write(response.Body as any);
|
|
200
200
|
writer.end();
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -161,7 +161,7 @@ export default class SharePointPlugin implements DocumentSourcePlugin {
|
|
|
161
161
|
try {
|
|
162
162
|
do {
|
|
163
163
|
const url = nextLink || `/drives/${driveId}/items/${folderId}/children`;
|
|
164
|
-
const response = await this.apiClient.get(url, {
|
|
164
|
+
const response: any = await this.apiClient.get(url, {
|
|
165
165
|
params: nextLink ? {} : {
|
|
166
166
|
$expand: 'thumbnails',
|
|
167
167
|
$select: 'id,name,size,lastModifiedDateTime,createdDateTime,file,folder,createdBy,lastModifiedBy,parentReference,webUrl'
|