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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/flow.cjs.map CHANGED
@@ -1 +1 @@
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"],"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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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"]}
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/batch-update.ts","../src/actions/presentation-create.ts","../src/actions/presentation-get.ts","../src/actions/text-replace.ts","../src/flow.ts"],"names":["callConnector","nestFields","googleSlidesBatchUpdateKind","googleSlidesPresentationKind","googleSlidesPresentationGetKind","googleSlidesTextReplaceKind"],"mappings":";;;;;;;;AA0BA,SAAS,eAAA,CAAgB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAC/D,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,SAAA,EAAW;AAAA,MACT;AAAC,KACH;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,oBAAA,EAAsB,IAAA,CAA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B,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,2BAAA,EAA+B,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GAC5F,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,4BAAA,GAAqD;AAAA,EAChE,EAAE,GAAGC,0CAAA,EAA6B,QAAA,EAAU,+BAAA,EAAgC;AAAA,EAC5E,EAAE,GAAGC,2CAAA,EAA8B,QAAA,EAAU,gCAAA,EAAiC;AAAA,EAC9E,EAAE,GAAGC,8CAAA,EAAiC,QAAA,EAAU,mCAAA,EAAoC;AAAA,EACpF,EAAE,GAAGC,0CAAA,EAA6B,QAAA,EAAU,+BAAA;AAC9C","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 fakeBatchUpdate({ config, fake }: FakeRequest): unknown {\n return {\n \"presentationId\": (config.presentationId !== undefined && config.presentationId !== null && config.presentationId !== \"\" ? String(config.presentationId) : fake.id(\"1Slide\")),\n \"replies\": [\n {},\n ],\n \"writeControl\": {\n \"requiredRevisionId\": fake.hex(16),\n },\n };\n}\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\nfunction fakeTextReplace({ config, fake }: FakeRequest): unknown {\n return {\n \"presentationId\": (config.presentationId !== undefined && config.presentationId !== null && config.presentationId !== \"\" ? String(config.presentationId) : fake.id(\"1Slide\")),\n \"replies\": [\n {\n \"replaceAllText\": {\n \"occurrencesChanged\": fake.int(1, 9),\n },\n },\n ],\n \"writeControl\": {\n \"requiredRevisionId\": fake.hex(16),\n },\n };\n}\n\nexport const googleSlidesFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"batch_update\":\n return fakeBatchUpdate(request);\n\n case \"presentation_create\":\n return fakePresentationCreate(request);\n\n case \"presentation_get\":\n return fakePresentationGet(request);\n\n case \"text_replace\":\n return fakeTextReplace(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/batch-update.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/batch-update.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Apply a list of Google Slides presentation API requests to a presentation,\n * all or none.\n *\n * POST /v1/presentations/{presentationId}:batchUpdate —\n * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate\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 BATCH_UPDATE_OPERATION = \"batch_update\";\n\nexport type BatchUpdateOptions = {\n /** The node's resolved config. Keys: presentationId, requests, requiredRevisionId. */\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 googleSlidesBatchUpdate(options: BatchUpdateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.presentationId === undefined || config.presentationId === null || config.presentationId === \"\") {\n throw new Error(`batch_update: \"presentationId\" is required (Presentation ID).`);\n }\n\n if (config.requests === undefined || config.requests === null || config.requests === \"\") {\n throw new Error(`batch_update: \"requests\" is required (Requests).`);\n }\n if (typeof config.requests === \"string\" && config.requests !== \"\") {\n try {\n JSON.parse(config.requests);\n } catch (error) {\n throw new Error(`batch_update: \"requests\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n return callConnector(GOOGLE_SLIDES, {\n operation: BATCH_UPDATE_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/${encodeURIComponent(String(config.presentationId))}:batchUpdate`,\n json: nestFields({\n ...(config.requests !== undefined && config.requests !== null && config.requests !== \"\" ? { \"requests\": typeof config.requests === \"string\" ? JSON.parse(config.requests) : config.requests } : {}),\n ...(config.requiredRevisionId !== undefined && config.requiredRevisionId !== null && config.requiredRevisionId !== \"\" ? { \"writeControl.requiredRevisionId\": String(config.requiredRevisionId) } : {}),\n }),\n },\n });\n}\n\n/**\n * `{\"properties.email\": x}` -> `{properties: {email: x}}`.\n *\n * A dotted `as` means NESTING, and only a JSON body can nest. The validator\n * refuses that spelling anywhere else, because in a form body it already means\n * something different — a literal dotted key.\n */\nfunction nestFields(flat: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split(\".\");\n let node = out;\n\n while (parts.length > 1) {\n const key = parts.shift() as string;\n // A NUMERIC segment is an array index: `dateRanges.0.startDate` has to\n // become `[{startDate}]`, not `{\"0\": {startDate}}`. PHP produced the\n // array by accident (its integer-keyed arrays serialise as JSON lists)\n // and the other two produced an object, which the provider rejects as\n // the wrong type. The parity suite is what caught the disagreement.\n const wantsArray = /^\\d+$/.test(parts[0] ?? \"\");\n\n if (typeof node[key] !== \"object\" || node[key] === null) node[key] = wantsArray ? [] : {};\n node = node[key] as Record<string, unknown>;\n }\n\n node[parts[0] as string] = value;\n }\n\n return out;\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/text-replace.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/text-replace.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Replace every occurrence of a string in a presentation.\n *\n * POST /v1/presentations/{presentationId}:batchUpdate —\n * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate\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 TEXT_REPLACE_OPERATION = \"text_replace\";\n\nexport type TextReplaceOptions = {\n /** The node's resolved config. Keys: presentationId, find, replaceWith, matchCase, pageObjectIds, requiredRevisionId. */\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 googleSlidesTextReplace(options: TextReplaceOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.presentationId === undefined || config.presentationId === null || config.presentationId === \"\") {\n throw new Error(`text_replace: \"presentationId\" is required (Presentation ID).`);\n }\n\n if (config.find === undefined || config.find === null || config.find === \"\") {\n throw new Error(`text_replace: \"find\" is required (Find).`);\n }\n\n if (config.replaceWith === undefined || config.replaceWith === null || config.replaceWith === \"\") {\n throw new Error(`text_replace: \"replaceWith\" is required (Replace with).`);\n }\n\n return callConnector(GOOGLE_SLIDES, {\n operation: TEXT_REPLACE_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/${encodeURIComponent(String(config.presentationId))}:batchUpdate`,\n json: nestFields({\n \"requests.0.replaceAllText.containsText.text\": String(config.find),\n \"requests.0.replaceAllText.replaceText\": String(config.replaceWith),\n ...(config.matchCase !== undefined && config.matchCase !== null && config.matchCase !== \"\" ? { \"requests.0.replaceAllText.containsText.matchCase\": Boolean(config.matchCase) } : {}),\n ...(config.pageObjectIds !== undefined && config.pageObjectIds !== null && config.pageObjectIds !== \"\" ? { \"requests.0.replaceAllText.pageObjectIds\": requests0ReplacealltextPageobjectidsList(config.pageObjectIds) } : {}),\n ...(config.requiredRevisionId !== undefined && config.requiredRevisionId !== null && config.requiredRevisionId !== \"\" ? { \"writeControl.requiredRevisionId\": String(config.requiredRevisionId) } : {}),\n }),\n },\n });\n}\n\n/**\n * `{\"properties.email\": x}` -> `{properties: {email: x}}`.\n *\n * A dotted `as` means NESTING, and only a JSON body can nest. The validator\n * refuses that spelling anywhere else, because in a form body it already means\n * something different — a literal dotted key.\n */\nfunction nestFields(flat: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split(\".\");\n let node = out;\n\n while (parts.length > 1) {\n const key = parts.shift() as string;\n // A NUMERIC segment is an array index: `dateRanges.0.startDate` has to\n // become `[{startDate}]`, not `{\"0\": {startDate}}`. PHP produced the\n // array by accident (its integer-keyed arrays serialise as JSON lists)\n // and the other two produced an object, which the provider rejects as\n // the wrong type. The parity suite is what caught the disagreement.\n const wantsArray = /^\\d+$/.test(parts[0] ?? \"\");\n\n if (typeof node[key] !== \"object\" || node[key] === null) node[key] = wantsArray ? [] : {};\n node = node[key] as Record<string, unknown>;\n }\n\n node[parts[0] as string] = value;\n }\n\n return out;\n}\n\n/** One value, a \",\"-separated string, or an array — all end up a list. */\nfunction requests0ReplacealltextPageobjectidsList(value: unknown): string[] {\n const items = Array.isArray(value)\n ? value.map(String)\n : typeof value === \"string\"\n ? value.split(\",\")\n : [];\n\n return items.map((item) => item.trim()).filter(Boolean);\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 googleSlidesBatchUpdateKind,\n googleSlidesPresentationKind,\n googleSlidesPresentationGetKind,\n googleSlidesTextReplaceKind,\n} from \"@particle-academy/google-slides-ui\";\n\nimport { googleSlidesBatchUpdate } from \"./actions/batch-update.js\";\nimport { googleSlidesPresentationCreate } from \"./actions/presentation-create.js\";\nimport { googleSlidesPresentationGet } from \"./actions/presentation-get.js\";\nimport { googleSlidesTextReplace } from \"./actions/text-replace.js\";\n\nexport const googleSlidesBatchUpdateExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesBatchUpdate({\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 batch_update ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\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\nexport const googleSlidesTextReplaceExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesTextReplace({\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 text_replace ${(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 { ...googleSlidesBatchUpdateKind, executor: googleSlidesBatchUpdateExecutor },\n { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },\n { ...googleSlidesPresentationGetKind, executor: googleSlidesPresentationGetExecutor },\n { ...googleSlidesTextReplaceKind, executor: googleSlidesTextReplaceExecutor },\n];\n"]}
package/dist/flow.d.cts CHANGED
@@ -19,9 +19,11 @@ import { NodeKindDefinition, NodeExecutor } from '@particle-academy/fancy-flow/e
19
19
  * installs the ui package and never this one.
