@spyglasshq/sdk 0.1.0 → 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/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 +85 -85
- package/dist/cjs/api/resources/search/client/Client.js +145 -145
- 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 +85 -85
- package/dist/esm/api/resources/search/client/Client.mjs +145 -145
- 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 +23 -23
|
@@ -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
|
*/
|
|
@@ -58,30 +58,30 @@ export class SearchClient {
|
|
|
58
58
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
59
59
|
* row even when nothing matches.
|
|
60
60
|
*
|
|
61
|
-
* @param {
|
|
61
|
+
* @param {spyglass.SearchBrandsRequest} request
|
|
62
62
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
63
|
*
|
|
64
|
-
* @throws {@link
|
|
65
|
-
* @throws {@link
|
|
66
|
-
* @throws {@link
|
|
67
|
-
* @throws {@link
|
|
68
|
-
* @throws {@link
|
|
69
|
-
* @throws {@link
|
|
70
|
-
* @throws {@link
|
|
71
|
-
* @throws {@link
|
|
64
|
+
* @throws {@link spyglass.BadRequestError}
|
|
65
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
66
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
67
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
68
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
69
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
70
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
71
|
+
* @throws {@link spyglass.InternalServerError}
|
|
72
72
|
* @throws {@link errors.SpyglassError}
|
|
73
73
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
74
74
|
*
|
|
75
75
|
* @example
|
|
76
|
-
* await client.search.
|
|
76
|
+
* await client.search.brands({
|
|
77
77
|
* names: ["Nike"],
|
|
78
78
|
* limit: 3
|
|
79
79
|
* })
|
|
80
80
|
*/
|
|
81
|
-
|
|
82
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
81
|
+
brands(request = {}, requestOptions) {
|
|
82
|
+
return core.HttpResponsePromise.fromPromise(this.__brands(request, requestOptions));
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
__brands() {
|
|
85
85
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
86
86
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
87
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
@@ -106,21 +106,21 @@ export class SearchClient {
|
|
|
106
106
|
if (_response.error.reason === "status-code") {
|
|
107
107
|
switch (_response.error.statusCode) {
|
|
108
108
|
case 400:
|
|
109
|
-
throw new
|
|
109
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
110
110
|
case 401:
|
|
111
|
-
throw new
|
|
111
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
112
112
|
case 402:
|
|
113
|
-
throw new
|
|
113
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
114
114
|
case 403:
|
|
115
|
-
throw new
|
|
115
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
116
116
|
case 405:
|
|
117
|
-
throw new
|
|
117
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
118
118
|
case 413:
|
|
119
|
-
throw new
|
|
119
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
120
120
|
case 429:
|
|
121
|
-
throw new
|
|
121
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
122
122
|
case 500:
|
|
123
|
-
throw new
|
|
123
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
124
124
|
default:
|
|
125
125
|
throw new errors.SpyglassError({
|
|
126
126
|
statusCode: _response.error.statusCode,
|
|
@@ -169,17 +169,17 @@ export class SearchClient {
|
|
|
169
169
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
170
170
|
* row even when nothing matches.
|
|
171
171
|
*
|
|
172
|
-
* @param {
|
|
172
|
+
* @param {spyglass.SearchCreatorsRequest} request
|
|
173
173
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
174
174
|
*
|
|
175
|
-
* @throws {@link
|
|
176
|
-
* @throws {@link
|
|
177
|
-
* @throws {@link
|
|
178
|
-
* @throws {@link
|
|
179
|
-
* @throws {@link
|
|
180
|
-
* @throws {@link
|
|
181
|
-
* @throws {@link
|
|
182
|
-
* @throws {@link
|
|
175
|
+
* @throws {@link spyglass.BadRequestError}
|
|
176
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
177
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
178
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
179
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
180
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
181
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
182
|
+
* @throws {@link spyglass.InternalServerError}
|
|
183
183
|
* @throws {@link errors.SpyglassError}
|
|
184
184
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
185
185
|
*
|
|
@@ -218,21 +218,21 @@ export class SearchClient {
|
|
|
218
218
|
if (_response.error.reason === "status-code") {
|
|
219
219
|
switch (_response.error.statusCode) {
|
|
220
220
|
case 400:
|
|
221
|
-
throw new
|
|
221
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
222
222
|
case 401:
|
|
223
|
-
throw new
|
|
223
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
224
224
|
case 402:
|
|
225
|
-
throw new
|
|
225
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
226
226
|
case 403:
|
|
227
|
-
throw new
|
|
227
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
228
228
|
case 405:
|
|
229
|
-
throw new
|
|
229
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
230
230
|
case 413:
|
|
231
|
-
throw new
|
|
231
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
232
232
|
case 429:
|
|
233
|
-
throw new
|
|
233
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
234
234
|
case 500:
|
|
235
|
-
throw new
|
|
235
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
236
236
|
default:
|
|
237
237
|
throw new errors.SpyglassError({
|
|
238
238
|
statusCode: _response.error.statusCode,
|
|
@@ -253,17 +253,17 @@ export class SearchClient {
|
|
|
253
253
|
* Costs 2,000 microdollars ($0.0020) per account returned, charged against your plan's monthly credits.
|
|
254
254
|
* An id that matches nothing returns 404 and is free.
|
|
255
255
|
*
|
|
256
|
-
* @param {
|
|
256
|
+
* @param {spyglass.GetAccountRequest} request
|
|
257
257
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
258
258
|
*
|
|
259
|
-
* @throws {@link
|
|
260
|
-
* @throws {@link
|
|
261
|
-
* @throws {@link
|
|
262
|
-
* @throws {@link
|
|
263
|
-
* @throws {@link
|
|
264
|
-
* @throws {@link
|
|
265
|
-
* @throws {@link
|
|
266
|
-
* @throws {@link
|
|
259
|
+
* @throws {@link spyglass.BadRequestError}
|
|
260
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
261
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
262
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
263
|
+
* @throws {@link spyglass.NotFoundError}
|
|
264
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
265
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
266
|
+
* @throws {@link spyglass.InternalServerError}
|
|
267
267
|
* @throws {@link errors.SpyglassError}
|
|
268
268
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
269
269
|
*
|
|
@@ -298,21 +298,21 @@ export class SearchClient {
|
|
|
298
298
|
if (_response.error.reason === "status-code") {
|
|
299
299
|
switch (_response.error.statusCode) {
|
|
300
300
|
case 400:
|
|
301
|
-
throw new
|
|
301
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
302
302
|
case 401:
|
|
303
|
-
throw new
|
|
303
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
304
304
|
case 402:
|
|
305
|
-
throw new
|
|
305
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
306
306
|
case 403:
|
|
307
|
-
throw new
|
|
307
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
308
308
|
case 404:
|
|
309
|
-
throw new
|
|
309
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
310
310
|
case 405:
|
|
311
|
-
throw new
|
|
311
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
312
312
|
case 429:
|
|
313
|
-
throw new
|
|
313
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
314
314
|
case 500:
|
|
315
|
-
throw new
|
|
315
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
316
316
|
default:
|
|
317
317
|
throw new errors.SpyglassError({
|
|
318
318
|
statusCode: _response.error.statusCode,
|
|
@@ -332,16 +332,16 @@ export class SearchClient {
|
|
|
332
332
|
* Limited to 120 requests per minute per user.
|
|
333
333
|
* This call is free and does not use credits.
|
|
334
334
|
*
|
|
335
|
-
* @param {
|
|
335
|
+
* @param {spyglass.SearchTaxonomiesRequest} request
|
|
336
336
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
337
337
|
*
|
|
338
|
-
* @throws {@link
|
|
339
|
-
* @throws {@link
|
|
340
|
-
* @throws {@link
|
|
341
|
-
* @throws {@link
|
|
342
|
-
* @throws {@link
|
|
343
|
-
* @throws {@link
|
|
344
|
-
* @throws {@link
|
|
338
|
+
* @throws {@link spyglass.BadRequestError}
|
|
339
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
340
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
341
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
342
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
343
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
344
|
+
* @throws {@link spyglass.InternalServerError}
|
|
345
345
|
* @throws {@link errors.SpyglassError}
|
|
346
346
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
347
347
|
*
|
|
@@ -384,19 +384,19 @@ export class SearchClient {
|
|
|
384
384
|
if (_response.error.reason === "status-code") {
|
|
385
385
|
switch (_response.error.statusCode) {
|
|
386
386
|
case 400:
|
|
387
|
-
throw new
|
|
387
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
388
388
|
case 401:
|
|
389
|
-
throw new
|
|
389
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
390
390
|
case 402:
|
|
391
|
-
throw new
|
|
391
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
392
392
|
case 403:
|
|
393
|
-
throw new
|
|
393
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
394
394
|
case 405:
|
|
395
|
-
throw new
|
|
395
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
396
396
|
case 429:
|
|
397
|
-
throw new
|
|
397
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
398
398
|
case 500:
|
|
399
|
-
throw new
|
|
399
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
400
400
|
default:
|
|
401
401
|
throw new errors.SpyglassError({
|
|
402
402
|
statusCode: _response.error.statusCode,
|
|
@@ -418,31 +418,31 @@ export class SearchClient {
|
|
|
418
418
|
* The call bills a minimum of one row even when nothing matches. In that
|
|
419
419
|
* case `count` is 0 but you are charged for one row.
|
|
420
420
|
*
|
|
421
|
-
* @param {
|
|
421
|
+
* @param {spyglass.GetMediaRequest} request
|
|
422
422
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
423
423
|
*
|
|
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
|
|
424
|
+
* @throws {@link spyglass.BadRequestError}
|
|
425
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
426
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
427
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
428
|
+
* @throws {@link spyglass.NotFoundError}
|
|
429
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
430
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
431
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
432
|
+
* @throws {@link spyglass.InternalServerError}
|
|
433
433
|
* @throws {@link errors.SpyglassError}
|
|
434
434
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
435
435
|
*
|
|
436
436
|
* @example
|
|
437
|
-
* await client.search.
|
|
437
|
+
* await client.search.getMedia({
|
|
438
438
|
* query: "comfort-focused video ads",
|
|
439
439
|
* limit: 20
|
|
440
440
|
* })
|
|
441
441
|
*/
|
|
442
|
-
|
|
443
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
442
|
+
getMedia(request = {}, requestOptions) {
|
|
443
|
+
return core.HttpResponsePromise.fromPromise(this.__getMedia(request, requestOptions));
|
|
444
444
|
}
|
|
445
|
-
|
|
445
|
+
__getMedia() {
|
|
446
446
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
447
447
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
448
448
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
@@ -467,23 +467,23 @@ export class SearchClient {
|
|
|
467
467
|
if (_response.error.reason === "status-code") {
|
|
468
468
|
switch (_response.error.statusCode) {
|
|
469
469
|
case 400:
|
|
470
|
-
throw new
|
|
470
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
471
471
|
case 401:
|
|
472
|
-
throw new
|
|
472
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
473
473
|
case 402:
|
|
474
|
-
throw new
|
|
474
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
475
475
|
case 403:
|
|
476
|
-
throw new
|
|
476
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
477
477
|
case 404:
|
|
478
|
-
throw new
|
|
478
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
479
479
|
case 405:
|
|
480
|
-
throw new
|
|
480
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
481
481
|
case 413:
|
|
482
|
-
throw new
|
|
482
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
483
483
|
case 429:
|
|
484
|
-
throw new
|
|
484
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
485
485
|
case 500:
|
|
486
|
-
throw new
|
|
486
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
487
487
|
default:
|
|
488
488
|
throw new errors.SpyglassError({
|
|
489
489
|
statusCode: _response.error.statusCode,
|
|
@@ -506,17 +506,17 @@ export class SearchClient {
|
|
|
506
506
|
* Limited to 120 requests per minute per user.
|
|
507
507
|
* 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
508
|
*
|
|
509
|
-
* @param {
|
|
509
|
+
* @param {spyglass.GetBrandMediaInsightsRequest} request
|
|
510
510
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
511
511
|
*
|
|
512
|
-
* @throws {@link
|
|
513
|
-
* @throws {@link
|
|
514
|
-
* @throws {@link
|
|
515
|
-
* @throws {@link
|
|
516
|
-
* @throws {@link
|
|
517
|
-
* @throws {@link
|
|
518
|
-
* @throws {@link
|
|
519
|
-
* @throws {@link
|
|
512
|
+
* @throws {@link spyglass.BadRequestError}
|
|
513
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
514
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
515
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
516
|
+
* @throws {@link spyglass.NotFoundError}
|
|
517
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
518
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
519
|
+
* @throws {@link spyglass.InternalServerError}
|
|
520
520
|
* @throws {@link errors.SpyglassError}
|
|
521
521
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
522
522
|
*
|
|
@@ -564,21 +564,21 @@ export class SearchClient {
|
|
|
564
564
|
if (_response.error.reason === "status-code") {
|
|
565
565
|
switch (_response.error.statusCode) {
|
|
566
566
|
case 400:
|
|
567
|
-
throw new
|
|
567
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
568
568
|
case 401:
|
|
569
|
-
throw new
|
|
569
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
570
570
|
case 402:
|
|
571
|
-
throw new
|
|
571
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
572
572
|
case 403:
|
|
573
|
-
throw new
|
|
573
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
574
574
|
case 404:
|
|
575
|
-
throw new
|
|
575
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
576
576
|
case 405:
|
|
577
|
-
throw new
|
|
577
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
578
578
|
case 429:
|
|
579
|
-
throw new
|
|
579
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
580
580
|
case 500:
|
|
581
|
-
throw new
|
|
581
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
582
582
|
default:
|
|
583
583
|
throw new errors.SpyglassError({
|
|
584
584
|
statusCode: _response.error.statusCode,
|
|
@@ -597,17 +597,17 @@ export class SearchClient {
|
|
|
597
597
|
* Limited to 120 requests per minute per user.
|
|
598
598
|
* 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
599
|
*
|
|
600
|
-
* @param {
|
|
600
|
+
* @param {spyglass.GetBrandLandingPagesRequest} request
|
|
601
601
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
602
602
|
*
|
|
603
|
-
* @throws {@link
|
|
604
|
-
* @throws {@link
|
|
605
|
-
* @throws {@link
|
|
606
|
-
* @throws {@link
|
|
607
|
-
* @throws {@link
|
|
608
|
-
* @throws {@link
|
|
609
|
-
* @throws {@link
|
|
610
|
-
* @throws {@link
|
|
603
|
+
* @throws {@link spyglass.BadRequestError}
|
|
604
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
605
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
606
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
607
|
+
* @throws {@link spyglass.NotFoundError}
|
|
608
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
609
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
610
|
+
* @throws {@link spyglass.InternalServerError}
|
|
611
611
|
* @throws {@link errors.SpyglassError}
|
|
612
612
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
613
613
|
*
|
|
@@ -653,21 +653,21 @@ export class SearchClient {
|
|
|
653
653
|
if (_response.error.reason === "status-code") {
|
|
654
654
|
switch (_response.error.statusCode) {
|
|
655
655
|
case 400:
|
|
656
|
-
throw new
|
|
656
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
657
657
|
case 401:
|
|
658
|
-
throw new
|
|
658
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
659
659
|
case 402:
|
|
660
|
-
throw new
|
|
660
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
661
661
|
case 403:
|
|
662
|
-
throw new
|
|
662
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
663
663
|
case 404:
|
|
664
|
-
throw new
|
|
664
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
665
665
|
case 405:
|
|
666
|
-
throw new
|
|
666
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
667
667
|
case 429:
|
|
668
|
-
throw new
|
|
668
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
669
669
|
case 500:
|
|
670
|
-
throw new
|
|
670
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
671
671
|
default:
|
|
672
672
|
throw new errors.SpyglassError({
|
|
673
673
|
statusCode: _response.error.statusCode,
|
|
@@ -704,17 +704,17 @@ export class SearchClient {
|
|
|
704
704
|
* Each comment page fetched live (`limit`, default 1) is one billed
|
|
705
705
|
* unit. Cached posts do not scrape and are not billed.
|
|
706
706
|
*
|
|
707
|
-
* @param {
|
|
707
|
+
* @param {spyglass.GetCommentsRequest} request
|
|
708
708
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
709
709
|
*
|
|
710
|
-
* @throws {@link
|
|
711
|
-
* @throws {@link
|
|
712
|
-
* @throws {@link
|
|
713
|
-
* @throws {@link
|
|
714
|
-
* @throws {@link
|
|
715
|
-
* @throws {@link
|
|
716
|
-
* @throws {@link
|
|
717
|
-
* @throws {@link
|
|
710
|
+
* @throws {@link spyglass.BadRequestError}
|
|
711
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
712
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
713
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
714
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
715
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
716
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
717
|
+
* @throws {@link spyglass.InternalServerError}
|
|
718
718
|
* @throws {@link errors.SpyglassError}
|
|
719
719
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
720
720
|
*
|
|
@@ -753,21 +753,21 @@ export class SearchClient {
|
|
|
753
753
|
if (_response.error.reason === "status-code") {
|
|
754
754
|
switch (_response.error.statusCode) {
|
|
755
755
|
case 400:
|
|
756
|
-
throw new
|
|
756
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
757
757
|
case 401:
|
|
758
|
-
throw new
|
|
758
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
759
759
|
case 402:
|
|
760
|
-
throw new
|
|
760
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
761
761
|
case 403:
|
|
762
|
-
throw new
|
|
762
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
763
763
|
case 405:
|
|
764
|
-
throw new
|
|
764
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
765
765
|
case 413:
|
|
766
|
-
throw new
|
|
766
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
767
767
|
case 429:
|
|
768
|
-
throw new
|
|
768
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
769
769
|
case 500:
|
|
770
|
-
throw new
|
|
770
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
771
771
|
default:
|
|
772
772
|
throw new errors.SpyglassError({
|
|
773
773
|
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
|
*/
|