@spyglasshq/sdk 0.1.8 → 0.1.10
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +8 -8
- package/dist/cjs/Client.js +8 -8
- package/dist/cjs/api/client/requests/SearchBrandsRequest.d.ts +4 -4
- package/dist/cjs/api/client/requests/SearchCreatorsRequest.d.ts +4 -4
- package/dist/cjs/api/client/requests/SearchMediaRequest.d.ts +2 -2
- package/dist/cjs/api/resources/account/client/Client.d.ts +63 -3
- package/dist/cjs/api/resources/account/client/Client.js +191 -4
- package/dist/cjs/api/resources/account/client/requests/CampaignsAccountRequest.d.ts +18 -0
- package/dist/cjs/api/resources/account/client/requests/CampaignsAccountRequest.js +3 -0
- package/dist/cjs/api/resources/account/client/requests/CollabsAccountRequest.d.ts +12 -0
- package/dist/cjs/api/resources/account/client/requests/CollabsAccountRequest.js +3 -0
- package/dist/cjs/api/resources/account/client/requests/LandingPagesAccountRequest.d.ts +1 -0
- package/dist/cjs/api/resources/account/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/account/types/CampaignsAccountRequestDatePreset.d.ts +17 -0
- package/dist/cjs/api/resources/account/types/CampaignsAccountRequestDatePreset.js +20 -0
- package/dist/cjs/api/resources/account/types/CampaignsAccountRequestSortBy.d.ts +5 -0
- package/dist/cjs/api/resources/account/types/CampaignsAccountRequestSortBy.js +8 -0
- package/dist/cjs/api/resources/account/types/CampaignsAccountRequestType.d.ts +5 -0
- package/dist/cjs/api/resources/account/types/CampaignsAccountRequestType.js +8 -0
- package/dist/cjs/api/resources/account/types/CampaignsAccountResponse.d.ts +20 -0
- package/dist/cjs/api/resources/account/types/CampaignsAccountResponse.js +3 -0
- package/dist/cjs/api/resources/account/types/CollabsAccountResponse.d.ts +14 -0
- package/dist/cjs/api/resources/account/types/CollabsAccountResponse.js +3 -0
- package/dist/cjs/api/resources/account/types/InsightsAccountResponse.d.ts +0 -10
- package/dist/cjs/api/resources/account/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/account/types/index.js +5 -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 +8 -8
- package/dist/esm/Client.mjs +8 -8
- package/dist/esm/api/client/requests/SearchBrandsRequest.d.mts +4 -4
- package/dist/esm/api/client/requests/SearchCreatorsRequest.d.mts +4 -4
- package/dist/esm/api/client/requests/SearchMediaRequest.d.mts +2 -2
- package/dist/esm/api/resources/account/client/Client.d.mts +63 -3
- package/dist/esm/api/resources/account/client/Client.mjs +191 -4
- package/dist/esm/api/resources/account/client/requests/CampaignsAccountRequest.d.mts +18 -0
- package/dist/esm/api/resources/account/client/requests/CampaignsAccountRequest.mjs +2 -0
- package/dist/esm/api/resources/account/client/requests/CollabsAccountRequest.d.mts +12 -0
- package/dist/esm/api/resources/account/client/requests/CollabsAccountRequest.mjs +2 -0
- package/dist/esm/api/resources/account/client/requests/LandingPagesAccountRequest.d.mts +1 -0
- package/dist/esm/api/resources/account/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/account/types/CampaignsAccountRequestDatePreset.d.mts +17 -0
- package/dist/esm/api/resources/account/types/CampaignsAccountRequestDatePreset.mjs +17 -0
- package/dist/esm/api/resources/account/types/CampaignsAccountRequestSortBy.d.mts +5 -0
- package/dist/esm/api/resources/account/types/CampaignsAccountRequestSortBy.mjs +5 -0
- package/dist/esm/api/resources/account/types/CampaignsAccountRequestType.d.mts +5 -0
- package/dist/esm/api/resources/account/types/CampaignsAccountRequestType.mjs +5 -0
- package/dist/esm/api/resources/account/types/CampaignsAccountResponse.d.mts +20 -0
- package/dist/esm/api/resources/account/types/CampaignsAccountResponse.mjs +2 -0
- package/dist/esm/api/resources/account/types/CollabsAccountResponse.d.mts +14 -0
- package/dist/esm/api/resources/account/types/CollabsAccountResponse.mjs +2 -0
- package/dist/esm/api/resources/account/types/InsightsAccountResponse.d.mts +0 -10
- package/dist/esm/api/resources/account/types/index.d.mts +5 -0
- package/dist/esm/api/resources/account/types/index.mjs +5 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +153 -11
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CampaignsAccountRequestType = void 0;
|
|
5
|
+
exports.CampaignsAccountRequestType = {
|
|
6
|
+
Campaign: 'CAMPAIGN',
|
|
7
|
+
Offer: 'OFFER',
|
|
8
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface CampaignsAccountResponse {
|
|
2
|
+
count: number;
|
|
3
|
+
campaigns: CampaignsAccountResponse.Campaigns.Item[];
|
|
4
|
+
}
|
|
5
|
+
export declare namespace CampaignsAccountResponse {
|
|
6
|
+
type Campaigns = Campaigns.Item[];
|
|
7
|
+
namespace Campaigns {
|
|
8
|
+
interface Item {
|
|
9
|
+
id: string;
|
|
10
|
+
type: string;
|
|
11
|
+
category: string | null;
|
|
12
|
+
title: string;
|
|
13
|
+
summary: string | null;
|
|
14
|
+
velocityScore: number | null;
|
|
15
|
+
startAt: string;
|
|
16
|
+
mediaCount?: number | undefined;
|
|
17
|
+
launches7d: number;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface CollabsAccountResponse {
|
|
2
|
+
count: number;
|
|
3
|
+
collabs: CollabsAccountResponse.Collabs.Item[];
|
|
4
|
+
}
|
|
5
|
+
export declare namespace CollabsAccountResponse {
|
|
6
|
+
type Collabs = Collabs.Item[];
|
|
7
|
+
namespace Collabs {
|
|
8
|
+
interface Item {
|
|
9
|
+
name: string;
|
|
10
|
+
profileUrl: string;
|
|
11
|
+
mediaCount: number;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -8,16 +8,6 @@ export type InsightsAccountResponse = {
|
|
|
8
8
|
} | {
|
|
9
9
|
type: 'HOOK' | 'TARGET_PERSONA' | 'AD_ANGLE';
|
|
10
10
|
count: number;
|
|
11
|
-
buckets: {
|
|
12
|
-
year: number;
|
|
13
|
-
week: number;
|
|
14
|
-
clusters: {
|
|
15
|
-
id: string;
|
|
16
|
-
label: string;
|
|
17
|
-
rawDelta: number;
|
|
18
|
-
percentDelta: number | null;
|
|
19
|
-
}[];
|
|
20
|
-
}[];
|
|
21
11
|
totals: {
|
|
22
12
|
id: string;
|
|
23
13
|
label: string;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export * from './CampaignsAccountRequestDatePreset.js';
|
|
2
|
+
export * from './CampaignsAccountRequestSortBy.js';
|
|
3
|
+
export * from './CampaignsAccountRequestType.js';
|
|
4
|
+
export * from './CampaignsAccountResponse.js';
|
|
5
|
+
export * from './CollabsAccountResponse.js';
|
|
1
6
|
export * from './GetAccountResponse.js';
|
|
2
7
|
export * from './IndexAccountResponse.js';
|
|
3
8
|
export * from './IndexStatusAccountResponse.js';
|
|
@@ -14,6 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CampaignsAccountRequestDatePreset.js"), exports);
|
|
18
|
+
__exportStar(require("./CampaignsAccountRequestSortBy.js"), exports);
|
|
19
|
+
__exportStar(require("./CampaignsAccountRequestType.js"), exports);
|
|
20
|
+
__exportStar(require("./CampaignsAccountResponse.js"), exports);
|
|
21
|
+
__exportStar(require("./CollabsAccountResponse.js"), exports);
|
|
17
22
|
__exportStar(require("./GetAccountResponse.js"), exports);
|
|
18
23
|
__exportStar(require("./IndexAccountResponse.js"), exports);
|
|
19
24
|
__exportStar(require("./IndexStatusAccountResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.10";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
'X-Fern-Language': 'JavaScript',
|
|
8
8
|
'X-Fern-SDK-Name': '@spyglasshq/sdk',
|
|
9
|
-
'X-Fern-SDK-Version': '0.1.
|
|
10
|
-
'User-Agent': '@spyglasshq/sdk/0.1.
|
|
9
|
+
'X-Fern-SDK-Version': '0.1.10',
|
|
10
|
+
'User-Agent': '@spyglasshq/sdk/0.1.10',
|
|
11
11
|
'X-Fern-Runtime': core.RUNTIME.type,
|
|
12
12
|
'X-Fern-Runtime-Version': core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -26,7 +26,7 @@ export declare class Spyglass {
|
|
|
26
26
|
* when nothing matches.
|
|
27
27
|
* - **Name** (`names`). Fuzzy-matches account names (a case-insensitive contains
|
|
28
28
|
* match). Pass every name in one array.
|
|
29
|
-
* - **ID** (`
|
|
29
|
+
* - **ID** (`ids`). Looks up known ids. Missing ids are omitted and listed
|
|
30
30
|
* in `unmatchedIds`. `limit` and `offset` are ignored.
|
|
31
31
|
* - **Instagram** (`igUsername`). Case-insensitive contains match on the
|
|
32
32
|
* handle. A leading `@` is ignored.
|
|
@@ -35,7 +35,7 @@ export declare class Spyglass {
|
|
|
35
35
|
* If a request includes more than one of these fields, only the highest
|
|
36
36
|
* priority field is used. The rest are ignored:
|
|
37
37
|
*
|
|
38
|
-
* 1. `
|
|
38
|
+
* 1. `ids`
|
|
39
39
|
* 2. `igUsername` or `tiktokUsername` (if both are set, either handle can match)
|
|
40
40
|
* 3. `names`
|
|
41
41
|
* 4. `query`
|
|
@@ -47,7 +47,7 @@ export declare class Spyglass {
|
|
|
47
47
|
* every mode except ID.
|
|
48
48
|
*
|
|
49
49
|
* Limited to 120 requests per minute per user.
|
|
50
|
-
* Costs
|
|
50
|
+
* Costs $0.0010 per brand returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
51
51
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
52
52
|
* row even when nothing matches.
|
|
53
53
|
*
|
|
@@ -86,7 +86,7 @@ export declare class Spyglass {
|
|
|
86
86
|
* when nothing matches.
|
|
87
87
|
* - **Name** (`names`). Fuzzy-matches account names (a case-insensitive contains
|
|
88
88
|
* match). Pass every name in one array.
|
|
89
|
-
* - **ID** (`
|
|
89
|
+
* - **ID** (`ids`). Looks up known ids. Missing ids are omitted and listed
|
|
90
90
|
* in `unmatchedIds`. `limit` and `offset` are ignored.
|
|
91
91
|
* - **Instagram** (`igUsername`). Case-insensitive contains match on the
|
|
92
92
|
* handle. A leading `@` is ignored.
|
|
@@ -95,7 +95,7 @@ export declare class Spyglass {
|
|
|
95
95
|
* If a request includes more than one of these fields, only the highest
|
|
96
96
|
* priority field is used. The rest are ignored:
|
|
97
97
|
*
|
|
98
|
-
* 1. `
|
|
98
|
+
* 1. `ids`
|
|
99
99
|
* 2. `igUsername` or `tiktokUsername` (if both are set, either handle can match)
|
|
100
100
|
* 3. `names`
|
|
101
101
|
* 4. `query`
|
|
@@ -107,7 +107,7 @@ export declare class Spyglass {
|
|
|
107
107
|
* every mode except ID.
|
|
108
108
|
*
|
|
109
109
|
* Limited to 120 requests per minute per user.
|
|
110
|
-
* Costs
|
|
110
|
+
* Costs $0.0010 per creator returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
111
111
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
112
112
|
* row even when nothing matches.
|
|
113
113
|
*
|
|
@@ -168,7 +168,7 @@ export declare class Spyglass {
|
|
|
168
168
|
* `query` is required.
|
|
169
169
|
*
|
|
170
170
|
* Limited to 120 requests per minute per user.
|
|
171
|
-
* Costs
|
|
171
|
+
* Costs $0.0005 per creative returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
172
172
|
* The call bills a minimum of one row even when nothing matches. In that
|
|
173
173
|
* case `count` is 0 but you are charged for one row.
|
|
174
174
|
*
|
|
@@ -242,7 +242,7 @@ export declare class Spyglass {
|
|
|
242
242
|
* are served from cache.
|
|
243
243
|
*
|
|
244
244
|
* Limited to 20 requests per minute per user.
|
|
245
|
-
* Costs
|
|
245
|
+
* Costs $0.0050 per successful page of comments returned, charged against your plan's monthly credits.
|
|
246
246
|
* Each comment page fetched live (`limit`, default 1) is one billed
|
|
247
247
|
* unit. Cached posts do not scrape and are not billed.
|
|
248
248
|
*
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -38,7 +38,7 @@ export class Spyglass {
|
|
|
38
38
|
* when nothing matches.
|
|
39
39
|
* - **Name** (`names`). Fuzzy-matches account names (a case-insensitive contains
|
|
40
40
|
* match). Pass every name in one array.
|
|
41
|
-
* - **ID** (`
|
|
41
|
+
* - **ID** (`ids`). Looks up known ids. Missing ids are omitted and listed
|
|
42
42
|
* in `unmatchedIds`. `limit` and `offset` are ignored.
|
|
43
43
|
* - **Instagram** (`igUsername`). Case-insensitive contains match on the
|
|
44
44
|
* handle. A leading `@` is ignored.
|
|
@@ -47,7 +47,7 @@ export class Spyglass {
|
|
|
47
47
|
* If a request includes more than one of these fields, only the highest
|
|
48
48
|
* priority field is used. The rest are ignored:
|
|
49
49
|
*
|
|
50
|
-
* 1. `
|
|
50
|
+
* 1. `ids`
|
|
51
51
|
* 2. `igUsername` or `tiktokUsername` (if both are set, either handle can match)
|
|
52
52
|
* 3. `names`
|
|
53
53
|
* 4. `query`
|
|
@@ -59,7 +59,7 @@ export class Spyglass {
|
|
|
59
59
|
* every mode except ID.
|
|
60
60
|
*
|
|
61
61
|
* Limited to 120 requests per minute per user.
|
|
62
|
-
* Costs
|
|
62
|
+
* Costs $0.0010 per brand returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
63
63
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
64
64
|
* row even when nothing matches.
|
|
65
65
|
*
|
|
@@ -153,7 +153,7 @@ export class Spyglass {
|
|
|
153
153
|
* when nothing matches.
|
|
154
154
|
* - **Name** (`names`). Fuzzy-matches account names (a case-insensitive contains
|
|
155
155
|
* match). Pass every name in one array.
|
|
156
|
-
* - **ID** (`
|
|
156
|
+
* - **ID** (`ids`). Looks up known ids. Missing ids are omitted and listed
|
|
157
157
|
* in `unmatchedIds`. `limit` and `offset` are ignored.
|
|
158
158
|
* - **Instagram** (`igUsername`). Case-insensitive contains match on the
|
|
159
159
|
* handle. A leading `@` is ignored.
|
|
@@ -162,7 +162,7 @@ export class Spyglass {
|
|
|
162
162
|
* If a request includes more than one of these fields, only the highest
|
|
163
163
|
* priority field is used. The rest are ignored:
|
|
164
164
|
*
|
|
165
|
-
* 1. `
|
|
165
|
+
* 1. `ids`
|
|
166
166
|
* 2. `igUsername` or `tiktokUsername` (if both are set, either handle can match)
|
|
167
167
|
* 3. `names`
|
|
168
168
|
* 4. `query`
|
|
@@ -174,7 +174,7 @@ export class Spyglass {
|
|
|
174
174
|
* every mode except ID.
|
|
175
175
|
*
|
|
176
176
|
* Limited to 120 requests per minute per user.
|
|
177
|
-
* Costs
|
|
177
|
+
* Costs $0.0010 per creator returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
178
178
|
* A `query` search runs a language model, so it bills a minimum of one
|
|
179
179
|
* row even when nothing matches.
|
|
180
180
|
*
|
|
@@ -349,7 +349,7 @@ export class Spyglass {
|
|
|
349
349
|
* `query` is required.
|
|
350
350
|
*
|
|
351
351
|
* Limited to 120 requests per minute per user.
|
|
352
|
-
* Costs
|
|
352
|
+
* Costs $0.0005 per creative returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
353
353
|
* The call bills a minimum of one row even when nothing matches. In that
|
|
354
354
|
* case `count` is 0 but you are charged for one row.
|
|
355
355
|
*
|
|
@@ -530,7 +530,7 @@ export class Spyglass {
|
|
|
530
530
|
* are served from cache.
|
|
531
531
|
*
|
|
532
532
|
* Limited to 20 requests per minute per user.
|
|
533
|
-
* Costs
|
|
533
|
+
* Costs $0.0050 per successful page of comments returned, charged against your plan's monthly credits.
|
|
534
534
|
* Each comment page fetched live (`limit`, default 1) is one billed
|
|
535
535
|
* unit. Cached posts do not scrape and are not billed.
|
|
536
536
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface SearchBrandsRequest {
|
|
9
|
-
|
|
9
|
+
ids?: SearchBrandsRequest.Ids.Item[];
|
|
10
10
|
names?: string[];
|
|
11
11
|
igUsername?: string;
|
|
12
12
|
tiktokUsername?: string;
|
|
@@ -20,10 +20,10 @@ export interface SearchBrandsRequest {
|
|
|
20
20
|
taxonomy?: string[];
|
|
21
21
|
}
|
|
22
22
|
export declare namespace SearchBrandsRequest {
|
|
23
|
-
type
|
|
24
|
-
namespace
|
|
23
|
+
type Ids = Ids.Item[];
|
|
24
|
+
namespace Ids {
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Account id given as a platform string or uuid
|
|
27
27
|
*/
|
|
28
28
|
type Item = string | number;
|
|
29
29
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* }
|
|
8
8
|
*/
|
|
9
9
|
export interface SearchCreatorsRequest {
|
|
10
|
-
|
|
10
|
+
ids?: SearchCreatorsRequest.Ids.Item[];
|
|
11
11
|
names?: string[];
|
|
12
12
|
igUsername?: string;
|
|
13
13
|
tiktokUsername?: string;
|
|
@@ -24,10 +24,10 @@ export interface SearchCreatorsRequest {
|
|
|
24
24
|
language?: SearchCreatorsRequest.Language;
|
|
25
25
|
}
|
|
26
26
|
export declare namespace SearchCreatorsRequest {
|
|
27
|
-
type
|
|
28
|
-
namespace
|
|
27
|
+
type Ids = Ids.Item[];
|
|
28
|
+
namespace Ids {
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Account id given as a platform string or uuid
|
|
31
31
|
*/
|
|
32
32
|
type Item = string | number;
|
|
33
33
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface SearchMediaRequest {
|
|
9
|
-
/**
|
|
9
|
+
/** Account id given as a platform string or uuid */
|
|
10
10
|
accountId?: SearchMediaRequest.AccountId;
|
|
11
11
|
query?: string;
|
|
12
12
|
channel?: SearchMediaRequest.Channel.Item[];
|
|
@@ -36,7 +36,7 @@ export interface SearchMediaRequest {
|
|
|
36
36
|
}
|
|
37
37
|
export declare namespace SearchMediaRequest {
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Account id given as a platform string or uuid
|
|
40
40
|
*/
|
|
41
41
|
type AccountId = string | number;
|
|
42
42
|
type Channel = Channel.Item[];
|
|
@@ -16,7 +16,7 @@ export declare class AccountClient {
|
|
|
16
16
|
* (`gender`, `ageRange`, ...) are present only on `CREATOR`.
|
|
17
17
|
*
|
|
18
18
|
* Limited to 120 requests per minute per user.
|
|
19
|
-
* Costs
|
|
19
|
+
* Costs $0.0010 per account returned, charged against your plan's monthly credits.
|
|
20
20
|
* An id that matches nothing returns 404 and is free.
|
|
21
21
|
*
|
|
22
22
|
* @param {spyglass.GetAccountRequest} request
|
|
@@ -49,7 +49,7 @@ export declare class AccountClient {
|
|
|
49
49
|
* `totals` to creatives that started within the requested window.
|
|
50
50
|
*
|
|
51
51
|
* Limited to 120 requests per minute per user.
|
|
52
|
-
* Costs
|
|
52
|
+
* Costs $0.0005 per cluster returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
53
53
|
*
|
|
54
54
|
* @param {spyglass.InsightsAccountRequest} request
|
|
55
55
|
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -73,12 +73,72 @@ export declare class AccountClient {
|
|
|
73
73
|
*/
|
|
74
74
|
insights(request: spyglass.InsightsAccountRequest, requestOptions?: AccountClient.RequestOptions): core.HttpResponsePromise<spyglass.InsightsAccountResponse>;
|
|
75
75
|
private __insights;
|
|
76
|
+
/**
|
|
77
|
+
* Return an account’s campaigns or offers, newest start date first.
|
|
78
|
+
* `datePreset`, or `startDate` and `endDate`, filter by campaign
|
|
79
|
+
* start date. Omit both for all time.
|
|
80
|
+
*
|
|
81
|
+
* Limited to 120 requests per minute per user.
|
|
82
|
+
* Costs $0.0005 per campaign returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
83
|
+
*
|
|
84
|
+
* @param {spyglass.CampaignsAccountRequest} request
|
|
85
|
+
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
|
+
*
|
|
87
|
+
* @throws {@link spyglass.BadRequestError}
|
|
88
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
89
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
90
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
91
|
+
* @throws {@link spyglass.NotFoundError}
|
|
92
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
93
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
94
|
+
* @throws {@link spyglass.InternalServerError}
|
|
95
|
+
* @throws {@link errors.SpyglassError}
|
|
96
|
+
* @throws {@link errors.SpyglassTimeoutError}
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* await client.account.campaigns({
|
|
100
|
+
* id: "id",
|
|
101
|
+
* type: "CAMPAIGN"
|
|
102
|
+
* })
|
|
103
|
+
*/
|
|
104
|
+
campaigns(request: spyglass.CampaignsAccountRequest, requestOptions?: AccountClient.RequestOptions): core.HttpResponsePromise<spyglass.CampaignsAccountResponse>;
|
|
105
|
+
private __campaigns;
|
|
106
|
+
/**
|
|
107
|
+
* Return the creators an account has collaborated with, ordered from
|
|
108
|
+
* most media to least. Works for both brands and creators.
|
|
109
|
+
* mediaCount is how many of that account’s media items tag the
|
|
110
|
+
* creator.
|
|
111
|
+
*
|
|
112
|
+
* Limited to 120 requests per minute per user.
|
|
113
|
+
* Costs $0.0005 per collab returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
114
|
+
*
|
|
115
|
+
* @param {spyglass.CollabsAccountRequest} request
|
|
116
|
+
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
117
|
+
*
|
|
118
|
+
* @throws {@link spyglass.BadRequestError}
|
|
119
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
120
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
121
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
122
|
+
* @throws {@link spyglass.NotFoundError}
|
|
123
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
124
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
125
|
+
* @throws {@link spyglass.InternalServerError}
|
|
126
|
+
* @throws {@link errors.SpyglassError}
|
|
127
|
+
* @throws {@link errors.SpyglassTimeoutError}
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* await client.account.collabs({
|
|
131
|
+
* id: "id"
|
|
132
|
+
* })
|
|
133
|
+
*/
|
|
134
|
+
collabs(request: spyglass.CollabsAccountRequest, requestOptions?: AccountClient.RequestOptions): core.HttpResponsePromise<spyglass.CollabsAccountResponse>;
|
|
135
|
+
private __collabs;
|
|
76
136
|
/**
|
|
77
137
|
* Return the landing-page URLs an account sends ad traffic to, ranked by
|
|
78
138
|
* how often they appear across its ads.
|
|
79
139
|
*
|
|
80
140
|
* Limited to 120 requests per minute per user.
|
|
81
|
-
* Costs
|
|
141
|
+
* Costs $0.0025 per landing page returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
82
142
|
*
|
|
83
143
|
* @param {spyglass.LandingPagesAccountRequest} request
|
|
84
144
|
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -26,7 +26,7 @@ export class AccountClient {
|
|
|
26
26
|
* (`gender`, `ageRange`, ...) are present only on `CREATOR`.
|
|
27
27
|
*
|
|
28
28
|
* Limited to 120 requests per minute per user.
|
|
29
|
-
* Costs
|
|
29
|
+
* Costs $0.0010 per account returned, charged against your plan's monthly credits.
|
|
30
30
|
* An id that matches nothing returns 404 and is free.
|
|
31
31
|
*
|
|
32
32
|
* @param {spyglass.GetAccountRequest} request
|
|
@@ -112,7 +112,7 @@ export class AccountClient {
|
|
|
112
112
|
* `totals` to creatives that started within the requested window.
|
|
113
113
|
*
|
|
114
114
|
* Limited to 120 requests per minute per user.
|
|
115
|
-
* Costs
|
|
115
|
+
* Costs $0.0005 per cluster returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
116
116
|
*
|
|
117
117
|
* @param {spyglass.InsightsAccountRequest} request
|
|
118
118
|
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -198,12 +198,198 @@ export class AccountClient {
|
|
|
198
198
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, 'GET', '/account/{id}/insights');
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Return an account’s campaigns or offers, newest start date first.
|
|
203
|
+
* `datePreset`, or `startDate` and `endDate`, filter by campaign
|
|
204
|
+
* start date. Omit both for all time.
|
|
205
|
+
*
|
|
206
|
+
* Limited to 120 requests per minute per user.
|
|
207
|
+
* Costs $0.0005 per campaign returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
208
|
+
*
|
|
209
|
+
* @param {spyglass.CampaignsAccountRequest} request
|
|
210
|
+
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
211
|
+
*
|
|
212
|
+
* @throws {@link spyglass.BadRequestError}
|
|
213
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
214
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
215
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
216
|
+
* @throws {@link spyglass.NotFoundError}
|
|
217
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
218
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
219
|
+
* @throws {@link spyglass.InternalServerError}
|
|
220
|
+
* @throws {@link errors.SpyglassError}
|
|
221
|
+
* @throws {@link errors.SpyglassTimeoutError}
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* await client.account.campaigns({
|
|
225
|
+
* id: "id",
|
|
226
|
+
* type: "CAMPAIGN"
|
|
227
|
+
* })
|
|
228
|
+
*/
|
|
229
|
+
campaigns(request, requestOptions) {
|
|
230
|
+
return core.HttpResponsePromise.fromPromise(this.__campaigns(request, requestOptions));
|
|
231
|
+
}
|
|
232
|
+
__campaigns(request, requestOptions) {
|
|
233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
235
|
+
const { id, type: type_, sortBy, limit, datePreset, startDate, endDate } = request;
|
|
236
|
+
const _queryParams = {
|
|
237
|
+
type: type_,
|
|
238
|
+
sortBy: sortBy != null ? sortBy : undefined,
|
|
239
|
+
limit,
|
|
240
|
+
datePreset: datePreset != null ? datePreset : undefined,
|
|
241
|
+
startDate,
|
|
242
|
+
endDate,
|
|
243
|
+
};
|
|
244
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
245
|
+
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);
|
|
246
|
+
const _response = yield core.fetcher({
|
|
247
|
+
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)}/campaigns`),
|
|
248
|
+
method: 'GET',
|
|
249
|
+
headers: _headers,
|
|
250
|
+
queryString: core.url
|
|
251
|
+
.queryBuilder()
|
|
252
|
+
.addMany(_queryParams)
|
|
253
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
254
|
+
.build(),
|
|
255
|
+
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,
|
|
256
|
+
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,
|
|
257
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
258
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
259
|
+
logging: this._options.logging,
|
|
260
|
+
});
|
|
261
|
+
if (_response.ok) {
|
|
262
|
+
return {
|
|
263
|
+
data: _response.body,
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
if (_response.error.reason === 'status-code') {
|
|
268
|
+
switch (_response.error.statusCode) {
|
|
269
|
+
case 400:
|
|
270
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
271
|
+
case 401:
|
|
272
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
273
|
+
case 402:
|
|
274
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
275
|
+
case 403:
|
|
276
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
277
|
+
case 404:
|
|
278
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
279
|
+
case 405:
|
|
280
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
281
|
+
case 429:
|
|
282
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
283
|
+
case 500:
|
|
284
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
285
|
+
default:
|
|
286
|
+
throw new errors.SpyglassError({
|
|
287
|
+
statusCode: _response.error.statusCode,
|
|
288
|
+
body: _response.error.body,
|
|
289
|
+
rawResponse: _response.rawResponse,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, 'GET', '/account/{id}/campaigns');
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Return the creators an account has collaborated with, ordered from
|
|
298
|
+
* most media to least. Works for both brands and creators.
|
|
299
|
+
* mediaCount is how many of that account’s media items tag the
|
|
300
|
+
* creator.
|
|
301
|
+
*
|
|
302
|
+
* Limited to 120 requests per minute per user.
|
|
303
|
+
* Costs $0.0005 per collab returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
304
|
+
*
|
|
305
|
+
* @param {spyglass.CollabsAccountRequest} request
|
|
306
|
+
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
307
|
+
*
|
|
308
|
+
* @throws {@link spyglass.BadRequestError}
|
|
309
|
+
* @throws {@link spyglass.UnauthorizedError}
|
|
310
|
+
* @throws {@link spyglass.PaymentRequiredError}
|
|
311
|
+
* @throws {@link spyglass.ForbiddenError}
|
|
312
|
+
* @throws {@link spyglass.NotFoundError}
|
|
313
|
+
* @throws {@link spyglass.MethodNotAllowedError}
|
|
314
|
+
* @throws {@link spyglass.TooManyRequestsError}
|
|
315
|
+
* @throws {@link spyglass.InternalServerError}
|
|
316
|
+
* @throws {@link errors.SpyglassError}
|
|
317
|
+
* @throws {@link errors.SpyglassTimeoutError}
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* await client.account.collabs({
|
|
321
|
+
* id: "id"
|
|
322
|
+
* })
|
|
323
|
+
*/
|
|
324
|
+
collabs(request, requestOptions) {
|
|
325
|
+
return core.HttpResponsePromise.fromPromise(this.__collabs(request, requestOptions));
|
|
326
|
+
}
|
|
327
|
+
__collabs(request, requestOptions) {
|
|
328
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
329
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
330
|
+
const { id, limit, offset } = request;
|
|
331
|
+
const _queryParams = {
|
|
332
|
+
limit,
|
|
333
|
+
offset,
|
|
334
|
+
};
|
|
335
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
336
|
+
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);
|
|
337
|
+
const _response = yield core.fetcher({
|
|
338
|
+
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)}/collabs`),
|
|
339
|
+
method: 'GET',
|
|
340
|
+
headers: _headers,
|
|
341
|
+
queryString: core.url
|
|
342
|
+
.queryBuilder()
|
|
343
|
+
.addMany(_queryParams)
|
|
344
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
345
|
+
.build(),
|
|
346
|
+
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,
|
|
347
|
+
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,
|
|
348
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
349
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
350
|
+
logging: this._options.logging,
|
|
351
|
+
});
|
|
352
|
+
if (_response.ok) {
|
|
353
|
+
return {
|
|
354
|
+
data: _response.body,
|
|
355
|
+
rawResponse: _response.rawResponse,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
if (_response.error.reason === 'status-code') {
|
|
359
|
+
switch (_response.error.statusCode) {
|
|
360
|
+
case 400:
|
|
361
|
+
throw new spyglass.BadRequestError(_response.error.body, _response.rawResponse);
|
|
362
|
+
case 401:
|
|
363
|
+
throw new spyglass.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
364
|
+
case 402:
|
|
365
|
+
throw new spyglass.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
366
|
+
case 403:
|
|
367
|
+
throw new spyglass.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
368
|
+
case 404:
|
|
369
|
+
throw new spyglass.NotFoundError(_response.error.body, _response.rawResponse);
|
|
370
|
+
case 405:
|
|
371
|
+
throw new spyglass.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
372
|
+
case 429:
|
|
373
|
+
throw new spyglass.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
374
|
+
case 500:
|
|
375
|
+
throw new spyglass.InternalServerError(_response.error.body, _response.rawResponse);
|
|
376
|
+
default:
|
|
377
|
+
throw new errors.SpyglassError({
|
|
378
|
+
statusCode: _response.error.statusCode,
|
|
379
|
+
body: _response.error.body,
|
|
380
|
+
rawResponse: _response.rawResponse,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, 'GET', '/account/{id}/collabs');
|
|
385
|
+
});
|
|
386
|
+
}
|
|
201
387
|
/**
|
|
202
388
|
* Return the landing-page URLs an account sends ad traffic to, ranked by
|
|
203
389
|
* how often they appear across its ads.
|
|
204
390
|
*
|
|
205
391
|
* Limited to 120 requests per minute per user.
|
|
206
|
-
* Costs
|
|
392
|
+
* Costs $0.0025 per landing page returned, charged against your plan's monthly credits. The count field is what you were charged for.
|
|
207
393
|
*
|
|
208
394
|
* @param {spyglass.LandingPagesAccountRequest} request
|
|
209
395
|
* @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -230,10 +416,11 @@ export class AccountClient {
|
|
|
230
416
|
__landingPages(request, requestOptions) {
|
|
231
417
|
return __awaiter(this, void 0, void 0, function* () {
|
|
232
418
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
233
|
-
const { id, showInactive, limit } = request;
|
|
419
|
+
const { id, showInactive, limit, offset } = request;
|
|
234
420
|
const _queryParams = {
|
|
235
421
|
showInactive: showInactive != null ? showInactive : undefined,
|
|
236
422
|
limit,
|
|
423
|
+
offset,
|
|
237
424
|
};
|
|
238
425
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
239
426
|
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);
|