@spyglasshq/sdk 0.1.2 → 0.1.4
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 +40 -42
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +257 -6
- package/dist/cjs/Client.js +574 -9
- package/dist/cjs/api/{resources/search/client/requests/GetMediaRequest.d.ts → client/requests/SearchMediaRequest.d.ts} +13 -13
- package/dist/cjs/api/{resources/search/client/requests/GetMediaRequest.js → client/requests/SearchMediaRequest.js} +14 -14
- package/dist/cjs/api/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/{resources/search/client → client}/requests/index.js +3 -3
- package/dist/cjs/api/index.d.ts +1 -0
- package/dist/cjs/api/index.js +1 -0
- package/dist/cjs/api/resources/account/client/Client.d.ts +131 -11
- package/dist/cjs/api/resources/account/client/Client.js +353 -14
- package/dist/cjs/api/resources/account/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/account/client/index.js +15 -0
- package/dist/cjs/api/resources/{indexing/client/requests/IndexBrandRequest.d.ts → account/client/requests/IndexAccountRequest.d.ts} +1 -1
- package/dist/{esm/api/resources/indexing/client/requests/IndexBrandStatusRequest.d.mts → cjs/api/resources/account/client/requests/IndexStatusAccountRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/{search/client/requests/GetBrandMediaInsightsRequest.d.ts → account/client/requests/InsightsAccountRequest.d.ts} +2 -2
- package/dist/cjs/api/resources/{search/client/requests/GetBrandLandingPagesRequest.d.ts → account/client/requests/LandingPagesAccountRequest.d.ts} +2 -2
- package/dist/cjs/api/resources/account/client/requests/index.d.ts +5 -0
- package/dist/{esm/api/resources/indexing/types/IndexBrandResponse.d.mts → cjs/api/resources/account/types/IndexAccountResponse.d.ts} +3 -3
- package/dist/cjs/api/resources/account/types/IndexAccountResponse.js +11 -0
- package/dist/cjs/api/resources/{indexing/types/IndexBrandStatusResponse.d.ts → account/types/IndexStatusAccountResponse.d.ts} +3 -3
- package/dist/cjs/api/resources/account/types/IndexStatusAccountResponse.js +11 -0
- package/dist/cjs/api/resources/account/types/InsightsAccountRequestType.d.ts +7 -0
- package/dist/cjs/api/resources/{search/types/GetBrandMediaInsightsRequestType.js → account/types/InsightsAccountRequestType.js} +2 -2
- package/dist/cjs/api/resources/{search/types/GetBrandMediaInsightsResponse.d.ts → account/types/InsightsAccountResponse.d.ts} +1 -1
- package/dist/cjs/api/resources/account/types/LandingPagesAccountRequestShowInactive.d.ts +5 -0
- package/dist/cjs/api/resources/{search/types/GetBrandLandingPagesRequestShowInactive.js → account/types/LandingPagesAccountRequestShowInactive.js} +2 -2
- package/dist/cjs/api/resources/{search/types/GetBrandLandingPagesResponse.d.ts → account/types/LandingPagesAccountResponse.d.ts} +3 -3
- package/dist/cjs/api/resources/account/types/index.d.ts +7 -1
- package/dist/cjs/api/resources/account/types/index.js +7 -1
- package/dist/cjs/api/resources/index.d.ts +1 -6
- package/dist/cjs/api/resources/index.js +5 -10
- package/dist/{esm/api/resources/search/types/GetMediaResponse.d.mts → cjs/api/types/SearchMediaResponse.d.ts} +3 -3
- package/dist/cjs/api/{resources/search/types/GetMediaResponse.js → types/SearchMediaResponse.js} +5 -5
- package/dist/cjs/api/types/index.d.ts +6 -0
- package/dist/cjs/api/types/index.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +257 -6
- package/dist/esm/Client.mjs +574 -9
- package/dist/esm/api/{resources/search/client/requests/GetMediaRequest.d.mts → client/requests/SearchMediaRequest.d.mts} +13 -13
- package/dist/esm/api/{resources/search/client/requests/GetMediaRequest.mjs → client/requests/SearchMediaRequest.mjs} +13 -13
- package/dist/esm/api/client/requests/index.d.mts +5 -0
- package/dist/esm/api/{resources/search/client → client}/requests/index.mjs +1 -1
- package/dist/esm/api/index.d.mts +1 -0
- package/dist/esm/api/index.mjs +1 -0
- package/dist/esm/api/resources/account/client/Client.d.mts +131 -11
- package/dist/esm/api/resources/account/client/Client.mjs +353 -14
- package/dist/esm/api/resources/account/client/index.d.mts +1 -1
- package/dist/esm/api/resources/account/client/index.mjs +1 -1
- package/dist/esm/api/resources/{indexing/client/requests/IndexBrandRequest.d.mts → account/client/requests/IndexAccountRequest.d.mts} +1 -1
- package/dist/{cjs/api/resources/indexing/client/requests/IndexBrandStatusRequest.d.ts → esm/api/resources/account/client/requests/IndexStatusAccountRequest.d.mts} +1 -1
- package/dist/esm/api/resources/{search/client/requests/GetBrandMediaInsightsRequest.d.mts → account/client/requests/InsightsAccountRequest.d.mts} +2 -2
- package/dist/esm/api/resources/{search/client/requests/GetBrandLandingPagesRequest.d.mts → account/client/requests/LandingPagesAccountRequest.d.mts} +2 -2
- package/dist/esm/api/resources/account/client/requests/index.d.mts +5 -0
- package/dist/{cjs/api/resources/indexing/types/IndexBrandResponse.d.ts → esm/api/resources/account/types/IndexAccountResponse.d.mts} +3 -3
- package/dist/esm/api/resources/account/types/IndexAccountResponse.mjs +8 -0
- package/dist/esm/api/resources/{indexing/types/IndexBrandStatusResponse.d.mts → account/types/IndexStatusAccountResponse.d.mts} +3 -3
- package/dist/esm/api/resources/account/types/IndexStatusAccountResponse.mjs +8 -0
- package/dist/esm/api/resources/account/types/InsightsAccountRequestType.d.mts +7 -0
- package/dist/esm/api/resources/{search/types/GetBrandMediaInsightsRequestType.mjs → account/types/InsightsAccountRequestType.mjs} +1 -1
- package/dist/esm/api/resources/{search/types/GetBrandMediaInsightsResponse.d.mts → account/types/InsightsAccountResponse.d.mts} +1 -1
- package/dist/esm/api/resources/account/types/LandingPagesAccountRequestShowInactive.d.mts +5 -0
- package/dist/esm/api/resources/{search/types/GetBrandLandingPagesRequestShowInactive.mjs → account/types/LandingPagesAccountRequestShowInactive.mjs} +1 -1
- package/dist/esm/api/resources/{search/types/GetBrandLandingPagesResponse.d.mts → account/types/LandingPagesAccountResponse.d.mts} +3 -3
- package/dist/esm/api/resources/account/types/index.d.mts +7 -1
- package/dist/esm/api/resources/account/types/index.mjs +7 -1
- package/dist/esm/api/resources/index.d.mts +1 -6
- package/dist/esm/api/resources/index.mjs +1 -6
- package/dist/{cjs/api/resources/search/types/GetMediaResponse.d.ts → esm/api/types/SearchMediaResponse.d.mts} +3 -3
- package/dist/esm/api/{resources/search/types/GetMediaResponse.mjs → types/SearchMediaResponse.mjs} +4 -4
- package/dist/esm/api/types/index.d.mts +6 -0
- package/dist/esm/api/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -23
- package/reference.md +109 -111
- package/dist/cjs/api/resources/indexing/client/Client.d.ts +0 -74
- package/dist/cjs/api/resources/indexing/client/Client.js +0 -219
- package/dist/cjs/api/resources/indexing/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/indexing/exports.d.ts +0 -2
- package/dist/cjs/api/resources/indexing/exports.js +0 -21
- package/dist/cjs/api/resources/indexing/index.d.ts +0 -2
- package/dist/cjs/api/resources/indexing/index.js +0 -18
- package/dist/cjs/api/resources/indexing/types/IndexBrandResponse.js +0 -11
- package/dist/cjs/api/resources/indexing/types/IndexBrandStatusResponse.js +0 -11
- package/dist/cjs/api/resources/indexing/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/indexing/types/index.js +0 -18
- package/dist/cjs/api/resources/search/client/Client.d.ts +0 -337
- package/dist/cjs/api/resources/search/client/Client.js +0 -823
- package/dist/cjs/api/resources/search/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/search/client/index.js +0 -17
- package/dist/cjs/api/resources/search/client/requests/index.d.ts +0 -8
- package/dist/cjs/api/resources/search/exports.d.ts +0 -2
- package/dist/cjs/api/resources/search/exports.js +0 -21
- package/dist/cjs/api/resources/search/index.d.ts +0 -2
- package/dist/cjs/api/resources/search/index.js +0 -18
- package/dist/cjs/api/resources/search/types/GetBrandLandingPagesRequestShowInactive.d.ts +0 -5
- package/dist/cjs/api/resources/search/types/GetBrandMediaInsightsRequestType.d.ts +0 -7
- package/dist/cjs/api/resources/search/types/index.d.ts +0 -10
- package/dist/cjs/api/resources/search/types/index.js +0 -26
- package/dist/esm/api/resources/indexing/client/Client.d.mts +0 -74
- package/dist/esm/api/resources/indexing/client/Client.mjs +0 -182
- package/dist/esm/api/resources/indexing/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/indexing/exports.d.mts +0 -2
- package/dist/esm/api/resources/indexing/exports.mjs +0 -3
- package/dist/esm/api/resources/indexing/index.d.mts +0 -2
- package/dist/esm/api/resources/indexing/index.mjs +0 -2
- package/dist/esm/api/resources/indexing/types/IndexBrandResponse.mjs +0 -8
- package/dist/esm/api/resources/indexing/types/IndexBrandStatusResponse.mjs +0 -8
- package/dist/esm/api/resources/indexing/types/index.d.mts +0 -2
- package/dist/esm/api/resources/indexing/types/index.mjs +0 -2
- package/dist/esm/api/resources/search/client/Client.d.mts +0 -337
- package/dist/esm/api/resources/search/client/Client.mjs +0 -786
- package/dist/esm/api/resources/search/client/index.d.mts +0 -1
- package/dist/esm/api/resources/search/client/index.mjs +0 -1
- package/dist/esm/api/resources/search/client/requests/index.d.mts +0 -8
- package/dist/esm/api/resources/search/exports.d.mts +0 -2
- package/dist/esm/api/resources/search/exports.mjs +0 -3
- package/dist/esm/api/resources/search/index.d.mts +0 -2
- package/dist/esm/api/resources/search/index.mjs +0 -2
- package/dist/esm/api/resources/search/types/GetBrandLandingPagesRequestShowInactive.d.mts +0 -5
- package/dist/esm/api/resources/search/types/GetBrandMediaInsightsRequestType.d.mts +0 -7
- package/dist/esm/api/resources/search/types/index.d.mts +0 -10
- package/dist/esm/api/resources/search/types/index.mjs +0 -10
- /package/dist/cjs/api/{resources/indexing/client → client}/index.d.ts +0 -0
- /package/dist/cjs/api/{resources/indexing/client → client}/index.js +0 -0
- /package/dist/cjs/api/{resources/search/client → client}/requests/GetCommentsRequest.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/client → client}/requests/GetCommentsRequest.js +0 -0
- /package/dist/cjs/api/{resources/search/client → client}/requests/SearchBrandsRequest.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/client → client}/requests/SearchBrandsRequest.js +0 -0
- /package/dist/cjs/api/{resources/search/client → client}/requests/SearchCreatorsRequest.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/client → client}/requests/SearchCreatorsRequest.js +0 -0
- /package/dist/cjs/api/{resources/search/client → client}/requests/SearchTaxonomiesRequest.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/client → client}/requests/SearchTaxonomiesRequest.js +0 -0
- /package/dist/cjs/api/resources/{search → account}/client/requests/GetAccountRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{search → account}/client/requests/GetAccountRequest.js +0 -0
- /package/dist/cjs/api/resources/account/{types/GetCreditUsageResponse.js → client/requests/IndexAccountRequest.js} +0 -0
- /package/dist/cjs/api/resources/{indexing/client/requests/IndexBrandRequest.js → account/client/requests/IndexStatusAccountRequest.js} +0 -0
- /package/dist/cjs/api/resources/{indexing/client/requests/IndexBrandStatusRequest.js → account/client/requests/InsightsAccountRequest.js} +0 -0
- /package/dist/cjs/api/resources/{search/client/requests/GetBrandLandingPagesRequest.js → account/client/requests/LandingPagesAccountRequest.js} +0 -0
- /package/dist/cjs/api/resources/{indexing → account}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{search → account}/types/GetAccountResponse.d.ts +0 -0
- /package/dist/cjs/api/resources/{search → account}/types/GetAccountResponse.js +0 -0
- /package/dist/cjs/api/resources/{search/client/requests/GetBrandMediaInsightsRequest.js → account/types/InsightsAccountResponse.js} +0 -0
- /package/dist/cjs/api/resources/{search/types/GetBrandLandingPagesResponse.js → account/types/LandingPagesAccountResponse.js} +0 -0
- /package/dist/cjs/api/{resources/search/types → types}/GetCommentsResponse.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/types → types}/GetCommentsResponse.js +0 -0
- /package/dist/cjs/api/{resources/account/types → types}/GetCreditUsageResponse.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/types/GetBrandMediaInsightsResponse.js → types/GetCreditUsageResponse.js} +0 -0
- /package/dist/cjs/api/{resources/search/types → types}/SearchBrandsResponse.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/types → types}/SearchBrandsResponse.js +0 -0
- /package/dist/cjs/api/{resources/search/types → types}/SearchCreatorsResponse.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/types → types}/SearchCreatorsResponse.js +0 -0
- /package/dist/cjs/api/{resources/search/types → types}/SearchTaxonomiesResponse.d.ts +0 -0
- /package/dist/cjs/api/{resources/search/types → types}/SearchTaxonomiesResponse.js +0 -0
- /package/dist/esm/api/{resources/indexing/client → client}/index.d.mts +0 -0
- /package/dist/esm/api/{resources/indexing/client → client}/index.mjs +0 -0
- /package/dist/esm/api/{resources/search/client → client}/requests/GetCommentsRequest.d.mts +0 -0
- /package/dist/esm/api/{resources/search/client → client}/requests/GetCommentsRequest.mjs +0 -0
- /package/dist/esm/api/{resources/search/client → client}/requests/SearchBrandsRequest.d.mts +0 -0
- /package/dist/esm/api/{resources/search/client → client}/requests/SearchBrandsRequest.mjs +0 -0
- /package/dist/esm/api/{resources/search/client → client}/requests/SearchCreatorsRequest.d.mts +0 -0
- /package/dist/esm/api/{resources/search/client → client}/requests/SearchCreatorsRequest.mjs +0 -0
- /package/dist/esm/api/{resources/search/client → client}/requests/SearchTaxonomiesRequest.d.mts +0 -0
- /package/dist/esm/api/{resources/search/client → client}/requests/SearchTaxonomiesRequest.mjs +0 -0
- /package/dist/esm/api/resources/{search → account}/client/requests/GetAccountRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{search → account}/client/requests/GetAccountRequest.mjs +0 -0
- /package/dist/esm/api/resources/account/{types/GetCreditUsageResponse.mjs → client/requests/IndexAccountRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{indexing/client/requests/IndexBrandRequest.mjs → account/client/requests/IndexStatusAccountRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{indexing/client/requests/IndexBrandStatusRequest.mjs → account/client/requests/InsightsAccountRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{search/client/requests/GetBrandLandingPagesRequest.mjs → account/client/requests/LandingPagesAccountRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{indexing → account}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{search → account}/types/GetAccountResponse.d.mts +0 -0
- /package/dist/esm/api/resources/{search → account}/types/GetAccountResponse.mjs +0 -0
- /package/dist/esm/api/resources/{search/client/requests/GetBrandMediaInsightsRequest.mjs → account/types/InsightsAccountResponse.mjs} +0 -0
- /package/dist/esm/api/resources/{search/types/GetBrandLandingPagesResponse.mjs → account/types/LandingPagesAccountResponse.mjs} +0 -0
- /package/dist/esm/api/{resources/search/types → types}/GetCommentsResponse.d.mts +0 -0
- /package/dist/esm/api/{resources/search/types → types}/GetCommentsResponse.mjs +0 -0
- /package/dist/esm/api/{resources/account/types → types}/GetCreditUsageResponse.d.mts +0 -0
- /package/dist/esm/api/{resources/search/types/GetBrandMediaInsightsResponse.mjs → types/GetCreditUsageResponse.mjs} +0 -0
- /package/dist/esm/api/{resources/search/types → types}/SearchBrandsResponse.d.mts +0 -0
- /package/dist/esm/api/{resources/search/types → types}/SearchBrandsResponse.mjs +0 -0
- /package/dist/esm/api/{resources/search/types → types}/SearchCreatorsResponse.d.mts +0 -0
- /package/dist/esm/api/{resources/search/types → types}/SearchCreatorsResponse.mjs +0 -0
- /package/dist/esm/api/{resources/search/types → types}/SearchTaxonomiesResponse.d.mts +0 -0
- /package/dist/esm/api/{resources/search/types → types}/SearchTaxonomiesResponse.mjs +0 -0
|
@@ -11,32 +11,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
14
15
|
import * as environments from "../../../../environments.mjs";
|
|
15
16
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
18
|
import * as spyglass from "../../../index.mjs";
|
|
18
|
-
/**
|
|
19
|
-
* The API key's team: credits and the billing period.
|
|
20
|
-
*/
|
|
21
19
|
export class AccountClient {
|
|
22
20
|
constructor(options) {
|
|
23
21
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
24
22
|
}
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* `
|
|
24
|
+
* Fetch a single brand or creator by id. The `type` field tells you
|
|
25
|
+
* which one you got: `BRAND` or `CREATOR`, and the creator-only fields
|
|
26
|
+
* (`gender`, `ageRange`, ...) are present only on `CREATOR`.
|
|
29
27
|
*
|
|
30
28
|
* Limited to 120 requests per minute per user.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* Costs 2,000 microdollars ($0.0020) per account returned, charged against your plan's monthly credits.
|
|
30
|
+
* An id that matches nothing returns 404 and is free.
|
|
33
31
|
*
|
|
32
|
+
* @param {spyglass.GetAccountRequest} request
|
|
34
33
|
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
34
|
*
|
|
36
35
|
* @throws {@link spyglass.BadRequestError}
|
|
37
36
|
* @throws {@link spyglass.UnauthorizedError}
|
|
38
37
|
* @throws {@link spyglass.PaymentRequiredError}
|
|
39
38
|
* @throws {@link spyglass.ForbiddenError}
|
|
39
|
+
* @throws {@link spyglass.NotFoundError}
|
|
40
40
|
* @throws {@link spyglass.MethodNotAllowedError}
|
|
41
41
|
* @throws {@link spyglass.TooManyRequestsError}
|
|
42
42
|
* @throws {@link spyglass.InternalServerError}
|
|
@@ -44,18 +44,21 @@ export class AccountClient {
|
|
|
44
44
|
* @throws {@link errors.SpyglassTimeoutError}
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
|
-
* await client.account.
|
|
47
|
+
* await client.account.get({
|
|
48
|
+
* id: "id"
|
|
49
|
+
* })
|
|
48
50
|
*/
|
|
49
|
-
|
|
50
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
51
|
+
get(request, requestOptions) {
|
|
52
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
51
53
|
}
|
|
52
|
-
|
|
54
|
+
__get(request, requestOptions) {
|
|
53
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
56
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
57
|
+
const { id } = request;
|
|
55
58
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
56
59
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
57
60
|
const _response = yield core.fetcher({
|
|
58
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default,
|
|
61
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, `account/${core.url.encodePathParam(id, errors.SpyglassError)}`),
|
|
59
62
|
method: "GET",
|
|
60
63
|
headers: _headers,
|
|
61
64
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
@@ -78,6 +81,8 @@ export class AccountClient {
|
|
|
78
81
|
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
79
82
|
case 403:
|
|
80
83
|
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
84
|
+
case 404:
|
|
85
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
81
86
|
case 405:
|
|
82
87
|
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
83
88
|
case 429:
|
|
@@ -92,7 +97,341 @@ export class AccountClient {
|
|
|
92
97
|
});
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/
|
|
100
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/account/{id}");
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Return clustered creative themes for an account. `MEDIA_MIX` returns a
|
|
105
|
+
* breakdown by media type; the other types return weekly buckets plus
|
|
106
|
+
* ranked totals, highest first.
|
|
107
|
+
*
|
|
108
|
+
* `maxDaysBack` filters both the weekly bucket series and ranked
|
|
109
|
+
* `totals` to creatives that started within the requested window.
|
|
110
|
+
*
|
|
111
|
+
* Limited to 120 requests per minute per user.
|
|
112
|
+
* 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.
|
|
113
|
+
*
|
|
114
|
+
* @param {spyglass.InsightsAccountRequest} request
|
|
115
|
+
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
116
|
+
*
|
|
117
|
+
* @throws {@link spyglass.BadRequestError}
|
|
118
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
119
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
120
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
121
|
+
* @throws {@link spyglass.NotFoundError}
|
|
122
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
123
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
124
|
+
* @throws {@link spyglass.InternalServerError}
|
|
125
|
+
* @throws {@link errors.SpyglassError}
|
|
126
|
+
* @throws {@link errors.SpyglassTimeoutError}
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* await client.account.insights({
|
|
130
|
+
* id: "id",
|
|
131
|
+
* type: "HOOK"
|
|
132
|
+
* })
|
|
133
|
+
*/
|
|
134
|
+
insights(request, requestOptions) {
|
|
135
|
+
return core.HttpResponsePromise.fromPromise(this.__insights(request, requestOptions));
|
|
136
|
+
}
|
|
137
|
+
__insights(request, requestOptions) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
140
|
+
const { id, type: type_, maxDaysBack, limit } = request;
|
|
141
|
+
const _queryParams = {
|
|
142
|
+
type: type_,
|
|
143
|
+
maxDaysBack,
|
|
144
|
+
limit,
|
|
145
|
+
};
|
|
146
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
147
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
148
|
+
const _response = yield core.fetcher({
|
|
149
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, `account/${core.url.encodePathParam(id, errors.SpyglassError)}/insights`),
|
|
150
|
+
method: "GET",
|
|
151
|
+
headers: _headers,
|
|
152
|
+
queryString: core.url
|
|
153
|
+
.queryBuilder()
|
|
154
|
+
.addMany(_queryParams)
|
|
155
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
156
|
+
.build(),
|
|
157
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
158
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
159
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
160
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
161
|
+
logging: this._options.logging,
|
|
162
|
+
});
|
|
163
|
+
if (_response.ok) {
|
|
164
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
165
|
+
}
|
|
166
|
+
if (_response.error.reason === "status-code") {
|
|
167
|
+
switch (_response.error.statusCode) {
|
|
168
|
+
case 400:
|
|
169
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
170
|
+
case 401:
|
|
171
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
172
|
+
case 402:
|
|
173
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
174
|
+
case 403:
|
|
175
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
176
|
+
case 404:
|
|
177
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
178
|
+
case 405:
|
|
179
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
180
|
+
case 429:
|
|
181
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
182
|
+
case 500:
|
|
183
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
184
|
+
default:
|
|
185
|
+
throw new errors.SpyglassError({
|
|
186
|
+
statusCode: _response.error.statusCode,
|
|
187
|
+
body: _response.error.body,
|
|
188
|
+
rawResponse: _response.rawResponse,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/account/{id}/insights");
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Return the landing-page URLs an account sends ad traffic to, ranked by
|
|
197
|
+
* how often they appear across its ads.
|
|
198
|
+
*
|
|
199
|
+
* Limited to 120 requests per minute per user.
|
|
200
|
+
* 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.
|
|
201
|
+
*
|
|
202
|
+
* @param {spyglass.LandingPagesAccountRequest} request
|
|
203
|
+
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
204
|
+
*
|
|
205
|
+
* @throws {@link spyglass.BadRequestError}
|
|
206
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
207
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
208
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
209
|
+
* @throws {@link spyglass.NotFoundError}
|
|
210
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
211
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
212
|
+
* @throws {@link spyglass.InternalServerError}
|
|
213
|
+
* @throws {@link errors.SpyglassError}
|
|
214
|
+
* @throws {@link errors.SpyglassTimeoutError}
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* await client.account.landingPages({
|
|
218
|
+
* id: "id"
|
|
219
|
+
* })
|
|
220
|
+
*/
|
|
221
|
+
landingPages(request, requestOptions) {
|
|
222
|
+
return core.HttpResponsePromise.fromPromise(this.__landingPages(request, requestOptions));
|
|
223
|
+
}
|
|
224
|
+
__landingPages(request, requestOptions) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
227
|
+
const { id, showInactive, limit } = request;
|
|
228
|
+
const _queryParams = {
|
|
229
|
+
showInactive: showInactive != null ? showInactive : undefined,
|
|
230
|
+
limit,
|
|
231
|
+
};
|
|
232
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
233
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
234
|
+
const _response = yield core.fetcher({
|
|
235
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, `account/${core.url.encodePathParam(id, errors.SpyglassError)}/landing-pages`),
|
|
236
|
+
method: "GET",
|
|
237
|
+
headers: _headers,
|
|
238
|
+
queryString: core.url
|
|
239
|
+
.queryBuilder()
|
|
240
|
+
.addMany(_queryParams)
|
|
241
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
242
|
+
.build(),
|
|
243
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
244
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
245
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
246
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
247
|
+
logging: this._options.logging,
|
|
248
|
+
});
|
|
249
|
+
if (_response.ok) {
|
|
250
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
251
|
+
}
|
|
252
|
+
if (_response.error.reason === "status-code") {
|
|
253
|
+
switch (_response.error.statusCode) {
|
|
254
|
+
case 400:
|
|
255
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
256
|
+
case 401:
|
|
257
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
258
|
+
case 402:
|
|
259
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
260
|
+
case 403:
|
|
261
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
262
|
+
case 404:
|
|
263
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
264
|
+
case 405:
|
|
265
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
266
|
+
case 429:
|
|
267
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
268
|
+
case 500:
|
|
269
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
270
|
+
default:
|
|
271
|
+
throw new errors.SpyglassError({
|
|
272
|
+
statusCode: _response.error.statusCode,
|
|
273
|
+
body: _response.error.body,
|
|
274
|
+
rawResponse: _response.rawResponse,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/account/{id}/landing-pages");
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Look up a brand by website URL, or start indexing it if we do not
|
|
283
|
+
* have it yet. Pass a single `websiteUrl`. Instagram and TikTok
|
|
284
|
+
* profile URLs are accepted and resolved as creators.
|
|
285
|
+
*
|
|
286
|
+
* This endpoint does not consume credits. An existing brand returns
|
|
287
|
+
* `status: "already_exists"`. A new brand is created and sync is
|
|
288
|
+
* queued, returning `status: "indexing"` and the new `brandId`.
|
|
289
|
+
*
|
|
290
|
+
* Limited to 50 requests per minute per user.
|
|
291
|
+
* This call is free.
|
|
292
|
+
*
|
|
293
|
+
* @param {spyglass.IndexAccountRequest} request
|
|
294
|
+
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
295
|
+
*
|
|
296
|
+
* @throws {@link spyglass.BadRequestError}
|
|
297
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
298
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
299
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
300
|
+
* @throws {@link spyglass.ContentTooLargeError}
|
|
301
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
302
|
+
* @throws {@link spyglass.InternalServerError}
|
|
303
|
+
* @throws {@link errors.SpyglassError}
|
|
304
|
+
* @throws {@link errors.SpyglassTimeoutError}
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* await client.account.index({
|
|
308
|
+
* websiteUrl: "https://www.nike.com"
|
|
309
|
+
* })
|
|
310
|
+
*/
|
|
311
|
+
index(request, requestOptions) {
|
|
312
|
+
return core.HttpResponsePromise.fromPromise(this.__index(request, requestOptions));
|
|
313
|
+
}
|
|
314
|
+
__index(request, requestOptions) {
|
|
315
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
316
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
317
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
318
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
319
|
+
const _response = yield core.fetcher({
|
|
320
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, "account/index"),
|
|
321
|
+
method: "POST",
|
|
322
|
+
headers: _headers,
|
|
323
|
+
contentType: "application/json",
|
|
324
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
325
|
+
requestType: "json",
|
|
326
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
327
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
328
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
329
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
330
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
331
|
+
logging: this._options.logging,
|
|
332
|
+
});
|
|
333
|
+
if (_response.ok) {
|
|
334
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
335
|
+
}
|
|
336
|
+
if (_response.error.reason === "status-code") {
|
|
337
|
+
switch (_response.error.statusCode) {
|
|
338
|
+
case 400:
|
|
339
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
340
|
+
case 401:
|
|
341
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
342
|
+
case 403:
|
|
343
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
344
|
+
case 405:
|
|
345
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
346
|
+
case 413:
|
|
347
|
+
throw new spyglass.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
348
|
+
case 429:
|
|
349
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
350
|
+
case 500:
|
|
351
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
352
|
+
default:
|
|
353
|
+
throw new errors.SpyglassError({
|
|
354
|
+
statusCode: _response.error.statusCode,
|
|
355
|
+
body: _response.error.body,
|
|
356
|
+
rawResponse: _response.rawResponse,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/account/index");
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Poll whether a brand finished indexing after POST /account/index.
|
|
365
|
+
*
|
|
366
|
+
* Limited to 300 requests per minute per user.
|
|
367
|
+
* This call is free.
|
|
368
|
+
*
|
|
369
|
+
* @param {spyglass.IndexStatusAccountRequest} request
|
|
370
|
+
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
371
|
+
*
|
|
372
|
+
* @throws {@link spyglass.BadRequestError}
|
|
373
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
374
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
375
|
+
* @throws {@link spyglass.NotFoundError}
|
|
376
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
377
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
378
|
+
* @throws {@link spyglass.InternalServerError}
|
|
379
|
+
* @throws {@link errors.SpyglassError}
|
|
380
|
+
* @throws {@link errors.SpyglassTimeoutError}
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* await client.account.indexStatus({
|
|
384
|
+
* id: "id"
|
|
385
|
+
* })
|
|
386
|
+
*/
|
|
387
|
+
indexStatus(request, requestOptions) {
|
|
388
|
+
return core.HttpResponsePromise.fromPromise(this.__indexStatus(request, requestOptions));
|
|
389
|
+
}
|
|
390
|
+
__indexStatus(request, requestOptions) {
|
|
391
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
392
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
393
|
+
const { id } = request;
|
|
394
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
395
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
396
|
+
const _response = yield core.fetcher({
|
|
397
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SpyglassEnvironment.Default, `account/${core.url.encodePathParam(id, errors.SpyglassError)}/index-status`),
|
|
398
|
+
method: "GET",
|
|
399
|
+
headers: _headers,
|
|
400
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
401
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
402
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
403
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
404
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
405
|
+
logging: this._options.logging,
|
|
406
|
+
});
|
|
407
|
+
if (_response.ok) {
|
|
408
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
409
|
+
}
|
|
410
|
+
if (_response.error.reason === "status-code") {
|
|
411
|
+
switch (_response.error.statusCode) {
|
|
412
|
+
case 400:
|
|
413
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
414
|
+
case 401:
|
|
415
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
416
|
+
case 403:
|
|
417
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
418
|
+
case 404:
|
|
419
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
420
|
+
case 405:
|
|
421
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
422
|
+
case 429:
|
|
423
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
424
|
+
case 500:
|
|
425
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
426
|
+
default:
|
|
427
|
+
throw new errors.SpyglassError({
|
|
428
|
+
statusCode: _response.error.statusCode,
|
|
429
|
+
body: _response.error.body,
|
|
430
|
+
rawResponse: _response.rawResponse,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/account/{id}/index-status");
|
|
96
435
|
});
|
|
97
436
|
}
|
|
98
437
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -6,10 +6,10 @@ import type * as spyglass from "../../../../index.mjs";
|
|
|
6
6
|
* type: "HOOK"
|
|
7
7
|
* }
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface InsightsAccountRequest {
|
|
10
10
|
/** Brand or creator id returned by POST /brands or POST /creators. */
|
|
11
11
|
id: string;
|
|
12
|
-
type: spyglass.
|
|
12
|
+
type: spyglass.InsightsAccountRequestType;
|
|
13
13
|
maxDaysBack?: number;
|
|
14
14
|
limit?: number;
|
|
15
15
|
}
|
|
@@ -5,9 +5,9 @@ import type * as spyglass from "../../../../index.mjs";
|
|
|
5
5
|
* id: "id"
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface LandingPagesAccountRequest {
|
|
9
9
|
/** Brand or creator id returned by POST /brands or POST /creators. */
|
|
10
10
|
id: string;
|
|
11
|
-
showInactive?: spyglass.
|
|
11
|
+
showInactive?: spyglass.LandingPagesAccountRequestShowInactive;
|
|
12
12
|
limit?: number;
|
|
13
13
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { GetAccountRequest } from "./GetAccountRequest.mjs";
|
|
2
|
+
export type { IndexAccountRequest } from "./IndexAccountRequest.mjs";
|
|
3
|
+
export type { IndexStatusAccountRequest } from "./IndexStatusAccountRequest.mjs";
|
|
4
|
+
export type { InsightsAccountRequest } from "./InsightsAccountRequest.mjs";
|
|
5
|
+
export type { LandingPagesAccountRequest } from "./LandingPagesAccountRequest.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface IndexAccountResponse {
|
|
2
2
|
brandId: string;
|
|
3
|
-
status:
|
|
3
|
+
status: IndexAccountResponse.Status;
|
|
4
4
|
}
|
|
5
|
-
export declare namespace
|
|
5
|
+
export declare namespace IndexAccountResponse {
|
|
6
6
|
const Status: {
|
|
7
7
|
readonly AlreadyExists: "already_exists";
|
|
8
8
|
readonly Indexing: "indexing";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var IndexAccountResponse;
|
|
3
|
+
(function (IndexAccountResponse) {
|
|
4
|
+
IndexAccountResponse.Status = {
|
|
5
|
+
AlreadyExists: "already_exists",
|
|
6
|
+
Indexing: "indexing",
|
|
7
|
+
};
|
|
8
|
+
})(IndexAccountResponse || (IndexAccountResponse = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
status:
|
|
1
|
+
export interface IndexStatusAccountResponse {
|
|
2
|
+
status: IndexStatusAccountResponse.Status;
|
|
3
3
|
}
|
|
4
|
-
export declare namespace
|
|
4
|
+
export declare namespace IndexStatusAccountResponse {
|
|
5
5
|
const Status: {
|
|
6
6
|
readonly Indexing: "indexing";
|
|
7
7
|
readonly Ready: "ready";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var IndexStatusAccountResponse;
|
|
3
|
+
(function (IndexStatusAccountResponse) {
|
|
4
|
+
IndexStatusAccountResponse.Status = {
|
|
5
|
+
Indexing: "indexing",
|
|
6
|
+
Ready: "ready",
|
|
7
|
+
};
|
|
8
|
+
})(IndexStatusAccountResponse || (IndexStatusAccountResponse = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const InsightsAccountRequestType: {
|
|
2
|
+
readonly Hook: "HOOK";
|
|
3
|
+
readonly TargetPersona: "TARGET_PERSONA";
|
|
4
|
+
readonly AdAngle: "AD_ANGLE";
|
|
5
|
+
readonly MediaMix: "MEDIA_MIX";
|
|
6
|
+
};
|
|
7
|
+
export type InsightsAccountRequestType = (typeof InsightsAccountRequestType)[keyof typeof InsightsAccountRequestType];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const LandingPagesAccountRequestShowInactive: {
|
|
2
|
+
readonly True: "true";
|
|
3
|
+
readonly False: "false";
|
|
4
|
+
};
|
|
5
|
+
export type LandingPagesAccountRequestShowInactive = (typeof LandingPagesAccountRequestShowInactive)[keyof typeof LandingPagesAccountRequestShowInactive];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface LandingPagesAccountResponse {
|
|
2
2
|
count: number;
|
|
3
|
-
landingPages:
|
|
3
|
+
landingPages: LandingPagesAccountResponse.LandingPages.Item[];
|
|
4
4
|
}
|
|
5
|
-
export declare namespace
|
|
5
|
+
export declare namespace LandingPagesAccountResponse {
|
|
6
6
|
type LandingPages = LandingPages.Item[];
|
|
7
7
|
namespace LandingPages {
|
|
8
8
|
interface Item {
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./GetAccountResponse.mjs";
|
|
2
|
+
export * from "./IndexAccountResponse.mjs";
|
|
3
|
+
export * from "./IndexStatusAccountResponse.mjs";
|
|
4
|
+
export * from "./InsightsAccountRequestType.mjs";
|
|
5
|
+
export * from "./InsightsAccountResponse.mjs";
|
|
6
|
+
export * from "./LandingPagesAccountRequestShowInactive.mjs";
|
|
7
|
+
export * from "./LandingPagesAccountResponse.mjs";
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./GetAccountResponse.mjs";
|
|
2
|
+
export * from "./IndexAccountResponse.mjs";
|
|
3
|
+
export * from "./IndexStatusAccountResponse.mjs";
|
|
4
|
+
export * from "./InsightsAccountRequestType.mjs";
|
|
5
|
+
export * from "./InsightsAccountResponse.mjs";
|
|
6
|
+
export * from "./LandingPagesAccountRequestShowInactive.mjs";
|
|
7
|
+
export * from "./LandingPagesAccountResponse.mjs";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
+
export * from "./account/client/requests/index.mjs";
|
|
1
2
|
export * as account from "./account/index.mjs";
|
|
2
3
|
export * from "./account/types/index.mjs";
|
|
3
|
-
export * from "./indexing/client/requests/index.mjs";
|
|
4
|
-
export * as indexing from "./indexing/index.mjs";
|
|
5
|
-
export * from "./indexing/types/index.mjs";
|
|
6
|
-
export * from "./search/client/requests/index.mjs";
|
|
7
|
-
export * as search from "./search/index.mjs";
|
|
8
|
-
export * from "./search/types/index.mjs";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
+
export * from "./account/client/requests/index.mjs";
|
|
1
2
|
export * as account from "./account/index.mjs";
|
|
2
3
|
export * from "./account/types/index.mjs";
|
|
3
|
-
export * from "./indexing/client/requests/index.mjs";
|
|
4
|
-
export * as indexing from "./indexing/index.mjs";
|
|
5
|
-
export * from "./indexing/types/index.mjs";
|
|
6
|
-
export * from "./search/client/requests/index.mjs";
|
|
7
|
-
export * as search from "./search/index.mjs";
|
|
8
|
-
export * from "./search/types/index.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface SearchMediaResponse {
|
|
2
2
|
count: number;
|
|
3
|
-
media:
|
|
3
|
+
media: SearchMediaResponse.Media.Item[];
|
|
4
4
|
}
|
|
5
|
-
export declare namespace
|
|
5
|
+
export declare namespace SearchMediaResponse {
|
|
6
6
|
type Media = Media.Item[];
|
|
7
7
|
namespace Media {
|
|
8
8
|
interface Item {
|