@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
|
@@ -51,7 +51,7 @@ const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
|
51
51
|
const environments = __importStar(require("../../../../environments.js"));
|
|
52
52
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
53
53
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
54
|
-
const
|
|
54
|
+
const spyglass = __importStar(require("../../../index.js"));
|
|
55
55
|
/**
|
|
56
56
|
* Search accounts, ads, and related data.
|
|
57
57
|
*/
|
|
@@ -94,30 +94,30 @@ class SearchClient {
|
|
|
94
94
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
95
95
|
* row even when nothing matches.
|
|
96
96
|
*
|
|
97
|
-
* @param {
|
|
97
|
+
* @param {spyglass.SearchBrandsRequest} request
|
|
98
98
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
99
99
|
*
|
|
100
|
-
* @throws {@link
|
|
101
|
-
* @throws {@link
|
|
102
|
-
* @throws {@link
|
|
103
|
-
* @throws {@link
|
|
104
|
-
* @throws {@link
|
|
105
|
-
* @throws {@link
|
|
106
|
-
* @throws {@link
|
|
107
|
-
* @throws {@link
|
|
100
|
+
* @throws {@link spyglass.BadRequestError}
|
|
101
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
102
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
103
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
104
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
105
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
106
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
107
|
+
* @throws {@link spyglass.InternalServerError}
|
|
108
108
|
* @throws {@link errors.SpyglassError}
|
|
109
109
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
110
110
|
*
|
|
111
111
|
* @example
|
|
112
|
-
* await client.search.
|
|
112
|
+
* await client.search.brands({
|
|
113
113
|
* names: ["Nike"],
|
|
114
114
|
* limit: 3
|
|
115
115
|
* })
|
|
116
116
|
*/
|
|
117
|
-
|
|
118
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
117
|
+
brands(request = {}, requestOptions) {
|
|
118
|
+
return core.HttpResponsePromise.fromPromise(this.__brands(request, requestOptions));
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
__brands() {
|
|
121
121
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
122
122
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
123
123
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
@@ -142,21 +142,21 @@ class SearchClient {
|
|
|
142
142
|
if (_response.error.reason === "status-code") {
|
|
143
143
|
switch (_response.error.statusCode) {
|
|
144
144
|
case 400:
|
|
145
|
-
throw new
|
|
145
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
146
146
|
case 401:
|
|
147
|
-
throw new
|
|
147
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
148
148
|
case 402:
|
|
149
|
-
throw new
|
|
149
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
150
150
|
case 403:
|
|
151
|
-
throw new
|
|
151
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
152
152
|
case 405:
|
|
153
|
-
throw new
|
|
153
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
154
154
|
case 413:
|
|
155
|
-
throw new
|
|
155
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
156
156
|
case 429:
|
|
157
|
-
throw new
|
|
157
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
158
158
|
case 500:
|
|
159
|
-
throw new
|
|
159
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
160
160
|
default:
|
|
161
161
|
throw new errors.SpyglassError({
|
|
162
162
|
statusCode: _response.error.statusCode,
|
|
@@ -205,17 +205,17 @@ class SearchClient {
|
|
|
205
205
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
206
206
|
* row even when nothing matches.
|
|
207
207
|
*
|
|
208
|
-
* @param {
|
|
208
|
+
* @param {spyglass.SearchCreatorsRequest} request
|
|
209
209
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
210
210
|
*
|
|
211
|
-
* @throws {@link
|
|
212
|
-
* @throws {@link
|
|
213
|
-
* @throws {@link
|
|
214
|
-
* @throws {@link
|
|
215
|
-
* @throws {@link
|
|
216
|
-
* @throws {@link
|
|
217
|
-
* @throws {@link
|
|
218
|
-
* @throws {@link
|
|
211
|
+
* @throws {@link spyglass.BadRequestError}
|
|
212
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
213
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
214
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
215
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
216
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
217
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
218
|
+
* @throws {@link spyglass.InternalServerError}
|
|
219
219
|
* @throws {@link errors.SpyglassError}
|
|
220
220
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
221
221
|
*
|
|
@@ -254,21 +254,21 @@ class SearchClient {
|
|
|
254
254
|
if (_response.error.reason === "status-code") {
|
|
255
255
|
switch (_response.error.statusCode) {
|
|
256
256
|
case 400:
|
|
257
|
-
throw new
|
|
257
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
258
258
|
case 401:
|
|
259
|
-
throw new
|
|
259
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
260
260
|
case 402:
|
|
261
|
-
throw new
|
|
261
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
262
262
|
case 403:
|
|
263
|
-
throw new
|
|
263
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
264
264
|
case 405:
|
|
265
|
-
throw new
|
|
265
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
266
266
|
case 413:
|
|
267
|
-
throw new
|
|
267
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
268
268
|
case 429:
|
|
269
|
-
throw new
|
|
269
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
270
270
|
case 500:
|
|
271
|
-
throw new
|
|
271
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
272
272
|
default:
|
|
273
273
|
throw new errors.SpyglassError({
|
|
274
274
|
statusCode: _response.error.statusCode,
|
|
@@ -289,17 +289,17 @@ class SearchClient {
|
|
|
289
289
|
* Costs 2,000 microdollars ($0.0020) per account returned, charged against your plan's monthly credits.
|
|
290
290
|
* An id that matches nothing returns 404 and is free.
|
|
291
291
|
*
|
|
292
|
-
* @param {
|
|
292
|
+
* @param {spyglass.GetAccountRequest} request
|
|
293
293
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
294
294
|
*
|
|
295
|
-
* @throws {@link
|
|
296
|
-
* @throws {@link
|
|
297
|
-
* @throws {@link
|
|
298
|
-
* @throws {@link
|
|
299
|
-
* @throws {@link
|
|
300
|
-
* @throws {@link
|
|
301
|
-
* @throws {@link
|
|
302
|
-
* @throws {@link
|
|
295
|
+
* @throws {@link spyglass.BadRequestError}
|
|
296
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
297
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
298
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
299
|
+
* @throws {@link spyglass.NotFoundError}
|
|
300
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
301
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
302
|
+
* @throws {@link spyglass.InternalServerError}
|
|
303
303
|
* @throws {@link errors.SpyglassError}
|
|
304
304
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
305
305
|
*
|
|
@@ -334,21 +334,21 @@ class SearchClient {
|
|
|
334
334
|
if (_response.error.reason === "status-code") {
|
|
335
335
|
switch (_response.error.statusCode) {
|
|
336
336
|
case 400:
|
|
337
|
-
throw new
|
|
337
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
338
338
|
case 401:
|
|
339
|
-
throw new
|
|
339
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
340
340
|
case 402:
|
|
341
|
-
throw new
|
|
341
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
342
342
|
case 403:
|
|
343
|
-
throw new
|
|
343
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
344
344
|
case 404:
|
|
345
|
-
throw new
|
|
345
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
346
346
|
case 405:
|
|
347
|
-
throw new
|
|
347
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
348
348
|
case 429:
|
|
349
|
-
throw new
|
|
349
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
350
350
|
case 500:
|
|
351
|
-
throw new
|
|
351
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
352
352
|
default:
|
|
353
353
|
throw new errors.SpyglassError({
|
|
354
354
|
statusCode: _response.error.statusCode,
|
|
@@ -368,16 +368,16 @@ class SearchClient {
|
|
|
368
368
|
* Limited to 120 requests per minute per user.
|
|
369
369
|
* This call is free and does not use credits.
|
|
370
370
|
*
|
|
371
|
-
* @param {
|
|
371
|
+
* @param {spyglass.SearchTaxonomiesRequest} request
|
|
372
372
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
373
373
|
*
|
|
374
|
-
* @throws {@link
|
|
375
|
-
* @throws {@link
|
|
376
|
-
* @throws {@link
|
|
377
|
-
* @throws {@link
|
|
378
|
-
* @throws {@link
|
|
379
|
-
* @throws {@link
|
|
380
|
-
* @throws {@link
|
|
374
|
+
* @throws {@link spyglass.BadRequestError}
|
|
375
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
376
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
377
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
378
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
379
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
380
|
+
* @throws {@link spyglass.InternalServerError}
|
|
381
381
|
* @throws {@link errors.SpyglassError}
|
|
382
382
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
383
383
|
*
|
|
@@ -420,19 +420,19 @@ class SearchClient {
|
|
|
420
420
|
if (_response.error.reason === "status-code") {
|
|
421
421
|
switch (_response.error.statusCode) {
|
|
422
422
|
case 400:
|
|
423
|
-
throw new
|
|
423
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
424
424
|
case 401:
|
|
425
|
-
throw new
|
|
425
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
426
426
|
case 402:
|
|
427
|
-
throw new
|
|
427
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
428
428
|
case 403:
|
|
429
|
-
throw new
|
|
429
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
430
430
|
case 405:
|
|
431
|
-
throw new
|
|
431
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
432
432
|
case 429:
|
|
433
|
-
throw new
|
|
433
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
434
434
|
case 500:
|
|
435
|
-
throw new
|
|
435
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
436
436
|
default:
|
|
437
437
|
throw new errors.SpyglassError({
|
|
438
438
|
statusCode: _response.error.statusCode,
|
|
@@ -454,31 +454,31 @@ class SearchClient {
|
|
|
454
454
|
* The call bills a minimum of one row even when nothing matches. In that
|
|
455
455
|
* case `count` is 0 but you are charged for one row.
|
|
456
456
|
*
|
|
457
|
-
* @param {
|
|
457
|
+
* @param {spyglass.GetMediaRequest} request
|
|
458
458
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
459
459
|
*
|
|
460
|
-
* @throws {@link
|
|
461
|
-
* @throws {@link
|
|
462
|
-
* @throws {@link
|
|
463
|
-
* @throws {@link
|
|
464
|
-
* @throws {@link
|
|
465
|
-
* @throws {@link
|
|
466
|
-
* @throws {@link
|
|
467
|
-
* @throws {@link
|
|
468
|
-
* @throws {@link
|
|
460
|
+
* @throws {@link spyglass.BadRequestError}
|
|
461
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
462
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
463
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
464
|
+
* @throws {@link spyglass.NotFoundError}
|
|
465
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
466
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
467
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
468
|
+
* @throws {@link spyglass.InternalServerError}
|
|
469
469
|
* @throws {@link errors.SpyglassError}
|
|
470
470
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
471
471
|
*
|
|
472
472
|
* @example
|
|
473
|
-
* await client.search.
|
|
473
|
+
* await client.search.getMedia({
|
|
474
474
|
* query: "comfort-focused video ads",
|
|
475
475
|
* limit: 20
|
|
476
476
|
* })
|
|
477
477
|
*/
|
|
478
|
-
|
|
479
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
478
|
+
getMedia(request = {}, requestOptions) {
|
|
479
|
+
return core.HttpResponsePromise.fromPromise(this.__getMedia(request, requestOptions));
|
|
480
480
|
}
|
|
481
|
-
|
|
481
|
+
__getMedia() {
|
|
482
482
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
483
483
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
484
484
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
@@ -503,23 +503,23 @@ class SearchClient {
|
|
|
503
503
|
if (_response.error.reason === "status-code") {
|
|
504
504
|
switch (_response.error.statusCode) {
|
|
505
505
|
case 400:
|
|
506
|
-
throw new
|
|
506
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
507
507
|
case 401:
|
|
508
|
-
throw new
|
|
508
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
509
509
|
case 402:
|
|
510
|
-
throw new
|
|
510
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
511
511
|
case 403:
|
|
512
|
-
throw new
|
|
512
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
513
513
|
case 404:
|
|
514
|
-
throw new
|
|
514
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
515
515
|
case 405:
|
|
516
|
-
throw new
|
|
516
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
517
517
|
case 413:
|
|
518
|
-
throw new
|
|
518
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
519
519
|
case 429:
|
|
520
|
-
throw new
|
|
520
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
521
521
|
case 500:
|
|
522
|
-
throw new
|
|
522
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
523
523
|
default:
|
|
524
524
|
throw new errors.SpyglassError({
|
|
525
525
|
statusCode: _response.error.statusCode,
|
|
@@ -542,17 +542,17 @@ class SearchClient {
|
|
|
542
542
|
* Limited to 120 requests per minute per user.
|
|
543
543
|
* 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.
|
|
544
544
|
*
|
|
545
|
-
* @param {
|
|
545
|
+
* @param {spyglass.GetBrandMediaInsightsRequest} request
|
|
546
546
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
547
547
|
*
|
|
548
|
-
* @throws {@link
|
|
549
|
-
* @throws {@link
|
|
550
|
-
* @throws {@link
|
|
551
|
-
* @throws {@link
|
|
552
|
-
* @throws {@link
|
|
553
|
-
* @throws {@link
|
|
554
|
-
* @throws {@link
|
|
555
|
-
* @throws {@link
|
|
548
|
+
* @throws {@link spyglass.BadRequestError}
|
|
549
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
550
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
551
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
552
|
+
* @throws {@link spyglass.NotFoundError}
|
|
553
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
554
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
555
|
+
* @throws {@link spyglass.InternalServerError}
|
|
556
556
|
* @throws {@link errors.SpyglassError}
|
|
557
557
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
558
558
|
*
|
|
@@ -600,21 +600,21 @@ class SearchClient {
|
|
|
600
600
|
if (_response.error.reason === "status-code") {
|
|
601
601
|
switch (_response.error.statusCode) {
|
|
602
602
|
case 400:
|
|
603
|
-
throw new
|
|
603
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
604
604
|
case 401:
|
|
605
|
-
throw new
|
|
605
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
606
606
|
case 402:
|
|
607
|
-
throw new
|
|
607
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
608
608
|
case 403:
|
|
609
|
-
throw new
|
|
609
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
610
610
|
case 404:
|
|
611
|
-
throw new
|
|
611
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
612
612
|
case 405:
|
|
613
|
-
throw new
|
|
613
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
614
614
|
case 429:
|
|
615
|
-
throw new
|
|
615
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
616
616
|
case 500:
|
|
617
|
-
throw new
|
|
617
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
618
618
|
default:
|
|
619
619
|
throw new errors.SpyglassError({
|
|
620
620
|
statusCode: _response.error.statusCode,
|
|
@@ -633,17 +633,17 @@ class SearchClient {
|
|
|
633
633
|
* Limited to 120 requests per minute per user.
|
|
634
634
|
* 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.
|
|
635
635
|
*
|
|
636
|
-
* @param {
|
|
636
|
+
* @param {spyglass.GetBrandLandingPagesRequest} request
|
|
637
637
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
638
638
|
*
|
|
639
|
-
* @throws {@link
|
|
640
|
-
* @throws {@link
|
|
641
|
-
* @throws {@link
|
|
642
|
-
* @throws {@link
|
|
643
|
-
* @throws {@link
|
|
644
|
-
* @throws {@link
|
|
645
|
-
* @throws {@link
|
|
646
|
-
* @throws {@link
|
|
639
|
+
* @throws {@link spyglass.BadRequestError}
|
|
640
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
641
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
642
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
643
|
+
* @throws {@link spyglass.NotFoundError}
|
|
644
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
645
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
646
|
+
* @throws {@link spyglass.InternalServerError}
|
|
647
647
|
* @throws {@link errors.SpyglassError}
|
|
648
648
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
649
649
|
*
|
|
@@ -689,21 +689,21 @@ class SearchClient {
|
|
|
689
689
|
if (_response.error.reason === "status-code") {
|
|
690
690
|
switch (_response.error.statusCode) {
|
|
691
691
|
case 400:
|
|
692
|
-
throw new
|
|
692
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
693
693
|
case 401:
|
|
694
|
-
throw new
|
|
694
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
695
695
|
case 402:
|
|
696
|
-
throw new
|
|
696
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
697
697
|
case 403:
|
|
698
|
-
throw new
|
|
698
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
699
699
|
case 404:
|
|
700
|
-
throw new
|
|
700
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
701
701
|
case 405:
|
|
702
|
-
throw new
|
|
702
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
703
703
|
case 429:
|
|
704
|
-
throw new
|
|
704
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
705
705
|
case 500:
|
|
706
|
-
throw new
|
|
706
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
707
707
|
default:
|
|
708
708
|
throw new errors.SpyglassError({
|
|
709
709
|
statusCode: _response.error.statusCode,
|
|
@@ -740,17 +740,17 @@ class SearchClient {
|
|
|
740
740
|
* Each comment page fetched live (`limit`, default 1) is one billed
|
|
741
741
|
* unit. Cached posts do not scrape and are not billed.
|
|
742
742
|
*
|
|
743
|
-
* @param {
|
|
743
|
+
* @param {spyglass.GetCommentsRequest} request
|
|
744
744
|
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
745
745
|
*
|
|
746
|
-
* @throws {@link
|
|
747
|
-
* @throws {@link
|
|
748
|
-
* @throws {@link
|
|
749
|
-
* @throws {@link
|
|
750
|
-
* @throws {@link
|
|
751
|
-
* @throws {@link
|
|
752
|
-
* @throws {@link
|
|
753
|
-
* @throws {@link
|
|
746
|
+
* @throws {@link spyglass.BadRequestError}
|
|
747
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
748
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
749
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
750
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
751
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
752
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
753
|
+
* @throws {@link spyglass.InternalServerError}
|
|
754
754
|
* @throws {@link errors.SpyglassError}
|
|
755
755
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
756
756
|
*
|
|
@@ -789,21 +789,21 @@ class SearchClient {
|
|
|
789
789
|
if (_response.error.reason === "status-code") {
|
|
790
790
|
switch (_response.error.statusCode) {
|
|
791
791
|
case 400:
|
|
792
|
-
throw new
|
|
792
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
793
793
|
case 401:
|
|
794
|
-
throw new
|
|
794
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
795
795
|
case 402:
|
|
796
|
-
throw new
|
|
796
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
797
797
|
case 403:
|
|
798
|
-
throw new
|
|
798
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
799
799
|
case 405:
|
|
800
|
-
throw new
|
|
800
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
801
801
|
case 413:
|
|
802
|
-
throw new
|
|
802
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
803
803
|
case 429:
|
|
804
|
-
throw new
|
|
804
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
805
805
|
case 500:
|
|
806
|
-
throw new
|
|
806
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
807
807
|
default:
|
|
808
808
|
throw new errors.SpyglassError({
|
|
809
809
|
statusCode: _response.error.statusCode,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as spyglass from "../../../../index.js";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
@@ -8,6 +8,6 @@ import type * as Spyglass from "../../../../index.js";
|
|
|
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.js";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
@@ -9,7 +9,7 @@ import type * as Spyglass from "../../../../index.js";
|
|
|
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
|
*/
|