@memberjunction/storage 2.32.1 → 2.32.2
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/drivers/BoxFileStorage.d.ts +87 -0
- package/dist/drivers/BoxFileStorage.d.ts.map +1 -0
- package/dist/drivers/BoxFileStorage.js +652 -0
- package/dist/drivers/BoxFileStorage.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { CreatePreAuthUploadUrlPayload, FileStorageBase, StorageListResult, StorageObjectMetadata } from '../generic/FileStorageBase';
|
|
3
|
+
export declare class BoxFileStorage extends FileStorageBase {
|
|
4
|
+
protected readonly providerName = "Box";
|
|
5
|
+
private _accessToken;
|
|
6
|
+
private _refreshToken;
|
|
7
|
+
private _clientId;
|
|
8
|
+
private _clientSecret;
|
|
9
|
+
private _tokenExpiresAt;
|
|
10
|
+
private _baseApiUrl;
|
|
11
|
+
private _uploadApiUrl;
|
|
12
|
+
private _rootFolderId;
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Ensures we have a valid access token
|
|
16
|
+
*/
|
|
17
|
+
private _ensureValidToken;
|
|
18
|
+
/**
|
|
19
|
+
* Make an authenticated API request to Box
|
|
20
|
+
*/
|
|
21
|
+
private _apiRequest;
|
|
22
|
+
/**
|
|
23
|
+
* Parse a Box API path into folder ID and name components
|
|
24
|
+
*/
|
|
25
|
+
private _parsePath;
|
|
26
|
+
/**
|
|
27
|
+
* Get item ID by path
|
|
28
|
+
*/
|
|
29
|
+
private _getIdFromPath;
|
|
30
|
+
/**
|
|
31
|
+
* Convert Box item to StorageObjectMetadata
|
|
32
|
+
*/
|
|
33
|
+
private _convertToMetadata;
|
|
34
|
+
/**
|
|
35
|
+
* Create a pre-authenticated upload URL
|
|
36
|
+
*/
|
|
37
|
+
CreatePreAuthUploadUrl(objectName: string): Promise<CreatePreAuthUploadUrlPayload>;
|
|
38
|
+
/**
|
|
39
|
+
* Create a pre-authenticated download URL
|
|
40
|
+
*/
|
|
41
|
+
CreatePreAuthDownloadUrl(objectName: string): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Move an object
|
|
44
|
+
*/
|
|
45
|
+
MoveObject(oldObjectName: string, newObjectName: string): Promise<boolean>;
|
|
46
|
+
/**
|
|
47
|
+
* Delete an object
|
|
48
|
+
*/
|
|
49
|
+
DeleteObject(objectName: string): Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* List objects in a directory
|
|
52
|
+
*/
|
|
53
|
+
ListObjects(prefix: string, delimiter?: string): Promise<StorageListResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Create a directory
|
|
56
|
+
*/
|
|
57
|
+
CreateDirectory(directoryPath: string): Promise<boolean>;
|
|
58
|
+
/**
|
|
59
|
+
* Delete a directory
|
|
60
|
+
*/
|
|
61
|
+
DeleteDirectory(directoryPath: string, recursive?: boolean): Promise<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Get object metadata
|
|
64
|
+
*/
|
|
65
|
+
GetObjectMetadata(objectName: string): Promise<StorageObjectMetadata>;
|
|
66
|
+
/**
|
|
67
|
+
* Get an object's contents
|
|
68
|
+
*/
|
|
69
|
+
GetObject(objectName: string): Promise<Buffer>;
|
|
70
|
+
/**
|
|
71
|
+
* Upload an object
|
|
72
|
+
*/
|
|
73
|
+
PutObject(objectName: string, data: Buffer, contentType?: string, metadata?: Record<string, string>): Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Copy an object
|
|
76
|
+
*/
|
|
77
|
+
CopyObject(sourceObjectName: string, destinationObjectName: string): Promise<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Check if an object exists
|
|
80
|
+
*/
|
|
81
|
+
ObjectExists(objectName: string): Promise<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Check if a directory exists
|
|
84
|
+
*/
|
|
85
|
+
DirectoryExists(directoryPath: string): Promise<boolean>;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=BoxFileStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BoxFileStorage.d.ts","sourceRoot":"","sources":["../../src/drivers/BoxFileStorage.ts"],"names":[],"mappings":";AAGA,OAAO,EACL,6BAA6B,EAC7B,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAEpC,qBACa,cAAe,SAAQ,eAAe;IACjD,SAAS,CAAC,QAAQ,CAAC,YAAY,SAAS;IAExC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,WAAW,CAAqC;IACxD,OAAO,CAAC,aAAa,CAA4C;IACjE,OAAO,CAAC,aAAa,CAAS;;IAuB9B;;OAEG;YACW,iBAAiB;IA+C/B;;OAEG;YACW,WAAW;IA6CzB;;OAEG;IACH,OAAO,CAAC,UAAU;IA0BlB;;OAEG;YACW,cAAc;IAgC5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA0B1B;;OAEG;IACU,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAoC/F;;OAEG;IACU,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAwB1E;;OAEG;IACU,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAkCvF;;OAEG;IACU,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA4B/D;;OAEG;IACU,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAuCrF;;OAEG;IACU,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA0CrE;;OAEG;IACU,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IA4CxF;;OAEG;IACU,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAuBlF;;OAEG;IACU,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgB3D;;OAEG;IACU,SAAS,CACpB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,OAAO,CAAC;IAyGnB;;OAEG;IACU,UAAU,CAAC,gBAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqClG;;OAEG;IACU,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS/D;;OAEG;IACU,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAetE"}
|
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
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;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
32
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.BoxFileStorage = void 0;
|
|
36
|
+
const global_1 = require("@memberjunction/global");
|
|
37
|
+
const env = __importStar(require("env-var"));
|
|
38
|
+
const mime = __importStar(require("mime-types"));
|
|
39
|
+
const FileStorageBase_1 = require("../generic/FileStorageBase");
|
|
40
|
+
let BoxFileStorage = class BoxFileStorage extends FileStorageBase_1.FileStorageBase {
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
this.providerName = 'Box';
|
|
44
|
+
this._tokenExpiresAt = 0;
|
|
45
|
+
this._baseApiUrl = 'https://api.box.com/2.0';
|
|
46
|
+
this._uploadApiUrl = 'https://upload.box.com/api/2.0';
|
|
47
|
+
// Box auth can be via access token or refresh token
|
|
48
|
+
this._accessToken = env.get('STORAGE_BOX_ACCESS_TOKEN').asString();
|
|
49
|
+
this._refreshToken = env.get('STORAGE_BOX_REFRESH_TOKEN').asString();
|
|
50
|
+
this._clientId = env.get('STORAGE_BOX_CLIENT_ID').asString();
|
|
51
|
+
this._clientSecret = env.get('STORAGE_BOX_CLIENT_SECRET').asString();
|
|
52
|
+
if (!this._refreshToken && !this._accessToken) {
|
|
53
|
+
throw new Error('Box storage requires either STORAGE_BOX_ACCESS_TOKEN or STORAGE_BOX_REFRESH_TOKEN with CLIENT_ID and CLIENT_SECRET');
|
|
54
|
+
}
|
|
55
|
+
if (this._refreshToken && (!this._clientId || !this._clientSecret)) {
|
|
56
|
+
throw new Error('Box storage with refresh token requires STORAGE_BOX_CLIENT_ID and STORAGE_BOX_CLIENT_SECRET');
|
|
57
|
+
}
|
|
58
|
+
// Root folder ID, optional (defaults to '0' which is root)
|
|
59
|
+
this._rootFolderId = env.get('STORAGE_BOX_ROOT_FOLDER_ID').default('0').asString();
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Ensures we have a valid access token
|
|
63
|
+
*/
|
|
64
|
+
async _ensureValidToken() {
|
|
65
|
+
// If we have a valid token, use it
|
|
66
|
+
if (this._accessToken && Date.now() < this._tokenExpiresAt) {
|
|
67
|
+
return this._accessToken;
|
|
68
|
+
}
|
|
69
|
+
// If we have refresh token, try to get a new access token
|
|
70
|
+
if (this._refreshToken && this._clientId && this._clientSecret) {
|
|
71
|
+
try {
|
|
72
|
+
const response = await fetch('https://api.box.com/oauth2/token', {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
headers: {
|
|
75
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
76
|
+
},
|
|
77
|
+
body: new URLSearchParams({
|
|
78
|
+
grant_type: 'refresh_token',
|
|
79
|
+
refresh_token: this._refreshToken,
|
|
80
|
+
client_id: this._clientId,
|
|
81
|
+
client_secret: this._clientSecret
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
if (!response.ok) {
|
|
85
|
+
throw new Error(`Failed to refresh token: ${response.status} ${response.statusText}`);
|
|
86
|
+
}
|
|
87
|
+
const data = await response.json();
|
|
88
|
+
this._accessToken = data.access_token;
|
|
89
|
+
this._refreshToken = data.refresh_token || this._refreshToken;
|
|
90
|
+
this._tokenExpiresAt = Date.now() + (data.expires_in * 1000) - 60000; // Subtract 1 minute for safety
|
|
91
|
+
return this._accessToken;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.error('Error refreshing Box access token', error);
|
|
95
|
+
throw new Error('Failed to authenticate with Box: ' + error.message);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// If we have an access token but it's expired and we can't refresh it
|
|
99
|
+
if (this._accessToken) {
|
|
100
|
+
console.warn('Using expired Box access token as no refresh token is available');
|
|
101
|
+
return this._accessToken;
|
|
102
|
+
}
|
|
103
|
+
throw new Error('No valid Box access token available');
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Make an authenticated API request to Box
|
|
107
|
+
*/
|
|
108
|
+
async _apiRequest(endpoint, method = 'GET', body, headers = {}, baseUrl = this._baseApiUrl) {
|
|
109
|
+
const token = await this._ensureValidToken();
|
|
110
|
+
const requestHeaders = {
|
|
111
|
+
'Authorization': `Bearer ${token}`,
|
|
112
|
+
...headers
|
|
113
|
+
};
|
|
114
|
+
if (body && typeof body !== 'string' && !(body instanceof FormData) && !(body instanceof URLSearchParams)) {
|
|
115
|
+
requestHeaders['Content-Type'] = 'application/json';
|
|
116
|
+
body = JSON.stringify(body);
|
|
117
|
+
}
|
|
118
|
+
const url = `${baseUrl}${endpoint}`;
|
|
119
|
+
const response = await fetch(url, {
|
|
120
|
+
method,
|
|
121
|
+
headers: requestHeaders,
|
|
122
|
+
body
|
|
123
|
+
});
|
|
124
|
+
if (response.status === 204 || response.status === 202) {
|
|
125
|
+
return null; // No content response
|
|
126
|
+
}
|
|
127
|
+
// For downloading files, return the response directly
|
|
128
|
+
if (endpoint.startsWith('/files/') && endpoint.includes('/content') && response.ok) {
|
|
129
|
+
return response;
|
|
130
|
+
}
|
|
131
|
+
const data = await response.json();
|
|
132
|
+
if (!response.ok) {
|
|
133
|
+
console.error('Box API error', { status: response.status, data });
|
|
134
|
+
throw new Error(`Box API error: ${response.status} - ${data.message || JSON.stringify(data)}`);
|
|
135
|
+
}
|
|
136
|
+
return data;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Parse a Box API path into folder ID and name components
|
|
140
|
+
*/
|
|
141
|
+
_parsePath(path) {
|
|
142
|
+
// Default to root folder
|
|
143
|
+
if (!path || path === '/' || path === '') {
|
|
144
|
+
return { id: this._rootFolderId, name: '', parent: '' };
|
|
145
|
+
}
|
|
146
|
+
// Remove leading and trailing slashes
|
|
147
|
+
let normalizedPath = path;
|
|
148
|
+
if (normalizedPath.startsWith('/')) {
|
|
149
|
+
normalizedPath = normalizedPath.substring(1);
|
|
150
|
+
}
|
|
151
|
+
if (normalizedPath.endsWith('/')) {
|
|
152
|
+
normalizedPath = normalizedPath.substring(0, normalizedPath.length - 1);
|
|
153
|
+
}
|
|
154
|
+
// Parse the name from the path
|
|
155
|
+
const parts = normalizedPath.split('/');
|
|
156
|
+
const name = parts[parts.length - 1];
|
|
157
|
+
// Parse the parent path
|
|
158
|
+
const parentParts = parts.slice(0, parts.length - 1);
|
|
159
|
+
const parent = parentParts.join('/');
|
|
160
|
+
return { id: '', name, parent };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Get item ID by path
|
|
164
|
+
*/
|
|
165
|
+
async _getIdFromPath(path) {
|
|
166
|
+
const parsedPath = this._parsePath(path);
|
|
167
|
+
// If we already have the ID, return it
|
|
168
|
+
if (parsedPath.id) {
|
|
169
|
+
return parsedPath.id;
|
|
170
|
+
}
|
|
171
|
+
// If it's the root, return the root folder ID
|
|
172
|
+
if (!parsedPath.name) {
|
|
173
|
+
return this._rootFolderId;
|
|
174
|
+
}
|
|
175
|
+
// Get the parent folder ID
|
|
176
|
+
let parentId = this._rootFolderId;
|
|
177
|
+
if (parsedPath.parent) {
|
|
178
|
+
parentId = await this._getIdFromPath(parsedPath.parent);
|
|
179
|
+
}
|
|
180
|
+
// Search for the item in the parent folder
|
|
181
|
+
const result = await this._apiRequest(`/folders/${parentId}/items`, 'GET', null, {
|
|
182
|
+
'fields': 'id,name,type'
|
|
183
|
+
});
|
|
184
|
+
const item = result.entries.find(entry => entry.name === parsedPath.name);
|
|
185
|
+
if (!item) {
|
|
186
|
+
throw new Error(`Item not found: ${path}`);
|
|
187
|
+
}
|
|
188
|
+
return item.id;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Convert Box item to StorageObjectMetadata
|
|
192
|
+
*/
|
|
193
|
+
_convertToMetadata(item, parentPath = '') {
|
|
194
|
+
const isDirectory = item.type === 'folder';
|
|
195
|
+
const name = item.name;
|
|
196
|
+
// Construct full path
|
|
197
|
+
const path = parentPath || '';
|
|
198
|
+
const fullPath = path ? `${path}/${name}` : name;
|
|
199
|
+
return {
|
|
200
|
+
name,
|
|
201
|
+
path,
|
|
202
|
+
fullPath,
|
|
203
|
+
size: isDirectory ? 0 : (item.size || 0),
|
|
204
|
+
contentType: isDirectory ?
|
|
205
|
+
'application/x-directory' :
|
|
206
|
+
(item.content_type || mime.lookup(name) || 'application/octet-stream'),
|
|
207
|
+
lastModified: new Date(item.modified_at || item.created_at || Date.now()),
|
|
208
|
+
isDirectory,
|
|
209
|
+
etag: item.etag,
|
|
210
|
+
customMetadata: {
|
|
211
|
+
id: item.id,
|
|
212
|
+
sequence_id: item.sequence_id
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Create a pre-authenticated upload URL
|
|
218
|
+
*/
|
|
219
|
+
async CreatePreAuthUploadUrl(objectName) {
|
|
220
|
+
try {
|
|
221
|
+
// Get the parent folder ID and file name
|
|
222
|
+
const parsedPath = this._parsePath(objectName);
|
|
223
|
+
let parentId = this._rootFolderId;
|
|
224
|
+
if (parsedPath.parent) {
|
|
225
|
+
try {
|
|
226
|
+
parentId = await this._getIdFromPath(parsedPath.parent);
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
// If parent folder doesn't exist, create it recursively
|
|
230
|
+
if (parsedPath.parent) {
|
|
231
|
+
await this.CreateDirectory(parsedPath.parent);
|
|
232
|
+
parentId = await this._getIdFromPath(parsedPath.parent);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// Create a file upload session
|
|
237
|
+
const data = await this._apiRequest('/files/upload_sessions', 'POST', {
|
|
238
|
+
folder_id: parentId,
|
|
239
|
+
file_name: parsedPath.name,
|
|
240
|
+
file_size: 0 // We'll use this later for chunked uploads
|
|
241
|
+
}, {}, this._uploadApiUrl);
|
|
242
|
+
// Return the upload URL with the session ID as the provider key
|
|
243
|
+
return {
|
|
244
|
+
UploadUrl: data.session_endpoints.upload_part,
|
|
245
|
+
ProviderKey: `session:${data.id}:${objectName}`
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
console.error('Error creating pre-auth upload URL', { objectName, error });
|
|
250
|
+
throw new Error(`Failed to create upload URL for: ${objectName}`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Create a pre-authenticated download URL
|
|
255
|
+
*/
|
|
256
|
+
async CreatePreAuthDownloadUrl(objectName) {
|
|
257
|
+
try {
|
|
258
|
+
// Check if this is a session upload that hasn't been completed
|
|
259
|
+
if (objectName.startsWith('session:')) {
|
|
260
|
+
throw new Error('Cannot create download URL for incomplete upload session');
|
|
261
|
+
}
|
|
262
|
+
// Get the file ID
|
|
263
|
+
const fileId = await this._getIdFromPath(objectName);
|
|
264
|
+
// Create a download URL that's good for 60 minutes
|
|
265
|
+
const data = await this._apiRequest(`/files/${fileId}?fields=download_url`, 'GET');
|
|
266
|
+
if (!data.download_url) {
|
|
267
|
+
throw new Error(`No download URL available for: ${objectName}`);
|
|
268
|
+
}
|
|
269
|
+
return data.download_url;
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
console.error('Error creating pre-auth download URL', { objectName, error });
|
|
273
|
+
throw new Error(`Failed to create download URL for: ${objectName}`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Move an object
|
|
278
|
+
*/
|
|
279
|
+
async MoveObject(oldObjectName, newObjectName) {
|
|
280
|
+
try {
|
|
281
|
+
// Get source info
|
|
282
|
+
const sourceId = await this._getIdFromPath(oldObjectName);
|
|
283
|
+
const sourceInfo = await this._apiRequest(`/items/${sourceId}`);
|
|
284
|
+
// Get destination info
|
|
285
|
+
const destPath = this._parsePath(newObjectName);
|
|
286
|
+
let destParentId = this._rootFolderId;
|
|
287
|
+
if (destPath.parent) {
|
|
288
|
+
try {
|
|
289
|
+
destParentId = await this._getIdFromPath(destPath.parent);
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
// Create parent folder if it doesn't exist
|
|
293
|
+
await this.CreateDirectory(destPath.parent);
|
|
294
|
+
destParentId = await this._getIdFromPath(destPath.parent);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
// Move the item
|
|
298
|
+
const endpoint = sourceInfo.type === 'folder' ? '/folders/' : '/files/';
|
|
299
|
+
await this._apiRequest(`${endpoint}${sourceId}`, 'PUT', {
|
|
300
|
+
parent: { id: destParentId },
|
|
301
|
+
name: destPath.name
|
|
302
|
+
});
|
|
303
|
+
return true;
|
|
304
|
+
}
|
|
305
|
+
catch (error) {
|
|
306
|
+
console.error('Error moving object', { oldObjectName, newObjectName, error });
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Delete an object
|
|
312
|
+
*/
|
|
313
|
+
async DeleteObject(objectName) {
|
|
314
|
+
try {
|
|
315
|
+
// Handle session objects specially
|
|
316
|
+
if (objectName.startsWith('session:')) {
|
|
317
|
+
const [, sessionId] = objectName.split(':');
|
|
318
|
+
await this._apiRequest(`/files/upload_sessions/${sessionId}`, 'DELETE');
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
const itemId = await this._getIdFromPath(objectName);
|
|
322
|
+
const itemInfo = await this._apiRequest(`/items/${itemId}`);
|
|
323
|
+
// Delete the item
|
|
324
|
+
const endpoint = itemInfo.type === 'folder' ? '/folders/' : '/files/';
|
|
325
|
+
await this._apiRequest(`${endpoint}${itemId}`, 'DELETE');
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
// If the error is a 404, consider it already deleted
|
|
330
|
+
if (error.message && error.message.includes('404')) {
|
|
331
|
+
return true;
|
|
332
|
+
}
|
|
333
|
+
console.error('Error deleting object', { objectName, error });
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* List objects in a directory
|
|
339
|
+
*/
|
|
340
|
+
async ListObjects(prefix, delimiter = '/') {
|
|
341
|
+
try {
|
|
342
|
+
let folderId;
|
|
343
|
+
try {
|
|
344
|
+
folderId = await this._getIdFromPath(prefix);
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
// If folder doesn't exist, return empty result
|
|
348
|
+
return { objects: [], prefixes: [] };
|
|
349
|
+
}
|
|
350
|
+
// Get folder contents
|
|
351
|
+
const result = await this._apiRequest(`/folders/${folderId}/items`, 'GET', null, {
|
|
352
|
+
'fields': 'id,name,type,size,content_type,modified_at,created_at,etag,sequence_id'
|
|
353
|
+
});
|
|
354
|
+
const objects = [];
|
|
355
|
+
const prefixes = [];
|
|
356
|
+
// Process entries
|
|
357
|
+
for (const entry of result.entries) {
|
|
358
|
+
objects.push(this._convertToMetadata(entry, prefix));
|
|
359
|
+
// If it's a folder, add to prefixes
|
|
360
|
+
if (entry.type === 'folder') {
|
|
361
|
+
const folderPath = prefix
|
|
362
|
+
? (prefix.endsWith('/') ? `${prefix}${entry.name}` : `${prefix}/${entry.name}`)
|
|
363
|
+
: entry.name;
|
|
364
|
+
prefixes.push(`${folderPath}/`);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return { objects, prefixes };
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
console.error('Error listing objects', { prefix, error });
|
|
371
|
+
return { objects: [], prefixes: [] };
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Create a directory
|
|
376
|
+
*/
|
|
377
|
+
async CreateDirectory(directoryPath) {
|
|
378
|
+
try {
|
|
379
|
+
// Remove trailing slash if present
|
|
380
|
+
const normalizedPath = directoryPath.endsWith('/')
|
|
381
|
+
? directoryPath.substring(0, directoryPath.length - 1)
|
|
382
|
+
: directoryPath;
|
|
383
|
+
// Check if directory already exists
|
|
384
|
+
try {
|
|
385
|
+
await this._getIdFromPath(normalizedPath);
|
|
386
|
+
return true; // Directory already exists
|
|
387
|
+
}
|
|
388
|
+
catch (error) {
|
|
389
|
+
// Directory doesn't exist, create it
|
|
390
|
+
}
|
|
391
|
+
// Get parent folder info
|
|
392
|
+
const parsedPath = this._parsePath(normalizedPath);
|
|
393
|
+
let parentId = this._rootFolderId;
|
|
394
|
+
if (parsedPath.parent) {
|
|
395
|
+
try {
|
|
396
|
+
parentId = await this._getIdFromPath(parsedPath.parent);
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
// Create parent directory recursively
|
|
400
|
+
await this.CreateDirectory(parsedPath.parent);
|
|
401
|
+
parentId = await this._getIdFromPath(parsedPath.parent);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
// Create the folder
|
|
405
|
+
await this._apiRequest('/folders', 'POST', {
|
|
406
|
+
name: parsedPath.name,
|
|
407
|
+
parent: { id: parentId }
|
|
408
|
+
});
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
catch (error) {
|
|
412
|
+
console.error('Error creating directory', { directoryPath, error });
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Delete a directory
|
|
418
|
+
*/
|
|
419
|
+
async DeleteDirectory(directoryPath, recursive = false) {
|
|
420
|
+
try {
|
|
421
|
+
// Remove trailing slash if present
|
|
422
|
+
const normalizedPath = directoryPath.endsWith('/')
|
|
423
|
+
? directoryPath.substring(0, directoryPath.length - 1)
|
|
424
|
+
: directoryPath;
|
|
425
|
+
// Get folder ID
|
|
426
|
+
let folderId;
|
|
427
|
+
try {
|
|
428
|
+
folderId = await this._getIdFromPath(normalizedPath);
|
|
429
|
+
}
|
|
430
|
+
catch (error) {
|
|
431
|
+
// If folder doesn't exist, consider it success
|
|
432
|
+
return true;
|
|
433
|
+
}
|
|
434
|
+
// Check if folder is empty if not recursive
|
|
435
|
+
if (!recursive) {
|
|
436
|
+
const contents = await this._apiRequest(`/folders/${folderId}/items`, 'GET', null, {
|
|
437
|
+
'limit': '1'
|
|
438
|
+
});
|
|
439
|
+
if (contents.entries.length > 0) {
|
|
440
|
+
throw new Error('Directory is not empty');
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
// Delete the folder
|
|
444
|
+
await this._apiRequest(`/folders/${folderId}`, 'DELETE', null, {
|
|
445
|
+
'recursive': recursive ? 'true' : 'false'
|
|
446
|
+
});
|
|
447
|
+
return true;
|
|
448
|
+
}
|
|
449
|
+
catch (error) {
|
|
450
|
+
// If the error is a 404, consider it already deleted
|
|
451
|
+
if (error.message && error.message.includes('404')) {
|
|
452
|
+
return true;
|
|
453
|
+
}
|
|
454
|
+
console.error('Error deleting directory', { directoryPath, recursive, error });
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Get object metadata
|
|
460
|
+
*/
|
|
461
|
+
async GetObjectMetadata(objectName) {
|
|
462
|
+
try {
|
|
463
|
+
const itemId = await this._getIdFromPath(objectName);
|
|
464
|
+
// Determine if it's a file or folder
|
|
465
|
+
const itemInfo = await this._apiRequest(`/items/${itemId}`);
|
|
466
|
+
const fullEndpoint = itemInfo.type === 'folder' ? `/folders/${itemId}` : `/files/${itemId}`;
|
|
467
|
+
// Get full metadata
|
|
468
|
+
const metadata = await this._apiRequest(fullEndpoint, 'GET', null, {
|
|
469
|
+
'fields': 'id,name,type,size,content_type,modified_at,created_at,etag,sequence_id'
|
|
470
|
+
});
|
|
471
|
+
// Parse path to get parent path
|
|
472
|
+
const parsedPath = this._parsePath(objectName);
|
|
473
|
+
return this._convertToMetadata(metadata, parsedPath.parent);
|
|
474
|
+
}
|
|
475
|
+
catch (error) {
|
|
476
|
+
console.error('Error getting object metadata', { objectName, error });
|
|
477
|
+
throw new Error(`Object not found: ${objectName}`);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Get an object's contents
|
|
482
|
+
*/
|
|
483
|
+
async GetObject(objectName) {
|
|
484
|
+
try {
|
|
485
|
+
const fileId = await this._getIdFromPath(objectName);
|
|
486
|
+
// Download the file
|
|
487
|
+
const response = await this._apiRequest(`/files/${fileId}/content`, 'GET');
|
|
488
|
+
// Convert response to buffer
|
|
489
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
490
|
+
return Buffer.from(arrayBuffer);
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
console.error('Error getting object', { objectName, error });
|
|
494
|
+
throw new Error(`Failed to get object: ${objectName}`);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Upload an object
|
|
499
|
+
*/
|
|
500
|
+
async PutObject(objectName, data, contentType, metadata) {
|
|
501
|
+
try {
|
|
502
|
+
// Get the parent folder ID and file name
|
|
503
|
+
const parsedPath = this._parsePath(objectName);
|
|
504
|
+
let parentId = this._rootFolderId;
|
|
505
|
+
if (parsedPath.parent) {
|
|
506
|
+
try {
|
|
507
|
+
parentId = await this._getIdFromPath(parsedPath.parent);
|
|
508
|
+
}
|
|
509
|
+
catch (error) {
|
|
510
|
+
// If parent folder doesn't exist, create it recursively
|
|
511
|
+
await this.CreateDirectory(parsedPath.parent);
|
|
512
|
+
parentId = await this._getIdFromPath(parsedPath.parent);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
// Check if file already exists
|
|
516
|
+
let fileId = null;
|
|
517
|
+
try {
|
|
518
|
+
fileId = await this._getIdFromPath(objectName);
|
|
519
|
+
}
|
|
520
|
+
catch (error) {
|
|
521
|
+
// File doesn't exist, will create new
|
|
522
|
+
}
|
|
523
|
+
// Use multipart upload for small files (<50MB)
|
|
524
|
+
if (data.length < 50 * 1024 * 1024) {
|
|
525
|
+
const formData = new FormData();
|
|
526
|
+
// Add file metadata
|
|
527
|
+
const fileMetadata = {
|
|
528
|
+
name: parsedPath.name,
|
|
529
|
+
parent: { id: parentId }
|
|
530
|
+
};
|
|
531
|
+
formData.append('attributes', JSON.stringify(fileMetadata));
|
|
532
|
+
// Create a file blob with the correct content type
|
|
533
|
+
const fileBlob = new Blob([data], { type: contentType || 'application/octet-stream' });
|
|
534
|
+
formData.append('file', fileBlob, parsedPath.name);
|
|
535
|
+
// Upload the file
|
|
536
|
+
const endpoint = fileId ? `/files/${fileId}/content` : '/files/content';
|
|
537
|
+
await this._apiRequest(endpoint, 'POST', formData, {}, this._uploadApiUrl);
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
// Use chunked upload for larger files
|
|
541
|
+
// Create upload session
|
|
542
|
+
const session = await this._apiRequest('/files/upload_sessions', 'POST', {
|
|
543
|
+
folder_id: parentId,
|
|
544
|
+
file_name: parsedPath.name,
|
|
545
|
+
file_size: data.length
|
|
546
|
+
}, {}, this._uploadApiUrl);
|
|
547
|
+
const sessionId = session.id;
|
|
548
|
+
const CHUNK_SIZE = 8 * 1024 * 1024; // 8MB chunks
|
|
549
|
+
let offset = 0;
|
|
550
|
+
const totalSize = data.length;
|
|
551
|
+
const parts = [];
|
|
552
|
+
// Upload chunks
|
|
553
|
+
while (offset < totalSize) {
|
|
554
|
+
const chunkEnd = Math.min(offset + CHUNK_SIZE, totalSize);
|
|
555
|
+
const chunkSize = chunkEnd - offset;
|
|
556
|
+
const chunk = data.slice(offset, chunkEnd);
|
|
557
|
+
const headers = {
|
|
558
|
+
'Content-Type': 'application/octet-stream',
|
|
559
|
+
'Digest': `sha=1234`, // Replace with actual SHA-1 digest
|
|
560
|
+
'Content-Range': `bytes ${offset}-${chunkEnd - 1}/${totalSize}`
|
|
561
|
+
};
|
|
562
|
+
const uploadResponse = await this._apiRequest(`/files/upload_sessions/${sessionId}`, 'PUT', chunk, headers, this._uploadApiUrl);
|
|
563
|
+
parts.push({
|
|
564
|
+
part_id: uploadResponse.part.part_id,
|
|
565
|
+
offset,
|
|
566
|
+
size: chunkSize,
|
|
567
|
+
sha1: uploadResponse.part.sha1
|
|
568
|
+
});
|
|
569
|
+
offset = chunkEnd;
|
|
570
|
+
}
|
|
571
|
+
// Commit the upload session
|
|
572
|
+
await this._apiRequest(`/files/upload_sessions/${sessionId}/commit`, 'POST', { parts }, { 'Content-Type': 'application/json' }, this._uploadApiUrl);
|
|
573
|
+
}
|
|
574
|
+
return true;
|
|
575
|
+
}
|
|
576
|
+
catch (error) {
|
|
577
|
+
console.error('Error putting object', { objectName, error });
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Copy an object
|
|
583
|
+
*/
|
|
584
|
+
async CopyObject(sourceObjectName, destinationObjectName) {
|
|
585
|
+
try {
|
|
586
|
+
// Get source info
|
|
587
|
+
const sourceId = await this._getIdFromPath(sourceObjectName);
|
|
588
|
+
const sourceInfo = await this._apiRequest(`/items/${sourceId}`);
|
|
589
|
+
if (sourceInfo.type !== 'file') {
|
|
590
|
+
throw new Error('Only files can be copied with CopyObject');
|
|
591
|
+
}
|
|
592
|
+
// Get destination info
|
|
593
|
+
const destPath = this._parsePath(destinationObjectName);
|
|
594
|
+
let destParentId = this._rootFolderId;
|
|
595
|
+
if (destPath.parent) {
|
|
596
|
+
try {
|
|
597
|
+
destParentId = await this._getIdFromPath(destPath.parent);
|
|
598
|
+
}
|
|
599
|
+
catch (error) {
|
|
600
|
+
// Create parent folder if it doesn't exist
|
|
601
|
+
await this.CreateDirectory(destPath.parent);
|
|
602
|
+
destParentId = await this._getIdFromPath(destPath.parent);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
// Copy the file
|
|
606
|
+
await this._apiRequest(`/files/${sourceId}/copy`, 'POST', {
|
|
607
|
+
parent: { id: destParentId },
|
|
608
|
+
name: destPath.name
|
|
609
|
+
});
|
|
610
|
+
return true;
|
|
611
|
+
}
|
|
612
|
+
catch (error) {
|
|
613
|
+
console.error('Error copying object', { sourceObjectName, destinationObjectName, error });
|
|
614
|
+
return false;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Check if an object exists
|
|
619
|
+
*/
|
|
620
|
+
async ObjectExists(objectName) {
|
|
621
|
+
try {
|
|
622
|
+
await this._getIdFromPath(objectName);
|
|
623
|
+
return true;
|
|
624
|
+
}
|
|
625
|
+
catch (error) {
|
|
626
|
+
return false;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Check if a directory exists
|
|
631
|
+
*/
|
|
632
|
+
async DirectoryExists(directoryPath) {
|
|
633
|
+
try {
|
|
634
|
+
// Remove trailing slash if present
|
|
635
|
+
const normalizedPath = directoryPath.endsWith('/')
|
|
636
|
+
? directoryPath.substring(0, directoryPath.length - 1)
|
|
637
|
+
: directoryPath;
|
|
638
|
+
const itemId = await this._getIdFromPath(normalizedPath);
|
|
639
|
+
const itemInfo = await this._apiRequest(`/items/${itemId}`);
|
|
640
|
+
return itemInfo.type === 'folder';
|
|
641
|
+
}
|
|
642
|
+
catch (error) {
|
|
643
|
+
return false;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
exports.BoxFileStorage = BoxFileStorage;
|
|
648
|
+
exports.BoxFileStorage = BoxFileStorage = __decorate([
|
|
649
|
+
(0, global_1.RegisterClass)(FileStorageBase_1.FileStorageBase, 'Box.com Storage'),
|
|
650
|
+
__metadata("design:paramtypes", [])
|
|
651
|
+
], BoxFileStorage);
|
|
652
|
+
//# sourceMappingURL=BoxFileStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BoxFileStorage.js","sourceRoot":"","sources":["../../src/drivers/BoxFileStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAuD;AACvD,6CAA+B;AAC/B,iDAAmC;AACnC,gEAKoC;AAG7B,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,iCAAe;IAYjD;QACE,KAAK,EAAE,CAAC;QAZS,iBAAY,GAAG,KAAK,CAAC;QAMhC,oBAAe,GAAW,CAAC,CAAC;QAC5B,gBAAW,GAAW,yBAAyB,CAAC;QAChD,kBAAa,GAAW,gCAAgC,CAAC;QAM/D,oDAAoD;QACpD,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,QAAQ,EAAE,CAAC;QACrE,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,QAAQ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C;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAA;AAhtBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,sBAAa,EAAC,iCAAe,EAAE,iBAAiB,CAAC;;GACrC,cAAc,CAgtB1B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './drivers/GoogleFileStorage';
|
|
|
4
4
|
export * from './drivers/GoogleDriveFileStorage';
|
|
5
5
|
export * from './drivers/SharePointFileStorage';
|
|
6
6
|
export * from './drivers/DropboxFileStorage';
|
|
7
|
+
export * from './drivers/BoxFileStorage';
|
|
7
8
|
export * from './generic/FileStorageBase';
|
|
8
9
|
export * from './util';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./drivers/GoogleFileStorage"), exports);
|
|
|
20
20
|
__exportStar(require("./drivers/GoogleDriveFileStorage"), exports);
|
|
21
21
|
__exportStar(require("./drivers/SharePointFileStorage"), exports);
|
|
22
22
|
__exportStar(require("./drivers/DropboxFileStorage"), exports);
|
|
23
|
+
__exportStar(require("./drivers/BoxFileStorage"), exports);
|
|
23
24
|
__exportStar(require("./generic/FileStorageBase"), exports);
|
|
24
25
|
__exportStar(require("./util"), exports);
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,6DAA2C;AAC3C,8DAA4C;AAC5C,mEAAiD;AACjD,kEAAgD;AAChD,+DAA6C;AAC7C,4DAA0C;AAC1C,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,6DAA2C;AAC3C,8DAA4C;AAC5C,mEAAiD;AACjD,kEAAgD;AAChD,+DAA6C;AAC7C,2DAAyC;AACzC,4DAA0C;AAC1C,yCAAuB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/storage",
|
|
3
|
-
"version": "2.32.
|
|
3
|
+
"version": "2.32.2",
|
|
4
4
|
"description": "This library provides a set of objects that handle the interface between the server-side API and various cloud storage providers.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@microsoft/mgt-sharepoint-provider": "^3.1.3",
|
|
33
33
|
"googleapis": "^134.0.0",
|
|
34
34
|
"dropbox": "^10.34.0",
|
|
35
|
-
"@memberjunction/core": "2.32.
|
|
36
|
-
"@memberjunction/core-entities": "2.32.
|
|
37
|
-
"@memberjunction/global": "2.32.
|
|
35
|
+
"@memberjunction/core": "2.32.2",
|
|
36
|
+
"@memberjunction/core-entities": "2.32.2",
|
|
37
|
+
"@memberjunction/global": "2.32.2",
|
|
38
38
|
"env-var": "^7.4.1",
|
|
39
39
|
"mime-types": "^2.1.35"
|
|
40
40
|
}
|