20
20
  */
21
21
 
22
+ declare const googleSlidesBatchUpdateExecutor: NodeExecutor;
22
23
  declare const googleSlidesPresentationExecutor: NodeExecutor;
23
24
  declare const googleSlidesPresentationGetExecutor: NodeExecutor;
25
+ declare const googleSlidesTextReplaceExecutor: NodeExecutor;
24
26
  /** The kinds a TypeScript host registers. */
25
27
  declare const GOOGLE_SLIDES_RUNNABLE_KINDS: NodeKindDefinition[];
26
28
 
27
- export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor };
29
+ export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesBatchUpdateExecutor, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor, googleSlidesTextReplaceExecutor };
package/dist/flow.d.ts CHANGED
@@ -19,9 +19,11 @@ import { NodeKindDefinition, NodeExecutor } from '@particle-academy/fancy-flow/e
19
19
  * installs the ui package and never this one.
20
20
  */
21
21
 
22
+ declare const googleSlidesBatchUpdateExecutor: NodeExecutor;
22
23
  declare const googleSlidesPresentationExecutor: NodeExecutor;
23
24
  declare const googleSlidesPresentationGetExecutor: NodeExecutor;
25
+ declare const googleSlidesTextReplaceExecutor: NodeExecutor;
24
26
  /** The kinds a TypeScript host registers. */
