decap-cms-lib-util 3.0.4 → 3.2.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.
- package/CHANGELOG.md +12 -0
- package/dist/decap-cms-lib-util.js +1 -1
- package/dist/decap-cms-lib-util.js.map +1 -1
- package/dist/esm/API.js +28 -41
- package/dist/esm/APIError.js +3 -10
- package/dist/esm/APIUtils.js +10 -23
- package/dist/esm/AccessTokenError.js +3 -10
- package/dist/esm/Cursor.js +12 -19
- package/dist/esm/EditorialWorkflowError.js +3 -10
- package/dist/esm/asyncLock.js +5 -12
- package/dist/esm/backendUtil.js +19 -31
- package/dist/esm/getBlobSHA.js +4 -11
- package/dist/esm/git-lfs.js +17 -28
- package/dist/esm/implementation.js +21 -37
- package/dist/esm/index.js +71 -409
- package/dist/esm/loadScript.js +1 -7
- package/dist/esm/localForage.js +4 -11
- package/dist/esm/path.js +4 -13
- package/dist/esm/promise.js +5 -14
- package/dist/esm/stega.js +129 -0
- package/dist/esm/types/semaphore.d.js +0 -1
- package/dist/esm/types.js +7 -0
- package/dist/esm/unsentRequest.js +13 -20
- package/package.json +2 -2
- package/src/API.ts +6 -4
- package/src/stega.ts +134 -0
- package/src/types.ts +9 -0
package/dist/esm/index.js
CHANGED
|
@@ -1,409 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(exports, "asyncLock", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function () {
|
|
76
|
-
return _asyncLock.asyncLock;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(exports, "basename", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function () {
|
|
82
|
-
return _path.basename;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
Object.defineProperty(exports, "blobToFileObj", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function () {
|
|
88
|
-
return _implementation.blobToFileObj;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
Object.defineProperty(exports, "branchFromContentKey", {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
get: function () {
|
|
94
|
-
return _APIUtils.branchFromContentKey;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
Object.defineProperty(exports, "contentKeyFromBranch", {
|
|
98
|
-
enumerable: true,
|
|
99
|
-
get: function () {
|
|
100
|
-
return _APIUtils.contentKeyFromBranch;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(exports, "createPointerFile", {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function () {
|
|
106
|
-
return _gitLfs.createPointerFile;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
Object.defineProperty(exports, "entriesByFiles", {
|
|
110
|
-
enumerable: true,
|
|
111
|
-
get: function () {
|
|
112
|
-
return _implementation.entriesByFiles;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(exports, "entriesByFolder", {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function () {
|
|
118
|
-
return _implementation.entriesByFolder;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
Object.defineProperty(exports, "fileExtension", {
|
|
122
|
-
enumerable: true,
|
|
123
|
-
get: function () {
|
|
124
|
-
return _path.fileExtension;
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
Object.defineProperty(exports, "fileExtensionWithSeparator", {
|
|
128
|
-
enumerable: true,
|
|
129
|
-
get: function () {
|
|
130
|
-
return _path.fileExtensionWithSeparator;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
Object.defineProperty(exports, "filterByExtension", {
|
|
134
|
-
enumerable: true,
|
|
135
|
-
get: function () {
|
|
136
|
-
return _backendUtil.filterByExtension;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
Object.defineProperty(exports, "flowAsync", {
|
|
140
|
-
enumerable: true,
|
|
141
|
-
get: function () {
|
|
142
|
-
return _promise.flowAsync;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
Object.defineProperty(exports, "generateContentKey", {
|
|
146
|
-
enumerable: true,
|
|
147
|
-
get: function () {
|
|
148
|
-
return _APIUtils.generateContentKey;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
Object.defineProperty(exports, "getAllResponses", {
|
|
152
|
-
enumerable: true,
|
|
153
|
-
get: function () {
|
|
154
|
-
return _backendUtil.getAllResponses;
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
Object.defineProperty(exports, "getBlobSHA", {
|
|
158
|
-
enumerable: true,
|
|
159
|
-
get: function () {
|
|
160
|
-
return _getBlobSHA.default;
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
Object.defineProperty(exports, "getDefaultBranchName", {
|
|
164
|
-
enumerable: true,
|
|
165
|
-
get: function () {
|
|
166
|
-
return _API.getDefaultBranchName;
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
Object.defineProperty(exports, "getLargeMediaFilteredMediaFiles", {
|
|
170
|
-
enumerable: true,
|
|
171
|
-
get: function () {
|
|
172
|
-
return _gitLfs.getLargeMediaFilteredMediaFiles;
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
Object.defineProperty(exports, "getLargeMediaPatternsFromGitAttributesFile", {
|
|
176
|
-
enumerable: true,
|
|
177
|
-
get: function () {
|
|
178
|
-
return _gitLfs.getLargeMediaPatternsFromGitAttributesFile;
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
Object.defineProperty(exports, "getMediaAsBlob", {
|
|
182
|
-
enumerable: true,
|
|
183
|
-
get: function () {
|
|
184
|
-
return _implementation.getMediaAsBlob;
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
Object.defineProperty(exports, "getMediaDisplayURL", {
|
|
188
|
-
enumerable: true,
|
|
189
|
-
get: function () {
|
|
190
|
-
return _implementation.getMediaDisplayURL;
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
Object.defineProperty(exports, "getPathDepth", {
|
|
194
|
-
enumerable: true,
|
|
195
|
-
get: function () {
|
|
196
|
-
return _backendUtil.getPathDepth;
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
Object.defineProperty(exports, "getPointerFileForMediaFileObj", {
|
|
200
|
-
enumerable: true,
|
|
201
|
-
get: function () {
|
|
202
|
-
return _gitLfs.getPointerFileForMediaFileObj;
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
Object.defineProperty(exports, "getPreviewStatus", {
|
|
206
|
-
enumerable: true,
|
|
207
|
-
get: function () {
|
|
208
|
-
return _API.getPreviewStatus;
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
Object.defineProperty(exports, "isAbsolutePath", {
|
|
212
|
-
enumerable: true,
|
|
213
|
-
get: function () {
|
|
214
|
-
return _path.isAbsolutePath;
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
Object.defineProperty(exports, "isCMSLabel", {
|
|
218
|
-
enumerable: true,
|
|
219
|
-
get: function () {
|
|
220
|
-
return _APIUtils.isCMSLabel;
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
Object.defineProperty(exports, "isPreviewContext", {
|
|
224
|
-
enumerable: true,
|
|
225
|
-
get: function () {
|
|
226
|
-
return _API.isPreviewContext;
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
Object.defineProperty(exports, "labelToStatus", {
|
|
230
|
-
enumerable: true,
|
|
231
|
-
get: function () {
|
|
232
|
-
return _APIUtils.labelToStatus;
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
Object.defineProperty(exports, "loadScript", {
|
|
236
|
-
enumerable: true,
|
|
237
|
-
get: function () {
|
|
238
|
-
return _loadScript.default;
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
Object.defineProperty(exports, "localForage", {
|
|
242
|
-
enumerable: true,
|
|
243
|
-
get: function () {
|
|
244
|
-
return _localForage.default;
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
Object.defineProperty(exports, "onlySuccessfulPromises", {
|
|
248
|
-
enumerable: true,
|
|
249
|
-
get: function () {
|
|
250
|
-
return _promise.onlySuccessfulPromises;
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
Object.defineProperty(exports, "parseContentKey", {
|
|
254
|
-
enumerable: true,
|
|
255
|
-
get: function () {
|
|
256
|
-
return _APIUtils.parseContentKey;
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
Object.defineProperty(exports, "parseLinkHeader", {
|
|
260
|
-
enumerable: true,
|
|
261
|
-
get: function () {
|
|
262
|
-
return _backendUtil.parseLinkHeader;
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
Object.defineProperty(exports, "parsePointerFile", {
|
|
266
|
-
enumerable: true,
|
|
267
|
-
get: function () {
|
|
268
|
-
return _gitLfs.parsePointerFile;
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
Object.defineProperty(exports, "parseResponse", {
|
|
272
|
-
enumerable: true,
|
|
273
|
-
get: function () {
|
|
274
|
-
return _backendUtil.parseResponse;
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
Object.defineProperty(exports, "readFile", {
|
|
278
|
-
enumerable: true,
|
|
279
|
-
get: function () {
|
|
280
|
-
return _API.readFile;
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
Object.defineProperty(exports, "readFileMetadata", {
|
|
284
|
-
enumerable: true,
|
|
285
|
-
get: function () {
|
|
286
|
-
return _API.readFileMetadata;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
Object.defineProperty(exports, "requestWithBackoff", {
|
|
290
|
-
enumerable: true,
|
|
291
|
-
get: function () {
|
|
292
|
-
return _API.requestWithBackoff;
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
Object.defineProperty(exports, "responseParser", {
|
|
296
|
-
enumerable: true,
|
|
297
|
-
get: function () {
|
|
298
|
-
return _backendUtil.responseParser;
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
Object.defineProperty(exports, "runWithLock", {
|
|
302
|
-
enumerable: true,
|
|
303
|
-
get: function () {
|
|
304
|
-
return _implementation.runWithLock;
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
Object.defineProperty(exports, "statusToLabel", {
|
|
308
|
-
enumerable: true,
|
|
309
|
-
get: function () {
|
|
310
|
-
return _APIUtils.statusToLabel;
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
Object.defineProperty(exports, "then", {
|
|
314
|
-
enumerable: true,
|
|
315
|
-
get: function () {
|
|
316
|
-
return _promise.then;
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
Object.defineProperty(exports, "throwOnConflictingBranches", {
|
|
320
|
-
enumerable: true,
|
|
321
|
-
get: function () {
|
|
322
|
-
return _API.throwOnConflictingBranches;
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
Object.defineProperty(exports, "unpublishedEntries", {
|
|
326
|
-
enumerable: true,
|
|
327
|
-
get: function () {
|
|
328
|
-
return _implementation.unpublishedEntries;
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
Object.defineProperty(exports, "unsentRequest", {
|
|
332
|
-
enumerable: true,
|
|
333
|
-
get: function () {
|
|
334
|
-
return _unsentRequest.default;
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
var _APIError = _interopRequireDefault(require("./APIError"));
|
|
338
|
-
var _Cursor = _interopRequireWildcard(require("./Cursor"));
|
|
339
|
-
var _EditorialWorkflowError = _interopRequireWildcard(require("./EditorialWorkflowError"));
|
|
340
|
-
var _AccessTokenError = _interopRequireDefault(require("./AccessTokenError"));
|
|
341
|
-
var _localForage = _interopRequireDefault(require("./localForage"));
|
|
342
|
-
var _path = require("./path");
|
|
343
|
-
var _promise = require("./promise");
|
|
344
|
-
var _unsentRequest = _interopRequireDefault(require("./unsentRequest"));
|
|
345
|
-
var _backendUtil = require("./backendUtil");
|
|
346
|
-
var _loadScript = _interopRequireDefault(require("./loadScript"));
|
|
347
|
-
var _getBlobSHA = _interopRequireDefault(require("./getBlobSHA"));
|
|
348
|
-
var _asyncLock = require("./asyncLock");
|
|
349
|
-
var _implementation = require("./implementation");
|
|
350
|
-
var _API = require("./API");
|
|
351
|
-
var _APIUtils = require("./APIUtils");
|
|
352
|
-
var _gitLfs = require("./git-lfs");
|
|
353
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
354
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
355
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
356
|
-
const DecapCmsLibUtil = exports.DecapCmsLibUtil = {
|
|
357
|
-
APIError: _APIError.default,
|
|
358
|
-
Cursor: _Cursor.default,
|
|
359
|
-
CURSOR_COMPATIBILITY_SYMBOL: _Cursor.CURSOR_COMPATIBILITY_SYMBOL,
|
|
360
|
-
EditorialWorkflowError: _EditorialWorkflowError.default,
|
|
361
|
-
EDITORIAL_WORKFLOW_ERROR: _EditorialWorkflowError.EDITORIAL_WORKFLOW_ERROR,
|
|
362
|
-
localForage: _localForage.default,
|
|
363
|
-
basename: _path.basename,
|
|
364
|
-
fileExtensionWithSeparator: _path.fileExtensionWithSeparator,
|
|
365
|
-
fileExtension: _path.fileExtension,
|
|
366
|
-
onlySuccessfulPromises: _promise.onlySuccessfulPromises,
|
|
367
|
-
flowAsync: _promise.flowAsync,
|
|
368
|
-
then: _promise.then,
|
|
369
|
-
unsentRequest: _unsentRequest.default,
|
|
370
|
-
filterByExtension: _backendUtil.filterByExtension,
|
|
371
|
-
parseLinkHeader: _backendUtil.parseLinkHeader,
|
|
372
|
-
parseResponse: _backendUtil.parseResponse,
|
|
373
|
-
responseParser: _backendUtil.responseParser,
|
|
374
|
-
loadScript: _loadScript.default,
|
|
375
|
-
getBlobSHA: _getBlobSHA.default,
|
|
376
|
-
getPathDepth: _backendUtil.getPathDepth,
|
|
377
|
-
entriesByFiles: _implementation.entriesByFiles,
|
|
378
|
-
entriesByFolder: _implementation.entriesByFolder,
|
|
379
|
-
unpublishedEntries: _implementation.unpublishedEntries,
|
|
380
|
-
getMediaDisplayURL: _implementation.getMediaDisplayURL,
|
|
381
|
-
getMediaAsBlob: _implementation.getMediaAsBlob,
|
|
382
|
-
readFile: _API.readFile,
|
|
383
|
-
readFileMetadata: _API.readFileMetadata,
|
|
384
|
-
CMS_BRANCH_PREFIX: _APIUtils.CMS_BRANCH_PREFIX,
|
|
385
|
-
generateContentKey: _APIUtils.generateContentKey,
|
|
386
|
-
isCMSLabel: _APIUtils.isCMSLabel,
|
|
387
|
-
labelToStatus: _APIUtils.labelToStatus,
|
|
388
|
-
statusToLabel: _APIUtils.statusToLabel,
|
|
389
|
-
DEFAULT_PR_BODY: _APIUtils.DEFAULT_PR_BODY,
|
|
390
|
-
MERGE_COMMIT_MESSAGE: _APIUtils.MERGE_COMMIT_MESSAGE,
|
|
391
|
-
isPreviewContext: _API.isPreviewContext,
|
|
392
|
-
getPreviewStatus: _API.getPreviewStatus,
|
|
393
|
-
runWithLock: _implementation.runWithLock,
|
|
394
|
-
PreviewState: _API.PreviewState,
|
|
395
|
-
parseContentKey: _APIUtils.parseContentKey,
|
|
396
|
-
createPointerFile: _gitLfs.createPointerFile,
|
|
397
|
-
getLargeMediaFilteredMediaFiles: _gitLfs.getLargeMediaFilteredMediaFiles,
|
|
398
|
-
getLargeMediaPatternsFromGitAttributesFile: _gitLfs.getLargeMediaPatternsFromGitAttributesFile,
|
|
399
|
-
parsePointerFile: _gitLfs.parsePointerFile,
|
|
400
|
-
getPointerFileForMediaFileObj: _gitLfs.getPointerFileForMediaFileObj,
|
|
401
|
-
branchFromContentKey: _APIUtils.branchFromContentKey,
|
|
402
|
-
contentKeyFromBranch: _APIUtils.contentKeyFromBranch,
|
|
403
|
-
blobToFileObj: _implementation.blobToFileObj,
|
|
404
|
-
requestWithBackoff: _API.requestWithBackoff,
|
|
405
|
-
getDefaultBranchName: _API.getDefaultBranchName,
|
|
406
|
-
allEntriesByFolder: _implementation.allEntriesByFolder,
|
|
407
|
-
AccessTokenError: _AccessTokenError.default,
|
|
408
|
-
throwOnConflictingBranches: _API.throwOnConflictingBranches
|
|
409
|
-
};
|
|
1
|
+
import APIError from './APIError';
|
|
2
|
+
import Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from './Cursor';
|
|
3
|
+
import EditorialWorkflowError, { EDITORIAL_WORKFLOW_ERROR } from './EditorialWorkflowError';
|
|
4
|
+
import AccessTokenError from './AccessTokenError';
|
|
5
|
+
import localForage from './localForage';
|
|
6
|
+
import { isAbsolutePath, basename, fileExtensionWithSeparator, fileExtension } from './path';
|
|
7
|
+
import { onlySuccessfulPromises, flowAsync, then } from './promise';
|
|
8
|
+
import unsentRequest from './unsentRequest';
|
|
9
|
+
import { filterByExtension, getAllResponses, parseLinkHeader, parseResponse, responseParser, getPathDepth } from './backendUtil';
|
|
10
|
+
import loadScript from './loadScript';
|
|
11
|
+
import getBlobSHA from './getBlobSHA';
|
|
12
|
+
import { asyncLock } from './asyncLock';
|
|
13
|
+
import { entriesByFiles, entriesByFolder, unpublishedEntries, getMediaDisplayURL, getMediaAsBlob, runWithLock, blobToFileObj, allEntriesByFolder } from './implementation';
|
|
14
|
+
import { readFile, readFileMetadata, isPreviewContext, getPreviewStatus, PreviewState, requestWithBackoff, getDefaultBranchName, throwOnConflictingBranches } from './API';
|
|
15
|
+
import { CMS_BRANCH_PREFIX, generateContentKey, isCMSLabel, labelToStatus, statusToLabel, DEFAULT_PR_BODY, MERGE_COMMIT_MESSAGE, parseContentKey, branchFromContentKey, contentKeyFromBranch } from './APIUtils';
|
|
16
|
+
import { createPointerFile, getLargeMediaFilteredMediaFiles, getLargeMediaPatternsFromGitAttributesFile, parsePointerFile, getPointerFileForMediaFileObj } from './git-lfs';
|
|
17
|
+
export const DecapCmsLibUtil = {
|
|
18
|
+
APIError,
|
|
19
|
+
Cursor,
|
|
20
|
+
CURSOR_COMPATIBILITY_SYMBOL,
|
|
21
|
+
EditorialWorkflowError,
|
|
22
|
+
EDITORIAL_WORKFLOW_ERROR,
|
|
23
|
+
localForage,
|
|
24
|
+
basename,
|
|
25
|
+
fileExtensionWithSeparator,
|
|
26
|
+
fileExtension,
|
|
27
|
+
onlySuccessfulPromises,
|
|
28
|
+
flowAsync,
|
|
29
|
+
then,
|
|
30
|
+
unsentRequest,
|
|
31
|
+
filterByExtension,
|
|
32
|
+
parseLinkHeader,
|
|
33
|
+
parseResponse,
|
|
34
|
+
responseParser,
|
|
35
|
+
loadScript,
|
|
36
|
+
getBlobSHA,
|
|
37
|
+
getPathDepth,
|
|
38
|
+
entriesByFiles,
|
|
39
|
+
entriesByFolder,
|
|
40
|
+
unpublishedEntries,
|
|
41
|
+
getMediaDisplayURL,
|
|
42
|
+
getMediaAsBlob,
|
|
43
|
+
readFile,
|
|
44
|
+
readFileMetadata,
|
|
45
|
+
CMS_BRANCH_PREFIX,
|
|
46
|
+
generateContentKey,
|
|
47
|
+
isCMSLabel,
|
|
48
|
+
labelToStatus,
|
|
49
|
+
statusToLabel,
|
|
50
|
+
DEFAULT_PR_BODY,
|
|
51
|
+
MERGE_COMMIT_MESSAGE,
|
|
52
|
+
isPreviewContext,
|
|
53
|
+
getPreviewStatus,
|
|
54
|
+
runWithLock,
|
|
55
|
+
PreviewState,
|
|
56
|
+
parseContentKey,
|
|
57
|
+
createPointerFile,
|
|
58
|
+
getLargeMediaFilteredMediaFiles,
|
|
59
|
+
getLargeMediaPatternsFromGitAttributesFile,
|
|
60
|
+
parsePointerFile,
|
|
61
|
+
getPointerFileForMediaFileObj,
|
|
62
|
+
branchFromContentKey,
|
|
63
|
+
contentKeyFromBranch,
|
|
64
|
+
blobToFileObj,
|
|
65
|
+
requestWithBackoff,
|
|
66
|
+
getDefaultBranchName,
|
|
67
|
+
allEntriesByFolder,
|
|
68
|
+
AccessTokenError,
|
|
69
|
+
throwOnConflictingBranches
|
|
70
|
+
};
|
|
71
|
+
export { APIError, Cursor, CURSOR_COMPATIBILITY_SYMBOL, EditorialWorkflowError, EDITORIAL_WORKFLOW_ERROR, localForage, basename, fileExtensionWithSeparator, fileExtension, onlySuccessfulPromises, flowAsync, then, unsentRequest, filterByExtension, parseLinkHeader, getAllResponses, parseResponse, responseParser, loadScript, getBlobSHA, asyncLock, isAbsolutePath, getPathDepth, entriesByFiles, entriesByFolder, unpublishedEntries, getMediaDisplayURL, getMediaAsBlob, readFile, readFileMetadata, CMS_BRANCH_PREFIX, generateContentKey, isCMSLabel, labelToStatus, statusToLabel, DEFAULT_PR_BODY, MERGE_COMMIT_MESSAGE, isPreviewContext, getPreviewStatus, runWithLock, PreviewState, parseContentKey, createPointerFile, getLargeMediaFilteredMediaFiles, getLargeMediaPatternsFromGitAttributesFile, parsePointerFile, getPointerFileForMediaFileObj, branchFromContentKey, contentKeyFromBranch, blobToFileObj, requestWithBackoff, getDefaultBranchName, allEntriesByFolder, AccessTokenError, throwOnConflictingBranches };
|
package/dist/esm/loadScript.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = loadScript;
|
|
7
1
|
/**
|
|
8
2
|
* Simple script loader that returns a promise.
|
|
9
3
|
*/
|
|
10
|
-
function loadScript(url) {
|
|
4
|
+
export default function loadScript(url) {
|
|
11
5
|
return new Promise((resolve, reject) => {
|
|
12
6
|
let done = false;
|
|
13
7
|
const head = document.getElementsByTagName('head')[0];
|
package/dist/esm/localForage.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _localforage = _interopRequireDefault(require("localforage"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
import localForage from 'localforage';
|
|
9
2
|
function localForageTest() {
|
|
10
3
|
const testKey = 'localForageTest';
|
|
11
|
-
|
|
4
|
+
localForage.setItem(testKey, {
|
|
12
5
|
expires: Date.now() + 300000
|
|
13
6
|
}).then(() => {
|
|
14
|
-
|
|
7
|
+
localForage.removeItem(testKey);
|
|
15
8
|
}).catch(err => {
|
|
16
9
|
if (err.code === 22) {
|
|
17
10
|
const message = 'Unable to set localStorage key. Quota exceeded! Full disk?';
|
|
@@ -21,4 +14,4 @@ function localForageTest() {
|
|
|
21
14
|
});
|
|
22
15
|
}
|
|
23
16
|
localForageTest();
|
|
24
|
-
|
|
17
|
+
export default localForage;
|
package/dist/esm/path.js
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.basename = basename;
|
|
7
|
-
exports.fileExtension = fileExtension;
|
|
8
|
-
exports.fileExtensionWithSeparator = fileExtensionWithSeparator;
|
|
9
|
-
exports.isAbsolutePath = isAbsolutePath;
|
|
10
1
|
const absolutePath = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
11
2
|
function normalizePath(path) {
|
|
12
3
|
return path.replace(/[\\/]+/g, '/');
|
|
13
4
|
}
|
|
14
|
-
function isAbsolutePath(path) {
|
|
5
|
+
export function isAbsolutePath(path) {
|
|
15
6
|
return absolutePath.test(path);
|
|
16
7
|
}
|
|
17
8
|
|
|
@@ -26,7 +17,7 @@ function isAbsolutePath(path) {
|
|
|
26
17
|
* // returns
|
|
27
18
|
* 'quux'
|
|
28
19
|
*/
|
|
29
|
-
function basename(p, ext = '') {
|
|
20
|
+
export function basename(p, ext = '') {
|
|
30
21
|
// Special case: Normalize will modify this to '.'
|
|
31
22
|
if (p === '') {
|
|
32
23
|
return p;
|
|
@@ -60,7 +51,7 @@ function basename(p, ext = '') {
|
|
|
60
51
|
* // returns
|
|
61
52
|
* '.html'
|
|
62
53
|
*/
|
|
63
|
-
function fileExtensionWithSeparator(p) {
|
|
54
|
+
export function fileExtensionWithSeparator(p) {
|
|
64
55
|
p = normalizePath(p);
|
|
65
56
|
const sections = p.split('/');
|
|
66
57
|
p = sections.pop();
|
|
@@ -87,7 +78,7 @@ function fileExtensionWithSeparator(p) {
|
|
|
87
78
|
* // returns
|
|
88
79
|
* 'html'
|
|
89
80
|
*/
|
|
90
|
-
function fileExtension(p) {
|
|
81
|
+
export function fileExtension(p) {
|
|
91
82
|
const ext = fileExtensionWithSeparator(p);
|
|
92
83
|
return ext === '' ? ext : ext.slice(1);
|
|
93
84
|
}
|
package/dist/esm/promise.js
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.flowAsync = flowAsync;
|
|
7
|
-
exports.onlySuccessfulPromises = onlySuccessfulPromises;
|
|
8
|
-
exports.then = then;
|
|
9
|
-
var _flow = _interopRequireDefault(require("lodash/flow"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function then(fn) {
|
|
1
|
+
import flow from 'lodash/flow';
|
|
2
|
+
export function then(fn) {
|
|
12
3
|
return p => Promise.resolve(p).then(fn);
|
|
13
4
|
}
|
|
14
5
|
const filterPromiseSymbol = Symbol('filterPromiseSymbol');
|
|
15
|
-
function onlySuccessfulPromises(promises) {
|
|
6
|
+
export function onlySuccessfulPromises(promises) {
|
|
16
7
|
return Promise.all(promises.map(p => p.catch(() => filterPromiseSymbol))).then(results => results.filter(result => result !== filterPromiseSymbol));
|
|
17
8
|
}
|
|
18
9
|
function wrapFlowAsync(fn) {
|
|
19
10
|
return async arg => fn(await arg);
|
|
20
11
|
}
|
|
21
|
-
function flowAsync(fns) {
|
|
22
|
-
return (
|
|
12
|
+
export function flowAsync(fns) {
|
|
13
|
+
return flow(fns.map(fn => wrapFlowAsync(fn)));
|
|
23
14
|
}
|