@epilot/sdk 2.7.0 → 2.8.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/definitions/app.json +101 -8
- package/definitions/configuration-hub-runtime.json +1 -1
- package/definitions/configuration-hub.json +623 -0
- package/definitions/customer-portal-runtime.json +1 -1
- package/definitions/customer-portal.json +505 -6
- package/definitions/design-runtime.json +1 -1
- package/definitions/design.json +1 -11
- package/definitions/email-settings-runtime.json +1 -1
- package/definitions/email-settings.json +86 -4
- package/definitions/file-runtime.json +1 -1
- package/definitions/file.json +262 -4
- package/definitions/focus-pocus-runtime.json +1 -0
- package/definitions/focus-pocus.json +757 -0
- package/definitions/journey-runtime.json +1 -1
- package/definitions/journey.json +21 -1
- package/dist/README-37TXN4EL.cjs +7 -0
- package/dist/README-Z2WITBOR.js +7 -0
- package/dist/{_index-DB2VV4PQ.cjs → _index-HTUXYSTD.cjs} +4 -1
- package/dist/{_index-5FB6F5YY.js → _index-YTOJUFGD.js} +3 -0
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.d.cts +2 -2
- package/dist/apis/app.d.ts +2 -2
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/configuration-hub.cjs +8 -8
- package/dist/apis/configuration-hub.d.cts +2 -2
- package/dist/apis/configuration-hub.d.ts +2 -2
- package/dist/apis/configuration-hub.js +2 -2
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +8 -8
- package/dist/apis/customer-portal.d.cts +2 -2
- package/dist/apis/customer-portal.d.ts +2 -2
- package/dist/apis/customer-portal.js +2 -2
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +8 -8
- package/dist/apis/design.js +2 -2
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +8 -8
- package/dist/apis/email-settings.d.cts +2 -2
- package/dist/apis/email-settings.d.ts +2 -2
- package/dist/apis/email-settings.js +2 -2
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/file.cjs +8 -8
- package/dist/apis/file.d.cts +2 -2
- package/dist/apis/file.d.ts +2 -2
- package/dist/apis/file.js +2 -2
- package/dist/apis/focus-pocus.cjs +38 -0
- package/dist/apis/focus-pocus.d.cts +18 -0
- package/dist/apis/focus-pocus.d.ts +18 -0
- package/dist/apis/focus-pocus.js +38 -0
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +8 -8
- package/dist/apis/journey.d.cts +2 -2
- package/dist/apis/journey.d.ts +2 -2
- package/dist/apis/journey.js +2 -2
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/{app-SSF545U7.cjs → app-74LECFMK.cjs} +1 -1
- package/dist/{app-34OBBTA4.js → app-GNUHCGPO.js} +1 -1
- package/dist/{app.d--5n0FQQ4.d.cts → app.d-BOR23dso.d.cts} +104 -4
- package/dist/{app.d--5n0FQQ4.d.ts → app.d-BOR23dso.d.ts} +104 -4
- package/dist/chunk-3APTSPY4.js +14 -0
- package/dist/{chunk-JB7LITSP.js → chunk-54KWFSCM.js} +35 -24
- package/dist/chunk-A6FYGWQ7.cjs +14 -0
- package/dist/{chunk-35CN2YFK.cjs → chunk-F5Z6I7TF.cjs} +35 -24
- package/dist/chunk-JOUTFBLN.js +14 -0
- package/dist/chunk-KCPVNRDL.js +14 -0
- package/dist/chunk-KJPOUJBU.cjs +14 -0
- package/dist/chunk-LAWKCWVU.cjs +14 -0
- package/dist/{chunk-ZSONBZIF.cjs → chunk-MOLFG5L4.cjs} +1 -1
- package/dist/chunk-OPXGJKZR.cjs +14 -0
- package/dist/chunk-P42Q6HOW.js +14 -0
- package/dist/chunk-P4NA7NWG.js +14 -0
- package/dist/chunk-PTEJYAYJ.js +14 -0
- package/dist/chunk-WHXYES2D.cjs +14 -0
- package/dist/{chunk-ONOGGR6Q.js → chunk-WW6DVKJR.js} +1 -1
- package/dist/chunk-YI5YGTAH.cjs +14 -0
- package/dist/configuration-hub-E7S4JB2T.js +7 -0
- package/dist/configuration-hub-Q5JBYB52.cjs +7 -0
- package/dist/{configuration-hub-runtime-L6IOERSP.js → configuration-hub-runtime-CXME7TCX.js} +1 -1
- package/dist/{configuration-hub-runtime-I5Y67CXD.cjs → configuration-hub-runtime-QVLJKEZD.cjs} +2 -2
- package/dist/configuration-hub.d-CbSJDa7k.d.cts +1096 -0
- package/dist/configuration-hub.d-CbSJDa7k.d.ts +1096 -0
- package/dist/customer-portal-DR6XFCTQ.js +7 -0
- package/dist/customer-portal-PNFBVIAH.cjs +7 -0
- package/dist/{customer-portal-runtime-OEXTSMSE.cjs → customer-portal-runtime-IYHJ3RME.cjs} +2 -2
- package/dist/{customer-portal-runtime-N4NWQ67M.js → customer-portal-runtime-ZYU3WIXY.js} +1 -1
- package/dist/{customer-portal.d-ChSEioI5.d.cts → customer-portal.d-CTTCBAZI.d.cts} +764 -14
- package/dist/{customer-portal.d-ChSEioI5.d.ts → customer-portal.d-CTTCBAZI.d.ts} +764 -14
- package/dist/data-governance-QYFHBCNB.cjs +7 -0
- package/dist/data-governance-YS2NA6W4.js +7 -0
- package/dist/design-EWZQZ5KX.js +7 -0
- package/dist/design-MUUYXB2J.cjs +7 -0
- package/dist/design-runtime-3RHYNHUV.cjs +5 -0
- package/dist/{design-runtime-QMJM4FAF.js → design-runtime-DLMA4EHQ.js} +1 -1
- package/dist/email-settings-YJ4X5VFU.cjs +7 -0
- package/dist/email-settings-YUK3DXFJ.js +7 -0
- package/dist/{email-settings-runtime-EGIJ2AVQ.js → email-settings-runtime-BXRZV4M5.js} +1 -1
- package/dist/{email-settings-runtime-WGVLI7N6.cjs → email-settings-runtime-FWJQBQBK.cjs} +2 -2
- package/dist/{email-settings.d-B7Q_xT25.d.cts → email-settings.d-UJ0C3jPI.d.cts} +108 -9
- package/dist/{email-settings.d-B7Q_xT25.d.ts → email-settings.d-UJ0C3jPI.d.ts} +108 -9
- package/dist/file-P2FUUER2.js +7 -0
- package/dist/file-XTY74SIX.cjs +7 -0
- package/dist/file-runtime-24S3QPA7.cjs +5 -0
- package/dist/{file-runtime-B6AAGZQF.js → file-runtime-BIRMXYRH.js} +1 -1
- package/dist/{file.d-DcTJxjp7.d.cts → file.d-DTlrbI40.d.cts} +2336 -19
- package/dist/{file.d-DcTJxjp7.d.ts → file.d-DTlrbI40.d.ts} +2336 -19
- package/dist/focus-pocus-JGXH42OF.cjs +7 -0
- package/dist/focus-pocus-XVDVUYL6.js +7 -0
- package/dist/focus-pocus-runtime-QXBBYVX7.js +5 -0
- package/dist/focus-pocus-runtime-X6GQ3WI4.cjs +5 -0
- package/dist/focus-pocus.d-BRFGe53G.d.cts +489 -0
- package/dist/focus-pocus.d-BRFGe53G.d.ts +489 -0
- package/dist/index.cjs +34 -26
- package/dist/index.d.cts +57 -55
- package/dist/index.d.ts +57 -55
- package/dist/index.js +23 -15
- package/dist/journey-4DIIPRU4.js +7 -0
- package/dist/journey-ATC3Y5AW.cjs +7 -0
- package/dist/{journey-runtime-SPBL3F32.cjs → journey-runtime-G2O5C3N2.cjs} +2 -2
- package/dist/{journey-runtime-YXIAOTMD.js → journey-runtime-RI2LJO5S.js} +1 -1
- package/dist/{journey.d-ClXO0xK8.d.cts → journey.d-BenIUWaO.d.cts} +9 -3
- package/dist/{journey.d-ClXO0xK8.d.ts → journey.d-BenIUWaO.d.ts} +9 -3
- package/dist/pricing-R5ENSVPQ.cjs +7 -0
- package/dist/pricing-X27CCRI6.js +7 -0
- package/dist/targeting-74BV7F7H.cjs +7 -0
- package/dist/targeting-W5EKJYR2.js +7 -0
- package/docs/app.md +34 -10
- package/docs/configuration-hub.md +660 -0
- package/docs/customer-portal.md +604 -176
- package/docs/data-governance.md +17 -17
- package/docs/design.md +1 -1
- package/docs/email-settings.md +67 -3
- package/docs/file.md +101 -2
- package/docs/focus-pocus.md +460 -0
- package/docs/journey.md +2 -0
- package/docs/pricing.md +1 -1
- package/docs/targeting.md +4 -4
- package/package.json +10 -1
- package/dist/README-46VYEGGW.js +0 -7
- package/dist/README-IVBISSWB.cjs +0 -7
- package/dist/chunk-4W22EIRF.cjs +0 -14
- package/dist/chunk-5OBMZHRL.cjs +0 -14
- package/dist/chunk-E2WMGOM5.js +0 -14
- package/dist/chunk-EFWPEVXI.js +0 -14
- package/dist/chunk-EIIIKDOJ.cjs +0 -14
- package/dist/chunk-KEI3GHDY.cjs +0 -14
- package/dist/chunk-KIWRGUKM.js +0 -14
- package/dist/chunk-MB6NKETA.cjs +0 -14
- package/dist/chunk-VSZEOCIE.js +0 -14
- package/dist/chunk-Z6HGUGXK.js +0 -14
- package/dist/configuration-hub-A3S6ND6R.cjs +0 -7
- package/dist/configuration-hub-PMAW44U5.js +0 -7
- package/dist/configuration-hub.d-Cqaq2F-W.d.cts +0 -478
- package/dist/configuration-hub.d-Cqaq2F-W.d.ts +0 -478
- package/dist/customer-portal-5I7ZGQDU.cjs +0 -7
- package/dist/customer-portal-YL2YMPZL.js +0 -7
- package/dist/data-governance-2U5UU4GM.cjs +0 -7
- package/dist/data-governance-36Y33JVG.js +0 -7
- package/dist/design-DROLIWS3.js +0 -7
- package/dist/design-XZKOZLTR.cjs +0 -7
- package/dist/design-runtime-OXEXKZVG.cjs +0 -5
- package/dist/email-settings-CKFJU4WZ.js +0 -7
- package/dist/email-settings-NQJJKS2P.cjs +0 -7
- package/dist/file-UOWBTDIU.cjs +0 -7
- package/dist/file-XSN3NAVZ.js +0 -7
- package/dist/file-runtime-SFZIKODF.cjs +0 -5
- package/dist/journey-KDR5EU3W.js +0 -7
- package/dist/journey-REBN4TGQ.cjs +0 -7
- package/dist/pricing-FODHQFCB.cjs +0 -7
- package/dist/pricing-XRIDVZFC.js +0 -7
- package/dist/targeting-EYGYZD6M.cjs +0 -7
- package/dist/targeting-GEJTJN5Z.js +0 -7
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
# Focus Pocus API
|
|
2
|
+
|
|
3
|
+
- **Base URL:** `https://focus-pocus.dev.sls.epilot.io`
|
|
4
|
+
- **Full API Docs:** [https://docs.epilot.io/api/focus-pocus](https://docs.epilot.io/api/focus-pocus)
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { epilot } from '@epilot/sdk'
|
|
10
|
+
|
|
11
|
+
epilot.authorize(() => '<token>')
|
|
12
|
+
const { data } = await epilot.focusPocus.getHealth(...)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Tree-shakeable import
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { getClient, authorize } from '@epilot/sdk/focus-pocus'
|
|
19
|
+
|
|
20
|
+
const focusPocusClient = getClient()
|
|
21
|
+
authorize(focusPocusClient, () => '<token>')
|
|
22
|
+
const { data } = await focusPocusClient.getHealth(...)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Operations
|
|
26
|
+
|
|
27
|
+
**Health**
|
|
28
|
+
- [`getHealth`](#gethealth)
|
|
29
|
+
|
|
30
|
+
**Achievements**
|
|
31
|
+
- [`listAchievements`](#listachievements)
|
|
32
|
+
- [`getAchievement`](#getachievement)
|
|
33
|
+
|
|
34
|
+
**Challenges**
|
|
35
|
+
- [`getSuggestedChallenge`](#getsuggestedchallenge)
|
|
36
|
+
- [`acceptChallenge`](#acceptchallenge)
|
|
37
|
+
- [`dismissChallenge`](#dismisschallenge)
|
|
38
|
+
- [`listActiveChallenges`](#listactivechallenges)
|
|
39
|
+
|
|
40
|
+
**Events**
|
|
41
|
+
- [`postEvent`](#postevent)
|
|
42
|
+
|
|
43
|
+
**Schemas**
|
|
44
|
+
- [`HealthResponse`](#healthresponse)
|
|
45
|
+
- [`ErrorResponse`](#errorresponse)
|
|
46
|
+
- [`ConflictError`](#conflicterror)
|
|
47
|
+
- [`ChallengeSuggested`](#challengesuggested)
|
|
48
|
+
- [`ChallengeActive`](#challengeactive)
|
|
49
|
+
- [`ActiveChallengeListResponse`](#activechallengelistresponse)
|
|
50
|
+
- [`AchievementFeedItem`](#achievementfeeditem)
|
|
51
|
+
- [`AchievementFeedListResponse`](#achievementfeedlistresponse)
|
|
52
|
+
- [`EventIngestRequest`](#eventingestrequest)
|
|
53
|
+
- [`EventAccepted`](#eventaccepted)
|
|
54
|
+
|
|
55
|
+
### `getHealth`
|
|
56
|
+
|
|
57
|
+
Liveness probe for the Focus Pocus API. Requires a valid EpilotAuth token.
|
|
58
|
+
|
|
59
|
+
`GET /v1/health`
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
const { data } = await client.getHealth()
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
<details>
|
|
66
|
+
<summary>Response</summary>
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"status": "ok",
|
|
71
|
+
"stage": "dev",
|
|
72
|
+
"service": "focus-pocus-api"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
</details>
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### `listAchievements`
|
|
81
|
+
|
|
82
|
+
Unified feed for the authenticated user: returns active challenges and completed
|
|
83
|
+
v1 static achievement unlocks. The `userId` is read from the EpilotAuth claim —
|
|
84
|
+
no user path or query parameter is acce
|
|
85
|
+
|
|
86
|
+
`GET /v1/achievements`
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
const { data } = await client.listAchievements()
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
<details>
|
|
93
|
+
<summary>Response</summary>
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"results": [
|
|
98
|
+
{
|
|
99
|
+
"id": "string",
|
|
100
|
+
"challenge_template_id": "string",
|
|
101
|
+
"category": "string",
|
|
102
|
+
"title": "string",
|
|
103
|
+
"description": "string",
|
|
104
|
+
"badge_image_url": "string",
|
|
105
|
+
"icon": "string",
|
|
106
|
+
"status": "active",
|
|
107
|
+
"accepted_at": "1970-01-01T00:00:00.000Z",
|
|
108
|
+
"deadline": "1970-01-01T00:00:00.000Z",
|
|
109
|
+
"time_remaining_ms": 0,
|
|
110
|
+
"unlocked_at": "1970-01-01T00:00:00.000Z",
|
|
111
|
+
"xp_awarded": 0,
|
|
112
|
+
"just_unlocked": true
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"total": 0
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
</details>
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### `getAchievement`
|
|
124
|
+
|
|
125
|
+
Single user-scoped achievement or active-challenge item. Returns 404 if the id
|
|
126
|
+
does not belong to the authenticated user.
|
|
127
|
+
|
|
128
|
+
`GET /v1/achievements/{id}`
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
const { data } = await client.getAchievement({
|
|
132
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
133
|
+
})
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
<details>
|
|
137
|
+
<summary>Response</summary>
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"id": "string",
|
|
142
|
+
"challenge_template_id": "string",
|
|
143
|
+
"category": "string",
|
|
144
|
+
"title": "string",
|
|
145
|
+
"description": "string",
|
|
146
|
+
"badge_image_url": "string",
|
|
147
|
+
"icon": "string",
|
|
148
|
+
"status": "active",
|
|
149
|
+
"accepted_at": "1970-01-01T00:00:00.000Z",
|
|
150
|
+
"deadline": "1970-01-01T00:00:00.000Z",
|
|
151
|
+
"time_remaining_ms": 0,
|
|
152
|
+
"unlocked_at": "1970-01-01T00:00:00.000Z",
|
|
153
|
+
"xp_awarded": 0,
|
|
154
|
+
"just_unlocked": true
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
</details>
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### `getSuggestedChallenge`
|
|
163
|
+
|
|
164
|
+
Returns a suggested challenge for the authenticated user. The suggestion is
|
|
165
|
+
persisted with a 7-day TTL. Calling again with the same `(user, category)`
|
|
166
|
+
within 24h returns the existing suggestion withou
|
|
167
|
+
|
|
168
|
+
`GET /v1/challenges/suggest`
|
|
169
|
+
|
|
170
|
+
```ts
|
|
171
|
+
const { data } = await client.getSuggestedChallenge({
|
|
172
|
+
route: 'example',
|
|
173
|
+
entity_type: 'example',
|
|
174
|
+
category_hint: 'example',
|
|
175
|
+
})
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
<details>
|
|
179
|
+
<summary>Response</summary>
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"id": "string",
|
|
184
|
+
"challenge_template_id": "string",
|
|
185
|
+
"category": "string",
|
|
186
|
+
"title": "string",
|
|
187
|
+
"description": "string",
|
|
188
|
+
"badge_image_url": "string",
|
|
189
|
+
"default_duration_hours": 1,
|
|
190
|
+
"status": "suggested",
|
|
191
|
+
"suggested_at": "1970-01-01T00:00:00.000Z"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
</details>
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### `acceptChallenge`
|
|
200
|
+
|
|
201
|
+
Accept a suggested challenge. Atomically transitions the challenge from
|
|
202
|
+
`suggested` to `active` using a conditional DynamoDB UpdateItem. Returns 409 if
|
|
203
|
+
the challenge has already been transitioned or t
|
|
204
|
+
|
|
205
|
+
`POST /v1/challenges/{id}/accept`
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
const { data } = await client.acceptChallenge({
|
|
209
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
210
|
+
})
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
<details>
|
|
214
|
+
<summary>Response</summary>
|
|
215
|
+
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"id": "string",
|
|
219
|
+
"challenge_template_id": "string",
|
|
220
|
+
"category": "string",
|
|
221
|
+
"title": "string",
|
|
222
|
+
"description": "string",
|
|
223
|
+
"badge_image_url": "string",
|
|
224
|
+
"status": "active",
|
|
225
|
+
"accepted_at": "1970-01-01T00:00:00.000Z",
|
|
226
|
+
"deadline": "1970-01-01T00:00:00.000Z",
|
|
227
|
+
"time_remaining_ms": 0
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
</details>
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
### `dismissChallenge`
|
|
236
|
+
|
|
237
|
+
Dismiss a suggested challenge. Atomically transitions the challenge from
|
|
238
|
+
`suggested` to `dismissed`. The challenge template is filtered from `/suggest`
|
|
239
|
+
responses for the next 24h. Returns 409 if the c
|
|
240
|
+
|
|
241
|
+
`POST /v1/challenges/{id}/dismiss`
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
const { data } = await client.dismissChallenge({
|
|
245
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
246
|
+
})
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### `listActiveChallenges`
|
|
252
|
+
|
|
253
|
+
Returns all active challenges for the authenticated user. Challenges whose
|
|
254
|
+
deadline has passed are lazily expired (fire-and-forget UpdateItem) and
|
|
255
|
+
excluded from the response. The result set is bounded
|
|
256
|
+
|
|
257
|
+
`GET /v1/challenges/active`
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
const { data } = await client.listActiveChallenges()
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
<details>
|
|
264
|
+
<summary>Response</summary>
|
|
265
|
+
|
|
266
|
+
```json
|
|
267
|
+
{
|
|
268
|
+
"results": [
|
|
269
|
+
{
|
|
270
|
+
"id": "string",
|
|
271
|
+
"challenge_template_id": "string",
|
|
272
|
+
"category": "string",
|
|
273
|
+
"title": "string",
|
|
274
|
+
"description": "string",
|
|
275
|
+
"badge_image_url": "string",
|
|
276
|
+
"status": "active",
|
|
277
|
+
"accepted_at": "1970-01-01T00:00:00.000Z",
|
|
278
|
+
"deadline": "1970-01-01T00:00:00.000Z",
|
|
279
|
+
"time_remaining_ms": 0
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"total": 0
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
</details>
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
### `postEvent`
|
|
291
|
+
|
|
292
|
+
Persist-first event ingest. Accepts an activity event, writes it to the event log
|
|
293
|
+
idempotently (keyed by `event_id`), and returns 202. Achievement evaluation happens
|
|
294
|
+
asynchronously — no unlocks are re
|
|
295
|
+
|
|
296
|
+
`POST /v1/events`
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
const { data } = await client.postEvent(
|
|
300
|
+
null,
|
|
301
|
+
{
|
|
302
|
+
event_id: 'string',
|
|
303
|
+
event_type: 'string',
|
|
304
|
+
actor_user_id: 'string',
|
|
305
|
+
occurred_at: '1970-01-01T00:00:00.000Z',
|
|
306
|
+
properties: {}
|
|
307
|
+
},
|
|
308
|
+
)
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Schemas
|
|
314
|
+
|
|
315
|
+
### `HealthResponse`
|
|
316
|
+
|
|
317
|
+
```ts
|
|
318
|
+
type HealthResponse = {
|
|
319
|
+
status: "ok"
|
|
320
|
+
stage: string
|
|
321
|
+
service: string
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### `ErrorResponse`
|
|
326
|
+
|
|
327
|
+
```ts
|
|
328
|
+
type ErrorResponse = {
|
|
329
|
+
status: number
|
|
330
|
+
error: string
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### `ConflictError`
|
|
335
|
+
|
|
336
|
+
```ts
|
|
337
|
+
type ConflictError = {
|
|
338
|
+
status: 409
|
|
339
|
+
error: string
|
|
340
|
+
reason: "already_transitioned" | "too_many_active" | "deadline_passed"
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### `ChallengeSuggested`
|
|
345
|
+
|
|
346
|
+
```ts
|
|
347
|
+
type ChallengeSuggested = {
|
|
348
|
+
id: string
|
|
349
|
+
challenge_template_id: string
|
|
350
|
+
category: string
|
|
351
|
+
title: string
|
|
352
|
+
description: string
|
|
353
|
+
badge_image_url: string
|
|
354
|
+
default_duration_hours: number
|
|
355
|
+
status: "suggested"
|
|
356
|
+
suggested_at: string // date-time
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### `ChallengeActive`
|
|
361
|
+
|
|
362
|
+
```ts
|
|
363
|
+
type ChallengeActive = {
|
|
364
|
+
id: string
|
|
365
|
+
challenge_template_id: string
|
|
366
|
+
category: string
|
|
367
|
+
title: string
|
|
368
|
+
description: string
|
|
369
|
+
badge_image_url: string
|
|
370
|
+
status: "active"
|
|
371
|
+
accepted_at: string // date-time
|
|
372
|
+
deadline: string // date-time
|
|
373
|
+
time_remaining_ms: number
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### `ActiveChallengeListResponse`
|
|
378
|
+
|
|
379
|
+
```ts
|
|
380
|
+
type ActiveChallengeListResponse = {
|
|
381
|
+
results: Array<{
|
|
382
|
+
id: string
|
|
383
|
+
challenge_template_id: string
|
|
384
|
+
category: string
|
|
385
|
+
title: string
|
|
386
|
+
description: string
|
|
387
|
+
badge_image_url: string
|
|
388
|
+
status: "active"
|
|
389
|
+
accepted_at: string // date-time
|
|
390
|
+
deadline: string // date-time
|
|
391
|
+
time_remaining_ms: number
|
|
392
|
+
}>
|
|
393
|
+
total: number
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### `AchievementFeedItem`
|
|
398
|
+
|
|
399
|
+
```ts
|
|
400
|
+
type AchievementFeedItem = {
|
|
401
|
+
id: string
|
|
402
|
+
challenge_template_id?: string
|
|
403
|
+
category: string
|
|
404
|
+
title: string
|
|
405
|
+
description: string
|
|
406
|
+
badge_image_url?: string
|
|
407
|
+
icon?: string
|
|
408
|
+
status: "active" | "completed" | "expired"
|
|
409
|
+
accepted_at?: string // date-time
|
|
410
|
+
deadline?: string // date-time
|
|
411
|
+
time_remaining_ms?: number
|
|
412
|
+
unlocked_at?: string // date-time
|
|
413
|
+
xp_awarded?: number
|
|
414
|
+
just_unlocked: boolean
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### `AchievementFeedListResponse`
|
|
419
|
+
|
|
420
|
+
```ts
|
|
421
|
+
type AchievementFeedListResponse = {
|
|
422
|
+
results: Array<{
|
|
423
|
+
id: string
|
|
424
|
+
challenge_template_id?: string
|
|
425
|
+
category: string
|
|
426
|
+
title: string
|
|
427
|
+
description: string
|
|
428
|
+
badge_image_url?: string
|
|
429
|
+
icon?: string
|
|
430
|
+
status: "active" | "completed" | "expired"
|
|
431
|
+
accepted_at?: string // date-time
|
|
432
|
+
deadline?: string // date-time
|
|
433
|
+
time_remaining_ms?: number
|
|
434
|
+
unlocked_at?: string // date-time
|
|
435
|
+
xp_awarded?: number
|
|
436
|
+
just_unlocked: boolean
|
|
437
|
+
}>
|
|
438
|
+
total: number
|
|
439
|
+
}
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### `EventIngestRequest`
|
|
443
|
+
|
|
444
|
+
```ts
|
|
445
|
+
type EventIngestRequest = {
|
|
446
|
+
event_id: string
|
|
447
|
+
event_type: string
|
|
448
|
+
actor_user_id: string
|
|
449
|
+
occurred_at: string // date-time
|
|
450
|
+
properties?: Record<string, unknown>
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### `EventAccepted`
|
|
455
|
+
|
|
456
|
+
```ts
|
|
457
|
+
type EventAccepted = {
|
|
458
|
+
accepted: true
|
|
459
|
+
}
|
|
460
|
+
```
|
package/docs/journey.md
CHANGED
|
@@ -100,6 +100,7 @@ Get journey by id. Private journeys requires valid private token to be passed
|
|
|
100
100
|
```ts
|
|
101
101
|
const { data } = await client.getJourney({
|
|
102
102
|
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
103
|
+
version: 1,
|
|
103
104
|
source: 'example',
|
|
104
105
|
orgId: 'example',
|
|
105
106
|
})
|
|
@@ -1432,6 +1433,7 @@ Get journey by id
|
|
|
1432
1433
|
```ts
|
|
1433
1434
|
const { data } = await client.getJourneyV2({
|
|
1434
1435
|
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
1436
|
+
version: 1,
|
|
1435
1437
|
})
|
|
1436
1438
|
```
|
|
1437
1439
|
|
package/docs/pricing.md
CHANGED
|
@@ -1368,7 +1368,7 @@ const { data } = await client.$computePrice(
|
|
|
1368
1368
|
consumption_NT: 0,
|
|
1369
1369
|
association_id: 'string',
|
|
1370
1370
|
billing_period: 'monthly',
|
|
1371
|
-
reference_date: '
|
|
1371
|
+
reference_date: 'string',
|
|
1372
1372
|
type: 'power',
|
|
1373
1373
|
meter_type: 'classic'
|
|
1374
1374
|
},
|
package/docs/targeting.md
CHANGED
|
@@ -116,8 +116,8 @@ const { data } = await client.changeCampaignStatus({
|
|
|
116
116
|
"name": "string",
|
|
117
117
|
"goal": "string",
|
|
118
118
|
"status": "draft",
|
|
119
|
-
"start_date": "
|
|
120
|
-
"end_date": "
|
|
119
|
+
"start_date": "string",
|
|
120
|
+
"end_date": "string",
|
|
121
121
|
"flow_id": "string",
|
|
122
122
|
"job_id": "string",
|
|
123
123
|
"target": {
|
|
@@ -296,8 +296,8 @@ const { data } = await client.matchCampaigns(
|
|
|
296
296
|
"name": "string",
|
|
297
297
|
"goal": "string",
|
|
298
298
|
"status": "draft",
|
|
299
|
-
"start_date": "
|
|
300
|
-
"end_date": "
|
|
299
|
+
"start_date": "string",
|
|
300
|
+
"end_date": "string",
|
|
301
301
|
"flow_id": "string",
|
|
302
302
|
"job_id": "string",
|
|
303
303
|
"target": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0-rc.0",
|
|
4
4
|
"description": "JavaScript/TypeScript SDK for epilot APIs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -165,6 +165,12 @@
|
|
|
165
165
|
"require": "./dist/apis/file.cjs"
|
|
166
166
|
},
|
|
167
167
|
"./file/openapi.json": "./definitions/file.json",
|
|
168
|
+
"./focus-pocus": {
|
|
169
|
+
"types": "./dist/apis/focus-pocus.d.ts",
|
|
170
|
+
"import": "./dist/apis/focus-pocus.js",
|
|
171
|
+
"require": "./dist/apis/focus-pocus.cjs"
|
|
172
|
+
},
|
|
173
|
+
"./focus-pocus/openapi.json": "./definitions/focus-pocus.json",
|
|
168
174
|
"./iban": {
|
|
169
175
|
"types": "./dist/apis/iban.d.ts",
|
|
170
176
|
"import": "./dist/apis/iban.js",
|
|
@@ -440,6 +446,9 @@
|
|
|
440
446
|
"file": [
|
|
441
447
|
"./dist/apis/file.d.ts"
|
|
442
448
|
],
|
|
449
|
+
"focus-pocus": [
|
|
450
|
+
"./dist/apis/focus-pocus.d.ts"
|
|
451
|
+
],
|
|
443
452
|
"iban": [
|
|
444
453
|
"./dist/apis/iban.d.ts"
|
|
445
454
|
],
|
package/dist/README-46VYEGGW.js
DELETED
|
@@ -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.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
|
-
};
|
package/dist/README-IVBISSWB.cjs
DELETED
|
@@ -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.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;
|
package/dist/chunk-4W22EIRF.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkNJK5F5TFcjs = require('./chunk-NJK5F5TF.cjs');
|
|
4
|
-
|
|
5
|
-
// src/definitions/file-runtime.json
|
|
6
|
-
var require_file_runtime = _chunkNJK5F5TFcjs.__commonJS.call(void 0, {
|
|
7
|
-
"src/definitions/file-runtime.json"(exports, module) {
|
|
8
|
-
module.exports = { s: "https://file.sls.epilot.io", o: [["uploadFileV2", "post", "/v2/files/upload", [["file_entity_id", "q"]], 1], ["saveFileV2", "post", "/v2/files", [["ActivityIdQueryParam"], ["FillActivityQueryParam"], ["StrictQueryParam"], ["AsyncOperationQueryParam"], ["DeleteTempFileQueryParam"], ["VersionOnlyQueryParam"]], 1], ["uploadFile", "post", "/v1/files/upload", [["file_entity_id", "q"]], 1], ["saveFile", "post", "/v1/files", [["ActivityIdQueryParam"], ["AsyncOperationQueryParam"], ["VersionOnlyQueryParam"]], 1], ["getFile", "get", "/v2/files/{id}", [["id", "p", true], ["source_url", "q"], ["StrictQueryParam"], ["AsyncOperationQueryParam"]]], ["deleteFile", "delete", "/v2/files/{id}", [["id", "p", true], ["purge", "q"], ["ActivityIdQueryParam"], ["StrictQueryParam"]]], ["downloadFile", "get", "/v1/files/{id}/download", [["id", "p", true], ["version", "q"], ["attachment", "q"]]], ["downloadS3File", "post", "/v1/files:downloadS3", [["s3_key", "q", true], ["s3_bucket", "q", true], ["attachment", "q"]]], ["downloadFiles", "post", "/v1/files:downloadFiles", null, 1], ["previewFile", "get", "/v1/files/{id}/preview", [["id", "p", true], ["version", "q"], ["w", "q"], ["h", "q"]]], ["previewS3File", "post", "/v1/files:previewS3", [["w", "q"], ["h", "q"]], 1], ["previewS3FileGet", "get", "/v1/files:previewS3", [["key", "q", true], ["bucket", "q", true], ["w", "q"], ["h", "q"]]], ["previewPublicFile", "get", "/v1/files/public/{id}/preview", [["id", "p", true], ["version", "q"], ["w", "q"], ["h", "q"], ["org_id", "q"]]], ["getSession", "get", "/v1/files/session"], ["deleteSession", "delete", "/v1/files/session"], ["generatePublicLink", "post", "/v1/files/{id}/public/links", [["id", "p", true]]], ["listPublicLinksForFile", "get", "/v1/files/{id}/public/links", [["id", "p", true]]], ["accessPublicLink", "get", "/v1/files/public/links/{id}/{filename}", [["id", "p", true], ["filename", "p", true], ["hash", "q"]]], ["revokePublicLink", "delete", "/v1/files/public/links/{id}", [["id", "p", true]]], ["verifyCustomDownloadUrl", "post", "/v1/files/download:verify", null, 1], ["uploadFilePublic", "post", "/v1/files/public/upload", null, 1], ["getUserSchemaFileCollections", "get", "/v1/{slug}/collections", [["slug", "p", true]]], ["createUserSchemaFileCollection", "post", "/v1/{slug}/collections", [["slug", "p", true]], 1], ["updateUserSchemaFileCollection", "put", "/v1/{slug}/collections/{collectionSlug}", [["slug", "p", true], ["collectionSlug", "p", true]], 1], ["deleteUserSchemaFileCollection", "delete", "/v1/{slug}/collections/{collectionSlug}", [["slug", "p", true], ["collectionSlug", "p", true]]], ["getFilesInCollection", "get", "/v1/entity/{id}/collections/{collectionSlug}/files", [["EntityIdPathParam"], ["collectionSlug", "p", true]]], ["getGlobalFileCollections", "get", "/v1/collections/{schemaSlug}", [["schemaSlug", "p", true]]]], v: "3.0.3", cp: { EntityIdPathParam: ["id", "p", true], StrictQueryParam: ["strict", "q"], ActivityIdQueryParam: ["activity_id", "q"], FillActivityQueryParam: ["fill_activity", "q"], AsyncOperationQueryParam: ["async", "q"], DeleteTempFileQueryParam: ["delete_temp_file", "q"], VersionOnlyQueryParam: ["version_only", "q"] } };
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.require_file_runtime = require_file_runtime;
|