25
27
  declare const GOOGLE_SLIDES_RUNNABLE_KINDS: NodeKindDefinition[];
26
28
 
27
- export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor };
29
+ export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesBatchUpdateExecutor, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor, googleSlidesTextReplaceExecutor };
package/dist/flow.js CHANGED
@@ -1,7 +1,21 @@
1
- import { googleSlidesPresentationCreate, googleSlidesPresentationGet } from './chunk-4BEANSYY.js';
1
+ import { googleSlidesBatchUpdate, googleSlidesPresentationCreate, googleSlidesPresentationGet, googleSlidesTextReplace } from './chunk-435KWWAB.js';
2
2
  import '@particle-academy/fancy-connector-core';
3
- import { googleSlidesPresentationKind, googleSlidesPresentationGetKind } from '@particle-academy/google-slides-ui';
3
+ import { googleSlidesBatchUpdateKind, googleSlidesPresentationKind, googleSlidesPresentationGetKind, googleSlidesTextReplaceKind } from '@particle-academy/google-slides-ui';
4
4
 
5
+ var googleSlidesBatchUpdateExecutor = async (ctx) => {
6
+ const config = ctx.node.data?.config ?? {};
7
+ const result = await googleSlidesBatchUpdate({
8
+ config,
9
+ input: ctx.inputs?.in
10
+ });
11
+ ctx.emit({
12
+ type: "log",
13
+ level: "info",
14
+ nodeId: ctx.node.id,
15
+ message: `google_slides batch_update ${result.data?.id} (${result.mode})`
16
+ });
17
+ return { __port: "out", value: result };
18
+ };
5
19
  var googleSlidesPresentationExecutor = async (ctx) => {
6
20
  const config = ctx.node.data?.config ?? {};
7
21
  const result = await googleSlidesPresentationCreate({
@@ -30,11 +44,27 @@ var googleSlidesPresentationGetExecutor = async (ctx) => {
30
44
  });
31
45
  return { __port: "out", value: result };
32
46
  };
47
+ var googleSlidesTextReplaceExecutor = async (ctx) => {
48
+ const config = ctx.node.data?.config ?? {};
49
+ const result = await googleSlidesTextReplace({
50
+ config,
51
+ input: ctx.inputs?.in
52
+ });
53
+ ctx.emit({
54
+ type: "log",
55
+ level: "info",
56
+ nodeId: ctx.node.id,
57
+ message: `google_slides text_replace ${result.data?.id} (${result.mode})`
58
+ });
59
+ return { __port: "out", value: result };
60
+ };
33
61
  var GOOGLE_SLIDES_RUNNABLE_KINDS = [
62
+ { ...googleSlidesBatchUpdateKind, executor: googleSlidesBatchUpdateExecutor },
34
63
  { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },
35
- { ...googleSlidesPresentationGetKind, executor: googleSlidesPresentationGetExecutor }
64
+ { ...googleSlidesPresentationGetKind, executor: googleSlidesPresentationGetExecutor },
65
+ { ...googleSlidesTextReplaceKind, executor: googleSlidesTextReplaceExecutor }
36
66
  ];
37
67
 
38
- export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor };
68
+ export { GOOGLE_SLIDES_RUNNABLE_KINDS, googleSlidesBatchUpdateExecutor, googleSlidesPresentationExecutor, googleSlidesPresentationGetExecutor, googleSlidesTextReplaceExecutor };
39
69
  //# sourceMappingURL=flow.js.map
