@mcpher/gas-fakes 1.2.26 → 1.2.28
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/package.json +1 -1
- package/src/cli/setup.js +35 -6
- package/src/cli/utils.js +8 -7
- package/src/index.js +1 -0
- package/src/services/advcalendar/clapis.js +14 -0
- package/src/services/advcalendar/fakeadvcalendarcalendarlist.js +30 -0
- package/src/services/advcalendar/fakeadvcalendarcalendars.js +25 -0
- package/src/services/advcalendar/fakeadvcalendarevents.js +51 -1
- package/src/services/calendarapp/app.js +11 -0
- package/src/services/calendarapp/fakecalendar.js +328 -0
- package/src/services/calendarapp/fakecalendarapp.js +147 -0
- package/src/services/calendarapp/fakecalendarevent.js +44 -0
- package/src/services/calendarapp/fakecalendareventseries.js +36 -0
- package/src/services/calendarapp/fakeeventrecurrence.js +19 -0
- package/src/services/enums/calendarenums.js +85 -0
- package/src/services/enums/slidesenums.js +1 -1
- package/src/services/formapp/fakechoiceitem.js +1 -1
- package/src/services/formapp/fakeform.js +4 -3
- package/src/services/formapp/fakeformitem.js +1 -2
- package/src/services/formapp/fakeformresponse.js +3 -2
- package/src/services/formapp/fakelistitem.js +3 -2
- package/src/services/scriptapp/behavior.js +56 -1
- package/src/services/slidesapp/fakeaffinetransform.js +55 -0
- package/src/services/slidesapp/fakeaffinetransformbuilder.js +64 -0
- package/src/services/slidesapp/fakeautofit.js +49 -0
- package/src/services/slidesapp/fakeautotext.js +29 -0
- package/src/services/slidesapp/fakeconnectionsite.js +24 -0
- package/src/services/slidesapp/fakelayout.js +38 -0
- package/src/services/slidesapp/fakeline.js +195 -0
- package/src/services/slidesapp/fakelinefill.js +58 -0
- package/src/services/slidesapp/fakelink.js +31 -0
- package/src/services/slidesapp/fakemaster.js +28 -0
- package/src/services/slidesapp/fakenotespage.js +19 -0
- package/src/services/slidesapp/fakepagebackground.js +17 -0
- package/src/services/slidesapp/fakepageelement.js +395 -0
- package/src/services/slidesapp/fakeparagraph.js +46 -0
- package/src/services/slidesapp/fakepoint.js +24 -0
- package/src/services/slidesapp/fakepresentation.js +61 -3
- package/src/services/slidesapp/fakeshape.js +49 -0
- package/src/services/slidesapp/fakeslide.js +232 -0
- package/src/services/slidesapp/fakeslidesapp.js +5 -0
- package/src/services/slidesapp/faketextrange.js +253 -0
- package/src/services/slidesapp/pageelementfactory.js +19 -0
- package/src/services/stores/gasflex.js +1 -1
- package/src/services/urlfetchapp/app.js +17 -1
- package/src/support/sxcalendar.js +61 -0
- package/src/support/sxfetch.js +39 -13
- package/src/support/sxforms.js +3 -1
- package/src/support/syncit.js +16 -2
- package/src/support/utils.js +2 -0
- package/src/support/workersync/sxfunctions.js +1 -0
package/src/support/sxforms.js
CHANGED
|
@@ -18,7 +18,7 @@ export const sxForms = async (Auth, { prop, subProp, method, params, options = {
|
|
|
18
18
|
|
|
19
19
|
const maxRetries = 7;
|
|
20
20
|
let delay = 1777;
|
|
21
|
-
//syncLog
|
|
21
|
+
// syncLog(`Forms API Call: ${prop}${subProp ? '.' + subProp : ''}.${method}, Params: ${JSON.stringify(params)}`);
|
|
22
22
|
for (let i = 0; i < maxRetries; i++) {
|
|
23
23
|
let response;
|
|
24
24
|
let error;
|
|
@@ -30,9 +30,11 @@ export const sxForms = async (Auth, { prop, subProp, method, params, options = {
|
|
|
30
30
|
callish = callish[subProp];
|
|
31
31
|
}
|
|
32
32
|
response = await callish[method](params, options);
|
|
33
|
+
//syncLog(`Forms API Response: ${prop}${subProp ? '.' + subProp : ''}.${method}, Status: ${response?.status}, Data: ${JSON.stringify(response?.data)}`);
|
|
33
34
|
} catch (err) {
|
|
34
35
|
error = err;
|
|
35
36
|
response = err.response;
|
|
37
|
+
syncError(`Forms API Error Response: ${prop}${subProp ? '.' + subProp : ''}.${method}, Status: ${response?.status}, Error: ${JSON.stringify(error)}`);
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
const isRetryable = [429, 500, 503].includes(response?.status) || error?.code == 429;
|
package/src/support/syncit.js
CHANGED
|
@@ -17,6 +17,7 @@ import { gmailCacher } from "./gmailcacher.js";
|
|
|
17
17
|
import { formsCacher } from "./formscacher.js";
|
|
18
18
|
import { slidesCacher } from "./slidescacher.js";
|
|
19
19
|
import { sheetsCacher } from "./sheetscacher.js";
|
|
20
|
+
import { calendarCacher } from "./calendarcacher.js";
|
|
20
21
|
import is from "@sindresorhus/is";
|
|
21
22
|
import { callSync } from "./workersync/synchronizer.js";
|
|
22
23
|
|
|
@@ -151,7 +152,7 @@ const fxGeneric = ({
|
|
|
151
152
|
if (method === "get") {
|
|
152
153
|
return register(resourceId, cacher, result, false, otherParams);
|
|
153
154
|
}
|
|
154
|
-
|
|
155
|
+
|
|
155
156
|
else if (resourceId) {
|
|
156
157
|
cacher.clear(resourceId);
|
|
157
158
|
}
|
|
@@ -341,7 +342,7 @@ const fxDriveMedia = ({ id }) => {
|
|
|
341
342
|
* @param {object} p.params the params to add to the request
|
|
342
343
|
* @return {DriveResponse} from the drive api
|
|
343
344
|
*/
|
|
344
|
-
const fxDriveExport = ({ id, mimeType
|
|
345
|
+
const fxDriveExport = ({ id, mimeType, options = { alt: 'media' } }) => {
|
|
345
346
|
// see issue https://issuetracker.google.com/issues/468534237
|
|
346
347
|
// live apps script failes without this alt option
|
|
347
348
|
return callSync("sxDriveExport", {
|
|
@@ -362,6 +363,10 @@ const fxFetch = (url, options, responseFields) => {
|
|
|
362
363
|
return callSync("sxFetch", url, options, responseFields);
|
|
363
364
|
};
|
|
364
365
|
|
|
366
|
+
const fxFetchAll = (requests, responseFields) => {
|
|
367
|
+
return callSync("sxFetchAll", requests, responseFields);
|
|
368
|
+
};
|
|
369
|
+
|
|
365
370
|
const fxSheets = (args) =>
|
|
366
371
|
fxGeneric({
|
|
367
372
|
...args,
|
|
@@ -397,11 +402,19 @@ const fxGmail = (args) =>
|
|
|
397
402
|
cacher: gmailCacher,
|
|
398
403
|
idField: "id",
|
|
399
404
|
});
|
|
405
|
+
const fxCalendar = (args) =>
|
|
406
|
+
fxGeneric({
|
|
407
|
+
...args,
|
|
408
|
+
serviceName: "Calendar",
|
|
409
|
+
cacher: calendarCacher,
|
|
410
|
+
idField: "calendarId",
|
|
411
|
+
});
|
|
400
412
|
|
|
401
413
|
// const fxGetImagesFromXlsx = (args) => callSync("sxGetImagesFromXlsx", args);
|
|
402
414
|
|
|
403
415
|
export const Syncit = {
|
|
404
416
|
fxFetch,
|
|
417
|
+
fxFetchAll,
|
|
405
418
|
fxDrive,
|
|
406
419
|
fxDriveMedia,
|
|
407
420
|
fxDriveGet,
|
|
@@ -416,5 +429,6 @@ export const Syncit = {
|
|
|
416
429
|
fxDocs,
|
|
417
430
|
fxForms,
|
|
418
431
|
fxGmail,
|
|
432
|
+
fxCalendar,
|
|
419
433
|
fxDriveExport
|
|
420
434
|
}
|
package/src/support/utils.js
CHANGED