@particle-academy/google-slides-js 0.6.0 → 0.7.1

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/index.d.cts CHANGED
@@ -76,6 +76,45 @@ declare const GOOGLE_SLIDES: ServiceDescriptor;
76
76
 
77
77
  declare const googleSlidesFaker: ConnectorFaker;
78
78
 
79
+ /**
80
+ * GENERATED FILE — do not edit.
81
+ *
82
+ * Emitted from provider/actions/batch-update.json by weaver's generator.
83
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
84
+ * being rejected, because it works until it silently does not. Fix
85
+ * provider/actions/batch-update.json (or weaver's template/) and regenerate:
86
+ *
87
+ * npm run provider -- google_slides
88
+ */
89
+ /**
90
+ * Apply a list of Google Slides presentation API requests to a presentation,
91
+ * all or none.
92
+ *
93
+ * POST /v1/presentations/{presentationId}:batchUpdate —
94
+ * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate
95
+ *
96
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
97
+ * no fake/real branch. This describes the request; callConnector resolves the
98
+ * connection, picks the estate, and either calls Google Slides or calls the
99
+ * faker.
100
+ *
101
+ * sideEffects: unsafe-to-replay.
102
+ */
103
+
104
+ declare const BATCH_UPDATE_OPERATION = "batch_update";
105
+ type BatchUpdateOptions = {
106
+ /** The node's resolved config. Keys: presentationId, requests, requiredRevisionId. */
107
+ config: Record<string, unknown>;
108
+ credentials?: Record<string, string | undefined>;
109
+ mode?: RequestedMode;
110
+ connectionId?: string | null;
111
+ input?: unknown;
112
+ attempts?: number;
113
+ /** Override the transport. The only way to exercise this without a network. */
114
+ transport?: Transport;
115
+ };
116
+ declare function googleSlidesBatchUpdate(options: BatchUpdateOptions): Promise<ConnectorResult>;
117
+
79
118
  /**
80
119
  * GENERATED FILE — do not edit.
81
120
  *
@@ -152,4 +191,42 @@ type PresentationGetOptions = {
152
191
  };
153
192
  declare function googleSlidesPresentationGet(options: PresentationGetOptions): Promise<ConnectorResult>;
154
193
 
155
- export { CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, PRESENTATION_GET_OPERATION, type PresentationCreateOptions, type PresentationGetOptions, googleSlidesAuthorize, googleSlidesFaker, googleSlidesPresentationCreate, googleSlidesPresentationGet };
194
+ /**
195
+ * GENERATED FILE — do not edit.
196
+ *
197
+ * Emitted from provider/actions/text-replace.json by weaver's generator.
198
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
199
+ * being rejected, because it works until it silently does not. Fix
200
+ * provider/actions/text-replace.json (or weaver's template/) and regenerate:
201
+ *
202
+ * npm run provider -- google_slides
203
+ */
204
+ /**
205
+ * Replace every occurrence of a string in a presentation.
206
+ *
207
+ * POST /v1/presentations/{presentationId}:batchUpdate —
208
+ * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate
209
+ *
210
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
211
+ * no fake/real branch. This describes the request; callConnector resolves the
212
+ * connection, picks the estate, and either calls Google Slides or calls the
213
+ * faker.
214
+ *
215
+ * sideEffects: unsafe-to-replay.
216
+ */
217
+
218
+ declare const TEXT_REPLACE_OPERATION = "text_replace";
219
+ type TextReplaceOptions = {
220
+ /** The node's resolved config. Keys: presentationId, find, replaceWith, matchCase, pageObjectIds, requiredRevisionId. */
221
+ config: Record<string, unknown>;
222
+ credentials?: Record<string, string | undefined>;
223
+ mode?: RequestedMode;
224
+ connectionId?: string | null;
225
+ input?: unknown;
226
+ attempts?: number;
227
+ /** Override the transport. The only way to exercise this without a network. */
228
+ transport?: Transport;
229
+ };
230
+ declare function googleSlidesTextReplace(options: TextReplaceOptions): Promise<ConnectorResult>;
231
+
232
+ export { BATCH_UPDATE_OPERATION, type BatchUpdateOptions, CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, PRESENTATION_GET_OPERATION, type PresentationCreateOptions, type PresentationGetOptions, TEXT_REPLACE_OPERATION, type TextReplaceOptions, googleSlidesAuthorize, googleSlidesBatchUpdate, googleSlidesFaker, googleSlidesPresentationCreate, googleSlidesPresentationGet, googleSlidesTextReplace };
package/dist/index.d.ts CHANGED
@@ -76,6 +76,45 @@ declare const GOOGLE_SLIDES: ServiceDescriptor;
76
76
 
