@mcpher/gas-fakes 2.5.5 → 2.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "name": "@mcpher/gas-fakes",
41
41
  "author": "bruce mcpherson",
42
- "version": "2.5.5",
42
+ "version": "2.5.6",
43
43
  "license": "MIT",
44
44
  "main": "main.js",
45
45
  "description": "An implementation of the Google Workspace Apps Script runtime: Run native App Script Code on Node and Cloud Run",
@@ -4,13 +4,32 @@ import { gError } from '../../support/helpers.js';
4
4
  import { slidesCacher } from '../../support/slidescacher.js';
5
5
  import { Proxies } from '../../support/proxies.js';
6
6
 
7
+ /**
8
+ * @class FakeAdvSlidesPresentationsPages
9
+ */
10
+ class FakeAdvSlidesPresentationsPages extends FakeAdvResource {
11
+ constructor(mainService) {
12
+ super(mainService, 'presentations', Syncit.fxSlides);
13
+ }
14
+
15
+
16
+ //https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations.pages/getThumbnail
17
+ getThumbnail(presentationId, pageObjectId, options) {
18
+ ScriptApp.__behavior.isAccessible(presentationId, 'Slides', 'read');
19
+ const { response, data } = this._call('getThumbnail', { presentationId, pageObjectId, ...options }, {}, 'pages');
20
+ gError(response, 'slides.presentations.pages', 'getThumbnail');
21
+ return data;
22
+ }
23
+ }
24
+
7
25
  /**
8
26
  * @class FakeAdvSlidesPresentations
9
27
  */
10
28
  class FakeAdvSlidesPresentations extends FakeAdvResource {
11
29
  constructor(mainService) {
12
30
  super(mainService, 'presentations', Syncit.fxSlides);
13
- this.slides = mainService
31
+ this.slides = mainService;
32
+ this.Pages = Proxies.guard(new FakeAdvSlidesPresentationsPages(mainService));
14
33
  }
15
34
 
16
35
  // Override 'get' to use the caching-enabled function fxSlidesGet.
@@ -19,12 +19,13 @@ import { getSlidesApiClient } from '../services/advslides/slapis.js';
19
19
  * @param {object} p.options gaxios options
20
20
  * @return {import('./sxdrive.js').SxResult} from the Slides api
21
21
  */
22
- export const sxSlides = async (Auth, { prop, method, params, options = {} }) => {
22
+ export const sxSlides = async (Auth, { subProp, prop, method, params, options = {} }) => {
23
23
 
24
24
  const apiClient = getSlidesApiClient();
25
- const tag = `sxSlides for ${prop}.${method}`;
25
+ const tag = `sxSlides for ${prop}${subProp ? '.' + subProp : ''}.${method}`;
26
26
 
27
27
  return sxRetry(Auth, tag, async () => {
28
- return apiClient[prop][method](params, options);
28
+ const callish = subProp ? apiClient[prop][subProp] : apiClient[prop];
29
+ return callish[method](params, options);
29
30
  });
30
- };
31
+ };