@spyglasshq/sdk 0.1.0 → 0.1.2
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 +248 -66
- package/dist/cjs/BaseClient.js +3 -3
- package/dist/cjs/Client.d.ts +4 -4
- package/dist/cjs/Client.js +3 -3
- package/dist/cjs/api/errors/BadRequestError.d.ts +3 -3
- package/dist/cjs/api/errors/ContentTooLargeError.d.ts +3 -3
- package/dist/cjs/api/errors/ForbiddenError.d.ts +3 -3
- package/dist/cjs/api/errors/InternalServerError.d.ts +3 -3
- package/dist/cjs/api/errors/MethodNotAllowedError.d.ts +3 -3
- package/dist/cjs/api/errors/NotFoundError.d.ts +3 -3
- package/dist/cjs/api/errors/PaymentRequiredError.d.ts +3 -3
- package/dist/cjs/api/errors/TooManyRequestsError.d.ts +3 -3
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +3 -3
- package/dist/cjs/api/resources/account/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/account/client/Client.js +15 -15
- package/dist/cjs/api/resources/indexing/client/Client.d.ts +19 -19
- package/dist/cjs/api/resources/indexing/client/Client.js +31 -31
- package/dist/cjs/api/resources/search/client/Client.d.ts +93 -89
- package/dist/cjs/api/resources/search/client/Client.js +153 -149
- package/dist/cjs/api/resources/search/client/requests/GetBrandLandingPagesRequest.d.ts +2 -2
- package/dist/cjs/api/resources/search/client/requests/GetBrandMediaInsightsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/search/client/requests/{GetMediaV2Request.d.ts → GetMediaRequest.d.ts} +13 -13
- package/dist/cjs/api/resources/search/client/requests/{GetMediaV2Request.js → GetMediaRequest.js} +14 -14
- package/dist/{esm/api/resources/search/client/requests/SearchBrandsV2Request.d.mts → cjs/api/resources/search/client/requests/SearchBrandsRequest.d.ts} +4 -4
- package/dist/cjs/api/resources/search/client/requests/{SearchBrandsV2Request.js → SearchBrandsRequest.js} +5 -5
- package/dist/cjs/api/resources/search/client/requests/index.d.ts +2 -2
- package/dist/cjs/api/resources/search/client/requests/index.js +5 -5
- package/dist/cjs/api/resources/search/types/GetAccountResponse.d.ts +2 -2
- package/dist/cjs/api/resources/search/types/{GetMediaV2Response.d.ts → GetMediaResponse.d.ts} +3 -3
- package/dist/cjs/api/resources/search/types/{GetMediaV2Response.js → GetMediaResponse.js} +5 -5
- package/dist/{esm/api/resources/search/types/SearchBrandsV2Response.d.mts → cjs/api/resources/search/types/SearchBrandsResponse.d.ts} +3 -3
- package/dist/cjs/api/resources/search/types/{SearchBrandsV2Response.js → SearchBrandsResponse.js} +5 -5
- package/dist/cjs/api/resources/search/types/index.d.ts +2 -2
- package/dist/cjs/api/resources/search/types/index.js +2 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +3 -3
- package/dist/esm/Client.d.mts +4 -4
- package/dist/esm/Client.mjs +1 -1
- package/dist/esm/api/errors/BadRequestError.d.mts +3 -3
- package/dist/esm/api/errors/ContentTooLargeError.d.mts +3 -3
- package/dist/esm/api/errors/ForbiddenError.d.mts +3 -3
- package/dist/esm/api/errors/InternalServerError.d.mts +3 -3
- package/dist/esm/api/errors/MethodNotAllowedError.d.mts +3 -3
- package/dist/esm/api/errors/NotFoundError.d.mts +3 -3
- package/dist/esm/api/errors/PaymentRequiredError.d.mts +3 -3
- package/dist/esm/api/errors/TooManyRequestsError.d.mts +3 -3
- package/dist/esm/api/errors/UnauthorizedError.d.mts +3 -3
- package/dist/esm/api/resources/account/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/account/client/Client.mjs +15 -15
- package/dist/esm/api/resources/indexing/client/Client.d.mts +19 -19
- package/dist/esm/api/resources/indexing/client/Client.mjs +31 -31
- package/dist/esm/api/resources/search/client/Client.d.mts +93 -89
- package/dist/esm/api/resources/search/client/Client.mjs +153 -149
- package/dist/esm/api/resources/search/client/requests/GetBrandLandingPagesRequest.d.mts +2 -2
- package/dist/esm/api/resources/search/client/requests/GetBrandMediaInsightsRequest.d.mts +2 -2
- package/dist/esm/api/resources/search/client/requests/{GetMediaV2Request.d.mts → GetMediaRequest.d.mts} +13 -13
- package/dist/esm/api/resources/search/client/requests/{GetMediaV2Request.mjs → GetMediaRequest.mjs} +13 -13
- package/dist/{cjs/api/resources/search/client/requests/SearchBrandsV2Request.d.ts → esm/api/resources/search/client/requests/SearchBrandsRequest.d.mts} +4 -4
- package/dist/esm/api/resources/search/client/requests/{SearchBrandsV2Request.mjs → SearchBrandsRequest.mjs} +4 -4
- package/dist/esm/api/resources/search/client/requests/index.d.mts +2 -2
- package/dist/esm/api/resources/search/client/requests/index.mjs +2 -2
- package/dist/esm/api/resources/search/types/GetAccountResponse.d.mts +2 -2
- package/dist/esm/api/resources/search/types/{GetMediaV2Response.d.mts → GetMediaResponse.d.mts} +3 -3
- package/dist/esm/api/resources/search/types/{GetMediaV2Response.mjs → GetMediaResponse.mjs} +4 -4
- package/dist/{cjs/api/resources/search/types/SearchBrandsV2Response.d.ts → esm/api/resources/search/types/SearchBrandsResponse.d.mts} +3 -3
- package/dist/esm/api/resources/search/types/{SearchBrandsV2Response.mjs → SearchBrandsResponse.mjs} +4 -4
- package/dist/esm/api/resources/search/types/index.d.mts +2 -2
- package/dist/esm/api/resources/search/types/index.mjs +2 -2
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +17 -2
- package/reference.md +31 -27
|
@@ -15,7 +15,7 @@ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs"
|
|
|
15
15
|
import * as environments from "../../../../environments.mjs";
|
|
16
16
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
17
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
18
|
-
import * as
|
|
18
|
+
import * as spyglass from "../../../index.mjs";
|
|
19
19
|
/**
|
|
20
20
|
* Search accounts, ads, and related data.
|
|
21
21
|
*/
|
|
@@ -24,7 +24,10 @@ export class SearchClient {
|
|
|
24
24
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Find brands
|
|
27
|
+
* Find brands.
|
|
28
|
+
* Search semantically with `query`, or look them up by name, id, or
|
|
29
|
+
* social handle. Either way, you can also narrow the results with
|
|
30
|
+
* filters such as product taxonomy, location, and follower count.
|
|
28
31
|
*
|
|
29
32
|
* Send one search field. Each field is its own mode:
|
|
30
33
|
*
|
|
@@ -58,30 +61,30 @@ export class SearchClient {
|
|
|
58
61
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
59
62
|
* row even when nothing matches.
|
|
60
63
|
*
|
|
61
|
-
* @param {
|
|
64
|
+
* @param {spyglass.SearchBrandsRequest} request
|
|
62
65
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
66
|
*
|
|
64
|
-
* @throws {@link
|
|
65
|
-
* @throws {@link
|
|
66
|
-
* @throws {@link
|
|
67
|
-
* @throws {@link
|
|
68
|
-
* @throws {@link
|
|
69
|
-
* @throws {@link
|
|
70
|
-
* @throws {@link
|
|
71
|
-
* @throws {@link
|
|
67
|
+
* @throws {@link spyglass.BadRequestError}
|
|
68
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
69
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
70
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
71
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
72
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
73
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
74
|
+
* @throws {@link spyglass.InternalServerError}
|
|
72
75
|
* @throws {@link errors.SpyglassError}
|
|
73
76
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
74
77
|
*
|
|
75
78
|
* @example
|
|
76
|
-
* await client.search.
|
|
79
|
+
* await client.search.brands({
|
|
77
80
|
* names: ["Nike"],
|
|
78
81
|
* limit: 3
|
|
79
82
|
* })
|
|
80
83
|
*/
|
|
81
|
-
|
|
82
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
84
|
+
brands(request = {}, requestOptions) {
|
|
85
|
+
return core.HttpResponsePromise.fromPromise(this.__brands(request, requestOptions));
|
|
83
86
|
}
|
|
84
|
-
|
|
87
|
+
__brands() {
|
|
85
88
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
86
89
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
90
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
@@ -106,21 +109,21 @@ export class SearchClient {
|
|
|
106
109
|
if (_response.error.reason === "status-code") {
|
|
107
110
|
switch (_response.error.statusCode) {
|
|
108
111
|
case 400:
|
|
109
|
-
throw new
|
|
112
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
110
113
|
case 401:
|
|
111
|
-
throw new
|
|
114
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
112
115
|
case 402:
|
|
113
|
-
throw new
|
|
116
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
114
117
|
case 403:
|
|
115
|
-
throw new
|
|
118
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
116
119
|
case 405:
|
|
117
|
-
throw new
|
|
120
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
118
121
|
case 413:
|
|
119
|
-
throw new
|
|
122
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
120
123
|
case 429:
|
|
121
|
-
throw new
|
|
124
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
122
125
|
case 500:
|
|
123
|
-
throw new
|
|
126
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
124
127
|
default:
|
|
125
128
|
throw new errors.SpyglassError({
|
|
126
129
|
statusCode: _response.error.statusCode,
|
|
@@ -133,9 +136,10 @@ export class SearchClient {
|
|
|
133
136
|
});
|
|
134
137
|
}
|
|
135
138
|
/**
|
|
136
|
-
* Find creators
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
+
* Find creators.
|
|
140
|
+
* Search semantically with `query`, or look them up by name, id, or
|
|
141
|
+
* social handle. Either way, you can also narrow the results with
|
|
142
|
+
* filters such as audience profile, location, and follower count.
|
|
139
143
|
*
|
|
140
144
|
* Send one search field. Each field is its own mode:
|
|
141
145
|
*
|
|
@@ -169,17 +173,17 @@ export class SearchClient {
|
|
|
169
173
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
170
174
|
* row even when nothing matches.
|
|
171
175
|
*
|
|
172
|
-
* @param {
|
|
176
|
+
* @param {spyglass.SearchCreatorsRequest} request
|
|
173
177
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
174
178
|
*
|
|
175
|
-
* @throws {@link
|
|
176
|
-
* @throws {@link
|
|
177
|
-
* @throws {@link
|
|
178
|
-
* @throws {@link
|
|
179
|
-
* @throws {@link
|
|
180
|
-
* @throws {@link
|
|
181
|
-
* @throws {@link
|
|
182
|
-
* @throws {@link
|
|
179
|
+
* @throws {@link spyglass.BadRequestError}
|
|
180
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
181
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
182
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
183
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
184
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
185
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
186
|
+
* @throws {@link spyglass.InternalServerError}
|
|
183
187
|
* @throws {@link errors.SpyglassError}
|
|
184
188
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
185
189
|
*
|
|
@@ -218,21 +222,21 @@ export class SearchClient {
|
|
|
218
222
|
if (_response.error.reason === "status-code") {
|
|
219
223
|
switch (_response.error.statusCode) {
|
|
220
224
|
case 400:
|
|
221
|
-
throw new
|
|
225
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
222
226
|
case 401:
|
|
223
|
-
throw new
|
|
227
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
224
228
|
case 402:
|
|
225
|
-
throw new
|
|
229
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
226
230
|
case 403:
|
|
227
|
-
throw new
|
|
231
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
228
232
|
case 405:
|
|
229
|
-
throw new
|
|
233
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
230
234
|
case 413:
|
|
231
|
-
throw new
|
|
235
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
232
236
|
case 429:
|
|
233
|
-
throw new
|
|
237
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
234
238
|
case 500:
|
|
235
|
-
throw new
|
|
239
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
236
240
|
default:
|
|
237
241
|
throw new errors.SpyglassError({
|
|
238
242
|
statusCode: _response.error.statusCode,
|
|
@@ -253,17 +257,17 @@ export class SearchClient {
|
|
|
253
257
|
* Costs 2,000 microdollars ($0.0020) per account returned, charged against your plan's monthly credits.
|
|
254
258
|
* An id that matches nothing returns 404 and is free.
|
|
255
259
|
*
|
|
256
|
-
* @param {
|
|
260
|
+
* @param {spyglass.GetAccountRequest} request
|
|
257
261
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
258
262
|
*
|
|
259
|
-
* @throws {@link
|
|
260
|
-
* @throws {@link
|
|
261
|
-
* @throws {@link
|
|
262
|
-
* @throws {@link
|
|
263
|
-
* @throws {@link
|
|
264
|
-
* @throws {@link
|
|
265
|
-
* @throws {@link
|
|
266
|
-
* @throws {@link
|
|
263
|
+
* @throws {@link spyglass.BadRequestError}
|
|
264
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
265
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
266
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
267
|
+
* @throws {@link spyglass.NotFoundError}
|
|
268
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
269
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
270
|
+
* @throws {@link spyglass.InternalServerError}
|
|
267
271
|
* @throws {@link errors.SpyglassError}
|
|
268
272
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
269
273
|
*
|
|
@@ -298,21 +302,21 @@ export class SearchClient {
|
|
|
298
302
|
if (_response.error.reason === "status-code") {
|
|
299
303
|
switch (_response.error.statusCode) {
|
|
300
304
|
case 400:
|
|
301
|
-
throw new
|
|
305
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
302
306
|
case 401:
|
|
303
|
-
throw new
|
|
307
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
304
308
|
case 402:
|
|
305
|
-
throw new
|
|
309
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
306
310
|
case 403:
|
|
307
|
-
throw new
|
|
311
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
308
312
|
case 404:
|
|
309
|
-
throw new
|
|
313
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
310
314
|
case 405:
|
|
311
|
-
throw new
|
|
315
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
312
316
|
case 429:
|
|
313
|
-
throw new
|
|
317
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
314
318
|
case 500:
|
|
315
|
-
throw new
|
|
319
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
316
320
|
default:
|
|
317
321
|
throw new errors.SpyglassError({
|
|
318
322
|
statusCode: _response.error.statusCode,
|
|
@@ -332,16 +336,16 @@ export class SearchClient {
|
|
|
332
336
|
* Limited to 120 requests per minute per user.
|
|
333
337
|
* This call is free and does not use credits.
|
|
334
338
|
*
|
|
335
|
-
* @param {
|
|
339
|
+
* @param {spyglass.SearchTaxonomiesRequest} request
|
|
336
340
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
337
341
|
*
|
|
338
|
-
* @throws {@link
|
|
339
|
-
* @throws {@link
|
|
340
|
-
* @throws {@link
|
|
341
|
-
* @throws {@link
|
|
342
|
-
* @throws {@link
|
|
343
|
-
* @throws {@link
|
|
344
|
-
* @throws {@link
|
|
342
|
+
* @throws {@link spyglass.BadRequestError}
|
|
343
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
344
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
345
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
346
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
347
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
348
|
+
* @throws {@link spyglass.InternalServerError}
|
|
345
349
|
* @throws {@link errors.SpyglassError}
|
|
346
350
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
347
351
|
*
|
|
@@ -384,19 +388,19 @@ export class SearchClient {
|
|
|
384
388
|
if (_response.error.reason === "status-code") {
|
|
385
389
|
switch (_response.error.statusCode) {
|
|
386
390
|
case 400:
|
|
387
|
-
throw new
|
|
391
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
388
392
|
case 401:
|
|
389
|
-
throw new
|
|
393
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
390
394
|
case 402:
|
|
391
|
-
throw new
|
|
395
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
392
396
|
case 403:
|
|
393
|
-
throw new
|
|
397
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
394
398
|
case 405:
|
|
395
|
-
throw new
|
|
399
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
396
400
|
case 429:
|
|
397
|
-
throw new
|
|
401
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
398
402
|
case 500:
|
|
399
|
-
throw new
|
|
403
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
400
404
|
default:
|
|
401
405
|
throw new errors.SpyglassError({
|
|
402
406
|
statusCode: _response.error.statusCode,
|
|
@@ -418,31 +422,31 @@ export class SearchClient {
|
|
|
418
422
|
* The call bills a minimum of one row even when nothing matches. In that
|
|
419
423
|
* case `count` is 0 but you are charged for one row.
|
|
420
424
|
*
|
|
421
|
-
* @param {
|
|
425
|
+
* @param {spyglass.GetMediaRequest} request
|
|
422
426
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
423
427
|
*
|
|
424
|
-
* @throws {@link
|
|
425
|
-
* @throws {@link
|
|
426
|
-
* @throws {@link
|
|
427
|
-
* @throws {@link
|
|
428
|
-
* @throws {@link
|
|
429
|
-
* @throws {@link
|
|
430
|
-
* @throws {@link
|
|
431
|
-
* @throws {@link
|
|
432
|
-
* @throws {@link
|
|
428
|
+
* @throws {@link spyglass.BadRequestError}
|
|
429
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
430
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
431
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
432
|
+
* @throws {@link spyglass.NotFoundError}
|
|
433
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
434
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
435
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
436
|
+
* @throws {@link spyglass.InternalServerError}
|
|
433
437
|
* @throws {@link errors.SpyglassError}
|
|
434
438
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
435
439
|
*
|
|
436
440
|
* @example
|
|
437
|
-
* await client.search.
|
|
441
|
+
* await client.search.getMedia({
|
|
438
442
|
* query: "comfort-focused video ads",
|
|
439
443
|
* limit: 20
|
|
440
444
|
* })
|
|
441
445
|
*/
|
|
442
|
-
|
|
443
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
446
|
+
getMedia(request = {}, requestOptions) {
|
|
447
|
+
return core.HttpResponsePromise.fromPromise(this.__getMedia(request, requestOptions));
|
|
444
448
|
}
|
|
445
|
-
|
|
449
|
+
__getMedia() {
|
|
446
450
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
447
451
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
448
452
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
@@ -467,23 +471,23 @@ export class SearchClient {
|
|
|
467
471
|
if (_response.error.reason === "status-code") {
|
|
468
472
|
switch (_response.error.statusCode) {
|
|
469
473
|
case 400:
|
|
470
|
-
throw new
|
|
474
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
471
475
|
case 401:
|
|
472
|
-
throw new
|
|
476
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
473
477
|
case 402:
|
|
474
|
-
throw new
|
|
478
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
475
479
|
case 403:
|
|
476
|
-
throw new
|
|
480
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
477
481
|
case 404:
|
|
478
|
-
throw new
|
|
482
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
479
483
|
case 405:
|
|
480
|
-
throw new
|
|
484
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
481
485
|
case 413:
|
|
482
|
-
throw new
|
|
486
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
483
487
|
case 429:
|
|
484
|
-
throw new
|
|
488
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
485
489
|
case 500:
|
|
486
|
-
throw new
|
|
490
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
487
491
|
default:
|
|
488
492
|
throw new errors.SpyglassError({
|
|
489
493
|
statusCode: _response.error.statusCode,
|
|
@@ -506,17 +510,17 @@ export class SearchClient {
|
|
|
506
510
|
* Limited to 120 requests per minute per user.
|
|
507
511
|
* Costs 1,000 microdollars ($0.0010) per cluster returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
508
512
|
*
|
|
509
|
-
* @param {
|
|
513
|
+
* @param {spyglass.GetBrandMediaInsightsRequest} request
|
|
510
514
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
511
515
|
*
|
|
512
|
-
* @throws {@link
|
|
513
|
-
* @throws {@link
|
|
514
|
-
* @throws {@link
|
|
515
|
-
* @throws {@link
|
|
516
|
-
* @throws {@link
|
|
517
|
-
* @throws {@link
|
|
518
|
-
* @throws {@link
|
|
519
|
-
* @throws {@link
|
|
516
|
+
* @throws {@link spyglass.BadRequestError}
|
|
517
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
518
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
519
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
520
|
+
* @throws {@link spyglass.NotFoundError}
|
|
521
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
522
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
523
|
+
* @throws {@link spyglass.InternalServerError}
|
|
520
524
|
* @throws {@link errors.SpyglassError}
|
|
521
525
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
522
526
|
*
|
|
@@ -564,21 +568,21 @@ export class SearchClient {
|
|
|
564
568
|
if (_response.error.reason === "status-code") {
|
|
565
569
|
switch (_response.error.statusCode) {
|
|
566
570
|
case 400:
|
|
567
|
-
throw new
|
|
571
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
568
572
|
case 401:
|
|
569
|
-
throw new
|
|
573
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
570
574
|
case 402:
|
|
571
|
-
throw new
|
|
575
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
572
576
|
case 403:
|
|
573
|
-
throw new
|
|
577
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
574
578
|
case 404:
|
|
575
|
-
throw new
|
|
579
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
576
580
|
case 405:
|
|
577
|
-
throw new
|
|
581
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
578
582
|
case 429:
|
|
579
|
-
throw new
|
|
583
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
580
584
|
case 500:
|
|
581
|
-
throw new
|
|
585
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
582
586
|
default:
|
|
583
587
|
throw new errors.SpyglassError({
|
|
584
588
|
statusCode: _response.error.statusCode,
|
|
@@ -597,17 +601,17 @@ export class SearchClient {
|
|
|
597
601
|
* Limited to 120 requests per minute per user.
|
|
598
602
|
* Costs 5,000 microdollars ($0.0050) per landing page returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
599
603
|
*
|
|
600
|
-
* @param {
|
|
604
|
+
* @param {spyglass.GetBrandLandingPagesRequest} request
|
|
601
605
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
602
606
|
*
|
|
603
|
-
* @throws {@link
|
|
604
|
-
* @throws {@link
|
|
605
|
-
* @throws {@link
|
|
606
|
-
* @throws {@link
|
|
607
|
-
* @throws {@link
|
|
608
|
-
* @throws {@link
|
|
609
|
-
* @throws {@link
|
|
610
|
-
* @throws {@link
|
|
607
|
+
* @throws {@link spyglass.BadRequestError}
|
|
608
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
609
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
610
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
611
|
+
* @throws {@link spyglass.NotFoundError}
|
|
612
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
613
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
614
|
+
* @throws {@link spyglass.InternalServerError}
|
|
611
615
|
* @throws {@link errors.SpyglassError}
|
|
612
616
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
613
617
|
*
|
|
@@ -653,21 +657,21 @@ export class SearchClient {
|
|
|
653
657
|
if (_response.error.reason === "status-code") {
|
|
654
658
|
switch (_response.error.statusCode) {
|
|
655
659
|
case 400:
|
|
656
|
-
throw new
|
|
660
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
657
661
|
case 401:
|
|
658
|
-
throw new
|
|
662
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
659
663
|
case 402:
|
|
660
|
-
throw new
|
|
664
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
661
665
|
case 403:
|
|
662
|
-
throw new
|
|
666
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
663
667
|
case 404:
|
|
664
|
-
throw new
|
|
668
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
665
669
|
case 405:
|
|
666
|
-
throw new
|
|
670
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
667
671
|
case 429:
|
|
668
|
-
throw new
|
|
672
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
669
673
|
case 500:
|
|
670
|
-
throw new
|
|
674
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
671
675
|
default:
|
|
672
676
|
throw new errors.SpyglassError({
|
|
673
677
|
statusCode: _response.error.statusCode,
|
|
@@ -704,17 +708,17 @@ export class SearchClient {
|
|
|
704
708
|
* Each comment page fetched live (`limit`, default 1) is one billed
|
|
705
709
|
* unit. Cached posts do not scrape and are not billed.
|
|
706
710
|
*
|
|
707
|
-
* @param {
|
|
711
|
+
* @param {spyglass.GetCommentsRequest} request
|
|
708
712
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
709
713
|
*
|
|
710
|
-
* @throws {@link
|
|
711
|
-
* @throws {@link
|
|
712
|
-
* @throws {@link
|
|
713
|
-
* @throws {@link
|
|
714
|
-
* @throws {@link
|
|
715
|
-
* @throws {@link
|
|
716
|
-
* @throws {@link
|
|
717
|
-
* @throws {@link
|
|
714
|
+
* @throws {@link spyglass.BadRequestError}
|
|
715
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
716
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
717
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
718
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
719
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
720
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
721
|
+
* @throws {@link spyglass.InternalServerError}
|
|
718
722
|
* @throws {@link errors.SpyglassError}
|
|
719
723
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
720
724
|
*
|
|
@@ -753,21 +757,21 @@ export class SearchClient {
|
|
|
753
757
|
if (_response.error.reason === "status-code") {
|
|
754
758
|
switch (_response.error.statusCode) {
|
|
755
759
|
case 400:
|
|
756
|
-
throw new
|
|
760
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
757
761
|
case 401:
|
|
758
|
-
throw new
|
|
762
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
759
763
|
case 402:
|
|
760
|
-
throw new
|
|
764
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
761
765
|
case 403:
|
|
762
|
-
throw new
|
|
766
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
763
767
|
case 405:
|
|
764
|
-
throw new
|
|
768
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
765
769
|
case 413:
|
|
766
|
-
throw new
|
|
770
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
767
771
|
case 429:
|
|
768
|
-
throw new
|
|
772
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
769
773
|
case 500:
|
|
770
|
-
throw new
|
|
774
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
771
775
|
default:
|
|
772
776
|
throw new errors.SpyglassError({
|
|
773
777
|
statusCode: _response.error.statusCode,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as spyglass from "../../../../index.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
@@ -8,6 +8,6 @@ import type * as Spyglass from "../../../../index.mjs";
|
|
|
8
8
|
export interface GetBrandLandingPagesRequest {
|
|
9
9
|
/** Brand or creator id returned by POST /brands or POST /creators. */
|
|
10
10
|
id: string;
|
|
11
|
-
showInactive?:
|
|
11
|
+
showInactive?: spyglass.GetBrandLandingPagesRequestShowInactive;
|
|
12
12
|
limit?: number;
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as spyglass from "../../../../index.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
@@ -9,7 +9,7 @@ import type * as Spyglass from "../../../../index.mjs";
|
|
|
9
9
|
export interface GetBrandMediaInsightsRequest {
|
|
10
10
|
/** Brand or creator id returned by POST /brands or POST /creators. */
|
|
11
11
|
id: string;
|
|
12
|
-
type:
|
|
12
|
+
type: spyglass.GetBrandMediaInsightsRequestType;
|
|
13
13
|
maxDaysBack?: number;
|
|
14
14
|
limit?: number;
|
|
15
15
|
}
|
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
* limit: 20
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface GetMediaRequest {
|
|
9
9
|
/** Brand id given as a platform string or uuid */
|
|
10
|
-
brandId?:
|
|
10
|
+
brandId?: GetMediaRequest.BrandId;
|
|
11
11
|
query?: string;
|
|
12
|
-
channel?:
|
|
13
|
-
format?:
|
|
14
|
-
duration?:
|
|
15
|
-
status?:
|
|
16
|
-
categories?:
|
|
12
|
+
channel?: GetMediaRequest.Channel.Item[];
|
|
13
|
+
format?: GetMediaRequest.Format.Item[];
|
|
14
|
+
duration?: GetMediaRequest.Duration.Item[];
|
|
15
|
+
status?: GetMediaRequest.Status;
|
|
16
|
+
categories?: GetMediaRequest.Categories.Item[];
|
|
17
17
|
taxonomy?: string[];
|
|
18
|
-
funnelStage?:
|
|
19
|
-
language?:
|
|
18
|
+
funnelStage?: GetMediaRequest.FunnelStage.Item[];
|
|
19
|
+
language?: GetMediaRequest.Language.Item[];
|
|
20
20
|
location?: string[];
|
|
21
|
-
datePreset?:
|
|
21
|
+
datePreset?: GetMediaRequest.DatePreset;
|
|
22
22
|
startDate?: string;
|
|
23
23
|
endDate?: string;
|
|
24
24
|
minDaysRun?: number;
|
|
@@ -26,15 +26,15 @@ export interface GetMediaV2Request {
|
|
|
26
26
|
minViewCount?: number;
|
|
27
27
|
maxViewCount?: number;
|
|
28
28
|
landingPage?: string;
|
|
29
|
-
landingPageMatch?:
|
|
29
|
+
landingPageMatch?: GetMediaRequest.LandingPageMatch;
|
|
30
30
|
lowImpressions?: boolean;
|
|
31
31
|
partnershipAd?: boolean;
|
|
32
32
|
crossposted?: boolean;
|
|
33
|
-
sortBy?:
|
|
33
|
+
sortBy?: GetMediaRequest.SortBy;
|
|
34
34
|
limit?: number;
|
|
35
35
|
offset?: number;
|
|
36
36
|
}
|
|
37
|
-
export declare namespace
|
|
37
|
+
export declare namespace GetMediaRequest {
|
|
38
38
|
/**
|
|
39
39
|
* Brand id given as a platform string or uuid
|
|
40
40
|
*/
|