@particle-academy/google-slides-js 0.3.4 → 0.4.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 CHANGED
@@ -8,6 +8,18 @@ The four packages share one version, because they are generated from one
8
8
  `provider/` definition and a version that meant something different in each
9
9
  would be a version nobody could reason about.
10
10
 
11
+ ## [0.4.0] — 2026-10-01
12
+
13
+ ### Added
14
+
15
+ - **`presentation_get`** — read a presentation's slides and the objectId
16
+ of every element on them. No scope change. This is the prerequisite
17
+ for targeting a specific shape or placeholder with a future edit —
18
+ `presentations.batchUpdate` operates on objectIds, and until now there
19
+ was no way to discover one. `insertText`-style editing is NOT included
20
+ yet; it is a natural next step once this read side exists, not
21
+ bundled in here.
22
+
11
23
  ## [0.3.4] — 2026-09-12
12
24
 
13
25
  ### Changed
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Google Slides
2
2
 
3
+ [![Fancified](art/fancified.svg)](https://particle.academy)
4
+
3
5
  Google Slides for [fancy-flow][flow] — as **four imported, versioned packages**, one
4
6
  per runtime. Not vendored source: a copy cannot be upgraded, and third-party APIs
5
7
  change.
@@ -75,6 +77,16 @@ Create a blank Google Slides presentation.
75
77
  |---|---|---|
76
78
  | `title` | yes | The title of the new blank presentation. |
77
79
 
80
+ #### `presentation_get` — Google Slides presentation
81
+
82
+ Read a presentation's slides and the objectId of every element on them -- the prerequisite for targeting a specific shape or placeholder with a future edit.
83
+
84
+ `GET /v1/presentations/{presentationId}` · reads only — safe to replay
85
+
86
+ | Input | Required | What it is |
87
+ |---|---|---|
88
+ | `presentationId` | yes | From presentation_create's data.presentationId, or the id in the presentation's own URL. |
89
+
78
90
  ## Run it before you have credentials
79
91
 
80
92
  Every operation ships a **faker**, whether or not Google Slides has a sandbox. Set a
@@ -0,0 +1,26 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="128" height="28" role="img" aria-label="Fancified — built with Fancy UI">
2
+ <title>Fancified · built with Fancy UI</title>
3
+ <defs>
4
+ <linearGradient id="fcdBg" x1="0" y1="0" x2="1" y2="1">
5
+ <stop offset="0" stop-color="#6d28d9"/>
6
+ <stop offset=".5" stop-color="#9333ea"/>
7
+ <stop offset="1" stop-color="#d946ef"/>
8
+ </linearGradient>
9
+ <linearGradient id="fcdGloss" x1="0" y1="0" x2="0" y2="1">
10
+ <stop offset="0" stop-color="#ffffff" stop-opacity=".30"/>
11
+ <stop offset=".55" stop-color="#ffffff" stop-opacity="0"/>
12
+ </linearGradient>
13
+ <clipPath id="fcdClip"><rect width="128" height="28" rx="7"/></clipPath>
14
+ </defs>
15
+ <g clip-path="url(#fcdClip)">
16
+ <rect width="128" height="28" fill="url(#fcdBg)"/>
17
+ <rect width="34" height="28" fill="#3b0764" fill-opacity=".5"/>
18
+ <rect width="128" height="13" fill="url(#fcdGloss)"/>
19
+ <g fill="#fff">
20
+ <path transform="translate(17 14)" d="M0 -7 C.6 -2.2 2.2 -.6 7 0 C2.2 .6 .6 2.2 0 7 C-.6 2.2 -2.2 .6 -7 0 C-2.2 -.6 -.6 -2.2 0 -7 Z"/>
21
+ <path transform="translate(25.5 7.5) scale(.34)" fill-opacity=".85" d="M0 -7 C.6 -2.2 2.2 -.6 7 0 C2.2 .6 .6 2.2 0 7 C-.6 2.2 -2.2 .6 -7 0 C-2.2 -.6 -.6 -2.2 0 -7 Z"/>
22
+ </g>
23
+ <text x="81" y="18.5" fill="#ffffff" text-anchor="middle" font-family="'Segoe UI',Verdana,'DejaVu Sans',sans-serif" font-size="12" font-weight="700" letter-spacing=".3">Fancified</text>
24
+ </g>
25
+ <rect x=".5" y=".5" width="127" height="27" rx="6.5" fill="none" stroke="#ffffff" stroke-opacity=".22"/>
26
+ </svg>
@@ -7,10 +7,50 @@ function fakePresentationCreate({ config, fake }) {
7
7
  "title": config.title !== void 0 && config.title !== null && config.title !== "" ? String(config.title) : "Untitled presentation"
8
8
  };
9
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
+ }
10
48
  var googleSlidesFaker = (operation, request) => {
11
49
  switch (operation) {
12
50
  case "presentation_create":
13
51
  return fakePresentationCreate(request);
52
+ case "presentation_get":
53
+ return fakePresentationGet(request);
14
54
  default:
15
55
  throw new Error(
16
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.`
@@ -65,7 +105,29 @@ async function googleSlidesPresentationCreate(options) {
65
105
  }
66
106
  });
67
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
+ }
68
130
 
69
- export { CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, googleSlidesAuthorize, googleSlidesFaker, googleSlidesPresentationCreate };
70
- //# sourceMappingURL=chunk-3WQSJ3XH.js.map
71
- //# sourceMappingURL=chunk-3WQSJ3XH.js.map
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
@@ -0,0 +1 @@
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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AQ,YAAA,EAAa;AAAA,IACnF,GAAI,QAAQ,QAAA,KAAa,MAAA,GAAY,EAAC,GAAI,EAAE,QAAA,EAAU,OAAA,CAAQ,QAAA,EAAS;AAAA,IACvE,GAAI,QAAQ,SAAA,KAAc,MAAA,GAAY,EAAC,GAAI,EAAE,SAAA,EAAW,OAAA,CAAQ,SAAA,EAAU;AAAA,IAC1E,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,KAAA;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"]}
package/dist/flow.cjs CHANGED
@@ -12,10 +12,50 @@ function fakePresentationCreate({ config, fake }) {
12
12
  "title": config.title !== void 0 && config.title !== null && config.title !== "" ? String(config.title) : "Untitled presentation"
13
13
  };
14
14
  }
15
+ function fakePresentationGet({ config, fake }) {
16
+ return {
17
+ "presentationId": config.presentationId !== void 0 && config.presentationId !== null && config.presentationId !== "" ? String(config.presentationId) : fake.id("1Slide"),
18
+ "title": "Untitled presentation",
19
+ "locale": "en",
20
+ "slides": [
21
+ {
22
+ "objectId": fake.id("slide"),
23
+ "pageElements": [
24
+ {
25
+ "objectId": fake.id("title"),
26
+ "shape": {
27
+ "shapeType": "TEXT_BOX",
28
+ "placeholder": {
29
+ "type": "CENTERED_TITLE"
30
+ },
31
+ "text": {
32
+ "textElements": []
33
+ }
34
+ }
35
+ },
36
+ {
37
+ "objectId": fake.id("subtitle"),
38
+ "shape": {
39
+ "shapeType": "TEXT_BOX",
40
+ "placeholder": {
41
+ "type": "SUBTITLE"
42
+ },
43
+ "text": {
44
+ "textElements": []
45
+ }
46
+ }
47
+ }
48
+ ]
49
+ }
50
+ ]
51
+ };
52
+ }
15
53
  var googleSlidesFaker = (operation, request) => {
16
54
  switch (operation) {
17
55
  case "presentation_create":
18
56
  return fakePresentationCreate(request);
57
+ case "presentation_get":
58
+ return fakePresentationGet(request);
19
59
  default:
20
60
  throw new Error(
21
61
  `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.`
@@ -69,6 +109,28 @@ async function googleSlidesPresentationCreate(options) {
69
109
  }
70
110
  });
71
111
  }
112
+ var PRESENTATION_GET_OPERATION = "presentation_get";
113
+ async function googleSlidesPresentationGet(options) {
114
+ const config = options.config ?? {};
115
+ if (config.presentationId === void 0 || config.presentationId === null || config.presentationId === "") {
116
+ throw new Error(`presentation_get: "presentationId" is required (Presentation ID).`);
117
+ }
118
+ return fancyConnectorCore.callConnector(GOOGLE_SLIDES, {
119
+ operation: PRESENTATION_GET_OPERATION,
120
+ config,
121
+ input: options.input,
122
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
123
+ ...options.mode === void 0 ? {} : { mode: options.mode },
124
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
125
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
126
+ ...options.transport === void 0 ? {} : { transport: options.transport },
127
+ request: {
128
+ method: "GET",
129
+ path: `/v1/presentations/${encodeURIComponent(String(config.presentationId))}`,
130
+ query: {}
131
+ }
132
+ });
133
+ }
72
134
 
73
135
  // src/flow.ts
74
136
  var googleSlidesPresentationExecutor = async (ctx) => {
@@ -85,11 +147,27 @@ var googleSlidesPresentationExecutor = async (ctx) => {
85
147
  });
86
148
  return { __port: "out", value: result };
87
149
  };
150
+ var googleSlidesPresentationGetExecutor = async (ctx) => {
151
+ const config = ctx.node.data?.config ?? {};
152
+ const result = await googleSlidesPresentationGet({
153
+ config,
154
+ input: ctx.inputs?.in
155
+ });
156
+ ctx.emit({
157
+ type: "log",
158
+ level: "info",
159
+ nodeId: ctx.node.id,
160
+ message: `google_slides presentation_get ${result.data?.id} (${result.mode})`
161
+ });
162
+ return { __port: "out", value: result };
163
+ };
88
164
  var GOOGLE_SLIDES_RUNNABLE_KINDS = [
89
- { ...googleSlidesUi.googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor }
165
+ { ...googleSlidesUi.googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },
166
+ { ...googleSlidesUi.googleSlidesPresentationGetKind, executor: googleSlidesPresentationGetExecutor }
90
167
  ];
91
168
 
92
169
  exports.GOOGLE_SLIDES_RUNNABLE_KINDS = GOOGLE_SLIDES_RUNNABLE_KINDS;
93
170
  exports.googleSlidesPresentationExecutor = googleSlidesPresentationExecutor;
171
+ exports.googleSlidesPresentationGetExecutor = googleSlidesPresentationGetExecutor;
94
172
  //# sourceMappingURL=flow.cjs.map
95
173
  //# sourceMappingURL=flow.cjs.map
package/dist/flow.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/presentation-create.ts","../src/flow.ts"],"names":["callConnector","googleSlidesPresentationKind"],"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,M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,EAAA;AAAA,IACjB,SAAS,CAAA,kCAAA,EAAsC,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACnG,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,4BAAA,GAAqD;AAAA,EAChE,EAAE,GAAGC,2CAAA,EAA8B,QAAA,EAAU,gCAAA;AAC/C","file":"flow.cjs","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\nexport const googleSlidesFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"presentation_create\":\n return fakePresentationCreate(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/ + triggers/ 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/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Google Slides's node kinds with their TypeScript executors attached — for\n * hosts that EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/google-slides-ui carries no\n * executor: the editor is React on every host, so a PHP or Python project\n * installs the ui package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_SLIDES } from \"./service.js\";\n\nimport {\n googleSlidesPresentationKind,\n} from \"@particle-academy/google-slides-ui\";\n\nimport { googleSlidesPresentationCreate } from \"./actions/presentation-create.js\";\n\nexport const googleSlidesPresentationExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesPresentationCreate({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `google_slides presentation_create ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const GOOGLE_SLIDES_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },\n];\n"]}
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/presentation-create.ts","../src/actions/presentation-get.ts","../src/flow.ts"],"names":["callConnector","googleSlidesPresentationKind","googleSlidesPresentationGetKind"],"m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AA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,kCAAA,EAAsC,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACnG,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAEO,IAAM,mCAAA,GAAoD,OAAO,GAAA,KAAQ;AAC9E,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,2BAAA,CAA4B;AAAA,IAC/C,MAAA;AAAA,IACA,KAAA,EAAO,IAAI,MAAA,EAAQ;AAAA,GACpB,CAAA;AAED,EAAA,GAAA,CAAI,IAAA,CAAK;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,+BAAA,EAAmC,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GAChG,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,4BAAA,GAAqD;AAAA,EAChE,EAAE,GAAGC,2CAAA,EAA8B,QAAA,EAAU,gCAAA,EAAiC;AAAA,EAC9E,EAAE,GAAGC,8CAAA,EAAiC,QAAA,EAAU,mCAAA;AAClD","file":"flow.cjs","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","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ 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/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Google Slides's node kinds with their TypeScript executors attached — for\n * hosts that EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/google-slides-ui carries no\n * executor: the editor is React on every host, so a PHP or Python project\n * installs the ui package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_SLIDES } from \"./service.js\";\n\nimport {\n googleSlidesPresentationKind,\n googleSlidesPresentationGetKind,\n} from \"@particle-academy/google-slides-ui\";\n\nimport { googleSlidesPresentationCreate } from \"./actions/presentation-create.js\";\nimport { googleSlidesPresentationGet } from \"./actions/presentation-get.js\";\n\nexport const googleSlidesPresentationExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesPresentationCreate({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `google_slides presentation_create ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\nexport const googleSlidesPresentationGetExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesPresentationGet({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `google_slides presentation_get ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const GOOGLE_SLIDES_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },\n { ...googleSlidesPresentationGetKind, executor: googleSlidesPresentationGetExecutor },\n];\n"]}
package/dist/flow.d.cts CHANGED
@@ -20,7 +20,8 @@ import { NodeKindDefinition, NodeExecutor } from '@particle-academy/fancy-flow/e
20
20
  */
21
21
 
22
22
  declare const googleSlidesPresentationExecutor: NodeExecutor;
23
+ declare const googleSlidesPresentationGetExecutor: NodeExecutor;
23
24
  /** The kinds a TypeScript host registers. */
24
25
  declare const GOOGLE_SLIDES_RUNNABLE_KINDS: NodeKindDefinition[];
25
26
 
26
- export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor };
27
+ export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor };
package/dist/flow.d.ts CHANGED
@@ -20,7 +20,8 @@ import { NodeKindDefinition, NodeExecutor } from '@particle-academy/fancy-flow/e
20
20
  */