40
70
  //# sourceMappingURL=flow.js.map
package/dist/flow.js.map CHANGED
@@ -1 +1 @@
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"]}
1
+ {"version":3,"sources":["../src/flow.ts"],"names":[],"mappings":";;;;AA0CO,IAAM,+BAAA,GAAgD,OAAO,GAAA,KAAQ;AAC1E,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,uBAAA,CAAwB;AAAA,IAC3C,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,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AAK,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;AAEO,IAAM,+BAAA,GAAgD,OAAO,GAAA,KAAQ;AAC1E,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,uBAAA,CAAwB;AAAA,IAC3C,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,2BAAA,EAA+B,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GAC5F,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,4BAAA,GAAqD;AAAA,EAChE,EAAE,GAAG,2BAAA,EAA6B,QAAA,EAAU,+BAAA,EAAgC;AAAA,EAC5E,EAAE,GAAG,4BAAA,EAA8B,QAAA,EAAU,gCAAA,EAAiC;AAAA,EAC9E,EAAE,GAAG,+BAAA,EAAiC,QAAA,EAAU,mCAAA,EAAoC;AAAA,EACpF,EAAE,GAAG,2BAAA,EAA6B,QAAA,EAAU,+BAAA;AAC9C","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 googleSlidesBatchUpdateKind,\n googleSlidesPresentationKind,\n googleSlidesPresentationGetKind,\n googleSlidesTextReplaceKind,\n} from \"@particle-academy/google-slides-ui\";\n\nimport { googleSlidesBatchUpdate } from \"./actions/batch-update.js\";\nimport { googleSlidesPresentationCreate } from \"./actions/presentation-create.js\";\nimport { googleSlidesPresentationGet } from \"./actions/presentation-get.js\";\nimport { googleSlidesTextReplace } from \"./actions/text-replace.js\";\n\nexport const googleSlidesBatchUpdateExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesBatchUpdate({\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 batch_update ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\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\nexport const googleSlidesTextReplaceExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await googleSlidesTextReplace({\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 text_replace ${(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 { ...googleSlidesBatchUpdateKind, executor: googleSlidesBatchUpdateExecutor },\n { ...googleSlidesPresentationKind, executor: googleSlidesPresentationExecutor },\n { ...googleSlidesPresentationGetKind, executor: googleSlidesPresentationGetExecutor },\n { ...googleSlidesTextReplaceKind, executor: googleSlidesTextReplaceExecutor },\n];\n"]}
package/dist/index.cjs CHANGED
@@ -3,6 +3,17 @@
3
3
  var fancyConnectorCore = require('@particle-academy/fancy-connector-core');
4
4
 
5
5
  // src/faker.ts
6
+ function fakeBatchUpdate({ config, fake }) {
7
+ return {
8
+ "presentationId": config.presentationId !== void 0 && config.presentationId !== null && config.presentationId !== "" ? String(config.presentationId) : fake.id("1Slide"),
9
+ "replies": [
10
+ {}
11
+ ],
12
+ "writeControl": {
13
+ "requiredRevisionId": fake.hex(16)
14
+ }
15
+ };
16
+ }
6
17
  function fakePresentationCreate({ config, fake }) {
7
18
  return {
8
19
  "presentationId": fake.id("1Slide"),
@@ -47,12 +58,31 @@ function fakePresentationGet({ config, fake }) {
47
58
  ]
48
59
  };
49
60
  }
