@epilot/sdk 2.20.55 → 2.20.56

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.
Files changed (139) hide show
  1. package/README.md +1 -0
  2. package/definitions/phone-integration-runtime.json +1 -0
  3. package/definitions/phone-integration.json +315 -0
  4. package/dist/README-EMWLD7LT.cjs +7 -0
  5. package/dist/README-XH3ZUZQC.js +7 -0
  6. package/dist/{_index-HL3HOTXB.js → _index-67F3SDWD.js} +3 -0
  7. package/dist/{_index-DEYTKG4Z.cjs → _index-GOK37TZ4.cjs} +4 -1
  8. package/dist/apis/access-token.cjs +6 -6
  9. package/dist/apis/access-token.js +1 -1
  10. package/dist/apis/address-suggestions.cjs +6 -6
  11. package/dist/apis/address-suggestions.js +1 -1
  12. package/dist/apis/address.cjs +6 -6
  13. package/dist/apis/address.js +1 -1
  14. package/dist/apis/ai-agents.cjs +6 -6
  15. package/dist/apis/ai-agents.js +1 -1
  16. package/dist/apis/app.cjs +6 -6
  17. package/dist/apis/app.js +1 -1
  18. package/dist/apis/audit-logs.cjs +6 -6
  19. package/dist/apis/audit-logs.js +1 -1
  20. package/dist/apis/automation.cjs +6 -6
  21. package/dist/apis/automation.js +1 -1
  22. package/dist/apis/billing.cjs +6 -6
  23. package/dist/apis/billing.js +1 -1
  24. package/dist/apis/blueprint-manifest.cjs +6 -6
  25. package/dist/apis/blueprint-manifest.js +1 -1
  26. package/dist/apis/calendar.cjs +6 -6
  27. package/dist/apis/calendar.js +1 -1
  28. package/dist/apis/chat.cjs +6 -6
  29. package/dist/apis/chat.js +1 -1
  30. package/dist/apis/configuration-hub.cjs +6 -6
  31. package/dist/apis/configuration-hub.js +1 -1
  32. package/dist/apis/consent.cjs +6 -6
  33. package/dist/apis/consent.js +1 -1
  34. package/dist/apis/customer-portal.cjs +6 -6
  35. package/dist/apis/customer-portal.js +1 -1
  36. package/dist/apis/dashboard.cjs +6 -6
  37. package/dist/apis/dashboard.js +1 -1
  38. package/dist/apis/data-governance.cjs +6 -6
  39. package/dist/apis/data-governance.js +1 -1
  40. package/dist/apis/deduplication.cjs +6 -6
  41. package/dist/apis/deduplication.js +1 -1
  42. package/dist/apis/design.cjs +6 -6
  43. package/dist/apis/design.js +1 -1
  44. package/dist/apis/document.cjs +6 -6
  45. package/dist/apis/document.js +1 -1
  46. package/dist/apis/email-settings.cjs +6 -6
  47. package/dist/apis/email-settings.js +1 -1
  48. package/dist/apis/email-template.cjs +6 -6
  49. package/dist/apis/email-template.js +1 -1
  50. package/dist/apis/entity-mapping.cjs +6 -6
  51. package/dist/apis/entity-mapping.js +1 -1
  52. package/dist/apis/entity.cjs +6 -6
  53. package/dist/apis/entity.js +1 -1
  54. package/dist/apis/environments.cjs +6 -6
  55. package/dist/apis/environments.js +1 -1
  56. package/dist/apis/event-catalog.cjs +6 -6
  57. package/dist/apis/event-catalog.js +1 -1
  58. package/dist/apis/external-values.cjs +6 -6
  59. package/dist/apis/external-values.js +1 -1
  60. package/dist/apis/file.cjs +6 -6
  61. package/dist/apis/file.js +1 -1
  62. package/dist/apis/iban.cjs +6 -6
  63. package/dist/apis/iban.js +1 -1
  64. package/dist/apis/identity.cjs +6 -6
  65. package/dist/apis/identity.js +1 -1
  66. package/dist/apis/integration-toolkit.cjs +6 -6
  67. package/dist/apis/integration-toolkit.js +1 -1
  68. package/dist/apis/journey.cjs +6 -6
  69. package/dist/apis/journey.js +1 -1
  70. package/dist/apis/kanban.cjs +6 -6
  71. package/dist/apis/kanban.js +1 -1
  72. package/dist/apis/message.cjs +6 -6
  73. package/dist/apis/message.js +1 -1
  74. package/dist/apis/metering.cjs +6 -6
  75. package/dist/apis/metering.js +1 -1
  76. package/dist/apis/notes.cjs +6 -6
  77. package/dist/apis/notes.js +1 -1
  78. package/dist/apis/notification.cjs +6 -6
  79. package/dist/apis/notification.js +1 -1
  80. package/dist/apis/organization.cjs +6 -6
  81. package/dist/apis/organization.js +1 -1
  82. package/dist/apis/partner-directory.cjs +6 -6
  83. package/dist/apis/partner-directory.js +1 -1
  84. package/dist/apis/permissions.cjs +6 -6
  85. package/dist/apis/permissions.js +1 -1
  86. package/dist/apis/phone-integration.cjs +38 -0
  87. package/dist/apis/phone-integration.d.cts +18 -0
  88. package/dist/apis/phone-integration.d.ts +18 -0
  89. package/dist/apis/phone-integration.js +38 -0
  90. package/dist/apis/pricing-tier.cjs +6 -6
  91. package/dist/apis/pricing-tier.js +1 -1
  92. package/dist/apis/pricing.cjs +6 -6
  93. package/dist/apis/pricing.js +1 -1
  94. package/dist/apis/purpose.cjs +6 -6
  95. package/dist/apis/purpose.js +1 -1
  96. package/dist/apis/query.cjs +6 -6
  97. package/dist/apis/query.js +1 -1
  98. package/dist/apis/sandbox.cjs +6 -6
  99. package/dist/apis/sandbox.js +1 -1
  100. package/dist/apis/sharing.cjs +6 -6
  101. package/dist/apis/sharing.js +1 -1
  102. package/dist/apis/snapshot.cjs +6 -6
  103. package/dist/apis/snapshot.js +1 -1
  104. package/dist/apis/submission.cjs +6 -6
  105. package/dist/apis/submission.js +1 -1
  106. package/dist/apis/target.cjs +6 -6
  107. package/dist/apis/target.js +1 -1
  108. package/dist/apis/targeting.cjs +6 -6
  109. package/dist/apis/targeting.js +1 -1
  110. package/dist/apis/template-variables.cjs +6 -6
  111. package/dist/apis/template-variables.js +1 -1
  112. package/dist/apis/user.cjs +6 -6
  113. package/dist/apis/user.js +1 -1
  114. package/dist/apis/validation-rules.cjs +6 -6
  115. package/dist/apis/validation-rules.js +1 -1
  116. package/dist/apis/webhooks.cjs +6 -6
  117. package/dist/apis/webhooks.js +1 -1
  118. package/dist/apis/workflow-definition.cjs +6 -6
  119. package/dist/apis/workflow-definition.js +1 -1
  120. package/dist/apis/workflow.cjs +6 -6
  121. package/dist/apis/workflow.js +1 -1
  122. package/dist/{chunk-KHUBKRKC.js → chunk-A73AZOKT.js} +4 -2
  123. package/dist/chunk-BY76NFAX.cjs +14 -0
  124. package/dist/{chunk-DPQXCUG4.cjs → chunk-GMONLMVN.cjs} +4 -2
  125. package/dist/chunk-UFMZ4EV3.js +14 -0
  126. package/dist/index.cjs +20 -12
  127. package/dist/index.d.cts +32 -30
  128. package/dist/index.d.ts +32 -30
  129. package/dist/index.js +14 -6
  130. package/dist/phone-integration-JT2UAOGS.cjs +7 -0
  131. package/dist/phone-integration-KORLYUBG.js +7 -0
  132. package/dist/phone-integration-runtime-27B4SHA5.js +5 -0
  133. package/dist/phone-integration-runtime-DFA6NYNK.cjs +5 -0
  134. package/dist/phone-integration.d-ChHA2oGI.d.cts +179 -0
  135. package/dist/phone-integration.d-ChHA2oGI.d.ts +179 -0
  136. package/docs/phone-integration.md +148 -0
  137. package/package.json +10 -1
  138. package/dist/README-B6X6BXAW.cjs +0 -7
  139. package/dist/README-LE2VBY2Y.js +0 -7