21
21
 
22
22
  declare const googleSlidesPresentationExecutor: NodeExecutor;
23
+ declare const googleSlidesPresentationGetExecutor: NodeExecutor;
23
24
  /** The kinds a TypeScript host registers. */
24
25
  declare const GOOGLE_SLIDES_RUNNABLE_KINDS: NodeKindDefinition[];
25
26
 
26
- export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor };
27
+ export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor };
package/dist/flow.js CHANGED
@@ -1,6 +1,6 @@
1
- import { googleSlidesPresentationCreate } from './chunk-3WQSJ3XH.js';
1
+ import { googleSlidesPresentationCreate, googleSlidesPresentationGet } from './chunk-4BEANSYY.js';
2
2
  import '@particle-academy/fancy-connector-core';
3
- import { googleSlidesPresentationKind } from '@particle-academy/google-slides-ui';
3
+ import { googleSlidesPresentationKind, googleSlidesPresentationGetKind } from '@particle-academy/google-slides-ui';
4
4
 
5
5
  var googleSlidesPresentationExecutor = async (ctx) => {
6
6
  const config = ctx.node.data?.config ?? {};
@@ -16,10 +16,25 @@ var googleSlidesPresentationExecutor = async (ctx) => {
16
16
  });
17
17
  return { __port: "out", value: result };
