[{"data":1,"prerenderedAt":5780},["ShallowReactive",2],{"docs-navigation":3,"content-query-rt8ijQdFn0":315},[4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,258,261,264,267,270,273,276,279,282,285,288,291,294,297,300,303,306,309,312],{"_path":5,"title":6},"/docs/account/account-management","Account management",{"_path":8,"title":9},"/docs/account/mfa","Multi-factor authentication (MFA)",{"_path":11,"title":12},"/docs/account/team","Teams and sub-accounts",{"_path":14,"title":15},"/docs/account/billing-and-subscriptions","Billing & subscriptions",{"_path":17,"title":18},"/docs/account/access-tokens","Webhook Relay access tokens: permissions and subscription scopes",{"_path":20,"title":21},"/docs/clawhub","Webhook Relay on ClawHub",{"_path":23,"title":24},"/docs/email","Receive emails as webhooks",{"_path":26,"title":27},"/docs/email/payload","Email webhook payload",{"_path":29,"title":30},"/docs/email/filtering-and-policy","Sender filtering & policy",{"_path":32,"title":33},"/docs/email/cli","Create & poll email addresses from the CLI",{"_path":35,"title":36},"/docs","Getting Started",{"_path":38,"title":39},"/docs/installation/cli","CLI",{"_path":41,"title":42},"/docs/installation/docker","Docker container",{"_path":44,"title":45},"/docs/installation/docker-compose","Docker Compose",{"_path":47,"title":48},"/docs/installation/kubernetes","Kubernetes",{"_path":50,"title":51},"/docs/installation/autostart-windows","Autostart (Windows)",{"_path":53,"title":54},"/docs/installation/autostart-linux","Autostart (Linux)",{"_path":56,"title":57},"/docs/installation/autostart-macos","Autostart (MacOS)",{"_path":59,"title":60},"/docs/installation/behind-proxy","HTTP proxy configuration",{"_path":62,"title":63},"/docs/mcp","MCP Server",{"_path":65,"title":66},"/docs/outbound","Outbound Gateway: send webhooks to your customers",{"_path":68,"title":69},"/docs/outbound/setup","Set up the Outbound Gateway",{"_path":71,"title":72},"/docs/outbound/receiving","Receive and verify outbound webhooks",{"_path":74,"title":75},"/docs/outbound/operating","Monitor, retry and recover deliveries",{"_path":77,"title":78},"/docs/security","Security & Tech",{"_path":80,"title":81},"/docs/service-connections","Service Connections",{"_path":83,"title":84},"/docs/service-connections/ai-providers","AI provider connections",{"_path":86,"title":87},"/docs/service-connections/aws_s3","AWS S3",{"_path":89,"title":90},"/docs/service-connections/aws_sns","AWS SNS",{"_path":92,"title":93},"/docs/service-connections/aws_sqs","AWS SQS",{"_path":95,"title":96},"/docs/service-connections/azure","Azure",{"_path":98,"title":99},"/docs/service-connections/gcp_gcs","GCP Cloud Storage",{"_path":101,"title":102},"/docs/service-connections/gcp_pubsub","GCP Pub/Sub",{"_path":104,"title":105},"/docs/service-connections/secrets","Secrets",{"_path":107,"title":108},"/docs/skills","Agent Skills",{"_path":110,"title":111},"/docs/skills-cli","skills.sh — the Agent Skills CLI",{"_path":113,"title":114},"/docs/tunnels/demoing-your-website","Demoing your website",{"_path":116,"title":117},"/docs/tunnels/regions","Regions",{"_path":119,"title":120},"/docs/tutorials/cicd/jenkins-bitbucket","Jenkins and Bitbucket",{"_path":122,"title":123},"/docs/tutorials/cicd/jenkins-github","Jenkins and GitHub",{"_path":125,"title":126},"/docs/tutorials/cicd/jenkins-plugin","Jenkins Plugin",{"_path":128,"title":129},"/docs/tutorials/cicd/jenkins-plugin-multibranch","Jenkins Multibranch Pipelines",{"_path":131,"title":132},"/docs/tutorials/cicd/kubernetes-operator","Kubernetes Operator",{"_path":134,"title":135},"/docs/tutorials/cicd/terraform-atlantis","Terraform Atlantis",{"_path":137,"title":138},"/docs/tutorials/cicd/webhook-exec","Execute scripts on webhook",{"_path":140,"title":141},"/docs/tutorials/edge/home-assistant","Home Assistant",{"_path":143,"title":144},"/docs/tutorials/edge/javascript-app","JavaScript app",{"_path":146,"title":147},"/docs/tutorials/edge/node-red","Node-RED",{"_path":149,"title":150},"/docs/tutorials/email/airtable","Email to Airtable",{"_path":152,"title":153},"/docs/tutorials/email/api","Email to API",{"_path":155,"title":156},"/docs/tutorials/email/database","Email to Database",{"_path":158,"title":159},"/docs/tutorials/email/discord","Email to Discord",{"_path":161,"title":162},"/docs/tutorials/email/google-sheets","Email to Google Sheets",{"_path":164,"title":165},"/docs/tutorials/email/microsoft-teams","Email to Microsoft Teams",{"_path":167,"title":168},"/docs/tutorials/email/notion","Email to Notion",{"_path":170,"title":171},"/docs/tutorials/email/slack","Email to Slack",{"_path":173,"title":174},"/docs/tutorials","Tutorials",{"_path":176,"title":177},"/docs/tutorials/n8n/email-trigger","n8n Email Trigger (Inbound Email)",{"_path":179,"title":180},"/docs/tutorials/n8n/webhook-trigger","n8n Webhook Trigger (No Public IP)",{"_path":182,"title":183},"/docs/tutorials/n8n/whatsapp-cloud-api-webhook","n8n WhatsApp Cloud API Webhook Setup",{"_path":185,"title":186},"/docs/tutorials/transform/docker-to-slack","DockerHub webhook to Slack notification",{"_path":188,"title":189},"/docs/tutorials/transform/enrich-webhooks","Enrich webhooks from APIs",{"_path":191,"title":192},"/docs/tutorials/transform/stripe-to-plain","Sync Stripe subscriptions to Plain.com tenants",{"_path":194,"title":195},"/docs/tutorials/warehouse/bigquery","GCP BigQuery",{"_path":197,"title":198},"/docs/webhooks/alerts","Alerts",{"_path":200,"title":201},"/docs/webhooks/auth/username-password","Username and password",{"_path":203,"title":204},"/docs/webhooks/auth/hmac","HMAC",{"_path":206,"title":207},"/docs/webhooks/auth/jwt","JWT authentication",{"_path":209,"title":210},"/docs/webhooks/auth/http-method","Auth using request method",{"_path":212,"title":213},"/docs/webhooks/cors","CORS for webhooks",{"_path":215,"title":216},"/docs/webhooks/cron/using-cron-webhooks","Schedule recurring webhooks",{"_path":218,"title":219},"/docs/webhooks/custom-domains","Custom webhook domains",{"_path":221,"title":222},"/docs/webhooks/custom-subdomains","Custom webhook subdomains",{"_path":224,"title":225},"/docs/webhooks/custom-webhook-response","Custom response to webhooks",{"_path":227,"title":228},"/docs/webhooks/durable-webhooks","Durable webhooks: reliable delivery with automatic retries",{"_path":230,"title":231},"/docs/webhooks/functions/manipulating-json","JSON encoding",{"_path":233,"title":234},"/docs/webhooks/functions/make-http-request","Make HTTP request",{"_path":236,"title":237},"/docs/webhooks/functions/modify-request","Modify webhook headers, body, method and path",{"_path":239,"title":240},"/docs/webhooks/functions/multipart-form-data","Multipart form to JSON",{"_path":242,"title":243},"/docs/webhooks/functions/url-encoded-data","URL Encoded Form",{"_path":245,"title":246},"/docs/webhooks/functions/working-with-time","Working with time",{"_path":248,"title":249},"/docs/webhooks/functions/send-emails","Sending emails",{"_path":251,"title":252},"/docs/webhooks/functions/crypto-functions","Base64, encryption",{"_path":254,"title":255},"/docs/webhooks/functions/integrate-into-cicd","Integrating into CI/CD",{"_path":257,"title":195},"/docs/webhooks/functions/big-query",{"_path":259,"title":260},"/docs/webhooks/functions/accessing-metadata","Accessing metadata",{"_path":262,"title":263},"/docs/webhooks/functions/response-functions","Response (post-delivery) functions",{"_path":265,"title":266},"/docs/webhooks/functions/alerting","Alerting from functions",{"_path":268,"title":269},"/docs/webhooks/functions/helper-libraries","Helper libraries",{"_path":271,"title":272},"/docs/webhooks/functions/transform-webhook-payload","Transform a webhook payload",{"_path":274,"title":275},"/docs/webhooks/functions/filter-webhooks","Filter or drop webhooks before forwarding",{"_path":277,"title":278},"/docs/webhooks/functions/provider-helpers","Provider-aware function helpers",{"_path":280,"title":281},"/docs/webhooks/functions","Webhook transformations (functions): modify body, headers, method and path",{"_path":283,"title":284},"/docs/webhooks/internal/localhost","Receive webhooks on localhost with the relay CLI",{"_path":286,"title":287},"/docs/webhooks/large-webhooks","Large Webhooks",{"_path":289,"title":290},"/docs/webhooks/outbound-throttling","Outbound throttling: control webhook delivery speed",{"_path":292,"title":293},"/docs/webhooks/polling-webhooks","Polling webhooks with /v1/events",{"_path":295,"title":296},"/docs/webhooks/public/public-destination","Forward to public URL",{"_path":298,"title":299},"/docs/webhooks/public/multiple-destination-urls","Forward webhooks to multiple destinations",{"_path":301,"title":302},"/docs/webhooks/replay-on-agent-connect","Webhook replay on agent connect: recover missed webhooks",{"_path":304,"title":305},"/docs/webhooks/static-ip-address","Static IP Address",{"_path":307,"title":308},"/docs/webhooks/tls-ssl-errors","Fix TLS/SSL handshake errors: unsupported protocol, wrong version number, handshake failure",{"_path":310,"title":311},"/docs/webhooks/websocket-server","Connecting to websocket server",{"_path":313,"title":314},"/docs/webhooks/zero-retention-buckets","Zero Retention Buckets",{"_path":191,"_dir":316,"_draft":317,"_partial":317,"_locale":318,"title":192,"description":319,"intro":320,"type":321,"layout":322,"tags":323,"faq":327,"body":340,"_type":5773,"_id":5774,"_source":5775,"_file":5776,"_stem":5777,"_extension":5778,"sitemap":5779},"transform",false,"","Keep Plain.com customers, tenants and tenant tiers in sync with Stripe subscription state using a single Webhook Relay function: verify the Stripe signature, map subscription events to Plain GraphQL mutations and answer Stripe — no server, no Cloudflare Worker.","Sync Stripe subscription state into Plain.com tenants with one Webhook Relay function — signature verification, customer upserts and tier updates included, nothing to deploy.","tutorial","doc",[324,325,326],"Functions","Stripe","Webhook Forwarding",[328,331,334,337],{"q":329,"a":330},"Do I need a destination output for this to work?","No. The function is attached to the bucket's input and calls the Plain GraphQL API directly with http.request, then answers Stripe itself with r.stopForwarding(). The bucket needs no output destinations; every request is still logged and replayable.",{"q":332,"a":333},"Which Stripe subscription statuses count as paid?","active, trialing and past_due set the paid tenant tier. Everything else — including customer.subscription.deleted, canceled and unpaid — clears the tier back to none.",{"q":335,"a":336},"What does Stripe see when Plain is down?","The function returns a 500, so Stripe retries the event on its normal schedule. Signature failures and malformed bodies return a 400, which Stripe does not retry. Successful handling returns a 200 with a JSON body.",{"q":338,"a":339},"Is the sync idempotent when Stripe retries the same event?","Yes. Every Plain mutation is an upsert keyed on the customer's email address and the Stripe customer ID as the tenant external ID, so replaying an event or re-running it from the bucket log converges to the same state.",{"type":341,"children":342,"toc":5763},"root",[343,357,366,371,378,411,417,438,525,536,542,586,5154,5165,5287,5293,5312,5318,5332,5371,5405,5411,5432,5502,5529,5535,5691,5697,5746,5757],{"type":344,"tag":345,"props":346,"children":347},"element","p",{},[348,355],{"type":344,"tag":349,"props":350,"children":351},"strong",{},[352],{"type":353,"value":354},"text","This tutorial replaces a \"Stripe → Plain.com\" sync worker (for example a Cloudflare Worker) with a single Webhook Relay function attached to a bucket input.",{"type":353,"value":356}," Stripe delivers subscription events to the bucket's permanent input URL; the function verifies the Stripe signature, looks up the customer, and upserts Plain.com customers, tenants and tenant tiers through Plain's GraphQL API — no server to deploy, no public endpoint of your own to secure. Every event is logged in the bucket and can be replayed.",{"type":344,"tag":345,"props":358,"children":359},{},[360],{"type":344,"tag":361,"props":362,"children":365},"img",{"alt":363,"src":364},"Stripe posts subscription events to a Webhook Relay bucket input. A function attached to the input verifies the Stripe signature, maps the event to a paid or free tier, and upserts Plain.com customers, tenants and tenant tiers through http.request GraphQL calls. The input answers Stripe with 200 received true, and every event is logged for replay.","/images/tutorials/transform/stripe-to-plain.svg",[],{"type":344,"tag":345,"props":367,"children":368},{},[369],{"type":353,"value":370},"The pattern works for any \"webhook in, GraphQL out\" integration — only the mutations change.",{"type":344,"tag":372,"props":373,"children":375},"h2",{"id":374},"_1-create-a-bucket-for-stripe-events",[376],{"type":353,"value":377},"1. Create a bucket for Stripe events",{"type":344,"tag":345,"props":379,"children":380},{},[381,383,392,394,401,403,409],{"type":353,"value":382},"In ",{"type":344,"tag":384,"props":385,"children":389},"a",{"href":386,"rel":387},"https://my.webhookrelay.com/buckets",[388],"nofollow",[390],{"type":353,"value":391},"my.webhookrelay.com/buckets",{"type":353,"value":393}," create a bucket named ",{"type":344,"tag":395,"props":396,"children":398},"code",{"className":397},[],[399],{"type":353,"value":400},"stripe",{"type":353,"value":402},". Its default input URL (",{"type":344,"tag":395,"props":404,"children":406},{"className":405},[],[407],{"type":353,"value":408},"https://xxx.hooks.webhookrelay.com/v1/web/...",{"type":353,"value":410},") is permanent and public — that is the endpoint Stripe will deliver to. No output destinations are needed.",{"type":344,"tag":372,"props":412,"children":414},{"id":413},"_2-store-the-credentials-as-secret-connections",[415],{"type":353,"value":416},"2. Store the credentials as secret connections",{"type":344,"tag":345,"props":418,"children":419},{},[420,422,427,429,436],{"type":353,"value":421},"The function needs three credentials. Create each as a ",{"type":344,"tag":349,"props":423,"children":424},{},[425],{"type":353,"value":426},"Secret",{"type":353,"value":428}," service connection at ",{"type":344,"tag":384,"props":430,"children":433},{"href":431,"rel":432},"https://my.webhookrelay.com/service-connections",[388],[434],{"type":353,"value":435},"my.webhookrelay.com/service-connections",{"type":353,"value":437}," — secrets are write-only, encrypted at rest and redacted from logs, unlike values pasted into source code:",{"type":344,"tag":439,"props":440,"children":441},"table",{},[442,461],{"type":344,"tag":443,"props":444,"children":445},"thead",{},[446],{"type":344,"tag":447,"props":448,"children":449},"tr",{},[450,456],{"type":344,"tag":451,"props":452,"children":453},"th",{},[454],{"type":353,"value":455},"Alias in the function",{"type":344,"tag":451,"props":457,"children":458},{},[459],{"type":353,"value":460},"Holds",{"type":344,"tag":462,"props":463,"children":464},"tbody",{},[465,491,508],{"type":344,"tag":447,"props":466,"children":467},{},[468,478],{"type":344,"tag":469,"props":470,"children":471},"td",{},[472],{"type":344,"tag":395,"props":473,"children":475},{"className":474},[],[476],{"type":353,"value":477},"secret:stripe-signing-secret",{"type":344,"tag":469,"props":479,"children":480},{},[481,483,489],{"type":353,"value":482},"Stripe webhook signing secret (",{"type":344,"tag":395,"props":484,"children":486},{"className":485},[],[487],{"type":353,"value":488},"whsec_...",{"type":353,"value":490}," from the webhook endpoint settings)",{"type":344,"tag":447,"props":492,"children":493},{},[494,503],{"type":344,"tag":469,"props":495,"children":496},{},[497],{"type":344,"tag":395,"props":498,"children":500},{"className":499},[],[501],{"type":353,"value":502},"secret:stripe-api-key",{"type":344,"tag":469,"props":504,"children":505},{},[506],{"type":353,"value":507},"Stripe secret API key (used to look up the customer's email on subscription events)",{"type":344,"tag":447,"props":509,"children":510},{},[511,520],{"type":344,"tag":469,"props":512,"children":513},{},[514],{"type":344,"tag":395,"props":515,"children":517},{"className":516},[],[518],{"type":353,"value":519},"secret:plain-api-key",{"type":344,"tag":469,"props":521,"children":522},{},[523],{"type":353,"value":524},"Plain.com API token",{"type":344,"tag":345,"props":526,"children":527},{},[528,530,534],{"type":353,"value":529},"How secret imports and bindings work: ",{"type":344,"tag":384,"props":531,"children":532},{"href":104},[533],{"type":353,"value":105},{"type":353,"value":535},".",{"type":344,"tag":372,"props":537,"children":539},{"id":538},"_3-create-the-function",[540],{"type":353,"value":541},"3. Create the function",{"type":344,"tag":345,"props":543,"children":544},{},[545,547,554,556,562,564,569,571,576,578,584],{"type":353,"value":546},"Go to ",{"type":344,"tag":384,"props":548,"children":551},{"href":549,"rel":550},"https://my.webhookrelay.com/functions",[388],[552],{"type":353,"value":553},"my.webhookrelay.com/functions",{"type":353,"value":555},", create a function named ",{"type":344,"tag":395,"props":557,"children":559},{"className":558},[],[560],{"type":353,"value":561},"stripe-to-plain",{"type":353,"value":563}," (driver ",{"type":344,"tag":349,"props":565,"children":566},{},[567],{"type":353,"value":568},"JavaScript",{"type":353,"value":570},") and paste in the code below. Then open the function's ",{"type":344,"tag":349,"props":572,"children":573},{},[574],{"type":353,"value":575},"Connections",{"type":353,"value":577}," tab and bind each ",{"type":344,"tag":395,"props":579,"children":581},{"className":580},[],[582],{"type":353,"value":583},"secret:",{"type":353,"value":585}," alias to the connection from step 2.",{"type":344,"tag":587,"props":588,"children":592},"pre",{"className":589,"code":590,"language":591,"meta":318,"style":318},"language-javascript shiki shiki-themes github-dark","// Stripe → Plain.com sync. Attached to a bucket INPUT: verifies Stripe's\n// signature, keeps Plain customers/tenants/tiers in sync with subscription\n// state, and answers Stripe directly. No output destination required.\n\n// Bound on the function's Connections tab — never hard-code these:\nconst stripeSigningSecret = require(\"secret:stripe-signing-secret\") // whsec_...\nconst stripeApiKey = require(\"secret:stripe-api-key\")               // sk_...\nconst plainApiKey = require(\"secret:plain-api-key\")                 // plainApiKey_...\n\n// Non-secret settings (function config, not secrets):\n//   PLAIN_PAID_TIER_ID – Plain tenant tier id that marks a tenant as paid\n//                        (Plain → Settings → Tenants → Tiers)\n//   DRY_RUN            – unset or \"true\" = log only, \"false\" = write to Plain\nconst PLAIN_API = \"https://core-api.uk.plain.com/graphql/v1\"\nconst SIGNATURE_TOLERANCE_S = 300\n\nconst PAID_STATUSES = [\"active\", \"trialing\", \"past_due\"]\nconst HANDLED_EVENTS = [\n  \"customer.subscription.created\",\n  \"customer.subscription.updated\",\n  \"customer.subscription.deleted\",\n  \"customer.created\"\n]\n\n// ---------- Plain GraphQL ----------\n\nconst UPSERT_CUSTOMER = `\n  mutation UpsertCustomer($input: UpsertCustomerInput!) {\n    upsertCustomer(input: $input) {\n      customer { id email { email } }\n      error { message code }\n    }\n  }`\n\nconst UPSERT_TENANT = `\n  mutation UpsertTenant($input: UpsertTenantInput!) {\n    upsertTenant(input: $input) {\n      tenant { id name externalId }\n      error { message code }\n    }\n  }`\n\nconst UPDATE_TENANT_TIER = `\n  mutation UpdateTenantTier($input: UpdateTenantTierInput!) {\n    updateTenantTier(input: $input) {\n      error { message code }\n    }\n  }`\n\nconst ADD_CUSTOMER_TO_TENANTS = `\n  mutation AddCustomerToTenants($input: AddCustomerToTenantsInput!) {\n    addCustomerToTenants(input: $input) {\n      customer { id }\n      error { message code }\n    }\n  }`\n\nfunction plain(query, variables) {\n  const resp = http.request(\"POST\", PLAIN_API, {\n    headers: {\n      \"Content-Type\": \"application/json\",\n      Authorization: \"Bearer \" + plainApiKey\n    },\n    body: JSON.stringify({ query: query, variables: variables })\n  })\n  if (resp.status_code !== 200) {\n    throw new Error(\"Plain HTTP \" + resp.status_code + \": \" + resp.body)\n  }\n  const body = JSON.parse(resp.body)\n  if (body.errors && body.errors.length > 0) {\n    throw new Error(\"Plain GraphQL: \" + body.errors.map(e => e.message).join(\"; \"))\n  }\n  if (!body.data) throw new Error(\"Plain returned empty data\")\n  return body.data\n}\n\nfunction upsertPlainCustomer(email, fullName, stripeCustomerId) {\n  const data = plain(UPSERT_CUSTOMER, {\n    input: {\n      identifier: { emailAddress: email },\n      onCreate: {\n        fullName: fullName || email,\n        email: { email: email, isVerified: false },\n        externalId: stripeCustomerId\n      },\n      onUpdate: {}\n    }\n  })\n  if (data.upsertCustomer.error) {\n    throw new Error(\"upsertCustomer: \" + data.upsertCustomer.error.message)\n  }\n  return data.upsertCustomer.customer.id\n}\n\nfunction upsertPlainTenant(stripeCustomerId, name) {\n  const data = plain(UPSERT_TENANT, {\n    input: {\n      identifier: { externalId: stripeCustomerId },\n      name: name,\n      externalId: stripeCustomerId\n    }\n  })\n  if (data.upsertTenant.error) {\n    throw new Error(\"upsertTenant: \" + data.upsertTenant.error.message)\n  }\n  return data.upsertTenant.tenant.id\n}\n\nfunction setPlainTenantTier(tenantId, tierId) {\n  if (!tierId) throw new Error(\"PLAIN_PAID_TIER_ID is not set in function config\")\n  plain(UPDATE_TENANT_TIER, {\n    input: {\n      tenantIdentifier: { tenantId: tenantId },\n      tierIdentifier: { tierId: tierId }\n    }\n  })\n}\n\nfunction clearPlainTenantTier(tenantId) {\n  plain(UPDATE_TENANT_TIER, {\n    input: {\n      tenantIdentifier: { tenantId: tenantId },\n      tierIdentifier: null\n    }\n  })\n}\n\nfunction linkPlainCustomerToTenant(customerId, tenantId) {\n  plain(ADD_CUSTOMER_TO_TENANTS, {\n    input: {\n      customerIdentifier: { customerId: customerId },\n      tenantIdentifiers: [{ tenantId: tenantId }]\n    }\n  })\n}\n\n// ---------- Stripe ----------\n\nfunction fetchStripeCustomer(customerId) {\n  const resp = http.request(\n    \"GET\",\n    \"https://api.stripe.com/v1/customers/\" + customerId,\n    { headers: { Authorization: \"Bearer \" + stripeApiKey } }\n  )\n  if (resp.status_code !== 200) {\n    throw new Error(\"Stripe customer lookup \" + resp.status_code + \": \" + resp.body)\n  }\n  return JSON.parse(resp.body)\n}\n\n// ---------- main ----------\n\nfunction answer(status, payload) {\n  r.setResponseStatus(status)\n  r.setResponseHeader(\"Content-Type\", \"application/json\")\n  r.setResponseBody(JSON.stringify(payload))\n  r.stopForwarding()\n}\n\n// 1) Verify Stripe's signature before trusting the payload.\n//    Stripe-Signature: t=\u003Cunix ts>, v1=\u003Chex hmac of \"\u003Cts>.\u003Cbody>\">\nconst signature = r.headers[\"Stripe-Signature\"] || \"\"\nconst timestamp = (signature.match(/t=(\\d+)/) || [])[1]\nconst sent = (signature.match(/v1=([a-f0-9]+)/) || [])[1]\n\nif (!timestamp || !sent) {\n  answer(400, { error: \"missing Stripe-Signature header\" })\n  return\n}\nif (Math.abs(time.unix() - parseInt(timestamp, 10)) > SIGNATURE_TOLERANCE_S) {\n  answer(400, { error: \"timestamp outside tolerance\" })\n  return\n}\nconst expected = crypto.hmac(\"sha256\", stripeSigningSecret, timestamp + \".\" + r.body)\nif (expected !== sent) {\n  answer(400, { error: \"signature mismatch\" })\n  return\n}\n\n// 2) Parse the event; ignore anything we do not sync.\nlet event\ntry {\n  event = JSON.parse(r.body)\n} catch (e) {\n  answer(400, { error: \"invalid JSON body\" })\n  return\n}\nif (HANDLED_EVENTS.indexOf(event.type) === -1) {\n  answer(200, { received: true, handled: false, type: event.type })\n  return\n}\n\n// 3) Sync. Any Plain error → 500 so Stripe retries the delivery.\ntry {\n  const outcome = syncEvent(event)\n  console.log(\"stripe-to-plain\", event.type, JSON.stringify(outcome))\n  answer(200, { received: true, handled: true, outcome: outcome })\n} catch (e) {\n  console.error(\"stripe-to-plain error\", event.type, String(e))\n  answer(500, { error: String(e) })\n}\n\n// ---------- sync ----------\n\nfunction syncEvent(event) {\n  let email, name, stripeCustomerId, tier\n\n  if (event.type === \"customer.created\") {\n    // New Stripe customer: make sure they exist in Plain on the free tier.\n    const c = event.data.object\n    if (!c.email) return { action: \"noop\", reason: \"customer_has_no_email\" }\n    email = c.email\n    name = c.name\n    stripeCustomerId = c.id\n    tier = \"free\"\n  } else {\n    // Subscription events: resolve the customer for email + name.\n    const sub = event.data.object\n    stripeCustomerId = typeof sub.customer === \"string\" ? sub.customer : sub.customer.id\n    const customer = fetchStripeCustomer(stripeCustomerId)\n    if (!customer.email) {\n      return { action: \"noop\", reason: \"stripe_customer_has_no_email\" }\n    }\n    email = customer.email\n    name = customer.name\n    if (event.type === \"customer.subscription.deleted\") {\n      tier = \"free\"\n    } else if (PAID_STATUSES.indexOf(sub.status) !== -1) {\n      tier = \"paid\"\n    } else {\n      tier = \"free\"\n    }\n  }\n\n  const action = tier === \"paid\" ? \"set_paid\" : \"set_free\"\n\n  // DRY_RUN unset or \"true\" = log only; set DRY_RUN=false to write to Plain.\n  if (cfg.get(\"DRY_RUN\") !== \"false\") {\n    return { action: action, email: email, reason: \"dry_run\" }\n  }\n\n  const customerId = upsertPlainCustomer(email, name, stripeCustomerId)\n  const tenantId = upsertPlainTenant(stripeCustomerId, email)\n  if (tier === \"paid\") {\n    setPlainTenantTier(tenantId, cfg.get(\"PLAIN_PAID_TIER_ID\"))\n  } else {\n    clearPlainTenantTier(tenantId)\n  }\n  linkPlainCustomerToTenant(customerId, tenantId)\n\n  return { action: action, email: email, plain_customer_id: customerId }\n}\n","javascript",[593],{"type":344,"tag":395,"props":594,"children":595},{"__ignoreMap":318},[596,608,617,626,636,645,694,734,774,782,791,800,809,818,840,862,870,921,943,957,970,983,992,1000,1008,1017,1025,1047,1056,1065,1074,1083,1092,1101,1109,1130,1139,1148,1157,1165,1173,1181,1189,1210,1219,1228,1236,1244,1252,1260,1281,1290,1299,1308,1316,1324,1332,1340,1378,1429,1438,1461,1485,1494,1522,1531,1559,1615,1624,1660,1702,1778,1786,1836,1850,1859,1867,1911,1945,1954,1963,1972,1991,2010,2019,2028,2037,2045,2053,2066,2100,2108,2121,2129,2137,2171,2204,2212,2221,2230,2239,2247,2255,2268,2302,2310,2323,2331,2339,2374,2420,2442,2450,2459,2468,2476,2484,2492,2500,2525,2545,2553,2561,2575,2583,2591,2599,2607,2641,2662,2670,2679,2688,2696,2704,2712,2720,2729,2737,2762,2791,2804,2822,2844,2853,2877,2926,2934,2958,2966,2974,2983,2991,3026,3045,3079,3113,3131,3139,3147,3156,3165,3206,3288,3363,3371,3407,3440,3449,3457,3528,3557,3565,3573,3632,3654,3683,3691,3699,3707,3716,3730,3744,3775,3794,3823,3831,3839,3888,3929,3937,3945,3953,3962,3974,4001,4046,4083,4099,4135,4165,4173,4181,4190,4198,4223,4237,4245,4271,4280,4303,4355,4373,4391,4409,4427,4445,4454,4475,4525,4551,4572,4602,4610,4627,4644,4669,4686,4742,4759,4775,4791,4799,4807,4815,4865,4873,4882,4926,4949,4957,4965,4991,5017,5042,5073,5089,5103,5111,5125,5133,5146],{"type":344,"tag":597,"props":598,"children":601},"span",{"class":599,"line":600},"line",1,[602],{"type":344,"tag":597,"props":603,"children":605},{"style":604},"--shiki-default:#6A737D",[606],{"type":353,"value":607},"// Stripe → Plain.com sync. Attached to a bucket INPUT: verifies Stripe's\n",{"type":344,"tag":597,"props":609,"children":611},{"class":599,"line":610},2,[612],{"type":344,"tag":597,"props":613,"children":614},{"style":604},[615],{"type":353,"value":616},"// signature, keeps Plain customers/tenants/tiers in sync with subscription\n",{"type":344,"tag":597,"props":618,"children":620},{"class":599,"line":619},3,[621],{"type":344,"tag":597,"props":622,"children":623},{"style":604},[624],{"type":353,"value":625},"// state, and answers Stripe directly. No output destination required.\n",{"type":344,"tag":597,"props":627,"children":629},{"class":599,"line":628},4,[630],{"type":344,"tag":597,"props":631,"children":633},{"emptyLinePlaceholder":632},true,[634],{"type":353,"value":635},"\n",{"type":344,"tag":597,"props":637,"children":639},{"class":599,"line":638},5,[640],{"type":344,"tag":597,"props":641,"children":642},{"style":604},[643],{"type":353,"value":644},"// Bound on the function's Connections tab — never hard-code these:\n",{"type":344,"tag":597,"props":646,"children":648},{"class":599,"line":647},6,[649,655,661,666,672,678,684,689],{"type":344,"tag":597,"props":650,"children":652},{"style":651},"--shiki-default:#F97583",[653],{"type":353,"value":654},"const",{"type":344,"tag":597,"props":656,"children":658},{"style":657},"--shiki-default:#79B8FF",[659],{"type":353,"value":660}," stripeSigningSecret",{"type":344,"tag":597,"props":662,"children":663},{"style":651},[664],{"type":353,"value":665}," =",{"type":344,"tag":597,"props":667,"children":669},{"style":668},"--shiki-default:#B392F0",[670],{"type":353,"value":671}," require",{"type":344,"tag":597,"props":673,"children":675},{"style":674},"--shiki-default:#E1E4E8",[676],{"type":353,"value":677},"(",{"type":344,"tag":597,"props":679,"children":681},{"style":680},"--shiki-default:#9ECBFF",[682],{"type":353,"value":683},"\"secret:stripe-signing-secret\"",{"type":344,"tag":597,"props":685,"children":686},{"style":674},[687],{"type":353,"value":688},") ",{"type":344,"tag":597,"props":690,"children":691},{"style":604},[692],{"type":353,"value":693},"// whsec_...\n",{"type":344,"tag":597,"props":695,"children":697},{"class":599,"line":696},7,[698,702,707,711,715,719,724,729],{"type":344,"tag":597,"props":699,"children":700},{"style":651},[701],{"type":353,"value":654},{"type":344,"tag":597,"props":703,"children":704},{"style":657},[705],{"type":353,"value":706}," stripeApiKey",{"type":344,"tag":597,"props":708,"children":709},{"style":651},[710],{"type":353,"value":665},{"type":344,"tag":597,"props":712,"children":713},{"style":668},[714],{"type":353,"value":671},{"type":344,"tag":597,"props":716,"children":717},{"style":674},[718],{"type":353,"value":677},{"type":344,"tag":597,"props":720,"children":721},{"style":680},[722],{"type":353,"value":723},"\"secret:stripe-api-key\"",{"type":344,"tag":597,"props":725,"children":726},{"style":674},[727],{"type":353,"value":728},")               ",{"type":344,"tag":597,"props":730,"children":731},{"style":604},[732],{"type":353,"value":733},"// sk_...\n",{"type":344,"tag":597,"props":735,"children":737},{"class":599,"line":736},8,[738,742,747,751,755,759,764,769],{"type":344,"tag":597,"props":739,"children":740},{"style":651},[741],{"type":353,"value":654},{"type":344,"tag":597,"props":743,"children":744},{"style":657},[745],{"type":353,"value":746}," plainApiKey",{"type":344,"tag":597,"props":748,"children":749},{"style":651},[750],{"type":353,"value":665},{"type":344,"tag":597,"props":752,"children":753},{"style":668},[754],{"type":353,"value":671},{"type":344,"tag":597,"props":756,"children":757},{"style":674},[758],{"type":353,"value":677},{"type":344,"tag":597,"props":760,"children":761},{"style":680},[762],{"type":353,"value":763},"\"secret:plain-api-key\"",{"type":344,"tag":597,"props":765,"children":766},{"style":674},[767],{"type":353,"value":768},")                 ",{"type":344,"tag":597,"props":770,"children":771},{"style":604},[772],{"type":353,"value":773},"// plainApiKey_...\n",{"type":344,"tag":597,"props":775,"children":777},{"class":599,"line":776},9,[778],{"type":344,"tag":597,"props":779,"children":780},{"emptyLinePlaceholder":632},[781],{"type":353,"value":635},{"type":344,"tag":597,"props":783,"children":785},{"class":599,"line":784},10,[786],{"type":344,"tag":597,"props":787,"children":788},{"style":604},[789],{"type":353,"value":790},"// Non-secret settings (function config, not secrets):\n",{"type":344,"tag":597,"props":792,"children":794},{"class":599,"line":793},11,[795],{"type":344,"tag":597,"props":796,"children":797},{"style":604},[798],{"type":353,"value":799},"//   PLAIN_PAID_TIER_ID – Plain tenant tier id that marks a tenant as paid\n",{"type":344,"tag":597,"props":801,"children":803},{"class":599,"line":802},12,[804],{"type":344,"tag":597,"props":805,"children":806},{"style":604},[807],{"type":353,"value":808},"//                        (Plain → Settings → Tenants → Tiers)\n",{"type":344,"tag":597,"props":810,"children":812},{"class":599,"line":811},13,[813],{"type":344,"tag":597,"props":814,"children":815},{"style":604},[816],{"type":353,"value":817},"//   DRY_RUN            – unset or \"true\" = log only, \"false\" = write to Plain\n",{"type":344,"tag":597,"props":819,"children":821},{"class":599,"line":820},14,[822,826,831,835],{"type":344,"tag":597,"props":823,"children":824},{"style":651},[825],{"type":353,"value":654},{"type":344,"tag":597,"props":827,"children":828},{"style":657},[829],{"type":353,"value":830}," PLAIN_API",{"type":344,"tag":597,"props":832,"children":833},{"style":651},[834],{"type":353,"value":665},{"type":344,"tag":597,"props":836,"children":837},{"style":680},[838],{"type":353,"value":839}," \"https://core-api.uk.plain.com/graphql/v1\"\n",{"type":344,"tag":597,"props":841,"children":843},{"class":599,"line":842},15,[844,848,853,857],{"type":344,"tag":597,"props":845,"children":846},{"style":651},[847],{"type":353,"value":654},{"type":344,"tag":597,"props":849,"children":850},{"style":657},[851],{"type":353,"value":852}," SIGNATURE_TOLERANCE_S",{"type":344,"tag":597,"props":854,"children":855},{"style":651},[856],{"type":353,"value":665},{"type":344,"tag":597,"props":858,"children":859},{"style":657},[860],{"type":353,"value":861}," 300\n",{"type":344,"tag":597,"props":863,"children":865},{"class":599,"line":864},16,[866],{"type":344,"tag":597,"props":867,"children":868},{"emptyLinePlaceholder":632},[869],{"type":353,"value":635},{"type":344,"tag":597,"props":871,"children":873},{"class":599,"line":872},17,[874,878,883,887,892,897,902,907,911,916],{"type":344,"tag":597,"props":875,"children":876},{"style":651},[877],{"type":353,"value":654},{"type":344,"tag":597,"props":879,"children":880},{"style":657},[881],{"type":353,"value":882}," PAID_STATUSES",{"type":344,"tag":597,"props":884,"children":885},{"style":651},[886],{"type":353,"value":665},{"type":344,"tag":597,"props":888,"children":889},{"style":674},[890],{"type":353,"value":891}," [",{"type":344,"tag":597,"props":893,"children":894},{"style":680},[895],{"type":353,"value":896},"\"active\"",{"type":344,"tag":597,"props":898,"children":899},{"style":674},[900],{"type":353,"value":901},", ",{"type":344,"tag":597,"props":903,"children":904},{"style":680},[905],{"type":353,"value":906},"\"trialing\"",{"type":344,"tag":597,"props":908,"children":909},{"style":674},[910],{"type":353,"value":901},{"type":344,"tag":597,"props":912,"children":913},{"style":680},[914],{"type":353,"value":915},"\"past_due\"",{"type":344,"tag":597,"props":917,"children":918},{"style":674},[919],{"type":353,"value":920},"]\n",{"type":344,"tag":597,"props":922,"children":924},{"class":599,"line":923},18,[925,929,934,938],{"type":344,"tag":597,"props":926,"children":927},{"style":651},[928],{"type":353,"value":654},{"type":344,"tag":597,"props":930,"children":931},{"style":657},[932],{"type":353,"value":933}," HANDLED_EVENTS",{"type":344,"tag":597,"props":935,"children":936},{"style":651},[937],{"type":353,"value":665},{"type":344,"tag":597,"props":939,"children":940},{"style":674},[941],{"type":353,"value":942}," [\n",{"type":344,"tag":597,"props":944,"children":946},{"class":599,"line":945},19,[947,952],{"type":344,"tag":597,"props":948,"children":949},{"style":680},[950],{"type":353,"value":951},"  \"customer.subscription.created\"",{"type":344,"tag":597,"props":953,"children":954},{"style":674},[955],{"type":353,"value":956},",\n",{"type":344,"tag":597,"props":958,"children":960},{"class":599,"line":959},20,[961,966],{"type":344,"tag":597,"props":962,"children":963},{"style":680},[964],{"type":353,"value":965},"  \"customer.subscription.updated\"",{"type":344,"tag":597,"props":967,"children":968},{"style":674},[969],{"type":353,"value":956},{"type":344,"tag":597,"props":971,"children":973},{"class":599,"line":972},21,[974,979],{"type":344,"tag":597,"props":975,"children":976},{"style":680},[977],{"type":353,"value":978},"  \"customer.subscription.deleted\"",{"type":344,"tag":597,"props":980,"children":981},{"style":674},[982],{"type":353,"value":956},{"type":344,"tag":597,"props":984,"children":986},{"class":599,"line":985},22,[987],{"type":344,"tag":597,"props":988,"children":989},{"style":680},[990],{"type":353,"value":991},"  \"customer.created\"\n",{"type":344,"tag":597,"props":993,"children":995},{"class":599,"line":994},23,[996],{"type":344,"tag":597,"props":997,"children":998},{"style":674},[999],{"type":353,"value":920},{"type":344,"tag":597,"props":1001,"children":1003},{"class":599,"line":1002},24,[1004],{"type":344,"tag":597,"props":1005,"children":1006},{"emptyLinePlaceholder":632},[1007],{"type":353,"value":635},{"type":344,"tag":597,"props":1009,"children":1011},{"class":599,"line":1010},25,[1012],{"type":344,"tag":597,"props":1013,"children":1014},{"style":604},[1015],{"type":353,"value":1016},"// ---------- Plain GraphQL ----------\n",{"type":344,"tag":597,"props":1018,"children":1020},{"class":599,"line":1019},26,[1021],{"type":344,"tag":597,"props":1022,"children":1023},{"emptyLinePlaceholder":632},[1024],{"type":353,"value":635},{"type":344,"tag":597,"props":1026,"children":1028},{"class":599,"line":1027},27,[1029,1033,1038,1042],{"type":344,"tag":597,"props":1030,"children":1031},{"style":651},[1032],{"type":353,"value":654},{"type":344,"tag":597,"props":1034,"children":1035},{"style":657},[1036],{"type":353,"value":1037}," UPSERT_CUSTOMER",{"type":344,"tag":597,"props":1039,"children":1040},{"style":651},[1041],{"type":353,"value":665},{"type":344,"tag":597,"props":1043,"children":1044},{"style":680},[1045],{"type":353,"value":1046}," `\n",{"type":344,"tag":597,"props":1048,"children":1050},{"class":599,"line":1049},28,[1051],{"type":344,"tag":597,"props":1052,"children":1053},{"style":680},[1054],{"type":353,"value":1055},"  mutation UpsertCustomer($input: UpsertCustomerInput!) {\n",{"type":344,"tag":597,"props":1057,"children":1059},{"class":599,"line":1058},29,[1060],{"type":344,"tag":597,"props":1061,"children":1062},{"style":680},[1063],{"type":353,"value":1064},"    upsertCustomer(input: $input) {\n",{"type":344,"tag":597,"props":1066,"children":1068},{"class":599,"line":1067},30,[1069],{"type":344,"tag":597,"props":1070,"children":1071},{"style":680},[1072],{"type":353,"value":1073},"      customer { id email { email } }\n",{"type":344,"tag":597,"props":1075,"children":1077},{"class":599,"line":1076},31,[1078],{"type":344,"tag":597,"props":1079,"children":1080},{"style":680},[1081],{"type":353,"value":1082},"      error { message code }\n",{"type":344,"tag":597,"props":1084,"children":1086},{"class":599,"line":1085},32,[1087],{"type":344,"tag":597,"props":1088,"children":1089},{"style":680},[1090],{"type":353,"value":1091},"    }\n",{"type":344,"tag":597,"props":1093,"children":1095},{"class":599,"line":1094},33,[1096],{"type":344,"tag":597,"props":1097,"children":1098},{"style":680},[1099],{"type":353,"value":1100},"  }`\n",{"type":344,"tag":597,"props":1102,"children":1104},{"class":599,"line":1103},34,[1105],{"type":344,"tag":597,"props":1106,"children":1107},{"emptyLinePlaceholder":632},[1108],{"type":353,"value":635},{"type":344,"tag":597,"props":1110,"children":1112},{"class":599,"line":1111},35,[1113,1117,1122,1126],{"type":344,"tag":597,"props":1114,"children":1115},{"style":651},[1116],{"type":353,"value":654},{"type":344,"tag":597,"props":1118,"children":1119},{"style":657},[1120],{"type":353,"value":1121}," UPSERT_TENANT",{"type":344,"tag":597,"props":1123,"children":1124},{"style":651},[1125],{"type":353,"value":665},{"type":344,"tag":597,"props":1127,"children":1128},{"style":680},[1129],{"type":353,"value":1046},{"type":344,"tag":597,"props":1131,"children":1133},{"class":599,"line":1132},36,[1134],{"type":344,"tag":597,"props":1135,"children":1136},{"style":680},[1137],{"type":353,"value":1138},"  mutation UpsertTenant($input: UpsertTenantInput!) {\n",{"type":344,"tag":597,"props":1140,"children":1142},{"class":599,"line":1141},37,[1143],{"type":344,"tag":597,"props":1144,"children":1145},{"style":680},[1146],{"type":353,"value":1147},"    upsertTenant(input: $input) {\n",{"type":344,"tag":597,"props":1149,"children":1151},{"class":599,"line":1150},38,[1152],{"type":344,"tag":597,"props":1153,"children":1154},{"style":680},[1155],{"type":353,"value":1156},"      tenant { id name externalId }\n",{"type":344,"tag":597,"props":1158,"children":1160},{"class":599,"line":1159},39,[1161],{"type":344,"tag":597,"props":1162,"children":1163},{"style":680},[1164],{"type":353,"value":1082},{"type":344,"tag":597,"props":1166,"children":1168},{"class":599,"line":1167},40,[1169],{"type":344,"tag":597,"props":1170,"children":1171},{"style":680},[1172],{"type":353,"value":1091},{"type":344,"tag":597,"props":1174,"children":1176},{"class":599,"line":1175},41,[1177],{"type":344,"tag":597,"props":1178,"children":1179},{"style":680},[1180],{"type":353,"value":1100},{"type":344,"tag":597,"props":1182,"children":1184},{"class":599,"line":1183},42,[1185],{"type":344,"tag":597,"props":1186,"children":1187},{"emptyLinePlaceholder":632},[1188],{"type":353,"value":635},{"type":344,"tag":597,"props":1190,"children":1192},{"class":599,"line":1191},43,[1193,1197,1202,1206],{"type":344,"tag":597,"props":1194,"children":1195},{"style":651},[1196],{"type":353,"value":654},{"type":344,"tag":597,"props":1198,"children":1199},{"style":657},[1200],{"type":353,"value":1201}," UPDATE_TENANT_TIER",{"type":344,"tag":597,"props":1203,"children":1204},{"style":651},[1205],{"type":353,"value":665},{"type":344,"tag":597,"props":1207,"children":1208},{"style":680},[1209],{"type":353,"value":1046},{"type":344,"tag":597,"props":1211,"children":1213},{"class":599,"line":1212},44,[1214],{"type":344,"tag":597,"props":1215,"children":1216},{"style":680},[1217],{"type":353,"value":1218},"  mutation UpdateTenantTier($input: UpdateTenantTierInput!) {\n",{"type":344,"tag":597,"props":1220,"children":1222},{"class":599,"line":1221},45,[1223],{"type":344,"tag":597,"props":1224,"children":1225},{"style":680},[1226],{"type":353,"value":1227},"    updateTenantTier(input: $input) {\n",{"type":344,"tag":597,"props":1229,"children":1231},{"class":599,"line":1230},46,[1232],{"type":344,"tag":597,"props":1233,"children":1234},{"style":680},[1235],{"type":353,"value":1082},{"type":344,"tag":597,"props":1237,"children":1239},{"class":599,"line":1238},47,[1240],{"type":344,"tag":597,"props":1241,"children":1242},{"style":680},[1243],{"type":353,"value":1091},{"type":344,"tag":597,"props":1245,"children":1247},{"class":599,"line":1246},48,[1248],{"type":344,"tag":597,"props":1249,"children":1250},{"style":680},[1251],{"type":353,"value":1100},{"type":344,"tag":597,"props":1253,"children":1255},{"class":599,"line":1254},49,[1256],{"type":344,"tag":597,"props":1257,"children":1258},{"emptyLinePlaceholder":632},[1259],{"type":353,"value":635},{"type":344,"tag":597,"props":1261,"children":1263},{"class":599,"line":1262},50,[1264,1268,1273,1277],{"type":344,"tag":597,"props":1265,"children":1266},{"style":651},[1267],{"type":353,"value":654},{"type":344,"tag":597,"props":1269,"children":1270},{"style":657},[1271],{"type":353,"value":1272}," ADD_CUSTOMER_TO_TENANTS",{"type":344,"tag":597,"props":1274,"children":1275},{"style":651},[1276],{"type":353,"value":665},{"type":344,"tag":597,"props":1278,"children":1279},{"style":680},[1280],{"type":353,"value":1046},{"type":344,"tag":597,"props":1282,"children":1284},{"class":599,"line":1283},51,[1285],{"type":344,"tag":597,"props":1286,"children":1287},{"style":680},[1288],{"type":353,"value":1289},"  mutation AddCustomerToTenants($input: AddCustomerToTenantsInput!) {\n",{"type":344,"tag":597,"props":1291,"children":1293},{"class":599,"line":1292},52,[1294],{"type":344,"tag":597,"props":1295,"children":1296},{"style":680},[1297],{"type":353,"value":1298},"    addCustomerToTenants(input: $input) {\n",{"type":344,"tag":597,"props":1300,"children":1302},{"class":599,"line":1301},53,[1303],{"type":344,"tag":597,"props":1304,"children":1305},{"style":680},[1306],{"type":353,"value":1307},"      customer { id }\n",{"type":344,"tag":597,"props":1309,"children":1311},{"class":599,"line":1310},54,[1312],{"type":344,"tag":597,"props":1313,"children":1314},{"style":680},[1315],{"type":353,"value":1082},{"type":344,"tag":597,"props":1317,"children":1319},{"class":599,"line":1318},55,[1320],{"type":344,"tag":597,"props":1321,"children":1322},{"style":680},[1323],{"type":353,"value":1091},{"type":344,"tag":597,"props":1325,"children":1327},{"class":599,"line":1326},56,[1328],{"type":344,"tag":597,"props":1329,"children":1330},{"style":680},[1331],{"type":353,"value":1100},{"type":344,"tag":597,"props":1333,"children":1335},{"class":599,"line":1334},57,[1336],{"type":344,"tag":597,"props":1337,"children":1338},{"emptyLinePlaceholder":632},[1339],{"type":353,"value":635},{"type":344,"tag":597,"props":1341,"children":1343},{"class":599,"line":1342},58,[1344,1349,1354,1358,1364,1368,1373],{"type":344,"tag":597,"props":1345,"children":1346},{"style":651},[1347],{"type":353,"value":1348},"function",{"type":344,"tag":597,"props":1350,"children":1351},{"style":668},[1352],{"type":353,"value":1353}," plain",{"type":344,"tag":597,"props":1355,"children":1356},{"style":674},[1357],{"type":353,"value":677},{"type":344,"tag":597,"props":1359,"children":1361},{"style":1360},"--shiki-default:#FFAB70",[1362],{"type":353,"value":1363},"query",{"type":344,"tag":597,"props":1365,"children":1366},{"style":674},[1367],{"type":353,"value":901},{"type":344,"tag":597,"props":1369,"children":1370},{"style":1360},[1371],{"type":353,"value":1372},"variables",{"type":344,"tag":597,"props":1374,"children":1375},{"style":674},[1376],{"type":353,"value":1377},") {\n",{"type":344,"tag":597,"props":1379,"children":1381},{"class":599,"line":1380},59,[1382,1387,1392,1396,1401,1406,1410,1415,1419,1424],{"type":344,"tag":597,"props":1383,"children":1384},{"style":651},[1385],{"type":353,"value":1386},"  const",{"type":344,"tag":597,"props":1388,"children":1389},{"style":657},[1390],{"type":353,"value":1391}," resp",{"type":344,"tag":597,"props":1393,"children":1394},{"style":651},[1395],{"type":353,"value":665},{"type":344,"tag":597,"props":1397,"children":1398},{"style":674},[1399],{"type":353,"value":1400}," http.",{"type":344,"tag":597,"props":1402,"children":1403},{"style":668},[1404],{"type":353,"value":1405},"request",{"type":344,"tag":597,"props":1407,"children":1408},{"style":674},[1409],{"type":353,"value":677},{"type":344,"tag":597,"props":1411,"children":1412},{"style":680},[1413],{"type":353,"value":1414},"\"POST\"",{"type":344,"tag":597,"props":1416,"children":1417},{"style":674},[1418],{"type":353,"value":901},{"type":344,"tag":597,"props":1420,"children":1421},{"style":657},[1422],{"type":353,"value":1423},"PLAIN_API",{"type":344,"tag":597,"props":1425,"children":1426},{"style":674},[1427],{"type":353,"value":1428},", {\n",{"type":344,"tag":597,"props":1430,"children":1432},{"class":599,"line":1431},60,[1433],{"type":344,"tag":597,"props":1434,"children":1435},{"style":674},[1436],{"type":353,"value":1437},"    headers: {\n",{"type":344,"tag":597,"props":1439,"children":1441},{"class":599,"line":1440},61,[1442,1447,1452,1457],{"type":344,"tag":597,"props":1443,"children":1444},{"style":680},[1445],{"type":353,"value":1446},"      \"Content-Type\"",{"type":344,"tag":597,"props":1448,"children":1449},{"style":674},[1450],{"type":353,"value":1451},": ",{"type":344,"tag":597,"props":1453,"children":1454},{"style":680},[1455],{"type":353,"value":1456},"\"application/json\"",{"type":344,"tag":597,"props":1458,"children":1459},{"style":674},[1460],{"type":353,"value":956},{"type":344,"tag":597,"props":1462,"children":1464},{"class":599,"line":1463},62,[1465,1470,1475,1480],{"type":344,"tag":597,"props":1466,"children":1467},{"style":674},[1468],{"type":353,"value":1469},"      Authorization: ",{"type":344,"tag":597,"props":1471,"children":1472},{"style":680},[1473],{"type":353,"value":1474},"\"Bearer \"",{"type":344,"tag":597,"props":1476,"children":1477},{"style":651},[1478],{"type":353,"value":1479}," +",{"type":344,"tag":597,"props":1481,"children":1482},{"style":674},[1483],{"type":353,"value":1484}," plainApiKey\n",{"type":344,"tag":597,"props":1486,"children":1488},{"class":599,"line":1487},63,[1489],{"type":344,"tag":597,"props":1490,"children":1491},{"style":674},[1492],{"type":353,"value":1493},"    },\n",{"type":344,"tag":597,"props":1495,"children":1497},{"class":599,"line":1496},64,[1498,1503,1508,1512,1517],{"type":344,"tag":597,"props":1499,"children":1500},{"style":674},[1501],{"type":353,"value":1502},"    body: ",{"type":344,"tag":597,"props":1504,"children":1505},{"style":657},[1506],{"type":353,"value":1507},"JSON",{"type":344,"tag":597,"props":1509,"children":1510},{"style":674},[1511],{"type":353,"value":535},{"type":344,"tag":597,"props":1513,"children":1514},{"style":668},[1515],{"type":353,"value":1516},"stringify",{"type":344,"tag":597,"props":1518,"children":1519},{"style":674},[1520],{"type":353,"value":1521},"({ query: query, variables: variables })\n",{"type":344,"tag":597,"props":1523,"children":1525},{"class":599,"line":1524},65,[1526],{"type":344,"tag":597,"props":1527,"children":1528},{"style":674},[1529],{"type":353,"value":1530},"  })\n",{"type":344,"tag":597,"props":1532,"children":1534},{"class":599,"line":1533},66,[1535,1540,1545,1550,1555],{"type":344,"tag":597,"props":1536,"children":1537},{"style":651},[1538],{"type":353,"value":1539},"  if",{"type":344,"tag":597,"props":1541,"children":1542},{"style":674},[1543],{"type":353,"value":1544}," (resp.status_code ",{"type":344,"tag":597,"props":1546,"children":1547},{"style":651},[1548],{"type":353,"value":1549},"!==",{"type":344,"tag":597,"props":1551,"children":1552},{"style":657},[1553],{"type":353,"value":1554}," 200",{"type":344,"tag":597,"props":1556,"children":1557},{"style":674},[1558],{"type":353,"value":1377},{"type":344,"tag":597,"props":1560,"children":1562},{"class":599,"line":1561},67,[1563,1568,1573,1578,1582,1587,1591,1596,1601,1606,1610],{"type":344,"tag":597,"props":1564,"children":1565},{"style":651},[1566],{"type":353,"value":1567},"    throw",{"type":344,"tag":597,"props":1569,"children":1570},{"style":651},[1571],{"type":353,"value":1572}," new",{"type":344,"tag":597,"props":1574,"children":1575},{"style":668},[1576],{"type":353,"value":1577}," Error",{"type":344,"tag":597,"props":1579,"children":1580},{"style":674},[1581],{"type":353,"value":677},{"type":344,"tag":597,"props":1583,"children":1584},{"style":680},[1585],{"type":353,"value":1586},"\"Plain HTTP \"",{"type":344,"tag":597,"props":1588,"children":1589},{"style":651},[1590],{"type":353,"value":1479},{"type":344,"tag":597,"props":1592,"children":1593},{"style":674},[1594],{"type":353,"value":1595}," resp.status_code ",{"type":344,"tag":597,"props":1597,"children":1598},{"style":651},[1599],{"type":353,"value":1600},"+",{"type":344,"tag":597,"props":1602,"children":1603},{"style":680},[1604],{"type":353,"value":1605}," \": \"",{"type":344,"tag":597,"props":1607,"children":1608},{"style":651},[1609],{"type":353,"value":1479},{"type":344,"tag":597,"props":1611,"children":1612},{"style":674},[1613],{"type":353,"value":1614}," resp.body)\n",{"type":344,"tag":597,"props":1616,"children":1618},{"class":599,"line":1617},68,[1619],{"type":344,"tag":597,"props":1620,"children":1621},{"style":674},[1622],{"type":353,"value":1623},"  }\n",{"type":344,"tag":597,"props":1625,"children":1627},{"class":599,"line":1626},69,[1628,1632,1637,1641,1646,1650,1655],{"type":344,"tag":597,"props":1629,"children":1630},{"style":651},[1631],{"type":353,"value":1386},{"type":344,"tag":597,"props":1633,"children":1634},{"style":657},[1635],{"type":353,"value":1636}," body",{"type":344,"tag":597,"props":1638,"children":1639},{"style":651},[1640],{"type":353,"value":665},{"type":344,"tag":597,"props":1642,"children":1643},{"style":657},[1644],{"type":353,"value":1645}," JSON",{"type":344,"tag":597,"props":1647,"children":1648},{"style":674},[1649],{"type":353,"value":535},{"type":344,"tag":597,"props":1651,"children":1652},{"style":668},[1653],{"type":353,"value":1654},"parse",{"type":344,"tag":597,"props":1656,"children":1657},{"style":674},[1658],{"type":353,"value":1659},"(resp.body)\n",{"type":344,"tag":597,"props":1661,"children":1663},{"class":599,"line":1662},70,[1664,1668,1673,1678,1683,1688,1693,1698],{"type":344,"tag":597,"props":1665,"children":1666},{"style":651},[1667],{"type":353,"value":1539},{"type":344,"tag":597,"props":1669,"children":1670},{"style":674},[1671],{"type":353,"value":1672}," (body.errors ",{"type":344,"tag":597,"props":1674,"children":1675},{"style":651},[1676],{"type":353,"value":1677},"&&",{"type":344,"tag":597,"props":1679,"children":1680},{"style":674},[1681],{"type":353,"value":1682}," body.errors.",{"type":344,"tag":597,"props":1684,"children":1685},{"style":657},[1686],{"type":353,"value":1687},"length",{"type":344,"tag":597,"props":1689,"children":1690},{"style":651},[1691],{"type":353,"value":1692}," >",{"type":344,"tag":597,"props":1694,"children":1695},{"style":657},[1696],{"type":353,"value":1697}," 0",{"type":344,"tag":597,"props":1699,"children":1700},{"style":674},[1701],{"type":353,"value":1377},{"type":344,"tag":597,"props":1703,"children":1705},{"class":599,"line":1704},71,[1706,1710,1714,1718,1722,1727,1731,1735,1740,1744,1749,1754,1759,1764,1768,1773],{"type":344,"tag":597,"props":1707,"children":1708},{"style":651},[1709],{"type":353,"value":1567},{"type":344,"tag":597,"props":1711,"children":1712},{"style":651},[1713],{"type":353,"value":1572},{"type":344,"tag":597,"props":1715,"children":1716},{"style":668},[1717],{"type":353,"value":1577},{"type":344,"tag":597,"props":1719,"children":1720},{"style":674},[1721],{"type":353,"value":677},{"type":344,"tag":597,"props":1723,"children":1724},{"style":680},[1725],{"type":353,"value":1726},"\"Plain GraphQL: \"",{"type":344,"tag":597,"props":1728,"children":1729},{"style":651},[1730],{"type":353,"value":1479},{"type":344,"tag":597,"props":1732,"children":1733},{"style":674},[1734],{"type":353,"value":1682},{"type":344,"tag":597,"props":1736,"children":1737},{"style":668},[1738],{"type":353,"value":1739},"map",{"type":344,"tag":597,"props":1741,"children":1742},{"style":674},[1743],{"type":353,"value":677},{"type":344,"tag":597,"props":1745,"children":1746},{"style":1360},[1747],{"type":353,"value":1748},"e",{"type":344,"tag":597,"props":1750,"children":1751},{"style":651},[1752],{"type":353,"value":1753}," =>",{"type":344,"tag":597,"props":1755,"children":1756},{"style":674},[1757],{"type":353,"value":1758}," e.message).",{"type":344,"tag":597,"props":1760,"children":1761},{"style":668},[1762],{"type":353,"value":1763},"join",{"type":344,"tag":597,"props":1765,"children":1766},{"style":674},[1767],{"type":353,"value":677},{"type":344,"tag":597,"props":1769,"children":1770},{"style":680},[1771],{"type":353,"value":1772},"\"; \"",{"type":344,"tag":597,"props":1774,"children":1775},{"style":674},[1776],{"type":353,"value":1777},"))\n",{"type":344,"tag":597,"props":1779,"children":1781},{"class":599,"line":1780},72,[1782],{"type":344,"tag":597,"props":1783,"children":1784},{"style":674},[1785],{"type":353,"value":1623},{"type":344,"tag":597,"props":1787,"children":1789},{"class":599,"line":1788},73,[1790,1794,1799,1804,1809,1814,1818,1822,1826,1831],{"type":344,"tag":597,"props":1791,"children":1792},{"style":651},[1793],{"type":353,"value":1539},{"type":344,"tag":597,"props":1795,"children":1796},{"style":674},[1797],{"type":353,"value":1798}," (",{"type":344,"tag":597,"props":1800,"children":1801},{"style":651},[1802],{"type":353,"value":1803},"!",{"type":344,"tag":597,"props":1805,"children":1806},{"style":674},[1807],{"type":353,"value":1808},"body.data) ",{"type":344,"tag":597,"props":1810,"children":1811},{"style":651},[1812],{"type":353,"value":1813},"throw",{"type":344,"tag":597,"props":1815,"children":1816},{"style":651},[1817],{"type":353,"value":1572},{"type":344,"tag":597,"props":1819,"children":1820},{"style":668},[1821],{"type":353,"value":1577},{"type":344,"tag":597,"props":1823,"children":1824},{"style":674},[1825],{"type":353,"value":677},{"type":344,"tag":597,"props":1827,"children":1828},{"style":680},[1829],{"type":353,"value":1830},"\"Plain returned empty data\"",{"type":344,"tag":597,"props":1832,"children":1833},{"style":674},[1834],{"type":353,"value":1835},")\n",{"type":344,"tag":597,"props":1837,"children":1839},{"class":599,"line":1838},74,[1840,1845],{"type":344,"tag":597,"props":1841,"children":1842},{"style":651},[1843],{"type":353,"value":1844},"  return",{"type":344,"tag":597,"props":1846,"children":1847},{"style":674},[1848],{"type":353,"value":1849}," body.data\n",{"type":344,"tag":597,"props":1851,"children":1853},{"class":599,"line":1852},75,[1854],{"type":344,"tag":597,"props":1855,"children":1856},{"style":674},[1857],{"type":353,"value":1858},"}\n",{"type":344,"tag":597,"props":1860,"children":1862},{"class":599,"line":1861},76,[1863],{"type":344,"tag":597,"props":1864,"children":1865},{"emptyLinePlaceholder":632},[1866],{"type":353,"value":635},{"type":344,"tag":597,"props":1868,"children":1870},{"class":599,"line":1869},77,[1871,1875,1880,1884,1889,1893,1898,1902,1907],{"type":344,"tag":597,"props":1872,"children":1873},{"style":651},[1874],{"type":353,"value":1348},{"type":344,"tag":597,"props":1876,"children":1877},{"style":668},[1878],{"type":353,"value":1879}," upsertPlainCustomer",{"type":344,"tag":597,"props":1881,"children":1882},{"style":674},[1883],{"type":353,"value":677},{"type":344,"tag":597,"props":1885,"children":1886},{"style":1360},[1887],{"type":353,"value":1888},"email",{"type":344,"tag":597,"props":1890,"children":1891},{"style":674},[1892],{"type":353,"value":901},{"type":344,"tag":597,"props":1894,"children":1895},{"style":1360},[1896],{"type":353,"value":1897},"fullName",{"type":344,"tag":597,"props":1899,"children":1900},{"style":674},[1901],{"type":353,"value":901},{"type":344,"tag":597,"props":1903,"children":1904},{"style":1360},[1905],{"type":353,"value":1906},"stripeCustomerId",{"type":344,"tag":597,"props":1908,"children":1909},{"style":674},[1910],{"type":353,"value":1377},{"type":344,"tag":597,"props":1912,"children":1914},{"class":599,"line":1913},78,[1915,1919,1924,1928,1932,1936,1941],{"type":344,"tag":597,"props":1916,"children":1917},{"style":651},[1918],{"type":353,"value":1386},{"type":344,"tag":597,"props":1920,"children":1921},{"style":657},[1922],{"type":353,"value":1923}," data",{"type":344,"tag":597,"props":1925,"children":1926},{"style":651},[1927],{"type":353,"value":665},{"type":344,"tag":597,"props":1929,"children":1930},{"style":668},[1931],{"type":353,"value":1353},{"type":344,"tag":597,"props":1933,"children":1934},{"style":674},[1935],{"type":353,"value":677},{"type":344,"tag":597,"props":1937,"children":1938},{"style":657},[1939],{"type":353,"value":1940},"UPSERT_CUSTOMER",{"type":344,"tag":597,"props":1942,"children":1943},{"style":674},[1944],{"type":353,"value":1428},{"type":344,"tag":597,"props":1946,"children":1948},{"class":599,"line":1947},79,[1949],{"type":344,"tag":597,"props":1950,"children":1951},{"style":674},[1952],{"type":353,"value":1953},"    input: {\n",{"type":344,"tag":597,"props":1955,"children":1957},{"class":599,"line":1956},80,[1958],{"type":344,"tag":597,"props":1959,"children":1960},{"style":674},[1961],{"type":353,"value":1962},"      identifier: { emailAddress: email },\n",{"type":344,"tag":597,"props":1964,"children":1966},{"class":599,"line":1965},81,[1967],{"type":344,"tag":597,"props":1968,"children":1969},{"style":674},[1970],{"type":353,"value":1971},"      onCreate: {\n",{"type":344,"tag":597,"props":1973,"children":1975},{"class":599,"line":1974},82,[1976,1981,1986],{"type":344,"tag":597,"props":1977,"children":1978},{"style":674},[1979],{"type":353,"value":1980},"        fullName: fullName ",{"type":344,"tag":597,"props":1982,"children":1983},{"style":651},[1984],{"type":353,"value":1985},"||",{"type":344,"tag":597,"props":1987,"children":1988},{"style":674},[1989],{"type":353,"value":1990}," email,\n",{"type":344,"tag":597,"props":1992,"children":1994},{"class":599,"line":1993},83,[1995,2000,2005],{"type":344,"tag":597,"props":1996,"children":1997},{"style":674},[1998],{"type":353,"value":1999},"        email: { email: email, isVerified: ",{"type":344,"tag":597,"props":2001,"children":2002},{"style":657},[2003],{"type":353,"value":2004},"false",{"type":344,"tag":597,"props":2006,"children":2007},{"style":674},[2008],{"type":353,"value":2009}," },\n",{"type":344,"tag":597,"props":2011,"children":2013},{"class":599,"line":2012},84,[2014],{"type":344,"tag":597,"props":2015,"children":2016},{"style":674},[2017],{"type":353,"value":2018},"        externalId: stripeCustomerId\n",{"type":344,"tag":597,"props":2020,"children":2022},{"class":599,"line":2021},85,[2023],{"type":344,"tag":597,"props":2024,"children":2025},{"style":674},[2026],{"type":353,"value":2027},"      },\n",{"type":344,"tag":597,"props":2029,"children":2031},{"class":599,"line":2030},86,[2032],{"type":344,"tag":597,"props":2033,"children":2034},{"style":674},[2035],{"type":353,"value":2036},"      onUpdate: {}\n",{"type":344,"tag":597,"props":2038,"children":2040},{"class":599,"line":2039},87,[2041],{"type":344,"tag":597,"props":2042,"children":2043},{"style":674},[2044],{"type":353,"value":1091},{"type":344,"tag":597,"props":2046,"children":2048},{"class":599,"line":2047},88,[2049],{"type":344,"tag":597,"props":2050,"children":2051},{"style":674},[2052],{"type":353,"value":1530},{"type":344,"tag":597,"props":2054,"children":2056},{"class":599,"line":2055},89,[2057,2061],{"type":344,"tag":597,"props":2058,"children":2059},{"style":651},[2060],{"type":353,"value":1539},{"type":344,"tag":597,"props":2062,"children":2063},{"style":674},[2064],{"type":353,"value":2065}," (data.upsertCustomer.error) {\n",{"type":344,"tag":597,"props":2067,"children":2069},{"class":599,"line":2068},90,[2070,2074,2078,2082,2086,2091,2095],{"type":344,"tag":597,"props":2071,"children":2072},{"style":651},[2073],{"type":353,"value":1567},{"type":344,"tag":597,"props":2075,"children":2076},{"style":651},[2077],{"type":353,"value":1572},{"type":344,"tag":597,"props":2079,"children":2080},{"style":668},[2081],{"type":353,"value":1577},{"type":344,"tag":597,"props":2083,"children":2084},{"style":674},[2085],{"type":353,"value":677},{"type":344,"tag":597,"props":2087,"children":2088},{"style":680},[2089],{"type":353,"value":2090},"\"upsertCustomer: \"",{"type":344,"tag":597,"props":2092,"children":2093},{"style":651},[2094],{"type":353,"value":1479},{"type":344,"tag":597,"props":2096,"children":2097},{"style":674},[2098],{"type":353,"value":2099}," data.upsertCustomer.error.message)\n",{"type":344,"tag":597,"props":2101,"children":2103},{"class":599,"line":2102},91,[2104],{"type":344,"tag":597,"props":2105,"children":2106},{"style":674},[2107],{"type":353,"value":1623},{"type":344,"tag":597,"props":2109,"children":2111},{"class":599,"line":2110},92,[2112,2116],{"type":344,"tag":597,"props":2113,"children":2114},{"style":651},[2115],{"type":353,"value":1844},{"type":344,"tag":597,"props":2117,"children":2118},{"style":674},[2119],{"type":353,"value":2120}," data.upsertCustomer.customer.id\n",{"type":344,"tag":597,"props":2122,"children":2124},{"class":599,"line":2123},93,[2125],{"type":344,"tag":597,"props":2126,"children":2127},{"style":674},[2128],{"type":353,"value":1858},{"type":344,"tag":597,"props":2130,"children":2132},{"class":599,"line":2131},94,[2133],{"type":344,"tag":597,"props":2134,"children":2135},{"emptyLinePlaceholder":632},[2136],{"type":353,"value":635},{"type":344,"tag":597,"props":2138,"children":2140},{"class":599,"line":2139},95,[2141,2145,2150,2154,2158,2162,2167],{"type":344,"tag":597,"props":2142,"children":2143},{"style":651},[2144],{"type":353,"value":1348},{"type":344,"tag":597,"props":2146,"children":2147},{"style":668},[2148],{"type":353,"value":2149}," upsertPlainTenant",{"type":344,"tag":597,"props":2151,"children":2152},{"style":674},[2153],{"type":353,"value":677},{"type":344,"tag":597,"props":2155,"children":2156},{"style":1360},[2157],{"type":353,"value":1906},{"type":344,"tag":597,"props":2159,"children":2160},{"style":674},[2161],{"type":353,"value":901},{"type":344,"tag":597,"props":2163,"children":2164},{"style":1360},[2165],{"type":353,"value":2166},"name",{"type":344,"tag":597,"props":2168,"children":2169},{"style":674},[2170],{"type":353,"value":1377},{"type":344,"tag":597,"props":2172,"children":2174},{"class":599,"line":2173},96,[2175,2179,2183,2187,2191,2195,2200],{"type":344,"tag":597,"props":2176,"children":2177},{"style":651},[2178],{"type":353,"value":1386},{"type":344,"tag":597,"props":2180,"children":2181},{"style":657},[2182],{"type":353,"value":1923},{"type":344,"tag":597,"props":2184,"children":2185},{"style":651},[2186],{"type":353,"value":665},{"type":344,"tag":597,"props":2188,"children":2189},{"style":668},[2190],{"type":353,"value":1353},{"type":344,"tag":597,"props":2192,"children":2193},{"style":674},[2194],{"type":353,"value":677},{"type":344,"tag":597,"props":2196,"children":2197},{"style":657},[2198],{"type":353,"value":2199},"UPSERT_TENANT",{"type":344,"tag":597,"props":2201,"children":2202},{"style":674},[2203],{"type":353,"value":1428},{"type":344,"tag":597,"props":2205,"children":2207},{"class":599,"line":2206},97,[2208],{"type":344,"tag":597,"props":2209,"children":2210},{"style":674},[2211],{"type":353,"value":1953},{"type":344,"tag":597,"props":2213,"children":2215},{"class":599,"line":2214},98,[2216],{"type":344,"tag":597,"props":2217,"children":2218},{"style":674},[2219],{"type":353,"value":2220},"      identifier: { externalId: stripeCustomerId },\n",{"type":344,"tag":597,"props":2222,"children":2224},{"class":599,"line":2223},99,[2225],{"type":344,"tag":597,"props":2226,"children":2227},{"style":674},[2228],{"type":353,"value":2229},"      name: name,\n",{"type":344,"tag":597,"props":2231,"children":2233},{"class":599,"line":2232},100,[2234],{"type":344,"tag":597,"props":2235,"children":2236},{"style":674},[2237],{"type":353,"value":2238},"      externalId: stripeCustomerId\n",{"type":344,"tag":597,"props":2240,"children":2242},{"class":599,"line":2241},101,[2243],{"type":344,"tag":597,"props":2244,"children":2245},{"style":674},[2246],{"type":353,"value":1091},{"type":344,"tag":597,"props":2248,"children":2250},{"class":599,"line":2249},102,[2251],{"type":344,"tag":597,"props":2252,"children":2253},{"style":674},[2254],{"type":353,"value":1530},{"type":344,"tag":597,"props":2256,"children":2258},{"class":599,"line":2257},103,[2259,2263],{"type":344,"tag":597,"props":2260,"children":2261},{"style":651},[2262],{"type":353,"value":1539},{"type":344,"tag":597,"props":2264,"children":2265},{"style":674},[2266],{"type":353,"value":2267}," (data.upsertTenant.error) {\n",{"type":344,"tag":597,"props":2269,"children":2271},{"class":599,"line":2270},104,[2272,2276,2280,2284,2288,2293,2297],{"type":344,"tag":597,"props":2273,"children":2274},{"style":651},[2275],{"type":353,"value":1567},{"type":344,"tag":597,"props":2277,"children":2278},{"style":651},[2279],{"type":353,"value":1572},{"type":344,"tag":597,"props":2281,"children":2282},{"style":668},[2283],{"type":353,"value":1577},{"type":344,"tag":597,"props":2285,"children":2286},{"style":674},[2287],{"type":353,"value":677},{"type":344,"tag":597,"props":2289,"children":2290},{"style":680},[2291],{"type":353,"value":2292},"\"upsertTenant: \"",{"type":344,"tag":597,"props":2294,"children":2295},{"style":651},[2296],{"type":353,"value":1479},{"type":344,"tag":597,"props":2298,"children":2299},{"style":674},[2300],{"type":353,"value":2301}," data.upsertTenant.error.message)\n",{"type":344,"tag":597,"props":2303,"children":2305},{"class":599,"line":2304},105,[2306],{"type":344,"tag":597,"props":2307,"children":2308},{"style":674},[2309],{"type":353,"value":1623},{"type":344,"tag":597,"props":2311,"children":2313},{"class":599,"line":2312},106,[2314,2318],{"type":344,"tag":597,"props":2315,"children":2316},{"style":651},[2317],{"type":353,"value":1844},{"type":344,"tag":597,"props":2319,"children":2320},{"style":674},[2321],{"type":353,"value":2322}," data.upsertTenant.tenant.id\n",{"type":344,"tag":597,"props":2324,"children":2326},{"class":599,"line":2325},107,[2327],{"type":344,"tag":597,"props":2328,"children":2329},{"style":674},[2330],{"type":353,"value":1858},{"type":344,"tag":597,"props":2332,"children":2334},{"class":599,"line":2333},108,[2335],{"type":344,"tag":597,"props":2336,"children":2337},{"emptyLinePlaceholder":632},[2338],{"type":353,"value":635},{"type":344,"tag":597,"props":2340,"children":2342},{"class":599,"line":2341},109,[2343,2347,2352,2356,2361,2365,2370],{"type":344,"tag":597,"props":2344,"children":2345},{"style":651},[2346],{"type":353,"value":1348},{"type":344,"tag":597,"props":2348,"children":2349},{"style":668},[2350],{"type":353,"value":2351}," setPlainTenantTier",{"type":344,"tag":597,"props":2353,"children":2354},{"style":674},[2355],{"type":353,"value":677},{"type":344,"tag":597,"props":2357,"children":2358},{"style":1360},[2359],{"type":353,"value":2360},"tenantId",{"type":344,"tag":597,"props":2362,"children":2363},{"style":674},[2364],{"type":353,"value":901},{"type":344,"tag":597,"props":2366,"children":2367},{"style":1360},[2368],{"type":353,"value":2369},"tierId",{"type":344,"tag":597,"props":2371,"children":2372},{"style":674},[2373],{"type":353,"value":1377},{"type":344,"tag":597,"props":2375,"children":2377},{"class":599,"line":2376},110,[2378,2382,2386,2390,2395,2399,2403,2407,2411,2416],{"type":344,"tag":597,"props":2379,"children":2380},{"style":651},[2381],{"type":353,"value":1539},{"type":344,"tag":597,"props":2383,"children":2384},{"style":674},[2385],{"type":353,"value":1798},{"type":344,"tag":597,"props":2387,"children":2388},{"style":651},[2389],{"type":353,"value":1803},{"type":344,"tag":597,"props":2391,"children":2392},{"style":674},[2393],{"type":353,"value":2394},"tierId) ",{"type":344,"tag":597,"props":2396,"children":2397},{"style":651},[2398],{"type":353,"value":1813},{"type":344,"tag":597,"props":2400,"children":2401},{"style":651},[2402],{"type":353,"value":1572},{"type":344,"tag":597,"props":2404,"children":2405},{"style":668},[2406],{"type":353,"value":1577},{"type":344,"tag":597,"props":2408,"children":2409},{"style":674},[2410],{"type":353,"value":677},{"type":344,"tag":597,"props":2412,"children":2413},{"style":680},[2414],{"type":353,"value":2415},"\"PLAIN_PAID_TIER_ID is not set in function config\"",{"type":344,"tag":597,"props":2417,"children":2418},{"style":674},[2419],{"type":353,"value":1835},{"type":344,"tag":597,"props":2421,"children":2423},{"class":599,"line":2422},111,[2424,2429,2433,2438],{"type":344,"tag":597,"props":2425,"children":2426},{"style":668},[2427],{"type":353,"value":2428},"  plain",{"type":344,"tag":597,"props":2430,"children":2431},{"style":674},[2432],{"type":353,"value":677},{"type":344,"tag":597,"props":2434,"children":2435},{"style":657},[2436],{"type":353,"value":2437},"UPDATE_TENANT_TIER",{"type":344,"tag":597,"props":2439,"children":2440},{"style":674},[2441],{"type":353,"value":1428},{"type":344,"tag":597,"props":2443,"children":2445},{"class":599,"line":2444},112,[2446],{"type":344,"tag":597,"props":2447,"children":2448},{"style":674},[2449],{"type":353,"value":1953},{"type":344,"tag":597,"props":2451,"children":2453},{"class":599,"line":2452},113,[2454],{"type":344,"tag":597,"props":2455,"children":2456},{"style":674},[2457],{"type":353,"value":2458},"      tenantIdentifier: { tenantId: tenantId },\n",{"type":344,"tag":597,"props":2460,"children":2462},{"class":599,"line":2461},114,[2463],{"type":344,"tag":597,"props":2464,"children":2465},{"style":674},[2466],{"type":353,"value":2467},"      tierIdentifier: { tierId: tierId }\n",{"type":344,"tag":597,"props":2469,"children":2471},{"class":599,"line":2470},115,[2472],{"type":344,"tag":597,"props":2473,"children":2474},{"style":674},[2475],{"type":353,"value":1091},{"type":344,"tag":597,"props":2477,"children":2479},{"class":599,"line":2478},116,[2480],{"type":344,"tag":597,"props":2481,"children":2482},{"style":674},[2483],{"type":353,"value":1530},{"type":344,"tag":597,"props":2485,"children":2487},{"class":599,"line":2486},117,[2488],{"type":344,"tag":597,"props":2489,"children":2490},{"style":674},[2491],{"type":353,"value":1858},{"type":344,"tag":597,"props":2493,"children":2495},{"class":599,"line":2494},118,[2496],{"type":344,"tag":597,"props":2497,"children":2498},{"emptyLinePlaceholder":632},[2499],{"type":353,"value":635},{"type":344,"tag":597,"props":2501,"children":2503},{"class":599,"line":2502},119,[2504,2508,2513,2517,2521],{"type":344,"tag":597,"props":2505,"children":2506},{"style":651},[2507],{"type":353,"value":1348},{"type":344,"tag":597,"props":2509,"children":2510},{"style":668},[2511],{"type":353,"value":2512}," clearPlainTenantTier",{"type":344,"tag":597,"props":2514,"children":2515},{"style":674},[2516],{"type":353,"value":677},{"type":344,"tag":597,"props":2518,"children":2519},{"style":1360},[2520],{"type":353,"value":2360},{"type":344,"tag":597,"props":2522,"children":2523},{"style":674},[2524],{"type":353,"value":1377},{"type":344,"tag":597,"props":2526,"children":2528},{"class":599,"line":2527},120,[2529,2533,2537,2541],{"type":344,"tag":597,"props":2530,"children":2531},{"style":668},[2532],{"type":353,"value":2428},{"type":344,"tag":597,"props":2534,"children":2535},{"style":674},[2536],{"type":353,"value":677},{"type":344,"tag":597,"props":2538,"children":2539},{"style":657},[2540],{"type":353,"value":2437},{"type":344,"tag":597,"props":2542,"children":2543},{"style":674},[2544],{"type":353,"value":1428},{"type":344,"tag":597,"props":2546,"children":2548},{"class":599,"line":2547},121,[2549],{"type":344,"tag":597,"props":2550,"children":2551},{"style":674},[2552],{"type":353,"value":1953},{"type":344,"tag":597,"props":2554,"children":2556},{"class":599,"line":2555},122,[2557],{"type":344,"tag":597,"props":2558,"children":2559},{"style":674},[2560],{"type":353,"value":2458},{"type":344,"tag":597,"props":2562,"children":2564},{"class":599,"line":2563},123,[2565,2570],{"type":344,"tag":597,"props":2566,"children":2567},{"style":674},[2568],{"type":353,"value":2569},"      tierIdentifier: ",{"type":344,"tag":597,"props":2571,"children":2572},{"style":657},[2573],{"type":353,"value":2574},"null\n",{"type":344,"tag":597,"props":2576,"children":2578},{"class":599,"line":2577},124,[2579],{"type":344,"tag":597,"props":2580,"children":2581},{"style":674},[2582],{"type":353,"value":1091},{"type":344,"tag":597,"props":2584,"children":2586},{"class":599,"line":2585},125,[2587],{"type":344,"tag":597,"props":2588,"children":2589},{"style":674},[2590],{"type":353,"value":1530},{"type":344,"tag":597,"props":2592,"children":2594},{"class":599,"line":2593},126,[2595],{"type":344,"tag":597,"props":2596,"children":2597},{"style":674},[2598],{"type":353,"value":1858},{"type":344,"tag":597,"props":2600,"children":2602},{"class":599,"line":2601},127,[2603],{"type":344,"tag":597,"props":2604,"children":2605},{"emptyLinePlaceholder":632},[2606],{"type":353,"value":635},{"type":344,"tag":597,"props":2608,"children":2610},{"class":599,"line":2609},128,[2611,2615,2620,2624,2629,2633,2637],{"type":344,"tag":597,"props":2612,"children":2613},{"style":651},[2614],{"type":353,"value":1348},{"type":344,"tag":597,"props":2616,"children":2617},{"style":668},[2618],{"type":353,"value":2619}," linkPlainCustomerToTenant",{"type":344,"tag":597,"props":2621,"children":2622},{"style":674},[2623],{"type":353,"value":677},{"type":344,"tag":597,"props":2625,"children":2626},{"style":1360},[2627],{"type":353,"value":2628},"customerId",{"type":344,"tag":597,"props":2630,"children":2631},{"style":674},[2632],{"type":353,"value":901},{"type":344,"tag":597,"props":2634,"children":2635},{"style":1360},[2636],{"type":353,"value":2360},{"type":344,"tag":597,"props":2638,"children":2639},{"style":674},[2640],{"type":353,"value":1377},{"type":344,"tag":597,"props":2642,"children":2644},{"class":599,"line":2643},129,[2645,2649,2653,2658],{"type":344,"tag":597,"props":2646,"children":2647},{"style":668},[2648],{"type":353,"value":2428},{"type":344,"tag":597,"props":2650,"children":2651},{"style":674},[2652],{"type":353,"value":677},{"type":344,"tag":597,"props":2654,"children":2655},{"style":657},[2656],{"type":353,"value":2657},"ADD_CUSTOMER_TO_TENANTS",{"type":344,"tag":597,"props":2659,"children":2660},{"style":674},[2661],{"type":353,"value":1428},{"type":344,"tag":597,"props":2663,"children":2665},{"class":599,"line":2664},130,[2666],{"type":344,"tag":597,"props":2667,"children":2668},{"style":674},[2669],{"type":353,"value":1953},{"type":344,"tag":597,"props":2671,"children":2673},{"class":599,"line":2672},131,[2674],{"type":344,"tag":597,"props":2675,"children":2676},{"style":674},[2677],{"type":353,"value":2678},"      customerIdentifier: { customerId: customerId },\n",{"type":344,"tag":597,"props":2680,"children":2682},{"class":599,"line":2681},132,[2683],{"type":344,"tag":597,"props":2684,"children":2685},{"style":674},[2686],{"type":353,"value":2687},"      tenantIdentifiers: [{ tenantId: tenantId }]\n",{"type":344,"tag":597,"props":2689,"children":2691},{"class":599,"line":2690},133,[2692],{"type":344,"tag":597,"props":2693,"children":2694},{"style":674},[2695],{"type":353,"value":1091},{"type":344,"tag":597,"props":2697,"children":2699},{"class":599,"line":2698},134,[2700],{"type":344,"tag":597,"props":2701,"children":2702},{"style":674},[2703],{"type":353,"value":1530},{"type":344,"tag":597,"props":2705,"children":2707},{"class":599,"line":2706},135,[2708],{"type":344,"tag":597,"props":2709,"children":2710},{"style":674},[2711],{"type":353,"value":1858},{"type":344,"tag":597,"props":2713,"children":2715},{"class":599,"line":2714},136,[2716],{"type":344,"tag":597,"props":2717,"children":2718},{"emptyLinePlaceholder":632},[2719],{"type":353,"value":635},{"type":344,"tag":597,"props":2721,"children":2723},{"class":599,"line":2722},137,[2724],{"type":344,"tag":597,"props":2725,"children":2726},{"style":604},[2727],{"type":353,"value":2728},"// ---------- Stripe ----------\n",{"type":344,"tag":597,"props":2730,"children":2732},{"class":599,"line":2731},138,[2733],{"type":344,"tag":597,"props":2734,"children":2735},{"emptyLinePlaceholder":632},[2736],{"type":353,"value":635},{"type":344,"tag":597,"props":2738,"children":2740},{"class":599,"line":2739},139,[2741,2745,2750,2754,2758],{"type":344,"tag":597,"props":2742,"children":2743},{"style":651},[2744],{"type":353,"value":1348},{"type":344,"tag":597,"props":2746,"children":2747},{"style":668},[2748],{"type":353,"value":2749}," fetchStripeCustomer",{"type":344,"tag":597,"props":2751,"children":2752},{"style":674},[2753],{"type":353,"value":677},{"type":344,"tag":597,"props":2755,"children":2756},{"style":1360},[2757],{"type":353,"value":2628},{"type":344,"tag":597,"props":2759,"children":2760},{"style":674},[2761],{"type":353,"value":1377},{"type":344,"tag":597,"props":2763,"children":2765},{"class":599,"line":2764},140,[2766,2770,2774,2778,2782,2786],{"type":344,"tag":597,"props":2767,"children":2768},{"style":651},[2769],{"type":353,"value":1386},{"type":344,"tag":597,"props":2771,"children":2772},{"style":657},[2773],{"type":353,"value":1391},{"type":344,"tag":597,"props":2775,"children":2776},{"style":651},[2777],{"type":353,"value":665},{"type":344,"tag":597,"props":2779,"children":2780},{"style":674},[2781],{"type":353,"value":1400},{"type":344,"tag":597,"props":2783,"children":2784},{"style":668},[2785],{"type":353,"value":1405},{"type":344,"tag":597,"props":2787,"children":2788},{"style":674},[2789],{"type":353,"value":2790},"(\n",{"type":344,"tag":597,"props":2792,"children":2794},{"class":599,"line":2793},141,[2795,2800],{"type":344,"tag":597,"props":2796,"children":2797},{"style":680},[2798],{"type":353,"value":2799},"    \"GET\"",{"type":344,"tag":597,"props":2801,"children":2802},{"style":674},[2803],{"type":353,"value":956},{"type":344,"tag":597,"props":2805,"children":2807},{"class":599,"line":2806},142,[2808,2813,2817],{"type":344,"tag":597,"props":2809,"children":2810},{"style":680},[2811],{"type":353,"value":2812},"    \"https://api.stripe.com/v1/customers/\"",{"type":344,"tag":597,"props":2814,"children":2815},{"style":651},[2816],{"type":353,"value":1479},{"type":344,"tag":597,"props":2818,"children":2819},{"style":674},[2820],{"type":353,"value":2821}," customerId,\n",{"type":344,"tag":597,"props":2823,"children":2825},{"class":599,"line":2824},143,[2826,2831,2835,2839],{"type":344,"tag":597,"props":2827,"children":2828},{"style":674},[2829],{"type":353,"value":2830},"    { headers: { Authorization: ",{"type":344,"tag":597,"props":2832,"children":2833},{"style":680},[2834],{"type":353,"value":1474},{"type":344,"tag":597,"props":2836,"children":2837},{"style":651},[2838],{"type":353,"value":1479},{"type":344,"tag":597,"props":2840,"children":2841},{"style":674},[2842],{"type":353,"value":2843}," stripeApiKey } }\n",{"type":344,"tag":597,"props":2845,"children":2847},{"class":599,"line":2846},144,[2848],{"type":344,"tag":597,"props":2849,"children":2850},{"style":674},[2851],{"type":353,"value":2852},"  )\n",{"type":344,"tag":597,"props":2854,"children":2856},{"class":599,"line":2855},145,[2857,2861,2865,2869,2873],{"type":344,"tag":597,"props":2858,"children":2859},{"style":651},[2860],{"type":353,"value":1539},{"type":344,"tag":597,"props":2862,"children":2863},{"style":674},[2864],{"type":353,"value":1544},{"type":344,"tag":597,"props":2866,"children":2867},{"style":651},[2868],{"type":353,"value":1549},{"type":344,"tag":597,"props":2870,"children":2871},{"style":657},[2872],{"type":353,"value":1554},{"type":344,"tag":597,"props":2874,"children":2875},{"style":674},[2876],{"type":353,"value":1377},{"type":344,"tag":597,"props":2878,"children":2880},{"class":599,"line":2879},146,[2881,2885,2889,2893,2897,2902,2906,2910,2914,2918,2922],{"type":344,"tag":597,"props":2882,"children":2883},{"style":651},[2884],{"type":353,"value":1567},{"type":344,"tag":597,"props":2886,"children":2887},{"style":651},[2888],{"type":353,"value":1572},{"type":344,"tag":597,"props":2890,"children":2891},{"style":668},[2892],{"type":353,"value":1577},{"type":344,"tag":597,"props":2894,"children":2895},{"style":674},[2896],{"type":353,"value":677},{"type":344,"tag":597,"props":2898,"children":2899},{"style":680},[2900],{"type":353,"value":2901},"\"Stripe customer lookup \"",{"type":344,"tag":597,"props":2903,"children":2904},{"style":651},[2905],{"type":353,"value":1479},{"type":344,"tag":597,"props":2907,"children":2908},{"style":674},[2909],{"type":353,"value":1595},{"type":344,"tag":597,"props":2911,"children":2912},{"style":651},[2913],{"type":353,"value":1600},{"type":344,"tag":597,"props":2915,"children":2916},{"style":680},[2917],{"type":353,"value":1605},{"type":344,"tag":597,"props":2919,"children":2920},{"style":651},[2921],{"type":353,"value":1479},{"type":344,"tag":597,"props":2923,"children":2924},{"style":674},[2925],{"type":353,"value":1614},{"type":344,"tag":597,"props":2927,"children":2929},{"class":599,"line":2928},147,[2930],{"type":344,"tag":597,"props":2931,"children":2932},{"style":674},[2933],{"type":353,"value":1623},{"type":344,"tag":597,"props":2935,"children":2937},{"class":599,"line":2936},148,[2938,2942,2946,2950,2954],{"type":344,"tag":597,"props":2939,"children":2940},{"style":651},[2941],{"type":353,"value":1844},{"type":344,"tag":597,"props":2943,"children":2944},{"style":657},[2945],{"type":353,"value":1645},{"type":344,"tag":597,"props":2947,"children":2948},{"style":674},[2949],{"type":353,"value":535},{"type":344,"tag":597,"props":2951,"children":2952},{"style":668},[2953],{"type":353,"value":1654},{"type":344,"tag":597,"props":2955,"children":2956},{"style":674},[2957],{"type":353,"value":1659},{"type":344,"tag":597,"props":2959,"children":2961},{"class":599,"line":2960},149,[2962],{"type":344,"tag":597,"props":2963,"children":2964},{"style":674},[2965],{"type":353,"value":1858},{"type":344,"tag":597,"props":2967,"children":2969},{"class":599,"line":2968},150,[2970],{"type":344,"tag":597,"props":2971,"children":2972},{"emptyLinePlaceholder":632},[2973],{"type":353,"value":635},{"type":344,"tag":597,"props":2975,"children":2977},{"class":599,"line":2976},151,[2978],{"type":344,"tag":597,"props":2979,"children":2980},{"style":604},[2981],{"type":353,"value":2982},"// ---------- main ----------\n",{"type":344,"tag":597,"props":2984,"children":2986},{"class":599,"line":2985},152,[2987],{"type":344,"tag":597,"props":2988,"children":2989},{"emptyLinePlaceholder":632},[2990],{"type":353,"value":635},{"type":344,"tag":597,"props":2992,"children":2994},{"class":599,"line":2993},153,[2995,2999,3004,3008,3013,3017,3022],{"type":344,"tag":597,"props":2996,"children":2997},{"style":651},[2998],{"type":353,"value":1348},{"type":344,"tag":597,"props":3000,"children":3001},{"style":668},[3002],{"type":353,"value":3003}," answer",{"type":344,"tag":597,"props":3005,"children":3006},{"style":674},[3007],{"type":353,"value":677},{"type":344,"tag":597,"props":3009,"children":3010},{"style":1360},[3011],{"type":353,"value":3012},"status",{"type":344,"tag":597,"props":3014,"children":3015},{"style":674},[3016],{"type":353,"value":901},{"type":344,"tag":597,"props":3018,"children":3019},{"style":1360},[3020],{"type":353,"value":3021},"payload",{"type":344,"tag":597,"props":3023,"children":3024},{"style":674},[3025],{"type":353,"value":1377},{"type":344,"tag":597,"props":3027,"children":3029},{"class":599,"line":3028},154,[3030,3035,3040],{"type":344,"tag":597,"props":3031,"children":3032},{"style":674},[3033],{"type":353,"value":3034},"  r.",{"type":344,"tag":597,"props":3036,"children":3037},{"style":668},[3038],{"type":353,"value":3039},"setResponseStatus",{"type":344,"tag":597,"props":3041,"children":3042},{"style":674},[3043],{"type":353,"value":3044},"(status)\n",{"type":344,"tag":597,"props":3046,"children":3048},{"class":599,"line":3047},155,[3049,3053,3058,3062,3067,3071,3075],{"type":344,"tag":597,"props":3050,"children":3051},{"style":674},[3052],{"type":353,"value":3034},{"type":344,"tag":597,"props":3054,"children":3055},{"style":668},[3056],{"type":353,"value":3057},"setResponseHeader",{"type":344,"tag":597,"props":3059,"children":3060},{"style":674},[3061],{"type":353,"value":677},{"type":344,"tag":597,"props":3063,"children":3064},{"style":680},[3065],{"type":353,"value":3066},"\"Content-Type\"",{"type":344,"tag":597,"props":3068,"children":3069},{"style":674},[3070],{"type":353,"value":901},{"type":344,"tag":597,"props":3072,"children":3073},{"style":680},[3074],{"type":353,"value":1456},{"type":344,"tag":597,"props":3076,"children":3077},{"style":674},[3078],{"type":353,"value":1835},{"type":344,"tag":597,"props":3080,"children":3082},{"class":599,"line":3081},156,[3083,3087,3092,3096,3100,3104,3108],{"type":344,"tag":597,"props":3084,"children":3085},{"style":674},[3086],{"type":353,"value":3034},{"type":344,"tag":597,"props":3088,"children":3089},{"style":668},[3090],{"type":353,"value":3091},"setResponseBody",{"type":344,"tag":597,"props":3093,"children":3094},{"style":674},[3095],{"type":353,"value":677},{"type":344,"tag":597,"props":3097,"children":3098},{"style":657},[3099],{"type":353,"value":1507},{"type":344,"tag":597,"props":3101,"children":3102},{"style":674},[3103],{"type":353,"value":535},{"type":344,"tag":597,"props":3105,"children":3106},{"style":668},[3107],{"type":353,"value":1516},{"type":344,"tag":597,"props":3109,"children":3110},{"style":674},[3111],{"type":353,"value":3112},"(payload))\n",{"type":344,"tag":597,"props":3114,"children":3116},{"class":599,"line":3115},157,[3117,3121,3126],{"type":344,"tag":597,"props":3118,"children":3119},{"style":674},[3120],{"type":353,"value":3034},{"type":344,"tag":597,"props":3122,"children":3123},{"style":668},[3124],{"type":353,"value":3125},"stopForwarding",{"type":344,"tag":597,"props":3127,"children":3128},{"style":674},[3129],{"type":353,"value":3130},"()\n",{"type":344,"tag":597,"props":3132,"children":3134},{"class":599,"line":3133},158,[3135],{"type":344,"tag":597,"props":3136,"children":3137},{"style":674},[3138],{"type":353,"value":1858},{"type":344,"tag":597,"props":3140,"children":3142},{"class":599,"line":3141},159,[3143],{"type":344,"tag":597,"props":3144,"children":3145},{"emptyLinePlaceholder":632},[3146],{"type":353,"value":635},{"type":344,"tag":597,"props":3148,"children":3150},{"class":599,"line":3149},160,[3151],{"type":344,"tag":597,"props":3152,"children":3153},{"style":604},[3154],{"type":353,"value":3155},"// 1) Verify Stripe's signature before trusting the payload.\n",{"type":344,"tag":597,"props":3157,"children":3159},{"class":599,"line":3158},161,[3160],{"type":344,"tag":597,"props":3161,"children":3162},{"style":604},[3163],{"type":353,"value":3164},"//    Stripe-Signature: t=\u003Cunix ts>, v1=\u003Chex hmac of \"\u003Cts>.\u003Cbody>\">\n",{"type":344,"tag":597,"props":3166,"children":3168},{"class":599,"line":3167},162,[3169,3173,3178,3182,3187,3192,3197,3201],{"type":344,"tag":597,"props":3170,"children":3171},{"style":651},[3172],{"type":353,"value":654},{"type":344,"tag":597,"props":3174,"children":3175},{"style":657},[3176],{"type":353,"value":3177}," signature",{"type":344,"tag":597,"props":3179,"children":3180},{"style":651},[3181],{"type":353,"value":665},{"type":344,"tag":597,"props":3183,"children":3184},{"style":674},[3185],{"type":353,"value":3186}," r.headers[",{"type":344,"tag":597,"props":3188,"children":3189},{"style":680},[3190],{"type":353,"value":3191},"\"Stripe-Signature\"",{"type":344,"tag":597,"props":3193,"children":3194},{"style":674},[3195],{"type":353,"value":3196},"] ",{"type":344,"tag":597,"props":3198,"children":3199},{"style":651},[3200],{"type":353,"value":1985},{"type":344,"tag":597,"props":3202,"children":3203},{"style":680},[3204],{"type":353,"value":3205}," \"\"\n",{"type":344,"tag":597,"props":3207,"children":3209},{"class":599,"line":3208},163,[3210,3214,3219,3223,3228,3233,3237,3242,3248,3253,3257,3262,3266,3270,3274,3279,3284],{"type":344,"tag":597,"props":3211,"children":3212},{"style":651},[3213],{"type":353,"value":654},{"type":344,"tag":597,"props":3215,"children":3216},{"style":657},[3217],{"type":353,"value":3218}," timestamp",{"type":344,"tag":597,"props":3220,"children":3221},{"style":651},[3222],{"type":353,"value":665},{"type":344,"tag":597,"props":3224,"children":3225},{"style":674},[3226],{"type":353,"value":3227}," (signature.",{"type":344,"tag":597,"props":3229,"children":3230},{"style":668},[3231],{"type":353,"value":3232},"match",{"type":344,"tag":597,"props":3234,"children":3235},{"style":674},[3236],{"type":353,"value":677},{"type":344,"tag":597,"props":3238,"children":3239},{"style":680},[3240],{"type":353,"value":3241},"/",{"type":344,"tag":597,"props":3243,"children":3245},{"style":3244},"--shiki-default:#DBEDFF",[3246],{"type":353,"value":3247},"t=(",{"type":344,"tag":597,"props":3249,"children":3250},{"style":657},[3251],{"type":353,"value":3252},"\\d",{"type":344,"tag":597,"props":3254,"children":3255},{"style":651},[3256],{"type":353,"value":1600},{"type":344,"tag":597,"props":3258,"children":3259},{"style":3244},[3260],{"type":353,"value":3261},")",{"type":344,"tag":597,"props":3263,"children":3264},{"style":680},[3265],{"type":353,"value":3241},{"type":344,"tag":597,"props":3267,"children":3268},{"style":674},[3269],{"type":353,"value":688},{"type":344,"tag":597,"props":3271,"children":3272},{"style":651},[3273],{"type":353,"value":1985},{"type":344,"tag":597,"props":3275,"children":3276},{"style":674},[3277],{"type":353,"value":3278}," [])[",{"type":344,"tag":597,"props":3280,"children":3281},{"style":657},[3282],{"type":353,"value":3283},"1",{"type":344,"tag":597,"props":3285,"children":3286},{"style":674},[3287],{"type":353,"value":920},{"type":344,"tag":597,"props":3289,"children":3291},{"class":599,"line":3290},164,[3292,3296,3301,3305,3309,3313,3317,3321,3326,3331,3335,3339,3343,3347,3351,3355,3359],{"type":344,"tag":597,"props":3293,"children":3294},{"style":651},[3295],{"type":353,"value":654},{"type":344,"tag":597,"props":3297,"children":3298},{"style":657},[3299],{"type":353,"value":3300}," sent",{"type":344,"tag":597,"props":3302,"children":3303},{"style":651},[3304],{"type":353,"value":665},{"type":344,"tag":597,"props":3306,"children":3307},{"style":674},[3308],{"type":353,"value":3227},{"type":344,"tag":597,"props":3310,"children":3311},{"style":668},[3312],{"type":353,"value":3232},{"type":344,"tag":597,"props":3314,"children":3315},{"style":674},[3316],{"type":353,"value":677},{"type":344,"tag":597,"props":3318,"children":3319},{"style":680},[3320],{"type":353,"value":3241},{"type":344,"tag":597,"props":3322,"children":3323},{"style":3244},[3324],{"type":353,"value":3325},"v1=(",{"type":344,"tag":597,"props":3327,"children":3328},{"style":657},[3329],{"type":353,"value":3330},"[a-f0-9]",{"type":344,"tag":597,"props":3332,"children":3333},{"style":651},[3334],{"type":353,"value":1600},{"type":344,"tag":597,"props":3336,"children":3337},{"style":3244},[3338],{"type":353,"value":3261},{"type":344,"tag":597,"props":3340,"children":3341},{"style":680},[3342],{"type":353,"value":3241},{"type":344,"tag":597,"props":3344,"children":3345},{"style":674},[3346],{"type":353,"value":688},{"type":344,"tag":597,"props":3348,"children":3349},{"style":651},[3350],{"type":353,"value":1985},{"type":344,"tag":597,"props":3352,"children":3353},{"style":674},[3354],{"type":353,"value":3278},{"type":344,"tag":597,"props":3356,"children":3357},{"style":657},[3358],{"type":353,"value":3283},{"type":344,"tag":597,"props":3360,"children":3361},{"style":674},[3362],{"type":353,"value":920},{"type":344,"tag":597,"props":3364,"children":3366},{"class":599,"line":3365},165,[3367],{"type":344,"tag":597,"props":3368,"children":3369},{"emptyLinePlaceholder":632},[3370],{"type":353,"value":635},{"type":344,"tag":597,"props":3372,"children":3374},{"class":599,"line":3373},166,[3375,3380,3384,3388,3393,3397,3402],{"type":344,"tag":597,"props":3376,"children":3377},{"style":651},[3378],{"type":353,"value":3379},"if",{"type":344,"tag":597,"props":3381,"children":3382},{"style":674},[3383],{"type":353,"value":1798},{"type":344,"tag":597,"props":3385,"children":3386},{"style":651},[3387],{"type":353,"value":1803},{"type":344,"tag":597,"props":3389,"children":3390},{"style":674},[3391],{"type":353,"value":3392},"timestamp ",{"type":344,"tag":597,"props":3394,"children":3395},{"style":651},[3396],{"type":353,"value":1985},{"type":344,"tag":597,"props":3398,"children":3399},{"style":651},[3400],{"type":353,"value":3401}," !",{"type":344,"tag":597,"props":3403,"children":3404},{"style":674},[3405],{"type":353,"value":3406},"sent) {\n",{"type":344,"tag":597,"props":3408,"children":3410},{"class":599,"line":3409},167,[3411,3416,3420,3425,3430,3435],{"type":344,"tag":597,"props":3412,"children":3413},{"style":668},[3414],{"type":353,"value":3415},"  answer",{"type":344,"tag":597,"props":3417,"children":3418},{"style":674},[3419],{"type":353,"value":677},{"type":344,"tag":597,"props":3421,"children":3422},{"style":657},[3423],{"type":353,"value":3424},"400",{"type":344,"tag":597,"props":3426,"children":3427},{"style":674},[3428],{"type":353,"value":3429},", { error: ",{"type":344,"tag":597,"props":3431,"children":3432},{"style":680},[3433],{"type":353,"value":3434},"\"missing Stripe-Signature header\"",{"type":344,"tag":597,"props":3436,"children":3437},{"style":674},[3438],{"type":353,"value":3439}," })\n",{"type":344,"tag":597,"props":3441,"children":3443},{"class":599,"line":3442},168,[3444],{"type":344,"tag":597,"props":3445,"children":3446},{"style":651},[3447],{"type":353,"value":3448},"  return\n",{"type":344,"tag":597,"props":3450,"children":3452},{"class":599,"line":3451},169,[3453],{"type":344,"tag":597,"props":3454,"children":3455},{"style":674},[3456],{"type":353,"value":1858},{"type":344,"tag":597,"props":3458,"children":3460},{"class":599,"line":3459},170,[3461,3465,3470,3475,3480,3485,3490,3495,3500,3505,3510,3515,3520,3524],{"type":344,"tag":597,"props":3462,"children":3463},{"style":651},[3464],{"type":353,"value":3379},{"type":344,"tag":597,"props":3466,"children":3467},{"style":674},[3468],{"type":353,"value":3469}," (Math.",{"type":344,"tag":597,"props":3471,"children":3472},{"style":668},[3473],{"type":353,"value":3474},"abs",{"type":344,"tag":597,"props":3476,"children":3477},{"style":674},[3478],{"type":353,"value":3479},"(time.",{"type":344,"tag":597,"props":3481,"children":3482},{"style":668},[3483],{"type":353,"value":3484},"unix",{"type":344,"tag":597,"props":3486,"children":3487},{"style":674},[3488],{"type":353,"value":3489},"() ",{"type":344,"tag":597,"props":3491,"children":3492},{"style":651},[3493],{"type":353,"value":3494},"-",{"type":344,"tag":597,"props":3496,"children":3497},{"style":668},[3498],{"type":353,"value":3499}," parseInt",{"type":344,"tag":597,"props":3501,"children":3502},{"style":674},[3503],{"type":353,"value":3504},"(timestamp, ",{"type":344,"tag":597,"props":3506,"children":3507},{"style":657},[3508],{"type":353,"value":3509},"10",{"type":344,"tag":597,"props":3511,"children":3512},{"style":674},[3513],{"type":353,"value":3514},")) ",{"type":344,"tag":597,"props":3516,"children":3517},{"style":651},[3518],{"type":353,"value":3519},">",{"type":344,"tag":597,"props":3521,"children":3522},{"style":657},[3523],{"type":353,"value":852},{"type":344,"tag":597,"props":3525,"children":3526},{"style":674},[3527],{"type":353,"value":1377},{"type":344,"tag":597,"props":3529,"children":3531},{"class":599,"line":3530},171,[3532,3536,3540,3544,3548,3553],{"type":344,"tag":597,"props":3533,"children":3534},{"style":668},[3535],{"type":353,"value":3415},{"type":344,"tag":597,"props":3537,"children":3538},{"style":674},[3539],{"type":353,"value":677},{"type":344,"tag":597,"props":3541,"children":3542},{"style":657},[3543],{"type":353,"value":3424},{"type":344,"tag":597,"props":3545,"children":3546},{"style":674},[3547],{"type":353,"value":3429},{"type":344,"tag":597,"props":3549,"children":3550},{"style":680},[3551],{"type":353,"value":3552},"\"timestamp outside tolerance\"",{"type":344,"tag":597,"props":3554,"children":3555},{"style":674},[3556],{"type":353,"value":3439},{"type":344,"tag":597,"props":3558,"children":3560},{"class":599,"line":3559},172,[3561],{"type":344,"tag":597,"props":3562,"children":3563},{"style":651},[3564],{"type":353,"value":3448},{"type":344,"tag":597,"props":3566,"children":3568},{"class":599,"line":3567},173,[3569],{"type":344,"tag":597,"props":3570,"children":3571},{"style":674},[3572],{"type":353,"value":1858},{"type":344,"tag":597,"props":3574,"children":3576},{"class":599,"line":3575},174,[3577,3581,3586,3590,3595,3600,3604,3609,3614,3618,3623,3627],{"type":344,"tag":597,"props":3578,"children":3579},{"style":651},[3580],{"type":353,"value":654},{"type":344,"tag":597,"props":3582,"children":3583},{"style":657},[3584],{"type":353,"value":3585}," expected",{"type":344,"tag":597,"props":3587,"children":3588},{"style":651},[3589],{"type":353,"value":665},{"type":344,"tag":597,"props":3591,"children":3592},{"style":674},[3593],{"type":353,"value":3594}," crypto.",{"type":344,"tag":597,"props":3596,"children":3597},{"style":668},[3598],{"type":353,"value":3599},"hmac",{"type":344,"tag":597,"props":3601,"children":3602},{"style":674},[3603],{"type":353,"value":677},{"type":344,"tag":597,"props":3605,"children":3606},{"style":680},[3607],{"type":353,"value":3608},"\"sha256\"",{"type":344,"tag":597,"props":3610,"children":3611},{"style":674},[3612],{"type":353,"value":3613},", stripeSigningSecret, timestamp ",{"type":344,"tag":597,"props":3615,"children":3616},{"style":651},[3617],{"type":353,"value":1600},{"type":344,"tag":597,"props":3619,"children":3620},{"style":680},[3621],{"type":353,"value":3622}," \".\"",{"type":344,"tag":597,"props":3624,"children":3625},{"style":651},[3626],{"type":353,"value":1479},{"type":344,"tag":597,"props":3628,"children":3629},{"style":674},[3630],{"type":353,"value":3631}," r.body)\n",{"type":344,"tag":597,"props":3633,"children":3635},{"class":599,"line":3634},175,[3636,3640,3645,3649],{"type":344,"tag":597,"props":3637,"children":3638},{"style":651},[3639],{"type":353,"value":3379},{"type":344,"tag":597,"props":3641,"children":3642},{"style":674},[3643],{"type":353,"value":3644}," (expected ",{"type":344,"tag":597,"props":3646,"children":3647},{"style":651},[3648],{"type":353,"value":1549},{"type":344,"tag":597,"props":3650,"children":3651},{"style":674},[3652],{"type":353,"value":3653}," sent) {\n",{"type":344,"tag":597,"props":3655,"children":3657},{"class":599,"line":3656},176,[3658,3662,3666,3670,3674,3679],{"type":344,"tag":597,"props":3659,"children":3660},{"style":668},[3661],{"type":353,"value":3415},{"type":344,"tag":597,"props":3663,"children":3664},{"style":674},[3665],{"type":353,"value":677},{"type":344,"tag":597,"props":3667,"children":3668},{"style":657},[3669],{"type":353,"value":3424},{"type":344,"tag":597,"props":3671,"children":3672},{"style":674},[3673],{"type":353,"value":3429},{"type":344,"tag":597,"props":3675,"children":3676},{"style":680},[3677],{"type":353,"value":3678},"\"signature mismatch\"",{"type":344,"tag":597,"props":3680,"children":3681},{"style":674},[3682],{"type":353,"value":3439},{"type":344,"tag":597,"props":3684,"children":3686},{"class":599,"line":3685},177,[3687],{"type":344,"tag":597,"props":3688,"children":3689},{"style":651},[3690],{"type":353,"value":3448},{"type":344,"tag":597,"props":3692,"children":3694},{"class":599,"line":3693},178,[3695],{"type":344,"tag":597,"props":3696,"children":3697},{"style":674},[3698],{"type":353,"value":1858},{"type":344,"tag":597,"props":3700,"children":3702},{"class":599,"line":3701},179,[3703],{"type":344,"tag":597,"props":3704,"children":3705},{"emptyLinePlaceholder":632},[3706],{"type":353,"value":635},{"type":344,"tag":597,"props":3708,"children":3710},{"class":599,"line":3709},180,[3711],{"type":344,"tag":597,"props":3712,"children":3713},{"style":604},[3714],{"type":353,"value":3715},"// 2) Parse the event; ignore anything we do not sync.\n",{"type":344,"tag":597,"props":3717,"children":3719},{"class":599,"line":3718},181,[3720,3725],{"type":344,"tag":597,"props":3721,"children":3722},{"style":651},[3723],{"type":353,"value":3724},"let",{"type":344,"tag":597,"props":3726,"children":3727},{"style":674},[3728],{"type":353,"value":3729}," event\n",{"type":344,"tag":597,"props":3731,"children":3733},{"class":599,"line":3732},182,[3734,3739],{"type":344,"tag":597,"props":3735,"children":3736},{"style":651},[3737],{"type":353,"value":3738},"try",{"type":344,"tag":597,"props":3740,"children":3741},{"style":674},[3742],{"type":353,"value":3743}," {\n",{"type":344,"tag":597,"props":3745,"children":3747},{"class":599,"line":3746},183,[3748,3753,3758,3762,3766,3770],{"type":344,"tag":597,"props":3749,"children":3750},{"style":674},[3751],{"type":353,"value":3752},"  event ",{"type":344,"tag":597,"props":3754,"children":3755},{"style":651},[3756],{"type":353,"value":3757},"=",{"type":344,"tag":597,"props":3759,"children":3760},{"style":657},[3761],{"type":353,"value":1645},{"type":344,"tag":597,"props":3763,"children":3764},{"style":674},[3765],{"type":353,"value":535},{"type":344,"tag":597,"props":3767,"children":3768},{"style":668},[3769],{"type":353,"value":1654},{"type":344,"tag":597,"props":3771,"children":3772},{"style":674},[3773],{"type":353,"value":3774},"(r.body)\n",{"type":344,"tag":597,"props":3776,"children":3778},{"class":599,"line":3777},184,[3779,3784,3789],{"type":344,"tag":597,"props":3780,"children":3781},{"style":674},[3782],{"type":353,"value":3783},"} ",{"type":344,"tag":597,"props":3785,"children":3786},{"style":651},[3787],{"type":353,"value":3788},"catch",{"type":344,"tag":597,"props":3790,"children":3791},{"style":674},[3792],{"type":353,"value":3793}," (e) {\n",{"type":344,"tag":597,"props":3795,"children":3797},{"class":599,"line":3796},185,[3798,3802,3806,3810,3814,3819],{"type":344,"tag":597,"props":3799,"children":3800},{"style":668},[3801],{"type":353,"value":3415},{"type":344,"tag":597,"props":3803,"children":3804},{"style":674},[3805],{"type":353,"value":677},{"type":344,"tag":597,"props":3807,"children":3808},{"style":657},[3809],{"type":353,"value":3424},{"type":344,"tag":597,"props":3811,"children":3812},{"style":674},[3813],{"type":353,"value":3429},{"type":344,"tag":597,"props":3815,"children":3816},{"style":680},[3817],{"type":353,"value":3818},"\"invalid JSON body\"",{"type":344,"tag":597,"props":3820,"children":3821},{"style":674},[3822],{"type":353,"value":3439},{"type":344,"tag":597,"props":3824,"children":3826},{"class":599,"line":3825},186,[3827],{"type":344,"tag":597,"props":3828,"children":3829},{"style":651},[3830],{"type":353,"value":3448},{"type":344,"tag":597,"props":3832,"children":3834},{"class":599,"line":3833},187,[3835],{"type":344,"tag":597,"props":3836,"children":3837},{"style":674},[3838],{"type":353,"value":1858},{"type":344,"tag":597,"props":3840,"children":3842},{"class":599,"line":3841},188,[3843,3847,3851,3856,3860,3865,3870,3875,3880,3884],{"type":344,"tag":597,"props":3844,"children":3845},{"style":651},[3846],{"type":353,"value":3379},{"type":344,"tag":597,"props":3848,"children":3849},{"style":674},[3850],{"type":353,"value":1798},{"type":344,"tag":597,"props":3852,"children":3853},{"style":657},[3854],{"type":353,"value":3855},"HANDLED_EVENTS",{"type":344,"tag":597,"props":3857,"children":3858},{"style":674},[3859],{"type":353,"value":535},{"type":344,"tag":597,"props":3861,"children":3862},{"style":668},[3863],{"type":353,"value":3864},"indexOf",{"type":344,"tag":597,"props":3866,"children":3867},{"style":674},[3868],{"type":353,"value":3869},"(event.type) ",{"type":344,"tag":597,"props":3871,"children":3872},{"style":651},[3873],{"type":353,"value":3874},"===",{"type":344,"tag":597,"props":3876,"children":3877},{"style":651},[3878],{"type":353,"value":3879}," -",{"type":344,"tag":597,"props":3881,"children":3882},{"style":657},[3883],{"type":353,"value":3283},{"type":344,"tag":597,"props":3885,"children":3886},{"style":674},[3887],{"type":353,"value":1377},{"type":344,"tag":597,"props":3889,"children":3891},{"class":599,"line":3890},189,[3892,3896,3900,3905,3910,3915,3920,3924],{"type":344,"tag":597,"props":3893,"children":3894},{"style":668},[3895],{"type":353,"value":3415},{"type":344,"tag":597,"props":3897,"children":3898},{"style":674},[3899],{"type":353,"value":677},{"type":344,"tag":597,"props":3901,"children":3902},{"style":657},[3903],{"type":353,"value":3904},"200",{"type":344,"tag":597,"props":3906,"children":3907},{"style":674},[3908],{"type":353,"value":3909},", { received: ",{"type":344,"tag":597,"props":3911,"children":3912},{"style":657},[3913],{"type":353,"value":3914},"true",{"type":344,"tag":597,"props":3916,"children":3917},{"style":674},[3918],{"type":353,"value":3919},", handled: ",{"type":344,"tag":597,"props":3921,"children":3922},{"style":657},[3923],{"type":353,"value":2004},{"type":344,"tag":597,"props":3925,"children":3926},{"style":674},[3927],{"type":353,"value":3928},", type: event.type })\n",{"type":344,"tag":597,"props":3930,"children":3932},{"class":599,"line":3931},190,[3933],{"type":344,"tag":597,"props":3934,"children":3935},{"style":651},[3936],{"type":353,"value":3448},{"type":344,"tag":597,"props":3938,"children":3940},{"class":599,"line":3939},191,[3941],{"type":344,"tag":597,"props":3942,"children":3943},{"style":674},[3944],{"type":353,"value":1858},{"type":344,"tag":597,"props":3946,"children":3948},{"class":599,"line":3947},192,[3949],{"type":344,"tag":597,"props":3950,"children":3951},{"emptyLinePlaceholder":632},[3952],{"type":353,"value":635},{"type":344,"tag":597,"props":3954,"children":3956},{"class":599,"line":3955},193,[3957],{"type":344,"tag":597,"props":3958,"children":3959},{"style":604},[3960],{"type":353,"value":3961},"// 3) Sync. Any Plain error → 500 so Stripe retries the delivery.\n",{"type":344,"tag":597,"props":3963,"children":3965},{"class":599,"line":3964},194,[3966,3970],{"type":344,"tag":597,"props":3967,"children":3968},{"style":651},[3969],{"type":353,"value":3738},{"type":344,"tag":597,"props":3971,"children":3972},{"style":674},[3973],{"type":353,"value":3743},{"type":344,"tag":597,"props":3975,"children":3977},{"class":599,"line":3976},195,[3978,3982,3987,3991,3996],{"type":344,"tag":597,"props":3979,"children":3980},{"style":651},[3981],{"type":353,"value":1386},{"type":344,"tag":597,"props":3983,"children":3984},{"style":657},[3985],{"type":353,"value":3986}," outcome",{"type":344,"tag":597,"props":3988,"children":3989},{"style":651},[3990],{"type":353,"value":665},{"type":344,"tag":597,"props":3992,"children":3993},{"style":668},[3994],{"type":353,"value":3995}," syncEvent",{"type":344,"tag":597,"props":3997,"children":3998},{"style":674},[3999],{"type":353,"value":4000},"(event)\n",{"type":344,"tag":597,"props":4002,"children":4004},{"class":599,"line":4003},196,[4005,4010,4015,4019,4024,4029,4033,4037,4041],{"type":344,"tag":597,"props":4006,"children":4007},{"style":674},[4008],{"type":353,"value":4009},"  console.",{"type":344,"tag":597,"props":4011,"children":4012},{"style":668},[4013],{"type":353,"value":4014},"log",{"type":344,"tag":597,"props":4016,"children":4017},{"style":674},[4018],{"type":353,"value":677},{"type":344,"tag":597,"props":4020,"children":4021},{"style":680},[4022],{"type":353,"value":4023},"\"stripe-to-plain\"",{"type":344,"tag":597,"props":4025,"children":4026},{"style":674},[4027],{"type":353,"value":4028},", event.type, ",{"type":344,"tag":597,"props":4030,"children":4031},{"style":657},[4032],{"type":353,"value":1507},{"type":344,"tag":597,"props":4034,"children":4035},{"style":674},[4036],{"type":353,"value":535},{"type":344,"tag":597,"props":4038,"children":4039},{"style":668},[4040],{"type":353,"value":1516},{"type":344,"tag":597,"props":4042,"children":4043},{"style":674},[4044],{"type":353,"value":4045},"(outcome))\n",{"type":344,"tag":597,"props":4047,"children":4049},{"class":599,"line":4048},197,[4050,4054,4058,4062,4066,4070,4074,4078],{"type":344,"tag":597,"props":4051,"children":4052},{"style":668},[4053],{"type":353,"value":3415},{"type":344,"tag":597,"props":4055,"children":4056},{"style":674},[4057],{"type":353,"value":677},{"type":344,"tag":597,"props":4059,"children":4060},{"style":657},[4061],{"type":353,"value":3904},{"type":344,"tag":597,"props":4063,"children":4064},{"style":674},[4065],{"type":353,"value":3909},{"type":344,"tag":597,"props":4067,"children":4068},{"style":657},[4069],{"type":353,"value":3914},{"type":344,"tag":597,"props":4071,"children":4072},{"style":674},[4073],{"type":353,"value":3919},{"type":344,"tag":597,"props":4075,"children":4076},{"style":657},[4077],{"type":353,"value":3914},{"type":344,"tag":597,"props":4079,"children":4080},{"style":674},[4081],{"type":353,"value":4082},", outcome: outcome })\n",{"type":344,"tag":597,"props":4084,"children":4086},{"class":599,"line":4085},198,[4087,4091,4095],{"type":344,"tag":597,"props":4088,"children":4089},{"style":674},[4090],{"type":353,"value":3783},{"type":344,"tag":597,"props":4092,"children":4093},{"style":651},[4094],{"type":353,"value":3788},{"type":344,"tag":597,"props":4096,"children":4097},{"style":674},[4098],{"type":353,"value":3793},{"type":344,"tag":597,"props":4100,"children":4102},{"class":599,"line":4101},199,[4103,4107,4112,4116,4121,4125,4130],{"type":344,"tag":597,"props":4104,"children":4105},{"style":674},[4106],{"type":353,"value":4009},{"type":344,"tag":597,"props":4108,"children":4109},{"style":668},[4110],{"type":353,"value":4111},"error",{"type":344,"tag":597,"props":4113,"children":4114},{"style":674},[4115],{"type":353,"value":677},{"type":344,"tag":597,"props":4117,"children":4118},{"style":680},[4119],{"type":353,"value":4120},"\"stripe-to-plain error\"",{"type":344,"tag":597,"props":4122,"children":4123},{"style":674},[4124],{"type":353,"value":4028},{"type":344,"tag":597,"props":4126,"children":4127},{"style":668},[4128],{"type":353,"value":4129},"String",{"type":344,"tag":597,"props":4131,"children":4132},{"style":674},[4133],{"type":353,"value":4134},"(e))\n",{"type":344,"tag":597,"props":4136,"children":4138},{"class":599,"line":4137},200,[4139,4143,4147,4152,4156,4160],{"type":344,"tag":597,"props":4140,"children":4141},{"style":668},[4142],{"type":353,"value":3415},{"type":344,"tag":597,"props":4144,"children":4145},{"style":674},[4146],{"type":353,"value":677},{"type":344,"tag":597,"props":4148,"children":4149},{"style":657},[4150],{"type":353,"value":4151},"500",{"type":344,"tag":597,"props":4153,"children":4154},{"style":674},[4155],{"type":353,"value":3429},{"type":344,"tag":597,"props":4157,"children":4158},{"style":668},[4159],{"type":353,"value":4129},{"type":344,"tag":597,"props":4161,"children":4162},{"style":674},[4163],{"type":353,"value":4164},"(e) })\n",{"type":344,"tag":597,"props":4166,"children":4168},{"class":599,"line":4167},201,[4169],{"type":344,"tag":597,"props":4170,"children":4171},{"style":674},[4172],{"type":353,"value":1858},{"type":344,"tag":597,"props":4174,"children":4176},{"class":599,"line":4175},202,[4177],{"type":344,"tag":597,"props":4178,"children":4179},{"emptyLinePlaceholder":632},[4180],{"type":353,"value":635},{"type":344,"tag":597,"props":4182,"children":4184},{"class":599,"line":4183},203,[4185],{"type":344,"tag":597,"props":4186,"children":4187},{"style":604},[4188],{"type":353,"value":4189},"// ---------- sync ----------\n",{"type":344,"tag":597,"props":4191,"children":4193},{"class":599,"line":4192},204,[4194],{"type":344,"tag":597,"props":4195,"children":4196},{"emptyLinePlaceholder":632},[4197],{"type":353,"value":635},{"type":344,"tag":597,"props":4199,"children":4201},{"class":599,"line":4200},205,[4202,4206,4210,4214,4219],{"type":344,"tag":597,"props":4203,"children":4204},{"style":651},[4205],{"type":353,"value":1348},{"type":344,"tag":597,"props":4207,"children":4208},{"style":668},[4209],{"type":353,"value":3995},{"type":344,"tag":597,"props":4211,"children":4212},{"style":674},[4213],{"type":353,"value":677},{"type":344,"tag":597,"props":4215,"children":4216},{"style":1360},[4217],{"type":353,"value":4218},"event",{"type":344,"tag":597,"props":4220,"children":4221},{"style":674},[4222],{"type":353,"value":1377},{"type":344,"tag":597,"props":4224,"children":4226},{"class":599,"line":4225},206,[4227,4232],{"type":344,"tag":597,"props":4228,"children":4229},{"style":651},[4230],{"type":353,"value":4231},"  let",{"type":344,"tag":597,"props":4233,"children":4234},{"style":674},[4235],{"type":353,"value":4236}," email, name, stripeCustomerId, tier\n",{"type":344,"tag":597,"props":4238,"children":4240},{"class":599,"line":4239},207,[4241],{"type":344,"tag":597,"props":4242,"children":4243},{"emptyLinePlaceholder":632},[4244],{"type":353,"value":635},{"type":344,"tag":597,"props":4246,"children":4248},{"class":599,"line":4247},208,[4249,4253,4258,4262,4267],{"type":344,"tag":597,"props":4250,"children":4251},{"style":651},[4252],{"type":353,"value":1539},{"type":344,"tag":597,"props":4254,"children":4255},{"style":674},[4256],{"type":353,"value":4257}," (event.type ",{"type":344,"tag":597,"props":4259,"children":4260},{"style":651},[4261],{"type":353,"value":3874},{"type":344,"tag":597,"props":4263,"children":4264},{"style":680},[4265],{"type":353,"value":4266}," \"customer.created\"",{"type":344,"tag":597,"props":4268,"children":4269},{"style":674},[4270],{"type":353,"value":1377},{"type":344,"tag":597,"props":4272,"children":4274},{"class":599,"line":4273},209,[4275],{"type":344,"tag":597,"props":4276,"children":4277},{"style":604},[4278],{"type":353,"value":4279},"    // New Stripe customer: make sure they exist in Plain on the free tier.\n",{"type":344,"tag":597,"props":4281,"children":4283},{"class":599,"line":4282},210,[4284,4289,4294,4298],{"type":344,"tag":597,"props":4285,"children":4286},{"style":651},[4287],{"type":353,"value":4288},"    const",{"type":344,"tag":597,"props":4290,"children":4291},{"style":657},[4292],{"type":353,"value":4293}," c",{"type":344,"tag":597,"props":4295,"children":4296},{"style":651},[4297],{"type":353,"value":665},{"type":344,"tag":597,"props":4299,"children":4300},{"style":674},[4301],{"type":353,"value":4302}," event.data.object\n",{"type":344,"tag":597,"props":4304,"children":4306},{"class":599,"line":4305},211,[4307,4312,4316,4320,4325,4330,4335,4340,4345,4350],{"type":344,"tag":597,"props":4308,"children":4309},{"style":651},[4310],{"type":353,"value":4311},"    if",{"type":344,"tag":597,"props":4313,"children":4314},{"style":674},[4315],{"type":353,"value":1798},{"type":344,"tag":597,"props":4317,"children":4318},{"style":651},[4319],{"type":353,"value":1803},{"type":344,"tag":597,"props":4321,"children":4322},{"style":674},[4323],{"type":353,"value":4324},"c.email) ",{"type":344,"tag":597,"props":4326,"children":4327},{"style":651},[4328],{"type":353,"value":4329},"return",{"type":344,"tag":597,"props":4331,"children":4332},{"style":674},[4333],{"type":353,"value":4334}," { action: ",{"type":344,"tag":597,"props":4336,"children":4337},{"style":680},[4338],{"type":353,"value":4339},"\"noop\"",{"type":344,"tag":597,"props":4341,"children":4342},{"style":674},[4343],{"type":353,"value":4344},", reason: ",{"type":344,"tag":597,"props":4346,"children":4347},{"style":680},[4348],{"type":353,"value":4349},"\"customer_has_no_email\"",{"type":344,"tag":597,"props":4351,"children":4352},{"style":674},[4353],{"type":353,"value":4354}," }\n",{"type":344,"tag":597,"props":4356,"children":4358},{"class":599,"line":4357},212,[4359,4364,4368],{"type":344,"tag":597,"props":4360,"children":4361},{"style":674},[4362],{"type":353,"value":4363},"    email ",{"type":344,"tag":597,"props":4365,"children":4366},{"style":651},[4367],{"type":353,"value":3757},{"type":344,"tag":597,"props":4369,"children":4370},{"style":674},[4371],{"type":353,"value":4372}," c.email\n",{"type":344,"tag":597,"props":4374,"children":4376},{"class":599,"line":4375},213,[4377,4382,4386],{"type":344,"tag":597,"props":4378,"children":4379},{"style":674},[4380],{"type":353,"value":4381},"    name ",{"type":344,"tag":597,"props":4383,"children":4384},{"style":651},[4385],{"type":353,"value":3757},{"type":344,"tag":597,"props":4387,"children":4388},{"style":674},[4389],{"type":353,"value":4390}," c.name\n",{"type":344,"tag":597,"props":4392,"children":4394},{"class":599,"line":4393},214,[4395,4400,4404],{"type":344,"tag":597,"props":4396,"children":4397},{"style":674},[4398],{"type":353,"value":4399},"    stripeCustomerId ",{"type":344,"tag":597,"props":4401,"children":4402},{"style":651},[4403],{"type":353,"value":3757},{"type":344,"tag":597,"props":4405,"children":4406},{"style":674},[4407],{"type":353,"value":4408}," c.id\n",{"type":344,"tag":597,"props":4410,"children":4412},{"class":599,"line":4411},215,[4413,4418,4422],{"type":344,"tag":597,"props":4414,"children":4415},{"style":674},[4416],{"type":353,"value":4417},"    tier ",{"type":344,"tag":597,"props":4419,"children":4420},{"style":651},[4421],{"type":353,"value":3757},{"type":344,"tag":597,"props":4423,"children":4424},{"style":680},[4425],{"type":353,"value":4426}," \"free\"\n",{"type":344,"tag":597,"props":4428,"children":4430},{"class":599,"line":4429},216,[4431,4436,4441],{"type":344,"tag":597,"props":4432,"children":4433},{"style":674},[4434],{"type":353,"value":4435},"  } ",{"type":344,"tag":597,"props":4437,"children":4438},{"style":651},[4439],{"type":353,"value":4440},"else",{"type":344,"tag":597,"props":4442,"children":4443},{"style":674},[4444],{"type":353,"value":3743},{"type":344,"tag":597,"props":4446,"children":4448},{"class":599,"line":4447},217,[4449],{"type":344,"tag":597,"props":4450,"children":4451},{"style":604},[4452],{"type":353,"value":4453},"    // Subscription events: resolve the customer for email + name.\n",{"type":344,"tag":597,"props":4455,"children":4457},{"class":599,"line":4456},218,[4458,4462,4467,4471],{"type":344,"tag":597,"props":4459,"children":4460},{"style":651},[4461],{"type":353,"value":4288},{"type":344,"tag":597,"props":4463,"children":4464},{"style":657},[4465],{"type":353,"value":4466}," sub",{"type":344,"tag":597,"props":4468,"children":4469},{"style":651},[4470],{"type":353,"value":665},{"type":344,"tag":597,"props":4472,"children":4473},{"style":674},[4474],{"type":353,"value":4302},{"type":344,"tag":597,"props":4476,"children":4478},{"class":599,"line":4477},219,[4479,4483,4487,4492,4497,4501,4506,4511,4515,4520],{"type":344,"tag":597,"props":4480,"children":4481},{"style":674},[4482],{"type":353,"value":4399},{"type":344,"tag":597,"props":4484,"children":4485},{"style":651},[4486],{"type":353,"value":3757},{"type":344,"tag":597,"props":4488,"children":4489},{"style":651},[4490],{"type":353,"value":4491}," typeof",{"type":344,"tag":597,"props":4493,"children":4494},{"style":674},[4495],{"type":353,"value":4496}," sub.customer ",{"type":344,"tag":597,"props":4498,"children":4499},{"style":651},[4500],{"type":353,"value":3874},{"type":344,"tag":597,"props":4502,"children":4503},{"style":680},[4504],{"type":353,"value":4505}," \"string\"",{"type":344,"tag":597,"props":4507,"children":4508},{"style":651},[4509],{"type":353,"value":4510}," ?",{"type":344,"tag":597,"props":4512,"children":4513},{"style":674},[4514],{"type":353,"value":4496},{"type":344,"tag":597,"props":4516,"children":4517},{"style":651},[4518],{"type":353,"value":4519},":",{"type":344,"tag":597,"props":4521,"children":4522},{"style":674},[4523],{"type":353,"value":4524}," sub.customer.id\n",{"type":344,"tag":597,"props":4526,"children":4528},{"class":599,"line":4527},220,[4529,4533,4538,4542,4546],{"type":344,"tag":597,"props":4530,"children":4531},{"style":651},[4532],{"type":353,"value":4288},{"type":344,"tag":597,"props":4534,"children":4535},{"style":657},[4536],{"type":353,"value":4537}," customer",{"type":344,"tag":597,"props":4539,"children":4540},{"style":651},[4541],{"type":353,"value":665},{"type":344,"tag":597,"props":4543,"children":4544},{"style":668},[4545],{"type":353,"value":2749},{"type":344,"tag":597,"props":4547,"children":4548},{"style":674},[4549],{"type":353,"value":4550},"(stripeCustomerId)\n",{"type":344,"tag":597,"props":4552,"children":4554},{"class":599,"line":4553},221,[4555,4559,4563,4567],{"type":344,"tag":597,"props":4556,"children":4557},{"style":651},[4558],{"type":353,"value":4311},{"type":344,"tag":597,"props":4560,"children":4561},{"style":674},[4562],{"type":353,"value":1798},{"type":344,"tag":597,"props":4564,"children":4565},{"style":651},[4566],{"type":353,"value":1803},{"type":344,"tag":597,"props":4568,"children":4569},{"style":674},[4570],{"type":353,"value":4571},"customer.email) {\n",{"type":344,"tag":597,"props":4573,"children":4575},{"class":599,"line":4574},222,[4576,4581,4585,4589,4593,4598],{"type":344,"tag":597,"props":4577,"children":4578},{"style":651},[4579],{"type":353,"value":4580},"      return",{"type":344,"tag":597,"props":4582,"children":4583},{"style":674},[4584],{"type":353,"value":4334},{"type":344,"tag":597,"props":4586,"children":4587},{"style":680},[4588],{"type":353,"value":4339},{"type":344,"tag":597,"props":4590,"children":4591},{"style":674},[4592],{"type":353,"value":4344},{"type":344,"tag":597,"props":4594,"children":4595},{"style":680},[4596],{"type":353,"value":4597},"\"stripe_customer_has_no_email\"",{"type":344,"tag":597,"props":4599,"children":4600},{"style":674},[4601],{"type":353,"value":4354},{"type":344,"tag":597,"props":4603,"children":4605},{"class":599,"line":4604},223,[4606],{"type":344,"tag":597,"props":4607,"children":4608},{"style":674},[4609],{"type":353,"value":1091},{"type":344,"tag":597,"props":4611,"children":4613},{"class":599,"line":4612},224,[4614,4618,4622],{"type":344,"tag":597,"props":4615,"children":4616},{"style":674},[4617],{"type":353,"value":4363},{"type":344,"tag":597,"props":4619,"children":4620},{"style":651},[4621],{"type":353,"value":3757},{"type":344,"tag":597,"props":4623,"children":4624},{"style":674},[4625],{"type":353,"value":4626}," customer.email\n",{"type":344,"tag":597,"props":4628,"children":4630},{"class":599,"line":4629},225,[4631,4635,4639],{"type":344,"tag":597,"props":4632,"children":4633},{"style":674},[4634],{"type":353,"value":4381},{"type":344,"tag":597,"props":4636,"children":4637},{"style":651},[4638],{"type":353,"value":3757},{"type":344,"tag":597,"props":4640,"children":4641},{"style":674},[4642],{"type":353,"value":4643}," customer.name\n",{"type":344,"tag":597,"props":4645,"children":4647},{"class":599,"line":4646},226,[4648,4652,4656,4660,4665],{"type":344,"tag":597,"props":4649,"children":4650},{"style":651},[4651],{"type":353,"value":4311},{"type":344,"tag":597,"props":4653,"children":4654},{"style":674},[4655],{"type":353,"value":4257},{"type":344,"tag":597,"props":4657,"children":4658},{"style":651},[4659],{"type":353,"value":3874},{"type":344,"tag":597,"props":4661,"children":4662},{"style":680},[4663],{"type":353,"value":4664}," \"customer.subscription.deleted\"",{"type":344,"tag":597,"props":4666,"children":4667},{"style":674},[4668],{"type":353,"value":1377},{"type":344,"tag":597,"props":4670,"children":4672},{"class":599,"line":4671},227,[4673,4678,4682],{"type":344,"tag":597,"props":4674,"children":4675},{"style":674},[4676],{"type":353,"value":4677},"      tier ",{"type":344,"tag":597,"props":4679,"children":4680},{"style":651},[4681],{"type":353,"value":3757},{"type":344,"tag":597,"props":4683,"children":4684},{"style":680},[4685],{"type":353,"value":4426},{"type":344,"tag":597,"props":4687,"children":4689},{"class":599,"line":4688},228,[4690,4695,4699,4704,4708,4713,4717,4721,4726,4730,4734,4738],{"type":344,"tag":597,"props":4691,"children":4692},{"style":674},[4693],{"type":353,"value":4694},"    } ",{"type":344,"tag":597,"props":4696,"children":4697},{"style":651},[4698],{"type":353,"value":4440},{"type":344,"tag":597,"props":4700,"children":4701},{"style":651},[4702],{"type":353,"value":4703}," if",{"type":344,"tag":597,"props":4705,"children":4706},{"style":674},[4707],{"type":353,"value":1798},{"type":344,"tag":597,"props":4709,"children":4710},{"style":657},[4711],{"type":353,"value":4712},"PAID_STATUSES",{"type":344,"tag":597,"props":4714,"children":4715},{"style":674},[4716],{"type":353,"value":535},{"type":344,"tag":597,"props":4718,"children":4719},{"style":668},[4720],{"type":353,"value":3864},{"type":344,"tag":597,"props":4722,"children":4723},{"style":674},[4724],{"type":353,"value":4725},"(sub.status) ",{"type":344,"tag":597,"props":4727,"children":4728},{"style":651},[4729],{"type":353,"value":1549},{"type":344,"tag":597,"props":4731,"children":4732},{"style":651},[4733],{"type":353,"value":3879},{"type":344,"tag":597,"props":4735,"children":4736},{"style":657},[4737],{"type":353,"value":3283},{"type":344,"tag":597,"props":4739,"children":4740},{"style":674},[4741],{"type":353,"value":1377},{"type":344,"tag":597,"props":4743,"children":4745},{"class":599,"line":4744},229,[4746,4750,4754],{"type":344,"tag":597,"props":4747,"children":4748},{"style":674},[4749],{"type":353,"value":4677},{"type":344,"tag":597,"props":4751,"children":4752},{"style":651},[4753],{"type":353,"value":3757},{"type":344,"tag":597,"props":4755,"children":4756},{"style":680},[4757],{"type":353,"value":4758}," \"paid\"\n",{"type":344,"tag":597,"props":4760,"children":4762},{"class":599,"line":4761},230,[4763,4767,4771],{"type":344,"tag":597,"props":4764,"children":4765},{"style":674},[4766],{"type":353,"value":4694},{"type":344,"tag":597,"props":4768,"children":4769},{"style":651},[4770],{"type":353,"value":4440},{"type":344,"tag":597,"props":4772,"children":4773},{"style":674},[4774],{"type":353,"value":3743},{"type":344,"tag":597,"props":4776,"children":4778},{"class":599,"line":4777},231,[4779,4783,4787],{"type":344,"tag":597,"props":4780,"children":4781},{"style":674},[4782],{"type":353,"value":4677},{"type":344,"tag":597,"props":4784,"children":4785},{"style":651},[4786],{"type":353,"value":3757},{"type":344,"tag":597,"props":4788,"children":4789},{"style":680},[4790],{"type":353,"value":4426},{"type":344,"tag":597,"props":4792,"children":4794},{"class":599,"line":4793},232,[4795],{"type":344,"tag":597,"props":4796,"children":4797},{"style":674},[4798],{"type":353,"value":1091},{"type":344,"tag":597,"props":4800,"children":4802},{"class":599,"line":4801},233,[4803],{"type":344,"tag":597,"props":4804,"children":4805},{"style":674},[4806],{"type":353,"value":1623},{"type":344,"tag":597,"props":4808,"children":4810},{"class":599,"line":4809},234,[4811],{"type":344,"tag":597,"props":4812,"children":4813},{"emptyLinePlaceholder":632},[4814],{"type":353,"value":635},{"type":344,"tag":597,"props":4816,"children":4818},{"class":599,"line":4817},235,[4819,4823,4828,4832,4837,4841,4846,4850,4855,4860],{"type":344,"tag":597,"props":4820,"children":4821},{"style":651},[4822],{"type":353,"value":1386},{"type":344,"tag":597,"props":4824,"children":4825},{"style":657},[4826],{"type":353,"value":4827}," action",{"type":344,"tag":597,"props":4829,"children":4830},{"style":651},[4831],{"type":353,"value":665},{"type":344,"tag":597,"props":4833,"children":4834},{"style":674},[4835],{"type":353,"value":4836}," tier ",{"type":344,"tag":597,"props":4838,"children":4839},{"style":651},[4840],{"type":353,"value":3874},{"type":344,"tag":597,"props":4842,"children":4843},{"style":680},[4844],{"type":353,"value":4845}," \"paid\"",{"type":344,"tag":597,"props":4847,"children":4848},{"style":651},[4849],{"type":353,"value":4510},{"type":344,"tag":597,"props":4851,"children":4852},{"style":680},[4853],{"type":353,"value":4854}," \"set_paid\"",{"type":344,"tag":597,"props":4856,"children":4857},{"style":651},[4858],{"type":353,"value":4859}," :",{"type":344,"tag":597,"props":4861,"children":4862},{"style":680},[4863],{"type":353,"value":4864}," \"set_free\"\n",{"type":344,"tag":597,"props":4866,"children":4868},{"class":599,"line":4867},236,[4869],{"type":344,"tag":597,"props":4870,"children":4871},{"emptyLinePlaceholder":632},[4872],{"type":353,"value":635},{"type":344,"tag":597,"props":4874,"children":4876},{"class":599,"line":4875},237,[4877],{"type":344,"tag":597,"props":4878,"children":4879},{"style":604},[4880],{"type":353,"value":4881},"  // DRY_RUN unset or \"true\" = log only; set DRY_RUN=false to write to Plain.\n",{"type":344,"tag":597,"props":4883,"children":4885},{"class":599,"line":4884},238,[4886,4890,4895,4900,4904,4909,4913,4917,4922],{"type":344,"tag":597,"props":4887,"children":4888},{"style":651},[4889],{"type":353,"value":1539},{"type":344,"tag":597,"props":4891,"children":4892},{"style":674},[4893],{"type":353,"value":4894}," (cfg.",{"type":344,"tag":597,"props":4896,"children":4897},{"style":668},[4898],{"type":353,"value":4899},"get",{"type":344,"tag":597,"props":4901,"children":4902},{"style":674},[4903],{"type":353,"value":677},{"type":344,"tag":597,"props":4905,"children":4906},{"style":680},[4907],{"type":353,"value":4908},"\"DRY_RUN\"",{"type":344,"tag":597,"props":4910,"children":4911},{"style":674},[4912],{"type":353,"value":688},{"type":344,"tag":597,"props":4914,"children":4915},{"style":651},[4916],{"type":353,"value":1549},{"type":344,"tag":597,"props":4918,"children":4919},{"style":680},[4920],{"type":353,"value":4921}," \"false\"",{"type":344,"tag":597,"props":4923,"children":4924},{"style":674},[4925],{"type":353,"value":1377},{"type":344,"tag":597,"props":4927,"children":4929},{"class":599,"line":4928},239,[4930,4935,4940,4945],{"type":344,"tag":597,"props":4931,"children":4932},{"style":651},[4933],{"type":353,"value":4934},"    return",{"type":344,"tag":597,"props":4936,"children":4937},{"style":674},[4938],{"type":353,"value":4939}," { action: action, email: email, reason: ",{"type":344,"tag":597,"props":4941,"children":4942},{"style":680},[4943],{"type":353,"value":4944},"\"dry_run\"",{"type":344,"tag":597,"props":4946,"children":4947},{"style":674},[4948],{"type":353,"value":4354},{"type":344,"tag":597,"props":4950,"children":4952},{"class":599,"line":4951},240,[4953],{"type":344,"tag":597,"props":4954,"children":4955},{"style":674},[4956],{"type":353,"value":1623},{"type":344,"tag":597,"props":4958,"children":4960},{"class":599,"line":4959},241,[4961],{"type":344,"tag":597,"props":4962,"children":4963},{"emptyLinePlaceholder":632},[4964],{"type":353,"value":635},{"type":344,"tag":597,"props":4966,"children":4968},{"class":599,"line":4967},242,[4969,4973,4978,4982,4986],{"type":344,"tag":597,"props":4970,"children":4971},{"style":651},[4972],{"type":353,"value":1386},{"type":344,"tag":597,"props":4974,"children":4975},{"style":657},[4976],{"type":353,"value":4977}," customerId",{"type":344,"tag":597,"props":4979,"children":4980},{"style":651},[4981],{"type":353,"value":665},{"type":344,"tag":597,"props":4983,"children":4984},{"style":668},[4985],{"type":353,"value":1879},{"type":344,"tag":597,"props":4987,"children":4988},{"style":674},[4989],{"type":353,"value":4990},"(email, name, stripeCustomerId)\n",{"type":344,"tag":597,"props":4992,"children":4994},{"class":599,"line":4993},243,[4995,4999,5004,5008,5012],{"type":344,"tag":597,"props":4996,"children":4997},{"style":651},[4998],{"type":353,"value":1386},{"type":344,"tag":597,"props":5000,"children":5001},{"style":657},[5002],{"type":353,"value":5003}," tenantId",{"type":344,"tag":597,"props":5005,"children":5006},{"style":651},[5007],{"type":353,"value":665},{"type":344,"tag":597,"props":5009,"children":5010},{"style":668},[5011],{"type":353,"value":2149},{"type":344,"tag":597,"props":5013,"children":5014},{"style":674},[5015],{"type":353,"value":5016},"(stripeCustomerId, email)\n",{"type":344,"tag":597,"props":5018,"children":5020},{"class":599,"line":5019},244,[5021,5025,5030,5034,5038],{"type":344,"tag":597,"props":5022,"children":5023},{"style":651},[5024],{"type":353,"value":1539},{"type":344,"tag":597,"props":5026,"children":5027},{"style":674},[5028],{"type":353,"value":5029}," (tier ",{"type":344,"tag":597,"props":5031,"children":5032},{"style":651},[5033],{"type":353,"value":3874},{"type":344,"tag":597,"props":5035,"children":5036},{"style":680},[5037],{"type":353,"value":4845},{"type":344,"tag":597,"props":5039,"children":5040},{"style":674},[5041],{"type":353,"value":1377},{"type":344,"tag":597,"props":5043,"children":5045},{"class":599,"line":5044},245,[5046,5051,5056,5060,5064,5069],{"type":344,"tag":597,"props":5047,"children":5048},{"style":668},[5049],{"type":353,"value":5050},"    setPlainTenantTier",{"type":344,"tag":597,"props":5052,"children":5053},{"style":674},[5054],{"type":353,"value":5055},"(tenantId, cfg.",{"type":344,"tag":597,"props":5057,"children":5058},{"style":668},[5059],{"type":353,"value":4899},{"type":344,"tag":597,"props":5061,"children":5062},{"style":674},[5063],{"type":353,"value":677},{"type":344,"tag":597,"props":5065,"children":5066},{"style":680},[5067],{"type":353,"value":5068},"\"PLAIN_PAID_TIER_ID\"",{"type":344,"tag":597,"props":5070,"children":5071},{"style":674},[5072],{"type":353,"value":1777},{"type":344,"tag":597,"props":5074,"children":5076},{"class":599,"line":5075},246,[5077,5081,5085],{"type":344,"tag":597,"props":5078,"children":5079},{"style":674},[5080],{"type":353,"value":4435},{"type":344,"tag":597,"props":5082,"children":5083},{"style":651},[5084],{"type":353,"value":4440},{"type":344,"tag":597,"props":5086,"children":5087},{"style":674},[5088],{"type":353,"value":3743},{"type":344,"tag":597,"props":5090,"children":5092},{"class":599,"line":5091},247,[5093,5098],{"type":344,"tag":597,"props":5094,"children":5095},{"style":668},[5096],{"type":353,"value":5097},"    clearPlainTenantTier",{"type":344,"tag":597,"props":5099,"children":5100},{"style":674},[5101],{"type":353,"value":5102},"(tenantId)\n",{"type":344,"tag":597,"props":5104,"children":5106},{"class":599,"line":5105},248,[5107],{"type":344,"tag":597,"props":5108,"children":5109},{"style":674},[5110],{"type":353,"value":1623},{"type":344,"tag":597,"props":5112,"children":5114},{"class":599,"line":5113},249,[5115,5120],{"type":344,"tag":597,"props":5116,"children":5117},{"style":668},[5118],{"type":353,"value":5119},"  linkPlainCustomerToTenant",{"type":344,"tag":597,"props":5121,"children":5122},{"style":674},[5123],{"type":353,"value":5124},"(customerId, tenantId)\n",{"type":344,"tag":597,"props":5126,"children":5128},{"class":599,"line":5127},250,[5129],{"type":344,"tag":597,"props":5130,"children":5131},{"emptyLinePlaceholder":632},[5132],{"type":353,"value":635},{"type":344,"tag":597,"props":5134,"children":5136},{"class":599,"line":5135},251,[5137,5141],{"type":344,"tag":597,"props":5138,"children":5139},{"style":651},[5140],{"type":353,"value":1844},{"type":344,"tag":597,"props":5142,"children":5143},{"style":674},[5144],{"type":353,"value":5145}," { action: action, email: email, plain_customer_id: customerId }\n",{"type":344,"tag":597,"props":5147,"children":5149},{"class":599,"line":5148},252,[5150],{"type":344,"tag":597,"props":5151,"children":5152},{"style":674},[5153],{"type":353,"value":1858},{"type":344,"tag":345,"props":5155,"children":5156},{},[5157,5159,5164],{"type":353,"value":5158},"Notes on the APIs used, all covered in the ",{"type":344,"tag":384,"props":5160,"children":5161},{"href":280},[5162],{"type":353,"value":5163},"functions reference",{"type":353,"value":4519},{"type":344,"tag":5166,"props":5167,"children":5168},"ul",{},[5169,5188,5213,5238,5249],{"type":344,"tag":5170,"props":5171,"children":5172},"li",{},[5173,5179,5181,5186],{"type":344,"tag":395,"props":5174,"children":5176},{"className":5175},[],[5177],{"type":353,"value":5178},"require(\"secret:...\")",{"type":353,"value":5180}," resolves ",{"type":344,"tag":384,"props":5182,"children":5183},{"href":104},[5184],{"type":353,"value":5185},"secret connections",{"type":353,"value":5187}," before the code runs; an unbound alias fails fast.",{"type":344,"tag":5170,"props":5189,"children":5190},{},[5191,5197,5199,5205,5207,5212],{"type":344,"tag":395,"props":5192,"children":5194},{"className":5193},[],[5195],{"type":353,"value":5196},"http.request",{"type":353,"value":5198}," is synchronous and returns ",{"type":344,"tag":395,"props":5200,"children":5202},{"className":5201},[],[5203],{"type":353,"value":5204},"{ body, status_code, headers }",{"type":353,"value":5206}," — see ",{"type":344,"tag":384,"props":5208,"children":5209},{"href":233},[5210],{"type":353,"value":5211},"make HTTP requests",{"type":353,"value":535},{"type":344,"tag":5170,"props":5214,"children":5215},{},[5216,5222,5224,5230,5232,5237],{"type":344,"tag":395,"props":5217,"children":5219},{"className":5218},[],[5220],{"type":353,"value":5221},"crypto.hmac(\"sha256\", key, message)",{"type":353,"value":5223}," returns a hex digest, matching Stripe's ",{"type":344,"tag":395,"props":5225,"children":5227},{"className":5226},[],[5228],{"type":353,"value":5229},"v1=",{"type":353,"value":5231}," signature — see ",{"type":344,"tag":384,"props":5233,"children":5234},{"href":251},[5235],{"type":353,"value":5236},"crypto functions",{"type":353,"value":535},{"type":344,"tag":5170,"props":5239,"children":5240},{},[5241,5247],{"type":344,"tag":395,"props":5242,"children":5244},{"className":5243},[],[5245],{"type":353,"value":5246},"time.unix()",{"type":353,"value":5248}," gives the current Unix time in seconds for the tolerance check.",{"type":344,"tag":5170,"props":5250,"children":5251},{},[5252,5258,5260,5265,5266,5271,5272,5277,5279,5285],{"type":344,"tag":395,"props":5253,"children":5255},{"className":5254},[],[5256],{"type":353,"value":5257},"answer()",{"type":353,"value":5259}," uses ",{"type":344,"tag":384,"props":5261,"children":5262},{"href":224},[5263],{"type":353,"value":5264},"response control",{"type":353,"value":1798},{"type":344,"tag":395,"props":5267,"children":5269},{"className":5268},[],[5270],{"type":353,"value":3039},{"type":353,"value":3241},{"type":344,"tag":395,"props":5273,"children":5275},{"className":5274},[],[5276],{"type":353,"value":3091},{"type":353,"value":5278},") plus ",{"type":344,"tag":395,"props":5280,"children":5282},{"className":5281},[],[5283],{"type":353,"value":5284},"r.stopForwarding()",{"type":353,"value":5286},", so Stripe is answered by the input itself.",{"type":344,"tag":372,"props":5288,"children":5290},{"id":5289},"_4-attach-the-function-to-the-input",[5291],{"type":353,"value":5292},"4. Attach the function to the input",{"type":344,"tag":345,"props":5294,"children":5295},{},[5296,5298,5303,5305,5310],{"type":353,"value":5297},"Open the ",{"type":344,"tag":395,"props":5299,"children":5301},{"className":5300},[],[5302],{"type":353,"value":400},{"type":353,"value":5304}," bucket, find the input's settings and select ",{"type":344,"tag":395,"props":5306,"children":5308},{"className":5307},[],[5309],{"type":353,"value":561},{"type":353,"value":5311}," as its function. An input-attached function is required here: functions attached to an output cannot customize the response returned to Stripe.",{"type":344,"tag":372,"props":5313,"children":5315},{"id":5314},"_5-point-stripe-at-the-bucket",[5316],{"type":353,"value":5317},"5. Point Stripe at the bucket",{"type":344,"tag":345,"props":5319,"children":5320},{},[5321,5323,5330],{"type":353,"value":5322},"In the ",{"type":344,"tag":384,"props":5324,"children":5327},{"href":5325,"rel":5326},"https://dashboard.stripe.com/webhooks",[388],[5328],{"type":353,"value":5329},"Stripe dashboard",{"type":353,"value":5331}," add a webhook endpoint with the bucket's input URL and subscribe to the events the function handles:",{"type":344,"tag":5166,"props":5333,"children":5334},{},[5335,5344,5353,5362],{"type":344,"tag":5170,"props":5336,"children":5337},{},[5338],{"type":344,"tag":395,"props":5339,"children":5341},{"className":5340},[],[5342],{"type":353,"value":5343},"customer.created",{"type":344,"tag":5170,"props":5345,"children":5346},{},[5347],{"type":344,"tag":395,"props":5348,"children":5350},{"className":5349},[],[5351],{"type":353,"value":5352},"customer.subscription.created",{"type":344,"tag":5170,"props":5354,"children":5355},{},[5356],{"type":344,"tag":395,"props":5357,"children":5359},{"className":5358},[],[5360],{"type":353,"value":5361},"customer.subscription.updated",{"type":344,"tag":5170,"props":5363,"children":5364},{},[5365],{"type":344,"tag":395,"props":5366,"children":5368},{"className":5367},[],[5369],{"type":353,"value":5370},"customer.subscription.deleted",{"type":344,"tag":345,"props":5372,"children":5373},{},[5374,5376,5381,5383,5388,5390,5396,5398,5404],{"type":353,"value":5375},"Stripe shows you the signing secret (",{"type":344,"tag":395,"props":5377,"children":5379},{"className":5378},[],[5380],{"type":353,"value":488},{"type":353,"value":5382},") for this endpoint — that is the value for the ",{"type":344,"tag":395,"props":5384,"children":5386},{"className":5385},[],[5387],{"type":353,"value":477},{"type":353,"value":5389}," binding. For testing against your live account first, the same flow works with a ",{"type":344,"tag":384,"props":5391,"children":5393},{"href":5392},"/blog/stripe-cli-alternative",[5394],{"type":353,"value":5395},"Stripe CLI alternative",{"type":353,"value":5397}," or a ",{"type":344,"tag":384,"props":5399,"children":5401},{"href":5400},"/blog/receiving-stripe-webhooks-localhost",[5402],{"type":353,"value":5403},"local receiver",{"type":353,"value":535},{"type":344,"tag":372,"props":5406,"children":5408},{"id":5407},"_6-test-it-dry-run-first",[5409],{"type":353,"value":5410},"6. Test it, dry run first",{"type":344,"tag":345,"props":5412,"children":5413},{},[5414,5416,5422,5424,5430],{"type":353,"value":5415},"The function ships safe by default: with ",{"type":344,"tag":395,"props":5417,"children":5419},{"className":5418},[],[5420],{"type":353,"value":5421},"DRY_RUN",{"type":353,"value":5423}," unset it only logs what it would do. In the function editor (or with ",{"type":344,"tag":395,"props":5425,"children":5427},{"className":5426},[],[5428],{"type":353,"value":5429},"relay function invoke",{"type":353,"value":5431},"), send a sample subscription event and check the logs — you should see:",{"type":344,"tag":587,"props":5433,"children":5437},{"className":5434,"code":5435,"language":5436,"meta":318,"style":318},"language-json shiki shiki-themes github-dark","{ \"action\": \"set_paid\", \"email\": \"ada@example.com\", \"reason\": \"dry_run\" }\n","json",[5438],{"type":344,"tag":395,"props":5439,"children":5440},{"__ignoreMap":318},[5441],{"type":344,"tag":597,"props":5442,"children":5443},{"class":599,"line":600},[5444,5449,5454,5458,5463,5467,5472,5476,5481,5485,5490,5494,5498],{"type":344,"tag":597,"props":5445,"children":5446},{"style":674},[5447],{"type":353,"value":5448},"{ ",{"type":344,"tag":597,"props":5450,"children":5451},{"style":657},[5452],{"type":353,"value":5453},"\"action\"",{"type":344,"tag":597,"props":5455,"children":5456},{"style":674},[5457],{"type":353,"value":1451},{"type":344,"tag":597,"props":5459,"children":5460},{"style":680},[5461],{"type":353,"value":5462},"\"set_paid\"",{"type":344,"tag":597,"props":5464,"children":5465},{"style":674},[5466],{"type":353,"value":901},{"type":344,"tag":597,"props":5468,"children":5469},{"style":657},[5470],{"type":353,"value":5471},"\"email\"",{"type":344,"tag":597,"props":5473,"children":5474},{"style":674},[5475],{"type":353,"value":1451},{"type":344,"tag":597,"props":5477,"children":5478},{"style":680},[5479],{"type":353,"value":5480},"\"ada@example.com\"",{"type":344,"tag":597,"props":5482,"children":5483},{"style":674},[5484],{"type":353,"value":901},{"type":344,"tag":597,"props":5486,"children":5487},{"style":657},[5488],{"type":353,"value":5489},"\"reason\"",{"type":344,"tag":597,"props":5491,"children":5492},{"style":674},[5493],{"type":353,"value":1451},{"type":344,"tag":597,"props":5495,"children":5496},{"style":680},[5497],{"type":353,"value":4944},{"type":344,"tag":597,"props":5499,"children":5500},{"style":674},[5501],{"type":353,"value":4354},{"type":344,"tag":345,"props":5503,"children":5504},{},[5505,5507,5513,5515,5520,5522,5527],{"type":353,"value":5506},"Then set ",{"type":344,"tag":395,"props":5508,"children":5510},{"className":5509},[],[5511],{"type":353,"value":5512},"PLAIN_PAID_TIER_ID",{"type":353,"value":5514}," in the function's config, flip ",{"type":344,"tag":395,"props":5516,"children":5518},{"className":5517},[],[5519],{"type":353,"value":5421},{"type":353,"value":5521}," to ",{"type":344,"tag":395,"props":5523,"children":5525},{"className":5524},[],[5526],{"type":353,"value":2004},{"type":353,"value":5528},", and trigger a real event (for example toggle a test subscription in Stripe). The customer appears in Plain, the tenant is created with the Stripe customer ID as its external ID, and the paid tier is set. In the bucket's request log you can open any past delivery and replay it — the Plain mutations are upserts, so a replay converges to the same state instead of duplicating anything.",{"type":344,"tag":372,"props":5530,"children":5532},{"id":5531},"what-each-event-does",[5533],{"type":353,"value":5534},"What each event does",{"type":344,"tag":439,"props":5536,"children":5537},{},[5538,5554],{"type":344,"tag":443,"props":5539,"children":5540},{},[5541],{"type":344,"tag":447,"props":5542,"children":5543},{},[5544,5549],{"type":344,"tag":451,"props":5545,"children":5546},{},[5547],{"type":353,"value":5548},"Stripe event",{"type":344,"tag":451,"props":5550,"children":5551},{},[5552],{"type":353,"value":5553},"Plain effect",{"type":344,"tag":462,"props":5555,"children":5556},{},[5557,5573,5625,5658,5673],{"type":344,"tag":447,"props":5558,"children":5559},{},[5560,5568],{"type":344,"tag":469,"props":5561,"children":5562},{},[5563],{"type":344,"tag":395,"props":5564,"children":5566},{"className":5565},[],[5567],{"type":353,"value":5343},{"type":344,"tag":469,"props":5569,"children":5570},{},[5571],{"type":353,"value":5572},"Customer upserted by email, tenant created (external ID = Stripe customer ID), tier cleared (free)",{"type":344,"tag":447,"props":5574,"children":5575},{},[5576,5615],{"type":344,"tag":469,"props":5577,"children":5578},{},[5579,5584,5586,5592,5594,5600,5601,5607,5609],{"type":344,"tag":395,"props":5580,"children":5582},{"className":5581},[],[5583],{"type":353,"value":5352},{"type":353,"value":5585}," / ",{"type":344,"tag":395,"props":5587,"children":5589},{"className":5588},[],[5590],{"type":353,"value":5591},".updated",{"type":353,"value":5593}," with status ",{"type":344,"tag":395,"props":5595,"children":5597},{"className":5596},[],[5598],{"type":353,"value":5599},"active",{"type":353,"value":901},{"type":344,"tag":395,"props":5602,"children":5604},{"className":5603},[],[5605],{"type":353,"value":5606},"trialing",{"type":353,"value":5608}," or ",{"type":344,"tag":395,"props":5610,"children":5612},{"className":5611},[],[5613],{"type":353,"value":5614},"past_due",{"type":344,"tag":469,"props":5616,"children":5617},{},[5618,5620],{"type":353,"value":5619},"Customer + tenant upserted, ",{"type":344,"tag":349,"props":5621,"children":5622},{},[5623],{"type":353,"value":5624},"paid tier set",{"type":344,"tag":447,"props":5626,"children":5627},{},[5628,5653],{"type":344,"tag":469,"props":5629,"children":5630},{},[5631,5636,5638,5644,5645,5651],{"type":344,"tag":395,"props":5632,"children":5634},{"className":5633},[],[5635],{"type":353,"value":5361},{"type":353,"value":5637}," with any other status (",{"type":344,"tag":395,"props":5639,"children":5641},{"className":5640},[],[5642],{"type":353,"value":5643},"unpaid",{"type":353,"value":901},{"type":344,"tag":395,"props":5646,"children":5648},{"className":5647},[],[5649],{"type":353,"value":5650},"canceled",{"type":353,"value":5652},", ...)",{"type":344,"tag":469,"props":5654,"children":5655},{},[5656],{"type":353,"value":5657},"Tier cleared",{"type":344,"tag":447,"props":5659,"children":5660},{},[5661,5669],{"type":344,"tag":469,"props":5662,"children":5663},{},[5664],{"type":344,"tag":395,"props":5665,"children":5667},{"className":5666},[],[5668],{"type":353,"value":5370},{"type":344,"tag":469,"props":5670,"children":5671},{},[5672],{"type":353,"value":5657},{"type":344,"tag":447,"props":5674,"children":5675},{},[5676,5681],{"type":344,"tag":469,"props":5677,"children":5678},{},[5679],{"type":353,"value":5680},"Any other event",{"type":344,"tag":469,"props":5682,"children":5683},{},[5684,5689],{"type":344,"tag":395,"props":5685,"children":5687},{"className":5686},[],[5688],{"type":353,"value":3904},{"type":353,"value":5690}," to Stripe, nothing synced",{"type":344,"tag":372,"props":5692,"children":5694},{"id":5693},"why-this-beats-a-worker-for-this-job",[5695],{"type":353,"value":5696},"Why this beats a worker for this job",{"type":344,"tag":5166,"props":5698,"children":5699},{},[5700,5710,5720,5736],{"type":344,"tag":5170,"props":5701,"children":5702},{},[5703,5708],{"type":344,"tag":349,"props":5704,"children":5705},{},[5706],{"type":353,"value":5707},"Nothing to deploy.",{"type":353,"value":5709}," The function lives next to the bucket; no CI, no wrangler, no worker URL to rotate.",{"type":344,"tag":5170,"props":5711,"children":5712},{},[5713,5718],{"type":344,"tag":349,"props":5714,"children":5715},{},[5716],{"type":353,"value":5717},"Every event is kept.",{"type":353,"value":5719}," Stripe deliveries land in the bucket's log with full request/response bodies, so you can audit and replay a missed sync — the upserts make replays safe.",{"type":344,"tag":5170,"props":5721,"children":5722},{},[5723,5728,5730,5734],{"type":344,"tag":349,"props":5724,"children":5725},{},[5726],{"type":353,"value":5727},"Secrets stay write-only.",{"type":353,"value":5729}," Credentials live in ",{"type":344,"tag":384,"props":5731,"children":5732},{"href":104},[5733],{"type":353,"value":5185},{"type":353,"value":5735},", not in source or environment variables that leak into logs.",{"type":344,"tag":5170,"props":5737,"children":5738},{},[5739,5744],{"type":344,"tag":349,"props":5740,"children":5741},{},[5742],{"type":353,"value":5743},"Retries are handled for you.",{"type":353,"value":5745}," A Plain outage returns a 500 to Stripe, which retries; a recovered event replays from the log without waiting for Stripe.",{"type":344,"tag":345,"props":5747,"children":5748},{},[5749,5751,5756],{"type":353,"value":5750},"If you also want the raw events somewhere durable (a warehouse, a queue, an internal API), keep the bucket's input as-is and add an output per destination — the input function still answers Stripe, and each output can have its own ",{"type":344,"tag":384,"props":5752,"children":5753},{"href":274},[5754],{"type":353,"value":5755},"function or forwarding rules",{"type":353,"value":535},{"type":344,"tag":5758,"props":5759,"children":5760},"style",{},[5761],{"type":353,"value":5762},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":318,"searchDepth":619,"depth":619,"links":5764},[5765,5766,5767,5768,5769,5770,5771,5772],{"id":374,"depth":610,"text":377},{"id":413,"depth":610,"text":416},{"id":538,"depth":610,"text":541},{"id":5289,"depth":610,"text":5292},{"id":5314,"depth":610,"text":5317},{"id":5407,"depth":610,"text":5410},{"id":5531,"depth":610,"text":5534},{"id":5693,"depth":610,"text":5696},"markdown","content:docs:tutorials:transform:3.stripe-to-plain.md","content","docs/tutorials/transform/3.stripe-to-plain.md","docs/tutorials/transform/3.stripe-to-plain","md",{"loc":191},1791655680513]