@epilot/sdk 2.20.50 → 2.20.52
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/external-values-runtime.json +1 -0
- package/definitions/external-values.json +450 -0
- package/definitions/pricing.json +206 -8
- package/dist/README-B6X6BXAW.cjs +7 -0
- package/dist/README-LE2VBY2Y.js +7 -0
- package/dist/{_index-UWRY3DNX.cjs → _index-DEYTKG4Z.cjs} +4 -1
- package/dist/{_index-UBUNWMRP.js → _index-HL3HOTXB.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.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/chat.cjs +6 -6
- package/dist/apis/chat.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/external-values.cjs +38 -0
- package/dist/apis/external-values.d.cts +18 -0
- package/dist/apis/external-values.d.ts +18 -0
- package/dist/apis/external-values.js +38 -0
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/identity.cjs +6 -6
- package/dist/apis/identity.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.d.cts +2 -2
- package/dist/apis/pricing.d.ts +2 -2
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/chunk-CMEMMJ3T.js +14 -0
- package/dist/chunk-NC33X2WL.cjs +14 -0
- package/dist/{chunk-VMA2UKDS.js → chunk-OI4LZOVC.js} +5 -3
- package/dist/{chunk-TF4SGSFP.cjs → chunk-YJ7BKTTM.cjs} +5 -3
- package/dist/external-values-DALDMPMB.js +7 -0
- package/dist/external-values-XG5LFKZQ.cjs +7 -0
- package/dist/external-values-runtime-BPR3H6RL.cjs +5 -0
- package/dist/external-values-runtime-VXZRGQCT.js +5 -0
- package/dist/external-values.d-DjP9C_-r.d.cts +391 -0
- package/dist/external-values.d-DjP9C_-r.d.ts +391 -0
- package/dist/index.cjs +22 -14
- package/dist/index.d.cts +58 -56
- package/dist/index.d.ts +58 -56
- package/dist/index.js +15 -7
- package/dist/pricing-5ZPVKMML.js +7 -0
- package/dist/pricing-VZXOELOD.cjs +7 -0
- package/dist/{pricing.d-BMV5QoZ7.d.cts → pricing.d-V26VSdNU.d.cts} +267 -60
- package/dist/{pricing.d-BMV5QoZ7.d.ts → pricing.d-V26VSdNU.d.ts} +267 -60
- package/docs/external-values.md +330 -0
- package/docs/pricing.md +395 -25
- package/package.json +10 -1
- package/dist/README-OSHX3IVR.cjs +0 -7
- package/dist/README-ZSJDIPZZ.js +0 -7
- package/dist/pricing-FYBJTHHN.js +0 -7
- package/dist/pricing-M2FG4LZ6.cjs +0 -7
package/docs/pricing.md
CHANGED
|
@@ -104,6 +104,12 @@ const { data } = await pricingClient.$calculatePricingDetails(...)
|
|
|
104
104
|
- [`CreateVariantRequest`](#createvariantrequest)
|
|
105
105
|
- [`VariantConditions`](#variantconditions)
|
|
106
106
|
- [`PinnedConditions`](#pinnedconditions)
|
|
107
|
+
- [`PinnedConditionValue`](#pinnedconditionvalue)
|
|
108
|
+
- [`ConditionDateRange`](#conditiondaterange)
|
|
109
|
+
- [`PostalCodeCity`](#postalcodecity)
|
|
110
|
+
- [`ContextConditionValue`](#contextconditionvalue)
|
|
111
|
+
- [`ConditionPredicate`](#conditionpredicate)
|
|
112
|
+
- [`OrderedConditionOperand`](#orderedconditionoperand)
|
|
107
113
|
- [`VariantValues`](#variantvalues)
|
|
108
114
|
- [`CreatedVariant`](#createdvariant)
|
|
109
115
|
- [`WriteWarning`](#writewarning)
|
|
@@ -3001,7 +3007,24 @@ variant, which is how to ask for it without knowing its id.
|
|
|
3001
3007
|
type ResolveConditionalEntityRequest = {
|
|
3002
3008
|
schema: "product" | "price" | "coupon"
|
|
3003
3009
|
entity_id: string
|
|
3004
|
-
context: Record<string,
|
|
3010
|
+
context: Record<string, string | number | boolean | {
|
|
3011
|
+
postal_code: string
|
|
3012
|
+
city: string
|
|
3013
|
+
} | {
|
|
3014
|
+
lt: number | string
|
|
3015
|
+
} | {
|
|
3016
|
+
lte: number | string
|
|
3017
|
+
} | {
|
|
3018
|
+
gt: number | string
|
|
3019
|
+
} | {
|
|
3020
|
+
gte: number | string
|
|
3021
|
+
} | {
|
|
3022
|
+
in: string | number[]
|
|
3023
|
+
} | {
|
|
3024
|
+
between: string
|
|
3025
|
+
} | {
|
|
3026
|
+
exists: boolean
|
|
3027
|
+
}>
|
|
3005
3028
|
as_of?: string
|
|
3006
3029
|
options?: {
|
|
3007
3030
|
resolve_one?: boolean
|
|
@@ -3028,7 +3051,24 @@ composed with the version in effect at `as_of`.
|
|
|
3028
3051
|
type ResolveByContextRequest = {
|
|
3029
3052
|
schema: "product" | "price" | "coupon"
|
|
3030
3053
|
entity_id: string
|
|
3031
|
-
context: Record<string,
|
|
3054
|
+
context: Record<string, string | number | boolean | {
|
|
3055
|
+
postal_code: string
|
|
3056
|
+
city: string
|
|
3057
|
+
} | {
|
|
3058
|
+
lt: number | string
|
|
3059
|
+
} | {
|
|
3060
|
+
lte: number | string
|
|
3061
|
+
} | {
|
|
3062
|
+
gt: number | string
|
|
3063
|
+
} | {
|
|
3064
|
+
gte: number | string
|
|
3065
|
+
} | {
|
|
3066
|
+
in: string | number[]
|
|
3067
|
+
} | {
|
|
3068
|
+
between: string
|
|
3069
|
+
} | {
|
|
3070
|
+
exists: boolean
|
|
3071
|
+
}>
|
|
3032
3072
|
as_of?: string
|
|
3033
3073
|
options?: {
|
|
3034
3074
|
resolve_one?: boolean
|
|
@@ -3064,7 +3104,24 @@ Each value is an exact value, typed by its condition, or a single-operator predi
|
|
|
3064
3104
|
- `{ "lt": v }`, `{ "lte"
|
|
3065
3105
|
|
|
3066
3106
|
```ts
|
|
3067
|
-
type ResolveContext = Record<string,
|
|
3107
|
+
type ResolveContext = Record<string, string | number | boolean | {
|
|
3108
|
+
postal_code: string
|
|
3109
|
+
city: string
|
|
3110
|
+
} | {
|
|
3111
|
+
lt: number | string
|
|
3112
|
+
} | {
|
|
3113
|
+
lte: number | string
|
|
3114
|
+
} | {
|
|
3115
|
+
gt: number | string
|
|
3116
|
+
} | {
|
|
3117
|
+
gte: number | string
|
|
3118
|
+
} | {
|
|
3119
|
+
in: string | number[]
|
|
3120
|
+
} | {
|
|
3121
|
+
between: string
|
|
3122
|
+
} | {
|
|
3123
|
+
exists: boolean
|
|
3124
|
+
}>
|
|
3068
3125
|
```
|
|
3069
3126
|
|
|
3070
3127
|
### `ResolveOptions`
|
|
@@ -3134,7 +3191,13 @@ type ResolvedVariant = {
|
|
|
3134
3191
|
|
|
3135
3192
|
```ts
|
|
3136
3193
|
type CreateVariantRequest = {
|
|
3137
|
-
conditions?: Record<string,
|
|
3194
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3195
|
+
from?: string
|
|
3196
|
+
until?: string
|
|
3197
|
+
} | {
|
|
3198
|
+
postal_code: string
|
|
3199
|
+
city: string
|
|
3200
|
+
}>
|
|
3138
3201
|
default?: boolean
|
|
3139
3202
|
valid_from?: string
|
|
3140
3203
|
values: Record<string, unknown>
|
|
@@ -3163,7 +3226,113 @@ Exact values only; predicates belong to reads. Values are stored canonicalized f
|
|
|
3163
3226
|
type: a `dat
|
|
3164
3227
|
|
|
3165
3228
|
```ts
|
|
3166
|
-
type PinnedConditions = Record<string,
|
|
3229
|
+
type PinnedConditions = Record<string, string | number | boolean | {
|
|
3230
|
+
from?: string
|
|
3231
|
+
until?: string
|
|
3232
|
+
} | {
|
|
3233
|
+
postal_code: string
|
|
3234
|
+
city: string
|
|
3235
|
+
}>
|
|
3236
|
+
```
|
|
3237
|
+
|
|
3238
|
+
### `PinnedConditionValue`
|
|
3239
|
+
|
|
3240
|
+
One condition's exact value. Which of these shapes a condition takes is set by its type in the
|
|
3241
|
+
entity's schema, and a value of another shape is refused with `PIN_FORMAT_INVALID`.
|
|
3242
|
+
|
|
3243
|
+
|
|
3244
|
+
```ts
|
|
3245
|
+
type PinnedConditionValue = string | number | boolean | {
|
|
3246
|
+
from?: string
|
|
3247
|
+
until?: string
|
|
3248
|
+
} | {
|
|
3249
|
+
postal_code: string
|
|
3250
|
+
city: string
|
|
3251
|
+
}
|
|
3252
|
+
```
|
|
3253
|
+
|
|
3254
|
+
### `ConditionDateRange`
|
|
3255
|
+
|
|
3256
|
+
The value of a `daterange` condition. A bound that is absent, `null` or an empty string is an
|
|
3257
|
+
open end; stored, an open end is an empty string.
|
|
3258
|
+
|
|
3259
|
+
|
|
3260
|
+
```ts
|
|
3261
|
+
type ConditionDateRange = {
|
|
3262
|
+
from?: string
|
|
3263
|
+
until?: string
|
|
3264
|
+
}
|
|
3265
|
+
```
|
|
3266
|
+
|
|
3267
|
+
### `PostalCodeCity`
|
|
3268
|
+
|
|
3269
|
+
The value of a `location` condition of format `postal_code_city`, its parts named as an entity
|
|
3270
|
+
address names them.
|
|
3271
|
+
|
|
3272
|
+
|
|
3273
|
+
```ts
|
|
3274
|
+
type PostalCodeCity = {
|
|
3275
|
+
postal_code: string
|
|
3276
|
+
city: string
|
|
3277
|
+
}
|
|
3278
|
+
```
|
|
3279
|
+
|
|
3280
|
+
### `ContextConditionValue`
|
|
3281
|
+
|
|
3282
|
+
One condition's value in a resolve context or listing filter: an exact value, or a predicate.
|
|
3283
|
+
Which of these a condition takes is set by its type in the entity's schema, and a value of
|
|
3284
|
+
another shape is refused with `CONTEXT_FORMAT_INVALID`, or `OPERATOR_UNSUPPORTED` for a
|
|
3285
|
+
predicate its type does not
|
|
3286
|
+
|
|
3287
|
+
```ts
|
|
3288
|
+
type ContextConditionValue = string | number | boolean | {
|
|
3289
|
+
postal_code: string
|
|
3290
|
+
city: string
|
|
3291
|
+
} | {
|
|
3292
|
+
lt: number | string
|
|
3293
|
+
} | {
|
|
3294
|
+
lte: number | string
|
|
3295
|
+
} | {
|
|
3296
|
+
gt: number | string
|
|
3297
|
+
} | {
|
|
3298
|
+
gte: number | string
|
|
3299
|
+
} | {
|
|
3300
|
+
in: string | number[]
|
|
3301
|
+
} | {
|
|
3302
|
+
between: string
|
|
3303
|
+
} | {
|
|
3304
|
+
exists: boolean
|
|
3305
|
+
}
|
|
3306
|
+
```
|
|
3307
|
+
|
|
3308
|
+
### `ConditionPredicate`
|
|
3309
|
+
|
|
3310
|
+
A single-operator predicate.
|
|
3311
|
+
|
|
3312
|
+
```ts
|
|
3313
|
+
type ConditionPredicate = {
|
|
3314
|
+
lt: number | string
|
|
3315
|
+
} | {
|
|
3316
|
+
lte: number | string
|
|
3317
|
+
} | {
|
|
3318
|
+
gt: number | string
|
|
3319
|
+
} | {
|
|
3320
|
+
gte: number | string
|
|
3321
|
+
} | {
|
|
3322
|
+
in: string | number[]
|
|
3323
|
+
} | {
|
|
3324
|
+
between: string
|
|
3325
|
+
} | {
|
|
3326
|
+
exists: boolean
|
|
3327
|
+
}
|
|
3328
|
+
```
|
|
3329
|
+
|
|
3330
|
+
### `OrderedConditionOperand`
|
|
3331
|
+
|
|
3332
|
+
A number, or a date as an RFC 3339 date or date-time.
|
|
3333
|
+
|
|
3334
|
+
```ts
|
|
3335
|
+
type OrderedConditionOperand = number | string
|
|
3167
3336
|
```
|
|
3168
3337
|
|
|
3169
3338
|
### `VariantValues`
|
|
@@ -3453,7 +3622,13 @@ type DeletedVariantVersion = {
|
|
|
3453
3622
|
type AppendVersionRequest = {
|
|
3454
3623
|
valid_from?: string
|
|
3455
3624
|
values: Record<string, unknown>
|
|
3456
|
-
conditions?: Record<string,
|
|
3625
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3626
|
+
from?: string
|
|
3627
|
+
until?: string
|
|
3628
|
+
} | {
|
|
3629
|
+
postal_code: string
|
|
3630
|
+
city: string
|
|
3631
|
+
}>
|
|
3457
3632
|
}
|
|
3458
3633
|
```
|
|
3459
3634
|
|
|
@@ -3464,7 +3639,13 @@ type ReplaceVersionRequest = {
|
|
|
3464
3639
|
values: Record<string, unknown>
|
|
3465
3640
|
_revision: number
|
|
3466
3641
|
valid_from?: string
|
|
3467
|
-
conditions?: Record<string,
|
|
3642
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3643
|
+
from?: string
|
|
3644
|
+
until?: string
|
|
3645
|
+
} | {
|
|
3646
|
+
postal_code: string
|
|
3647
|
+
city: string
|
|
3648
|
+
}>
|
|
3468
3649
|
}
|
|
3469
3650
|
```
|
|
3470
3651
|
|
|
@@ -3475,7 +3656,13 @@ type PatchVersionRequest = {
|
|
|
3475
3656
|
values: Record<string, unknown>
|
|
3476
3657
|
_revision: number
|
|
3477
3658
|
valid_from?: string
|
|
3478
|
-
conditions?: Record<string,
|
|
3659
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3660
|
+
from?: string
|
|
3661
|
+
until?: string
|
|
3662
|
+
} | {
|
|
3663
|
+
postal_code: string
|
|
3664
|
+
city: string
|
|
3665
|
+
}>
|
|
3479
3666
|
}
|
|
3480
3667
|
```
|
|
3481
3668
|
|
|
@@ -3488,7 +3675,24 @@ first ten variants in `variant_id` order, but the body itself is required. `cond
|
|
|
3488
3675
|
|
|
3489
3676
|
```ts
|
|
3490
3677
|
type ListVariantsRequest = {
|
|
3491
|
-
conditions?: Record<string,
|
|
3678
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3679
|
+
postal_code: string
|
|
3680
|
+
city: string
|
|
3681
|
+
} | {
|
|
3682
|
+
lt: number | string
|
|
3683
|
+
} | {
|
|
3684
|
+
lte: number | string
|
|
3685
|
+
} | {
|
|
3686
|
+
gt: number | string
|
|
3687
|
+
} | {
|
|
3688
|
+
gte: number | string
|
|
3689
|
+
} | {
|
|
3690
|
+
in: string | number[]
|
|
3691
|
+
} | {
|
|
3692
|
+
between: string
|
|
3693
|
+
} | {
|
|
3694
|
+
exists: boolean
|
|
3695
|
+
}>
|
|
3492
3696
|
search?: string
|
|
3493
3697
|
sort?: string
|
|
3494
3698
|
from?: number
|
|
@@ -3505,7 +3709,24 @@ The variants list's request plus `as_of`, the instant each row's version is sele
|
|
|
3505
3709
|
|
|
3506
3710
|
```ts
|
|
3507
3711
|
type VariantTreeRequest = {
|
|
3508
|
-
conditions?: Record<string,
|
|
3712
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3713
|
+
postal_code: string
|
|
3714
|
+
city: string
|
|
3715
|
+
} | {
|
|
3716
|
+
lt: number | string
|
|
3717
|
+
} | {
|
|
3718
|
+
lte: number | string
|
|
3719
|
+
} | {
|
|
3720
|
+
gt: number | string
|
|
3721
|
+
} | {
|
|
3722
|
+
gte: number | string
|
|
3723
|
+
} | {
|
|
3724
|
+
in: string | number[]
|
|
3725
|
+
} | {
|
|
3726
|
+
between: string
|
|
3727
|
+
} | {
|
|
3728
|
+
exists: boolean
|
|
3729
|
+
}>
|
|
3509
3730
|
search?: string
|
|
3510
3731
|
sort?: string
|
|
3511
3732
|
from?: number
|
|
@@ -3524,7 +3745,24 @@ filtered on. An `in` list carries at most 50,000 values.
|
|
|
3524
3745
|
A variant matches only where it pins the condition — unlike `:re
|
|
3525
3746
|
|
|
3526
3747
|
```ts
|
|
3527
|
-
type VariantConditionFilter = Record<string,
|
|
3748
|
+
type VariantConditionFilter = Record<string, string | number | boolean | {
|
|
3749
|
+
postal_code: string
|
|
3750
|
+
city: string
|
|
3751
|
+
} | {
|
|
3752
|
+
lt: number | string
|
|
3753
|
+
} | {
|
|
3754
|
+
lte: number | string
|
|
3755
|
+
} | {
|
|
3756
|
+
gt: number | string
|
|
3757
|
+
} | {
|
|
3758
|
+
gte: number | string
|
|
3759
|
+
} | {
|
|
3760
|
+
in: string | number[]
|
|
3761
|
+
} | {
|
|
3762
|
+
between: string
|
|
3763
|
+
} | {
|
|
3764
|
+
exists: boolean
|
|
3765
|
+
}>
|
|
3528
3766
|
```
|
|
3529
3767
|
|
|
3530
3768
|
### `VariantList`
|
|
@@ -3677,7 +3915,13 @@ type BatchUpsertVariantsRequest = {
|
|
|
3677
3915
|
correlation_id?: string
|
|
3678
3916
|
items: Array<{
|
|
3679
3917
|
entity_id: string
|
|
3680
|
-
conditions?: Record<string,
|
|
3918
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3919
|
+
from?: { ... }
|
|
3920
|
+
until?: { ... }
|
|
3921
|
+
} | {
|
|
3922
|
+
postal_code: { ... }
|
|
3923
|
+
city: { ... }
|
|
3924
|
+
}>
|
|
3681
3925
|
default?: boolean
|
|
3682
3926
|
valid_from?: string
|
|
3683
3927
|
values: Record<string, unknown>
|
|
@@ -3694,7 +3938,13 @@ existing condition tuple appends a version to the variant holding it rather than
|
|
|
3694
3938
|
```ts
|
|
3695
3939
|
type BatchUpsertItem = {
|
|
3696
3940
|
entity_id: string
|
|
3697
|
-
conditions?: Record<string,
|
|
3941
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3942
|
+
from?: string
|
|
3943
|
+
until?: string
|
|
3944
|
+
} | {
|
|
3945
|
+
postal_code: string
|
|
3946
|
+
city: string
|
|
3947
|
+
}>
|
|
3698
3948
|
default?: boolean
|
|
3699
3949
|
valid_from?: string
|
|
3700
3950
|
values: Record<string, unknown>
|
|
@@ -3714,7 +3964,13 @@ type BatchDeleteVariantsRequest = {
|
|
|
3714
3964
|
valid_from?: string
|
|
3715
3965
|
} | {
|
|
3716
3966
|
entity_id: string
|
|
3717
|
-
conditions?: Record<string,
|
|
3967
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3968
|
+
from?: { ... }
|
|
3969
|
+
until?: { ... }
|
|
3970
|
+
} | {
|
|
3971
|
+
postal_code: { ... }
|
|
3972
|
+
city: { ... }
|
|
3973
|
+
}>
|
|
3718
3974
|
default?: boolean
|
|
3719
3975
|
valid_from?: string
|
|
3720
3976
|
}>
|
|
@@ -3735,7 +3991,13 @@ type BatchDeleteItem = {
|
|
|
3735
3991
|
valid_from?: string
|
|
3736
3992
|
} | {
|
|
3737
3993
|
entity_id: string
|
|
3738
|
-
conditions?: Record<string,
|
|
3994
|
+
conditions?: Record<string, string | number | boolean | {
|
|
3995
|
+
from?: string
|
|
3996
|
+
until?: string
|
|
3997
|
+
} | {
|
|
3998
|
+
postal_code: string
|
|
3999
|
+
city: string
|
|
4000
|
+
}>
|
|
3739
4001
|
default?: boolean
|
|
3740
4002
|
valid_from?: string
|
|
3741
4003
|
}
|
|
@@ -3764,7 +4026,13 @@ per-item `VARIANT_UNPINNED`, and one marking `default` besi
|
|
|
3764
4026
|
```ts
|
|
3765
4027
|
type BatchDeleteByConditions = {
|
|
3766
4028
|
entity_id: string
|
|
3767
|
-
conditions?: Record<string,
|
|
4029
|
+
conditions?: Record<string, string | number | boolean | {
|
|
4030
|
+
from?: string
|
|
4031
|
+
until?: string
|
|
4032
|
+
} | {
|
|
4033
|
+
postal_code: string
|
|
4034
|
+
city: string
|
|
4035
|
+
}>
|
|
3768
4036
|
default?: boolean
|
|
3769
4037
|
valid_from?: string
|
|
3770
4038
|
}
|
|
@@ -4982,9 +5250,60 @@ type ResolveCatalogRequest = {
|
|
|
4982
5250
|
price_id?: string
|
|
4983
5251
|
}>
|
|
4984
5252
|
context: {
|
|
4985
|
-
product?: Record<string,
|
|
4986
|
-
|
|
4987
|
-
|
|
5253
|
+
product?: Record<string, string | number | boolean | {
|
|
5254
|
+
postal_code: { ... }
|
|
5255
|
+
city: { ... }
|
|
5256
|
+
} | {
|
|
5257
|
+
lt: { ... }
|
|
5258
|
+
} | {
|
|
5259
|
+
lte: { ... }
|
|
5260
|
+
} | {
|
|
5261
|
+
gt: { ... }
|
|
5262
|
+
} | {
|
|
5263
|
+
gte: { ... }
|
|
5264
|
+
} | {
|
|
5265
|
+
in: { ... }
|
|
5266
|
+
} | {
|
|
5267
|
+
between: { ... }
|
|
5268
|
+
} | {
|
|
5269
|
+
exists: { ... }
|
|
5270
|
+
}>
|
|
5271
|
+
price?: Record<string, string | number | boolean | {
|
|
5272
|
+
postal_code: { ... }
|
|
5273
|
+
city: { ... }
|
|
5274
|
+
} | {
|
|
5275
|
+
lt: { ... }
|
|
5276
|
+
} | {
|
|
5277
|
+
lte: { ... }
|
|
5278
|
+
} | {
|
|
5279
|
+
gt: { ... }
|
|
5280
|
+
} | {
|
|
5281
|
+
gte: { ... }
|
|
5282
|
+
} | {
|
|
5283
|
+
in: { ... }
|
|
5284
|
+
} | {
|
|
5285
|
+
between: { ... }
|
|
5286
|
+
} | {
|
|
5287
|
+
exists: { ... }
|
|
5288
|
+
}>
|
|
5289
|
+
coupon?: Record<string, string | number | boolean | {
|
|
5290
|
+
postal_code: { ... }
|
|
5291
|
+
city: { ... }
|
|
5292
|
+
} | {
|
|
5293
|
+
lt: { ... }
|
|
5294
|
+
} | {
|
|
5295
|
+
lte: { ... }
|
|
5296
|
+
} | {
|
|
5297
|
+
gt: { ... }
|
|
5298
|
+
} | {
|
|
5299
|
+
gte: { ... }
|
|
5300
|
+
} | {
|
|
5301
|
+
in: { ... }
|
|
5302
|
+
} | {
|
|
5303
|
+
between: { ... }
|
|
5304
|
+
} | {
|
|
5305
|
+
exists: { ... }
|
|
5306
|
+
}>
|
|
4988
5307
|
}
|
|
4989
5308
|
as_of?: string
|
|
4990
5309
|
}
|
|
@@ -4993,15 +5312,66 @@ type ResolveCatalogRequest = {
|
|
|
4993
5312
|
### `CatalogContext`
|
|
4994
5313
|
|
|
4995
5314
|
One context per entity type, each the authenticated resolve's context and checked against
|
|
4996
|
-
that type's schema alone. A product resolves against `product`, a price and each of a
|
|
4997
|
-
composite's components against `price
|
|
4998
|
-
|
|
5315
|
+
that type's schema alone. A product resolves against `product`, and a price and each of a
|
|
5316
|
+
composite's components against `price`. A type left out resolves against an empty context,
|
|
5317
|
+
which serves the `default` va
|
|
4999
5318
|
|
|
5000
5319
|
```ts
|
|
5001
5320
|
type CatalogContext = {
|
|
5002
|
-
product?: Record<string,
|
|
5003
|
-
|
|
5004
|
-
|
|
5321
|
+
product?: Record<string, string | number | boolean | {
|
|
5322
|
+
postal_code: string
|
|
5323
|
+
city: string
|
|
5324
|
+
} | {
|
|
5325
|
+
lt: number | string
|
|
5326
|
+
} | {
|
|
5327
|
+
lte: number | string
|
|
5328
|
+
} | {
|
|
5329
|
+
gt: number | string
|
|
5330
|
+
} | {
|
|
5331
|
+
gte: number | string
|
|
5332
|
+
} | {
|
|
5333
|
+
in: string | number[]
|
|
5334
|
+
} | {
|
|
5335
|
+
between: string
|
|
5336
|
+
} | {
|
|
5337
|
+
exists: boolean
|
|
5338
|
+
}>
|
|
5339
|
+
price?: Record<string, string | number | boolean | {
|
|
5340
|
+
postal_code: string
|
|
5341
|
+
city: string
|
|
5342
|
+
} | {
|
|
5343
|
+
lt: number | string
|
|
5344
|
+
} | {
|
|
5345
|
+
lte: number | string
|
|
5346
|
+
} | {
|
|
5347
|
+
gt: number | string
|
|
5348
|
+
} | {
|
|
5349
|
+
gte: number | string
|
|
5350
|
+
} | {
|
|
5351
|
+
in: string | number[]
|
|
5352
|
+
} | {
|
|
5353
|
+
between: string
|
|
5354
|
+
} | {
|
|
5355
|
+
exists: boolean
|
|
5356
|
+
}>
|
|
5357
|
+
coupon?: Record<string, string | number | boolean | {
|
|
5358
|
+
postal_code: string
|
|
5359
|
+
city: string
|
|
5360
|
+
} | {
|
|
5361
|
+
lt: number | string
|
|
5362
|
+
} | {
|
|
5363
|
+
lte: number | string
|
|
5364
|
+
} | {
|
|
5365
|
+
gt: number | string
|
|
5366
|
+
} | {
|
|
5367
|
+
gte: number | string
|
|
5368
|
+
} | {
|
|
5369
|
+
in: string | number[]
|
|
5370
|
+
} | {
|
|
5371
|
+
between: string
|
|
5372
|
+
} | {
|
|
5373
|
+
exists: boolean
|
|
5374
|
+
}>
|
|
5005
5375
|
}
|
|
5006
5376
|
```
|
|
5007
5377
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/sdk",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.52",
|
|
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/event-catalog.cjs"
|
|
166
166
|
},
|
|
167
167
|
"./event-catalog/openapi.json": "./definitions/event-catalog.json",
|
|
168
|
+
"./external-values": {
|
|
169
|
+
"types": "./dist/apis/external-values.d.ts",
|
|
170
|
+
"import": "./dist/apis/external-values.js",
|
|
171
|
+
"require": "./dist/apis/external-values.cjs"
|
|
172
|
+
},
|
|
173
|
+
"./external-values/openapi.json": "./definitions/external-values.json",
|
|
168
174
|
"./file": {
|
|
169
175
|
"types": "./dist/apis/file.d.ts",
|
|
170
176
|
"import": "./dist/apis/file.js",
|
|
@@ -448,6 +454,9 @@
|
|
|
448
454
|
"event-catalog": [
|
|
449
455
|
"./dist/apis/event-catalog.d.ts"
|
|
450
456
|
],
|
|
457
|
+
"external-values": [
|
|
458
|
+
"./dist/apis/external-values.d.ts"
|
|
459
|
+
],
|
|
451
460
|
"file": [
|
|
452
461
|
"./dist/apis/file.d.ts"
|
|
453
462
|
],
|
package/dist/README-OSHX3IVR.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.chat` | `@epilot/sdk/chat` | [docs](./docs/chat.md) |\n| `epilot.configurationHub` | `@epilot/sdk/configuration-hub` | [docs](./docs/configuration-hub.md) |\n| `epilot.consent` | `@epilot/sdk/consent` | [docs](./docs/consent.md) |\n| `epilot.customerPortal` | `@epilot/sdk/customer-portal` | [docs](./docs/customer-portal.md) |\n| `epilot.dashboard` | `@epilot/sdk/dashboard` | [docs](./docs/dashboard.md) |\n| `epilot.dataGovernance` | `@epilot/sdk/data-governance` | [docs](./docs/data-governance.md) |\n| `epilot.deduplication` | `@epilot/sdk/deduplication` | [docs](./docs/deduplication.md) |\n| `epilot.design` | `@epilot/sdk/design` | [docs](./docs/design.md) |\n| `epilot.document` | `@epilot/sdk/document` | [docs](./docs/document.md) |\n| `epilot.emailSettings` | `@epilot/sdk/email-settings` | [docs](./docs/email-settings.md) |\n| `epilot.emailTemplate` | `@epilot/sdk/email-template` | [docs](./docs/email-template.md) |\n| `epilot.entity` | `@epilot/sdk/entity` | [docs](./docs/entity.md) |\n| `epilot.entityMapping` | `@epilot/sdk/entity-mapping` | [docs](./docs/entity-mapping.md) |\n| `epilot.environments` | `@epilot/sdk/environments` | [docs](./docs/environments.md) |\n| `epilot.eventCatalog` | `@epilot/sdk/event-catalog` | [docs](./docs/event-catalog.md) |\n| `epilot.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |\n| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.md) |\n| `epilot.identity` | `@epilot/sdk/identity` | [docs](./docs/identity.md) |\n| `epilot.integrationToolkit` | `@epilot/sdk/integration-toolkit` | [docs](./docs/integration-toolkit.md) |\n| `epilot.journey` | `@epilot/sdk/journey` | [docs](./docs/journey.md) |\n| `epilot.kanban` | `@epilot/sdk/kanban` | [docs](./docs/kanban.md) |\n| `epilot.message` | `@epilot/sdk/message` | [docs](./docs/message.md) |\n| `epilot.metering` | `@epilot/sdk/metering` | [docs](./docs/metering.md) |\n| `epilot.notes` | `@epilot/sdk/notes` | [docs](./docs/notes.md) |\n| `epilot.notification` | `@epilot/sdk/notification` | [docs](./docs/notification.md) |\n| `epilot.organization` | `@epilot/sdk/organization` | [docs](./docs/organization.md) |\n| `epilot.partnerDirectory` | `@epilot/sdk/partner-directory` | [docs](./docs/partner-directory.md) |\n| `epilot.permissions` | `@epilot/sdk/permissions` | [docs](./docs/permissions.md) |\n| `epilot.pricing` | `@epilot/sdk/pricing` | [docs](./docs/pricing.md) |\n| `epilot.pricingTier` | `@epilot/sdk/pricing-tier` | [docs](./docs/pricing-tier.md) |\n| `epilot.purpose` | `@epilot/sdk/purpose` | [docs](./docs/purpose.md) |\n| `epilot.query` | `@epilot/sdk/query` | [docs](./docs/query.md) |\n| `epilot.sandbox` | `@epilot/sdk/sandbox` | [docs](./docs/sandbox.md) |\n| `epilot.sharing` | `@epilot/sdk/sharing` | [docs](./docs/sharing.md) |\n| `epilot.snapshot` | `@epilot/sdk/snapshot` | [docs](./docs/snapshot.md) |\n| `epilot.submission` | `@epilot/sdk/submission` | [docs](./docs/submission.md) |\n| `epilot.targeting` | `@epilot/sdk/targeting` | [docs](./docs/targeting.md) |\n| `epilot.templateVariables` | `@epilot/sdk/template-variables` | [docs](./docs/template-variables.md) |\n| `epilot.user` | `@epilot/sdk/user` | [docs](./docs/user.md) |\n| `epilot.validationRules` | `@epilot/sdk/validation-rules` | [docs](./docs/validation-rules.md) |\n| `epilot.webhooks` | `@epilot/sdk/webhooks` | [docs](./docs/webhooks.md) |\n| `epilot.workflow` | `@epilot/sdk/workflow` | [docs](./docs/workflow.md) |\n| `epilot.workflowDefinition` | `@epilot/sdk/workflow-definition` | [docs](./docs/workflow-definition.md) |\n<!-- /api-reference-table -->\n\n## OpenAPI Spec\n\nRetrieve the full OpenAPI specification for any API at runtime. The spec is lazy-loaded on first call and cached.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Via API handle\nconst entitySpec = await epilot.entity.openapi()\nconsole.log(entitySpec.info.title) // \"Entity API\"\nconsole.log(entitySpec.paths) // all paths with full schemas\n\n// Via top-level method\nconst spec = await epilot.openapi('entity')\n```\n\nFor tree-shakeable imports:\n\n```ts\nimport { openapi } from '@epilot/sdk/entity'\n\nconst spec = await openapi()\n```\n\n## Explicit Client Access\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\n\n// Get the cached singleton client\nconst entityClient = epilot.entity.getClient()\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Create a fresh (non-singleton) client instance\nconst freshClient = epilot.entity.createClient()\nauthorize(freshClient, () => '<my-token>')\n```\n\n## Tree-Shakeable Imports\n\nImport only what you need. Other APIs never touch your bundle.\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Or use the handle for direct operation forwarding\nimport { entity } from '@epilot/sdk/entity'\nconst { data } = await entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n## Types\n\nEach API subpath re-exports all schema types generated from the OpenAPI spec. Import them directly:\n\n```ts\nimport type { Entity, EntitySchema, RelationAttribute } from '@epilot/sdk/entity'\nimport type { FileItem } from '@epilot/sdk/file'\nimport type { AutomationFlow } from '@epilot/sdk/automation'\n```\n\nThe `Client`, `OperationMethods`, and `PathsDictionary` types are also available for typing client instances:\n\n```ts\nimport type { Client } from '@epilot/sdk/entity'\n\nconst entityClient: Client = epilot.entity.getClient()\n```\n\n## Headers\n\n### Global Headers\n\nSet default headers applied to all clients. Useful for `x-epilot-org-id`, `x-epilot-user-id`, etc.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.headers({\n 'x-epilot-org-id': 'org-123',\n 'x-epilot-user-id': 'user-456',\n})\n\nconst { data } = await epilot.entity.searchEntities(...)\n```\n\n### Standard Axios Headers\n\nUse standard axios `defaults.headers.common` on individual clients:\n\n```ts\nconst entityClient = epilot.entity.getClient()\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Auth Patterns\n\n`authorize()` accepts a string or a function. The function form is preferred \u2014 it is called on every request, so tokens stay fresh.\n\n```ts\nimport { authorize } from '@epilot/sdk'\nimport { getClient } from '@epilot/sdk/entity'\n\n// Per-client \u2014 function predicate (recommended)\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\n// Per-client \u2014 async function (e.g. OAuth / session)\nauthorize(entityClient, async () => {\n return await getTokenFromSession()\n})\n\n// Per-client \u2014 static string (sets default header once)\nauthorize(entityClient, 'my-static-api-token')\n```\n\n```ts\n// Global \u2014 applies to all clients resolved from the SDK\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.authorize(async () => await getTokenFromSession())\nepilot.authorize('my-static-api-token')\n```\n\n## Fresh Client Instance\n\n```ts\nimport { createClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = createClient()\nauthorize(entityClient, () => '<my-token>')\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Multiple SDK Instances\n\n```ts\nimport { createSDK } from '@epilot/sdk'\n\nconst sdk1 = createSDK()\nsdk1.authorize(() => '<token-for-org-1>')\nsdk1.headers({ 'x-epilot-org-id': 'org-1' })\n\nconst sdk2 = createSDK()\nsdk2.authorize(() => '<token-for-org-2>')\nsdk2.headers({ 'x-epilot-org-id': 'org-2' })\n```\n\n\n## Interceptors\n\nUse axios interceptors for custom request/response processing. Since clients are axios instances, you can use `client.interceptors` directly:\n\n```ts\nentityClient.interceptors.response.use((response) => {\n console.debug(`${response.config.method?.toUpperCase()} ${response.config.url}`, {\n status: response.status,\n data: response.data,\n })\n return response\n})\n```\n\nOr register global interceptors applied to all clients:\n\n```ts\nepilot.interceptors.request((config) => {\n config.headers['x-correlation-id'] = generateTraceId()\n return config\n})\n```\n\n## Auto-Retry (429 Too Many Requests)\n\nThe SDK automatically retries requests that receive a `429 Too Many Requests` response. It respects the `Retry-After` header (in seconds) to determine how long to wait before retrying.\n\nEnabled by default with up to 3 retries.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Customize retry behavior\nepilot.retry({ maxRetries: 5, defaultDelayMs: 2000 })\n\n// Disable retries\nepilot.retry({ maxRetries: 0 })\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `maxRetries` | `3` | Maximum number of retries. Set to `0` to disable. |\n| `defaultDelayMs` | `1000` | Fallback delay in ms when `Retry-After` header is missing. |\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyRetryInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyRetryInterceptor({ client: entityClient, config: { maxRetries: 3 } })\n```\n\n## Large Response Handling (413 Payload Too Large)\n\nepilot APIs use a [large response middleware](https://github.com/epilot-dev/aws-lambda-utility-middlewares) to work around the AWS Lambda 6MB response limit. When a response exceeds ~5.1MB, the API uploads the payload to S3 and returns a presigned URL instead.\n\nThe SDK handles this transparently \u2014 it sends the opt-in `Accept` header and automatically fetches the full payload from S3 when a large response URL is returned. Enabled by default.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Disable large response handling\nepilot.largeResponse({ enabled: false })\n```\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyLargeResponseInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyLargeResponseInterceptor({ client: entityClient, config: { enabled: true } })\n```\n\n## Overrides & Custom APIs\n\nOverride built-in API specs or register custom APIs via `.epilot/sdk-overrides.json`. This is useful for testing new versions of an API spec or getting the latest types without waiting for an SDK release.\n\n```json\n{\n \"entity\": \"./specs/entity-openapi.json\",\n \"myNewApi\": \"./specs/my-new-api-openapi.json\"\n}\n```\n\n```ts\n// Built-in API with overridden spec\nconst { data } = await epilot.entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n### Override Commands\n\n```bash\n# Apply all overrides from .epilot/sdk-overrides.json\nnpx epilot-sdk override\n\n# Override a single API\nnpx epilot-sdk override entity ./my-local-entity-spec.yaml\n\n# Regenerate types after spec changes\nnpx epilot-sdk typegen\n```\n\n<details>\n<summary>Migration from <code>@epilot/*-client</code></summary>\n\nDrop-in replacement \u2014 just change the import path:\n\n```ts\n// Before\nimport { getClient, createClient, authorize } from '@epilot/entity-client'\nimport type { Client, Entity } from '@epilot/entity-client'\n\n// After\nimport { getClient, createClient, authorize } from '@epilot/sdk/entity'\nimport type { Client, Entity } from '@epilot/sdk/entity'\n```\n\n</details>\n\n<details>\n<summary>Client Lifecycle</summary>\n\nWhen you call `authorize()`, `headers()`, `retry()`, `largeResponse()`, or `interceptors`, the SDK invalidates all cached client instances. The next operation call creates a fresh client with the updated configuration.\n\n**Operation methods are always up to date** \u2014 calls like `epilot.entity.getEntity(...)` re-resolve the client on every invocation, so they always use the latest config.\n\n**Direct `getClient()` references can go stale** \u2014 if you hold a reference and then change config, your reference still points to the old client:\n\n```ts\nconst entityClient = epilot.entity.getClient()\n\nepilot.authorize('new-token') // invalidates all cached clients\n\n// entityClient still has the old token\n// epilot.entity.getEntity(...) will use a new client with the new token\n```\n\nIf you need a long-lived reference that survives config changes, call `getClient()` again after changing config, or use operation methods directly.\n\n</details>\n";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = README_default;
|
package/dist/README-ZSJDIPZZ.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.chat` | `@epilot/sdk/chat` | [docs](./docs/chat.md) |\n| `epilot.configurationHub` | `@epilot/sdk/configuration-hub` | [docs](./docs/configuration-hub.md) |\n| `epilot.consent` | `@epilot/sdk/consent` | [docs](./docs/consent.md) |\n| `epilot.customerPortal` | `@epilot/sdk/customer-portal` | [docs](./docs/customer-portal.md) |\n| `epilot.dashboard` | `@epilot/sdk/dashboard` | [docs](./docs/dashboard.md) |\n| `epilot.dataGovernance` | `@epilot/sdk/data-governance` | [docs](./docs/data-governance.md) |\n| `epilot.deduplication` | `@epilot/sdk/deduplication` | [docs](./docs/deduplication.md) |\n| `epilot.design` | `@epilot/sdk/design` | [docs](./docs/design.md) |\n| `epilot.document` | `@epilot/sdk/document` | [docs](./docs/document.md) |\n| `epilot.emailSettings` | `@epilot/sdk/email-settings` | [docs](./docs/email-settings.md) |\n| `epilot.emailTemplate` | `@epilot/sdk/email-template` | [docs](./docs/email-template.md) |\n| `epilot.entity` | `@epilot/sdk/entity` | [docs](./docs/entity.md) |\n| `epilot.entityMapping` | `@epilot/sdk/entity-mapping` | [docs](./docs/entity-mapping.md) |\n| `epilot.environments` | `@epilot/sdk/environments` | [docs](./docs/environments.md) |\n| `epilot.eventCatalog` | `@epilot/sdk/event-catalog` | [docs](./docs/event-catalog.md) |\n| `epilot.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |\n| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.md) |\n| `epilot.identity` | `@epilot/sdk/identity` | [docs](./docs/identity.md) |\n| `epilot.integrationToolkit` | `@epilot/sdk/integration-toolkit` | [docs](./docs/integration-toolkit.md) |\n| `epilot.journey` | `@epilot/sdk/journey` | [docs](./docs/journey.md) |\n| `epilot.kanban` | `@epilot/sdk/kanban` | [docs](./docs/kanban.md) |\n| `epilot.message` | `@epilot/sdk/message` | [docs](./docs/message.md) |\n| `epilot.metering` | `@epilot/sdk/metering` | [docs](./docs/metering.md) |\n| `epilot.notes` | `@epilot/sdk/notes` | [docs](./docs/notes.md) |\n| `epilot.notification` | `@epilot/sdk/notification` | [docs](./docs/notification.md) |\n| `epilot.organization` | `@epilot/sdk/organization` | [docs](./docs/organization.md) |\n| `epilot.partnerDirectory` | `@epilot/sdk/partner-directory` | [docs](./docs/partner-directory.md) |\n| `epilot.permissions` | `@epilot/sdk/permissions` | [docs](./docs/permissions.md) |\n| `epilot.pricing` | `@epilot/sdk/pricing` | [docs](./docs/pricing.md) |\n| `epilot.pricingTier` | `@epilot/sdk/pricing-tier` | [docs](./docs/pricing-tier.md) |\n| `epilot.purpose` | `@epilot/sdk/purpose` | [docs](./docs/purpose.md) |\n| `epilot.query` | `@epilot/sdk/query` | [docs](./docs/query.md) |\n| `epilot.sandbox` | `@epilot/sdk/sandbox` | [docs](./docs/sandbox.md) |\n| `epilot.sharing` | `@epilot/sdk/sharing` | [docs](./docs/sharing.md) |\n| `epilot.snapshot` | `@epilot/sdk/snapshot` | [docs](./docs/snapshot.md) |\n| `epilot.submission` | `@epilot/sdk/submission` | [docs](./docs/submission.md) |\n| `epilot.targeting` | `@epilot/sdk/targeting` | [docs](./docs/targeting.md) |\n| `epilot.templateVariables` | `@epilot/sdk/template-variables` | [docs](./docs/template-variables.md) |\n| `epilot.user` | `@epilot/sdk/user` | [docs](./docs/user.md) |\n| `epilot.validationRules` | `@epilot/sdk/validation-rules` | [docs](./docs/validation-rules.md) |\n| `epilot.webhooks` | `@epilot/sdk/webhooks` | [docs](./docs/webhooks.md) |\n| `epilot.workflow` | `@epilot/sdk/workflow` | [docs](./docs/workflow.md) |\n| `epilot.workflowDefinition` | `@epilot/sdk/workflow-definition` | [docs](./docs/workflow-definition.md) |\n<!-- /api-reference-table -->\n\n## OpenAPI Spec\n\nRetrieve the full OpenAPI specification for any API at runtime. The spec is lazy-loaded on first call and cached.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Via API handle\nconst entitySpec = await epilot.entity.openapi()\nconsole.log(entitySpec.info.title) // \"Entity API\"\nconsole.log(entitySpec.paths) // all paths with full schemas\n\n// Via top-level method\nconst spec = await epilot.openapi('entity')\n```\n\nFor tree-shakeable imports:\n\n```ts\nimport { openapi } from '@epilot/sdk/entity'\n\nconst spec = await openapi()\n```\n\n## Explicit Client Access\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\n\n// Get the cached singleton client\nconst entityClient = epilot.entity.getClient()\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Create a fresh (non-singleton) client instance\nconst freshClient = epilot.entity.createClient()\nauthorize(freshClient, () => '<my-token>')\n```\n\n## Tree-Shakeable Imports\n\nImport only what you need. Other APIs never touch your bundle.\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Or use the handle for direct operation forwarding\nimport { entity } from '@epilot/sdk/entity'\nconst { data } = await entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n## Types\n\nEach API subpath re-exports all schema types generated from the OpenAPI spec. Import them directly:\n\n```ts\nimport type { Entity, EntitySchema, RelationAttribute } from '@epilot/sdk/entity'\nimport type { FileItem } from '@epilot/sdk/file'\nimport type { AutomationFlow } from '@epilot/sdk/automation'\n```\n\nThe `Client`, `OperationMethods`, and `PathsDictionary` types are also available for typing client instances:\n\n```ts\nimport type { Client } from '@epilot/sdk/entity'\n\nconst entityClient: Client = epilot.entity.getClient()\n```\n\n## Headers\n\n### Global Headers\n\nSet default headers applied to all clients. Useful for `x-epilot-org-id`, `x-epilot-user-id`, etc.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.headers({\n 'x-epilot-org-id': 'org-123',\n 'x-epilot-user-id': 'user-456',\n})\n\nconst { data } = await epilot.entity.searchEntities(...)\n```\n\n### Standard Axios Headers\n\nUse standard axios `defaults.headers.common` on individual clients:\n\n```ts\nconst entityClient = epilot.entity.getClient()\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Auth Patterns\n\n`authorize()` accepts a string or a function. The function form is preferred \u2014 it is called on every request, so tokens stay fresh.\n\n```ts\nimport { authorize } from '@epilot/sdk'\nimport { getClient } from '@epilot/sdk/entity'\n\n// Per-client \u2014 function predicate (recommended)\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\n// Per-client \u2014 async function (e.g. OAuth / session)\nauthorize(entityClient, async () => {\n return await getTokenFromSession()\n})\n\n// Per-client \u2014 static string (sets default header once)\nauthorize(entityClient, 'my-static-api-token')\n```\n\n```ts\n// Global \u2014 applies to all clients resolved from the SDK\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.authorize(async () => await getTokenFromSession())\nepilot.authorize('my-static-api-token')\n```\n\n## Fresh Client Instance\n\n```ts\nimport { createClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = createClient()\nauthorize(entityClient, () => '<my-token>')\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Multiple SDK Instances\n\n```ts\nimport { createSDK } from '@epilot/sdk'\n\nconst sdk1 = createSDK()\nsdk1.authorize(() => '<token-for-org-1>')\nsdk1.headers({ 'x-epilot-org-id': 'org-1' })\n\nconst sdk2 = createSDK()\nsdk2.authorize(() => '<token-for-org-2>')\nsdk2.headers({ 'x-epilot-org-id': 'org-2' })\n```\n\n\n## Interceptors\n\nUse axios interceptors for custom request/response processing. Since clients are axios instances, you can use `client.interceptors` directly:\n\n```ts\nentityClient.interceptors.response.use((response) => {\n console.debug(`${response.config.method?.toUpperCase()} ${response.config.url}`, {\n status: response.status,\n data: response.data,\n })\n return response\n})\n```\n\nOr register global interceptors applied to all clients:\n\n```ts\nepilot.interceptors.request((config) => {\n config.headers['x-correlation-id'] = generateTraceId()\n return config\n})\n```\n\n## Auto-Retry (429 Too Many Requests)\n\nThe SDK automatically retries requests that receive a `429 Too Many Requests` response. It respects the `Retry-After` header (in seconds) to determine how long to wait before retrying.\n\nEnabled by default with up to 3 retries.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Customize retry behavior\nepilot.retry({ maxRetries: 5, defaultDelayMs: 2000 })\n\n// Disable retries\nepilot.retry({ maxRetries: 0 })\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `maxRetries` | `3` | Maximum number of retries. Set to `0` to disable. |\n| `defaultDelayMs` | `1000` | Fallback delay in ms when `Retry-After` header is missing. |\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyRetryInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyRetryInterceptor({ client: entityClient, config: { maxRetries: 3 } })\n```\n\n## Large Response Handling (413 Payload Too Large)\n\nepilot APIs use a [large response middleware](https://github.com/epilot-dev/aws-lambda-utility-middlewares) to work around the AWS Lambda 6MB response limit. When a response exceeds ~5.1MB, the API uploads the payload to S3 and returns a presigned URL instead.\n\nThe SDK handles this transparently \u2014 it sends the opt-in `Accept` header and automatically fetches the full payload from S3 when a large response URL is returned. Enabled by default.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Disable large response handling\nepilot.largeResponse({ enabled: false })\n```\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyLargeResponseInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyLargeResponseInterceptor({ client: entityClient, config: { enabled: true } })\n```\n\n## Overrides & Custom APIs\n\nOverride built-in API specs or register custom APIs via `.epilot/sdk-overrides.json`. This is useful for testing new versions of an API spec or getting the latest types without waiting for an SDK release.\n\n```json\n{\n \"entity\": \"./specs/entity-openapi.json\",\n \"myNewApi\": \"./specs/my-new-api-openapi.json\"\n}\n```\n\n```ts\n// Built-in API with overridden spec\nconst { data } = await epilot.entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n### Override Commands\n\n```bash\n# Apply all overrides from .epilot/sdk-overrides.json\nnpx epilot-sdk override\n\n# Override a single API\nnpx epilot-sdk override entity ./my-local-entity-spec.yaml\n\n# Regenerate types after spec changes\nnpx epilot-sdk typegen\n```\n\n<details>\n<summary>Migration from <code>@epilot/*-client</code></summary>\n\nDrop-in replacement \u2014 just change the import path:\n\n```ts\n// Before\nimport { getClient, createClient, authorize } from '@epilot/entity-client'\nimport type { Client, Entity } from '@epilot/entity-client'\n\n// After\nimport { getClient, createClient, authorize } from '@epilot/sdk/entity'\nimport type { Client, Entity } from '@epilot/sdk/entity'\n```\n\n</details>\n\n<details>\n<summary>Client Lifecycle</summary>\n\nWhen you call `authorize()`, `headers()`, `retry()`, `largeResponse()`, or `interceptors`, the SDK invalidates all cached client instances. The next operation call creates a fresh client with the updated configuration.\n\n**Operation methods are always up to date** \u2014 calls like `epilot.entity.getEntity(...)` re-resolve the client on every invocation, so they always use the latest config.\n\n**Direct `getClient()` references can go stale** \u2014 if you hold a reference and then change config, your reference still points to the old client:\n\n```ts\nconst entityClient = epilot.entity.getClient()\n\nepilot.authorize('new-token') // invalidates all cached clients\n\n// entityClient still has the old token\n// epilot.entity.getEntity(...) will use a new client with the new token\n```\n\nIf you need a long-lived reference that survives config changes, call `getClient()` again after changing config, or use operation methods directly.\n\n</details>\n";
|
|
5
|
-
export {
|
|
6
|
-
README_default as default
|
|
7
|
-
};
|