18
18
  };
19
+ var googleSlidesPresentationGetExecutor = async (ctx) => {
20
+ const config = ctx.node.data?.config ?? {};
21
+ const result = await googleSlidesPresentationGet({
22
+ config,
23
+ input: ctx.inputs?.in
24
+ });
25
+ ctx.emit({
26
+ type: "log",
27
+ level: "info",
28
+ nodeId: ctx.node.id,
29
+ message: `google_slides presentation_get ${result.data?.id} (${result.mode})`
30
+ });
31
+ return { __port: "out", value: result };
32
+ };
19
33
  var GOOGLE_SLIDES_RUNNABLE_KINDS = [
20
- { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor }
34
+ { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },
35
+ { ...googleSlidesPresentationGetKind, executor: googleSlidesPresentationGetExecutor }
21
36
  ];
22
37
 
23
- export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor };
38
+ export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor };
24
39
  //# sourceMappingURL=flow.js.map
25
40
  //# sourceMappingURL=flow.js.map
package/dist/flow.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flow.ts"],"names":[],"mappings":";;;;AAoCO,IAAM,gCAAA,GAAiD,OAAO,GAAA,KAAQ;AAC3E,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,8BAAA,CAA+B;AAAA,IAClD,MAAA;AAAA,IACA,KAAA,EAAO,IAAI,MAAA,EAAQ;AAAA,GACpB,CAAA;AAED,EAAA,GAAA,CAAI,IAAA,CAAK;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,kCAAA,EAAsC,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACnG,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,4BAAA,GAAqD;AAAA,EAChE,EAAE,GAAG,4BAAA,EAA8B,QAAA,EAAU,gCAAA;AAC/C","file":"flow.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ 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/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Google Slides's node kinds with their TypeScript executors attached — for\n * hosts that EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/google-slides-ui carries no\n * executor: the editor is React on every host, so a PHP or Python project\n * installs the ui package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_SLIDES } from \"./service.js\";\n\nimport {\n googleSlidesPresentationKind,\n} from \"@particle-academy/google-slides-ui\";\n\nimport { googleSlidesPresentationCreate } from \"./actions/presentation-create.js\";\n\nexport const googleSlidesPresentationExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesPresentationCreate({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `google_slides presentation_create ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const GOOGLE_SLIDES_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },\n];\n"]}
1
+ {"version":3,"sources":["../src/flow.ts"],"names":[],"mappings":";;;;AAsCO,IAAM,gCAAA,GAAiD,OAAO,GAAA,KAAQ;AAC3E,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,8BAAA,CAA+B;AAAA,IAClD,MAAA;AAAA,IACA,KAAA,EAAO,IAAI,MAAA,EAAQ;AAAA,GACpB,CAAA;AAED,EAAA,GAAA,CAAI,IAAA,CAAK;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,kCAAA,EAAsC,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACnG,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAEO,IAAM,mCAAA,GAAoD,OAAO,GAAA,KAAQ;AAC9E,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,2BAAA,CAA4B;AAAA,IAC/C,MAAA;AAAA,IACA,KAAA,EAAO,IAAI,MAAA,EAAQ;AAAA,GACpB,CAAA;AAED,EAAA,GAAA,CAAI,IAAA,CAAK;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,+BAAA,EAAmC,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GAChG,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,4BAAA,GAAqD;AAAA,EAChE,EAAE,GAAG,4BAAA,EAA8B,QAAA,EAAU,gCAAA,EAAiC;AAAA,EAC9E,EAAE,GAAG,+BAAA,EAAiC,QAAA,EAAU,mCAAA;AAClD","file":"flow.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ 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/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Google Slides's node kinds with their TypeScript executors attached — for\n * hosts that EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/google-slides-ui carries no\n * executor: the editor is React on every host, so a PHP or Python project\n * installs the ui package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GOOGLE_SLIDES } from \"./service.js\";\n\nimport {\n googleSlidesPresentationKind,\n googleSlidesPresentationGetKind,\n} from \"@particle-academy/google-slides-ui\";\n\nimport { googleSlidesPresentationCreate } from \"./actions/presentation-create.js\";\nimport { googleSlidesPresentationGet } from \"./actions/presentation-get.js\";\n\nexport const googleSlidesPresentationExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesPresentationCreate({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `google_slides presentation_create ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\nexport const googleSlidesPresentationGetExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesPresentationGet({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `google_slides presentation_get ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const GOOGLE_SLIDES_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },\n { ...googleSlidesPresentationGetKind, executor: googleSlidesPresentationGetExecutor },\n];\n"]}
package/dist/index.cjs CHANGED
@@ -9,10 +9,50 @@ function fakePresentationCreate({ config, fake }) {
9
9
  "title": config.title !== void 0 && config.title !== null && config.title !== "" ? String(config.title) : "Untitled presentation"
10
10
  };
