@docbox-nz/hapi-gateway 0.1.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 (45) hide show
  1. package/.eslintignore +6 -0
  2. package/.eslintrc +131 -0
  3. package/.prettierignore +11 -0
  4. package/.prettierrc +6 -0
  5. package/LICENSE.md +21 -0
  6. package/README.md +152 -0
  7. package/cspell.json +6 -0
  8. package/dist/api/adminService.d.ts +16 -0
  9. package/dist/api/boxService.d.ts +43 -0
  10. package/dist/api/client.d.ts +45 -0
  11. package/dist/api/docboxFile.d.ts +15 -0
  12. package/dist/api/fileService.d.ts +251 -0
  13. package/dist/api/folderService.d.ts +45 -0
  14. package/dist/api/linkService.d.ts +115 -0
  15. package/dist/api/taskService.d.ts +23 -0
  16. package/dist/api/utils.d.ts +1 -0
  17. package/dist/error.d.ts +11 -0
  18. package/dist/index.browser.cjs +988 -0
  19. package/dist/index.browser.cjs.map +1 -0
  20. package/dist/index.browser.esm.js +984 -0
  21. package/dist/index.browser.esm.js.map +1 -0
  22. package/dist/index.browser.js +4390 -0
  23. package/dist/index.browser.js.map +1 -0
  24. package/dist/index.d.ts +4 -0
  25. package/dist/index.node.cjs +22660 -0
  26. package/dist/index.node.cjs.map +1 -0
  27. package/dist/index.node.esm.js +22657 -0
  28. package/dist/index.node.esm.js.map +1 -0
  29. package/dist/index.node.js +20809 -0
  30. package/dist/index.node.js.map +1 -0
  31. package/dist/options.d.ts +79 -0
  32. package/dist/types/box.d.ts +59 -0
  33. package/dist/types/file.d.ts +371 -0
  34. package/dist/types/folder.d.ts +153 -0
  35. package/dist/types/index.d.ts +22 -0
  36. package/dist/types/link.d.ts +136 -0
  37. package/dist/types/search.d.ts +177 -0
  38. package/dist/types/shared.d.ts +94 -0
  39. package/dist/types/user.d.ts +20 -0
  40. package/package.json +56 -0
  41. package/rollup.config.js +36 -0
  42. package/src/error.ts +46 -0
  43. package/src/index.ts +244 -0
  44. package/src/options.ts +95 -0
  45. package/tsconfig.json +15 -0
