@elmohq/sdk 0.0.0-stage → 0.1.1
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 +326 -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 +1031 -0
- package/dist/index.mjs.map +1 -0
- package/dist/request-options-B9S9d24M.d.mts +1549 -0
- package/dist/request-options-B9S9d24M.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-B1lVtYAr.mjs +2459 -0
- package/dist/tools-B1lVtYAr.mjs.map +1 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +1 -0
- package/package.json +68 -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 +649 -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 +225 -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/page.ts +402 -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 +554 -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 +168 -0
- package/src/internal/feature/rules.ts +54 -0
- package/src/internal/feature/timeout.ts +146 -0
- package/src/internal/feature/validate.ts +82 -0
- package/src/internal/transport/fetch.ts +82 -0
- package/src/resources/analytics.ts +364 -0
- package/src/resources/brands.ts +288 -0
- package/src/resources/competitors.ts +213 -0
- package/src/resources/identity.ts +49 -0
- package/src/resources/models.ts +32 -0
- package/src/resources/opportunities.ts +81 -0
- package/src/resources/organizations.ts +182 -0
- package/src/resources/prompts.ts +293 -0
- package/src/resources/reports.ts +212 -0
- package/src/resources/runs.ts +124 -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 +69 -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,390 @@
|
|
|
1
|
+
import { $ as getBrandOpportunitiesFields, A as listModelsDescriptor, B as updateCompetitorDescriptor, D as getOrganizationFields, E as getOrganizationDescriptor, F as deleteCompetitorDescriptor, G as getBrandFields, I as deleteCompetitorFields, J as updateBrandFields, K as listBrandsDescriptor, L as getCompetitorDescriptor, M as getMeDescriptor, O as listOrganizationsDescriptor, P as createCompetitorDescriptor, Q as getBrandOpportunitiesDescriptor, R as getCompetitorFields, S as listPromptRunsFields, T as getOrganizationBillingFields, U as createBrandDescriptor, V as updateCompetitorFields, W as getBrandDescriptor, X as listBrandTagsDescriptor, Y as pages, Z as listBrandTagsFields, _ as getPromptSnapshotDescriptor, a as getReportDescriptor, at as listBrandCitationDomainsFields, b as getRunFields, ct as listBrandPromptPerformanceDescriptor, d as deletePromptFields, dt as mergeParams, et as getBrandAnalyticsDescriptor, f as getPromptDescriptor, ft as placeParams, g as updatePromptFields, h as updatePromptDescriptor, i as createReportDescriptor, it as listBrandCitationDomainsDescriptor, l as createPromptDescriptor, lt as listBrandPromptPerformanceFields, m as listPromptsDescriptor, n as analyzeBrandDescriptor, nt as getBrandQueryFanoutDescriptor, o as getReportFields, ot as listBrandCitationURLsDescriptor, p as getPromptFields, pt as callPromise, q as updateBrandDescriptor, rt as getBrandQueryFanoutFields, s as listReportsDescriptor, st as listBrandCitationUrlsFields, tt as getBrandAnalyticsFields, u as deletePromptDescriptor, ut as groupParams, v as getPromptSnapshotFields, w as getOrganizationBillingDescriptor, x as listPromptRunsDescriptor, y as getRunDescriptor, z as listCompetitorsDescriptor } from "../tools-B1lVtYAr.mjs";
|
|
2
|
+
//#region src/calls/brands-analytics-get.ts
|
|
3
|
+
/**
|
|
4
|
+
* Get a brand's analytics
|
|
5
|
+
*
|
|
6
|
+
* Visibility, share of voice, the per-model breakdown and the citation totals for one window, in
|
|
7
|
+
* one request.
|
|
8
|
+
*
|
|
9
|
+
* The long lists — cited domains and URLs, sub-queries, per-prompt results — are endpoints of their
|
|
10
|
+
* own. Everything else is always included.
|
|
11
|
+
*/
|
|
12
|
+
function brandsAnalyticsGet(client, brandId, params, options) {
|
|
13
|
+
return callPromise(options?.client ?? client, getBrandAnalyticsDescriptor, mergeParams(placeParams({
|
|
14
|
+
...params,
|
|
15
|
+
brandId
|
|
16
|
+
}, getBrandAnalyticsFields, "query"), options));
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/calls/brands-citations-domains-list.ts
|
|
20
|
+
/**
|
|
21
|
+
* List cited domains
|
|
22
|
+
*
|
|
23
|
+
* Domains the engines cited when answering this brand's prompts, categorized and compared against
|
|
24
|
+
* the equal-length window immediately before this one.
|
|
25
|
+
*/
|
|
26
|
+
function brandsCitationsDomainsList(client, brandId, params, options) {
|
|
27
|
+
return callPromise(options?.client ?? client, listBrandCitationDomainsDescriptor, mergeParams(placeParams({
|
|
28
|
+
...params,
|
|
29
|
+
brandId
|
|
30
|
+
}, listBrandCitationDomainsFields, "query"), options));
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/calls/brands-citations-urls-list.ts
|
|
34
|
+
/**
|
|
35
|
+
* List cited URLs
|
|
36
|
+
*
|
|
37
|
+
* Individual pages the engines cited, with their category and page type.
|
|
38
|
+
*/
|
|
39
|
+
function brandsCitationsURLsList(client, brandId, params, options) {
|
|
40
|
+
return callPromise(options?.client ?? client, listBrandCitationURLsDescriptor, mergeParams(placeParams({
|
|
41
|
+
...params,
|
|
42
|
+
brandId
|
|
43
|
+
}, listBrandCitationUrlsFields, "query"), options));
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/calls/brands-create.ts
|
|
47
|
+
/** Create a brand */
|
|
48
|
+
function brandsCreate(client, params, options) {
|
|
49
|
+
return callPromise(options?.client ?? client, createBrandDescriptor, mergeParams(groupParams(params, "body"), options));
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/calls/brands-get.ts
|
|
53
|
+
/** Get a brand */
|
|
54
|
+
function brandsGet(client, brandId, options) {
|
|
55
|
+
return callPromise(options?.client ?? client, getBrandDescriptor, mergeParams(placeParams({ brandId }, getBrandFields, "query"), options));
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/calls/brands-list.ts
|
|
59
|
+
function brandsList(client, params, options) {
|
|
60
|
+
return pages(options?.client ?? client, listBrandsDescriptor, mergeParams(groupParams(params, "query"), options));
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/calls/brands-opportunities-get.ts
|
|
64
|
+
/**
|
|
65
|
+
* Get the latest opportunities report
|
|
66
|
+
*
|
|
67
|
+
* **Experimental — the response shape may still change.**
|
|
68
|
+
*
|
|
69
|
+
* The brand's Opportunities report: a prioritized set of ways to get cited more often, with the
|
|
70
|
+
* tracked prompts and cited pages behind each one. The same analysis the dashboard shows, from the
|
|
71
|
+
* same code.
|
|
72
|
+
*
|
|
73
|
+
* Generation is inline and synchronous. A stored report is served while it is fresh and regenerated
|
|
74
|
+
* when it is not, so there is nothing to poll for and no way to be handed a stale one — but a
|
|
75
|
+
* request that triggers a generation waits for it. The freshness window bounds the cost: however
|
|
76
|
+
* many callers ask, one generation per brand per window. There is deliberately no `POST`, which
|
|
77
|
+
* would spend provider budget with nothing metering it per call.
|
|
78
|
+
*
|
|
79
|
+
* @experimental
|
|
80
|
+
*/
|
|
81
|
+
function brandsOpportunitiesGet(client, brandId, options) {
|
|
82
|
+
return callPromise(options?.client ?? client, getBrandOpportunitiesDescriptor, mergeParams(placeParams({ brandId }, getBrandOpportunitiesFields, "query"), options));
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/calls/brands-prompt-performance-list.ts
|
|
86
|
+
/**
|
|
87
|
+
* List prompt performance
|
|
88
|
+
*
|
|
89
|
+
* Per-prompt mention rates over the window. The analytics counterpart to `GET /prompts?brandId=`,
|
|
90
|
+
* which returns prompt configuration rather than results.
|
|
91
|
+
*
|
|
92
|
+
* A prompt the brand stopped tracking is not sampled, so it has no results over the window and does
|
|
93
|
+
* not appear here.
|
|
94
|
+
*/
|
|
95
|
+
function brandsPromptPerformanceList(client, brandId, params, options) {
|
|
96
|
+
return callPromise(options?.client ?? client, listBrandPromptPerformanceDescriptor, mergeParams(placeParams({
|
|
97
|
+
...params,
|
|
98
|
+
brandId
|
|
99
|
+
}, listBrandPromptPerformanceFields, "query"), options));
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/calls/brands-query-fanout-get.ts
|
|
103
|
+
/**
|
|
104
|
+
* Get query fan-out
|
|
105
|
+
*
|
|
106
|
+
* The searches engines ran while answering this brand's prompts. Engines that don't expose their
|
|
107
|
+
* searches still contribute runs, so `coverageRate` is the honest denominator.
|
|
108
|
+
*/
|
|
109
|
+
function brandsQueryFanoutGet(client, brandId, params, options) {
|
|
110
|
+
return callPromise(options?.client ?? client, getBrandQueryFanoutDescriptor, mergeParams(placeParams({
|
|
111
|
+
...params,
|
|
112
|
+
brandId
|
|
113
|
+
}, getBrandQueryFanoutFields, "query"), options));
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/calls/brands-tags-list.ts
|
|
117
|
+
/**
|
|
118
|
+
* List a brand's tags
|
|
119
|
+
*
|
|
120
|
+
* Every tag in use on the brand's prompts, with how many carry each — enough to build the same
|
|
121
|
+
* filter the dashboard shows without paging the whole prompt list to derive it.
|
|
122
|
+
*
|
|
123
|
+
* Tags are not a resource of their own: a tag exists exactly as long as some prompt carries it.
|
|
124
|
+
* `branded` and `unbranded` are computed by Elmo and always listed.
|
|
125
|
+
*/
|
|
126
|
+
function brandsTagsList(client, brandId, options) {
|
|
127
|
+
return callPromise(options?.client ?? client, listBrandTagsDescriptor, mergeParams(placeParams({ brandId }, listBrandTagsFields, "query"), options));
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/calls/brands-update.ts
|
|
131
|
+
/** Update a brand */
|
|
132
|
+
function brandsUpdate(client, brandId, params, options) {
|
|
133
|
+
return callPromise(options?.client ?? client, updateBrandDescriptor, mergeParams(placeParams({
|
|
134
|
+
...params,
|
|
135
|
+
brandId
|
|
136
|
+
}, updateBrandFields, "body"), options));
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/calls/competitors-create.ts
|
|
140
|
+
/** Add a competitor */
|
|
141
|
+
function competitorsCreate(client, params, options) {
|
|
142
|
+
return callPromise(options?.client ?? client, createCompetitorDescriptor, mergeParams(groupParams(params, "body"), options));
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/calls/competitors-delete.ts
|
|
146
|
+
/** Delete a competitor */
|
|
147
|
+
function competitorsDelete(client, competitorId, options) {
|
|
148
|
+
return callPromise(options?.client ?? client, deleteCompetitorDescriptor, mergeParams(placeParams({ competitorId }, deleteCompetitorFields, "query"), options));
|
|
149
|
+
}
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/calls/competitors-get.ts
|
|
152
|
+
/** Get a competitor */
|
|
153
|
+
function competitorsGet(client, competitorId, options) {
|
|
154
|
+
return callPromise(options?.client ?? client, getCompetitorDescriptor, mergeParams(placeParams({ competitorId }, getCompetitorFields, "query"), options));
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/calls/competitors-list.ts
|
|
158
|
+
function competitorsList(client, params, options) {
|
|
159
|
+
return pages(options?.client ?? client, listCompetitorsDescriptor, mergeParams(groupParams(params, "query"), options));
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/calls/competitors-update.ts
|
|
163
|
+
/** Update a competitor */
|
|
164
|
+
function competitorsUpdate(client, competitorId, params, options) {
|
|
165
|
+
return callPromise(options?.client ?? client, updateCompetitorDescriptor, mergeParams(placeParams({
|
|
166
|
+
...params,
|
|
167
|
+
competitorId
|
|
168
|
+
}, updateCompetitorFields, "body"), options));
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/calls/me-get.ts
|
|
172
|
+
/**
|
|
173
|
+
* Describe the calling key
|
|
174
|
+
*
|
|
175
|
+
* What this key is, which organization and brands it reaches, and which scopes it holds. Requires
|
|
176
|
+
* no scope, so it is always safe to call first when wiring up an integration.
|
|
177
|
+
*/
|
|
178
|
+
function meGet(client, options) {
|
|
179
|
+
return callPromise(options?.client ?? client, getMeDescriptor, options);
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/calls/models-list.ts
|
|
183
|
+
/**
|
|
184
|
+
* List trackable models
|
|
185
|
+
*
|
|
186
|
+
* The answer engines this deployment can track, so a client can build a model filter without
|
|
187
|
+
* hardcoding ids that differ between deployments.
|
|
188
|
+
*
|
|
189
|
+
* Requires no scope.
|
|
190
|
+
*/
|
|
191
|
+
function modelsList(client, options) {
|
|
192
|
+
return callPromise(options?.client ?? client, listModelsDescriptor, options);
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/calls/organizations-billing-get.ts
|
|
196
|
+
/**
|
|
197
|
+
* Get billing state
|
|
198
|
+
*
|
|
199
|
+
* The organization's plan, its limits, and how much of each limit is already spent — enough for an
|
|
200
|
+
* integration to know a write will be rejected before attempting it.
|
|
201
|
+
*
|
|
202
|
+
* This endpoint is read-only by construction. No API key of any kind can change a subscription, an
|
|
203
|
+
* add-on quantity, or a payment method; there is no billing write endpoint and no billing write
|
|
204
|
+
* scope. Stripe identifiers, invoices, and payment methods are never returned.
|
|
205
|
+
*
|
|
206
|
+
* Deployments without billing answer `200` with `billingEnabled: false`, a null plan, and null
|
|
207
|
+
* limits, so callers need no special case.
|
|
208
|
+
*/
|
|
209
|
+
function organizationsBillingGet(client, organizationId, options) {
|
|
210
|
+
return callPromise(options?.client ?? client, getOrganizationBillingDescriptor, mergeParams(placeParams({ organizationId }, getOrganizationBillingFields, "query"), options));
|
|
211
|
+
}
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/calls/organizations-get.ts
|
|
214
|
+
/**
|
|
215
|
+
* Get an organization
|
|
216
|
+
*
|
|
217
|
+
* No scope required. An organization outside the key's reach answers `404`, identically to one that
|
|
218
|
+
* does not exist.
|
|
219
|
+
*/
|
|
220
|
+
function organizationsGet(client, organizationId, options) {
|
|
221
|
+
return callPromise(options?.client ?? client, getOrganizationDescriptor, mergeParams(placeParams({ organizationId }, getOrganizationFields, "query"), options));
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/calls/organizations-list.ts
|
|
225
|
+
/**
|
|
226
|
+
* One entry for an organization key — the one it acts inside. Every organization for an instance
|
|
227
|
+
* admin key. No scope required: a key can only ever see the organization it is already bound to.
|
|
228
|
+
*/
|
|
229
|
+
function organizationsList(client, params, options) {
|
|
230
|
+
return pages(options?.client ?? client, listOrganizationsDescriptor, mergeParams(groupParams(params, "query"), options));
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/calls/prompts-create.ts
|
|
234
|
+
/**
|
|
235
|
+
* Create a new prompt
|
|
236
|
+
*
|
|
237
|
+
* Create a new prompt for a brand. This will automatically schedule the prompt for execution.
|
|
238
|
+
*/
|
|
239
|
+
function promptsCreate(client, params, options) {
|
|
240
|
+
return callPromise(options?.client ?? client, createPromptDescriptor, mergeParams(groupParams(params, "body"), options));
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/calls/prompts-delete.ts
|
|
244
|
+
/**
|
|
245
|
+
* Delete a prompt
|
|
246
|
+
*
|
|
247
|
+
* Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete
|
|
248
|
+
* all associated prompt runs.
|
|
249
|
+
*
|
|
250
|
+
* Requires an instance admin key; organization keys receive `403`. The dashboard has no delete
|
|
251
|
+
* either — stop tracking a prompt with `promptsUpdate()` and `enabled: false`, which keeps its
|
|
252
|
+
* history and frees the plan slot.
|
|
253
|
+
*/
|
|
254
|
+
function promptsDelete(client, promptId, options) {
|
|
255
|
+
return callPromise(options?.client ?? client, deletePromptDescriptor, mergeParams(placeParams({ promptId }, deletePromptFields, "query"), options));
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/calls/prompts-get.ts
|
|
259
|
+
/**
|
|
260
|
+
* Get a prompt
|
|
261
|
+
*
|
|
262
|
+
* Retrieve a specific prompt by ID
|
|
263
|
+
*/
|
|
264
|
+
function promptsGet(client, promptId, options) {
|
|
265
|
+
return callPromise(options?.client ?? client, getPromptDescriptor, mergeParams(placeParams({ promptId }, getPromptFields, "query"), options));
|
|
266
|
+
}
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region src/calls/prompts-list.ts
|
|
269
|
+
/**
|
|
270
|
+
* List all prompts
|
|
271
|
+
*
|
|
272
|
+
* Retrieve a paginated list of all prompts across all brands
|
|
273
|
+
*/
|
|
274
|
+
function promptsList(client, params, options) {
|
|
275
|
+
return pages(options?.client ?? client, listPromptsDescriptor, mergeParams(groupParams(params, "query"), options));
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/calls/prompts-runs-get.ts
|
|
279
|
+
/**
|
|
280
|
+
* Get a run
|
|
281
|
+
*
|
|
282
|
+
* One model answer, with its text normalized out of the provider’s response and its citations in
|
|
283
|
+
* the order the engine listed them. A run belonging to some other prompt answers `404`. The
|
|
284
|
+
* provider’s raw payload is deliberately not exposed — its shape belongs to the provider, not to
|
|
285
|
+
* this API.
|
|
286
|
+
*/
|
|
287
|
+
function promptsRunsGet(client, promptId, runId, options) {
|
|
288
|
+
return callPromise(options?.client ?? client, getRunDescriptor, mergeParams(placeParams({
|
|
289
|
+
promptId,
|
|
290
|
+
runId
|
|
291
|
+
}, getRunFields, "query"), options));
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/calls/prompts-runs-list.ts
|
|
295
|
+
/**
|
|
296
|
+
* List runs for a prompt
|
|
297
|
+
*
|
|
298
|
+
* Individual model answers behind the aggregates, newest first, without their text — the list stays
|
|
299
|
+
* small enough to page through. Fetch `promptsRunsGet()` for the answer itself.
|
|
300
|
+
*/
|
|
301
|
+
function promptsRunsList(client, promptId, params, options) {
|
|
302
|
+
return pages(options?.client ?? client, listPromptRunsDescriptor, mergeParams(placeParams({
|
|
303
|
+
...params,
|
|
304
|
+
promptId
|
|
305
|
+
}, listPromptRunsFields, "query"), options));
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/calls/prompts-snapshot-get.ts
|
|
309
|
+
/**
|
|
310
|
+
* Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date
|
|
311
|
+
* range. Use this to identify competitive gaps, track brand visibility trends, and discover top
|
|
312
|
+
* cited URLs.
|
|
313
|
+
*/
|
|
314
|
+
function promptsSnapshotGet(client, promptId, params, options) {
|
|
315
|
+
return callPromise(options?.client ?? client, getPromptSnapshotDescriptor, mergeParams(placeParams({
|
|
316
|
+
...params,
|
|
317
|
+
promptId
|
|
318
|
+
}, getPromptSnapshotFields, "query"), options));
|
|
319
|
+
}
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/calls/prompts-update.ts
|
|
322
|
+
/**
|
|
323
|
+
* Update a prompt
|
|
324
|
+
*
|
|
325
|
+
* Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules
|
|
326
|
+
* or unschedules the recurring run job.
|
|
327
|
+
*/
|
|
328
|
+
function promptsUpdate(client, promptId, params, options) {
|
|
329
|
+
return callPromise(options?.client ?? client, updatePromptDescriptor, mergeParams(placeParams({
|
|
330
|
+
...params,
|
|
331
|
+
promptId
|
|
332
|
+
}, updatePromptFields, "body"), options));
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/calls/reports-create.ts
|
|
336
|
+
/**
|
|
337
|
+
* Create a report
|
|
338
|
+
*
|
|
339
|
+
* Create a new AI Share of Voice report and queue it for generation. The report will evaluate the
|
|
340
|
+
* brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom
|
|
341
|
+
* prompts.
|
|
342
|
+
*
|
|
343
|
+
* Requires an instance admin key; organization keys receive `403`.
|
|
344
|
+
*/
|
|
345
|
+
function reportsCreate(client, params, options) {
|
|
346
|
+
return callPromise(options?.client ?? client, createReportDescriptor, mergeParams(groupParams(params, "body"), options));
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/calls/reports-get.ts
|
|
350
|
+
/**
|
|
351
|
+
* Get report status and data
|
|
352
|
+
*
|
|
353
|
+
* Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts.
|
|
354
|
+
* Consumers are responsible for computing SoV and other derived metrics from the raw data.
|
|
355
|
+
*
|
|
356
|
+
* Requires an instance admin key; organization keys receive `403`.
|
|
357
|
+
*/
|
|
358
|
+
function reportsGet(client, reportId, params, options) {
|
|
359
|
+
return callPromise(options?.client ?? client, getReportDescriptor, mergeParams(placeParams({
|
|
360
|
+
...params,
|
|
361
|
+
reportId
|
|
362
|
+
}, getReportFields, "query"), options));
|
|
363
|
+
}
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/calls/reports-list.ts
|
|
366
|
+
/**
|
|
367
|
+
* Retrieve a paginated list of all reports, ordered by creation date (newest first).
|
|
368
|
+
*
|
|
369
|
+
* Requires an instance admin key; organization keys receive `403`.
|
|
370
|
+
*/
|
|
371
|
+
function reportsList(client, params, options) {
|
|
372
|
+
return pages(options?.client ?? client, listReportsDescriptor, mergeParams(groupParams(params, "query"), options));
|
|
373
|
+
}
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region src/calls/tools-analyze.ts
|
|
376
|
+
/**
|
|
377
|
+
* Analyze a website
|
|
378
|
+
*
|
|
379
|
+
* Run brand analysis without persisting anything. Returns suggested additional domains, aliases,
|
|
380
|
+
* competitors, and prompts.
|
|
381
|
+
*
|
|
382
|
+
* Requires an instance admin key; organization keys receive `403`.
|
|
383
|
+
*/
|
|
384
|
+
function toolsAnalyze(client, params, options) {
|
|
385
|
+
return callPromise(options?.client ?? client, analyzeBrandDescriptor, mergeParams(groupParams(params, "body"), options));
|
|
386
|
+
}
|
|
387
|
+
//#endregion
|
|
388
|
+
export { brandsAnalyticsGet, brandsCitationsDomainsList, brandsCitationsURLsList, brandsCreate, brandsGet, brandsList, brandsOpportunitiesGet, brandsPromptPerformanceList, brandsQueryFanoutGet, brandsTagsList, brandsUpdate, competitorsCreate, competitorsDelete, competitorsGet, competitorsList, competitorsUpdate, meGet, modelsList, organizationsBillingGet, organizationsGet, organizationsList, promptsCreate, promptsDelete, promptsGet, promptsList, promptsRunsGet, promptsRunsList, promptsSnapshotGet, promptsUpdate, reportsCreate, reportsGet, reportsList, toolsAnalyze };
|
|
389
|
+
|
|
390
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/calls/brands-analytics-get.ts","../../src/calls/brands-citations-domains-list.ts","../../src/calls/brands-citations-urls-list.ts","../../src/calls/brands-create.ts","../../src/calls/brands-get.ts","../../src/calls/brands-list.ts","../../src/calls/brands-opportunities-get.ts","../../src/calls/brands-prompt-performance-list.ts","../../src/calls/brands-query-fanout-get.ts","../../src/calls/brands-tags-list.ts","../../src/calls/brands-update.ts","../../src/calls/competitors-create.ts","../../src/calls/competitors-delete.ts","../../src/calls/competitors-get.ts","../../src/calls/competitors-list.ts","../../src/calls/competitors-update.ts","../../src/calls/me-get.ts","../../src/calls/models-list.ts","../../src/calls/organizations-billing-get.ts","../../src/calls/organizations-get.ts","../../src/calls/organizations-list.ts","../../src/calls/prompts-create.ts","../../src/calls/prompts-delete.ts","../../src/calls/prompts-get.ts","../../src/calls/prompts-list.ts","../../src/calls/prompts-runs-get.ts","../../src/calls/prompts-runs-list.ts","../../src/calls/prompts-snapshot-get.ts","../../src/calls/prompts-update.ts","../../src/calls/reports-create.ts","../../src/calls/reports-get.ts","../../src/calls/reports-list.ts","../../src/calls/tools-analyze.ts"],"mappings":";;;;;;;;;;;AAqBA,SAAgB,mBACd,QACA,SACA,QACA,SACsE;CACtE,OAAO,YACL,SAAS,UAAU,QACnB,6BACA,YAAY,YAAY;EAAE,GAAG;EAAQ;CAAQ,GAAG,yBAAyB,OAAO,GAAG,OAAO,CAC5F;AACF;;;;;;;;;ACXA,SAAgB,2BACd,QACA,SACA,QACA,SACoF;CACpF,OAAO,YACL,SAAS,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AS,UAAU,QACnB,0BACA,YAAY,YAAY;EAAE,GAAG;EAAQ;CAAS,GAAG,sBAAsB,OAAO,GAAG,OAAO,CAC1F;AACF;;;;;;;;ACbA,SAAgB,mBACd,QACA,UACA,QACA,SACsE;CACtE,OAAO,YACL,SAAS,UAAU,QACnB,6BACA,YAAY,YAAY;EAAE,GAAG;EAAQ;CAAS,GAAG,yBAAyB,OAAO,GAAG,OAAO,CAC7F;AACF;;;;;;;;;ACVA,SAAgB,cACd,QACA,UACA,QACA,SAC4D;CAC5D,OAAO,YACL,SAAS,UAAU,QACnB,wBACA,YAAY,YAAY;EAAE,GAAG;EAAQ;CAAS,GAAG,oBAAoB,MAAM,GAAG,OAAO,CACvF;AACF;;;;;;;;;;;;ACRA,SAAgB,cACd,QACA,QACA,SAC4D;CAC5D,OAAO,YACL,SAAS,UAAU,QACnB,wBACA,YAAY,YAAY,QAAQ,MAAM,GAAG,OAAO,CAClD;AACF;;;;;;;;;;;ACfA,SAAgB,WACd,QACA,UACA,QACA,SACsD;CACtD,OAAO,YACL,SAAS,UAAU,QACnB,qBACA,YAAY,YAAY;EAAE,GAAG;EAAQ;CAAS,GAAG,iBAAiB,OAAO,GAAG,OAAO,CACrF;AACF;;;;;;;;ACTA,SAAgB,YACd,QACA,QACA,SACoE;CACpE,OAAO,MACL,SAAS,UAAU,QACnB,uBACA,YAAY,YAAY,QAAQ,OAAO,GAAG,OAAO,CACnD;AACF;;;;;;;;;;;ACZA,SAAgB,aACd,QACA,QACA,SAC4D;CAC5D,OAAO,YACL,SAAS,UAAU,QACnB,wBACA,YAAY,YAAY,QAAQ,MAAM,GAAG,OAAO,CAClD;AACF"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as TransportError, S as TimeoutError, _ as APIError, b as ElmoError, c as ConflictError, d as PaymentRequiredError, f as PermissionDeniedError, i as createElmoClient, l as InternalServerError, m as UnprocessableEntityError, n as Elmo, o as AuthenticationError, p as RateLimitError, r as VERSION, s as BadRequestError, u as NotFoundError, v as AbortError, x as MissingCredentialError, y as DecodeError } from "./request-options-B9S9d24M.mjs";
|
|
2
|
+
export { APIError, AbortError, AuthenticationError, BadRequestError, ConflictError, DecodeError, Elmo, ElmoError, InternalServerError, MissingCredentialError, NotFoundError, PaymentRequiredError, PermissionDeniedError, RateLimitError, TimeoutError, TransportError, UnprocessableEntityError, VERSION, createElmoClient };
|