11
11
  }
12
+ function fakePresentationGet({ config, fake }) {
13
+ return {
14
+ "presentationId": config.presentationId !== void 0 && config.presentationId !== null && config.presentationId !== "" ? String(config.presentationId) : fake.id("1Slide"),
15
+ "title": "Untitled presentation",
16
+ "locale": "en",
17
+ "slides": [
18
+ {
19
+ "objectId": fake.id("slide"),
20
+ "pageElements": [
21
+ {
22
+ "objectId": fake.id("title"),
23
+ "shape": {
24
+ "shapeType": "TEXT_BOX",
25
+ "placeholder": {
26
+ "type": "CENTERED_TITLE"
27
+ },
28
+ "text": {
29
+ "textElements": []
30
+ }
31
+ }
32
+ },
33
+ {
34
+ "objectId": fake.id("subtitle"),
35
+ "shape": {
36
+ "shapeType": "TEXT_BOX",
37
+ "placeholder": {
38
+ "type": "SUBTITLE"
39
+ },
40
+ "text": {
41
+ "textElements": []
42
+ }
43
+ }
44
+ }
45
+ ]
46
+ }
47
+ ]
48
+ };
49
+ }
12
50
  var googleSlidesFaker = (operation, request) => {
13
51
  switch (operation) {
14
52
  case "presentation_create":
15
53
  return fakePresentationCreate(request);
54
+ case "presentation_get":
55
+ return fakePresentationGet(request);
16
56
  default:
17
57
  throw new Error(
18
58
  `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.`
@@ -67,14 +107,38 @@ async function googleSlidesPresentationCreate(options) {
67
107
  }
68
108
  });
69
109
  }
