@epilot/sdk 2.20.75 → 2.20.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/app.json +82 -1
- package/definitions/environments.json +42 -2
- package/definitions/external-values.json +34 -4
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.d.cts +2 -2
- package/dist/apis/app.d.ts +2 -2
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/chat.cjs +6 -6
- package/dist/apis/chat.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.d.cts +2 -2
- package/dist/apis/environments.d.ts +2 -2
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/external-values.cjs +6 -6
- package/dist/apis/external-values.d.cts +2 -2
- package/dist/apis/external-values.d.ts +2 -2
- package/dist/apis/external-values.js +1 -1
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/identity.cjs +6 -6
- package/dist/apis/identity.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/phone-integration.cjs +6 -6
- package/dist/apis/phone-integration.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/app-3WUZHA43.js +7 -0
- package/dist/app-7VPZV72D.cjs +7 -0
- package/dist/{app.d-CZELwNO3.d.cts → app.d-cnyQ-loP.d.cts} +46 -5
- package/dist/{app.d-CZELwNO3.d.ts → app.d-cnyQ-loP.d.ts} +46 -5
- package/dist/{chunk-6B5HXASK.js → chunk-C6T52ZOY.js} +3 -3
- package/dist/{chunk-JGPHZYSD.cjs → chunk-RZJMF6WE.cjs} +3 -3
- package/dist/environments-MKY6TF4Z.js +7 -0
- package/dist/environments-QII3AKWU.cjs +7 -0
- package/dist/{environments.d-qL1urwAq.d.cts → environments.d-BC2zAtBO.d.cts} +40 -28
- package/dist/{environments.d-qL1urwAq.d.ts → environments.d-BC2zAtBO.d.ts} +40 -28
- package/dist/external-values-66ANK66M.js +7 -0
- package/dist/external-values-WET4FHGU.cjs +7 -0
- package/dist/{external-values.d-23q55J5P.d.cts → external-values.d-DeDtCu_V.d.cts} +46 -12
- package/dist/{external-values.d-23q55J5P.d.ts → external-values.d-DeDtCu_V.d.ts} +46 -12
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/docs/app.md +60 -2
- package/docs/environments.md +4 -3
- package/docs/external-values.md +31 -2
- package/package.json +1 -1
- package/dist/app-CKQAJ7EE.js +0 -7
- package/dist/app-ERJHXY64.cjs +0 -7
- package/dist/environments-OYCH6VUD.js +0 -7
- package/dist/environments-S3O6ASTY.cjs +0 -7
- package/dist/external-values-7BS76RVR.js +0 -7
- package/dist/external-values-R2XB2ALG.cjs +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./chunk-YPSWSI3M.js";
|
|
2
|
+
|
|
3
|
+
// src/docs/environments.json
|
|
4
|
+
var environments_default = '# Environments API\n\n- **Base URL:** `https://environments.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/environments](https://docs.epilot.io/api/environments)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.environments.listEnvironmentVariables(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/environments\'\n\nconst environmentsClient = getClient()\nauthorize(environmentsClient, () => \'<token>\')\nconst { data } = await environmentsClient.listEnvironmentVariables(...)\n```\n\n## Operations\n\n**environments**\n- [`listEnvironmentVariables`](#listenvironmentvariables)\n- [`createEnvironmentVariable`](#createenvironmentvariable)\n- [`listEnvironmentGroups`](#listenvironmentgroups)\n- [`putEnvironmentGroup`](#putenvironmentgroup)\n- [`deleteEnvironmentGroup`](#deleteenvironmentgroup)\n- [`getEnvironmentVariable`](#getenvironmentvariable)\n- [`updateEnvironmentVariable`](#updateenvironmentvariable)\n- [`deleteEnvironmentVariable`](#deleteenvironmentvariable)\n\n**Schemas**\n- [`EnvironmentValueType`](#environmentvaluetype)\n- [`StringTranslations`](#stringtranslations)\n- [`MapEntry`](#mapentry)\n- [`MapValue`](#mapvalue)\n- [`JsonValue`](#jsonvalue)\n- [`LinkValue`](#linkvalue)\n- [`LinkFields`](#linkfields)\n- [`ListItemType`](#listitemtype)\n- [`ListOfText`](#listoftext)\n- [`ListOfString`](#listofstring)\n- [`ListOfSecretString`](#listofsecretstring)\n- [`ListOfNumber`](#listofnumber)\n- [`ListOfBoolean`](#listofboolean)\n- [`ListOfJson`](#listofjson)\n- [`ListOfLink`](#listoflink)\n- [`ListValue`](#listvalue)\n- [`EnvironmentValue`](#environmentvalue)\n- [`EnvironmentVariable`](#environmentvariable)\n- [`EnvironmentVariableListItem`](#environmentvariablelistitem)\n- [`EnvironmentVariableList`](#environmentvariablelist)\n- [`EnvironmentVariableCreateRequest`](#environmentvariablecreaterequest)\n- [`EnvironmentVariableUpdateRequest`](#environmentvariableupdaterequest)\n- [`EnvironmentGroup`](#environmentgroup)\n- [`EnvironmentGroupList`](#environmentgrouplist)\n- [`EnvironmentGroupUpsertRequest`](#environmentgroupupsertrequest)\n\n### `listEnvironmentVariables`\n\nList all environment variables for the organization. Returns metadata only, no secret values.\n\n`GET /v1/environments`\n\n```ts\nconst { data } = await client.listEnvironmentVariables()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "items": [\n {\n "key": "string",\n "type": "String",\n "item_type": "String",\n "description": "string",\n "group": "string",\n "value": "string",\n "protected": true,\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createEnvironmentVariable`\n\nCreate a new environment variable or secret for the organization. If `group` is provided and the group does not yet exist, it is created automatically.\n\n`POST /v1/environments`\n\n```ts\nconst { data } = await client.createEnvironmentVariable(\n null,\n {\n key: \'string\',\n type: \'String\',\n description: \'string\',\n group: \'string\',\n value: \'string\',\n protected: true\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "key": "string",\n "type": "String",\n "item_type": "String",\n "description": "string",\n "group": "string",\n "value": "string",\n "protected": true,\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `listEnvironmentGroups`\n\nList all environment groups for the organization.\n\n`GET /v1/environments/groups`\n\n```ts\nconst { data } = await client.listEnvironmentGroups()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "items": [\n {\n "name": "string",\n "description": "string",\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `putEnvironmentGroup`\n\nCreate or update an environment group by name. Acts as an upsert \u2014 creates the group if it does not exist.\n\n`PUT /v1/environments/groups/{name}`\n\n```ts\nconst { data } = await client.putEnvironmentGroup(\n {\n name: \'example\',\n },\n {\n description: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "name": "string",\n "description": "string",\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `deleteEnvironmentGroup`\n\nDeletes a group. Variables assigned to this group become ungrouped.\n\n`DELETE /v1/environments/groups/{name}`\n\n```ts\nconst { data } = await client.deleteEnvironmentGroup({\n name: \'example\',\n})\n```\n\n---\n\n### `getEnvironmentVariable`\n\nGet an environment variable by key. Returns value for non-secret types, omitted for SecretString.\n\n`GET /v1/environments/{key}`\n\n```ts\nconst { data } = await client.getEnvironmentVariable({\n key: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "key": "string",\n "type": "String",\n "item_type": "String",\n "description": "string",\n "group": "string",\n "value": "string",\n "protected": true,\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateEnvironmentVariable`\n\nCreate or update an environment variable. Acts as an upsert \u2014 creates the variable if it does not exist. If `group` is provided and the group does not yet exist, it is created automatically.\n\n`PUT /v1/environments/{key}`\n\n```ts\nconst { data } = await client.updateEnvironmentVariable(\n {\n key: \'example\',\n },\n {\n type: \'String\',\n value: \'string\',\n description: \'string\',\n group: \'string\',\n protected: true\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "key": "string",\n "type": "String",\n "item_type": "String",\n "description": "string",\n "group": "string",\n "value": "string",\n "protected": true,\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `deleteEnvironmentVariable`\n\nDelete an environment variable by key.\n\n`DELETE /v1/environments/{key}`\n\n```ts\nconst { data } = await client.deleteEnvironmentVariable({\n key: \'example\',\n})\n```\n\n---\n\n## Schemas\n\n### `EnvironmentValueType`\n\nThe structure a variable\'s value holds. `SecretString` is encrypted at rest and\nits value is never returned. Every other type\nmay be served to browser-facing consumers. A `List` inherits this from its element\ntype: a `List`<SecretString>`` is never served.\n\n\n```ts\ntype EnvironmentValueType = "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n```\n\n### `StringTranslations`\n\nA string translated per language. Keys are language codes (e.g. `de`,\n`en-US`), matching the hyphen-only BCP-47 form epilot\'s i18n stack uses\neverywhere else: `^[a-z]{2,3}(-[A-Za-z0-9]+)*$`. The server enforces\nthat with LANGUAGE_KEY_PATTERN in src/core/value-types.ts \u2014 the two are\nnot otherwise lin\n\n```ts\ntype StringTranslations = Record<string, string>\n```\n\n### `MapEntry`\n\nOne entry of a Map. `key` is the token a journey submits; `value` is\nwhat the customer reads \u2014 either one string, or one string per\nlanguage. Every entry of a Map must agree on which of the two it uses.\n\n\n```ts\ntype MapEntry = {\n key: string\n value: string | Record<string, string>\n}\n```\n\n### `MapValue`\n\n```ts\ntype MapValue = {\n fallbackLanguage?: string\n options: Array<{\n key: string\n value: string | Record<string, string>\n }>\n}\n```\n\n### `JsonValue`\n\nArbitrary JSON object, e.g. a flat key/value map used by integrations for\nenum translation: {"Mr.": 1, "Ms. / Mrs.": 2}. Max 32 KB serialised.\n\n\n```ts\ntype JsonValue = Record<string, unknown>\n```\n\n### `LinkValue`\n\nOne URL with a label and description a customer reads. `label` and\n`description` are each either a plain string or one string per language;\nthe two fields decide that independently \u2014 a plain string means "the\nsame in every language". A translated field must carry the fallback\nlanguage.\n\nThe URL must\n\n```ts\ntype LinkValue = {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n}\n```\n\n### `LinkFields`\n\nThe fields of a link, without a fallback language \u2014 the shape a `List`\nitem carries. Inside a list the fallback belongs to the wrapper, which\nowns the language tabs for every row.\n\nRestated rather than composed with `LinkValue`: `allOf` plus\n`additionalProperties: false` is rejected by most validato\n\n```ts\ntype LinkFields = {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n}\n```\n\n### `ListItemType`\n\nThe element type a `List` holds \u2014 every value type except the\ncontainers. `Map` is already a keyed collection and a list of lists has\nno consumer. A list is exactly as client-safe and exactly as secret as\nits element type: a list of `SecretString` is encrypted per item and its\nvalue is never returne\n\n```ts\ntype ListItemType = "String" | "SecretString" | "Text" | "Number" | "Boolean" | "JSON" | "Link"\n```\n\n### `ListOfText`\n\n```ts\ntype ListOfText = {\n itemType: "Text"\n items: string[]\n}\n```\n\n### `ListOfString`\n\n```ts\ntype ListOfString = {\n itemType: "String"\n items: string[]\n}\n```\n\n### `ListOfSecretString`\n\nWrite-only in effect: the items are encrypted per item at rest and the\nwhole value is omitted from every read response, exactly as a\n`SecretString` variable\'s value is. Read `item_type` to learn what a\nlist holds when its value is withheld.\n\n\n```ts\ntype ListOfSecretString = {\n itemType: "SecretString"\n items: string[]\n}\n```\n\n### `ListOfNumber`\n\n```ts\ntype ListOfNumber = {\n itemType: "Number"\n items: number[]\n}\n```\n\n### `ListOfBoolean`\n\n```ts\ntype ListOfBoolean = {\n itemType: "Boolean"\n items: boolean[]\n}\n```\n\n### `ListOfJson`\n\n```ts\ntype ListOfJson = {\n itemType: "JSON"\n items: Record<string, unknown>[]\n}\n```\n\n### `ListOfLink`\n\nA list of links. `fallbackLanguage` applies to every item\'s translated\n`label` and `description`; items may mix plain and translated fields\nfreely, since a plain string is a complete answer for any language.\n\n\n```ts\ntype ListOfLink = {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n }>\n}\n```\n\n### `ListValue`\n\nAn ordered collection of one declared element type. Items round-trip in\nthe order written; nothing sorts them. Holds at most 100 items.\n\nThe whole value is limited to 32768 characters when serialised \u2014 the\nserver enforces this, and it is not expressible per-property here.\n\n\n```ts\ntype ListValue = {\n itemType: "Text"\n items: string[]\n} | {\n itemType: "Number"\n items: number[]\n} | {\n itemType: "Boolean"\n items: boolean[]\n} | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n} | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n }>\n} | {\n itemType: "String"\n items: string[]\n} | {\n itemType: "SecretString"\n items: string[]\n}\n```\n\n### `EnvironmentValue`\n\nA variable\'s value. The JSON type corresponds to the variable\'s `type`:\n`String`, `SecretString` and `Text` are strings, `Number` is a number,\n`Boolean` is a boolean, and `Map`, `JSON`, `Link` and `List` are objects.\nNumbers are IEEE 754 doubles; integers above 2^53 may lose precision on\nround-trip.\n\n```ts\ntype EnvironmentValue = string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: string\n value: string | Record<string, string>\n }>\n} | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n} | {\n itemType: "Text"\n items: string[]\n} | {\n itemType: "Number"\n items: number[]\n} | {\n itemType: "Boolean"\n items: boolean[]\n} | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n} | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n }>\n} | {\n itemType: "String"\n items: string[]\n} | {\n itemType: "SecretString"\n items: string[]\n}\n```\n\n### `EnvironmentVariable`\n\n```ts\ntype EnvironmentVariable = {\n key: string\n type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n item_type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "JSON" | "Link"\n description?: string\n group?: string\n value?: string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: { ... }\n value: { ... }\n }>\n } | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n } | {\n itemType: "Text"\n items: string[]\n } | {\n itemType: "Number"\n items: number[]\n } | {\n itemType: "Boolean"\n items: boolean[]\n } | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n } | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: { ... }\n label: { ... }\n description?: { ... }\n }>\n } | {\n itemType: "String"\n items: string[]\n } | {\n itemType: "SecretString"\n items: string[]\n }\n protected?: boolean\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `EnvironmentVariableListItem`\n\n```ts\ntype EnvironmentVariableListItem = {\n key: string\n type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n item_type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "JSON" | "Link"\n description?: string\n group?: string\n value?: string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: { ... }\n value: { ... }\n }>\n } | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n } | {\n itemType: "Text"\n items: string[]\n } | {\n itemType: "Number"\n items: number[]\n } | {\n itemType: "Boolean"\n items: boolean[]\n } | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n } | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: { ... }\n label: { ... }\n description?: { ... }\n }>\n } | {\n itemType: "String"\n items: string[]\n } | {\n itemType: "SecretString"\n items: string[]\n }\n protected?: boolean\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `EnvironmentVariableList`\n\n```ts\ntype EnvironmentVariableList = {\n items: Array<{\n key: string\n type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n item_type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "JSON" | "Link"\n description?: string\n group?: string\n value?: string | number | boolean | {\n fallbackLanguage?: { ... }\n options: { ... }\n } | Record<string, unknown> | {\n url: { ... }\n label: { ... }\n description?: { ... }\n fallbackLanguage?: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n fallbackLanguage?: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n }\n protected?: boolean\n created_at: string // date-time\n updated_at: string // date-time\n }>\n}\n```\n\n### `EnvironmentVariableCreateRequest`\n\n```ts\ntype EnvironmentVariableCreateRequest = {\n key: string\n type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n description?: string\n group?: string\n value?: string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: { ... }\n value: { ... }\n }>\n } | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n } | {\n itemType: "Text"\n items: string[]\n } | {\n itemType: "Number"\n items: number[]\n } | {\n itemType: "Boolean"\n items: boolean[]\n } | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n } | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: { ... }\n label: { ... }\n description?: { ... }\n }>\n } | {\n itemType: "String"\n items: string[]\n } | {\n itemType: "SecretString"\n items: string[]\n }\n protected?: boolean\n}\n```\n\n### `EnvironmentVariableUpdateRequest`\n\n```ts\ntype EnvironmentVariableUpdateRequest = {\n type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n value?: string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: { ... }\n value: { ... }\n }>\n } | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n } | {\n itemType: "Text"\n items: string[]\n } | {\n itemType: "Number"\n items: number[]\n } | {\n itemType: "Boolean"\n items: boolean[]\n } | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n } | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: { ... }\n label: { ... }\n description?: { ... }\n }>\n } | {\n itemType: "String"\n items: string[]\n } | {\n itemType: "SecretString"\n items: string[]\n }\n description?: string\n group?: string\n protected?: boolean\n}\n```\n\n### `EnvironmentGroup`\n\n```ts\ntype EnvironmentGroup = {\n name: string\n description?: string\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `EnvironmentGroupList`\n\n```ts\ntype EnvironmentGroupList = {\n items: Array<{\n name: string\n description?: string\n created_at: string // date-time\n updated_at: string // date-time\n }>\n}\n```\n\n### `EnvironmentGroupUpsertRequest`\n\n```ts\ntype EnvironmentGroupUpsertRequest = {\n description?: string\n}\n```\n';
|
|
5
|
+
export {
|
|
6
|
+
environments_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
+
|
|
3
|
+
// src/docs/environments.json
|
|
4
|
+
var environments_default = '# Environments API\n\n- **Base URL:** `https://environments.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/environments](https://docs.epilot.io/api/environments)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.environments.listEnvironmentVariables(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/environments\'\n\nconst environmentsClient = getClient()\nauthorize(environmentsClient, () => \'<token>\')\nconst { data } = await environmentsClient.listEnvironmentVariables(...)\n```\n\n## Operations\n\n**environments**\n- [`listEnvironmentVariables`](#listenvironmentvariables)\n- [`createEnvironmentVariable`](#createenvironmentvariable)\n- [`listEnvironmentGroups`](#listenvironmentgroups)\n- [`putEnvironmentGroup`](#putenvironmentgroup)\n- [`deleteEnvironmentGroup`](#deleteenvironmentgroup)\n- [`getEnvironmentVariable`](#getenvironmentvariable)\n- [`updateEnvironmentVariable`](#updateenvironmentvariable)\n- [`deleteEnvironmentVariable`](#deleteenvironmentvariable)\n\n**Schemas**\n- [`EnvironmentValueType`](#environmentvaluetype)\n- [`StringTranslations`](#stringtranslations)\n- [`MapEntry`](#mapentry)\n- [`MapValue`](#mapvalue)\n- [`JsonValue`](#jsonvalue)\n- [`LinkValue`](#linkvalue)\n- [`LinkFields`](#linkfields)\n- [`ListItemType`](#listitemtype)\n- [`ListOfText`](#listoftext)\n- [`ListOfString`](#listofstring)\n- [`ListOfSecretString`](#listofsecretstring)\n- [`ListOfNumber`](#listofnumber)\n- [`ListOfBoolean`](#listofboolean)\n- [`ListOfJson`](#listofjson)\n- [`ListOfLink`](#listoflink)\n- [`ListValue`](#listvalue)\n- [`EnvironmentValue`](#environmentvalue)\n- [`EnvironmentVariable`](#environmentvariable)\n- [`EnvironmentVariableListItem`](#environmentvariablelistitem)\n- [`EnvironmentVariableList`](#environmentvariablelist)\n- [`EnvironmentVariableCreateRequest`](#environmentvariablecreaterequest)\n- [`EnvironmentVariableUpdateRequest`](#environmentvariableupdaterequest)\n- [`EnvironmentGroup`](#environmentgroup)\n- [`EnvironmentGroupList`](#environmentgrouplist)\n- [`EnvironmentGroupUpsertRequest`](#environmentgroupupsertrequest)\n\n### `listEnvironmentVariables`\n\nList all environment variables for the organization. Returns metadata only, no secret values.\n\n`GET /v1/environments`\n\n```ts\nconst { data } = await client.listEnvironmentVariables()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "items": [\n {\n "key": "string",\n "type": "String",\n "item_type": "String",\n "description": "string",\n "group": "string",\n "value": "string",\n "protected": true,\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createEnvironmentVariable`\n\nCreate a new environment variable or secret for the organization. If `group` is provided and the group does not yet exist, it is created automatically.\n\n`POST /v1/environments`\n\n```ts\nconst { data } = await client.createEnvironmentVariable(\n null,\n {\n key: \'string\',\n type: \'String\',\n description: \'string\',\n group: \'string\',\n value: \'string\',\n protected: true\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "key": "string",\n "type": "String",\n "item_type": "String",\n "description": "string",\n "group": "string",\n "value": "string",\n "protected": true,\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `listEnvironmentGroups`\n\nList all environment groups for the organization.\n\n`GET /v1/environments/groups`\n\n```ts\nconst { data } = await client.listEnvironmentGroups()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "items": [\n {\n "name": "string",\n "description": "string",\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `putEnvironmentGroup`\n\nCreate or update an environment group by name. Acts as an upsert \u2014 creates the group if it does not exist.\n\n`PUT /v1/environments/groups/{name}`\n\n```ts\nconst { data } = await client.putEnvironmentGroup(\n {\n name: \'example\',\n },\n {\n description: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "name": "string",\n "description": "string",\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `deleteEnvironmentGroup`\n\nDeletes a group. Variables assigned to this group become ungrouped.\n\n`DELETE /v1/environments/groups/{name}`\n\n```ts\nconst { data } = await client.deleteEnvironmentGroup({\n name: \'example\',\n})\n```\n\n---\n\n### `getEnvironmentVariable`\n\nGet an environment variable by key. Returns value for non-secret types, omitted for SecretString.\n\n`GET /v1/environments/{key}`\n\n```ts\nconst { data } = await client.getEnvironmentVariable({\n key: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "key": "string",\n "type": "String",\n "item_type": "String",\n "description": "string",\n "group": "string",\n "value": "string",\n "protected": true,\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `updateEnvironmentVariable`\n\nCreate or update an environment variable. Acts as an upsert \u2014 creates the variable if it does not exist. If `group` is provided and the group does not yet exist, it is created automatically.\n\n`PUT /v1/environments/{key}`\n\n```ts\nconst { data } = await client.updateEnvironmentVariable(\n {\n key: \'example\',\n },\n {\n type: \'String\',\n value: \'string\',\n description: \'string\',\n group: \'string\',\n protected: true\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "key": "string",\n "type": "String",\n "item_type": "String",\n "description": "string",\n "group": "string",\n "value": "string",\n "protected": true,\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z"\n}\n```\n\n</details>\n\n---\n\n### `deleteEnvironmentVariable`\n\nDelete an environment variable by key.\n\n`DELETE /v1/environments/{key}`\n\n```ts\nconst { data } = await client.deleteEnvironmentVariable({\n key: \'example\',\n})\n```\n\n---\n\n## Schemas\n\n### `EnvironmentValueType`\n\nThe structure a variable\'s value holds. `SecretString` is encrypted at rest and\nits value is never returned. Every other type\nmay be served to browser-facing consumers. A `List` inherits this from its element\ntype: a `List`<SecretString>`` is never served.\n\n\n```ts\ntype EnvironmentValueType = "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n```\n\n### `StringTranslations`\n\nA string translated per language. Keys are language codes (e.g. `de`,\n`en-US`), matching the hyphen-only BCP-47 form epilot\'s i18n stack uses\neverywhere else: `^[a-z]{2,3}(-[A-Za-z0-9]+)*$`. The server enforces\nthat with LANGUAGE_KEY_PATTERN in src/core/value-types.ts \u2014 the two are\nnot otherwise lin\n\n```ts\ntype StringTranslations = Record<string, string>\n```\n\n### `MapEntry`\n\nOne entry of a Map. `key` is the token a journey submits; `value` is\nwhat the customer reads \u2014 either one string, or one string per\nlanguage. Every entry of a Map must agree on which of the two it uses.\n\n\n```ts\ntype MapEntry = {\n key: string\n value: string | Record<string, string>\n}\n```\n\n### `MapValue`\n\n```ts\ntype MapValue = {\n fallbackLanguage?: string\n options: Array<{\n key: string\n value: string | Record<string, string>\n }>\n}\n```\n\n### `JsonValue`\n\nArbitrary JSON object, e.g. a flat key/value map used by integrations for\nenum translation: {"Mr.": 1, "Ms. / Mrs.": 2}. Max 32 KB serialised.\n\n\n```ts\ntype JsonValue = Record<string, unknown>\n```\n\n### `LinkValue`\n\nOne URL with a label and description a customer reads. `label` and\n`description` are each either a plain string or one string per language;\nthe two fields decide that independently \u2014 a plain string means "the\nsame in every language". A translated field must carry the fallback\nlanguage.\n\nThe URL must\n\n```ts\ntype LinkValue = {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n}\n```\n\n### `LinkFields`\n\nThe fields of a link, without a fallback language \u2014 the shape a `List`\nitem carries. Inside a list the fallback belongs to the wrapper, which\nowns the language tabs for every row.\n\nRestated rather than composed with `LinkValue`: `allOf` plus\n`additionalProperties: false` is rejected by most validato\n\n```ts\ntype LinkFields = {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n}\n```\n\n### `ListItemType`\n\nThe element type a `List` holds \u2014 every value type except the\ncontainers. `Map` is already a keyed collection and a list of lists has\nno consumer. A list is exactly as client-safe and exactly as secret as\nits element type: a list of `SecretString` is encrypted per item and its\nvalue is never returne\n\n```ts\ntype ListItemType = "String" | "SecretString" | "Text" | "Number" | "Boolean" | "JSON" | "Link"\n```\n\n### `ListOfText`\n\n```ts\ntype ListOfText = {\n itemType: "Text"\n items: string[]\n}\n```\n\n### `ListOfString`\n\n```ts\ntype ListOfString = {\n itemType: "String"\n items: string[]\n}\n```\n\n### `ListOfSecretString`\n\nWrite-only in effect: the items are encrypted per item at rest and the\nwhole value is omitted from every read response, exactly as a\n`SecretString` variable\'s value is. Read `item_type` to learn what a\nlist holds when its value is withheld.\n\n\n```ts\ntype ListOfSecretString = {\n itemType: "SecretString"\n items: string[]\n}\n```\n\n### `ListOfNumber`\n\n```ts\ntype ListOfNumber = {\n itemType: "Number"\n items: number[]\n}\n```\n\n### `ListOfBoolean`\n\n```ts\ntype ListOfBoolean = {\n itemType: "Boolean"\n items: boolean[]\n}\n```\n\n### `ListOfJson`\n\n```ts\ntype ListOfJson = {\n itemType: "JSON"\n items: Record<string, unknown>[]\n}\n```\n\n### `ListOfLink`\n\nA list of links. `fallbackLanguage` applies to every item\'s translated\n`label` and `description`; items may mix plain and translated fields\nfreely, since a plain string is a complete answer for any language.\n\n\n```ts\ntype ListOfLink = {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n }>\n}\n```\n\n### `ListValue`\n\nAn ordered collection of one declared element type. Items round-trip in\nthe order written; nothing sorts them. Holds at most 100 items.\n\nThe whole value is limited to 32768 characters when serialised \u2014 the\nserver enforces this, and it is not expressible per-property here.\n\n\n```ts\ntype ListValue = {\n itemType: "Text"\n items: string[]\n} | {\n itemType: "Number"\n items: number[]\n} | {\n itemType: "Boolean"\n items: boolean[]\n} | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n} | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n }>\n} | {\n itemType: "String"\n items: string[]\n} | {\n itemType: "SecretString"\n items: string[]\n}\n```\n\n### `EnvironmentValue`\n\nA variable\'s value. The JSON type corresponds to the variable\'s `type`:\n`String`, `SecretString` and `Text` are strings, `Number` is a number,\n`Boolean` is a boolean, and `Map`, `JSON`, `Link` and `List` are objects.\nNumbers are IEEE 754 doubles; integers above 2^53 may lose precision on\nround-trip.\n\n```ts\ntype EnvironmentValue = string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: string\n value: string | Record<string, string>\n }>\n} | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n} | {\n itemType: "Text"\n items: string[]\n} | {\n itemType: "Number"\n items: number[]\n} | {\n itemType: "Boolean"\n items: boolean[]\n} | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n} | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n }>\n} | {\n itemType: "String"\n items: string[]\n} | {\n itemType: "SecretString"\n items: string[]\n}\n```\n\n### `EnvironmentVariable`\n\n```ts\ntype EnvironmentVariable = {\n key: string\n type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n item_type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "JSON" | "Link"\n description?: string\n group?: string\n value?: string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: { ... }\n value: { ... }\n }>\n } | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n } | {\n itemType: "Text"\n items: string[]\n } | {\n itemType: "Number"\n items: number[]\n } | {\n itemType: "Boolean"\n items: boolean[]\n } | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n } | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: { ... }\n label: { ... }\n description?: { ... }\n }>\n } | {\n itemType: "String"\n items: string[]\n } | {\n itemType: "SecretString"\n items: string[]\n }\n protected?: boolean\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `EnvironmentVariableListItem`\n\n```ts\ntype EnvironmentVariableListItem = {\n key: string\n type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n item_type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "JSON" | "Link"\n description?: string\n group?: string\n value?: string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: { ... }\n value: { ... }\n }>\n } | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n } | {\n itemType: "Text"\n items: string[]\n } | {\n itemType: "Number"\n items: number[]\n } | {\n itemType: "Boolean"\n items: boolean[]\n } | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n } | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: { ... }\n label: { ... }\n description?: { ... }\n }>\n } | {\n itemType: "String"\n items: string[]\n } | {\n itemType: "SecretString"\n items: string[]\n }\n protected?: boolean\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `EnvironmentVariableList`\n\n```ts\ntype EnvironmentVariableList = {\n items: Array<{\n key: string\n type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n item_type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "JSON" | "Link"\n description?: string\n group?: string\n value?: string | number | boolean | {\n fallbackLanguage?: { ... }\n options: { ... }\n } | Record<string, unknown> | {\n url: { ... }\n label: { ... }\n description?: { ... }\n fallbackLanguage?: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n fallbackLanguage?: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n } | {\n itemType: { ... }\n items: { ... }\n }\n protected?: boolean\n created_at: string // date-time\n updated_at: string // date-time\n }>\n}\n```\n\n### `EnvironmentVariableCreateRequest`\n\n```ts\ntype EnvironmentVariableCreateRequest = {\n key: string\n type: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n description?: string\n group?: string\n value?: string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: { ... }\n value: { ... }\n }>\n } | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n } | {\n itemType: "Text"\n items: string[]\n } | {\n itemType: "Number"\n items: number[]\n } | {\n itemType: "Boolean"\n items: boolean[]\n } | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n } | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: { ... }\n label: { ... }\n description?: { ... }\n }>\n } | {\n itemType: "String"\n items: string[]\n } | {\n itemType: "SecretString"\n items: string[]\n }\n protected?: boolean\n}\n```\n\n### `EnvironmentVariableUpdateRequest`\n\n```ts\ntype EnvironmentVariableUpdateRequest = {\n type?: "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"\n value?: string | number | boolean | {\n fallbackLanguage?: string\n options: Array<{\n key: { ... }\n value: { ... }\n }>\n } | Record<string, unknown> | {\n url: string\n label: string | Record<string, string>\n description?: string | Record<string, string>\n fallbackLanguage?: string\n } | {\n itemType: "Text"\n items: string[]\n } | {\n itemType: "Number"\n items: number[]\n } | {\n itemType: "Boolean"\n items: boolean[]\n } | {\n itemType: "JSON"\n items: Record<string, unknown>[]\n } | {\n itemType: "Link"\n fallbackLanguage?: string\n items: Array<{\n url: { ... }\n label: { ... }\n description?: { ... }\n }>\n } | {\n itemType: "String"\n items: string[]\n } | {\n itemType: "SecretString"\n items: string[]\n }\n description?: string\n group?: string\n protected?: boolean\n}\n```\n\n### `EnvironmentGroup`\n\n```ts\ntype EnvironmentGroup = {\n name: string\n description?: string\n created_at: string // date-time\n updated_at: string // date-time\n}\n```\n\n### `EnvironmentGroupList`\n\n```ts\ntype EnvironmentGroupList = {\n items: Array<{\n name: string\n description?: string\n created_at: string // date-time\n updated_at: string // date-time\n }>\n}\n```\n\n### `EnvironmentGroupUpsertRequest`\n\n```ts\ntype EnvironmentGroupUpsertRequest = {\n description?: string\n}\n```\n';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.default = environments_default;
|
|
@@ -45,9 +45,13 @@ declare namespace Components {
|
|
|
45
45
|
* same in every language". A translated field must carry the fallback
|
|
46
46
|
* language.
|
|
47
47
|
*
|
|
48
|
-
* The URL must be absolute and `http
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* The URL must be absolute and use `http`, `https`, `mailto` or `tel`.
|
|
49
|
+
* `mailto:` needs at least one address (`name@domain`) and may carry
|
|
50
|
+
* `?subject=…`; `tel:` needs a phone number (digits, an optional leading
|
|
51
|
+
* `+`, spaces, `-`, `.`, `(`, `)`) and may carry `;ext=…`. The checks are
|
|
52
|
+
* deliberately light. This value is served to browser-facing consumers,
|
|
53
|
+
* so every other scheme — `javascript:` and `data:` included — is rejected
|
|
54
|
+
* at write time.
|
|
51
55
|
*
|
|
52
56
|
* Written flat rather than composed from a shared field set: `allOf` plus
|
|
53
57
|
* `additionalProperties: false` is rejected by most validators, because
|
|
@@ -72,10 +76,9 @@ declare namespace Components {
|
|
|
72
76
|
ListValue;
|
|
73
77
|
/**
|
|
74
78
|
* The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
75
|
-
* its value is never returned.
|
|
76
|
-
* may be served to browser-facing consumers
|
|
77
|
-
*
|
|
78
|
-
* `itemType` is itself client-safe, so a `List<String>` or `List<SecretString>` is not.
|
|
79
|
+
* its value is never returned. Every other type
|
|
80
|
+
* may be served to browser-facing consumers. A `List` inherits this from its element
|
|
81
|
+
* type: a `List<SecretString>` is never served.
|
|
79
82
|
*
|
|
80
83
|
*/
|
|
81
84
|
export type EnvironmentValueType = "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List";
|
|
@@ -83,10 +86,9 @@ declare namespace Components {
|
|
|
83
86
|
key: string; // ^[a-z0-9][a-z0-9_.\-]{0,127}$
|
|
84
87
|
type: /**
|
|
85
88
|
* The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
86
|
-
* its value is never returned.
|
|
87
|
-
* may be served to browser-facing consumers
|
|
88
|
-
*
|
|
89
|
-
* `itemType` is itself client-safe, so a `List<String>` or `List<SecretString>` is not.
|
|
89
|
+
* its value is never returned. Every other type
|
|
90
|
+
* may be served to browser-facing consumers. A `List` inherits this from its element
|
|
91
|
+
* type: a `List<SecretString>` is never served.
|
|
90
92
|
*
|
|
91
93
|
*/
|
|
92
94
|
EnvironmentValueType;
|
|
@@ -129,9 +131,13 @@ declare namespace Components {
|
|
|
129
131
|
* same in every language". A translated field must carry the fallback
|
|
130
132
|
* language.
|
|
131
133
|
*
|
|
132
|
-
* The URL must be absolute and `http
|
|
133
|
-
*
|
|
134
|
-
*
|
|
134
|
+
* The URL must be absolute and use `http`, `https`, `mailto` or `tel`.
|
|
135
|
+
* `mailto:` needs at least one address (`name@domain`) and may carry
|
|
136
|
+
* `?subject=…`; `tel:` needs a phone number (digits, an optional leading
|
|
137
|
+
* `+`, spaces, `-`, `.`, `(`, `)`) and may carry `;ext=…`. The checks are
|
|
138
|
+
* deliberately light. This value is served to browser-facing consumers,
|
|
139
|
+
* so every other scheme — `javascript:` and `data:` included — is rejected
|
|
140
|
+
* at write time.
|
|
135
141
|
*
|
|
136
142
|
* Written flat rather than composed from a shared field set: `allOf` plus
|
|
137
143
|
* `additionalProperties: false` is rejected by most validators, because
|
|
@@ -165,10 +171,9 @@ declare namespace Components {
|
|
|
165
171
|
key: string; // ^[a-z0-9][a-z0-9_.\-]{0,127}$
|
|
166
172
|
type: /**
|
|
167
173
|
* The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
168
|
-
* its value is never returned.
|
|
169
|
-
* may be served to browser-facing consumers
|
|
170
|
-
*
|
|
171
|
-
* `itemType` is itself client-safe, so a `List<String>` or `List<SecretString>` is not.
|
|
174
|
+
* its value is never returned. Every other type
|
|
175
|
+
* may be served to browser-facing consumers. A `List` inherits this from its element
|
|
176
|
+
* type: a `List<SecretString>` is never served.
|
|
172
177
|
*
|
|
173
178
|
*/
|
|
174
179
|
EnvironmentValueType;
|
|
@@ -195,10 +200,9 @@ declare namespace Components {
|
|
|
195
200
|
key: string;
|
|
196
201
|
type: /**
|
|
197
202
|
* The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
198
|
-
* its value is never returned.
|
|
199
|
-
* may be served to browser-facing consumers
|
|
200
|
-
*
|
|
201
|
-
* `itemType` is itself client-safe, so a `List<String>` or `List<SecretString>` is not.
|
|
203
|
+
* its value is never returned. Every other type
|
|
204
|
+
* may be served to browser-facing consumers. A `List` inherits this from its element
|
|
205
|
+
* type: a `List<SecretString>` is never served.
|
|
202
206
|
*
|
|
203
207
|
*/
|
|
204
208
|
EnvironmentValueType;
|
|
@@ -241,9 +245,13 @@ declare namespace Components {
|
|
|
241
245
|
* same in every language". A translated field must carry the fallback
|
|
242
246
|
* language.
|
|
243
247
|
*
|
|
244
|
-
* The URL must be absolute and `http
|
|
245
|
-
*
|
|
246
|
-
*
|
|
248
|
+
* The URL must be absolute and use `http`, `https`, `mailto` or `tel`.
|
|
249
|
+
* `mailto:` needs at least one address (`name@domain`) and may carry
|
|
250
|
+
* `?subject=…`; `tel:` needs a phone number (digits, an optional leading
|
|
251
|
+
* `+`, spaces, `-`, `.`, `(`, `)`) and may carry `;ext=…`. The checks are
|
|
252
|
+
* deliberately light. This value is served to browser-facing consumers,
|
|
253
|
+
* so every other scheme — `javascript:` and `data:` included — is rejected
|
|
254
|
+
* at write time.
|
|
247
255
|
*
|
|
248
256
|
* Written flat rather than composed from a shared field set: `allOf` plus
|
|
249
257
|
* `additionalProperties: false` is rejected by most validators, because
|
|
@@ -345,9 +353,13 @@ declare namespace Components {
|
|
|
345
353
|
* same in every language". A translated field must carry the fallback
|
|
346
354
|
* language.
|
|
347
355
|
*
|
|
348
|
-
* The URL must be absolute and `http
|
|
349
|
-
*
|
|
350
|
-
*
|
|
356
|
+
* The URL must be absolute and use `http`, `https`, `mailto` or `tel`.
|
|
357
|
+
* `mailto:` needs at least one address (`name@domain`) and may carry
|
|
358
|
+
* `?subject=…`; `tel:` needs a phone number (digits, an optional leading
|
|
359
|
+
* `+`, spaces, `-`, `.`, `(`, `)`) and may carry `;ext=…`. The checks are
|
|
360
|
+
* deliberately light. This value is served to browser-facing consumers,
|
|
361
|
+
* so every other scheme — `javascript:` and `data:` included — is rejected
|
|
362
|
+
* at write time.
|
|
351
363
|
*
|
|
352
364
|
* Written flat rather than composed from a shared field set: `allOf` plus
|
|
353
365
|
* `additionalProperties: false` is rejected by most validators, because
|
|
@@ -45,9 +45,13 @@ declare namespace Components {
|
|
|
45
45
|
* same in every language". A translated field must carry the fallback
|
|
46
46
|
* language.
|
|
47
47
|
*
|
|
48
|
-
* The URL must be absolute and `http
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* The URL must be absolute and use `http`, `https`, `mailto` or `tel`.
|
|
49
|
+
* `mailto:` needs at least one address (`name@domain`) and may carry
|
|
50
|
+
* `?subject=…`; `tel:` needs a phone number (digits, an optional leading
|
|
51
|
+
* `+`, spaces, `-`, `.`, `(`, `)`) and may carry `;ext=…`. The checks are
|
|
52
|
+
* deliberately light. This value is served to browser-facing consumers,
|
|
53
|
+
* so every other scheme — `javascript:` and `data:` included — is rejected
|
|
54
|
+
* at write time.
|
|
51
55
|
*
|
|
52
56
|
* Written flat rather than composed from a shared field set: `allOf` plus
|
|
53
57
|
* `additionalProperties: false` is rejected by most validators, because
|
|
@@ -72,10 +76,9 @@ declare namespace Components {
|
|
|
72
76
|
ListValue;
|
|
73
77
|
/**
|
|
74
78
|
* The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
75
|
-
* its value is never returned.
|
|
76
|
-
* may be served to browser-facing consumers
|
|
77
|
-
*
|
|
78
|
-
* `itemType` is itself client-safe, so a `List<String>` or `List<SecretString>` is not.
|
|
79
|
+
* its value is never returned. Every other type
|
|
80
|
+
* may be served to browser-facing consumers. A `List` inherits this from its element
|
|
81
|
+
* type: a `List<SecretString>` is never served.
|
|
79
82
|
*
|
|
80
83
|
*/
|
|
81
84
|
export type EnvironmentValueType = "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List";
|
|
@@ -83,10 +86,9 @@ declare namespace Components {
|
|
|
83
86
|
key: string; // ^[a-z0-9][a-z0-9_.\-]{0,127}$
|
|
84
87
|
type: /**
|
|
85
88
|
* The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
86
|
-
* its value is never returned.
|
|
87
|
-
* may be served to browser-facing consumers
|
|
88
|
-
*
|
|
89
|
-
* `itemType` is itself client-safe, so a `List<String>` or `List<SecretString>` is not.
|
|
89
|
+
* its value is never returned. Every other type
|
|
90
|
+
* may be served to browser-facing consumers. A `List` inherits this from its element
|
|
91
|
+
* type: a `List<SecretString>` is never served.
|
|
90
92
|
*
|
|
91
93
|
*/
|
|
92
94
|
EnvironmentValueType;
|
|
@@ -129,9 +131,13 @@ declare namespace Components {
|
|
|
129
131
|
* same in every language". A translated field must carry the fallback
|
|
130
132
|
* language.
|
|
131
133
|
*
|
|
132
|
-
* The URL must be absolute and `http
|
|
133
|
-
*
|
|
134
|
-
*
|
|
134
|
+
* The URL must be absolute and use `http`, `https`, `mailto` or `tel`.
|
|
135
|
+
* `mailto:` needs at least one address (`name@domain`) and may carry
|
|
136
|
+
* `?subject=…`; `tel:` needs a phone number (digits, an optional leading
|
|
137
|
+
* `+`, spaces, `-`, `.`, `(`, `)`) and may carry `;ext=…`. The checks are
|
|
138
|
+
* deliberately light. This value is served to browser-facing consumers,
|
|
139
|
+
* so every other scheme — `javascript:` and `data:` included — is rejected
|
|
140
|
+
* at write time.
|
|
135
141
|
*
|
|
136
142
|
* Written flat rather than composed from a shared field set: `allOf` plus
|
|
137
143
|
* `additionalProperties: false` is rejected by most validators, because
|
|
@@ -165,10 +171,9 @@ declare namespace Components {
|
|
|
165
171
|
key: string; // ^[a-z0-9][a-z0-9_.\-]{0,127}$
|
|
166
172
|
type: /**
|
|
167
173
|
* The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
168
|
-
* its value is never returned.
|
|
169
|
-
* may be served to browser-facing consumers
|
|
170
|
-
*
|
|
171
|
-
* `itemType` is itself client-safe, so a `List<String>` or `List<SecretString>` is not.
|
|
174
|
+
* its value is never returned. Every other type
|
|
175
|
+
* may be served to browser-facing consumers. A `List` inherits this from its element
|
|
176
|
+
* type: a `List<SecretString>` is never served.
|
|
172
177
|
*
|
|
173
178
|
*/
|
|
174
179
|
EnvironmentValueType;
|
|
@@ -195,10 +200,9 @@ declare namespace Components {
|
|
|
195
200
|
key: string;
|
|
196
201
|
type: /**
|
|
197
202
|
* The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
198
|
-
* its value is never returned.
|
|
199
|
-
* may be served to browser-facing consumers
|
|
200
|
-
*
|
|
201
|
-
* `itemType` is itself client-safe, so a `List<String>` or `List<SecretString>` is not.
|
|
203
|
+
* its value is never returned. Every other type
|
|
204
|
+
* may be served to browser-facing consumers. A `List` inherits this from its element
|
|
205
|
+
* type: a `List<SecretString>` is never served.
|
|
202
206
|
*
|
|
203
207
|
*/
|
|
204
208
|
EnvironmentValueType;
|
|
@@ -241,9 +245,13 @@ declare namespace Components {
|
|
|
241
245
|
* same in every language". A translated field must carry the fallback
|
|
242
246
|
* language.
|
|
243
247
|
*
|
|
244
|
-
* The URL must be absolute and `http
|
|
245
|
-
*
|
|
246
|
-
*
|
|
248
|
+
* The URL must be absolute and use `http`, `https`, `mailto` or `tel`.
|
|
249
|
+
* `mailto:` needs at least one address (`name@domain`) and may carry
|
|
250
|
+
* `?subject=…`; `tel:` needs a phone number (digits, an optional leading
|
|
251
|
+
* `+`, spaces, `-`, `.`, `(`, `)`) and may carry `;ext=…`. The checks are
|
|
252
|
+
* deliberately light. This value is served to browser-facing consumers,
|
|
253
|
+
* so every other scheme — `javascript:` and `data:` included — is rejected
|
|
254
|
+
* at write time.
|
|
247
255
|
*
|
|
248
256
|
* Written flat rather than composed from a shared field set: `allOf` plus
|
|
249
257
|
* `additionalProperties: false` is rejected by most validators, because
|
|
@@ -345,9 +353,13 @@ declare namespace Components {
|
|
|
345
353
|
* same in every language". A translated field must carry the fallback
|
|
346
354
|
* language.
|
|
347
355
|
*
|
|
348
|
-
* The URL must be absolute and `http
|
|
349
|
-
*
|
|
350
|
-
*
|
|
356
|
+
* The URL must be absolute and use `http`, `https`, `mailto` or `tel`.
|
|
357
|
+
* `mailto:` needs at least one address (`name@domain`) and may carry
|
|
358
|
+
* `?subject=…`; `tel:` needs a phone number (digits, an optional leading
|
|
359
|
+
* `+`, spaces, `-`, `.`, `(`, `)`) and may carry `;ext=…`. The checks are
|
|
360
|
+
* deliberately light. This value is served to browser-facing consumers,
|
|
361
|
+
* so every other scheme — `javascript:` and `data:` included — is rejected
|
|
362
|
+
* at write time.
|
|
351
363
|
*
|
|
352
364
|
* Written flat rather than composed from a shared field set: `allOf` plus
|
|
353
365
|
* `additionalProperties: false` is rejected by most validators, because
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./chunk-YPSWSI3M.js";
|
|
2
|
+
|
|
3
|
+
// src/docs/external-values.json
|
|
4
|
+
var external_values_default = '# External Values API\n\n- **Base URL:** `https://external-values.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/external-values](https://docs.epilot.io/api/external-values)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.externalValues.listExternalValues(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/external-values\'\n\nconst externalValuesClient = getClient()\nauthorize(externalValuesClient, () => \'<token>\')\nconst { data } = await externalValuesClient.listExternalValues(...)\n```\n\n## Operations\n\n**external-values**\n- [`listExternalValues`](#listexternalvalues)\n- [`resolveExternalValue`](#resolveexternalvalue)\n- [`resolvePortalExternalValue`](#resolveportalexternalvalue)\n\n**Schemas**\n- [`TranslatedString`](#translatedstring)\n- [`ExternalValueType`](#externalvaluetype)\n- [`ResolveExternalValueRequest`](#resolveexternalvaluerequest)\n- [`ExternalValueErrorCode`](#externalvalueerrorcode)\n- [`ExternalValueError`](#externalvalueerror)\n- [`ResolveExternalValueResponse`](#resolveexternalvalueresponse)\n- [`ExternalValueResultSummary`](#externalvalueresultsummary)\n- [`ExternalValueHookSummary`](#externalvaluehooksummary)\n- [`ContextRequirement`](#contextrequirement)\n- [`EntityContextRequirement`](#entitycontextrequirement)\n- [`ValueContextRequirement`](#valuecontextrequirement)\n- [`ExternalValueHookList`](#externalvaluehooklist)\n\n### `listExternalValues`\n\nList hooks and their results of all enabled installed apps that declare an\n`EXTERNAL_VALUES` component. Intended for pickers (e.g. the validation-rules builder).\n\n`GET /v1/external-values`\n\n```ts\nconst { data } = await client.listExternalValues()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hooks": [\n {\n "app_id": "string",\n "app_name": "string",\n "hook_id": "string",\n "name": {\n "de": "string",\n "en": "string"\n },\n "description": {\n "de": "string",\n "en": "string"\n },\n "results": [\n {\n "id": "string",\n "type": "number",\n "name": {\n "de": "string",\n "en": "string"\n }\n }\n ],\n "contexts": [\n {\n "type": "entity",\n "schema": "contract"\n }\n ]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `resolveExternalValue`\n\nResolve an external value hook for an epilot 360 user (builder preview, entity-attribute\nrules). The organization is taken from the caller\'s token.\n\n`POST /v1/external-values/{app_id}/hooks/{hook_id}:resolve`\n\n```ts\nconst { data } = await client.resolveExternalValue(\n {\n app_id: \'example\',\n hook_id: \'example\',\n },\n {\n context: {\n contract: [\n {\n _id: \'8a7e3f5e-9c0c-4c74-8d4a-1a1a1a1a1a1a\',\n external_id: \'C-1001\',\n installment_amount: 110\n }\n ]\n },\n consumer: {\n type: \'validation_rule\',\n rule_id: \'6c0a9e1e-2f4b-4e6a-8f8e-2b2b2b2b2b2b\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "values": {\n "predicted": 132\n },\n "errors": [\n {\n "result_id": "limit",\n "code": "coercion_failed",\n "message": "Cannot coerce \\"n/a\\" to number"\n }\n ],\n "policy": {\n "on_unavailable": "skip"\n }\n}\n```\n\n</details>\n\n---\n\n### `resolvePortalExternalValue`\n\nResolve an external value hook for a portal end customer (private journeys, portal).\nThe organization is taken from the portal token claims.\n\n`POST /v1/portal/external-values/{app_id}/hooks/{hook_id}:resolve`\n\n```ts\nconst { data } = await client.resolvePortalExternalValue(\n {\n app_id: \'example\',\n hook_id: \'example\',\n },\n {\n context: {\n contract: [\n {\n _id: \'8a7e3f5e-9c0c-4c74-8d4a-1a1a1a1a1a1a\',\n external_id: \'C-1001\',\n installment_amount: 110\n }\n ]\n },\n consumer: {\n type: \'validation_rule\',\n rule_id: \'6c0a9e1e-2f4b-4e6a-8f8e-2b2b2b2b2b2b\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "values": {\n "predicted": 132\n },\n "errors": [\n {\n "result_id": "limit",\n "code": "coercion_failed",\n "message": "Cannot coerce \\"n/a\\" to number"\n }\n ],\n "policy": {\n "on_unavailable": "skip"\n }\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `TranslatedString`\n\n```ts\ntype TranslatedString = {\n de: string\n en?: string\n}\n```\n\n### `ExternalValueType`\n\n```ts\ntype ExternalValueType = "number" | "text" | "date" | "boolean"\n```\n\n### `ResolveExternalValueRequest`\n\n```ts\ntype ResolveExternalValueRequest = {\n context: Record<string, unknown>\n consumer?: {\n type?: string\n rule_id?: string\n journey_id?: string\n }\n}\n```\n\n### `ExternalValueErrorCode`\n\n- `timeout`: the third-party call exceeded `timeout_ms`\n- `upstream_error`: the third-party call failed or returned a non-2xx status\n- `auth_failed`: the `auth` pre-call failed\n- `extraction_failed`: template/path/jsonata threw or yielded null / empty\n- `coercion_failed`: the extracted value could n\n\n```ts\ntype ExternalValueErrorCode = "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"\n```\n\n### `ExternalValueError`\n\n```ts\ntype ExternalValueError = {\n result_id?: string\n code: "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"\n message: string\n}\n```\n\n### `ResolveExternalValueResponse`\n\n```ts\ntype ResolveExternalValueResponse = {\n values: Record<string, number | string | boolean>\n errors: Array<{\n result_id?: string\n code: "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"\n message: string\n }>\n policy: {\n on_unavailable: "skip" | "block"\n }\n cached?: boolean\n}\n```\n\n### `ExternalValueResultSummary`\n\n```ts\ntype ExternalValueResultSummary = {\n id: string\n type: "number" | "text" | "date" | "boolean"\n name: {\n de: string\n en?: string\n }\n}\n```\n\n### `ExternalValueHookSummary`\n\n```ts\ntype ExternalValueHookSummary = {\n app_id: string\n app_name: string\n hook_id: string\n name: {\n de: string\n en?: string\n }\n description?: {\n de: string\n en?: string\n }\n results: Array<{\n id: string\n type: "number" | "text" | "date" | "boolean"\n name: {\n de: { ... }\n en?: { ... }\n }\n }>\n contexts?: Array<{\n type: "entity"\n schema: string\n } | {\n type: "value"\n name: string\n value_type: "number" | "text" | "date" | "boolean"\n }>\n}\n```\n\n### `ContextRequirement`\n\nSomething a hook needs the consumer to supply in `context`, discriminated by `type`:\nbound entities (`entity`) or an optional scalar input (`value`). More types may follow;\nconsumers ignore types they do not know.\n\n\n```ts\ntype ContextRequirement = {\n type: "entity"\n schema: string\n} | {\n type: "value"\n name: string\n value_type: "number" | "text" | "date" | "boolean"\n}\n```\n\n### `EntityContextRequirement`\n\nThe consumer supplies the bound entities of `schema` under `Context.`<schema>``, e.g. a hook\ninterpolating `{{ Context.contract[0].external_id }}` declares\n`{ type: entity, schema: contract }`.\n\n\n```ts\ntype EntityContextRequirement = {\n type: "entity"\n schema: string\n}\n```\n\n### `ValueContextRequirement`\n\nAn optional scalar input. When the consumer has a value it supplies it under\n`Context.`<name>`` (dates as ISO 8601 strings, `YYYY-MM-DD` or a date-time); otherwise the\nkey is absent, so the hook template must provide a fallback, e.g.\n`{{ Context.reading_date | default: "now" | date: "%Y-%m-%d" }}` dec\n\n```ts\ntype ValueContextRequirement = {\n type: "value"\n name: string\n value_type: "number" | "text" | "date" | "boolean"\n}\n```\n\n### `ExternalValueHookList`\n\n```ts\ntype ExternalValueHookList = {\n hooks: Array<{\n app_id: string\n app_name: string\n hook_id: string\n name: {\n de: { ... }\n en?: { ... }\n }\n description?: {\n de: { ... }\n en?: { ... }\n }\n results: Array<{\n id: { ... }\n type: { ... }\n name: { ... }\n }>\n contexts?: Array<{\n type: { ... }\n schema: { ... }\n } | {\n type: { ... }\n name: { ... }\n value_type: { ... }\n }>\n }>\n}\n```\n';
|
|
5
|
+
export {
|
|
6
|
+
external_values_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
+
|
|
3
|
+
// src/docs/external-values.json
|
|
4
|
+
var external_values_default = '# External Values API\n\n- **Base URL:** `https://external-values.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/external-values](https://docs.epilot.io/api/external-values)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.externalValues.listExternalValues(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/external-values\'\n\nconst externalValuesClient = getClient()\nauthorize(externalValuesClient, () => \'<token>\')\nconst { data } = await externalValuesClient.listExternalValues(...)\n```\n\n## Operations\n\n**external-values**\n- [`listExternalValues`](#listexternalvalues)\n- [`resolveExternalValue`](#resolveexternalvalue)\n- [`resolvePortalExternalValue`](#resolveportalexternalvalue)\n\n**Schemas**\n- [`TranslatedString`](#translatedstring)\n- [`ExternalValueType`](#externalvaluetype)\n- [`ResolveExternalValueRequest`](#resolveexternalvaluerequest)\n- [`ExternalValueErrorCode`](#externalvalueerrorcode)\n- [`ExternalValueError`](#externalvalueerror)\n- [`ResolveExternalValueResponse`](#resolveexternalvalueresponse)\n- [`ExternalValueResultSummary`](#externalvalueresultsummary)\n- [`ExternalValueHookSummary`](#externalvaluehooksummary)\n- [`ContextRequirement`](#contextrequirement)\n- [`EntityContextRequirement`](#entitycontextrequirement)\n- [`ValueContextRequirement`](#valuecontextrequirement)\n- [`ExternalValueHookList`](#externalvaluehooklist)\n\n### `listExternalValues`\n\nList hooks and their results of all enabled installed apps that declare an\n`EXTERNAL_VALUES` component. Intended for pickers (e.g. the validation-rules builder).\n\n`GET /v1/external-values`\n\n```ts\nconst { data } = await client.listExternalValues()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "hooks": [\n {\n "app_id": "string",\n "app_name": "string",\n "hook_id": "string",\n "name": {\n "de": "string",\n "en": "string"\n },\n "description": {\n "de": "string",\n "en": "string"\n },\n "results": [\n {\n "id": "string",\n "type": "number",\n "name": {\n "de": "string",\n "en": "string"\n }\n }\n ],\n "contexts": [\n {\n "type": "entity",\n "schema": "contract"\n }\n ]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `resolveExternalValue`\n\nResolve an external value hook for an epilot 360 user (builder preview, entity-attribute\nrules). The organization is taken from the caller\'s token.\n\n`POST /v1/external-values/{app_id}/hooks/{hook_id}:resolve`\n\n```ts\nconst { data } = await client.resolveExternalValue(\n {\n app_id: \'example\',\n hook_id: \'example\',\n },\n {\n context: {\n contract: [\n {\n _id: \'8a7e3f5e-9c0c-4c74-8d4a-1a1a1a1a1a1a\',\n external_id: \'C-1001\',\n installment_amount: 110\n }\n ]\n },\n consumer: {\n type: \'validation_rule\',\n rule_id: \'6c0a9e1e-2f4b-4e6a-8f8e-2b2b2b2b2b2b\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "values": {\n "predicted": 132\n },\n "errors": [\n {\n "result_id": "limit",\n "code": "coercion_failed",\n "message": "Cannot coerce \\"n/a\\" to number"\n }\n ],\n "policy": {\n "on_unavailable": "skip"\n }\n}\n```\n\n</details>\n\n---\n\n### `resolvePortalExternalValue`\n\nResolve an external value hook for a portal end customer (private journeys, portal).\nThe organization is taken from the portal token claims.\n\n`POST /v1/portal/external-values/{app_id}/hooks/{hook_id}:resolve`\n\n```ts\nconst { data } = await client.resolvePortalExternalValue(\n {\n app_id: \'example\',\n hook_id: \'example\',\n },\n {\n context: {\n contract: [\n {\n _id: \'8a7e3f5e-9c0c-4c74-8d4a-1a1a1a1a1a1a\',\n external_id: \'C-1001\',\n installment_amount: 110\n }\n ]\n },\n consumer: {\n type: \'validation_rule\',\n rule_id: \'6c0a9e1e-2f4b-4e6a-8f8e-2b2b2b2b2b2b\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "values": {\n "predicted": 132\n },\n "errors": [\n {\n "result_id": "limit",\n "code": "coercion_failed",\n "message": "Cannot coerce \\"n/a\\" to number"\n }\n ],\n "policy": {\n "on_unavailable": "skip"\n }\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `TranslatedString`\n\n```ts\ntype TranslatedString = {\n de: string\n en?: string\n}\n```\n\n### `ExternalValueType`\n\n```ts\ntype ExternalValueType = "number" | "text" | "date" | "boolean"\n```\n\n### `ResolveExternalValueRequest`\n\n```ts\ntype ResolveExternalValueRequest = {\n context: Record<string, unknown>\n consumer?: {\n type?: string\n rule_id?: string\n journey_id?: string\n }\n}\n```\n\n### `ExternalValueErrorCode`\n\n- `timeout`: the third-party call exceeded `timeout_ms`\n- `upstream_error`: the third-party call failed or returned a non-2xx status\n- `auth_failed`: the `auth` pre-call failed\n- `extraction_failed`: template/path/jsonata threw or yielded null / empty\n- `coercion_failed`: the extracted value could n\n\n```ts\ntype ExternalValueErrorCode = "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"\n```\n\n### `ExternalValueError`\n\n```ts\ntype ExternalValueError = {\n result_id?: string\n code: "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"\n message: string\n}\n```\n\n### `ResolveExternalValueResponse`\n\n```ts\ntype ResolveExternalValueResponse = {\n values: Record<string, number | string | boolean>\n errors: Array<{\n result_id?: string\n code: "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"\n message: string\n }>\n policy: {\n on_unavailable: "skip" | "block"\n }\n cached?: boolean\n}\n```\n\n### `ExternalValueResultSummary`\n\n```ts\ntype ExternalValueResultSummary = {\n id: string\n type: "number" | "text" | "date" | "boolean"\n name: {\n de: string\n en?: string\n }\n}\n```\n\n### `ExternalValueHookSummary`\n\n```ts\ntype ExternalValueHookSummary = {\n app_id: string\n app_name: string\n hook_id: string\n name: {\n de: string\n en?: string\n }\n description?: {\n de: string\n en?: string\n }\n results: Array<{\n id: string\n type: "number" | "text" | "date" | "boolean"\n name: {\n de: { ... }\n en?: { ... }\n }\n }>\n contexts?: Array<{\n type: "entity"\n schema: string\n } | {\n type: "value"\n name: string\n value_type: "number" | "text" | "date" | "boolean"\n }>\n}\n```\n\n### `ContextRequirement`\n\nSomething a hook needs the consumer to supply in `context`, discriminated by `type`:\nbound entities (`entity`) or an optional scalar input (`value`). More types may follow;\nconsumers ignore types they do not know.\n\n\n```ts\ntype ContextRequirement = {\n type: "entity"\n schema: string\n} | {\n type: "value"\n name: string\n value_type: "number" | "text" | "date" | "boolean"\n}\n```\n\n### `EntityContextRequirement`\n\nThe consumer supplies the bound entities of `schema` under `Context.`<schema>``, e.g. a hook\ninterpolating `{{ Context.contract[0].external_id }}` declares\n`{ type: entity, schema: contract }`.\n\n\n```ts\ntype EntityContextRequirement = {\n type: "entity"\n schema: string\n}\n```\n\n### `ValueContextRequirement`\n\nAn optional scalar input. When the consumer has a value it supplies it under\n`Context.`<name>`` (dates as ISO 8601 strings, `YYYY-MM-DD` or a date-time); otherwise the\nkey is absent, so the hook template must provide a fallback, e.g.\n`{{ Context.reading_date | default: "now" | date: "%Y-%m-%d" }}` dec\n\n```ts\ntype ValueContextRequirement = {\n type: "value"\n name: string\n value_type: "number" | "text" | "date" | "boolean"\n}\n```\n\n### `ExternalValueHookList`\n\n```ts\ntype ExternalValueHookList = {\n hooks: Array<{\n app_id: string\n app_name: string\n hook_id: string\n name: {\n de: { ... }\n en?: { ... }\n }\n description?: {\n de: { ... }\n en?: { ... }\n }\n results: Array<{\n id: { ... }\n type: { ... }\n name: { ... }\n }>\n contexts?: Array<{\n type: { ... }\n schema: { ... }\n } | {\n type: { ... }\n name: { ... }\n value_type: { ... }\n }>\n }>\n}\n```\n';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.default = external_values_default;
|
|
@@ -14,13 +14,15 @@ declare namespace Components {
|
|
|
14
14
|
}
|
|
15
15
|
namespace Schemas {
|
|
16
16
|
/**
|
|
17
|
-
* Something a hook needs the consumer to supply in `context`, discriminated by `type
|
|
18
|
-
*
|
|
17
|
+
* Something a hook needs the consumer to supply in `context`, discriminated by `type`:
|
|
18
|
+
* bound entities (`entity`) or an optional scalar input (`value`). More types may follow;
|
|
19
|
+
* consumers ignore types they do not know.
|
|
19
20
|
*
|
|
20
21
|
*/
|
|
21
22
|
export type ContextRequirement = /**
|
|
22
|
-
* Something a hook needs the consumer to supply in `context`, discriminated by `type
|
|
23
|
-
*
|
|
23
|
+
* Something a hook needs the consumer to supply in `context`, discriminated by `type`:
|
|
24
|
+
* bound entities (`entity`) or an optional scalar input (`value`). More types may follow;
|
|
25
|
+
* consumers ignore types they do not know.
|
|
24
26
|
*
|
|
25
27
|
*/
|
|
26
28
|
/**
|
|
@@ -29,7 +31,16 @@ declare namespace Components {
|
|
|
29
31
|
* `{ type: entity, schema: contract }`.
|
|
30
32
|
*
|
|
31
33
|
*/
|
|
32
|
-
EntityContextRequirement
|
|
34
|
+
EntityContextRequirement | /**
|
|
35
|
+
* An optional scalar input. When the consumer has a value it supplies it under
|
|
36
|
+
* `Context.<name>` (dates as ISO 8601 strings, `YYYY-MM-DD` or a date-time); otherwise the
|
|
37
|
+
* key is absent, so the hook template must provide a fallback, e.g.
|
|
38
|
+
* `{{ Context.reading_date | default: "now" | date: "%Y-%m-%d" }}` declares
|
|
39
|
+
* `{ type: value, name: reading_date, value_type: date }`. `name` is unique among the hook's
|
|
40
|
+
* `value` requirements and never equals the `schema` of one of its `entity` requirements.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
ValueContextRequirement;
|
|
33
44
|
/**
|
|
34
45
|
* The consumer supplies the bound entities of `schema` under `Context.<schema>`, e.g. a hook
|
|
35
46
|
* interpolating `{{ Context.contract[0].external_id }}` declares
|
|
@@ -83,13 +94,15 @@ declare namespace Components {
|
|
|
83
94
|
/**
|
|
84
95
|
* What the hook needs the consumer to supply in `context`, as declared in the hook
|
|
85
96
|
* config. Omitted when the hook declares none. A rule builder must require these
|
|
86
|
-
* contexts on any rule that uses the hook, so the
|
|
87
|
-
* More requirement types
|
|
97
|
+
* contexts (and offer these value inputs) on any rule that uses the hook, so the
|
|
98
|
+
* caller passes them in `context`. More requirement types may follow; consumers
|
|
99
|
+
* ignore types they do not know.
|
|
88
100
|
*
|
|
89
101
|
*/
|
|
90
102
|
contexts?: /**
|
|
91
|
-
* Something a hook needs the consumer to supply in `context`, discriminated by `type
|
|
92
|
-
*
|
|
103
|
+
* Something a hook needs the consumer to supply in `context`, discriminated by `type`:
|
|
104
|
+
* bound entities (`entity`) or an optional scalar input (`value`). More types may follow;
|
|
105
|
+
* consumers ignore types they do not know.
|
|
93
106
|
*
|
|
94
107
|
*/
|
|
95
108
|
ContextRequirement[];
|
|
@@ -126,8 +139,9 @@ declare namespace Components {
|
|
|
126
139
|
*
|
|
127
140
|
* One entry per context requirement the consumer bound (see
|
|
128
141
|
* `ExternalValueHookSummary.contexts`): for an `entity` requirement, the bound
|
|
129
|
-
* entities of that schema under its schema slug
|
|
130
|
-
*
|
|
142
|
+
* entities of that schema under its schema slug; for a `value` requirement, the
|
|
143
|
+
* bound scalar under its `name` (e.g. `"reading_date": "2026-03-01"`), omitted when
|
|
144
|
+
* the consumer has no value. This API gives no name special treatment.
|
|
131
145
|
*
|
|
132
146
|
*/
|
|
133
147
|
context: {
|
|
@@ -194,6 +208,25 @@ declare namespace Components {
|
|
|
194
208
|
*/
|
|
195
209
|
en?: string | null;
|
|
196
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* An optional scalar input. When the consumer has a value it supplies it under
|
|
213
|
+
* `Context.<name>` (dates as ISO 8601 strings, `YYYY-MM-DD` or a date-time); otherwise the
|
|
214
|
+
* key is absent, so the hook template must provide a fallback, e.g.
|
|
215
|
+
* `{{ Context.reading_date | default: "now" | date: "%Y-%m-%d" }}` declares
|
|
216
|
+
* `{ type: value, name: reading_date, value_type: date }`. `name` is unique among the hook's
|
|
217
|
+
* `value` requirements and never equals the `schema` of one of its `entity` requirements.
|
|
218
|
+
*
|
|
219
|
+
*/
|
|
220
|
+
export interface ValueContextRequirement {
|
|
221
|
+
type: "value";
|
|
222
|
+
/**
|
|
223
|
+
* Key under `Context`, same pattern as validation rule parameter names.
|
|
224
|
+
* example:
|
|
225
|
+
* reading_date
|
|
226
|
+
*/
|
|
227
|
+
name: string; // ^[a-z][a-z0-9_]{0,63}$
|
|
228
|
+
value_type: ExternalValueType;
|
|
229
|
+
}
|
|
197
230
|
}
|
|
198
231
|
}
|
|
199
232
|
declare namespace Paths {
|
|
@@ -441,5 +474,6 @@ type ExternalValueType = Components.Schemas.ExternalValueType;
|
|
|
441
474
|
type ResolveExternalValueRequest = Components.Schemas.ResolveExternalValueRequest;
|
|
442
475
|
type ResolveExternalValueResponse = Components.Schemas.ResolveExternalValueResponse;
|
|
443
476
|
type TranslatedString = Components.Schemas.TranslatedString;
|
|
477
|
+
type ValueContextRequirement = Components.Schemas.ValueContextRequirement;
|
|
444
478
|
|
|
445
|
-
export { type Client as C, type EntityContextRequirement as E, type OperationMethods as O, Paths as P, type ResolveExternalValueRequest as R, type TranslatedString as T, Components as a, type PathsDictionary as b, type ContextRequirement as c, type ExternalValueError as d, type ExternalValueErrorCode as e, type ExternalValueHookList as f, type ExternalValueHookSummary as g, type ExternalValueResultSummary as h, type ExternalValueType as i, type ResolveExternalValueResponse as j };
|
|
479
|
+
export { type Client as C, type EntityContextRequirement as E, type OperationMethods as O, Paths as P, type ResolveExternalValueRequest as R, type TranslatedString as T, type ValueContextRequirement as V, Components as a, type PathsDictionary as b, type ContextRequirement as c, type ExternalValueError as d, type ExternalValueErrorCode as e, type ExternalValueHookList as f, type ExternalValueHookSummary as g, type ExternalValueResultSummary as h, type ExternalValueType as i, type ResolveExternalValueResponse as j };
|