@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.
Files changed (77) hide show
  1. package/README.md +248 -66
  2. package/dist/cjs/BaseClient.js +3 -3
  3. package/dist/cjs/Client.d.ts +4 -4
  4. package/dist/cjs/Client.js +3 -3
  5. package/dist/cjs/api/errors/BadRequestError.d.ts +3 -3
  6. package/dist/cjs/api/errors/ContentTooLargeError.d.ts +3 -3
  7. package/dist/cjs/api/errors/ForbiddenError.d.ts +3 -3
  8. package/dist/cjs/api/errors/InternalServerError.d.ts +3 -3
  9. package/dist/cjs/api/errors/MethodNotAllowedError.d.ts +3 -3
  10. package/dist/cjs/api/errors/NotFoundError.d.ts +3 -3
  11. package/dist/cjs/api/errors/PaymentRequiredError.d.ts +3 -3
  12. package/dist/cjs/api/errors/TooManyRequestsError.d.ts +3 -3
  13. package/dist/cjs/api/errors/UnauthorizedError.d.ts +3 -3
  14. package/dist/cjs/api/resources/account/client/Client.d.ts +9 -9
  15. package/dist/cjs/api/resources/account/client/Client.js +15 -15
  16. package/dist/cjs/api/resources/indexing/client/Client.d.ts +19 -19
  17. package/dist/cjs/api/resources/indexing/client/Client.js +31 -31
  18. package/dist/cjs/api/resources/search/client/Client.d.ts +93 -89
  19. package/dist/cjs/api/resources/search/client/Client.js +153 -149
  20. package/dist/cjs/api/resources/search/client/requests/GetBrandLandingPagesRequest.d.ts +2 -2
  21. package/dist/cjs/api/resources/search/client/requests/GetBrandMediaInsightsRequest.d.ts +2 -2
  22. package/dist/cjs/api/resources/search/client/requests/{GetMediaV2Request.d.ts → GetMediaRequest.d.ts} +13 -13
  23. package/dist/cjs/api/resources/search/client/requests/{GetMediaV2Request.js → GetMediaRequest.js} +14 -14
  24. package/dist/{esm/api/resources/search/client/requests/SearchBrandsV2Request.d.mts → cjs/api/resources/search/client/requests/SearchBrandsRequest.d.ts} +4 -4
  25. package/dist/cjs/api/resources/search/client/requests/{SearchBrandsV2Request.js → SearchBrandsRequest.js} +5 -5
  26. package/dist/cjs/api/resources/search/client/requests/index.d.ts +2 -2
  27. package/dist/cjs/api/resources/search/client/requests/index.js +5 -5
  28. package/dist/cjs/api/resources/search/types/GetAccountResponse.d.ts +2 -2
  29. package/dist/cjs/api/resources/search/types/{GetMediaV2Response.d.ts → GetMediaResponse.d.ts} +3 -3
  30. package/dist/cjs/api/resources/search/types/{GetMediaV2Response.js → GetMediaResponse.js} +5 -5
  31. package/dist/{esm/api/resources/search/types/SearchBrandsV2Response.d.mts → cjs/api/resources/search/types/SearchBrandsResponse.d.ts} +3 -3
  32. package/dist/cjs/api/resources/search/types/{SearchBrandsV2Response.js → SearchBrandsResponse.js} +5 -5
  33. package/dist/cjs/api/resources/search/types/index.d.ts +2 -2
  34. package/dist/cjs/api/resources/search/types/index.js +2 -2
  35. package/dist/cjs/index.d.ts +2 -2
  36. package/dist/cjs/index.js +3 -3
  37. package/dist/cjs/version.d.ts +1 -1
  38. package/dist/cjs/version.js +1 -1
  39. package/dist/esm/BaseClient.mjs +3 -3
  40. package/dist/esm/Client.d.mts +4 -4
  41. package/dist/esm/Client.mjs +1 -1
  42. package/dist/esm/api/errors/BadRequestError.d.mts +3 -3
  43. package/dist/esm/api/errors/ContentTooLargeError.d.mts +3 -3
  44. package/dist/esm/api/errors/ForbiddenError.d.mts +3 -3
  45. package/dist/esm/api/errors/InternalServerError.d.mts +3 -3
  46. package/dist/esm/api/errors/MethodNotAllowedError.d.mts +3 -3
  47. package/dist/esm/api/errors/NotFoundError.d.mts +3 -3
  48. package/dist/esm/api/errors/PaymentRequiredError.d.mts +3 -3
  49. package/dist/esm/api/errors/TooManyRequestsError.d.mts +3 -3
  50. package/dist/esm/api/errors/UnauthorizedError.d.mts +3 -3
  51. package/dist/esm/api/resources/account/client/Client.d.mts +9 -9
  52. package/dist/esm/api/resources/account/client/Client.mjs +15 -15
  53. package/dist/esm/api/resources/indexing/client/Client.d.mts +19 -19
  54. package/dist/esm/api/resources/indexing/client/Client.mjs +31 -31
  55. package/dist/esm/api/resources/search/client/Client.d.mts +93 -89
  56. package/dist/esm/api/resources/search/client/Client.mjs +153 -149
  57. package/dist/esm/api/resources/search/client/requests/GetBrandLandingPagesRequest.d.mts +2 -2
  58. package/dist/esm/api/resources/search/client/requests/GetBrandMediaInsightsRequest.d.mts +2 -2
  59. package/dist/esm/api/resources/search/client/requests/{GetMediaV2Request.d.mts → GetMediaRequest.d.mts} +13 -13
  60. package/dist/esm/api/resources/search/client/requests/{GetMediaV2Request.mjs → GetMediaRequest.mjs} +13 -13
  61. package/dist/{cjs/api/resources/search/client/requests/SearchBrandsV2Request.d.ts → esm/api/resources/search/client/requests/SearchBrandsRequest.d.mts} +4 -4
  62. package/dist/esm/api/resources/search/client/requests/{SearchBrandsV2Request.mjs → SearchBrandsRequest.mjs} +4 -4
  63. package/dist/esm/api/resources/search/client/requests/index.d.mts +2 -2
  64. package/dist/esm/api/resources/search/client/requests/index.mjs +2 -2
  65. package/dist/esm/api/resources/search/types/GetAccountResponse.d.mts +2 -2
  66. package/dist/esm/api/resources/search/types/{GetMediaV2Response.d.mts → GetMediaResponse.d.mts} +3 -3
  67. package/dist/esm/api/resources/search/types/{GetMediaV2Response.mjs → GetMediaResponse.mjs} +4 -4
  68. package/dist/{cjs/api/resources/search/types/SearchBrandsV2Response.d.ts → esm/api/resources/search/types/SearchBrandsResponse.d.mts} +3 -3
  69. package/dist/esm/api/resources/search/types/{SearchBrandsV2Response.mjs → SearchBrandsResponse.mjs} +4 -4
  70. package/dist/esm/api/resources/search/types/index.d.mts +2 -2
  71. package/dist/esm/api/resources/search/types/index.mjs +2 -2
  72. package/dist/esm/index.d.mts +2 -2
  73. package/dist/esm/index.mjs +2 -2
  74. package/dist/esm/version.d.mts +1 -1
  75. package/dist/esm/version.mjs +1 -1
  76. package/package.json +17 -2
  77. package/reference.md +31 -27