110
+ var PRESENTATION_GET_OPERATION = "presentation_get";
111
+ async function googleSlidesPresentationGet(options) {
112
+ const config = options.config ?? {};
113
+ if (config.presentationId === void 0 || config.presentationId === null || config.presentationId === "") {
114
+ throw new Error(`presentation_get: "presentationId" is required (Presentation ID).`);
115
+ }
116
+ return fancyConnectorCore.callConnector(GOOGLE_SLIDES, {
117
+ operation: PRESENTATION_GET_OPERATION,
118
+ config,
119
+ input: options.input,
120
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
121
+ ...options.mode === void 0 ? {} : { mode: options.mode },
122
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
123
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
124
+ ...options.transport === void 0 ? {} : { transport: options.transport },
125
+ request: {
126
+ method: "GET",
127
+ path: `/v1/presentations/${encodeURIComponent(String(config.presentationId))}`,
128
+ query: {}
129
+ }
130
+ });
131
+ }
70
132
 
71
133
  exports.CONNECTOR_API_VERSION = CONNECTOR_API_VERSION;
72
134
  exports.GOOGLE_SLIDES = GOOGLE_SLIDES;
73
135
  exports.GOOGLE_SLIDES_BASE_URLS = GOOGLE_SLIDES_BASE_URLS;