@@ -0,0 +1,984 @@
1
+ import axios, { isAxiosError } from 'axios';
2
+
3
+ /**
4
+ * Types of generated files
5
+ */
6
+ var GeneratedFileType;
7
+ (function (GeneratedFileType) {
8
+ GeneratedFileType["PDF"] = "Pdf";
9
+ GeneratedFileType["COVER_PAGE"] = "CoverPage";
10
+ GeneratedFileType["SMALL_THUMBNAIL"] = "SmallThumbnail";
11
+ GeneratedFileType["LARGE_THUMBNAIL"] = "LargeThumbnail";
12
+ GeneratedFileType["TEXT_CONTENT"] = "TextContent";
13
+ GeneratedFileType["HTML_CONTENT"] = "HtmlContent";
14
+ GeneratedFileType["METADATA"] = "Metadata";
15
+ })(GeneratedFileType || (GeneratedFileType = {}));
16
+ /**
17
+ * Statuses that a presigned upload task can have
18
+ */
19
+ var PresignedUploadStatus;
20
+ (function (PresignedUploadStatus) {
21
+ PresignedUploadStatus["Pending"] = "Pending";
22
+ PresignedUploadStatus["Complete"] = "Complete";
23
+ PresignedUploadStatus["Failed"] = "Failed";
24
+ })(PresignedUploadStatus || (PresignedUploadStatus = {}));
25
+ var DocboxTaskStatus;
26
+ (function (DocboxTaskStatus) {
27
+ DocboxTaskStatus["Pending"] = "Pending";
28
+ DocboxTaskStatus["Completed"] = "Completed";
29
+ DocboxTaskStatus["Failed"] = "Failed";
30
+ })(DocboxTaskStatus || (DocboxTaskStatus = {}));
31
+
32
+ /**
33
+ * Possible search result item types
34
+ */
35
+ var SearchResultItemType;
36
+ (function (SearchResultItemType) {
37
+ SearchResultItemType["FILE"] = "File";
38
+ SearchResultItemType["FOLDER"] = "Folder";
39
+ SearchResultItemType["LINK"] = "Link";
40
+ })(SearchResultItemType || (SearchResultItemType = {}));
41
+
42
+ var EditHistoryType;
43
+ (function (EditHistoryType) {
44
+ EditHistoryType["MoveToFolder"] = "MoveToFolder";
45
+ EditHistoryType["Rename"] = "Rename";
46
+ EditHistoryType["LinkValue"] = "LinkValue";
47
+ })(EditHistoryType || (EditHistoryType = {}));
48
+
49
+ var DocboxItemType;
50
+ (function (DocboxItemType) {
51
+ DocboxItemType["File"] = "File";
52
+ DocboxItemType["Folder"] = "Folder";
53
+ DocboxItemType["Link"] = "Link";
54
+ })(DocboxItemType || (DocboxItemType = {}));
55
+
56
+ function sleep(timeout) {
57
+ return new Promise((resolve) => setTimeout(resolve, timeout));
58
+ }
59
+
60
+ /******************************************************************************
61
+ Copyright (c) Microsoft Corporation.
62
+
63
+ Permission to use, copy, modify, and/or distribute this software for any
64
+ purpose with or without fee is hereby granted.
65
+
66
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
67
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
68
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
69
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
70
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
71
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
72
+ PERFORMANCE OF THIS SOFTWARE.
73
+ ***************************************************************************** */
74
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
75
+
76
+
77
+ function __awaiter(thisArg, _arguments, P, generator) {
78
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
79
+ return new (P || (P = Promise))(function (resolve, reject) {
80
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
81
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
82
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
83
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
84
+ });
85
+ }
86
+
87
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
88
+ var e = new Error(message);
89
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
90
+ };
91
+
92
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
93
+
94
+ var formdata_min = {};
95
+
96
+ /*! formdata-polyfill. MIT License. Jimmy W?rting <https://jimmy.warting.se/opensource> */
97
+
98
+ var hasRequiredFormdata_min;
99
+
100
+ function requireFormdata_min () {
101
+ if (hasRequiredFormdata_min) return formdata_min;
102
+ hasRequiredFormdata_min = 1;
103
+ (function(){var h;function l(a){var b=0;return function(){return b<a.length?{done:false,value:a[b++]}:{done:true}}}var m="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
104
+ function n(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof commonjsGlobal&&commonjsGlobal];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var q=n(this);function r(a,b){if(b)a:{var c=q;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e];}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&m(c,a,{configurable:true,writable:true,value:b});}}
105
+ r("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.A=f;m(this,"description",{configurable:true,writable:true,value:g});}if(a)return a;c.prototype.toString=function(){return this.A};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b});
106
+ r("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=q[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&m(d.prototype,a,{configurable:true,writable:true,value:function(){return u(l(this))}});}return a});function u(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
107
+ function v(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:l(a)}}var w;if("function"==typeof Object.setPrototypeOf)w=Object.setPrototypeOf;else {var y;a:{var z={a:true},A={};try{A.__proto__=z;y=A.a;break a}catch(a){}y=false;}w=y?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null;}var B=w;function C(){this.m=false;this.j=null;this.v=void 0;this.h=1;this.u=this.C=0;this.l=null;}
108
+ function D(a){if(a.m)throw new TypeError("Generator is already running");a.m=true;}C.prototype.o=function(a){this.v=a;};C.prototype.s=function(a){this.l={D:a,F:true};this.h=this.C||this.u;};C.prototype.return=function(a){this.l={return:a};this.h=this.u;};function E(a,b){a.h=3;return {value:b}}function F(a){this.g=new C;this.G=a;}F.prototype.o=function(a){D(this.g);if(this.g.j)return G(this,this.g.j.next,a,this.g.o);this.g.o(a);return H(this)};
109
+ function I(a,b){D(a.g);var c=a.g.j;if(c)return G(a,"return"in c?c["return"]:function(d){return {value:d,done:true}},b,a.g.return);a.g.return(b);return H(a)}F.prototype.s=function(a){D(this.g);if(this.g.j)return G(this,this.g.j["throw"],a,this.g.o);this.g.s(a);return H(this)};
110
+ function G(a,b,c,d){try{var e=b.call(a.g.j,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.g.m=!1,e;var f=e.value;}catch(g){return a.g.j=null,a.g.s(g),H(a)}a.g.j=null;d.call(a.g,f);return H(a)}function H(a){for(;a.g.h;)try{var b=a.G(a.g);if(b)return a.g.m=!1,{value:b.value,done:!1}}catch(c){a.g.v=void 0,a.g.s(c);}a.g.m=false;if(a.g.l){b=a.g.l;a.g.l=null;if(b.F)throw b.D;return {value:b.return,done:true}}return {value:void 0,done:true}}
111
+ function J(a){this.next=function(b){return a.o(b)};this.throw=function(b){return a.s(b)};this.return=function(b){return I(a,b)};this[Symbol.iterator]=function(){return this};}function K(a,b){b=new J(new F(b));B&&a.prototype&&B(b,a.prototype);return b}function L(a,b){a instanceof String&&(a+="");var c=0,d=false,e={next:function(){if(!d&&c<a.length){var f=c++;return {value:b(f,a[f]),done:false}}d=true;return {done:true,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}
112
+ r("Array.prototype.entries",function(a){return a?a:function(){return L(this,function(b,c){return [b,c]})}});
113
+ if("undefined"!==typeof Blob&&("undefined"===typeof FormData||!FormData.prototype.keys)){var M=function(a,b){for(var c=0;c<a.length;c++)b(a[c]);},N=function(a){return a.replace(/\r?\n|\r/g,"\r\n")},O=function(a,b,c){if(b instanceof Blob){c=void 0!==c?String(c+""):"string"===typeof b.name?b.name:"blob";if(b.name!==c||"[object Blob]"===Object.prototype.toString.call(b))b=new File([b],c);return [String(a),b]}return [String(a),String(b)]},P=function(a,b){if(a.length<b)throw new TypeError(b+" argument required, but only "+
114
+ a.length+" present.");},Q="object"===typeof globalThis?globalThis:"object"===typeof window?window:"object"===typeof self?self:this,R=Q.FormData,S=Q.XMLHttpRequest&&Q.XMLHttpRequest.prototype.send,T=Q.Request&&Q.fetch,U=Q.navigator&&Q.navigator.sendBeacon,V=Q.Element&&Q.Element.prototype,W=Q.Symbol&&Symbol.toStringTag;W&&(Blob.prototype[W]||(Blob.prototype[W]="Blob"),"File"in Q&&!File.prototype[W]&&(File.prototype[W]="File"));try{new File([],"");}catch(a){Q.File=function(b,c,d){b=new Blob(b,d||{});
115
+ Object.defineProperties(b,{name:{value:c},lastModified:{value:+(d&&void 0!==d.lastModified?new Date(d.lastModified):new Date)},toString:{value:function(){return "[object File]"}}});W&&Object.defineProperty(b,W,{value:"File"});return b};}var escape=function(a){return a.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},X=function(a){this.i=[];var b=this;a&&M(a.elements,function(c){if(c.name&&!c.disabled&&"submit"!==c.type&&"button"!==c.type&&!c.matches("form fieldset[disabled] *"))if("file"===
116
+ c.type){var d=c.files&&c.files.length?c.files:[new File([],"",{type:"application/octet-stream"})];M(d,function(e){b.append(c.name,e);});}else "select-multiple"===c.type||"select-one"===c.type?M(c.options,function(e){!e.disabled&&e.selected&&b.append(c.name,e.value);}):"checkbox"===c.type||"radio"===c.type?c.checked&&b.append(c.name,c.value):(d="textarea"===c.type?N(c.value):c.value,b.append(c.name,d));});};h=X.prototype;h.append=function(a,b,c){P(arguments,2);this.i.push(O(a,b,c));};h.delete=function(a){P(arguments,
117
+ 1);var b=[];a=String(a);M(this.i,function(c){c[0]!==a&&b.push(c);});this.i=b;};h.entries=function b(){var c,d=this;return K(b,function(e){1==e.h&&(c=0);if(3!=e.h)return c<d.i.length?e=E(e,d.i[c]):(e.h=0,e=void 0),e;c++;e.h=2;})};h.forEach=function(b,c){P(arguments,1);for(var d=v(this),e=d.next();!e.done;e=d.next()){var f=v(e.value);e=f.next().value;f=f.next().value;b.call(c,f,e,this);}};h.get=function(b){P(arguments,1);var c=this.i;b=String(b);for(var d=0;d<c.length;d++)if(c[d][0]===b)return c[d][1];
118
+ return null};h.getAll=function(b){P(arguments,1);var c=[];b=String(b);M(this.i,function(d){d[0]===b&&c.push(d[1]);});return c};h.has=function(b){P(arguments,1);b=String(b);for(var c=0;c<this.i.length;c++)if(this.i[c][0]===b)return true;return false};h.keys=function c(){var d=this,e,f,g,k,p;return K(c,function(t){1==t.h&&(e=v(d),f=e.next());if(3!=t.h){if(f.done){t.h=0;return}g=f.value;k=v(g);p=k.next().value;return E(t,p)}f=e.next();t.h=2;})};h.set=function(c,d,e){P(arguments,2);c=String(c);var f=[],g=O(c,
119
+ d,e),k=true;M(this.i,function(p){p[0]===c?k&&(k=!f.push(g)):f.push(p);});k&&f.push(g);this.i=f;};h.values=function d(){var e=this,f,g,k,p,t;return K(d,function(x){1==x.h&&(f=v(e),g=f.next());if(3!=x.h){if(g.done){x.h=0;return}k=g.value;p=v(k);p.next();t=p.next().value;return E(x,t)}g=f.next();x.h=2;})};X.prototype._asNative=function(){for(var d=new R,e=v(this),f=e.next();!f.done;f=e.next()){var g=v(f.value);f=g.next().value;g=g.next().value;d.append(f,g);}return d};X.prototype._blob=function(){var d="----formdata-polyfill-"+
120
+ Math.random(),e=[],f="--"+d+'\r\nContent-Disposition: form-data; name="';this.forEach(function(g,k){return "string"==typeof g?e.push(f+escape(N(k))+('"\r\n\r\n'+N(g)+"\r\n")):e.push(f+escape(N(k))+('"; filename="'+escape(g.name)+'"\r\nContent-Type: '+(g.type||"application/octet-stream")+"\r\n\r\n"),g,"\r\n")});e.push("--"+d+"--");return new Blob(e,{type:"multipart/form-data; boundary="+d})};X.prototype[Symbol.iterator]=function(){return this.entries()};X.prototype.toString=function(){return "[object FormData]"};
121
+ V&&!V.matches&&(V.matches=V.matchesSelector||V.mozMatchesSelector||V.msMatchesSelector||V.oMatchesSelector||V.webkitMatchesSelector||function(d){d=(this.document||this.ownerDocument).querySelectorAll(d);for(var e=d.length;0<=--e&&d.item(e)!==this;);return -1<e});W&&(X.prototype[W]="FormData");if(S){var Y=Q.XMLHttpRequest.prototype.setRequestHeader;Q.XMLHttpRequest.prototype.setRequestHeader=function(d,e){Y.call(this,d,e);"content-type"===d.toLowerCase()&&(this.B=true);};Q.XMLHttpRequest.prototype.send=
122
+ function(d){d instanceof X?(d=d._blob(),this.B||this.setRequestHeader("Content-Type",d.type),S.call(this,d)):S.call(this,d);};}T&&(Q.fetch=function(d,e){e&&e.body&&e.body instanceof X&&(e.body=e.body._blob());return T.call(this,d,e)});U&&(Q.navigator.sendBeacon=function(d,e){e instanceof X&&(e=e._asNative());return U.call(this,d,e)});Q.FormData=X;}})();
123
+ return formdata_min;
124
+ }
125
+
126
+ requireFormdata_min();
127
+
128
+ class FileService {
129
+ constructor(client) {
130
+ this.client = client;
131
+ }
132
+ /**
133
+ * Get a URL to a raw version of a file
134
+ *
135
+ * @param scope Scope the file is within
136
+ * @param id ID of the file
137
+ * @returns The file URL
138
+ */
139
+ rawURL(scope, id) {
140
+ return `box/${scope}/file/${id}/raw`;
141
+ }
142
+ /**
143
+ * Get a URL to a raw version of a file with an additional
144
+ * cosmetic name shown in browser viewers
145
+ *
146
+ * @param scope Scope the file is within
147
+ * @param id ID of the file
148
+ * @param name Name to provide the file
149
+ * @returns The file URL
150
+ */
151
+ rawNamedURL(scope, id, name) {
152
+ return `box/${scope}/file/${id}/raw/${encodeURIComponent(name)}`;
153
+ }
154
+ /**
155
+ * Get a URL to a generated version of a file
156
+ *
157
+ * @param scope Scope the file is within
158
+ * @param id ID of the main file
159
+ * @param type Type of generated file to get
160
+ * @returns The URL to the generated file
161
+ */
162
+ generatedRawURL(scope, id, type) {
163
+ return `box/${scope}/file/${id}/generated/${type}/raw`;
164
+ }
165
+ /**
166
+ * Get a URL to a generated version of a file with an additional
167
+ * cosmetic name shown in browser viewers
168
+ *
169
+ * @param scope Scope the file is within
170
+ * @param id ID of the main file
171
+ * @param type Type of generated file to get
172
+ * @param name Name to provide the file
173
+ * @returns The URL to the generated file
174
+ */
175
+ generatedRawNamedURL(scope, id, type, name) {
176
+ return `box/${scope}/file/${id}/generated/${type}/raw/${encodeURIComponent(name)}`;
177
+ }
178
+ /**
179
+ * Direct upload
180
+ *
181
+ * @deprecated When behind the proxy service this will often encounter timeout issues
182
+ * its recommended you use another upload method
183
+ *
184
+ * Prefer {@link FileService.uploadAsync}
185
+ *
186
+ * @param scope Scope to upload the file into
187
+ * @param name Name of the file
188
+ * @param folder_id Folder to store the file in
189
+ * @param file File to store
190
+ * @returns File upload response
191
+ */
192
+ upload(scope, name, folder_id, file) {
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ // Create form data
195
+ const data = new FormData();
196
+ data.append('name', name);
197
+ data.append('folder_id', folder_id);
198
+ data.append('file', file);
199
+ return this.client.httpPost(`box/${scope}/file`, data, {
200
+ // Clear default JSON content type (We need the browser to set multipart headers properly)
201
+ headers: { 'Content-Type': undefined },
202
+ });
203
+ });
204
+ }
205
+ /**
206
+ * Asynchronous direct upload
207
+ *
208
+ * (File is uploaded directly but processed asynchronously)
209
+ *
210
+ * If you are handling reasonably sized files prefer {@link FileService.uploadPresigned} to
211
+ * prevent running into browser timeouts as the file is transferred between services
212
+ *
213
+ * @param request Upload request data
214
+ * @returns The uploaded file response
215
+ */
216
+ uploadAsync(request) {
217
+ return __awaiter(this, void 0, void 0, function* () {
218
+ // Create form data
219
+ const data = new FormData();
220
+ data.append('name', request.name);
221
+ data.append('folder_id', request.folder_id);
222
+ data.append('file', request.file);
223
+ data.append('asynchronous', 'true');
224
+ if (request.fixed_id) {
225
+ data.append('fixed_id', request.fixed_id);
226
+ }
227
+ if (request.parent_id) {
228
+ data.append('fixed_id', request.parent_id);
229
+ }
230
+ if (request.processing_config) {
231
+ data.append('processing_config', JSON.stringify(request.processing_config));
232
+ }
233
+ const taskResponse = yield this.client.httpPost(`box/${request.scope}/file`, data, {
234
+ // Clear default JSON content type (We need the browser to set multipart headers properly)
235
+ headers: { 'Content-Type': undefined },
236
+ });
237
+ return yield this.client.task.finished(request.scope, taskResponse.task_id, 1000, request.abort);
238
+ });
239
+ }
240
+ /**
241
+ * Performs a pre-signed file upload
242
+ *
243
+ * @param scope Scope to upload the file into
244
+ * @param folderId ID of the folder to store the file within
245
+ * @param file File to upload
246
+ * @param options Request options
247
+ * @returns File upload response
248
+ */
249
+ uploadPresigned(scope, folderId, file, options) {
250
+ return __awaiter(this, void 0, void 0, function* () {
251
+ if (options && options.onProgress) {
252
+ options.onProgress('Preparing');
253
+ }
254
+ const presigned = yield this.createPresignedUpload(scope, {
255
+ name: file.name,
256
+ folder_id: folderId,
257
+ size: file.size,
258
+ mime: file.type,
259
+ parent_id: options === null || options === void 0 ? void 0 : options.parent_id,
260
+ processing_config: options === null || options === void 0 ? void 0 : options.processing_config,
261
+ });
262
+ yield this.performPresignedUpload(file, presigned, options);
263
+ if (options && options.onProgress) {
264
+ options.onProgress('Processing');
265
+ }
266
+ const taskId = presigned.task_id;
267
+ const response = yield this.presignedFinished(scope, taskId, 1000, options === null || options === void 0 ? void 0 : options.abort);
268
+ if (options && options.onProgress) {
269
+ options.onProgress('Complete', 1);
270
+ }
271
+ return response;
272
+ });
273
+ }
274
+ performPresignedUpload(file, presigned, options) {
275
+ return __awaiter(this, void 0, void 0, function* () {
276
+ if (options && options.onProgress) {
277
+ options.onProgress('Starting');
278
+ }
279
+ // Browser is not allowed to set this header
280
+ delete presigned.headers['content-length'];
281
+ const config = {
282
+ method: presigned.method,
283
+ url: presigned.uri,
284
+ headers: Object.assign({ 'Content-Type': file.type }, presigned.headers),
285
+ data: file,
286
+ };
287
+ if (options) {
288
+ if (options.onProgress) {
289
+ const onProgress = options.onProgress;
290
+ config.onUploadProgress = (event) => {
291
+ if (!event.progress) {
292
+ onProgress('Uploading');
293
+ return;
294
+ }
295
+ if (event.progress === 1) {
296
+ onProgress('Uploaded', 1);
297
+ }
298
+ else {
299
+ onProgress('Uploading', event.progress);
300
+ }
301
+ };
302
+ }
303
+ // Apply abort signal
304
+ if (options.abort) {
305
+ config.signal = options.abort.signal;
306
+ }
307
+ }
308
+ // Upload the file to the presigned target
309
+ yield axios.request(config);
310
+ });
311
+ }
312
+ /**
313
+ * Creates a new presigned upload
314
+ *
315
+ * @param scope Scope to upload the file within
316
+ * @param request The presigned upload request
317
+ * @returns The presigned upload details
318
+ */
319
+ createPresignedUpload(scope, request) {
320
+ return this.client.httpPost(`box/${scope}/file/presigned`, request);
321
+ }
322
+ /**
323
+ * Request the status of a presigned upload task
324
+ *
325
+ * @param scope Scope the upload file task is within
326
+ * @param taskId ID of the uploading task
327
+ * @param abort Abort handle to abort the request
328
+ * @returns The task status
329
+ */
330
+ presignedStatus(scope, taskId, abort) {
331
+ return this.client.httpGet(`box/${scope}/file/presigned/${taskId}`, { signal: abort === null || abort === void 0 ? void 0 : abort.signal });
332
+ }
333
+ /**
334
+ * Polls for the completion of a presigned upload task
335
+ *
336
+ * @param scope Scope the upload file task is within
337
+ * @param task_id ID of the uploading task
338
+ * @param interval Rate at which to poll for completion
339
+ * @param abort Abort handle that can abort the polling
340
+ * @returns The uploaded file response
341
+ */
342
+ presignedFinished(scope_1, task_id_1) {
343
+ return __awaiter(this, arguments, void 0, function* (scope, task_id, interval = 1000, abort) {
344
+ var _a;
345
+ while (abort === undefined ? true : !abort.signal.aborted) {
346
+ const task = yield this.presignedStatus(scope, task_id, abort);
347
+ if (task.status === 'Complete') {
348
+ return { file: task.file, generated: task.generated };
349
+ }
350
+ if (task.status === 'Failed') {
351
+ const error = (_a = task.error) !== null && _a !== void 0 ? _a : 'Unknown error';
352
+ throw new Error(error);
353
+ }
354
+ yield sleep(interval);
355
+ }
356
+ throw new Error('upload tracking aborted');
357
+ });
358
+ }
359
+ /**
360
+ * Request the details of a file using its ID and scope
361
+ *
362
+ * @param scope Scope the file resides within
363
+ * @param file_id ID of the file
364
+ * @returns The full file details
365
+ */
366
+ get(scope, file_id) {
367
+ return this.client.httpGet(`box/${scope}/file/${file_id}`);
368
+ }
369
+ /**
370
+ * Search within the contents of a file
371
+ *
372
+ * @param scope Scope the file resides within
373
+ * @param file_id ID of the file
374
+ * @param request The search request
375
+ * @returns The full file details
376
+ */
377
+ search(scope, file_id, request) {
378
+ return this.client.httpPost(`box/${scope}/file/${file_id}/search`, request);
379
+ }
380
+ /**
381
+ * Request children of the file, in the case of .eml email files this
382
+ * would provide a list of files for the attachments associated with
383
+ * the email
384
+ *
385
+ * @param scope Scope the file resides within
386
+ * @param file_id ID of the file to find the children of
387
+ * @returns The files that are children
388
+ */
389
+ children(scope, file_id) {
390
+ return this.client.httpGet(`box/${scope}/file/${file_id}/children`);
391
+ }
392
+ /**
393
+ * Request the history of edits to the file
394
+ *
395
+ * @param scope Scope the file resides within
396
+ * @param file_id ID of the file to get the history for
397
+ * @returns The edit history
398
+ */
399
+ editHistory(scope, file_id) {
400
+ return this.client.httpGet(`box/${scope}/file/${file_id}/edit-history`);
401
+ }
402
+ /**
403
+ * Update the details about the file
404
+ *
405
+ * @param scope Scope the file resides within
406
+ * @param file_id ID of the file to update
407
+ * @param data The updates to perform
408
+ */
409
+ update(scope, file_id, data) {
410
+ return this.client.httpPut(`box/${scope}/file/${file_id}`, data);
411
+ }
412
+ /**
413
+ * Gets the raw file contents of the provided file
414
+ *
415
+ * On node this returns an {@link ArrayBuffer} not a blob
416
+ *
417
+ * @param scope Scope the file resides within
418
+ * @param file_id ID of the file to retrieve
419
+ * @returns The raw contents of the file
420
+ */
421
+ raw(scope, file_id) {
422
+ return this.client.httpGet(this.rawURL(scope, file_id), {
423
+ responseType: typeof window === 'undefined' ? 'arraybuffer' : 'blob',
424
+ });
425
+ }
426
+ /**
427
+ * Gets the raw file contents of the provided file
428
+ *
429
+ * This function is the same as {@link FileService.raw} just
430
+ * it has the correct return type for Node
431
+ *
432
+ * @param scope Scope the file resides within
433
+ * @param file_id ID of the file to retrieve
434
+ * @returns The raw contents of the file
435
+ */
436
+ rawNode(scope, file_id) {
437
+ return this.client.httpGet(this.rawURL(scope, file_id), {
438
+ responseType: 'arraybuffer',
439
+ });
440
+ }
441
+ /**
442
+ * Gets the raw file contents of the provided file in
443
+ * JSON format (Will only work if the actual file is JSON)
444
+ *
445
+ * @param scope Scope the file resides within
446
+ * @param file_id ID of the file to retrieve
447
+ * @returns The JSON contents of the file
448
+ */
449
+ json(scope, file_id) {
450
+ return this.client.httpGet(this.rawURL(scope, file_id), {
451
+ responseType: 'json',
452
+ });
453
+ }
454
+ /**
455
+ * Gets the raw file contents of the provided file as text
456
+ * (Will only work if the actual file is text)
457
+ *
458
+ * @param scope Scope the file resides within
459
+ * @param file_id ID of the file to retrieve
460
+ * @returns The text contents of the file
461
+ */
462
+ text(scope, file_id) {
463
+ return this.client.httpGet(this.rawURL(scope, file_id), {
464
+ responseType: 'text',
465
+ });
466
+ }
467
+ /**
468
+ * Deletes a file
469
+ *
470
+ * @param scope Scope the file resides within
471
+ * @param file_id ID of the file to delete
472
+ */
473
+ delete(scope, file_id) {
474
+ return this.client.httpDelete(`box/${scope}/file/${file_id}`);
475
+ }
476
+ /**
477
+ * Gets a generated file details
478
+ *
479
+ * @param scope Scope the file resides within
480
+ * @param file_id ID of the file to query
481
+ * @param type Type of the generated file
482
+ * @returns The generated file details
483
+ */
484
+ generated(scope, file_id, type) {
485
+ return this.client.httpGet(`box/${scope}/file/${file_id}/generated/${type}`);
486
+ }
487
+ /**
488
+ * Gets a generated file raw contents
489
+ *
490
+ * On node this returns an {@link ArrayBuffer} not a blob
491
+ *
492
+ * @param scope Scope the file resides within
493
+ * @param file_id ID of the file to query
494
+ * @param type Type of the generated file
495
+ * @returns The Blob/ArrayBuffer content of the file (Blob within a browser, ArrayBuffer on node)
496
+ */
497
+ generatedRaw(scope, file_id, type) {
498
+ return this.client.httpGet(this.generatedRawURL(scope, file_id, type), {
499
+ responseType: typeof window === 'undefined' ? 'arraybuffer' : 'blob',
500
+ });
501
+ }
502
+ /**
503
+ * Gets a generated file raw contents
504
+ *
505
+ * This function is the same as {@link FileService.generatedRaw} just
506
+ * it has the correct return type for Node and will only return an
507
+ * ArrayBuffer
508
+ *
509
+ * @param scope Scope the file resides within
510
+ * @param file_id ID of the file to query
511
+ * @param type Type of the generated file
512
+ * @returns The ArrayBuffer content of the generated file
513
+ */
514
+ generatedRawNode(scope, file_id, type) {
515
+ return this.client.httpGet(this.generatedRawURL(scope, file_id, type), {
516
+ responseType: 'arraybuffer',
517
+ });
518
+ }
519
+ /**
520
+ * Gets a generated file raw contents as text
521
+ *
522
+ * @param scope Scope the file resides within
523
+ * @param file_id ID of the file to query
524
+ * @param type Type of the generated file
525
+ * @returns The text content of the generated file
526
+ */
527
+ generatedText(scope, file_id, type) {
528
+ return this.client.httpGet(this.generatedRawURL(scope, file_id, type), {
529
+ responseType: 'text',
530
+ });
531
+ }
532
+ /**
533
+ * Gets a generated file raw contents as JSON
534
+ *
535
+ * @param scope Scope the file resides within
536
+ * @param file_id ID of the file to query
537
+ * @param type Type of the generated file
538
+ * @returns The JSON content of the generated file
539
+ */
540
+ generatedJson(scope, file_id, type) {
541
+ return this.client.httpGet(this.generatedRawURL(scope, file_id, type), {
542
+ responseType: 'json',
543
+ });
544
+ }
545
+ }
546
+
547
+ class BoxService {
548
+ constructor(client) {
549
+ this.client = client;
550
+ }
551
+ /**
552
+ * Get a document box for a scope
553
+ *
554
+ * @param scope Scope of the document box to get
555
+ * @param createIfMissing Whether to create the document box if it doesn't exist
556
+ */
557
+ get(scope_1) {
558
+ return __awaiter(this, arguments, void 0, function* (scope, createIfMissing = false) {
559
+ var _a;
560
+ try {
561
+ return yield this.client.httpGet(`box/${scope}`);
562
+ }
563
+ catch (err) {
564
+ // Handle a document box not being created yet
565
+ if (createIfMissing && isAxiosError(err) && ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
566
+ // Attempt to create the document box
567
+ return this.create(scope, false);
568
+ }
569
+ throw err;
570
+ }
571
+ });
572
+ }
573
+ /**
574
+ * Creates a new document box optional returning an existing one if there is one available
575
+ *
576
+ * @param scope Scope for the document box to create
577
+ * @param allowExisting Whether to allow returning an existing document box (If one is present)
578
+ * @returns The created document box
579
+ */
580
+ create(scope_1) {
581
+ return __awaiter(this, arguments, void 0, function* (scope, allowExisting = true) {
582
+ var _a;
583
+ try {
584
+ return yield this.client.httpPost('box', { scope });
585
+ }
586
+ catch (err) {
587
+ // Handle document box already exists response
588
+ if (allowExisting && isAxiosError(err) && ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 409) {
589
+ return this.get(scope);
590
+ }
591
+ throw err;
592
+ }
593
+ });
594
+ }
595
+ /**
596
+ * Delete a specific document vox
597
+ *
598
+ * @param scope Scope of the document box to delete
599
+ * @returns
600
+ */
601
+ delete(scope) {
602
+ return __awaiter(this, void 0, void 0, function* () {
603
+ var _a;
604
+ try {
605
+ return this.client.httpDelete(`box/${scope}`);
606
+ }
607
+ catch (err) {
608
+ // Handle document box never existed
609
+ if (isAxiosError(err) && ((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
610
+ return {};
611
+ }
612
+ throw err;
613
+ }
614
+ });
615
+ }
616
+ /**
617
+ * Search within the provided document box
618
+ *
619
+ * @param scope The scope of the document box to search
620
+ * @param data Search request data
621
+ * @returns The search results
622
+ */
623
+ search(scope, data) {
624
+ return __awaiter(this, void 0, void 0, function* () {
625
+ return yield this.client.httpPost(`box/${scope}/search`, data);
626
+ });
627
+ }
628
+ /**
629
+ * Get statistics for the provided document box
630
+ *
631
+ * @param scope The scope of the document box
632
+ * @returns The box stats
633
+ */
634
+ stats(scope) {
635
+ return __awaiter(this, void 0, void 0, function* () {
636
+ return yield this.client.httpGet(`box/${scope}/stats`);
637
+ });
638
+ }
639
+ }
640
+
641
+ class LinkService {
642
+ constructor(client) {
643
+ this.client = client;
644
+ }
645
+ /**
646
+ * Get a link to the favicon image for the provided link
647
+ *
648
+ * @param scope Scope the link resides within
649
+ * @param id ID of the link to request
650
+ * @returns The favicon image URL
651
+ */
652
+ faviconURL(scope, id) {
653
+ return `box/${scope}/link/${id}/favicon`;
654
+ }
655
+ /**
656
+ * Get a link to the OGP image for the provided link
657
+ *
658
+ * @param scope Scope the link resides within
659
+ * @param id ID of the link to request
660
+ * @returns The OGP image URL
661
+ */
662
+ imageURL(scope, id) {
663
+ return `box/${scope}/link/${id}/image`;
664
+ }
665
+ /**
666
+ * Creates a new link within the provided document box
667
+ *
668
+ * @param scope Scope to create the link within
669
+ * @param data Link creation data
670
+ * @returns The created link
671
+ */
672
+ create(scope, data) {
673
+ return this.client.httpPost(`box/${scope}/link`, data);
674
+ }
675
+ /**
676
+ * Request a specific link by ID
677
+ *
678
+ * @param scope Scope the link resides within
679
+ * @param link_id ID of the link to request
680
+ * @returns The requested link
681
+ */
682
+ get(scope, link_id) {
683
+ return this.client.httpGet(`box/${scope}/link/${link_id}`);
684
+ }
685
+ /**
686
+ * Requests metadata for the link. This will make a request to the site at
687
+ * the link value to extract metadata from the website itself such as title,
688
+ * and OGP metadata
689
+ *
690
+ * @param scope Scope the link resides within
691
+ * @param link_id ID of the link to request
692
+ * @returns The link website metadata
693
+ */
694
+ metadata(scope, link_id) {
695
+ return this.client.httpGet(`box/${scope}/link/${link_id}/metadata`);
696
+ }
697
+ /**
698
+ * Get the raw favicon content for a link
699
+ *
700
+ * On node this returns an {@link ArrayBuffer} not a blob
701
+ *
702
+ * @param scope Scope the link resides within
703
+ * @param link_id ID of the link to request
704
+ * @returns The link raw favicon
705
+ */
706
+ favicon(scope, link_id) {
707
+ return this.client.httpGet(this.faviconURL(scope, link_id), {
708
+ responseType: typeof window === 'undefined' ? 'arraybuffer' : 'blob',
709
+ });
710
+ }
711
+ /**
712
+ * Get the raw favicon content for a link
713
+ *
714
+ * This function is the same as {@link LinkService.favicon} just
715
+ * it has the correct return type for Node and will only return an
716
+ * ArrayBuffer
717
+ *
718
+ * @param scope Scope the link resides within
719
+ * @param link_id ID of the link to request
720
+ * @returns The link raw favicon
721
+ */
722
+ faviconNode(scope, link_id) {
723
+ return this.client.httpGet(this.faviconURL(scope, link_id), {
724
+ responseType: 'arraybuffer',
725
+ });
726
+ }
727
+ /**
728
+ * Get the raw social image for a link
729
+ *
730
+ * On node this returns an {@link ArrayBuffer} not a blob
731
+ *
732
+ * @param scope Scope the link resides within
733
+ * @param link_id ID of the link to request
734
+ * @returns The link raw social image
735
+ */
736
+ image(scope, link_id) {
737
+ return this.client.httpGet(this.imageURL(scope, link_id), {
738
+ responseType: typeof window === 'undefined' ? 'arraybuffer' : 'blob',
739
+ });
740
+ }
741
+ /**
742
+ * Get the raw social image for a link
743
+ *
744
+ * This function is the same as {@link LinkService.image} just
745
+ * it has the correct return type for Node and will only return an
746
+ * ArrayBuffer
747
+ *
748
+ * @param scope Scope the link resides within
749
+ * @param link_id ID of the link to request
750
+ * @returns
751
+ */
752
+ imageNode(scope, link_id) {
753
+ return this.client.httpGet(this.imageURL(scope, link_id), {
754
+ responseType: 'arraybuffer',
755
+ });
756
+ }
757
+ /**
758
+ * Get the edit history for a link
759
+ *
760
+ * @param scope Scope the link resides within
761
+ * @param link_id ID of the link to request
762
+ * @returns Edit history for the link
763
+ */
764
+ editHistory(scope, link_id) {
765
+ return this.client.httpGet(`box/${scope}/link/${link_id}/edit-history`);
766
+ }
767
+ /**
768
+ * Updates a link
769
+ *
770
+ * @param scope Scope the link resides within
771
+ * @param link_id ID of the link to request
772
+ * @param data The update request
773
+ */
774
+ update(scope, link_id, data) {
775
+ return this.client.httpPut(`box/${scope}/link/${link_id}`, data);
776
+ }
777
+ /**
778
+ * Deletes the provided link
779
+ *
780
+ * @param scope Scope the link resides within
781
+ * @param link_id ID of the link to request
782
+ */
783
+ delete(scope, link_id) {
784
+ return this.client.httpDelete(`box/${scope}/link/${link_id}`);
785
+ }
786
+ }
787
+
788
+ class FolderService {
789
+ constructor(client) {
790
+ this.client = client;
791
+ }
792
+ /**
793
+ * Create a new folder
794
+ *
795
+ * @param scope Scope to create the folder within
796
+ * @param data Configuration for creating the folder
797
+ * @returns The created folder
798
+ */
799
+ create(scope, data) {
800
+ return this.client.httpPost(`box/${scope}/folder`, data);
801
+ }
802
+ /**
803
+ * Loads a specific folder
804
+ *
805
+ * @param scope Scope the folder resides within
806
+ * @param folder_id ID of the folder to request
807
+ * @returns The resolved folder
808
+ */
809
+ get(scope, folder_id) {
810
+ return this.client.httpGet(`box/${scope}/folder/${folder_id}`);
811
+ }
812
+ /**
813
+ * Update a folder details
814
+ *
815
+ * @param scope Scope the folder resides within
816
+ * @param folder_id ID of the folder to update
817
+ * @param data The folder update data
818
+ */
819
+ update(scope, folder_id, data) {
820
+ return this.client.httpPut(`box/${scope}/folder/${folder_id}`, data);
821
+ }
822
+ /**
823
+ * Deletes the provided folder
824
+ *
825
+ * @param scope Scope the folder resides within
826
+ * @param folder_id ID of the folder to delete
827
+ */
828
+ delete(scope, folder_id) {
829
+ return this.client.httpDelete(`box/${scope}/folder/${folder_id}`);
830
+ }
831
+ /**
832
+ * Load the edit history of a folder
833
+ *
834
+ * @param scope Scope the folder resides within
835
+ * @param folder_id ID of the folder to query
836
+ * @returns The folder edit history
837
+ */
838
+ editHistory(scope, folder_id) {
839
+ return this.client.httpGet(`box/${scope}/folder/${folder_id}/edit-history`);
840
+ }
841
+ }
842
+
843
+ class TaskService {
844
+ constructor(client) {
845
+ this.client = client;
846
+ }
847
+ /**
848
+ * Get the current status of a specific task
849
+ *
850
+ * @param scope
851
+ * @param task_id
852
+ * @returns
853
+ */
854
+ get(scope, task_id, abort) {
855
+ return __awaiter(this, void 0, void 0, function* () {
856
+ return this.client.httpGet(`box/${scope}/task/${task_id}`, {
857
+ signal: abort === null || abort === void 0 ? void 0 : abort.signal,
858
+ });
859
+ });
860
+ }
861
+ /**
862
+ * Polls for the completion of a task
863
+ *
864
+ * @param scope
865
+ * @param task_id
866
+ * @param abort
867
+ * @returns
868
+ */
869
+ finished(scope_1, task_id_1) {
870
+ return __awaiter(this, arguments, void 0, function* (scope, task_id, interval = 1000, abort) {
871
+ var _a, _b;
872
+ while (abort === undefined ? true : !abort.signal.aborted) {
873
+ const task = yield this.get(scope, task_id, abort);
874
+ if (task.status === DocboxTaskStatus.Completed) {
875
+ const response = task.output_data;
876
+ return response;
877
+ }
878
+ if (task.status === DocboxTaskStatus.Failed) {
879
+ const error = (_b = (_a = task.output_data) === null || _a === void 0 ? void 0 : _a.error) !== null && _b !== void 0 ? _b : 'Unknown Error';
880
+ throw new Error(error);
881
+ }
882
+ yield sleep(interval);
883
+ }
884
+ throw new Error('upload tracking aborted');
885
+ });
886
+ }
887
+ }
888
+
889
+ class AdminService {
890
+ constructor(client) {
891
+ this.client = client;
892
+ }
893
+ /**
894
+ * Perform an admin search across multiple document boxes.
895
+ *
896
+ * This function will only work on your server handling authentication
897
+ * you should not allow the frontend to access these endpoints
898
+ *
899
+ * @param data Search request data
900
+ * @returns The search results
901
+ */
902
+ search(data) {
903
+ return __awaiter(this, void 0, void 0, function* () {
904
+ return yield this.client.httpPost(`admin/search`, data);
905
+ });
906
+ }
907
+ }
908
+
909
+ class DocboxClient {
910
+ /**
911
+ * Creates a new docbox
912
+ *
913
+ * @param client
914
+ */
915
+ constructor(client) {
916
+ this.client = client;
917
+ this.documentBox = new BoxService(this);
918
+ this.task = new TaskService(this);
919
+ this.file = new FileService(this);
920
+ this.link = new LinkService(this);
921
+ this.folder = new FolderService(this);
922
+ this.admin = new AdminService(this);
923
+ }
924
+ httpGet(url, config) {
925
+ return __awaiter(this, void 0, void 0, function* () {
926
+ const { data } = yield this.client.get(url, config);
927
+ return data;
928
+ });
929
+ }
930
+ httpPost(url, data, config) {
931
+ return __awaiter(this, void 0, void 0, function* () {
932
+ const { data: responseData } = yield this.client.post(url, data, config);
933
+ return responseData;
934
+ });
935
+ }
936
+ httpPut(url, data, config) {
937
+ return __awaiter(this, void 0, void 0, function* () {
938
+ const { data: responseData } = yield this.client.put(url, data, config);
939
+ return responseData;
940
+ });
941
+ }
942
+ httpPatch(url, data, config) {
943
+ return __awaiter(this, void 0, void 0, function* () {
944
+ const { data: responseData } = yield this.client.patch(url, data, config);
945
+ return responseData;
946
+ });
947
+ }
948
+ httpDelete(url, config) {
949
+ return __awaiter(this, void 0, void 0, function* () {
950
+ const { data: responseData } = yield this.client.delete(url, config);
951
+ return responseData;
952
+ });
953
+ }
954
+ }
955
+
956
+ let FileGlobal = File;
957
+ // Node targets don't have this available, just mock it.
958
+ // this type should not be used in a node env
959
+ if (FileGlobal === undefined) {
960
+ class MockFile {
961
+ constructor(name, fileParts, options) {
962
+ this.name = name;
963
+ this.fileParts = fileParts;
964
+ this.options = options;
965
+ }
966
+ }
967
+ FileGlobal = MockFile;
968
+ }
969
+ /**
970
+ * Wrapper around the browser File type to allow using a docbox file
971
+ * in place when handling already uploaded files in a form
972
+ */
973
+ class DocboxFile extends FileGlobal {
974
+ get size() {
975
+ return this.file.size;
976
+ }
977
+ constructor(file) {
978
+ super([], file.name, { type: file.mime });
979
+ this.file = file;
980
+ }
981
+ }
982
+
983
+ export { DocboxClient, DocboxFile, DocboxItemType, DocboxTaskStatus, EditHistoryType, GeneratedFileType, PresignedUploadStatus, SearchResultItemType, sleep };
984
+ //# sourceMappingURL=index.browser.esm.js.map