@elmohq/sdk 0.0.0-stage → 0.1.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/LICENSE.md +21 -0
- package/README.md +325 -2
- package/dist/calls/index.d.mts +288 -0
- package/dist/calls/index.d.mts.map +1 -0
- package/dist/calls/index.mjs +390 -0
- package/dist/calls/index.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1029 -0
- package/dist/index.mjs.map +1 -0
- package/dist/request-options-DWYI_Ldj.d.mts +1550 -0
- package/dist/request-options-DWYI_Ldj.d.mts.map +1 -0
- package/dist/tools-7Hs5J2xb.d.mts +1945 -0
- package/dist/tools-7Hs5J2xb.d.mts.map +1 -0
- package/dist/tools-SwP0sK8H.mjs +2458 -0
- package/dist/tools-SwP0sK8H.mjs.map +1 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +1 -0
- package/package.json +67 -4
- package/src/calls/brands-analytics-get.ts +33 -0
- package/src/calls/brands-citations-domains-list.ts +36 -0
- package/src/calls/brands-citations-urls-list.ts +32 -0
- package/src/calls/brands-create.ts +19 -0
- package/src/calls/brands-get.ts +19 -0
- package/src/calls/brands-list.ts +18 -0
- package/src/calls/brands-opportunities-get.ts +42 -0
- package/src/calls/brands-prompt-performance-list.ts +39 -0
- package/src/calls/brands-query-fanout-get.ts +30 -0
- package/src/calls/brands-tags-list.ts +28 -0
- package/src/calls/brands-update.ts +20 -0
- package/src/calls/competitors-create.ts +23 -0
- package/src/calls/competitors-delete.ts +19 -0
- package/src/calls/competitors-get.ts +19 -0
- package/src/calls/competitors-list.ts +23 -0
- package/src/calls/competitors-update.ts +24 -0
- package/src/calls/index.ts +33 -0
- package/src/calls/me-get.ts +18 -0
- package/src/calls/models-list.ts +20 -0
- package/src/calls/organizations-billing-get.ts +37 -0
- package/src/calls/organizations-get.ts +24 -0
- package/src/calls/organizations-list.ts +27 -0
- package/src/calls/prompts-create.ts +27 -0
- package/src/calls/prompts-delete.ts +28 -0
- package/src/calls/prompts-get.ts +23 -0
- package/src/calls/prompts-list.ts +28 -0
- package/src/calls/prompts-runs-get.ts +27 -0
- package/src/calls/prompts-runs-list.ts +30 -0
- package/src/calls/prompts-snapshot-get.ts +28 -0
- package/src/calls/prompts-update.ts +29 -0
- package/src/calls/reports-create.ts +31 -0
- package/src/calls/reports-get.ts +27 -0
- package/src/calls/reports-list.ts +28 -0
- package/src/calls/tools-analyze.ts +26 -0
- package/src/client.ts +662 -0
- package/src/index.ts +21 -0
- package/src/internal/binding/rest/binding.ts +127 -0
- package/src/internal/binding/rest/errors.ts +107 -0
- package/src/internal/binding/rest/path.ts +9 -0
- package/src/internal/binding/rest/url.ts +97 -0
- package/src/internal/codec/json.ts +66 -0
- package/src/internal/codec/registry.ts +55 -0
- package/src/internal/core/backoff.ts +170 -0
- package/src/internal/core/body.ts +54 -0
- package/src/internal/core/browser.ts +11 -0
- package/src/internal/core/call-promise.ts +145 -0
- package/src/internal/core/callable.ts +11 -0
- package/src/internal/core/client.ts +89 -0
- package/src/internal/core/config.ts +84 -0
- package/src/internal/core/credentials.ts +40 -0
- package/src/internal/core/dispatch.ts +227 -0
- package/src/internal/core/env.ts +68 -0
- package/src/internal/core/errors.ts +431 -0
- package/src/internal/core/features.ts +60 -0
- package/src/internal/core/lazy-promise.ts +39 -0
- package/src/internal/core/metadata.ts +79 -0
- package/src/internal/core/params.ts +98 -0
- package/src/internal/core/protocol.ts +17 -0
- package/src/internal/core/read-reply.ts +7 -0
- package/src/internal/core/text.ts +7 -0
- package/src/internal/core/types.ts +556 -0
- package/src/internal/feature/auth.ts +201 -0
- package/src/internal/feature/interceptors.ts +36 -0
- package/src/internal/feature/logger.ts +222 -0
- package/src/internal/feature/retry.ts +165 -0
- package/src/internal/feature/rules.ts +54 -0
- package/src/internal/feature/timeout.ts +146 -0
- package/src/internal/feature/validate.ts +74 -0
- package/src/internal/page/page.ts +402 -0
- package/src/internal/transport/fetch.ts +82 -0
- package/src/resources/analytics.ts +363 -0
- package/src/resources/brands.ts +285 -0
- package/src/resources/competitors.ts +212 -0
- package/src/resources/identity.ts +48 -0
- package/src/resources/models.ts +32 -0
- package/src/resources/opportunities.ts +79 -0
- package/src/resources/organizations.ts +181 -0
- package/src/resources/prompts.ts +292 -0
- package/src/resources/reports.ts +211 -0
- package/src/resources/runs.ts +123 -0
- package/src/resources/shared/auth.ts +13 -0
- package/src/resources/shared/request-options.ts +26 -0
- package/src/resources/shared/resource.ts +23 -0
- package/src/resources/shared/rule.ts +25 -0
- package/src/resources/snapshots.ts +54 -0
- package/src/resources/tags.ts +46 -0
- package/src/resources/tools.ts +68 -0
- package/src/types/analytics.ts +497 -0
- package/src/types/brands.ts +228 -0
- package/src/types/competitors.ts +196 -0
- package/src/types/identity.ts +55 -0
- package/src/types/index.ts +163 -0
- package/src/types/models.ts +40 -0
- package/src/types/opportunities.ts +84 -0
- package/src/types/organizations.ts +157 -0
- package/src/types/prompts.ts +231 -0
- package/src/types/reports.ts +266 -0
- package/src/types/runs.ts +131 -0
- package/src/types/shared/brand-id-path.ts +2 -0
- package/src/types/shared/conflict-error.ts +7 -0
- package/src/types/shared/error.ts +29 -0
- package/src/types/shared/limit.ts +8 -0
- package/src/types/shared/mention-entry.ts +21 -0
- package/src/types/shared/model-filter.ts +15 -0
- package/src/types/shared/not-found-error.ts +4 -0
- package/src/types/shared/page.ts +7 -0
- package/src/types/shared/pagination.ts +7 -0
- package/src/types/shared/validation-error.ts +4 -0
- package/src/types/snapshots.ts +88 -0
- package/src/types/tags.ts +47 -0
- package/src/types/tools.ts +78 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import type { ConflictError, PaymentRequiredError } from './shared/conflict-error';
|
|
2
|
+
import type {
|
|
3
|
+
ForbiddenError,
|
|
4
|
+
InternalServerError,
|
|
5
|
+
RateLimitError,
|
|
6
|
+
UnauthorizedError,
|
|
7
|
+
} from './shared/error';
|
|
8
|
+
import type { Limit } from './shared/limit';
|
|
9
|
+
import type { NotFoundError } from './shared/not-found-error';
|
|
10
|
+
import type { Page } from './shared/page';
|
|
11
|
+
import type { Pagination } from './shared/pagination';
|
|
12
|
+
import type { ValidationError } from './shared/validation-error';
|
|
13
|
+
|
|
14
|
+
export type Brand = {
|
|
15
|
+
aliases: Array<string>;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
/** Sampling cadence override in hours. Null means the plan cadence. */
|
|
18
|
+
delayOverrideHours: number | null;
|
|
19
|
+
/**
|
|
20
|
+
* Brand domains. The first entry is the primary website; remaining entries are additional
|
|
21
|
+
* domains.
|
|
22
|
+
*/
|
|
23
|
+
domains: Array<string>;
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
/** Models this brand is tracked on. Null means the deployment default. */
|
|
26
|
+
enabledModels: Array<string> | null;
|
|
27
|
+
/** User-supplied brand identifier (e.g. "acme") */
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
onboarded: boolean;
|
|
31
|
+
/** The organization that owns this brand and is billed for it. */
|
|
32
|
+
organizationId: string;
|
|
33
|
+
updatedAt: Date;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type BrandsList = {
|
|
37
|
+
/**
|
|
38
|
+
* Deprecated: read `data` instead. Kept while the one known consumer migrates, and removed in a
|
|
39
|
+
* future release.
|
|
40
|
+
*
|
|
41
|
+
* @deprecated
|
|
42
|
+
*/
|
|
43
|
+
brands: Array<Brand>;
|
|
44
|
+
/** The items on this page. Read this rather than the named key below. */
|
|
45
|
+
data: Array<Brand>;
|
|
46
|
+
pagination: Pagination;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type ListBrandsErrors = {
|
|
50
|
+
/** Authentication required */
|
|
51
|
+
401: UnauthorizedError;
|
|
52
|
+
/**
|
|
53
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
54
|
+
* read-only (demo) mode.
|
|
55
|
+
*/
|
|
56
|
+
403: ForbiddenError;
|
|
57
|
+
/** Per-key rate limit exceeded. */
|
|
58
|
+
429: RateLimitError;
|
|
59
|
+
/** Internal server error */
|
|
60
|
+
500: InternalServerError;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type ListBrandsResponses = {
|
|
64
|
+
/** Paginated list of brands */
|
|
65
|
+
200: BrandsList;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type CreateBrandErrors = {
|
|
69
|
+
/** Invalid request data */
|
|
70
|
+
400: ValidationError;
|
|
71
|
+
/** Authentication required */
|
|
72
|
+
401: UnauthorizedError;
|
|
73
|
+
/** The organization has no active subscription. Cloud deployments only. */
|
|
74
|
+
402: PaymentRequiredError;
|
|
75
|
+
/**
|
|
76
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
77
|
+
* read-only (demo) mode.
|
|
78
|
+
*/
|
|
79
|
+
403: ForbiddenError;
|
|
80
|
+
/** Resource not found */
|
|
81
|
+
404: NotFoundError;
|
|
82
|
+
/** Resource already exists */
|
|
83
|
+
409: ConflictError;
|
|
84
|
+
/** Per-key rate limit exceeded. */
|
|
85
|
+
429: RateLimitError;
|
|
86
|
+
/** Internal server error */
|
|
87
|
+
500: InternalServerError;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type CreateBrandResponses = {
|
|
91
|
+
/** Brand created */
|
|
92
|
+
201: Brand;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type GetBrandErrors = {
|
|
96
|
+
/** Authentication required */
|
|
97
|
+
401: UnauthorizedError;
|
|
98
|
+
/**
|
|
99
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
100
|
+
* read-only (demo) mode.
|
|
101
|
+
*/
|
|
102
|
+
403: ForbiddenError;
|
|
103
|
+
/** Resource not found */
|
|
104
|
+
404: NotFoundError;
|
|
105
|
+
/** Per-key rate limit exceeded. */
|
|
106
|
+
429: RateLimitError;
|
|
107
|
+
/** Internal server error */
|
|
108
|
+
500: InternalServerError;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export type GetBrandResponses = {
|
|
112
|
+
/** Brand */
|
|
113
|
+
200: Brand;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export type UpdateBrandErrors = {
|
|
117
|
+
/** Invalid request data */
|
|
118
|
+
400: ValidationError;
|
|
119
|
+
/** Authentication required */
|
|
120
|
+
401: UnauthorizedError;
|
|
121
|
+
/** The organization has no active subscription. Cloud deployments only. */
|
|
122
|
+
402: PaymentRequiredError;
|
|
123
|
+
/**
|
|
124
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
125
|
+
* read-only (demo) mode.
|
|
126
|
+
*/
|
|
127
|
+
403: ForbiddenError;
|
|
128
|
+
/** Resource not found */
|
|
129
|
+
404: NotFoundError;
|
|
130
|
+
/** Resource already exists */
|
|
131
|
+
409: ConflictError;
|
|
132
|
+
/** Per-key rate limit exceeded. */
|
|
133
|
+
429: RateLimitError;
|
|
134
|
+
/** Internal server error */
|
|
135
|
+
500: InternalServerError;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export type UpdateBrandResponses = {
|
|
139
|
+
/** Brand updated */
|
|
140
|
+
200: Brand;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export type ListBrandsParams = {
|
|
144
|
+
/**
|
|
145
|
+
* Page number, 1-based.
|
|
146
|
+
*
|
|
147
|
+
* @default 1
|
|
148
|
+
* @minimum 1
|
|
149
|
+
*/
|
|
150
|
+
page?: Page;
|
|
151
|
+
/**
|
|
152
|
+
* Items per page. Values above the maximum are clamped, not rejected.
|
|
153
|
+
*
|
|
154
|
+
* @default 20
|
|
155
|
+
* @minimum 1
|
|
156
|
+
* @maximum 100
|
|
157
|
+
*/
|
|
158
|
+
limit?: Limit;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary
|
|
163
|
+
* website; the rest are stored as additional domains.
|
|
164
|
+
*/
|
|
165
|
+
export type CreateBrandParams = {
|
|
166
|
+
/** @minLength 1 */
|
|
167
|
+
id: string;
|
|
168
|
+
/** @minLength 1 */
|
|
169
|
+
name: string;
|
|
170
|
+
/**
|
|
171
|
+
* Brand domains. The first entry is the primary website; remaining entries are additional
|
|
172
|
+
* domains.
|
|
173
|
+
*
|
|
174
|
+
* @minItems 1
|
|
175
|
+
*/
|
|
176
|
+
domains: Array<string>;
|
|
177
|
+
aliases?: Array<string>;
|
|
178
|
+
competitors?: Array<{
|
|
179
|
+
aliases?: Array<string>;
|
|
180
|
+
domains?: Array<string>;
|
|
181
|
+
/** @minLength 1 */
|
|
182
|
+
name: string;
|
|
183
|
+
}>;
|
|
184
|
+
prompts?: Array<{
|
|
185
|
+
/** @default true */
|
|
186
|
+
enabled?: boolean;
|
|
187
|
+
tags?: Array<string>;
|
|
188
|
+
/** @minLength 1 */
|
|
189
|
+
value: string;
|
|
190
|
+
}>;
|
|
191
|
+
/**
|
|
192
|
+
* Organization to create the brand in.
|
|
193
|
+
*
|
|
194
|
+
* | | Omitted | Present |
|
|
195
|
+
* | --- | --- | --- |
|
|
196
|
+
* | **Organization key** | creates in the key's own organization | must name the key's own organization; any other value is a `400` |
|
|
197
|
+
* | **Admin key** | provisions a new organization named after the brand id | creates in the named organization, which must already exist — `404` if it does not |
|
|
198
|
+
*
|
|
199
|
+
* An admin key omitting this field is currently the only way to create an organization over the
|
|
200
|
+
* API.
|
|
201
|
+
*/
|
|
202
|
+
organizationId?: string;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Update brand-level fields. At least one field must be provided. Provided arrays replace the
|
|
207
|
+
* stored values verbatim. When `domains` is provided, the first entry becomes the primary website
|
|
208
|
+
* and the rest become additional domains. Prompts and competitors are managed via /prompts and
|
|
209
|
+
* /competitors.
|
|
210
|
+
*/
|
|
211
|
+
export type UpdateBrandParams = {
|
|
212
|
+
/** @minLength 1 */
|
|
213
|
+
brandName?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Brand domains. The first entry is the primary website; remaining entries are additional
|
|
216
|
+
* domains.
|
|
217
|
+
*
|
|
218
|
+
* @minItems 1
|
|
219
|
+
*/
|
|
220
|
+
domains?: Array<string>;
|
|
221
|
+
aliases?: Array<string>;
|
|
222
|
+
/**
|
|
223
|
+
* Whether the brand is sampled at all. **Modifiable only with an instance admin key**: setting it
|
|
224
|
+
* with an organization key is a `403`, because disabling ends tracking silently while the plan
|
|
225
|
+
* keeps being billed and no dashboard control does it at any role.
|
|
226
|
+
*/
|
|
227
|
+
enabled?: boolean;
|
|
228
|
+
};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { ConflictError, PaymentRequiredError } from './shared/conflict-error';
|
|
2
|
+
import type {
|
|
3
|
+
ForbiddenError,
|
|
4
|
+
InternalServerError,
|
|
5
|
+
RateLimitError,
|
|
6
|
+
UnauthorizedError,
|
|
7
|
+
} from './shared/error';
|
|
8
|
+
import type { Limit } from './shared/limit';
|
|
9
|
+
import type { NotFoundError } from './shared/not-found-error';
|
|
10
|
+
import type { Page } from './shared/page';
|
|
11
|
+
import type { Pagination } from './shared/pagination';
|
|
12
|
+
import type { ValidationError } from './shared/validation-error';
|
|
13
|
+
|
|
14
|
+
export type Competitor = {
|
|
15
|
+
aliases: Array<string>;
|
|
16
|
+
brandId: string;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
domains: Array<string>;
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type CompetitorsList = {
|
|
25
|
+
/**
|
|
26
|
+
* Deprecated: read `data` instead. Kept while the one known consumer migrates, and removed in a
|
|
27
|
+
* future release.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
31
|
+
competitors: Array<Competitor>;
|
|
32
|
+
/** The items on this page. Read this rather than the named key below. */
|
|
33
|
+
data: Array<Competitor>;
|
|
34
|
+
pagination: Pagination;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type ListCompetitorsErrors = {
|
|
38
|
+
/** Authentication required */
|
|
39
|
+
401: UnauthorizedError;
|
|
40
|
+
/**
|
|
41
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
42
|
+
* read-only (demo) mode.
|
|
43
|
+
*/
|
|
44
|
+
403: ForbiddenError;
|
|
45
|
+
/** Per-key rate limit exceeded. */
|
|
46
|
+
429: RateLimitError;
|
|
47
|
+
/** Internal server error */
|
|
48
|
+
500: InternalServerError;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type ListCompetitorsResponses = {
|
|
52
|
+
/** Paginated list of competitors */
|
|
53
|
+
200: CompetitorsList;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type CreateCompetitorErrors = {
|
|
57
|
+
/** Invalid request data */
|
|
58
|
+
400: ValidationError;
|
|
59
|
+
/** Authentication required */
|
|
60
|
+
401: UnauthorizedError;
|
|
61
|
+
/** The organization has no active subscription. Cloud deployments only. */
|
|
62
|
+
402: PaymentRequiredError;
|
|
63
|
+
/**
|
|
64
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
65
|
+
* read-only (demo) mode.
|
|
66
|
+
*/
|
|
67
|
+
403: ForbiddenError;
|
|
68
|
+
/** Resource already exists */
|
|
69
|
+
409: ConflictError;
|
|
70
|
+
/** Per-key rate limit exceeded. */
|
|
71
|
+
429: RateLimitError;
|
|
72
|
+
/** Internal server error */
|
|
73
|
+
500: InternalServerError;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type CreateCompetitorResponses = {
|
|
77
|
+
/** Competitor created */
|
|
78
|
+
201: Competitor;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type DeleteCompetitorErrors = {
|
|
82
|
+
/** Invalid request data */
|
|
83
|
+
400: ValidationError;
|
|
84
|
+
/** Authentication required */
|
|
85
|
+
401: UnauthorizedError;
|
|
86
|
+
/** The organization has no active subscription. Cloud deployments only. */
|
|
87
|
+
402: PaymentRequiredError;
|
|
88
|
+
/**
|
|
89
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
90
|
+
* read-only (demo) mode.
|
|
91
|
+
*/
|
|
92
|
+
403: ForbiddenError;
|
|
93
|
+
/** Resource not found */
|
|
94
|
+
404: NotFoundError;
|
|
95
|
+
/** Resource already exists */
|
|
96
|
+
409: ConflictError;
|
|
97
|
+
/** Per-key rate limit exceeded. */
|
|
98
|
+
429: RateLimitError;
|
|
99
|
+
/** Internal server error */
|
|
100
|
+
500: InternalServerError;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type DeleteCompetitorResponses = {
|
|
104
|
+
/** Competitor deleted (returns the deleted competitor) */
|
|
105
|
+
200: Competitor;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type GetCompetitorErrors = {
|
|
109
|
+
/** Invalid request data */
|
|
110
|
+
400: ValidationError;
|
|
111
|
+
/** Authentication required */
|
|
112
|
+
401: UnauthorizedError;
|
|
113
|
+
/**
|
|
114
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
115
|
+
* read-only (demo) mode.
|
|
116
|
+
*/
|
|
117
|
+
403: ForbiddenError;
|
|
118
|
+
/** Resource not found */
|
|
119
|
+
404: NotFoundError;
|
|
120
|
+
/** Per-key rate limit exceeded. */
|
|
121
|
+
429: RateLimitError;
|
|
122
|
+
/** Internal server error */
|
|
123
|
+
500: InternalServerError;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type GetCompetitorResponses = {
|
|
127
|
+
/** Competitor */
|
|
128
|
+
200: Competitor;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export type UpdateCompetitorErrors = {
|
|
132
|
+
/** Invalid request data */
|
|
133
|
+
400: ValidationError;
|
|
134
|
+
/** Authentication required */
|
|
135
|
+
401: UnauthorizedError;
|
|
136
|
+
/** The organization has no active subscription. Cloud deployments only. */
|
|
137
|
+
402: PaymentRequiredError;
|
|
138
|
+
/**
|
|
139
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
140
|
+
* read-only (demo) mode.
|
|
141
|
+
*/
|
|
142
|
+
403: ForbiddenError;
|
|
143
|
+
/** Resource not found */
|
|
144
|
+
404: NotFoundError;
|
|
145
|
+
/** Resource already exists */
|
|
146
|
+
409: ConflictError;
|
|
147
|
+
/** Per-key rate limit exceeded. */
|
|
148
|
+
429: RateLimitError;
|
|
149
|
+
/** Internal server error */
|
|
150
|
+
500: InternalServerError;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type UpdateCompetitorResponses = {
|
|
154
|
+
/** Competitor updated */
|
|
155
|
+
200: Competitor;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type ListCompetitorsParams = {
|
|
159
|
+
brandId?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Page number, 1-based.
|
|
162
|
+
*
|
|
163
|
+
* @default 1
|
|
164
|
+
* @minimum 1
|
|
165
|
+
*/
|
|
166
|
+
page?: Page;
|
|
167
|
+
/**
|
|
168
|
+
* Items per page. Values above the maximum are clamped, not rejected.
|
|
169
|
+
*
|
|
170
|
+
* @default 20
|
|
171
|
+
* @minimum 1
|
|
172
|
+
* @maximum 100
|
|
173
|
+
*/
|
|
174
|
+
limit?: Limit;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/** Add a competitor to a brand. */
|
|
178
|
+
export type CreateCompetitorParams = {
|
|
179
|
+
/** @minLength 1 */
|
|
180
|
+
brandId: string;
|
|
181
|
+
/** @minLength 1 */
|
|
182
|
+
name: string;
|
|
183
|
+
domains?: Array<string>;
|
|
184
|
+
aliases?: Array<string>;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Update a competitor. At least one field must be provided. Provided arrays replace the stored
|
|
189
|
+
* values verbatim.
|
|
190
|
+
*/
|
|
191
|
+
export type UpdateCompetitorParams = {
|
|
192
|
+
/** @minLength 1 */
|
|
193
|
+
name?: string;
|
|
194
|
+
domains?: Array<string>;
|
|
195
|
+
aliases?: Array<string>;
|
|
196
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ForbiddenError,
|
|
3
|
+
InternalServerError,
|
|
4
|
+
RateLimitError,
|
|
5
|
+
UnauthorizedError,
|
|
6
|
+
} from './shared/error';
|
|
7
|
+
|
|
8
|
+
export type APIKeyIdentity = {
|
|
9
|
+
/**
|
|
10
|
+
* Brands the key is narrowed to, or null when it reaches every brand in its organization. Never
|
|
11
|
+
* an empty array — a restriction to no brands is rejected at creation rather than treated as no
|
|
12
|
+
* restriction.
|
|
13
|
+
*/
|
|
14
|
+
brandIds: Array<string> | null;
|
|
15
|
+
createdAt: Date | null;
|
|
16
|
+
/** The key's label, as given when it was issued. Null for admin keys. */
|
|
17
|
+
createdBy: string | null;
|
|
18
|
+
/** When the key stops working, if it has an expiry. */
|
|
19
|
+
expiresAt: Date | null;
|
|
20
|
+
/** `admin` for an instance key, `organization` for a dashboard-issued key. */
|
|
21
|
+
keyType: 'admin' | 'organization';
|
|
22
|
+
lastUsedAt: Date | null;
|
|
23
|
+
/** The organization this key acts inside. Null for admin keys. */
|
|
24
|
+
organizationId: string | null;
|
|
25
|
+
organizationName: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* The key's configured limit — generous by design: it exists to stop a runaway loop, not to meter
|
|
28
|
+
* normal use. Enforcement is a fixed window and approximate under concurrency.
|
|
29
|
+
*/
|
|
30
|
+
rateLimit: {
|
|
31
|
+
limit: number;
|
|
32
|
+
window: 'minute' | 'hour';
|
|
33
|
+
} | null;
|
|
34
|
+
/** Scopes this key holds. A read-write key lists both; an admin key always does. */
|
|
35
|
+
scopes: Array<'read' | 'write'>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type GetMeErrors = {
|
|
39
|
+
/** Authentication required */
|
|
40
|
+
401: UnauthorizedError;
|
|
41
|
+
/**
|
|
42
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
43
|
+
* read-only (demo) mode.
|
|
44
|
+
*/
|
|
45
|
+
403: ForbiddenError;
|
|
46
|
+
/** Per-key rate limit exceeded. */
|
|
47
|
+
429: RateLimitError;
|
|
48
|
+
/** Internal server error */
|
|
49
|
+
500: InternalServerError;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type GetMeResponses = {
|
|
53
|
+
/** Describe the calling key */
|
|
54
|
+
200: APIKeyIdentity;
|
|
55
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
BrandAnalytics,
|
|
3
|
+
BrandQueryFanout,
|
|
4
|
+
CitationDomain,
|
|
5
|
+
CitationDomainList,
|
|
6
|
+
CitationURL,
|
|
7
|
+
CitationURLList,
|
|
8
|
+
DateRange,
|
|
9
|
+
FanoutQuery,
|
|
10
|
+
GetBrandAnalyticsErrors,
|
|
11
|
+
GetBrandAnalyticsParams,
|
|
12
|
+
GetBrandAnalyticsResponses,
|
|
13
|
+
GetBrandQueryFanoutErrors,
|
|
14
|
+
GetBrandQueryFanoutParams,
|
|
15
|
+
GetBrandQueryFanoutResponses,
|
|
16
|
+
ListBrandCitationDomainsErrors,
|
|
17
|
+
ListBrandCitationDomainsParams,
|
|
18
|
+
ListBrandCitationDomainsResponses,
|
|
19
|
+
ListBrandCitationURLsErrors,
|
|
20
|
+
ListBrandCitationURLsParams,
|
|
21
|
+
ListBrandCitationURLsResponses,
|
|
22
|
+
ListBrandPromptPerformanceErrors,
|
|
23
|
+
ListBrandPromptPerformanceParams,
|
|
24
|
+
ListBrandPromptPerformanceResponses,
|
|
25
|
+
ModelVisibility,
|
|
26
|
+
PromptPerformance,
|
|
27
|
+
PromptPerformanceList,
|
|
28
|
+
ShareOfVoiceEntry,
|
|
29
|
+
ShareOfVoicePoint,
|
|
30
|
+
TagsFilter,
|
|
31
|
+
VisibilityPoint,
|
|
32
|
+
} from './analytics';
|
|
33
|
+
export type {
|
|
34
|
+
Brand,
|
|
35
|
+
BrandsList,
|
|
36
|
+
CreateBrandErrors,
|
|
37
|
+
CreateBrandParams,
|
|
38
|
+
CreateBrandResponses,
|
|
39
|
+
GetBrandErrors,
|
|
40
|
+
GetBrandResponses,
|
|
41
|
+
ListBrandsErrors,
|
|
42
|
+
ListBrandsParams,
|
|
43
|
+
ListBrandsResponses,
|
|
44
|
+
UpdateBrandErrors,
|
|
45
|
+
UpdateBrandParams,
|
|
46
|
+
UpdateBrandResponses,
|
|
47
|
+
} from './brands';
|
|
48
|
+
export type {
|
|
49
|
+
Competitor,
|
|
50
|
+
CompetitorsList,
|
|
51
|
+
CreateCompetitorErrors,
|
|
52
|
+
CreateCompetitorParams,
|
|
53
|
+
CreateCompetitorResponses,
|
|
54
|
+
DeleteCompetitorErrors,
|
|
55
|
+
DeleteCompetitorResponses,
|
|
56
|
+
GetCompetitorErrors,
|
|
57
|
+
GetCompetitorResponses,
|
|
58
|
+
ListCompetitorsErrors,
|
|
59
|
+
ListCompetitorsParams,
|
|
60
|
+
ListCompetitorsResponses,
|
|
61
|
+
UpdateCompetitorErrors,
|
|
62
|
+
UpdateCompetitorParams,
|
|
63
|
+
UpdateCompetitorResponses,
|
|
64
|
+
} from './competitors';
|
|
65
|
+
export type { APIKeyIdentity, GetMeErrors, GetMeResponses } from './identity';
|
|
66
|
+
export type { ListModelsErrors, ListModelsResponses, Model, ModelList } from './models';
|
|
67
|
+
export type {
|
|
68
|
+
BrandOpportunities,
|
|
69
|
+
CitedPage,
|
|
70
|
+
GetBrandOpportunitiesErrors,
|
|
71
|
+
GetBrandOpportunitiesResponses,
|
|
72
|
+
Opportunity,
|
|
73
|
+
OpportunityPrompt,
|
|
74
|
+
} from './opportunities';
|
|
75
|
+
export type {
|
|
76
|
+
BillingPlan,
|
|
77
|
+
GetOrganizationBillingErrors,
|
|
78
|
+
GetOrganizationBillingResponses,
|
|
79
|
+
GetOrganizationErrors,
|
|
80
|
+
GetOrganizationResponses,
|
|
81
|
+
ListOrganizationsErrors,
|
|
82
|
+
ListOrganizationsParams,
|
|
83
|
+
ListOrganizationsResponses,
|
|
84
|
+
Organization,
|
|
85
|
+
OrganizationBilling,
|
|
86
|
+
OrganizationList,
|
|
87
|
+
PlanLimits,
|
|
88
|
+
} from './organizations';
|
|
89
|
+
export type {
|
|
90
|
+
CreatePromptErrors,
|
|
91
|
+
CreatePromptParams,
|
|
92
|
+
CreatePromptResponses,
|
|
93
|
+
DeletePromptErrors,
|
|
94
|
+
DeletePromptResponse,
|
|
95
|
+
DeletePromptResponses,
|
|
96
|
+
GetPromptErrors,
|
|
97
|
+
GetPromptResponses,
|
|
98
|
+
ListPromptsErrors,
|
|
99
|
+
ListPromptsParams,
|
|
100
|
+
ListPromptsResponse,
|
|
101
|
+
ListPromptsResponses,
|
|
102
|
+
Prompt,
|
|
103
|
+
UpdatePromptErrors,
|
|
104
|
+
UpdatePromptParams,
|
|
105
|
+
UpdatePromptResponses,
|
|
106
|
+
} from './prompts';
|
|
107
|
+
export type {
|
|
108
|
+
CreateReportErrors,
|
|
109
|
+
CreateReportParams,
|
|
110
|
+
CreateReportResponse,
|
|
111
|
+
CreateReportResponses,
|
|
112
|
+
GetReportErrors,
|
|
113
|
+
GetReportParams,
|
|
114
|
+
GetReportResponse,
|
|
115
|
+
GetReportResponses,
|
|
116
|
+
ListReportsErrors,
|
|
117
|
+
ListReportsParams,
|
|
118
|
+
ListReportsResponse,
|
|
119
|
+
ListReportsResponses,
|
|
120
|
+
ReportPromptSnapshot,
|
|
121
|
+
ReportSummary,
|
|
122
|
+
} from './reports';
|
|
123
|
+
export type {
|
|
124
|
+
GetRunErrors,
|
|
125
|
+
GetRunResponses,
|
|
126
|
+
ListPromptRunsErrors,
|
|
127
|
+
ListPromptRunsParams,
|
|
128
|
+
ListPromptRunsResponses,
|
|
129
|
+
Run,
|
|
130
|
+
RunCitation,
|
|
131
|
+
RunList,
|
|
132
|
+
RunSummary,
|
|
133
|
+
} from './runs';
|
|
134
|
+
export type { BrandIdPath } from './shared/brand-id-path';
|
|
135
|
+
export type { ConflictError, PaymentRequiredError } from './shared/conflict-error';
|
|
136
|
+
export type {
|
|
137
|
+
Error,
|
|
138
|
+
ForbiddenError,
|
|
139
|
+
InternalServerError,
|
|
140
|
+
RateLimitError,
|
|
141
|
+
UnauthorizedError,
|
|
142
|
+
} from './shared/error';
|
|
143
|
+
export type { Limit } from './shared/limit';
|
|
144
|
+
export type { MentionEntry, MentionsSummary } from './shared/mention-entry';
|
|
145
|
+
export type { ModelFilter, WindowEnd, WindowStart } from './shared/model-filter';
|
|
146
|
+
export type { NotFoundError } from './shared/not-found-error';
|
|
147
|
+
export type { Page } from './shared/page';
|
|
148
|
+
export type { Pagination } from './shared/pagination';
|
|
149
|
+
export type { ValidationError } from './shared/validation-error';
|
|
150
|
+
export type {
|
|
151
|
+
CitedURLEntry,
|
|
152
|
+
GetPromptSnapshotErrors,
|
|
153
|
+
GetPromptSnapshotParams,
|
|
154
|
+
GetPromptSnapshotResponses,
|
|
155
|
+
PromptSnapshot,
|
|
156
|
+
} from './snapshots';
|
|
157
|
+
export type { ListBrandTagsErrors, ListBrandTagsResponses, Tag, TagList } from './tags';
|
|
158
|
+
export type {
|
|
159
|
+
AnalyzeBrandErrors,
|
|
160
|
+
AnalyzeBrandParams,
|
|
161
|
+
AnalyzeBrandResponses,
|
|
162
|
+
OnboardingSuggestion,
|
|
163
|
+
} from './tools';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ForbiddenError,
|
|
3
|
+
InternalServerError,
|
|
4
|
+
RateLimitError,
|
|
5
|
+
UnauthorizedError,
|
|
6
|
+
} from './shared/error';
|
|
7
|
+
|
|
8
|
+
export type ModelList = {
|
|
9
|
+
data: Array<Model>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type Model = {
|
|
13
|
+
/** Whether this deployment is actually wired to reach it. */
|
|
14
|
+
configured: boolean;
|
|
15
|
+
/** Identifier used by the `model` filter, e.g. `chatgpt`. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Human-readable name. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Whether this model can be tracked grounded, spending a premium pairing. */
|
|
20
|
+
premiumCapable: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type ListModelsErrors = {
|
|
24
|
+
/** Authentication required */
|
|
25
|
+
401: UnauthorizedError;
|
|
26
|
+
/**
|
|
27
|
+
* The key is valid but not permitted: a missing scope, an admin-only endpoint, or a write in
|
|
28
|
+
* read-only (demo) mode.
|
|
29
|
+
*/
|
|
30
|
+
403: ForbiddenError;
|
|
31
|
+
/** Per-key rate limit exceeded. */
|
|
32
|
+
429: RateLimitError;
|
|
33
|
+
/** Internal server error */
|
|
34
|
+
500: InternalServerError;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type ListModelsResponses = {
|
|
38
|
+
/** List trackable models */
|
|
39
|
+
200: ModelList;
|
|
40
|
+
};
|