@@ -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 Spyglass = __importStar(require("../../../index.js"));
54
+ const spyglass = __importStar(require("../../../index.js"));
55
55
  /**
56
56
  * Search accounts, ads, and related data.
57
57
  */
@@ -60,7 +60,10 @@ class SearchClient {
60
60
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
61
61
  }
62
62
  /**
63
- * Find brands (advertisers) only.
63
+ * Find brands.
64
+ * Search semantically with `query`, or look them up by name, id, or
65
+ * social handle. Either way, you can also narrow the results with
66
+ * filters such as product taxonomy, location, and follower count.
64
67
  *
65
68
  * Send one search field. Each field is its own mode:
66
69
  *
@@ -94,30 +97,30 @@ class SearchClient {
94
97
  * A `query` search runs a language model, so it bills a minimum of one
95
98
  * row even when nothing matches.
96
99
  *
97
- * @param {Spyglass.SearchBrandsV2Request} request
100
+ * @param {spyglass.SearchBrandsRequest} request
98
101
  * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
99
102
  *
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}
103
+ * @throws {@link spyglass.BadRequestError}
104
+ * @throws {@link spyglass.UnauthorizedError}
105
+ * @throws {@link spyglass.PaymentRequiredError}
106
+ * @throws {@link spyglass.ForbiddenError}
107
+ * @throws {@link spyglass.MethodNotAllowedError}
108
+ * @throws {@link spyglass.ContentTooLargeError}
109
+ * @throws {@link spyglass.TooManyRequestsError}
110
+ * @throws {@link spyglass.InternalServerError}
108
111
  * @throws {@link errors.SpyglassError}
109
112
  * @throws {@link errors.SpyglassTimeoutError}
110
113
  *
111
114
  * @example
112
- * await client.search.searchBrandsV2({
115
+ * await client.search.brands({
113
116
  * names: ["Nike"],
114
117
  * limit: 3
115
118
  * })
116
119
  */