74
136
  exports.GOOGLE_SLIDES_REQUIRES = GOOGLE_SLIDES_REQUIRES;
75
137
  exports.PRESENTATION_CREATE_OPERATION = PRESENTATION_CREATE_OPERATION;
138
+ exports.PRESENTATION_GET_OPERATION = PRESENTATION_GET_OPERATION;
76
139
  exports.googleSlidesAuthorize = googleSlidesAuthorize;
77
140
  exports.googleSlidesFaker = googleSlidesFaker;
78
141
  exports.googleSlidesPresentationCreate = googleSlidesPresentationCreate;
142
+ exports.googleSlidesPresentationGet = googleSlidesPresentationGet;
79
143
  //# sourceMappingURL=index.cjs.map
80
144
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/presentation-create.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;AAEO,IAAM,iBAAA,GAAoC,CAAC,SAAA,EAAW,OAAA,KAAY;AACvE,EAAA,QAAQ,SAAA;AAAW,IACjB,KAAK,qBAAA;AACH,MAAA,OAAO,uBAAuB,OAAO,CAAA;AAAA,IAEvC;AAIE,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,mDAAmD,SAAS,CAAA,iJAAA;AAAA,OAG9D;AAAA;AAEN;;;ACXO,IAAM,qBAAA,GAAwB;AAE9B,IAAM,uBAAA,GAA0B;AAAA,EACrC,MAAA,EAAQ;AACV;AAGO,IAAM,sBAAA,GAAyB;AAAA,EACpC,aAAA;AAAA,EACA,cAAA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AI,QAAQ,QAAA,KAAa,MAAA,GAAY,EAAC,GAAI,EAAE,QAAA,EAAU,OAAA,CAAQ,QAAA,EAAS;AAAA,IACvE,GAAI,QAAQ,SAAA,KAAc,MAAA,GAAY,EAAC,GAAI,EAAE,SAAA,EAAW,OAAA,CAAQ,SAAA,EAAU;AAAA,IAC1E,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,MAAA;AAAA,MACR,IAAA,EAAM,mBAAA;AAAA,MACN,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,KAAK;AAAA;AAC9B;AACF,GACD,CAAA;AACH","file":"index.cjs","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\nexport const googleSlidesFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"presentation_create\":\n return fakePresentationCreate(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"]}
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,QACE,UAAA,EAAY,IAAA,CAAK,EAAA,CAAG,OAAO,CAAA;AAAA,QAC3B,cAAA,EAAgB;AAAA,UACd;AAAA,YACE,UAAA,EAAY,IAAA,CAAK,EAAA,CAAG,OAAO,CAAA;AAAA,YAC3B,OAAA,EAAS;AAAA,cACP,WAAA,EAAa,UAAA;AAAA,cACb,aAAA,EAAe;AAAA,gBACb,MAAA,EAAQ;AAAA,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,eAAsB,4BAA4B,OAAA,EAA2D;AAC3G,EAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,MAAA,IAAU,EAAC;AAElC,EAAA,IAAI,MAAA,CAAO,mBAAmB,MAAA,IAAa,MAAA,CAAO,mBAAmB,IAAA,IAAQ,MAAA,CAAO,mBAAmB,EAAA,EAAI;AACzG,IAAA,MAAM,IAAI,MAAM,CAAA,iEAAA,CAAmE,CAAA;AAAA,EACrF;AAEA,EAAA,OAAOA,iCAAc,aAAA,EAAe;AAAA,IAClC,SAAA,EAAW,0BAAA;AAAA,IACX,MAAA;AAAA,IACA,OAAO,OAAA,CAAQ,KAAA;AAAA,IACf,GAAI,QAAQ,WAAA,KAAgB,MAAA,GAAY,EAAC,GAAI,EAAE,WAAA,EAAa,OAAA,CAAQ,WAAA,EAAY;AAAA,IAChF,GAAI,QAAQ,IAAA,KAAS,MAAA,GAAY,EAAC,GAAI,EAAE,IAAA,EAAM,OAAA,CAAQ,IAAA,EAAK;AAAA,IAC3D,GAAI,QAAQ,YAAA,KAAiB,MAAA,GAAY,EAAC,GAAI,EAAE,YAAA,EAAc,OAAA,CAAQ,YAAA,EAAa;AAAA,IACnF,GAAI,QAAQ,QAAA,KAAa,MAAA,GAAY,EAAC,GAAI,EAAE,QAAA,EAAU,OAAA,CAAQ,QAAA,EAAS;AAAA,IACvE,GAAI,QAAQ,SAAA,KAAc,MAAA,GAAY,EAAC,GAAI,EAAE,SAAA,EAAW,OAAA,CAAQ,SAAA,EAAU;AAAA,IAC1E,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,KAAA;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":"index.cjs","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"]}
package/dist/index.d.cts CHANGED
@@ -114,4 +114,42 @@ type PresentationCreateOptions = {
114
114
  };