61
+ function fakeTextReplace({ config, fake }) {
62
+ return {
63
+ "presentationId": config.presentationId !== void 0 && config.presentationId !== null && config.presentationId !== "" ? String(config.presentationId) : fake.id("1Slide"),
64
+ "replies": [
65
+ {
66
+ "replaceAllText": {
67
+ "occurrencesChanged": fake.int(1, 9)
68
+ }
69
+ }
70
+ ],
71
+ "writeControl": {
72
+ "requiredRevisionId": fake.hex(16)
73
+ }
74
+ };
75
+ }
50
76
  var googleSlidesFaker = (operation, request) => {
51
77
  switch (operation) {
78
+ case "batch_update":
79
+ return fakeBatchUpdate(request);
52
80
  case "presentation_create":
53
81
  return fakePresentationCreate(request);
54
82
  case "presentation_get":
55
83
  return fakePresentationGet(request);
84
+ case "text_replace":
85
+ return fakeTextReplace(request);
56
86
  default:
57
87
  throw new Error(
58
88
  `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.`
@@ -83,6 +113,56 @@ var GOOGLE_SLIDES = {
83
113
  authorize: googleSlidesAuthorize,
84
114
  faker: googleSlidesFaker
85
115
  };
116
+ var BATCH_UPDATE_OPERATION = "batch_update";
117
+ async function googleSlidesBatchUpdate(options) {
118
+ const config = options.config ?? {};
119
+ if (config.presentationId === void 0 || config.presentationId === null || config.presentationId === "") {
120
+ throw new Error(`batch_update: "presentationId" is required (Presentation ID).`);
121
+ }
122
+ if (config.requests === void 0 || config.requests === null || config.requests === "") {
123
+ throw new Error(`batch_update: "requests" is required (Requests).`);
124
+ }
125
+ if (typeof config.requests === "string" && config.requests !== "") {
126
+ try {
127
+ JSON.parse(config.requests);
128
+ } catch (error) {
129
+ throw new Error(`batch_update: "requests" must be JSON: ${error.message}`);
130
+ }
131
+ }
132
+ return fancyConnectorCore.callConnector(GOOGLE_SLIDES, {
133
+ operation: BATCH_UPDATE_OPERATION,
134
+ config,
135
+ input: options.input,
136
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
137
+ ...options.mode === void 0 ? {} : { mode: options.mode },
138
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
139
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
140
+ ...options.transport === void 0 ? {} : { transport: options.transport },
141
+ request: {
142
+ method: "POST",
143
+ path: `/v1/presentations/${encodeURIComponent(String(config.presentationId))}:batchUpdate`,
144
+ json: nestFields({
145
+ ...config.requests !== void 0 && config.requests !== null && config.requests !== "" ? { "requests": typeof config.requests === "string" ? JSON.parse(config.requests) : config.requests } : {},
146
+ ...config.requiredRevisionId !== void 0 && config.requiredRevisionId !== null && config.requiredRevisionId !== "" ? { "writeControl.requiredRevisionId": String(config.requiredRevisionId) } : {}
147
+ })
148
+ }
149
+ });
150
+ }
151
+ function nestFields(flat) {
152
+ const out = {};
153
+ for (const [path, value] of Object.entries(flat)) {
154
+ const parts = path.split(".");
155
+ let node = out;
156
+ while (parts.length > 1) {
157
+ const key = parts.shift();
158
+ const wantsArray = /^\d+$/.test(parts[0] ?? "");
159
+ if (typeof node[key] !== "object" || node[key] === null) node[key] = wantsArray ? [] : {};
160
+ node = node[key];
161
+ }
162
+ node[parts[0]] = value;
163
+ }
164
+ return out;
165
+ }
86
166
  var PRESENTATION_CREATE_OPERATION = "presentation_create";
87
167
  async function googleSlidesPresentationCreate(options) {
88
168
  const config = options.config ?? {};
@@ -129,16 +209,73 @@ async function googleSlidesPresentationGet(options) {
129
209
  }
130
210
  });
131
211
  }
212
+ var TEXT_REPLACE_OPERATION = "text_replace";
213
+ async function googleSlidesTextReplace(options) {
214
+ const config = options.config ?? {};
215
+ if (config.presentationId === void 0 || config.presentationId === null || config.presentationId === "") {
216
+ throw new Error(`text_replace: "presentationId" is required (Presentation ID).`);
217
+ }
218
+ if (config.find === void 0 || config.find === null || config.find === "") {
219
+ throw new Error(`text_replace: "find" is required (Find).`);
220
+ }
221
+ if (config.replaceWith === void 0 || config.replaceWith === null || config.replaceWith === "") {
222
+ throw new Error(`text_replace: "replaceWith" is required (Replace with).`);
223
+ }
224
+ return fancyConnectorCore.callConnector(GOOGLE_SLIDES, {
225
+ operation: TEXT_REPLACE_OPERATION,
226
+ config,
227
+ input: options.input,
228
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
229
+ ...options.mode === void 0 ? {} : { mode: options.mode },
230
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
231
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
232
+ ...options.transport === void 0 ? {} : { transport: options.transport },
233
+ request: {
234
+ method: "POST",
235
+ path: `/v1/presentations/${encodeURIComponent(String(config.presentationId))}:batchUpdate`,
236
+ json: nestFields2({
237
+ "requests.0.replaceAllText.containsText.text": String(config.find),
238
+ "requests.0.replaceAllText.replaceText": String(config.replaceWith),
239
+ ...config.matchCase !== void 0 && config.matchCase !== null && config.matchCase !== "" ? { "requests.0.replaceAllText.containsText.matchCase": Boolean(config.matchCase) } : {},
240
+ ...config.pageObjectIds !== void 0 && config.pageObjectIds !== null && config.pageObjectIds !== "" ? { "requests.0.replaceAllText.pageObjectIds": requests0ReplacealltextPageobjectidsList(config.pageObjectIds) } : {},
241
+ ...config.requiredRevisionId !== void 0 && config.requiredRevisionId !== null && config.requiredRevisionId !== "" ? { "writeControl.requiredRevisionId": String(config.requiredRevisionId) } : {}
242
+ })
243
+ }
244
+ });
245
+ }
246
+ function nestFields2(flat) {
247
+ const out = {};
248
+ for (const [path, value] of Object.entries(flat)) {
249
+ const parts = path.split(".");
250
+ let node = out;
251
+ while (parts.length > 1) {
252
+ const key = parts.shift();
253
+ const wantsArray = /^\d+$/.test(parts[0] ?? "");
254
+ if (typeof node[key] !== "object" || node[key] === null) node[key] = wantsArray ? [] : {};
255
+ node = node[key];
256
+ }
257
+ node[parts[0]] = value;
258
+ }
259
+ return out;
260
+ }
261
+ function requests0ReplacealltextPageobjectidsList(value) {
262
+ const items = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(",") : [];
263
+ return items.map((item) => item.trim()).filter(Boolean);
264
+ }
132
265
 
266
+ exports.BATCH_UPDATE_OPERATION = BATCH_UPDATE_OPERATION;
133
267
  exports.CONNECTOR_API_VERSION = CONNECTOR_API_VERSION;
134
268
  exports.GOOGLE_SLIDES = GOOGLE_SLIDES;
135
269
  exports.GOOGLE_SLIDES_BASE_URLS = GOOGLE_SLIDES_BASE_URLS;
136
270
  exports.GOOGLE_SLIDES_REQUIRES = GOOGLE_SLIDES_REQUIRES;
137
271
  exports.PRESENTATION_CREATE_OPERATION = PRESENTATION_CREATE_OPERATION;
138
272
  exports.PRESENTATION_GET_OPERATION = PRESENTATION_GET_OPERATION;
273
+ exports.TEXT_REPLACE_OPERATION = TEXT_REPLACE_OPERATION;
139
274
  exports.googleSlidesAuthorize = googleSlidesAuthorize;
275
+ exports.googleSlidesBatchUpdate = googleSlidesBatchUpdate;
140
276
  exports.googleSlidesFaker = googleSlidesFaker;
141
277
  exports.googleSlidesPresentationCreate = googleSlidesPresentationCreate;
142
278
  exports.googleSlidesPresentationGet = googleSlidesPresentationGet;
279
+ exports.googleSlidesTextReplace = googleSlidesTextReplace;
143
280
  //# sourceMappingURL=index.cjs.map
144
281
  //# sourceMappingURL=index.cjs.map
@@ -1 +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;A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AAQ,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"]}
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/batch-update.ts","../src/actions/presentation-create.ts","../src/actions/presentation-get.ts","../src/actions/text-replace.ts"],"names":["callConnector","nestFields"],"mappings":";;;;;AA0BA,SAAS,eAAA,CAAgB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAC/D,EAAA,OAAO;AAAA,IACL,kBAAmB,MAAA,CAAO,cAAA,KAAmB,MAAA,IAAa,MAAA,CAAO,mBAAmB,IAAA,IAAQ,MAAA,CAAO,cAAA,KAAm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AM,YAAY,IAAA,CAAK,GAAG,CAAA,KAAM,IAAA,OAAW,GAAG,CAAA,GAAI,UAAA,GAAa,KAAK,EAAC;AACxF,MAAA,IAAA,GAAO,KAAK,GAAG,CAAA;AAAA,IACjB;AAEA,IAAA,IAAA,CAAK,KAAA,CAAM,CAAC,CAAW,CAAA,GAAI,KAAA;AAAA,EAC7B;AAEA,EAAA,OAAO,GAAA;AACT;AAGA,SAAS,yCAAyC,KAAA,EAA0B;AAC1E,EAAA,MAAM,QAAQ,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAC7B,MAAM,GAAA,CAAI,MAAM,CAAA,GAChB,OAAO,UAAU,QAAA,GACf,KAAA,CAAM,KAAA,CAAM,GAAG,IACf,EAAC;AAEP,EAAA,OAAO,KAAA,CAAM,IAAI,CAAC,IAAA,KAAS,KAAK,IAAA,EAAM,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA;AACxD","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 fakeBatchUpdate({ config, fake }: FakeRequest): unknown {\n return {\n \"presentationId\": (config.presentationId !== undefined && config.presentationId !== null && config.presentationId !== \"\" ? String(config.presentationId) : fake.id(\"1Slide\")),\n \"replies\": [\n {},\n ],\n \"writeControl\": {\n \"requiredRevisionId\": fake.hex(16),\n },\n };\n}\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\nfunction fakeTextReplace({ config, fake }: FakeRequest): unknown {\n return {\n \"presentationId\": (config.presentationId !== undefined && config.presentationId !== null && config.presentationId !== \"\" ? String(config.presentationId) : fake.id(\"1Slide\")),\n \"replies\": [\n {\n \"replaceAllText\": {\n \"occurrencesChanged\": fake.int(1, 9),\n },\n },\n ],\n \"writeControl\": {\n \"requiredRevisionId\": fake.hex(16),\n },\n };\n}\n\nexport const googleSlidesFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"batch_update\":\n return fakeBatchUpdate(request);\n\n case \"presentation_create\":\n return fakePresentationCreate(request);\n\n case \"presentation_get\":\n return fakePresentationGet(request);\n\n case \"text_replace\":\n return fakeTextReplace(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/batch-update.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/batch-update.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Apply a list of Google Slides presentation API requests to a presentation,\n * all or none.\n *\n * POST /v1/presentations/{presentationId}:batchUpdate —\n * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate\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 BATCH_UPDATE_OPERATION = \"batch_update\";\n\nexport type BatchUpdateOptions = {\n /** The node's resolved config. Keys: presentationId, requests, requiredRevisionId. */\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 googleSlidesBatchUpdate(options: BatchUpdateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.presentationId === undefined || config.presentationId === null || config.presentationId === \"\") {\n throw new Error(`batch_update: \"presentationId\" is required (Presentation ID).`);\n }\n\n if (config.requests === undefined || config.requests === null || config.requests === \"\") {\n throw new Error(`batch_update: \"requests\" is required (Requests).`);\n }\n if (typeof config.requests === \"string\" && config.requests !== \"\") {\n try {\n JSON.parse(config.requests);\n } catch (error) {\n throw new Error(`batch_update: \"requests\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n return callConnector(GOOGLE_SLIDES, {\n operation: BATCH_UPDATE_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/${encodeURIComponent(String(config.presentationId))}:batchUpdate`,\n json: nestFields({\n ...(config.requests !== undefined && config.requests !== null && config.requests !== \"\" ? { \"requests\": typeof config.requests === \"string\" ? JSON.parse(config.requests) : config.requests } : {}),\n ...(config.requiredRevisionId !== undefined && config.requiredRevisionId !== null && config.requiredRevisionId !== \"\" ? { \"writeControl.requiredRevisionId\": String(config.requiredRevisionId) } : {}),\n }),\n },\n });\n}\n\n/**\n * `{\"properties.email\": x}` -> `{properties: {email: x}}`.\n *\n * A dotted `as` means NESTING, and only a JSON body can nest. The validator\n * refuses that spelling anywhere else, because in a form body it already means\n * something different — a literal dotted key.\n */\nfunction nestFields(flat: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split(\".\");\n let node = out;\n\n while (parts.length > 1) {\n const key = parts.shift() as string;\n // A NUMERIC segment is an array index: `dateRanges.0.startDate` has to\n // become `[{startDate}]`, not `{\"0\": {startDate}}`. PHP produced the\n // array by accident (its integer-keyed arrays serialise as JSON lists)\n // and the other two produced an object, which the provider rejects as\n // the wrong type. The parity suite is what caught the disagreement.\n const wantsArray = /^\\d+$/.test(parts[0] ?? \"\");\n\n if (typeof node[key] !== \"object\" || node[key] === null) node[key] = wantsArray ? [] : {};\n node = node[key] as Record<string, unknown>;\n }\n\n node[parts[0] as string] = value;\n }\n\n return out;\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/text-replace.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/text-replace.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_slides\n */\n\n/**\n * Replace every occurrence of a string in a presentation.\n *\n * POST /v1/presentations/{presentationId}:batchUpdate —\n * https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/batchUpdate\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 TEXT_REPLACE_OPERATION = \"text_replace\";\n\nexport type TextReplaceOptions = {\n /** The node's resolved config. Keys: presentationId, find, replaceWith, matchCase, pageObjectIds, requiredRevisionId. */\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 googleSlidesTextReplace(options: TextReplaceOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.presentationId === undefined || config.presentationId === null || config.presentationId === \"\") {\n throw new Error(`text_replace: \"presentationId\" is required (Presentation ID).`);\n }\n\n if (config.find === undefined || config.find === null || config.find === \"\") {\n throw new Error(`text_replace: \"find\" is required (Find).`);\n }\n\n if (config.replaceWith === undefined || config.replaceWith === null || config.replaceWith === \"\") {\n throw new Error(`text_replace: \"replaceWith\" is required (Replace with).`);\n }\n\n return callConnector(GOOGLE_SLIDES, {\n operation: TEXT_REPLACE_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/${encodeURIComponent(String(config.presentationId))}:batchUpdate`,\n json: nestFields({\n \"requests.0.replaceAllText.containsText.text\": String(config.find),\n \"requests.0.replaceAllText.replaceText\": String(config.replaceWith),\n ...(config.matchCase !== undefined && config.matchCase !== null && config.matchCase !== \"\" ? { \"requests.0.replaceAllText.containsText.matchCase\": Boolean(config.matchCase) } : {}),\n ...(config.pageObjectIds !== undefined && config.pageObjectIds !== null && config.pageObjectIds !== \"\" ? { \"requests.0.replaceAllText.pageObjectIds\": requests0ReplacealltextPageobjectidsList(config.pageObjectIds) } : {}),\n ...(config.requiredRevisionId !== undefined && config.requiredRevisionId !== null && config.requiredRevisionId !== \"\" ? { \"writeControl.requiredRevisionId\": String(config.requiredRevisionId) } : {}),\n }),\n },\n });\n}\n\n/**\n * `{\"properties.email\": x}` -> `{properties: {email: x}}`.\n *\n * A dotted `as` means NESTING, and only a JSON body can nest. The validator\n * refuses that spelling anywhere else, because in a form body it already means\n * something different — a literal dotted key.\n */\nfunction nestFields(flat: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split(\".\");\n let node = out;\n\n while (parts.length > 1) {\n const key = parts.shift() as string;\n // A NUMERIC segment is an array index: `dateRanges.0.startDate` has to\n // become `[{startDate}]`, not `{\"0\": {startDate}}`. PHP produced the\n // array by accident (its integer-keyed arrays serialise as JSON lists)\n // and the other two produced an object, which the provider rejects as\n // the wrong type. The parity suite is what caught the disagreement.\n const wantsArray = /^\\d+$/.test(parts[0] ?? \"\");\n\n if (typeof node[key] !== \"object\" || node[key] === null) node[key] = wantsArray ? [] : {};\n node = node[key] as Record<string, unknown>;\n }\n\n node[parts[0] as string] = value;\n }\n\n return out;\n}\n\n/** One value, a \",\"-separated string, or an array — all end up a list. */\nfunction requests0ReplacealltextPageobjectidsList(value: unknown): string[] {\n const items = Array.isArray(value)\n ? value.map(String)\n : typeof value === \"string\"\n ? value.split(\",\")\n : [];\n\n return items.map((item) => item.trim()).filter(Boolean);\n}\n"]}