@epilot/sdk 2.4.3 → 2.4.4

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 (136) hide show
  1. package/README.md +1 -0
  2. package/definitions/app-runtime.json +1 -1
  3. package/definitions/app.json +346 -10
  4. package/definitions/calendar-runtime.json +1 -0
  5. package/definitions/calendar.json +675 -0
  6. package/definitions/customer-portal.json +29 -0
  7. package/definitions/notes.json +175 -130
  8. package/definitions/pricing.json +5 -1
  9. package/dist/README-46VYEGGW.js +7 -0
  10. package/dist/README-IVBISSWB.cjs +7 -0
  11. package/dist/{_index-HE4B6FOA.js → _index-5FB6F5YY.js} +3 -0
  12. package/dist/{_index-55HAH24D.cjs → _index-DB2VV4PQ.cjs} +4 -1
  13. package/dist/apis/access-token.cjs +6 -6
  14. package/dist/apis/access-token.js +1 -1
  15. package/dist/apis/address-suggestions.cjs +6 -6
  16. package/dist/apis/address-suggestions.js +1 -1
  17. package/dist/apis/address.cjs +6 -6
  18. package/dist/apis/address.js +1 -1
  19. package/dist/apis/ai-agents.cjs +6 -6
  20. package/dist/apis/ai-agents.js +1 -1
  21. package/dist/apis/app.cjs +6 -6
  22. package/dist/apis/app.js +1 -1
  23. package/dist/apis/audit-logs.cjs +6 -6
  24. package/dist/apis/audit-logs.js +1 -1
  25. package/dist/apis/automation.cjs +6 -6
  26. package/dist/apis/automation.js +1 -1
  27. package/dist/apis/billing.cjs +6 -6
  28. package/dist/apis/billing.js +1 -1
  29. package/dist/apis/blueprint-manifest.cjs +6 -6
  30. package/dist/apis/blueprint-manifest.js +1 -1
  31. package/dist/apis/calendar.cjs +38 -0
  32. package/dist/apis/calendar.d.cts +18 -0
  33. package/dist/apis/calendar.d.ts +18 -0
  34. package/dist/apis/calendar.js +38 -0
  35. package/dist/apis/configuration-hub.cjs +6 -6
  36. package/dist/apis/configuration-hub.js +1 -1
  37. package/dist/apis/consent.cjs +6 -6
  38. package/dist/apis/consent.js +1 -1
  39. package/dist/apis/customer-portal.cjs +6 -6
  40. package/dist/apis/customer-portal.js +1 -1
  41. package/dist/apis/dashboard.cjs +6 -6
  42. package/dist/apis/dashboard.js +1 -1
  43. package/dist/apis/data-governance.cjs +6 -6
  44. package/dist/apis/data-governance.js +1 -1
  45. package/dist/apis/deduplication.cjs +6 -6
  46. package/dist/apis/deduplication.js +1 -1
  47. package/dist/apis/design.cjs +6 -6
  48. package/dist/apis/design.js +1 -1
  49. package/dist/apis/document.cjs +6 -6
  50. package/dist/apis/document.js +1 -1
  51. package/dist/apis/email-settings.cjs +6 -6
  52. package/dist/apis/email-settings.js +1 -1
  53. package/dist/apis/email-template.cjs +6 -6
  54. package/dist/apis/email-template.js +1 -1
  55. package/dist/apis/entity-mapping.cjs +6 -6
  56. package/dist/apis/entity-mapping.js +1 -1
  57. package/dist/apis/entity.cjs +6 -6
  58. package/dist/apis/entity.js +1 -1
  59. package/dist/apis/environments.cjs +6 -6
  60. package/dist/apis/environments.js +1 -1
  61. package/dist/apis/event-catalog.cjs +6 -6
  62. package/dist/apis/event-catalog.js +1 -1
  63. package/dist/apis/file.cjs +6 -6
  64. package/dist/apis/file.js +1 -1
  65. package/dist/apis/iban.cjs +6 -6
  66. package/dist/apis/iban.js +1 -1
  67. package/dist/apis/integration-toolkit.cjs +6 -6
  68. package/dist/apis/integration-toolkit.js +1 -1
  69. package/dist/apis/journey.cjs +6 -6
  70. package/dist/apis/journey.js +1 -1
  71. package/dist/apis/kanban.cjs +6 -6
  72. package/dist/apis/kanban.js +1 -1
  73. package/dist/apis/message.cjs +6 -6
  74. package/dist/apis/message.js +1 -1
  75. package/dist/apis/metering.cjs +6 -6
  76. package/dist/apis/metering.js +1 -1
  77. package/dist/apis/notes.cjs +6 -6
  78. package/dist/apis/notes.js +1 -1
  79. package/dist/apis/notification.cjs +6 -6
  80. package/dist/apis/notification.js +1 -1
  81. package/dist/apis/organization.cjs +6 -6
  82. package/dist/apis/organization.js +1 -1
  83. package/dist/apis/partner-directory.cjs +6 -6
  84. package/dist/apis/partner-directory.js +1 -1
  85. package/dist/apis/permissions.cjs +6 -6
  86. package/dist/apis/permissions.js +1 -1
  87. package/dist/apis/pricing-tier.cjs +6 -6
  88. package/dist/apis/pricing-tier.js +1 -1
  89. package/dist/apis/pricing.cjs +6 -6
  90. package/dist/apis/pricing.js +1 -1
  91. package/dist/apis/purpose.cjs +6 -6
  92. package/dist/apis/purpose.js +1 -1
  93. package/dist/apis/query.cjs +6 -6
  94. package/dist/apis/query.js +1 -1
  95. package/dist/apis/sandbox.cjs +6 -6
  96. package/dist/apis/sandbox.js +1 -1
  97. package/dist/apis/sharing.cjs +6 -6
  98. package/dist/apis/sharing.js +1 -1
  99. package/dist/apis/submission.cjs +6 -6
  100. package/dist/apis/submission.js +1 -1
  101. package/dist/apis/target.cjs +6 -6
  102. package/dist/apis/target.js +1 -1
  103. package/dist/apis/targeting.cjs +6 -6
  104. package/dist/apis/targeting.js +1 -1
  105. package/dist/apis/template-variables.cjs +6 -6
  106. package/dist/apis/template-variables.js +1 -1
  107. package/dist/apis/user.cjs +6 -6
  108. package/dist/apis/user.js +1 -1
  109. package/dist/apis/validation-rules.cjs +6 -6
  110. package/dist/apis/validation-rules.js +1 -1
  111. package/dist/apis/webhooks.cjs +6 -6
  112. package/dist/apis/webhooks.js +1 -1
  113. package/dist/apis/workflow-definition.cjs +6 -6
  114. package/dist/apis/workflow-definition.js +1 -1
  115. package/dist/apis/workflow.cjs +6 -6
  116. package/dist/apis/workflow.js +1 -1
  117. package/dist/bin/cli.js +1 -1
  118. package/dist/calendar-2YDAYG7S.cjs +7 -0
  119. package/dist/calendar-ACFIHQ2N.js +7 -0
  120. package/dist/calendar-runtime-6CMMEQMG.js +5 -0
  121. package/dist/calendar-runtime-G4SN5PDY.cjs +5 -0
  122. package/dist/calendar.d-BEjLDagH.d.cts +353 -0
  123. package/dist/calendar.d-BEjLDagH.d.ts +353 -0
  124. package/dist/{chunk-AM5TSEMU.cjs → chunk-CD4OX2U6.cjs} +4 -2
  125. package/dist/chunk-CKLEBO4K.cjs +14 -0
  126. package/dist/chunk-JNH37UUH.js +14 -0
  127. package/dist/{chunk-M25MI6ZX.js → chunk-TSV242UN.js} +4 -2
  128. package/dist/index.cjs +25 -17
  129. package/dist/index.d.cts +82 -80
  130. package/dist/index.d.ts +82 -80
  131. package/dist/index.js +21 -13
  132. package/dist/{js-yaml-DLCVPJ7G.js → js-yaml-UPZKYVRY.js} +15 -17
  133. package/docs/calendar.md +441 -0
  134. package/package.json +10 -1
  135. package/dist/README-6MG272KM.cjs +0 -7
  136. package/dist/README-7N542PBL.js +0 -7