117
- searchBrandsV2(request = {}, requestOptions) {
118
- return core.HttpResponsePromise.fromPromise(this.__searchBrandsV2(request, requestOptions));
120
+ brands(request = {}, requestOptions) {
121
+ return core.HttpResponsePromise.fromPromise(this.__brands(request, requestOptions));
119
122
  }
120
- __searchBrandsV2() {
123
+ __brands() {
121
124
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
122
125
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
123
126
  const _authRequest = yield this._options.authProvider.getAuthRequest();
@@ -142,21 +145,21 @@ class SearchClient {
142
145
  if (_response.error.reason === "status-code") {
143
146
  switch (_response.error.statusCode) {
144
147
  case 400:
145
- throw new Spyglass.BadRequestError(_response.error.body, _response.rawResponse);
148
+ throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
146
149
  case 401:
147
- throw new Spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
150
+ throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
148
151
  case 402:
149
- throw new Spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
152
+ throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
150
153
  case 403:
151
- throw new Spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
154
+ throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
152
155
  case 405:
153
- throw new Spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
156
+ throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
154
157
  case 413:
155
- throw new Spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
158
+ throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
156
159
  case 429:
157
- throw new Spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
160
+ throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
158
161
  case 500:
159
- throw new Spyglass.InternalServerError(_response.error.body, _response.rawResponse);
162
+ throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
160
163
  default:
161
164
  throw new errors.SpyglassError({
162
165
  statusCode: _response.error.statusCode,
@@ -169,9 +172,10 @@ class SearchClient {
169
172
  });
170
173
  }
171
174
  /**
172
- * Find creators only.
173
- *
174
- * They also accept profile filters: `gender`, `ageRange`, `ethnicity`, `location` and `language`.
175
+ * Find creators.
176
+ * Search semantically with `query`, or look them up by name, id, or
177
+ * social handle. Either way, you can also narrow the results with
178
+ * filters such as audience profile, location, and follower count.
175
179
  *
176
180
  * Send one search field. Each field is its own mode:
177
181
  *
@@ -205,17 +209,17 @@ class SearchClient {
205
209
  * A `query` search runs a language model, so it bills a minimum of one
206
210
  * row even when nothing matches.
207
211
  *
208
- * @param {Spyglass.SearchCreatorsRequest} request
212
+ * @param {spyglass.SearchCreatorsRequest} request
209
213
  * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
210
214
  *
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}
215
+ * @throws {@link spyglass.BadRequestError}
216
+ * @throws {@link spyglass.UnauthorizedError}
217
+ * @throws {@link spyglass.PaymentRequiredError}
218
+ * @throws {@link spyglass.ForbiddenError}
219
+ * @throws {@link spyglass.MethodNotAllowedError}
220
+ * @throws {@link spyglass.ContentTooLargeError}
221
+ * @throws {@link spyglass.TooManyRequestsError}
222
+ * @throws {@link spyglass.InternalServerError}
219
223
  * @throws {@link errors.SpyglassError}
220
224
  * @throws {@link errors.SpyglassTimeoutError}
221
225
  *
@@ -254,21 +258,21 @@ class SearchClient {
254
258
  if (_response.error.reason === "status-code") {
255
259
  switch (_response.error.statusCode) {
256
260
  case 400:
257
- throw new Spyglass.BadRequestError(_response.error.body, _response.rawResponse);
261
+ throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
258
262
  case 401:
259
- throw new Spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
263
+ throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
260
264
  case 402:
261
- throw new Spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
265
+ throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
262
266
  case 403:
263
- throw new Spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
267
+ throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
264
268
  case 405:
265
- throw new Spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
269
+ throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
266
270
  case 413:
267
- throw new Spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
271
+ throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
268
272
  case 429:
269
- throw new Spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
273
+ throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
270
274
  case 500:
271
- throw new Spyglass.InternalServerError(_response.error.body, _response.rawResponse);
275
+ throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
272
276
  default:
273
277
  throw new errors.SpyglassError({
274
278
  statusCode: _response.error.statusCode,
@@ -289,17 +293,17 @@ class SearchClient {
289
293
  * Costs 2,000 microdollars ($0.0020) per account returned, charged against your plan's monthly credits.
290
294
  * An id that matches nothing returns 404 and is free.
291
295
  *
292
- * @param {Spyglass.GetAccountRequest} request
296
+ * @param {spyglass.GetAccountRequest} request
293
297
  * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
294
298
  *
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}
299
+ * @throws {@link spyglass.BadRequestError}
300
+ * @throws {@link spyglass.UnauthorizedError}
301
+ * @throws {@link spyglass.PaymentRequiredError}
302
+ * @throws {@link spyglass.ForbiddenError}
303
+ * @throws {@link spyglass.NotFoundError}
304
+ * @throws {@link spyglass.MethodNotAllowedError}
305
+ * @throws {@link spyglass.TooManyRequestsError}
306
+ * @throws {@link spyglass.InternalServerError}
303
307
  * @throws {@link errors.SpyglassError}
304
308
  * @throws {@link errors.SpyglassTimeoutError}
305
309
  *
@@ -334,21 +338,21 @@ class SearchClient {
334
338
  if (_response.error.reason === "status-code") {
335
339
  switch (_response.error.statusCode) {
336
340
  case 400:
337
- throw new Spyglass.BadRequestError(_response.error.body, _response.rawResponse);
341
+ throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
338
342
  case 401:
339
- throw new Spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
343
+ throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
340
344
  case 402:
341
- throw new Spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
345
+ throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
342
346
  case 403:
343
- throw new Spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
347
+ throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
344
348
  case 404:
345
- throw new Spyglass.NotFoundError(_response.error.body, _response.rawResponse);
349
+ throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
346
350
  case 405:
347
- throw new Spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
351
+ throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
348
352
  case 429:
349
- throw new Spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
353
+ throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
350
354
  case 500:
351
- throw new Spyglass.InternalServerError(_response.error.body, _response.rawResponse);
355
+ throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
352
356
  default:
353
357
  throw new errors.SpyglassError({
354
358
  statusCode: _response.error.statusCode,
@@ -368,16 +372,16 @@ class SearchClient {
368
372
  * Limited to 120 requests per minute per user.
369
373
  * This call is free and does not use credits.
370
374
  *
371
- * @param {Spyglass.SearchTaxonomiesRequest} request
375
+ * @param {spyglass.SearchTaxonomiesRequest} request
372
376
  * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
373
377
  *
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}
378
+ * @throws {@link spyglass.BadRequestError}
379
+ * @throws {@link spyglass.UnauthorizedError}
380
+ * @throws {@link spyglass.PaymentRequiredError}
381
+ * @throws {@link spyglass.ForbiddenError}
382
+ * @throws {@link spyglass.MethodNotAllowedError}
383
+ * @throws {@link spyglass.TooManyRequestsError}
384
+ * @throws {@link spyglass.InternalServerError}
381
385
  * @throws {@link errors.SpyglassError}
382
386
  * @throws {@link errors.SpyglassTimeoutError}
383
387
  *
@@ -420,19 +424,19 @@ class SearchClient {
420
424
  if (_response.error.reason === "status-code") {
421
425
  switch (_response.error.statusCode) {
422
426
  case 400:
423
- throw new Spyglass.BadRequestError(_response.error.body, _response.rawResponse);
427
+ throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
424
428
  case 401:
425
- throw new Spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
429
+ throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
426
430
  case 402:
427
- throw new Spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
431
+ throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
428
432
  case 403:
429
- throw new Spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
433
+ throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
430
434
  case 405:
431
- throw new Spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
435
+ throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
432
436
  case 429:
433
- throw new Spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
437
+ throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
434
438
  case 500:
435
- throw new Spyglass.InternalServerError(_response.error.body, _response.rawResponse);
439
+ throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
436
440
  default:
437
441
  throw new errors.SpyglassError({
438
442
  statusCode: _response.error.statusCode,
@@ -454,31 +458,31 @@ class SearchClient {
454
458
  * The call bills a minimum of one row even when nothing matches. In that
455
459
  * case `count` is 0 but you are charged for one row.
456
460
  *
457
- * @param {Spyglass.GetMediaV2Request} request
461
+ * @param {spyglass.GetMediaRequest} request
458
462
  * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
459
463
  *
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}
464
+ * @throws {@link spyglass.BadRequestError}
465
+ * @throws {@link spyglass.UnauthorizedError}
466
+ * @throws {@link spyglass.PaymentRequiredError}
467
+ * @throws {@link spyglass.ForbiddenError}
468
+ * @throws {@link spyglass.NotFoundError}
469
+ * @throws {@link spyglass.MethodNotAllowedError}
470
+ * @throws {@link spyglass.ContentTooLargeError}
471
+ * @throws {@link spyglass.TooManyRequestsError}
472
+ * @throws {@link spyglass.InternalServerError}
469
473
  * @throws {@link errors.SpyglassError}
470
474
  * @throws {@link errors.SpyglassTimeoutError}
471
475
  *
472
476
  * @example
473
- * await client.search.getMediaV2({
477
+ * await client.search.getMedia({
474
478
  * query: "comfort-focused video ads",
475
479
  * limit: 20
476
480
  * })
477
481
  */
478
- getMediaV2(request = {}, requestOptions) {
479
- return core.HttpResponsePromise.fromPromise(this.__getMediaV2(request, requestOptions));
482
+ getMedia(request = {}, requestOptions) {
483
+ return core.HttpResponsePromise.fromPromise(this.__getMedia(request, requestOptions));
480
484
  }
481
- __getMediaV2() {
485
+ __getMedia() {
482
486
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
483
487
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
484
488
  const _authRequest = yield this._options.authProvider.getAuthRequest();
@@ -503,23 +507,23 @@ class SearchClient {
503
507
  if (_response.error.reason === "status-code") {
504
508
  switch (_response.error.statusCode) {
505
509
  case 400:
506
- throw new Spyglass.BadRequestError(_response.error.body, _response.rawResponse);
510
+ throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
507
511
  case 401:
508
- throw new Spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
512
+ throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
509
513
  case 402:
510
- throw new Spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
514
+ throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
511
515
  case 403:
512
- throw new Spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
516
+ throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
513
517
  case 404:
514
- throw new Spyglass.NotFoundError(_response.error.body, _response.rawResponse);
518
+ throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
515
519
  case 405:
516
- throw new Spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
520
+ throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
517
521
  case 413:
518
- throw new Spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
522
+ throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
519
523
  case 429:
520
- throw new Spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
524
+ throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
521
525
  case 500:
522
- throw new Spyglass.InternalServerError(_response.error.body, _response.rawResponse);
526
+ throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
523
527
  default:
524
528
  throw new errors.SpyglassError({
525
529
  statusCode: _response.error.statusCode,
@@ -542,17 +546,17 @@ class SearchClient {
542
546
  * Limited to 120 requests per minute per user.
543
547
  * 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
548
  *
545
- * @param {Spyglass.GetBrandMediaInsightsRequest} request
549
+ * @param {spyglass.GetBrandMediaInsightsRequest} request
546
550
  * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
547
551
  *
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}
552
+ * @throws {@link spyglass.BadRequestError}
553
+ * @throws {@link spyglass.UnauthorizedError}
554
+ * @throws {@link spyglass.PaymentRequiredError}
555
+ * @throws {@link spyglass.ForbiddenError}
556
+ * @throws {@link spyglass.NotFoundError}
557
+ * @throws {@link spyglass.MethodNotAllowedError}
558
+ * @throws {@link spyglass.TooManyRequestsError}
559
+ * @throws {@link spyglass.InternalServerError}
556
560
  * @throws {@link errors.SpyglassError}
557
561
  * @throws {@link errors.SpyglassTimeoutError}
558
562
  *
@@ -600,21 +604,21 @@ class SearchClient {
600
604
  if (_response.error.reason === "status-code") {
601
605
  switch (_response.error.statusCode) {
602
606
  case 400:
603
- throw new Spyglass.BadRequestError(_response.error.body, _response.rawResponse);
607
+ throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
604
608
  case 401:
605
- throw new Spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
609
+ throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
606
610
  case 402:
607
- throw new Spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
611
+ throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
608
612
  case 403:
609
- throw new Spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
613
+ throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
610
614
  case 404:
611
- throw new Spyglass.NotFoundError(_response.error.body, _response.rawResponse);
615
+ throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
612
616
  case 405:
613
- throw new Spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
617
+ throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
614
618
  case 429:
615
- throw new Spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
619
+ throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
616
620
  case 500:
617
- throw new Spyglass.InternalServerError(_response.error.body, _response.rawResponse);
621
+ throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
618
622
  default:
619
623
  throw new errors.SpyglassError({
620
624
  statusCode: _response.error.statusCode,
@@ -633,17 +637,17 @@ class SearchClient {
633
637
  * Limited to 120 requests per minute per user.
634
638
  * 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
639
  *
636
- * @param {Spyglass.GetBrandLandingPagesRequest} request
640
+ * @param {spyglass.GetBrandLandingPagesRequest} request
637
641
  * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
638
642
  *
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}
643
+ * @throws {@link spyglass.BadRequestError}
644
+ * @throws {@link spyglass.UnauthorizedError}
645
+ * @throws {@link spyglass.PaymentRequiredError}
646
+ * @throws {@link spyglass.ForbiddenError}
647
+ * @throws {@link spyglass.NotFoundError}
648
+ * @throws {@link spyglass.MethodNotAllowedError}
649
+ * @throws {@link spyglass.TooManyRequestsError}
650
+ * @throws {@link spyglass.InternalServerError}
647
651
  * @throws {@link errors.SpyglassError}
648
652
  * @throws {@link errors.SpyglassTimeoutError}
649
653
  *
@@ -689,21 +693,21 @@ class SearchClient {
689
693
  if (_response.error.reason === "status-code") {
690
694
  switch (_response.error.statusCode) {
691
695
  case 400:
692
- throw new Spyglass.BadRequestError(_response.error.body, _response.rawResponse);
696
+ throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
693
697
  case 401:
694
- throw new Spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
698
+ throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
695
699
  case 402:
696
- throw new Spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
700
+ throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
697
701
  case 403:
698
- throw new Spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
702
+ throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
699
703
  case 404:
700
- throw new Spyglass.NotFoundError(_response.error.body, _response.rawResponse);
704
+ throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
701
705
  case 405:
702
- throw new Spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
706
+ throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
703
707
  case 429:
704
- throw new Spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
708
+ throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
705
709
  case 500:
706
- throw new Spyglass.InternalServerError(_response.error.body, _response.rawResponse);
710
+ throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
707
711
  default:
708
712
  throw new errors.SpyglassError({
709
713
  statusCode: _response.error.statusCode,
@@ -740,17 +744,17 @@ class SearchClient {
740
744
  * Each comment page fetched live (`limit`, default 1) is one billed
741
745
  * unit. Cached posts do not scrape and are not billed.
742
746
  *
743
- * @param {Spyglass.GetCommentsRequest} request
747
+ * @param {spyglass.GetCommentsRequest} request
744
748
  * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
745
749
  *
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}
750
+ * @throws {@link spyglass.BadRequestError}
751
+ * @throws {@link spyglass.UnauthorizedError}
752
+ * @throws {@link spyglass.PaymentRequiredError}
753
+ * @throws {@link spyglass.ForbiddenError}
754
+ * @throws {@link spyglass.MethodNotAllowedError}
755
+ * @throws {@link spyglass.ContentTooLargeError}
756
+ * @throws {@link spyglass.TooManyRequestsError}
757
+ * @throws {@link spyglass.InternalServerError}
754
758
  * @throws {@link errors.SpyglassError}
755
759
  * @throws {@link errors.SpyglassTimeoutError}
756
760
  *
@@ -789,21 +793,21 @@ class SearchClient {
789
793
  if (_response.error.reason === "status-code") {
790
794
  switch (_response.error.statusCode) {
791
795
  case 400:
792
- throw new Spyglass.BadRequestError(_response.error.body, _response.rawResponse);
796
+ throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
793
797
  case 401:
794
- throw new Spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
798
+ throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
795
799
  case 402:
796
- throw new Spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
800
+ throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
797
801
  case 403:
798
- throw new Spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
802
+ throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
799
803
  case 405:
800
- throw new Spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
804
+ throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
801
805
  case 413:
802
- throw new Spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
806
+ throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
803
807
  case 429:
804
- throw new Spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
808
+ throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
805
809
  case 500:
806
- throw new Spyglass.InternalServerError(_response.error.body, _response.rawResponse);
810
+ throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
807
811
  default:
808
812
  throw new errors.SpyglassError({
809
813
  statusCode: _response.error.statusCode,
@@ -1,4 +1,4 @@
1
- import type * as Spyglass from "../../../../index.js";
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?: Spyglass.GetBrandLandingPagesRequestShowInactive;
11
+ showInactive?: spyglass.GetBrandLandingPagesRequestShowInactive;
12
12
  limit?: number;
13
13
  }
@@ -1,4 +1,4 @@
1
- import type * as Spyglass from "../../../../index.js";
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: Spyglass.GetBrandMediaInsightsRequestType;
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 GetMediaV2Request {
8
+ export interface GetMediaRequest {
9
9
  /** Brand id given as a platform string or uuid */
10
- brandId?: GetMediaV2Request.BrandId;
10
+ brandId?: GetMediaRequest.BrandId;
11
11
  query?: string;
12
- channel?: GetMediaV2Request.Channel.Item[];
13
- format?: GetMediaV2Request.Format.Item[];
14
- duration?: GetMediaV2Request.Duration.Item[];
15
- status?: GetMediaV2Request.Status;
16
- categories?: GetMediaV2Request.Categories.Item[];
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?: GetMediaV2Request.FunnelStage.Item[];
19
- language?: GetMediaV2Request.Language.Item[];
18
+ funnelStage?: GetMediaRequest.FunnelStage.Item[];
19
+ language?: GetMediaRequest.Language.Item[];
20
20
  location?: string[];
21
- datePreset?: GetMediaV2Request.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?: GetMediaV2Request.LandingPageMatch;
29
+ landingPageMatch?: GetMediaRequest.LandingPageMatch;
30
30
  lowImpressions?: boolean;
31
31
  partnershipAd?: boolean;
32
32
  crossposted?: boolean;
33
- sortBy?: GetMediaV2Request.SortBy;
33
+ sortBy?: GetMediaRequest.SortBy;
34
34
  limit?: number;
35
35
  offset?: number;
36
36
  }
37
- export declare namespace GetMediaV2Request {
37
+ export declare namespace GetMediaRequest {
38
38
  /**
39
39
  * Brand id given as a platform string or uuid
40
40
  */