77
77
  declare const googleSlidesFaker: ConnectorFaker;
78
78
 
79
+ /**
80
+ * GENERATED FILE — do not edit.
81
+ *
82
+ * Emitted from provider/actions/batch-update.json by weaver's generator.
83
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
84
+ * being rejected, because it works until it silently does not. Fix
85
+ * provider/actions/batch-update.json (or weaver's template/) and regenerate:
86
+ *
87
+ * npm run provider -- google_slides
88
+ */
89
+ /**
90
+ * Apply a list of Google Slides presentation API requests to a presentation,
91
+ * all or none.
92
+ *
93
+ * POST /v1/presentations/{presentationId}:batchUpdate —
94
+ * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate
95
+ *
96
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
97
+ * no fake/real branch. This describes the request; callConnector resolves the
98
+ * connection, picks the estate, and either calls Google Slides or calls the
99
+ * faker.
100
+ *
101
+ * sideEffects: unsafe-to-replay.
102
+ */
103
+
104
+ declare const BATCH_UPDATE_OPERATION = "batch_update";
105
+ type BatchUpdateOptions = {
106
+ /** The node's resolved config. Keys: presentationId, requests, requiredRevisionId. */
107
+ config: Record<string, unknown>;
108
+ credentials?: Record<string, string | undefined>;
109
+ mode?: RequestedMode;
110
+ connectionId?: string | null;
111
+ input?: unknown;
112
+ attempts?: number;
113
+ /** Override the transport. The only way to exercise this without a network. */
114
+ transport?: Transport;
115
+ };
116
+ declare function googleSlidesBatchUpdate(options: BatchUpdateOptions): Promise<ConnectorResult>;
117
+
79
118
  /**
80
119
  * GENERATED FILE — do not edit.
81
120
  *
@@ -152,4 +191,42 @@ type PresentationGetOptions = {
152
191
  };
153
192
  declare function googleSlidesPresentationGet(options: PresentationGetOptions): Promise<ConnectorResult>;
154
193
 
155
- export { CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, PRESENTATION_GET_OPERATION, type PresentationCreateOptions, type PresentationGetOptions, googleSlidesAuthorize, googleSlidesFaker, googleSlidesPresentationCreate, googleSlidesPresentationGet };
194
+ /**
195
+ * GENERATED FILE — do not edit.
196
+ *
197
+ * Emitted from provider/actions/text-replace.json by weaver's generator.
198
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
199
+ * being rejected, because it works until it silently does not. Fix
200
+ * provider/actions/text-replace.json (or weaver's template/) and regenerate:
201
+ *
202
+ * npm run provider -- google_slides
203
+ */
204
+ /**
205
+ * Replace every occurrence of a string in a presentation.
206
+ *
207
+ * POST /v1/presentations/{presentationId}:batchUpdate —
208
+ * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate
209
+ *
210
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
211
+ * no fake/real branch. This describes the request; callConnector resolves the
212
+ * connection, picks the estate, and either calls Google Slides or calls the
213
+ * faker.
214
+ *
215
+ * sideEffects: unsafe-to-replay.
216
+ */
217
+
218
+ declare const TEXT_REPLACE_OPERATION = "text_replace";
219
+ type TextReplaceOptions = {
220
+ /** The node's resolved config. Keys: presentationId, find, replaceWith, matchCase, pageObjectIds, requiredRevisionId. */
221
+ config: Record<string, unknown>;
222
+ credentials?: Record<string, string | undefined>;
223
+ mode?: RequestedMode;
224
+ connectionId?: string | null;
225
+ input?: unknown;
226
+ attempts?: number;
227
+ /** Override the transport. The only way to exercise this without a network. */
228
+ transport?: Transport;
229
+ };
230
+ declare function googleSlidesTextReplace(options: TextReplaceOptions): Promise<ConnectorResult>;
231
+
232
+ export { BATCH_UPDATE_OPERATION, type BatchUpdateOptions, CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, PRESENTATION_GET_OPERATION, type PresentationCreateOptions, type PresentationGetOptions, TEXT_REPLACE_OPERATION, type TextReplaceOptions, googleSlidesAuthorize, googleSlidesBatchUpdate, googleSlidesFaker, googleSlidesPresentationCreate, googleSlidesPresentationGet, googleSlidesTextReplace };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, PRESENTATION_GET_OPERATION, googleSlidesAuthorize, googleSlidesFaker, googleSlidesPresentationCreate, googleSlidesPresentationGet } from './chunk-4BEANSYY.js';
1
+ export { BATCH_UPDATE_OPERATION, CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, PRESENTATION_GET_OPERATION, TEXT_REPLACE_OPERATION, googleSlidesAuthorize, googleSlidesBatchUpdate, googleSlidesFaker, googleSlidesPresentationCreate, googleSlidesPresentationGet, googleSlidesTextReplace } from './chunk-435KWWAB.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-academy/google-slides-js",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Google Slides for Node — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP on @particle-academy/fancy-connector-core; no vendor SDK.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
57
- "@particle-academy/google-slides-ui": ">=0.6.0 <0.7.0"
57
+ "@particle-academy/google-slides-ui": ">=0.7.0 <0.8.0"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@particle-academy/fancy-flow": {
@@ -1,133 +0,0 @@
1
- import { callConnector } from '@particle-academy/fancy-connector-core';
2
-
3
- // src/faker.ts
4
- function fakePresentationCreate({ config, fake }) {
5
- return {
6
- "presentationId": fake.id("1Slide"),
7
- "title": config.title !== void 0 && config.title !== null && config.title !== "" ? String(config.title) : "Untitled presentation"
8
- };
9
- }
10
- function fakePresentationGet({ config, fake }) {
11
- return {
12
- "presentationId": config.presentationId !== void 0 && config.presentationId !== null && config.presentationId !== "" ? String(config.presentationId) : fake.id("1Slide"),
13
- "title": "Untitled presentation",
14
- "locale": "en",
15
- "slides": [
16
- {
17
- "objectId": fake.id("slide"),
18
- "pageElements": [
19
- {
20
- "objectId": fake.id("title"),
21
- "shape": {
22
- "shapeType": "TEXT_BOX",
23
- "placeholder": {
24
- "type": "CENTERED_TITLE"
25
- },
26
- "text": {
27
- "textElements": []
28
- }
29
- }
30
- },
31
- {
32
- "objectId": fake.id("subtitle"),
33
- "shape": {
34
- "shapeType": "TEXT_BOX",
35
- "placeholder": {
36
- "type": "SUBTITLE"
37
- },
38
- "text": {
39
- "textElements": []
40
- }
41
- }
42
- }
43
- ]
44
- }
45
- ]
46
- };
47
- }
48
- var googleSlidesFaker = (operation, request) => {
49
- switch (operation) {
50
- case "presentation_create":
51
- return fakePresentationCreate(request);
52
- case "presentation_get":
53
- return fakePresentationGet(request);
54
- default:
55
- throw new Error(
56
- `google_slides: no fake response is defined for "${operation}". Add a fixture under provider/fixtures/ and regenerate \u2014 a connector without a faker cannot be developed against, tested, or demonstrated.`
57
- );
58
- }
59
- };
60
-
61
- // src/service.ts
62
- var CONNECTOR_API_VERSION = 1;
63
- var GOOGLE_SLIDES_BASE_URLS = {
64
- "live": "https://slides.googleapis.com"
65
- };
66
- var GOOGLE_SLIDES_REQUIRES = [
67
- "accessToken",
68
- "refreshToken",
69
- "clientId",
70
- "clientSecret"
71
- ];
72
- function googleSlidesAuthorize(credentials, request, _mode) {
73
- request.headers.Authorization = `Bearer ${credentials.accessToken ?? ""}`;
74
- }
75
- var GOOGLE_SLIDES = {
76
- service: "google_slides",
77
- title: "Google Slides",
78
- sandbox: "none",
79
- baseUrls: { ...GOOGLE_SLIDES_BASE_URLS },
80
- requires: [...GOOGLE_SLIDES_REQUIRES],
81
- authorize: googleSlidesAuthorize,
82
- faker: googleSlidesFaker
83
- };
84
- var PRESENTATION_CREATE_OPERATION = "presentation_create";
85
- async function googleSlidesPresentationCreate(options) {
86
- const config = options.config ?? {};
87
- if (config.title === void 0 || config.title === null || config.title === "") {
88
- throw new Error(`presentation_create: "title" is required (Title).`);
89
- }
90
- return callConnector(GOOGLE_SLIDES, {
91
- operation: PRESENTATION_CREATE_OPERATION,
92
- config,
93
- input: options.input,
94
- ...options.credentials === void 0 ? {} : { credentials: options.credentials },
95
- ...options.mode === void 0 ? {} : { mode: options.mode },
96
- ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
97
- ...options.attempts === void 0 ? {} : { attempts: options.attempts },
98
- ...options.transport === void 0 ? {} : { transport: options.transport },
99
- request: {
100
- method: "POST",
101
- path: "/v1/presentations",
102
- json: {
103
- "title": String(config.title)
104
- }
105
- }
106
- });
107
- }
108
- var PRESENTATION_GET_OPERATION = "presentation_get";
109
- async function googleSlidesPresentationGet(options) {
110
- const config = options.config ?? {};
111
- if (config.presentationId === void 0 || config.presentationId === null || config.presentationId === "") {
112
- throw new Error(`presentation_get: "presentationId" is required (Presentation ID).`);
113
- }
114
- return callConnector(GOOGLE_SLIDES, {
115
- operation: PRESENTATION_GET_OPERATION,
116
- config,
117
- input: options.input,
118
- ...options.credentials === void 0 ? {} : { credentials: options.credentials },
119
- ...options.mode === void 0 ? {} : { mode: options.mode },
120
- ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
121
- ...options.attempts === void 0 ? {} : { attempts: options.attempts },
122
- ...options.transport === void 0 ? {} : { transport: options.transport },
123
- request: {
124
- method: "GET",
125
- path: `/v1/presentations/${encodeURIComponent(String(config.presentationId))}`,
126
- query: {}
127
- }
128
- });
129
- }
130
-
131
- export { CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, PRESENTATION_GET_OPERATION, googleSlidesAuthorize, googleSlidesFaker, googleSlidesPresentationCreate, googleSlidesPresentationGet };
132
- //# sourceMappingURL=chunk-4BEANSYY.js.map
133
- //# sourceMappingURL=chunk-4BEANSYY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/presentation-create.ts","../src/actions/presentation-get.ts"],"names":["callConnector"],"mappings":";;;AA0BA,SAAS,sBAAA,CAAuB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AACtE,EAAA,OAAO;AAAA,IACL,gBAAA,EAAkB,IAAA,CAAK,EAAA,CAAG,QAAQ,CAAA;AAAA,IAClC,OAAA,EAAU,MAAA,CAAO,KAAA,KAAU,MAAA,IAAa,MAAA,CAAO,KAAA,KAAU,IAAA,IAAQ,MAAA,CAAO,KAAA,KAAU,EAAA,GAAK,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA,GAAI;AAAA,GAChH;AACF;AAEA,SAAS,mBAAA,CAAoB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AACnE,EAAA,OAAO;AAAA,IACL,kBAAmB,MAAA,CAAO,cAAA,KAAmB,MAAA,IAAa,MAAA,CAAO,mBAAmB,IAAA,IAAQ,MAAA,CAAO,cAAA,KAAmB,EAAA,GAAK,OAAO,MAAA,CAAO,cAAc,CAAA,GAAI,IAAA,CAAK,GAAG,QAAQ,CAAA;AAAA,IAC3K,OAAA,EAAS,uBAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,QAAA,EAAU;AAAA,MACR;AAAA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AAA;AAAA,MACR,MAAM,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,OAAO,MAAA,CAAO,cAAc,CAAC,CAAC,CAAA,CAAA;AAAA,MAC5E,OAAO;AAAC;AACV,GACD,CAAA;AACH","file":"chunk-4BEANSYY.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/fixtures/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/fixtures/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * The Google Slides faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Google Slides actually publishes, so an author can wire {{\n * $json.data.id }} against a fake and have it keep working against the real\n * thing.\n *\n * Deterministic — same inputs, same output. A faker returning a fresh uuid\n * every call cannot be asserted on, so its fixtures degrade to \"it did not\n * throw\", which is the assertion that catches nothing.\n */\n\nimport type { ConnectorFaker, FakeRequest } from \"@particle-academy/fancy-connector-core\";\n\nfunction fakePresentationCreate({ config, fake }: FakeRequest): unknown {\n return {\n \"presentationId\": fake.id(\"1Slide\"),\n \"title\": (config.title !== undefined && config.title !== null && config.title !== \"\" ? String(config.title) : \"Untitled presentation\"),\n };\n}\n\nfunction fakePresentationGet({ config, fake }: FakeRequest): unknown {\n return {\n \"presentationId\": (config.presentationId !== undefined && config.presentationId !== null && config.presentationId !== \"\" ? String(config.presentationId) : fake.id(\"1Slide\")),\n \"title\": \"Untitled presentation\",\n \"locale\": \"en\",\n \"slides\": [\n {\n \"objectId\": fake.id(\"slide\"),\n \"pageElements\": [\n {\n \"objectId\": fake.id(\"title\"),\n \"shape\": {\n \"shapeType\": \"TEXT_BOX\",\n \"placeholder\": {\n \"type\": \"CENTERED_TITLE\",\n },\n \"text\": {\n \"textElements\": [],\n },\n },\n },\n {\n \"objectId\": fake.id(\"subtitle\"),\n \"shape\": {\n \"shapeType\": \"TEXT_BOX\",\n \"placeholder\": {\n \"type\": \"SUBTITLE\",\n },\n \"text\": {\n \"textElements\": [],\n },\n },\n },\n ],\n },\n ],\n };\n}\n\nexport const googleSlidesFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"presentation_create\":\n return fakePresentationCreate(request);\n\n case \"presentation_get\":\n return fakePresentationGet(request);\n\n default:\n // A faker asked for an operation it has no shape for must SAY so. Making\n // something up would produce a green run whose output silently has none\n // of the fields the author is about to reference.\n throw new Error(\n `google_slides: no fake response is defined for \"${operation}\". ` +\n \"Add a fixture under provider/fixtures/ and regenerate — a connector without a faker \" +\n \"cannot be developed against, tested, or demonstrated.\",\n );\n }\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Google Slides, as one service descriptor shared by every Google Slides\n * operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Google Slides: its base URL, its\n * auth scheme, its idempotency header, and its faker.\n *\n * ## The sandbox trap, written down where it is used\n *\n * Google has no sandbox for Slides. A test presentation is a real one in a\n * real Drive, so every create is real -- use the faker while developing and\n * clean up any live test presentations.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { googleSlidesFaker } from \"./faker.js\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported. An imported constant lets an upgrade rewrite the\n * very claim it exists to detect, after which the copy agrees with itself\n * forever.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\nexport const GOOGLE_SLIDES_BASE_URLS = {\n \"live\": \"https://slides.googleapis.com\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const GOOGLE_SLIDES_REQUIRES = [\n \"accessToken\",\n \"refreshToken\",\n \"clientId\",\n \"clientSecret\"\n] as const;\n\n/**\n * Apply Google Slides's auth scheme to an outgoing request.\n *\n *\n *\n * The mode is passed in because for some providers auth and estate are the\n * same decision expressed in the URL; here it is unused, and saying so is\n * cheaper than wondering later whether it was forgotten.\n */\nexport function googleSlidesAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers.Authorization = `Bearer ${credentials.accessToken ?? \"\"}`;\n}\n\n/** The Google Slides service, for the TypeScript runtime. */\nexport const GOOGLE_SLIDES: ServiceDescriptor = {\n service: \"google_slides\",\n title: \"Google Slides\",\n sandbox: \"none\",\n baseUrls: { ...GOOGLE_SLIDES_BASE_URLS },\n requires: [...GOOGLE_SLIDES_REQUIRES],\n authorize: googleSlidesAuthorize,\n faker: googleSlidesFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/presentation-create.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/presentation-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Create a blank Google Slides presentation.\n *\n * POST /v1/presentations —\n * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/create\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Google Slides or calls the\n * faker.\n *\n * sideEffects: unsafe-to-replay.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_SLIDES } from \"../service.js\";\n\nexport const PRESENTATION_CREATE_OPERATION = \"presentation_create\";\n\nexport type PresentationCreateOptions = {\n /** The node's resolved config. Keys: title. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function googleSlidesPresentationCreate(options: PresentationCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.title === undefined || config.title === null || config.title === \"\") {\n throw new Error(`presentation_create: \"title\" is required (Title).`);\n }\n\n return callConnector(GOOGLE_SLIDES, {\n operation: PRESENTATION_CREATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/v1/presentations\",\n json: {\n \"title\": String(config.title),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/presentation-get.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/presentation-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Read a presentation's slides and the objectId of every element on them --\n * the prerequisite for targeting a specific shape or placeholder with a future\n * edit.\n *\n * GET /v1/presentations/{presentationId} —\n * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/get\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Google Slides or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_SLIDES } from \"../service.js\";\n\nexport const PRESENTATION_GET_OPERATION = \"presentation_get\";\n\nexport type PresentationGetOptions = {\n /** The node's resolved config. Keys: presentationId. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function googleSlidesPresentationGet(options: PresentationGetOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.presentationId === undefined || config.presentationId === null || config.presentationId === \"\") {\n throw new Error(`presentation_get: \"presentationId\" is required (Presentation ID).`);\n }\n\n return callConnector(GOOGLE_SLIDES, {\n operation: PRESENTATION_GET_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/v1/presentations/${encodeURIComponent(String(config.presentationId))}`,\n query: {},\n },\n });\n}\n"]}