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