115
115
  declare function googleSlidesPresentationCreate(options: PresentationCreateOptions): Promise<ConnectorResult>;
116
116
 
117
- export { CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, type PresentationCreateOptions, googleSlidesAuthorize, googleSlidesFaker, googleSlidesPresentationCreate };
117
+ /**
118
+ * GENERATED FILE — do not edit.
119
+ *
120
+ * Emitted from provider/actions/presentation-get.json by weaver's generator.
121
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
122
+ * being rejected, because it works until it silently does not. Fix
123
+ * provider/actions/presentation-get.json (or weaver's template/) and regenerate:
124
+ *
125
+ * npm run provider -- google_slides
126
+ */
127
+ /**
128
+ * Read a presentation's slides and the objectId of every element on them --
129
+ * the prerequisite for targeting a specific shape or placeholder with a future
130
+ * edit.
131
+ *
132
+ * GET /v1/presentations/{presentationId} —
133
+ * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/get
134
+ *
135
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
136
+ * no fake/real branch. This describes the request; callConnector resolves the
137
+ * connection, picks the estate, and either calls Google Slides or calls the
138
+ * faker.
139
+ */
140
+
141
+ declare const PRESENTATION_GET_OPERATION = "presentation_get";
142
+ type PresentationGetOptions = {
143
+ /** The node's resolved config. Keys: presentationId. */
144
+ config: Record<string, unknown>;
145
+ credentials?: Record<string, string | undefined>;
146
+ mode?: RequestedMode;
147
+ connectionId?: string | null;
148
+ input?: unknown;
149
+ attempts?: number;
150
+ /** Override the transport. The only way to exercise this without a network. */
151
+ transport?: Transport;
152
+ };
153
+ declare function googleSlidesPresentationGet(options: PresentationGetOptions): Promise<ConnectorResult>;
154
+
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 };
package/dist/index.d.ts CHANGED
@@ -114,4 +114,42 @@ type PresentationCreateOptions = {
114
114
  };
