import "./chunk-YPSWSI3M.js";

// src/docs/consent.json
var consent_default = '# Consent API\n\n- **Base URL:** `https://consent.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/consent](https://docs.epilot.io/api/consent)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.consent.publishConsentEvent(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/consent\'\n\nconst consentClient = getClient()\nauthorize(consentClient, () => \'<token>\')\nconst { data } = await consentClient.publishConsentEvent(...)\n```\n\n## Operations\n\n**consent**\n- [`publishConsentEvent`](#publishconsentevent)\n- [`listConsentEvents`](#listconsentevents)\n- [`handleOptInWithToken`](#handleoptinwithtoken)\n\n**Schemas**\n- [`ConsentIdentifier`](#consentidentifier)\n- [`ConsentTopic`](#consenttopic)\n- [`ConsentSource`](#consentsource)\n- [`ConsentMeta`](#consentmeta)\n- [`ConsentEventRequestBody`](#consenteventrequestbody)\n- [`ConsentEvent`](#consentevent)\n- [`OrganizationId`](#organizationid)\n\n### `publishConsentEvent`\n\nPublishes consent event on event bus, which appends to consent store\n\n`POST /v1/consent/publish`\n\n```ts\nconst { data } = await client.publishConsentEvent(\n  null,\n  {\n    type: \'OPT_IN\',\n    topic: \'EMAIL_MARKETING\',\n    source: \'www.frontend.epilot.cloud\',\n    identifier: \'exampleuser@epilot.cloud\',\n    meta: {\n      double_opt_in: true,\n      source_type: \'journey\',\n      source_id: \'0e4f2a26-14f0-4ada-9294-a7d7a0b9b214\',\n      ip_address: \'1.1.1.1\',\n      user_agent: \'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36\'\n    }\n  },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n  "type": "OPT_IN",\n  "created_at": "1970-01-01T00:00:00.000Z",\n  "topic": "EMAIL_MARKETING",\n  "source": "www.frontend.epilot.cloud",\n  "organization_id": "123",\n  "identifier": "exampleuser@epilot.cloud",\n  "meta": {\n    "double_opt_in": true,\n    "source_type": "journey",\n    "source_id": "0e4f2a26-14f0-4ada-9294-a7d7a0b9b214",\n    "ip_address": "1.1.1.1",\n    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36"\n  }\n}\n```\n\n</details>\n\n---\n\n### `listConsentEvents`\n\nList opt-ins and opt-outs by customer identifier\n\n`GET /v1/consent/{identifier}`\n\n```ts\nconst { data } = await client.listConsentEvents({\n  identifier: \'example\',\n  topic: \'example\',\n  limit: 1,\n  from: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n  "events": [\n    {\n      "type": "OPT_IN",\n      "created_at": "1970-01-01T00:00:00.000Z",\n      "topic": "EMAIL_MARKETING",\n      "source": "www.frontend.epilot.cloud",\n      "organization_id": "123",\n      "identifier": "exampleuser@epilot.cloud",\n      "meta": {\n        "double_opt_in": true,\n        "source_type": "journey",\n        "source_id": "0e4f2a26-14f0-4ada-9294-a7d7a0b9b214",\n        "ip_address": "1.1.1.1",\n        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36"\n      }\n    }\n  ],\n  "total": 1\n}\n```\n\n</details>\n\n---\n\n### `handleOptInWithToken`\n\nEndpoint to handle opt-in links\n\n`GET /v1/opt-in/{token}`\n\n```ts\nconst { data } = await client.handleOptInWithToken({\n  token: \'example\',\n  lang: \'example\',\n})\n```\n\n---\n\n## Schemas\n\n### `ConsentIdentifier`\n\nUnique identifier for consent source (e.g. customer email or phone)\n\n```ts\ntype ConsentIdentifier = string\n```\n\n### `ConsentTopic`\n\nConsent Topic (what the person is opting into)\n\n```ts\ntype ConsentTopic = string\n```\n\n### `ConsentSource`\n\nConsent Source (Origin of the Consent Event)\n\n```ts\ntype ConsentSource = string\n```\n\n### `ConsentMeta`\n\n```ts\ntype ConsentMeta = Record<string, unknown>\n```\n\n### `ConsentEventRequestBody`\n\n```ts\ntype ConsentEventRequestBody = {\n  type: "OPT_IN" | "OPT_OUT"\n  topic: string\n  source?: string\n  identifier: string\n  meta?: Record<string, unknown>\n}\n```\n\n### `ConsentEvent`\n\n```ts\ntype ConsentEvent = {\n  type: "OPT_IN" | "OPT_OUT" | "DOUBLE_OPT_IN_REQUESTED" | "DOUBLE_OPT_IN"\n  created_at?: string // date-time\n  topic: string\n  source?: string\n  organization_id?: string\n  identifier: string\n  meta?: Record<string, unknown>\n}\n```\n\n### `OrganizationId`\n\n```ts\ntype OrganizationId = string\n```\n';
export {
  consent_default as default
};