@@ -0,0 +1,179 @@
1
+ import { OpenAPIClient, Parameters, AxiosRequestConfig, OperationResponse } from 'openapi-client-axios';
2
+
3
+ /* Auto-copied from phone-integration-client */
4
+
5
+
6
+ declare namespace Components {
7
+ namespace Schemas {
8
+ export interface CustomerBatchSearchResult {
9
+ /**
10
+ * One result per distinct identifier
11
+ */
12
+ results: CustomerSearchResult[];
13
+ }
14
+ export interface CustomerIdentifier {
15
+ type: "id" | "customer_number" | "external_id" | "phone_number" | "email";
16
+ /**
17
+ * The identifier as sent
18
+ * example:
19
+ * +4917012345678
20
+ */
21
+ value: string;
22
+ }
23
+ export interface CustomerSearchResult {
24
+ identifier: CustomerIdentifier;
25
+ /**
26
+ * - `found` — exactly one contact has the identifier; see `customer`
27
+ * - `not_found` — no contact the caller may see has it
28
+ * - `ambiguous` — several contacts share it; none is chosen
29
+ * - `invalid` — not a usable identifier (a phone number that does
30
+ * not parse), so nothing was searched
31
+ * - `error` — the search for this identifier failed; try again
32
+ *
33
+ */
34
+ status: "found" | "not_found" | "ambiguous" | "invalid" | "error";
35
+ customer?: /* Present when `status` is `found` */ CustomerSummary;
36
+ }
37
+ /**
38
+ * Present when `status` is `found`
39
+ */
40
+ export interface CustomerSummary {
41
+ /**
42
+ * epilot entity id of the customer (Contact)
43
+ * example:
44
+ * dba8e5f9-8b3f-4608-b887-cd0798fce624
45
+ */
46
+ id: string;
47
+ /**
48
+ * The contact's title, else its first and last name; null when it has neither
49
+ * example:
50
+ * Max Mustermann
51
+ */
52
+ name: string | null;
53
+ /**
54
+ * Omitted when the contact has none
55
+ * example:
56
+ * 4711
57
+ */
58
+ customer_number?: string;
59
+ }
60
+ export interface ErrorResponse {
61
+ /**
62
+ * HTTP status code.
63
+ */
64
+ status: number;
65
+ /**
66
+ * Human-readable error message.
67
+ */
68
+ error: string;
69
+ /**
70
+ * Stable machine-readable error code, when the operation defines one.
71
+ */
72
+ code?: string;
73
+ }
74
+ }
75
+ }
76
+ declare namespace Paths {
77
+ namespace BatchSearchCustomers {
78
+ export interface HeaderParameters {
79
+ "x-trace-id"?: Parameters.XTraceId;
80
+ }
81
+ namespace Parameters {
82
+ export type CustomerNumber = string[];
83
+ export type Email = string[];
84
+ export type ExternalId = string[];
85
+ export type Id = string[];
86
+ export type PhoneNumber = string[];
87
+ export type XTraceId = string;
88
+ }
89
+ export interface QueryParameters {
90
+ id?: Parameters.Id;
91
+ customer_number?: Parameters.CustomerNumber;
92
+ external_id?: Parameters.ExternalId;
93
+ phone_number?: Parameters.PhoneNumber;
94
+ email?: Parameters.Email;
95
+ }
96
+ namespace Responses {
97
+ export type $200 = Components.Schemas.CustomerBatchSearchResult;
98
+ export type $400 = Components.Schemas.ErrorResponse;
99
+ export type $401 = Components.Schemas.ErrorResponse;
100
+ export type $403 = Components.Schemas.ErrorResponse;
101
+ }
102
+ }
103
+ }
104
+
105
+
106
+ interface OperationMethods {
107
+ /**
108
+ * batchSearchCustomers - batchSearchCustomers
109
+ *
110
+ * Resolves up to 50 identifiers to epilot customers (Contacts) in one
111
+ * request — for example every number in an agent's call history.
112
+ *
113
+ * Each identifier is an exact key of a Contact: its entity `id`, its
114
+ * `customer_number`, its `external_id`, one of its `email` addresses or
115
+ * one of its `phone` numbers. Repeat a parameter to pass several values,
116
+ * and combine parameters freely. Phone numbers are normalized on the
117
+ * server, so E.164, national and formatted forms of one number match the
118
+ * same contact; the other identifiers match exactly, ignoring case and
119
+ * surrounding whitespace.
120
+ *
121
+ * Every distinct identifier gets its own result, so one unknown or
122
+ * ambiguous identifier never fails the others. Results are ordered by
123
+ * parameter (`id`, `customer_number`, `external_id`, `phone_number`,
124
+ * `email`), then as sent; match them by `identifier`.
125
+ *
126
+ * The search runs with the caller's token: the organization and the
127
+ * permissions applied are the caller's own, as for entity search.
128
+ *
129
+ */
130
+ 'batchSearchCustomers'(
131
+ parameters?: Parameters<Paths.BatchSearchCustomers.QueryParameters & Paths.BatchSearchCustomers.HeaderParameters> | null,
132
+ data?: any,
133
+ config?: AxiosRequestConfig
134
+ ): OperationResponse<Paths.BatchSearchCustomers.Responses.$200>
135
+ }
136
+
137
+ interface PathsDictionary {
138
+ ['/v1/customer:batchSearch']: {
139
+ /**
140
+ * batchSearchCustomers - batchSearchCustomers
141
+ *
142
+ * Resolves up to 50 identifiers to epilot customers (Contacts) in one
143
+ * request — for example every number in an agent's call history.
144
+ *
145
+ * Each identifier is an exact key of a Contact: its entity `id`, its
146
+ * `customer_number`, its `external_id`, one of its `email` addresses or
147
+ * one of its `phone` numbers. Repeat a parameter to pass several values,
148
+ * and combine parameters freely. Phone numbers are normalized on the
149
+ * server, so E.164, national and formatted forms of one number match the
150
+ * same contact; the other identifiers match exactly, ignoring case and
151
+ * surrounding whitespace.
152
+ *
153
+ * Every distinct identifier gets its own result, so one unknown or
154
+ * ambiguous identifier never fails the others. Results are ordered by
155
+ * parameter (`id`, `customer_number`, `external_id`, `phone_number`,
156
+ * `email`), then as sent; match them by `identifier`.
157
+ *
158
+ * The search runs with the caller's token: the organization and the
159
+ * permissions applied are the caller's own, as for entity search.
160
+ *
161
+ */
162
+ 'get'(
163
+ parameters?: Parameters<Paths.BatchSearchCustomers.QueryParameters & Paths.BatchSearchCustomers.HeaderParameters> | null,
164
+ data?: any,
165
+ config?: AxiosRequestConfig
166
+ ): OperationResponse<Paths.BatchSearchCustomers.Responses.$200>
167
+ }
168
+ }
169
+
170
+ type Client = OpenAPIClient<OperationMethods, PathsDictionary>
171
+
172
+
173
+ type CustomerBatchSearchResult = Components.Schemas.CustomerBatchSearchResult;
174
+ type CustomerIdentifier = Components.Schemas.CustomerIdentifier;
175
+ type CustomerSearchResult = Components.Schemas.CustomerSearchResult;
176
+ type CustomerSummary = Components.Schemas.CustomerSummary;
177
+ type ErrorResponse = Components.Schemas.ErrorResponse;
178
+
179
+ export { type Client as C, type ErrorResponse as E, type OperationMethods as O, Paths as P, Components as a, type PathsDictionary as b, type CustomerBatchSearchResult as c, type CustomerIdentifier as d, type CustomerSearchResult as e, type CustomerSummary as f };
@@ -0,0 +1,179 @@
1
+ import { OpenAPIClient, Parameters, AxiosRequestConfig, OperationResponse } from 'openapi-client-axios';
2
+
3
+ /* Auto-copied from phone-integration-client */
4
+
5
+
6
+ declare namespace Components {
7
+ namespace Schemas {
8
+ export interface CustomerBatchSearchResult {
9
+ /**
10
+ * One result per distinct identifier
11
+ */
12
+ results: CustomerSearchResult[];
13
+ }
14
+ export interface CustomerIdentifier {
15
+ type: "id" | "customer_number" | "external_id" | "phone_number" | "email";
16
+ /**
17
+ * The identifier as sent
18
+ * example:
19
+ * +4917012345678
20
+ */
21
+ value: string;
22
+ }
23
+ export interface CustomerSearchResult {
24
+ identifier: CustomerIdentifier;
25
+ /**
26
+ * - `found` — exactly one contact has the identifier; see `customer`
27
+ * - `not_found` — no contact the caller may see has it
28
+ * - `ambiguous` — several contacts share it; none is chosen
29
+ * - `invalid` — not a usable identifier (a phone number that does
30
+ * not parse), so nothing was searched
31
+ * - `error` — the search for this identifier failed; try again
32
+ *
33
+ */
34
+ status: "found" | "not_found" | "ambiguous" | "invalid" | "error";
35
+ customer?: /* Present when `status` is `found` */ CustomerSummary;
36
+ }
37
+ /**
38
+ * Present when `status` is `found`
39
+ */
40
+ export interface CustomerSummary {
41
+ /**
42
+ * epilot entity id of the customer (Contact)
43
+ * example:
44
+ * dba8e5f9-8b3f-4608-b887-cd0798fce624
45
+ */
46
+ id: string;
47
+ /**
48
+ * The contact's title, else its first and last name; null when it has neither
49
+ * example:
50
+ * Max Mustermann
51
+ */
52
+ name: string | null;
53
+ /**
54
+ * Omitted when the contact has none
55
+ * example:
56
+ * 4711
57
+ */
58
+ customer_number?: string;
59
+ }
60
+ export interface ErrorResponse {
61
+ /**
62
+ * HTTP status code.
63
+ */
64
+ status: number;
65
+ /**
66
+ * Human-readable error message.
67
+ */
68
+ error: string;
69
+ /**
70
+ * Stable machine-readable error code, when the operation defines one.
71
+ */
72
+ code?: string;
73
+ }
74
+ }
75
+ }
76
+ declare namespace Paths {
77
+ namespace BatchSearchCustomers {
78
+ export interface HeaderParameters {
79
+ "x-trace-id"?: Parameters.XTraceId;
80
+ }
81
+ namespace Parameters {
82
+ export type CustomerNumber = string[];
83
+ export type Email = string[];
84
+ export type ExternalId = string[];
85
+ export type Id = string[];
86
+ export type PhoneNumber = string[];
87
+ export type XTraceId = string;
88
+ }
89
+ export interface QueryParameters {
90
+ id?: Parameters.Id;
91
+ customer_number?: Parameters.CustomerNumber;
92
+ external_id?: Parameters.ExternalId;
93
+ phone_number?: Parameters.PhoneNumber;
94
+ email?: Parameters.Email;
95
+ }
96
+ namespace Responses {
97
+ export type $200 = Components.Schemas.CustomerBatchSearchResult;
98
+ export type $400 = Components.Schemas.ErrorResponse;
99
+ export type $401 = Components.Schemas.ErrorResponse;
100
+ export type $403 = Components.Schemas.ErrorResponse;
101
+ }
102
+ }
103
+ }
104
+
105
+
106
+ interface OperationMethods {
107
+ /**
108
+ * batchSearchCustomers - batchSearchCustomers
109
+ *
110
+ * Resolves up to 50 identifiers to epilot customers (Contacts) in one
111
+ * request — for example every number in an agent's call history.
112
+ *
113
+ * Each identifier is an exact key of a Contact: its entity `id`, its
114
+ * `customer_number`, its `external_id`, one of its `email` addresses or
115
+ * one of its `phone` numbers. Repeat a parameter to pass several values,
116
+ * and combine parameters freely. Phone numbers are normalized on the
117
+ * server, so E.164, national and formatted forms of one number match the
118
+ * same contact; the other identifiers match exactly, ignoring case and
119
+ * surrounding whitespace.
120
+ *
121
+ * Every distinct identifier gets its own result, so one unknown or
122
+ * ambiguous identifier never fails the others. Results are ordered by
123
+ * parameter (`id`, `customer_number`, `external_id`, `phone_number`,
124
+ * `email`), then as sent; match them by `identifier`.
125
+ *
126
+ * The search runs with the caller's token: the organization and the
127
+ * permissions applied are the caller's own, as for entity search.
128
+ *
129
+ */
130
+ 'batchSearchCustomers'(
131
+ parameters?: Parameters<Paths.BatchSearchCustomers.QueryParameters & Paths.BatchSearchCustomers.HeaderParameters> | null,
132
+ data?: any,
133
+ config?: AxiosRequestConfig
134
+ ): OperationResponse<Paths.BatchSearchCustomers.Responses.$200>
135
+ }
136
+
137
+ interface PathsDictionary {
138
+ ['/v1/customer:batchSearch']: {
139
+ /**
140
+ * batchSearchCustomers - batchSearchCustomers
141
+ *
142
+ * Resolves up to 50 identifiers to epilot customers (Contacts) in one
143
+ * request — for example every number in an agent's call history.
144
+ *
145
+ * Each identifier is an exact key of a Contact: its entity `id`, its
146
+ * `customer_number`, its `external_id`, one of its `email` addresses or
147
+ * one of its `phone` numbers. Repeat a parameter to pass several values,
148
+ * and combine parameters freely. Phone numbers are normalized on the
149
+ * server, so E.164, national and formatted forms of one number match the
150
+ * same contact; the other identifiers match exactly, ignoring case and
151
+ * surrounding whitespace.
152
+ *
153
+ * Every distinct identifier gets its own result, so one unknown or
154
+ * ambiguous identifier never fails the others. Results are ordered by
155
+ * parameter (`id`, `customer_number`, `external_id`, `phone_number`,
156
+ * `email`), then as sent; match them by `identifier`.
157
+ *
158
+ * The search runs with the caller's token: the organization and the
159
+ * permissions applied are the caller's own, as for entity search.
160
+ *
161
+ */
162
+ 'get'(
163
+ parameters?: Parameters<Paths.BatchSearchCustomers.QueryParameters & Paths.BatchSearchCustomers.HeaderParameters> | null,
164
+ data?: any,
165
+ config?: AxiosRequestConfig
166
+ ): OperationResponse<Paths.BatchSearchCustomers.Responses.$200>
167
+ }
168
+ }
169
+
170
+ type Client = OpenAPIClient<OperationMethods, PathsDictionary>
171
+
172
+
173
+ type CustomerBatchSearchResult = Components.Schemas.CustomerBatchSearchResult;
174
+ type CustomerIdentifier = Components.Schemas.CustomerIdentifier;
175
+ type CustomerSearchResult = Components.Schemas.CustomerSearchResult;
176
+ type CustomerSummary = Components.Schemas.CustomerSummary;
177
+ type ErrorResponse = Components.Schemas.ErrorResponse;
178
+
179
+ export { type Client as C, type ErrorResponse as E, type OperationMethods as O, Paths as P, Components as a, type PathsDictionary as b, type CustomerBatchSearchResult as c, type CustomerIdentifier as d, type CustomerSearchResult as e, type CustomerSummary as f };
@@ -0,0 +1,148 @@
1
+ # Phone Integration API
2
+
3
+ - **Base URL:** `https://phone-integration-api.sls.epilot.io`
4
+ - **Full API Docs:** [https://docs.epilot.io/api/phone-integration](https://docs.epilot.io/api/phone-integration)
5
+
6
+ ## Usage
7
+
8
+ ```ts
9
+ import { epilot } from '@epilot/sdk'
10
+
11
+ epilot.authorize(() => '<token>')
12
+ const { data } = await epilot.phoneIntegration.batchSearchCustomers(...)
13
+ ```
14
+
15
+ ### Tree-shakeable import
16
+
17
+ ```ts
18
+ import { getClient, authorize } from '@epilot/sdk/phone-integration'
19
+
20
+ const phoneIntegrationClient = getClient()
21
+ authorize(phoneIntegrationClient, () => '<token>')
22
+ const { data } = await phoneIntegrationClient.batchSearchCustomers(...)
23
+ ```
24
+
25
+ ## Operations
26
+
27
+ **phone-integration**
28
+ - [`batchSearchCustomers`](#batchsearchcustomers)
29
+
30
+ **Schemas**
31
+ - [`CustomerBatchSearchResult`](#customerbatchsearchresult)
32
+ - [`CustomerSearchResult`](#customersearchresult)
33
+ - [`CustomerIdentifier`](#customeridentifier)
34
+ - [`CustomerSummary`](#customersummary)
35
+ - [`ErrorResponse`](#errorresponse)
36
+
37
+ ### `batchSearchCustomers`
38
+
39
+ Resolves up to 50 identifiers to epilot customers (Contacts) in one
40
+ request — for example every number in an agent's call history.
41
+
42
+ `GET /v1/customer:batchSearch`
43
+
44
+ ```ts
45
+ const { data } = await client.batchSearchCustomers({
46
+ id: ['...'],
47
+ customer_number: ['...'],
48
+ external_id: ['...'],
49
+ phone_number: ['...'],
50
+ email: ['...'],
51
+ x-trace-id: 'example',
52
+ })
53
+ ```
54
+
55
+ <details>
56
+ <summary>Response</summary>
57
+
58
+ ```json
59
+ {
60
+ "results": [
61
+ {
62
+ "identifier": {
63
+ "type": "id",
64
+ "value": "+4917012345678"
65
+ },
66
+ "status": "found",
67
+ "customer": {
68
+ "id": "dba8e5f9-8b3f-4608-b887-cd0798fce624",
69
+ "name": "Max Mustermann",
70
+ "customer_number": "4711"
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ ```
76
+
77
+ </details>
78
+
79
+ ---
80
+
81
+ ## Schemas
82
+
83
+ ### `CustomerBatchSearchResult`
84
+
85
+ ```ts
86
+ type CustomerBatchSearchResult = {
87
+ results: Array<{
88
+ identifier: {
89
+ type: { ... }
90
+ value: { ... }
91
+ }
92
+ status: "found" | "not_found" | "ambiguous" | "invalid" | "error"
93
+ customer?: {
94
+ id: { ... }
95
+ name: { ... }
96
+ customer_number?: { ... }
97
+ }
98
+ }>
99
+ }
100
+ ```
101
+
102
+ ### `CustomerSearchResult`
103
+
104
+ ```ts
105
+ type CustomerSearchResult = {
106
+ identifier: {
107
+ type: "id" | "customer_number" | "external_id" | "phone_number" | "email"
108
+ value: string
109
+ }
110
+ status: "found" | "not_found" | "ambiguous" | "invalid" | "error"
111
+ customer?: {
112
+ id: string
113
+ name: string
114
+ customer_number?: string
115
+ }
116
+ }
117
+ ```
118
+
119
+ ### `CustomerIdentifier`
120
+
121
+ ```ts
122
+ type CustomerIdentifier = {
123
+ type: "id" | "customer_number" | "external_id" | "phone_number" | "email"
124
+ value: string
125
+ }
126
+ ```
127
+
128
+ ### `CustomerSummary`
129
+
130
+ Present when `status` is `found`
131
+
132
+ ```ts
133
+ type CustomerSummary = {
134
+ id: string
135
+ name: string
136
+ customer_number?: string
137
+ }
138
+ ```
139
+
140
+ ### `ErrorResponse`
141
+
142
+ ```ts
143
+ type ErrorResponse = {
144
+ status: number
145
+ error: string
146
+ code?: string
147
+ }
148
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/sdk",
3
- "version": "2.20.55",
3
+ "version": "2.20.56",
4
4
  "description": "JavaScript/TypeScript SDK for epilot APIs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -249,6 +249,12 @@
249
249
  "require": "./dist/apis/permissions.cjs"
250
250
  },
251
251
  "./permissions/openapi.json": "./definitions/permissions.json",
252
+ "./phone-integration": {
253
+ "types": "./dist/apis/phone-integration.d.ts",
254
+ "import": "./dist/apis/phone-integration.js",
255
+ "require": "./dist/apis/phone-integration.cjs"
256
+ },
257
+ "./phone-integration/openapi.json": "./definitions/phone-integration.json",
252
258
  "./pricing": {
253
259
  "types": "./dist/apis/pricing.d.ts",
254
260
  "import": "./dist/apis/pricing.js",
@@ -496,6 +502,9 @@
496
502
  "permissions": [
497
503
  "./dist/apis/permissions.d.ts"
498
504
  ],
505
+ "phone-integration": [
506
+ "./dist/apis/phone-integration.d.ts"
507
+ ],
499
508
  "pricing": [
500
509
  "./dist/apis/pricing.d.ts"
501
510
  ],
@@ -1,7 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
2
-
3
- // src/docs/README.json
4
- var README_default = "<h1 align=\"center\"><img alt=\"epilot\" src=\"https://raw.githubusercontent.com/epilot-dev/sdk-js/main/logo.png\" width=\"200\"><br>@epilot/sdk</h1>\n\n<p align=\"center\">\n <a href=\"https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI\"><img src=\"https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg\" alt=\"CI\"></a>\n <a href=\"https://www.npmjs.com/package/@epilot/sdk\"><img src=\"https://img.shields.io/npm/v/@epilot/sdk.svg\" alt=\"npm version\"></a>\n <a href=\"https://github.com/epilot-dev/sdk-js/blob/main/\"><img src=\"http://img.shields.io/:license-mit-blue.svg\" alt=\"License\"></a>\n</p>\n\n<p align=\"center\">JavaScript/TypeScript SDK for epilot APIs. Full types, tree-shakeable imports, and lazy-loaded OpenAPI specs.</p>\n\n## Install\n\n```bash\nnpm i @epilot/sdk axios openapi-client-axios\n```\n\n## Quick Start\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-bearer-token>')\n\nconst { data: entity } = await epilot.entity.createEntity(\n { slug: 'contact' },\n { first_name: 'John', last_name: 'Doe' },\n)\n\nconst { data: file } = await epilot.file.getFile({ id: 'file-123' })\n\nconst { data: executions } = await epilot.workflow.getExecutions()\n```\n\nAPI clients are built on [openapi-client-axios](https://openapistack.co/docs/openapi-client-axios/intro/), which generates fully typed operation methods on top of regular [axios](https://axios-http.com/docs/intro) instances. All standard axios features (interceptors, defaults, config) work as expected. Each operation is forwarded to a lazy singleton \u2014 the spec is loaded and the client initialized on first use, then cached.\n\nFull API documentation: [https://docs.epilot.io/api](https://docs.epilot.io/api)\n\n## API Reference\n\n<!-- api-reference-table -->\n| API | Import | Docs |\n| --- | ------ | ---- |\n| `epilot.accessToken` | `@epilot/sdk/access-token` | [docs](./docs/access-token.md) |\n| `epilot.address` | `@epilot/sdk/address` | [docs](./docs/address.md) |\n| `epilot.addressSuggestions` | `@epilot/sdk/address-suggestions` | [docs](./docs/address-suggestions.md) |\n| `epilot.aiAgents` | `@epilot/sdk/ai-agents` | [docs](./docs/ai-agents.md) |\n| `epilot.app` | `@epilot/sdk/app` | [docs](./docs/app.md) |\n| `epilot.auditLogs` | `@epilot/sdk/audit-logs` | [docs](./docs/audit-logs.md) |\n| `epilot.automation` | `@epilot/sdk/automation` | [docs](./docs/automation.md) |\n| `epilot.billing` | `@epilot/sdk/billing` | [docs](./docs/billing.md) |\n| `epilot.blueprintManifest` | `@epilot/sdk/blueprint-manifest` | [docs](./docs/blueprint-manifest.md) |\n| `epilot.calendar` | `@epilot/sdk/calendar` | [docs](./docs/calendar.md) |\n| `epilot.chat` | `@epilot/sdk/chat` | [docs](./docs/chat.md) |\n| `epilot.configurationHub` | `@epilot/sdk/configuration-hub` | [docs](./docs/configuration-hub.md) |\n| `epilot.consent` | `@epilot/sdk/consent` | [docs](./docs/consent.md) |\n| `epilot.customerPortal` | `@epilot/sdk/customer-portal` | [docs](./docs/customer-portal.md) |\n| `epilot.dashboard` | `@epilot/sdk/dashboard` | [docs](./docs/dashboard.md) |\n| `epilot.dataGovernance` | `@epilot/sdk/data-governance` | [docs](./docs/data-governance.md) |\n| `epilot.deduplication` | `@epilot/sdk/deduplication` | [docs](./docs/deduplication.md) |\n| `epilot.design` | `@epilot/sdk/design` | [docs](./docs/design.md) |\n| `epilot.document` | `@epilot/sdk/document` | [docs](./docs/document.md) |\n| `epilot.emailSettings` | `@epilot/sdk/email-settings` | [docs](./docs/email-settings.md) |\n| `epilot.emailTemplate` | `@epilot/sdk/email-template` | [docs](./docs/email-template.md) |\n| `epilot.entity` | `@epilot/sdk/entity` | [docs](./docs/entity.md) |\n| `epilot.entityMapping` | `@epilot/sdk/entity-mapping` | [docs](./docs/entity-mapping.md) |\n| `epilot.environments` | `@epilot/sdk/environments` | [docs](./docs/environments.md) |\n| `epilot.eventCatalog` | `@epilot/sdk/event-catalog` | [docs](./docs/event-catalog.md) |\n| `epilot.externalValues` | `@epilot/sdk/external-values` | [docs](./docs/external-values.md) |\n| `epilot.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |\n| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.md) |\n| `epilot.identity` | `@epilot/sdk/identity` | [docs](./docs/identity.md) |\n| `epilot.integrationToolkit` | `@epilot/sdk/integration-toolkit` | [docs](./docs/integration-toolkit.md) |\n| `epilot.journey` | `@epilot/sdk/journey` | [docs](./docs/journey.md) |\n| `epilot.kanban` | `@epilot/sdk/kanban` | [docs](./docs/kanban.md) |\n| `epilot.message` | `@epilot/sdk/message` | [docs](./docs/message.md) |\n| `epilot.metering` | `@epilot/sdk/metering` | [docs](./docs/metering.md) |\n| `epilot.notes` | `@epilot/sdk/notes` | [docs](./docs/notes.md) |\n| `epilot.notification` | `@epilot/sdk/notification` | [docs](./docs/notification.md) |\n| `epilot.organization` | `@epilot/sdk/organization` | [docs](./docs/organization.md) |\n| `epilot.partnerDirectory` | `@epilot/sdk/partner-directory` | [docs](./docs/partner-directory.md) |\n| `epilot.permissions` | `@epilot/sdk/permissions` | [docs](./docs/permissions.md) |\n| `epilot.pricing` | `@epilot/sdk/pricing` | [docs](./docs/pricing.md) |\n| `epilot.pricingTier` | `@epilot/sdk/pricing-tier` | [docs](./docs/pricing-tier.md) |\n| `epilot.purpose` | `@epilot/sdk/purpose` | [docs](./docs/purpose.md) |\n| `epilot.query` | `@epilot/sdk/query` | [docs](./docs/query.md) |\n| `epilot.sandbox` | `@epilot/sdk/sandbox` | [docs](./docs/sandbox.md) |\n| `epilot.sharing` | `@epilot/sdk/sharing` | [docs](./docs/sharing.md) |\n| `epilot.snapshot` | `@epilot/sdk/snapshot` | [docs](./docs/snapshot.md) |\n| `epilot.submission` | `@epilot/sdk/submission` | [docs](./docs/submission.md) |\n| `epilot.targeting` | `@epilot/sdk/targeting` | [docs](./docs/targeting.md) |\n| `epilot.templateVariables` | `@epilot/sdk/template-variables` | [docs](./docs/template-variables.md) |\n| `epilot.user` | `@epilot/sdk/user` | [docs](./docs/user.md) |\n| `epilot.validationRules` | `@epilot/sdk/validation-rules` | [docs](./docs/validation-rules.md) |\n| `epilot.webhooks` | `@epilot/sdk/webhooks` | [docs](./docs/webhooks.md) |\n| `epilot.workflow` | `@epilot/sdk/workflow` | [docs](./docs/workflow.md) |\n| `epilot.workflowDefinition` | `@epilot/sdk/workflow-definition` | [docs](./docs/workflow-definition.md) |\n<!-- /api-reference-table -->\n\n## OpenAPI Spec\n\nRetrieve the full OpenAPI specification for any API at runtime. The spec is lazy-loaded on first call and cached.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Via API handle\nconst entitySpec = await epilot.entity.openapi()\nconsole.log(entitySpec.info.title) // \"Entity API\"\nconsole.log(entitySpec.paths) // all paths with full schemas\n\n// Via top-level method\nconst spec = await epilot.openapi('entity')\n```\n\nFor tree-shakeable imports:\n\n```ts\nimport { openapi } from '@epilot/sdk/entity'\n\nconst spec = await openapi()\n```\n\n## Explicit Client Access\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\n\n// Get the cached singleton client\nconst entityClient = epilot.entity.getClient()\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Create a fresh (non-singleton) client instance\nconst freshClient = epilot.entity.createClient()\nauthorize(freshClient, () => '<my-token>')\n```\n\n## Tree-Shakeable Imports\n\nImport only what you need. Other APIs never touch your bundle.\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Or use the handle for direct operation forwarding\nimport { entity } from '@epilot/sdk/entity'\nconst { data } = await entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n## Types\n\nEach API subpath re-exports all schema types generated from the OpenAPI spec. Import them directly:\n\n```ts\nimport type { Entity, EntitySchema, RelationAttribute } from '@epilot/sdk/entity'\nimport type { FileItem } from '@epilot/sdk/file'\nimport type { AutomationFlow } from '@epilot/sdk/automation'\n```\n\nThe `Client`, `OperationMethods`, and `PathsDictionary` types are also available for typing client instances:\n\n```ts\nimport type { Client } from '@epilot/sdk/entity'\n\nconst entityClient: Client = epilot.entity.getClient()\n```\n\n## Headers\n\n### Global Headers\n\nSet default headers applied to all clients. Useful for `x-epilot-org-id`, `x-epilot-user-id`, etc.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.headers({\n 'x-epilot-org-id': 'org-123',\n 'x-epilot-user-id': 'user-456',\n})\n\nconst { data } = await epilot.entity.searchEntities(...)\n```\n\n### Standard Axios Headers\n\nUse standard axios `defaults.headers.common` on individual clients:\n\n```ts\nconst entityClient = epilot.entity.getClient()\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Auth Patterns\n\n`authorize()` accepts a string or a function. The function form is preferred \u2014 it is called on every request, so tokens stay fresh.\n\n```ts\nimport { authorize } from '@epilot/sdk'\nimport { getClient } from '@epilot/sdk/entity'\n\n// Per-client \u2014 function predicate (recommended)\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\n// Per-client \u2014 async function (e.g. OAuth / session)\nauthorize(entityClient, async () => {\n return await getTokenFromSession()\n})\n\n// Per-client \u2014 static string (sets default header once)\nauthorize(entityClient, 'my-static-api-token')\n```\n\n```ts\n// Global \u2014 applies to all clients resolved from the SDK\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.authorize(async () => await getTokenFromSession())\nepilot.authorize('my-static-api-token')\n```\n\n## Fresh Client Instance\n\n```ts\nimport { createClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = createClient()\nauthorize(entityClient, () => '<my-token>')\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Multiple SDK Instances\n\n```ts\nimport { createSDK } from '@epilot/sdk'\n\nconst sdk1 = createSDK()\nsdk1.authorize(() => '<token-for-org-1>')\nsdk1.headers({ 'x-epilot-org-id': 'org-1' })\n\nconst sdk2 = createSDK()\nsdk2.authorize(() => '<token-for-org-2>')\nsdk2.headers({ 'x-epilot-org-id': 'org-2' })\n```\n\n\n## Interceptors\n\nUse axios interceptors for custom request/response processing. Since clients are axios instances, you can use `client.interceptors` directly:\n\n```ts\nentityClient.interceptors.response.use((response) => {\n console.debug(`${response.config.method?.toUpperCase()} ${response.config.url}`, {\n status: response.status,\n data: response.data,\n })\n return response\n})\n```\n\nOr register global interceptors applied to all clients:\n\n```ts\nepilot.interceptors.request((config) => {\n config.headers['x-correlation-id'] = generateTraceId()\n return config\n})\n```\n\n## Auto-Retry (429 Too Many Requests)\n\nThe SDK automatically retries requests that receive a `429 Too Many Requests` response. It respects the `Retry-After` header (in seconds) to determine how long to wait before retrying.\n\nEnabled by default with up to 3 retries.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Customize retry behavior\nepilot.retry({ maxRetries: 5, defaultDelayMs: 2000 })\n\n// Disable retries\nepilot.retry({ maxRetries: 0 })\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `maxRetries` | `3` | Maximum number of retries. Set to `0` to disable. |\n| `defaultDelayMs` | `1000` | Fallback delay in ms when `Retry-After` header is missing. |\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyRetryInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyRetryInterceptor({ client: entityClient, config: { maxRetries: 3 } })\n```\n\n## Large Response Handling (413 Payload Too Large)\n\nepilot APIs use a [large response middleware](https://github.com/epilot-dev/aws-lambda-utility-middlewares) to work around the AWS Lambda 6MB response limit. When a response exceeds ~5.1MB, the API uploads the payload to S3 and returns a presigned URL instead.\n\nThe SDK handles this transparently \u2014 it sends the opt-in `Accept` header and automatically fetches the full payload from S3 when a large response URL is returned. Enabled by default.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Disable large response handling\nepilot.largeResponse({ enabled: false })\n```\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyLargeResponseInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyLargeResponseInterceptor({ client: entityClient, config: { enabled: true } })\n```\n\n## Overrides & Custom APIs\n\nOverride built-in API specs or register custom APIs via `.epilot/sdk-overrides.json`. This is useful for testing new versions of an API spec or getting the latest types without waiting for an SDK release.\n\n```json\n{\n \"entity\": \"./specs/entity-openapi.json\",\n \"myNewApi\": \"./specs/my-new-api-openapi.json\"\n}\n```\n\n```ts\n// Built-in API with overridden spec\nconst { data } = await epilot.entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n### Override Commands\n\n```bash\n# Apply all overrides from .epilot/sdk-overrides.json\nnpx epilot-sdk override\n\n# Override a single API\nnpx epilot-sdk override entity ./my-local-entity-spec.yaml\n\n# Regenerate types after spec changes\nnpx epilot-sdk typegen\n```\n\n<details>\n<summary>Migration from <code>@epilot/*-client</code></summary>\n\nDrop-in replacement \u2014 just change the import path:\n\n```ts\n// Before\nimport { getClient, createClient, authorize } from '@epilot/entity-client'\nimport type { Client, Entity } from '@epilot/entity-client'\n\n// After\nimport { getClient, createClient, authorize } from '@epilot/sdk/entity'\nimport type { Client, Entity } from '@epilot/sdk/entity'\n```\n\n</details>\n\n<details>\n<summary>Client Lifecycle</summary>\n\nWhen you call `authorize()`, `headers()`, `retry()`, `largeResponse()`, or `interceptors`, the SDK invalidates all cached client instances. The next operation call creates a fresh client with the updated configuration.\n\n**Operation methods are always up to date** \u2014 calls like `epilot.entity.getEntity(...)` re-resolve the client on every invocation, so they always use the latest config.\n\n**Direct `getClient()` references can go stale** \u2014 if you hold a reference and then change config, your reference still points to the old client:\n\n```ts\nconst entityClient = epilot.entity.getClient()\n\nepilot.authorize('new-token') // invalidates all cached clients\n\n// entityClient still has the old token\n// epilot.entity.getEntity(...) will use a new client with the new token\n```\n\nIf you need a long-lived reference that survives config changes, call `getClient()` again after changing config, or use operation methods directly.\n\n</details>\n";
5
-
6
-
7
- exports.default = README_default;
@@ -1,7 +0,0 @@
1
- import "./chunk-YPSWSI3M.js";
2
-
3
- // src/docs/README.json
4
- var README_default = "<h1 align=\"center\"><img alt=\"epilot\" src=\"https://raw.githubusercontent.com/epilot-dev/sdk-js/main/logo.png\" width=\"200\"><br>@epilot/sdk</h1>\n\n<p align=\"center\">\n <a href=\"https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI\"><img src=\"https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg\" alt=\"CI\"></a>\n <a href=\"https://www.npmjs.com/package/@epilot/sdk\"><img src=\"https://img.shields.io/npm/v/@epilot/sdk.svg\" alt=\"npm version\"></a>\n <a href=\"https://github.com/epilot-dev/sdk-js/blob/main/\"><img src=\"http://img.shields.io/:license-mit-blue.svg\" alt=\"License\"></a>\n</p>\n\n<p align=\"center\">JavaScript/TypeScript SDK for epilot APIs. Full types, tree-shakeable imports, and lazy-loaded OpenAPI specs.</p>\n\n## Install\n\n```bash\nnpm i @epilot/sdk axios openapi-client-axios\n```\n\n## Quick Start\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-bearer-token>')\n\nconst { data: entity } = await epilot.entity.createEntity(\n { slug: 'contact' },\n { first_name: 'John', last_name: 'Doe' },\n)\n\nconst { data: file } = await epilot.file.getFile({ id: 'file-123' })\n\nconst { data: executions } = await epilot.workflow.getExecutions()\n```\n\nAPI clients are built on [openapi-client-axios](https://openapistack.co/docs/openapi-client-axios/intro/), which generates fully typed operation methods on top of regular [axios](https://axios-http.com/docs/intro) instances. All standard axios features (interceptors, defaults, config) work as expected. Each operation is forwarded to a lazy singleton \u2014 the spec is loaded and the client initialized on first use, then cached.\n\nFull API documentation: [https://docs.epilot.io/api](https://docs.epilot.io/api)\n\n## API Reference\n\n<!-- api-reference-table -->\n| API | Import | Docs |\n| --- | ------ | ---- |\n| `epilot.accessToken` | `@epilot/sdk/access-token` | [docs](./docs/access-token.md) |\n| `epilot.address` | `@epilot/sdk/address` | [docs](./docs/address.md) |\n| `epilot.addressSuggestions` | `@epilot/sdk/address-suggestions` | [docs](./docs/address-suggestions.md) |\n| `epilot.aiAgents` | `@epilot/sdk/ai-agents` | [docs](./docs/ai-agents.md) |\n| `epilot.app` | `@epilot/sdk/app` | [docs](./docs/app.md) |\n| `epilot.auditLogs` | `@epilot/sdk/audit-logs` | [docs](./docs/audit-logs.md) |\n| `epilot.automation` | `@epilot/sdk/automation` | [docs](./docs/automation.md) |\n| `epilot.billing` | `@epilot/sdk/billing` | [docs](./docs/billing.md) |\n| `epilot.blueprintManifest` | `@epilot/sdk/blueprint-manifest` | [docs](./docs/blueprint-manifest.md) |\n| `epilot.calendar` | `@epilot/sdk/calendar` | [docs](./docs/calendar.md) |\n| `epilot.chat` | `@epilot/sdk/chat` | [docs](./docs/chat.md) |\n| `epilot.configurationHub` | `@epilot/sdk/configuration-hub` | [docs](./docs/configuration-hub.md) |\n| `epilot.consent` | `@epilot/sdk/consent` | [docs](./docs/consent.md) |\n| `epilot.customerPortal` | `@epilot/sdk/customer-portal` | [docs](./docs/customer-portal.md) |\n| `epilot.dashboard` | `@epilot/sdk/dashboard` | [docs](./docs/dashboard.md) |\n| `epilot.dataGovernance` | `@epilot/sdk/data-governance` | [docs](./docs/data-governance.md) |\n| `epilot.deduplication` | `@epilot/sdk/deduplication` | [docs](./docs/deduplication.md) |\n| `epilot.design` | `@epilot/sdk/design` | [docs](./docs/design.md) |\n| `epilot.document` | `@epilot/sdk/document` | [docs](./docs/document.md) |\n| `epilot.emailSettings` | `@epilot/sdk/email-settings` | [docs](./docs/email-settings.md) |\n| `epilot.emailTemplate` | `@epilot/sdk/email-template` | [docs](./docs/email-template.md) |\n| `epilot.entity` | `@epilot/sdk/entity` | [docs](./docs/entity.md) |\n| `epilot.entityMapping` | `@epilot/sdk/entity-mapping` | [docs](./docs/entity-mapping.md) |\n| `epilot.environments` | `@epilot/sdk/environments` | [docs](./docs/environments.md) |\n| `epilot.eventCatalog` | `@epilot/sdk/event-catalog` | [docs](./docs/event-catalog.md) |\n| `epilot.externalValues` | `@epilot/sdk/external-values` | [docs](./docs/external-values.md) |\n| `epilot.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |\n| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.md) |\n| `epilot.identity` | `@epilot/sdk/identity` | [docs](./docs/identity.md) |\n| `epilot.integrationToolkit` | `@epilot/sdk/integration-toolkit` | [docs](./docs/integration-toolkit.md) |\n| `epilot.journey` | `@epilot/sdk/journey` | [docs](./docs/journey.md) |\n| `epilot.kanban` | `@epilot/sdk/kanban` | [docs](./docs/kanban.md) |\n| `epilot.message` | `@epilot/sdk/message` | [docs](./docs/message.md) |\n| `epilot.metering` | `@epilot/sdk/metering` | [docs](./docs/metering.md) |\n| `epilot.notes` | `@epilot/sdk/notes` | [docs](./docs/notes.md) |\n| `epilot.notification` | `@epilot/sdk/notification` | [docs](./docs/notification.md) |\n| `epilot.organization` | `@epilot/sdk/organization` | [docs](./docs/organization.md) |\n| `epilot.partnerDirectory` | `@epilot/sdk/partner-directory` | [docs](./docs/partner-directory.md) |\n| `epilot.permissions` | `@epilot/sdk/permissions` | [docs](./docs/permissions.md) |\n| `epilot.pricing` | `@epilot/sdk/pricing` | [docs](./docs/pricing.md) |\n| `epilot.pricingTier` | `@epilot/sdk/pricing-tier` | [docs](./docs/pricing-tier.md) |\n| `epilot.purpose` | `@epilot/sdk/purpose` | [docs](./docs/purpose.md) |\n| `epilot.query` | `@epilot/sdk/query` | [docs](./docs/query.md) |\n| `epilot.sandbox` | `@epilot/sdk/sandbox` | [docs](./docs/sandbox.md) |\n| `epilot.sharing` | `@epilot/sdk/sharing` | [docs](./docs/sharing.md) |\n| `epilot.snapshot` | `@epilot/sdk/snapshot` | [docs](./docs/snapshot.md) |\n| `epilot.submission` | `@epilot/sdk/submission` | [docs](./docs/submission.md) |\n| `epilot.targeting` | `@epilot/sdk/targeting` | [docs](./docs/targeting.md) |\n| `epilot.templateVariables` | `@epilot/sdk/template-variables` | [docs](./docs/template-variables.md) |\n| `epilot.user` | `@epilot/sdk/user` | [docs](./docs/user.md) |\n| `epilot.validationRules` | `@epilot/sdk/validation-rules` | [docs](./docs/validation-rules.md) |\n| `epilot.webhooks` | `@epilot/sdk/webhooks` | [docs](./docs/webhooks.md) |\n| `epilot.workflow` | `@epilot/sdk/workflow` | [docs](./docs/workflow.md) |\n| `epilot.workflowDefinition` | `@epilot/sdk/workflow-definition` | [docs](./docs/workflow-definition.md) |\n<!-- /api-reference-table -->\n\n## OpenAPI Spec\n\nRetrieve the full OpenAPI specification for any API at runtime. The spec is lazy-loaded on first call and cached.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Via API handle\nconst entitySpec = await epilot.entity.openapi()\nconsole.log(entitySpec.info.title) // \"Entity API\"\nconsole.log(entitySpec.paths) // all paths with full schemas\n\n// Via top-level method\nconst spec = await epilot.openapi('entity')\n```\n\nFor tree-shakeable imports:\n\n```ts\nimport { openapi } from '@epilot/sdk/entity'\n\nconst spec = await openapi()\n```\n\n## Explicit Client Access\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\n\n// Get the cached singleton client\nconst entityClient = epilot.entity.getClient()\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Create a fresh (non-singleton) client instance\nconst freshClient = epilot.entity.createClient()\nauthorize(freshClient, () => '<my-token>')\n```\n\n## Tree-Shakeable Imports\n\nImport only what you need. Other APIs never touch your bundle.\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Or use the handle for direct operation forwarding\nimport { entity } from '@epilot/sdk/entity'\nconst { data } = await entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n## Types\n\nEach API subpath re-exports all schema types generated from the OpenAPI spec. Import them directly:\n\n```ts\nimport type { Entity, EntitySchema, RelationAttribute } from '@epilot/sdk/entity'\nimport type { FileItem } from '@epilot/sdk/file'\nimport type { AutomationFlow } from '@epilot/sdk/automation'\n```\n\nThe `Client`, `OperationMethods`, and `PathsDictionary` types are also available for typing client instances:\n\n```ts\nimport type { Client } from '@epilot/sdk/entity'\n\nconst entityClient: Client = epilot.entity.getClient()\n```\n\n## Headers\n\n### Global Headers\n\nSet default headers applied to all clients. Useful for `x-epilot-org-id`, `x-epilot-user-id`, etc.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.headers({\n 'x-epilot-org-id': 'org-123',\n 'x-epilot-user-id': 'user-456',\n})\n\nconst { data } = await epilot.entity.searchEntities(...)\n```\n\n### Standard Axios Headers\n\nUse standard axios `defaults.headers.common` on individual clients:\n\n```ts\nconst entityClient = epilot.entity.getClient()\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Auth Patterns\n\n`authorize()` accepts a string or a function. The function form is preferred \u2014 it is called on every request, so tokens stay fresh.\n\n```ts\nimport { authorize } from '@epilot/sdk'\nimport { getClient } from '@epilot/sdk/entity'\n\n// Per-client \u2014 function predicate (recommended)\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\n// Per-client \u2014 async function (e.g. OAuth / session)\nauthorize(entityClient, async () => {\n return await getTokenFromSession()\n})\n\n// Per-client \u2014 static string (sets default header once)\nauthorize(entityClient, 'my-static-api-token')\n```\n\n```ts\n// Global \u2014 applies to all clients resolved from the SDK\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.authorize(async () => await getTokenFromSession())\nepilot.authorize('my-static-api-token')\n```\n\n## Fresh Client Instance\n\n```ts\nimport { createClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = createClient()\nauthorize(entityClient, () => '<my-token>')\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Multiple SDK Instances\n\n```ts\nimport { createSDK } from '@epilot/sdk'\n\nconst sdk1 = createSDK()\nsdk1.authorize(() => '<token-for-org-1>')\nsdk1.headers({ 'x-epilot-org-id': 'org-1' })\n\nconst sdk2 = createSDK()\nsdk2.authorize(() => '<token-for-org-2>')\nsdk2.headers({ 'x-epilot-org-id': 'org-2' })\n```\n\n\n## Interceptors\n\nUse axios interceptors for custom request/response processing. Since clients are axios instances, you can use `client.interceptors` directly:\n\n```ts\nentityClient.interceptors.response.use((response) => {\n console.debug(`${response.config.method?.toUpperCase()} ${response.config.url}`, {\n status: response.status,\n data: response.data,\n })\n return response\n})\n```\n\nOr register global interceptors applied to all clients:\n\n```ts\nepilot.interceptors.request((config) => {\n config.headers['x-correlation-id'] = generateTraceId()\n return config\n})\n```\n\n## Auto-Retry (429 Too Many Requests)\n\nThe SDK automatically retries requests that receive a `429 Too Many Requests` response. It respects the `Retry-After` header (in seconds) to determine how long to wait before retrying.\n\nEnabled by default with up to 3 retries.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Customize retry behavior\nepilot.retry({ maxRetries: 5, defaultDelayMs: 2000 })\n\n// Disable retries\nepilot.retry({ maxRetries: 0 })\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `maxRetries` | `3` | Maximum number of retries. Set to `0` to disable. |\n| `defaultDelayMs` | `1000` | Fallback delay in ms when `Retry-After` header is missing. |\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyRetryInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyRetryInterceptor({ client: entityClient, config: { maxRetries: 3 } })\n```\n\n## Large Response Handling (413 Payload Too Large)\n\nepilot APIs use a [large response middleware](https://github.com/epilot-dev/aws-lambda-utility-middlewares) to work around the AWS Lambda 6MB response limit. When a response exceeds ~5.1MB, the API uploads the payload to S3 and returns a presigned URL instead.\n\nThe SDK handles this transparently \u2014 it sends the opt-in `Accept` header and automatically fetches the full payload from S3 when a large response URL is returned. Enabled by default.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Disable large response handling\nepilot.largeResponse({ enabled: false })\n```\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyLargeResponseInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyLargeResponseInterceptor({ client: entityClient, config: { enabled: true } })\n```\n\n## Overrides & Custom APIs\n\nOverride built-in API specs or register custom APIs via `.epilot/sdk-overrides.json`. This is useful for testing new versions of an API spec or getting the latest types without waiting for an SDK release.\n\n```json\n{\n \"entity\": \"./specs/entity-openapi.json\",\n \"myNewApi\": \"./specs/my-new-api-openapi.json\"\n}\n```\n\n```ts\n// Built-in API with overridden spec\nconst { data } = await epilot.entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n### Override Commands\n\n```bash\n# Apply all overrides from .epilot/sdk-overrides.json\nnpx epilot-sdk override\n\n# Override a single API\nnpx epilot-sdk override entity ./my-local-entity-spec.yaml\n\n# Regenerate types after spec changes\nnpx epilot-sdk typegen\n```\n\n<details>\n<summary>Migration from <code>@epilot/*-client</code></summary>\n\nDrop-in replacement \u2014 just change the import path:\n\n```ts\n// Before\nimport { getClient, createClient, authorize } from '@epilot/entity-client'\nimport type { Client, Entity } from '@epilot/entity-client'\n\n// After\nimport { getClient, createClient, authorize } from '@epilot/sdk/entity'\nimport type { Client, Entity } from '@epilot/sdk/entity'\n```\n\n</details>\n\n<details>\n<summary>Client Lifecycle</summary>\n\nWhen you call `authorize()`, `headers()`, `retry()`, `largeResponse()`, or `interceptors`, the SDK invalidates all cached client instances. The next operation call creates a fresh client with the updated configuration.\n\n**Operation methods are always up to date** \u2014 calls like `epilot.entity.getEntity(...)` re-resolve the client on every invocation, so they always use the latest config.\n\n**Direct `getClient()` references can go stale** \u2014 if you hold a reference and then change config, your reference still points to the old client:\n\n```ts\nconst entityClient = epilot.entity.getClient()\n\nepilot.authorize('new-token') // invalidates all cached clients\n\n// entityClient still has the old token\n// epilot.entity.getEntity(...) will use a new client with the new token\n```\n\nIf you need a long-lived reference that survives config changes, call `getClient()` again after changing config, or use operation methods directly.\n\n</details>\n";
5
- export {
6
- README_default as default
7
- };