115
115
  declare function googleSlidesPresentationCreate(options: PresentationCreateOptions): Promise<ConnectorResult>;
116
116
 
117
- export { CONNECTOR_API_VERSION, GOOGLE_SLIDES, GOOGLE_SLIDES_BASE_URLS, GOOGLE_SLIDES_REQUIRES, PRESENTATION_CREATE_OPERATION, type PresentationCreateOptions, googleSlidesAuthorize, googleSlidesFaker, googleSlidesPresentationCreate };
117
+ /**
118
+ * GENERATED FILE — do not edit.
119
+ *
120
+ * Emitted from provider/actions/presentation-get.json by weaver's generator.
121
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
122
+ * being rejected, because it works until it silently does not. Fix
123
+ * provider/actions/presentation-get.json (or weaver's template/) and regenerate:
124
+ *
125
+ * npm run provider -- google_slides
126
+ */
127
+ /**
128
+ * Read a presentation's slides and the objectId of every element on them --
129
+ * the prerequisite for targeting a specific shape or placeholder with a future
130
+ * edit.
131
+ *
132
+ * GET /v1/presentations/{presentationId} —
133
+ * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/get
134
+ *
135
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
136
+ * no fake/real branch. This describes the request; callConnector resolves the
137
+ * connection, picks the estate, and either calls Google Slides or calls the
138
+ * faker.
139
+ */
140
+
141
+ declare const PRESENTATION_GET_OPERATION = "presentation_get";
142
+ type PresentationGetOptions = {
143
+ /** The node's resolved config. Keys: presentationId. */
144
+ config: Record<string, unknown>;
145
+ credentials?: Record<string, string | undefined>;
146
+ mode?: RequestedMode;
147
+ connectionId?: string | null;
148
+ input?: unknown;
149
+ attempts?: number;
150
+ /** Override the transport. The only way to exercise this without a network. */
151
+ transport?: Transport;
152
+ };
153
+ declare function googleSlidesPresentationGet(options: PresentationGetOptions): Promise<ConnectorResult>;
154
+
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 };
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, googleSlidesAuthorize, googleSlidesFaker, googleSlidesPresentationCreate } from './chunk-3WQSJ3XH.js';
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';
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.3.4",
3
+ "version": "0.4.0",
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",
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "files": [
40
40
  "dist",
41
+ "art",
41
42
  "README.md",
42
43
  "CHANGELOG.md",
43
44
  "LICENSE"
@@ -53,7 +54,7 @@
53
54
  },
54
55
  "peerDependencies": {
55
56
  "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
56
- "@particle-academy/google-slides-ui": ">=0.3.0 <0.4.0"
57
+ "@particle-academy/google-slides-ui": ">=0.4.0 <0.5.0"
57
58
  },
58
59
  "peerDependenciesMeta": {
59
60
  "@particle-academy/fancy-flow": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/presentation-create.ts"],"names":[],"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;AAEO,IAAM,iBAAA,GAAoC,CAAC,SAAA,EAAW,OAAA,KAAY;AACvE,EAAA,QAAQ,SAAA;AAAW,IACjB,KAAK,qBAAA;AACH,MAAA,OAAO,uBAAuB,OAAO,CAAA;AAAA,IAEvC;AAIE,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,mDAAmD,SAAS,CAAA,iJAAA;AAAA,OAG9D;AAAA;AAEN;;;ACXO,IAAM,qBAAA,GAAwB;AAE9B,IAAM,uBAAA,GAA0B;AAAA,EACrC,MAAA,EAAQ;AACV;AAGO,IAAM,sBAAA,GAAyB;AAAA,EACpC,aAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF;AAWO,SAAS,qBAAA,CACd,WAAA,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AAA,CAAQ,QAAA,EAAS;AAAA,IACvE,GAAI,QAAQ,SAAA,KAAc,MAAA,GAAY,EAAC,GAAI,EAAE,SAAA,EAAW,OAAA,CAAQ,SAAA,EAAU;AAAA,IAC1E,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,MAAA;AAAA,MACR,IAAA,EAAM,mBAAA;AAAA,MACN,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,KAAK;AAAA;AAC9B;AACF,GACD,CAAA;AACH","file":"chunk-3WQSJ3XH.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\nexport const googleSlidesFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"presentation_create\":\n return fakePresentationCreate(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"]}