@@ -0,0 +1,441 @@
1
+ # Calendar API
2
+
3
+ - **Base URL:** `https://calendar.sls.epilot.io`
4
+ - **Full API Docs:** [https://docs.epilot.io/api/calendar](https://docs.epilot.io/api/calendar)
5
+
6
+ ## Usage
7
+
8
+ ```ts
9
+ import { epilot } from '@epilot/sdk'
10
+
11
+ epilot.authorize(() => '<token>')
12
+ const { data } = await epilot.calendar.listCalendars(...)
13
+ ```
14
+
15
+ ### Tree-shakeable import
16
+
17
+ ```ts
18
+ import { getClient, authorize } from '@epilot/sdk/calendar'
19
+
20
+ const calendarClient = getClient()
21
+ authorize(calendarClient, () => '<token>')
22
+ const { data } = await calendarClient.listCalendars(...)
23
+ ```
24
+
25
+ ## Operations
26
+
27
+ **Calendars**
28
+ - [`listCalendars`](#listcalendars)
29
+ - [`getCalendar`](#getcalendar)
30
+
31
+ **Events**
32
+ - [`listEvents`](#listevents)
33
+ - [`getEvent`](#getevent)
34
+
35
+ **Schemas**
36
+ - [`Calendar`](#calendar)
37
+ - [`CalendarSource`](#calendarsource)
38
+ - [`Provider`](#provider)
39
+ - [`Error`](#error)
40
+ - [`CalendarEvent`](#calendarevent)
41
+ - [`EventType`](#eventtype)
42
+ - [`EventStatus`](#eventstatus)
43
+ - [`Sensitivity`](#sensitivity)
44
+ - [`Importance`](#importance)
45
+ - [`ResponseStatus`](#responsestatus)
46
+ - [`Attendee`](#attendee)
47
+ - [`EventSource`](#eventsource)
48
+
49
+ ### `listCalendars`
50
+
51
+ List calendars visible to the caller.
52
+
53
+ `GET /v1/calendar`
54
+
55
+ ```ts
56
+ const { data } = await client.listCalendars({
57
+ size: 1,
58
+ cursor: 'example',
59
+ })
60
+ ```
61
+
62
+ <details>
63
+ <summary>Response</summary>
64
+
65
+ ```json
66
+ {
67
+ "results": [
68
+ {
69
+ "_id": "string",
70
+ "_schema": "calendar",
71
+ "_org": "string",
72
+ "_title": "string",
73
+ "name": "string",
74
+ "description": "string",
75
+ "color": "string",
76
+ "is_default": true,
77
+ "read_only": true,
78
+ "owner_email": "user@example.com",
79
+ "source": {
80
+ "type": "native",
81
+ "provider": "outlook",
82
+ "provider_calendar_id": "string",
83
+ "last_synced_at": "1970-01-01T00:00:00.000Z"
84
+ },
85
+ "_created_at": "1970-01-01T00:00:00.000Z",
86
+ "_updated_at": "1970-01-01T00:00:00.000Z"
87
+ }
88
+ ],
89
+ "next_cursor": "string"
90
+ }
91
+ ```
92
+
93
+ </details>
94
+
95
+ ---
96
+
97
+ ### `getCalendar`
98
+
99
+ Get a single calendar by its epilot ID.
100
+
101
+ `GET /v1/calendar/{calendar_id}`
102
+
103
+ ```ts
104
+ const { data } = await client.getCalendar({
105
+ calendar_id: 'example',
106
+ })
107
+ ```
108
+
109
+ <details>
110
+ <summary>Response</summary>
111
+
112
+ ```json
113
+ {
114
+ "_id": "string",
115
+ "_schema": "calendar",
116
+ "_org": "string",
117
+ "_title": "string",
118
+ "name": "string",
119
+ "description": "string",
120
+ "color": "string",
121
+ "is_default": true,
122
+ "read_only": true,
123
+ "owner_email": "user@example.com",
124
+ "source": {
125
+ "type": "native",
126
+ "provider": "outlook",
127
+ "provider_calendar_id": "string",
128
+ "last_synced_at": "1970-01-01T00:00:00.000Z"
129
+ },
130
+ "_created_at": "1970-01-01T00:00:00.000Z",
131
+ "_updated_at": "1970-01-01T00:00:00.000Z"
132
+ }
133
+ ```
134
+
135
+ </details>
136
+
137
+ ---
138
+
139
+ ### `listEvents`
140
+
141
+ List events in a time window. Recurring events are returned as expanded occurrences – each instance appears as its own event.
142
+
143
+ `GET /v1/calendar/events`
144
+
145
+ ```ts
146
+ const { data } = await client.listEvents({
147
+ from: 'example',
148
+ to: 'example',
149
+ calendar_id: 'example',
150
+ size: 1,
151
+ cursor: 'example',
152
+ })
153
+ ```
154
+
155
+ <details>
156
+ <summary>Response</summary>
157
+
158
+ ```json
159
+ {
160
+ "results": [
161
+ {
162
+ "_id": "string",
163
+ "_schema": "calendar_event",
164
+ "_org": "string",
165
+ "_title": "string",
166
+ "_tags": ["string"],
167
+ "calendar_id": "string",
168
+ "event_type": "singleInstance",
169
+ "description": "string",
170
+ "start_time": "1970-01-01T00:00:00.000Z",
171
+ "end_time": "1970-01-01T00:00:00.000Z",
172
+ "timezone": "string",
173
+ "is_all_day": true,
174
+ "location": "string",
175
+ "status": "free",
176
+ "busy": true,
177
+ "is_cancelled": true,
178
+ "sensitivity": "normal",
179
+ "importance": "low",
180
+ "is_online_meeting": true,
181
+ "online_meeting_url": "https://example.com/path",
182
+ "web_link": "https://example.com/path",
183
+ "response_status": "none",
184
+ "organizer_email": "user@example.com",
185
+ "attendees": [
186
+ {
187
+ "email": "user@example.com",
188
+ "name": "string",
189
+ "response": "none",
190
+ "type": "required"
191
+ }
192
+ ],
193
+ "is_recurring": true,
194
+ "series_master_id": "string",
195
+ "source": {
196
+ "type": "native",
197
+ "provider": "outlook",
198
+ "provider_event_id": "string",
199
+ "provider_event_url": "https://example.com/path",
200
+ "last_synced_at": "1970-01-01T00:00:00.000Z",
201
+ "etag": "string"
202
+ },
203
+ "_created_at": "1970-01-01T00:00:00.000Z",
204
+ "_updated_at": "1970-01-01T00:00:00.000Z"
205
+ }
206
+ ],
207
+ "next_cursor": "string"
208
+ }
209
+ ```
210
+
211
+ </details>
212
+
213
+ ---
214
+
215
+ ### `getEvent`
216
+
217
+ Get a single event by its epilot ID.
218
+
219
+ `GET /v1/calendar/events/{event_id}`
220
+
221
+ ```ts
222
+ const { data } = await client.getEvent({
223
+ event_id: 'example',
224
+ })
225
+ ```
226
+
227
+ <details>
228
+ <summary>Response</summary>
229
+
230
+ ```json
231
+ {
232
+ "_id": "string",
233
+ "_schema": "calendar_event",
234
+ "_org": "string",
235
+ "_title": "string",
236
+ "_tags": ["string"],
237
+ "calendar_id": "string",
238
+ "event_type": "singleInstance",
239
+ "description": "string",
240
+ "start_time": "1970-01-01T00:00:00.000Z",
241
+ "end_time": "1970-01-01T00:00:00.000Z",
242
+ "timezone": "string",
243
+ "is_all_day": true,
244
+ "location": "string",
245
+ "status": "free",
246
+ "busy": true,
247
+ "is_cancelled": true,
248
+ "sensitivity": "normal",
249
+ "importance": "low",
250
+ "is_online_meeting": true,
251
+ "online_meeting_url": "https://example.com/path",
252
+ "web_link": "https://example.com/path",
253
+ "response_status": "none",
254
+ "organizer_email": "user@example.com",
255
+ "attendees": [
256
+ {
257
+ "email": "user@example.com",
258
+ "name": "string",
259
+ "response": "none",
260
+ "type": "required"
261
+ }
262
+ ],
263
+ "is_recurring": true,
264
+ "series_master_id": "string",
265
+ "source": {
266
+ "type": "native",
267
+ "provider": "outlook",
268
+ "provider_event_id": "string",
269
+ "provider_event_url": "https://example.com/path",
270
+ "last_synced_at": "1970-01-01T00:00:00.000Z",
271
+ "etag": "string"
272
+ },
273
+ "_created_at": "1970-01-01T00:00:00.000Z",
274
+ "_updated_at": "1970-01-01T00:00:00.000Z"
275
+ }
276
+ ```
277
+
278
+ </details>
279
+
280
+ ---
281
+
282
+ ## Schemas
283
+
284
+ ### `Calendar`
285
+
286
+ ```ts
287
+ type Calendar = {
288
+ _id: string
289
+ _schema: "calendar"
290
+ _org: string
291
+ _title?: string
292
+ name: string
293
+ description?: string
294
+ color?: string
295
+ is_default: boolean
296
+ read_only: boolean
297
+ owner_email?: string // email
298
+ source: {
299
+ type: "native" | "synced"
300
+ provider?: "outlook" | "google" | null
301
+ provider_calendar_id?: string
302
+ last_synced_at?: string // date-time
303
+ }
304
+ _created_at?: string // date-time
305
+ _updated_at?: string // date-time
306
+ }
307
+ ```
308
+
309
+ ### `CalendarSource`
310
+
311
+ ```ts
312
+ type CalendarSource = {
313
+ type: "native" | "synced"
314
+ provider?: "outlook" | "google" | null
315
+ provider_calendar_id?: string
316
+ last_synced_at?: string // date-time
317
+ }
318
+ ```
319
+
320
+ ### `Provider`
321
+
322
+ Null for native epilot calendars
323
+
324
+ ```ts
325
+ type Provider = "outlook" | "google" | null
326
+ ```
327
+
328
+ ### `Error`
329
+
330
+ ```ts
331
+ type Error = {
332
+ message: string
333
+ code?: string
334
+ }
335
+ ```
336
+
337
+ ### `CalendarEvent`
338
+
339
+ ```ts
340
+ type CalendarEvent = {
341
+ _id: string
342
+ _schema: "calendar_event"
343
+ _org: string
344
+ _title?: string
345
+ _tags?: string[]
346
+ calendar_id: string
347
+ event_type: "singleInstance" | "occurrence" | "exception" | "seriesMaster"
348
+ description?: string
349
+ start_time: string // date-time
350
+ end_time: string // date-time
351
+ timezone: string
352
+ is_all_day: boolean
353
+ location?: string
354
+ status: "free" | "tentative" | "busy" | "oof" | "workingElsewhere" | "unknown"
355
+ busy: boolean
356
+ is_cancelled: boolean
357
+ sensitivity: "normal" | "personal" | "private" | "confidential"
358
+ importance: "low" | "normal" | "high"
359
+ is_online_meeting: boolean
360
+ online_meeting_url?: string // uri
361
+ web_link?: string // uri
362
+ response_status: "none" | "organizer" | "tentativelyAccepted" | "accepted" | "declined" | "notResponded"
363
+ organizer_email?: string // email
364
+ attendees?: Array<{
365
+ email: string // email
366
+ name?: string
367
+ response: "none" | "organizer" | "tentativelyAccepted" | "accepted" | "declined" | "notResponded"
368
+ type: "required" | "optional" | "resource"
369
+ }>
370
+ is_recurring: boolean
371
+ series_master_id?: string
372
+ source: {
373
+ type: "native" | "synced"
374
+ provider?: "outlook" | "google" | null
375
+ provider_event_id?: string
376
+ provider_event_url?: string // uri
377
+ last_synced_at?: string // date-time
378
+ etag?: string
379
+ }
380
+ _created_at?: string // date-time
381
+ _updated_at?: string // date-time
382
+ }
383
+ ```
384
+
385
+ ### `EventType`
386
+
387
+ ```ts
388
+ type EventType = "singleInstance" | "occurrence" | "exception" | "seriesMaster"
389
+ ```
390
+
391
+ ### `EventStatus`
392
+
393
+ Free/busy state derived from provider `showAs`
394
+
395
+ ```ts
396
+ type EventStatus = "free" | "tentative" | "busy" | "oof" | "workingElsewhere" | "unknown"
397
+ ```
398
+
399
+ ### `Sensitivity`
400
+
401
+ ```ts
402
+ type Sensitivity = "normal" | "personal" | "private" | "confidential"
403
+ ```
404
+
405
+ ### `Importance`
406
+
407
+ ```ts
408
+ type Importance = "low" | "normal" | "high"
409
+ ```
410
+
411
+ ### `ResponseStatus`
412
+
413
+ Caller's response to the invite
414
+
415
+ ```ts
416
+ type ResponseStatus = "none" | "organizer" | "tentativelyAccepted" | "accepted" | "declined" | "notResponded"
417
+ ```
418
+
419
+ ### `Attendee`
420
+
421
+ ```ts
422
+ type Attendee = {
423
+ email: string // email
424
+ name?: string
425
+ response: "none" | "organizer" | "tentativelyAccepted" | "accepted" | "declined" | "notResponded"
426
+ type: "required" | "optional" | "resource"
427
+ }
428
+ ```
429
+
430
+ ### `EventSource`
431
+
432
+ ```ts
433
+ type EventSource = {
434
+ type: "native" | "synced"
435
+ provider?: "outlook" | "google" | null
436
+ provider_event_id?: string
437
+ provider_event_url?: string // uri
438
+ last_synced_at?: string // date-time
439
+ etag?: string
440
+ }
441
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/sdk",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "JavaScript/TypeScript SDK for epilot APIs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -69,6 +69,12 @@
69
69
  "require": "./dist/apis/blueprint-manifest.cjs"
70
70
  },
71
71
  "./blueprint-manifest/openapi.json": "./definitions/blueprint-manifest.json",
72
+ "./calendar": {
73
+ "types": "./dist/apis/calendar.d.ts",
74
+ "import": "./dist/apis/calendar.js",
75
+ "require": "./dist/apis/calendar.cjs"
76
+ },
77
+ "./calendar/openapi.json": "./definitions/calendar.json",
72
78
  "./configuration-hub": {
73
79
  "types": "./dist/apis/configuration-hub.d.ts",
74
80
  "import": "./dist/apis/configuration-hub.js",
@@ -386,6 +392,9 @@
386
392
  "blueprint-manifest": [
387
393
  "./dist/apis/blueprint-manifest.d.ts"
388
394
  ],
395
+ "calendar": [
396
+ "./dist/apis/calendar.d.ts"
397
+ ],
389
398
  "configuration-hub": [
390
399
  "./dist/apis/configuration-hub.d.ts"
391
400
  ],
@@ -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.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.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |\n| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.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.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.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.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |\n| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.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.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
- };