Skip to content

Feat/real express api integration#129

Open
priyankmodiPM wants to merge 20 commits into
render-examples:mainfrom
priyankmodiPM:feat/real-express-api-integration
Open

Feat/real express api integration#129
priyankmodiPM wants to merge 20 commits into
render-examples:mainfrom
priyankmodiPM:feat/real-express-api-integration

Conversation

@priyankmodiPM

Copy link
Copy Markdown

No description provided.

priyankmodiPM and others added 20 commits June 26, 2026 00:30
When an incoming WhatsApp message contains "update the discount", the webhook
automatically replies to the sender with the discount image via the WhatsApp
Cloud API. Phone number ID and token are read from env vars.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ant (#1)

Adds a GPT decision loop (with per-phone conversation history) that
routes inbound WhatsApp messages to campaign-graphic actions —
listing graphics, checking allowed edits, editing via Adobe Express,
and bulk generation from an uploaded file — instead of only replying
to a hardcoded "update the discount" phrase.

Co-authored-by: Priyank Modi <pmodi@adobe.com>
Co-authored-by: Priyank Modi <pmodi@adobe.com>
yarn.lock resolved every package from Adobe's internal Artifactory
(picked up via local ~/.npmrc), which Render's build servers can't
reach or validate certs for, causing "unable to get local issuer
certificate" during deploy. Regenerated against registry.npmjs.org
and dropped package-lock.json since render.yaml only runs yarn.

Co-authored-by: Priyank Modi <pmodi@adobe.com>
app.js reads process.env.OPENAI_API_KEY but the Blueprint never
declared the key, so a value set in the Render dashboard was never
wired into the service, causing "Missing credentials" at boot.
…ails

Model was hardcoded to gpt-4o while the configured Azure OpenAI resource
only has a gpt-5.4-mini deployment, causing every request to fail with a
404 "deployment does not exist" error. Reads OPENAI_MODEL/OPENAI_BASE_URL
from env instead, and logs the resolved config plus full error details on
failure to make future mismatches easy to diagnose.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs: add design spec for mocked Adobe Express image-edit flow

* docs: add implementation plan for image-edit flow

* feat: add in-memory tracked-image store

* feat: add mock Adobe Express API module

* feat: add mock Meta media upload module

* feat: extract GPT action handlers and add image-edit validation flow

* feat: wire image-edit flow into the webhook and GPT tool schema

* feat: map Croma earbuds graphic to Price/Address/Product Image/Partner Logo edits

Replaces the New Arrival Poster mock seed image with the real Croma
earbuds graphic and its allowed-edit fields.

* feat: return fixed updated Croma earbuds image for any edit

Any allowed edit on the Croma earbuds graphic now resolves to the
fixed croma1-earbuds-updated image, sent as a new WhatsApp message,
instead of a randomized mock render/upload URL.

---------

Co-authored-by: Priyank Modi <pmodi@adobe.com>
Whenever an edit is requested, always send the fixed Croma earbuds
image; whenever allowed-edits is asked, always reply with the fixed
layer list. Removes per-template edit-key validation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replaces the mocked expressApi.js/imageStore.js/metaUpload.js flow with
real tagged-documents/generate-variation/status calls against a shared
docID catalog, per the brainstorming session.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Implement expressAuth.js with getAccessToken and buildAuthHeaders functions.
Provides IMS token caching with 60s refresh margin per Adobe IMS v3 convention.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
If the catalog file parses successfully but isn't an array (e.g., `{}` or `42`),
treat it as an invalid catalog, log the error, and return empty array instead of
crashing on `.map()`. Aligns with design spec requirement to degrade gracefully
on catalog read failures.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…variation/status calls

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Use the real statusUrl returned by generateVariation instead of
  reconstructing a status URL from apiBaseUrl()+jobId, which was an
  unverified assumption about the API's URL shape.
- Overlay image.currentEdits onto tagged elements before formatting
  allowed-edits messages so previously edited fields show their latest
  value instead of the stale original document value.
- Narrow the hardcoded campaign graphics list to match the real
  single-entry catalog (Croma Earbuds).
- Guard the sendImage call in actionEditGraphic with try/catch so a
  delivery failure doesn't swallow an already-successful edit; users
  now get a "couldn't send" message instead of no reply at all.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ess/

Keeps data/ (shared catalog) and docs/ at repo root. Updates
imageStore.js's default catalog path, actions.js/actions.test.js's
expressApi import, and the app.js entry point in package.json/render.yaml
to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant