adapty 0.8.4 → 0.8.6
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 +7 -2
- package/bin/dev.js +2 -2
- package/bin/run.js +2 -2
- package/dist/cli/base/adapty/adapty-command.d.ts +21 -0
- package/dist/cli/base/adapty/adapty-command.js +47 -0
- package/dist/cli/base/adapty/build.d.ts +11 -0
- package/dist/cli/base/adapty/build.js +13 -0
- package/dist/cli/base/adapty/index.d.ts +5 -0
- package/dist/cli/base/adapty/index.js +3 -0
- package/dist/cli/base/adapty/openSession.d.ts +22 -0
- package/dist/cli/base/adapty/openSession.js +25 -0
- package/dist/cli/base/base-command.d.ts +30 -0
- package/dist/cli/base/base-command.js +64 -0
- package/dist/cli/commands/apps/create.d.ts +19 -0
- package/dist/cli/commands/apps/create.js +68 -0
- package/dist/cli/commands/apps/get.d.ts +10 -0
- package/dist/cli/commands/apps/get.js +14 -0
- package/dist/cli/commands/apps/list.d.ts +11 -0
- package/dist/cli/commands/apps/list.js +14 -0
- package/dist/cli/commands/apps/update.d.ts +15 -0
- package/dist/cli/commands/apps/update.js +30 -0
- package/dist/cli/commands/auth/login.d.ts +11 -0
- package/dist/cli/commands/auth/login.js +68 -0
- package/dist/cli/commands/auth/logout.d.ts +12 -0
- package/dist/cli/commands/auth/logout.js +28 -0
- package/dist/cli/commands/auth/revoke.d.ts +13 -0
- package/dist/cli/commands/auth/revoke.js +32 -0
- package/dist/cli/commands/auth/status/index.d.ts +7 -0
- package/dist/cli/commands/auth/status/index.js +22 -0
- package/dist/cli/commands/auth/status/lib/render.d.ts +3 -0
- package/dist/cli/commands/auth/status/lib/render.js +14 -0
- package/dist/cli/commands/auth/status/lib/result.d.ts +15 -0
- package/dist/cli/commands/auth/status/lib/result.js +1 -0
- package/dist/cli/commands/auth/whoami.d.ts +10 -0
- package/dist/cli/commands/auth/whoami.js +16 -0
- package/dist/cli/errors.d.ts +39 -0
- package/dist/cli/errors.js +92 -0
- package/dist/cli/flags.d.ts +16 -0
- package/dist/cli/flags.js +27 -0
- package/dist/cli/views/list.d.ts +6 -0
- package/dist/cli/views/list.js +10 -0
- package/dist/cli/views/record.d.ts +9 -0
- package/dist/cli/views/record.js +14 -0
- package/dist/commands/access-levels/create.js +1 -1
- package/dist/commands/access-levels/list.d.ts +1 -1
- package/dist/commands/apps/create.d.ts +1 -14
- package/dist/commands/apps/create.js +2 -54
- package/dist/commands/apps/get.d.ts +1 -11
- package/dist/commands/apps/get.js +2 -22
- package/dist/commands/apps/list.d.ts +1 -13
- package/dist/commands/apps/list.js +2 -19
- package/dist/commands/apps/update.d.ts +1 -16
- package/dist/commands/apps/update.js +2 -38
- package/dist/commands/asa/ad-groups/create.js +9 -7
- package/dist/commands/asa/ad-groups/get.js +3 -2
- package/dist/commands/asa/ad-groups/list.d.ts +1 -1
- package/dist/commands/asa/ad-groups/list.js +1 -1
- package/dist/commands/asa/ad-groups/update.js +22 -12
- package/dist/commands/asa/ads/create.js +7 -5
- package/dist/commands/asa/ads/get.js +3 -2
- package/dist/commands/asa/ads/list.d.ts +1 -1
- package/dist/commands/asa/ads/list.js +1 -1
- package/dist/commands/asa/ads/update.js +9 -5
- package/dist/commands/asa/apps/list.d.ts +1 -1
- package/dist/commands/asa/apps/list.js +1 -1
- package/dist/commands/asa/automations/create.js +9 -6
- package/dist/commands/asa/automations/get.js +3 -2
- package/dist/commands/asa/automations/list.d.ts +1 -1
- package/dist/commands/asa/automations/list.js +1 -1
- package/dist/commands/asa/automations/run.js +5 -3
- package/dist/commands/asa/automations/runs.d.ts +1 -1
- package/dist/commands/asa/automations/runs.js +4 -4
- package/dist/commands/asa/automations/update.js +17 -9
- package/dist/commands/asa/campaigns/bulk-create.js +31 -18
- package/dist/commands/asa/campaigns/bulk-list.js +7 -5
- package/dist/commands/asa/campaigns/bulk-status.js +3 -2
- package/dist/commands/asa/campaigns/create.js +10 -8
- package/dist/commands/asa/campaigns/get.js +3 -2
- package/dist/commands/asa/campaigns/list.d.ts +1 -1
- package/dist/commands/asa/campaigns/list.js +1 -1
- package/dist/commands/asa/campaigns/update.js +25 -15
- package/dist/commands/asa/competitors/summary.js +5 -5
- package/dist/commands/asa/connect.js +5 -3
- package/dist/commands/asa/creatives/list.d.ts +1 -1
- package/dist/commands/asa/creatives/list.js +1 -1
- package/dist/commands/asa/keywords/add.js +13 -10
- package/dist/commands/asa/keywords/list.d.ts +1 -1
- package/dist/commands/asa/keywords/list.js +1 -1
- package/dist/commands/asa/keywords/update.js +15 -10
- package/dist/commands/asa/metrics/index.d.ts +2 -2
- package/dist/commands/asa/metrics/index.js +22 -8
- package/dist/commands/asa/metrics/overview.js +3 -3
- package/dist/commands/asa/negative-keywords/add.js +10 -7
- package/dist/commands/asa/negative-keywords/list.d.ts +1 -1
- package/dist/commands/asa/negative-keywords/list.js +1 -1
- package/dist/commands/asa/orgs/list.d.ts +1 -1
- package/dist/commands/asa/orgs/list.js +1 -1
- package/dist/commands/asa/product-pages/list.d.ts +1 -1
- package/dist/commands/asa/product-pages/list.js +1 -1
- package/dist/commands/asa/product-pages/sync.js +1 -1
- package/dist/commands/asa/search-terms/list.d.ts +1 -1
- package/dist/commands/asa/search-terms/list.js +1 -1
- package/dist/commands/asa/whoami.js +13 -4
- package/dist/commands/auth/login.d.ts +1 -8
- package/dist/commands/auth/login.js +2 -120
- package/dist/commands/auth/logout.d.ts +1 -9
- package/dist/commands/auth/logout.js +2 -18
- package/dist/commands/auth/revoke.d.ts +1 -9
- package/dist/commands/auth/revoke.js +2 -21
- package/dist/commands/auth/status.d.ts +1 -7
- package/dist/commands/auth/status.js +2 -26
- package/dist/commands/auth/whoami.d.ts +1 -7
- package/dist/commands/auth/whoami.js +2 -15
- package/dist/commands/flows/config/get.js +2 -2
- package/dist/commands/flows/config/preview.d.ts +2 -2
- package/dist/commands/flows/config/preview.js +6 -4
- package/dist/commands/flows/config/update.js +5 -3
- package/dist/commands/flows/config/validate.js +5 -3
- package/dist/commands/flows/list.d.ts +1 -1
- package/dist/commands/flows/media/upload.js +1 -1
- package/dist/commands/flows/publish.js +5 -5
- package/dist/commands/paywalls/create.js +1 -1
- package/dist/commands/paywalls/list.d.ts +1 -1
- package/dist/commands/paywalls/placements.d.ts +2 -2
- package/dist/commands/paywalls/update.js +1 -1
- package/dist/commands/placements/create.js +17 -12
- package/dist/commands/placements/list.d.ts +1 -1
- package/dist/commands/placements/update.js +20 -15
- package/dist/commands/products/create.js +20 -13
- package/dist/commands/products/list.d.ts +1 -1
- package/dist/commands/products/update.js +1 -1
- package/dist/commands/segments/list.d.ts +1 -1
- package/dist/lib/api-client.d.ts +10 -6
- package/dist/lib/api-client.js +56 -35
- package/dist/lib/api-schemas.d.ts +63 -59
- package/dist/lib/app-url.js +2 -1
- package/dist/lib/asa-client.d.ts +13 -8
- package/dist/lib/asa-client.js +9 -4
- package/dist/lib/asa-flags.d.ts +19 -19
- package/dist/lib/asa-flags.js +38 -25
- package/dist/lib/asa-keyword-action.d.ts +10 -10
- package/dist/lib/asa-keyword-action.js +40 -25
- package/dist/lib/asa-schemas.d.ts +101 -81
- package/dist/lib/auth.js +2 -1
- package/dist/lib/client-from-config.d.ts +1 -1
- package/dist/lib/client-from-config.js +2 -1
- package/dist/lib/config.d.ts +2 -2
- package/dist/lib/confirm.d.ts +4 -4
- package/dist/lib/confirm.js +12 -7
- package/dist/lib/errors.d.ts +18 -18
- package/dist/lib/errors.js +12 -9
- package/dist/lib/flags.d.ts +3 -3
- package/dist/lib/flags.js +2 -1
- package/dist/lib/flow-help.js +11 -6
- package/dist/lib/output.js +23 -12
- package/dist/lib/preview.d.ts +5 -5
- package/dist/lib/preview.js +2 -1
- package/dist/sdk/adapty/access-levels.d.ts +15 -0
- package/dist/sdk/adapty/access-levels.js +4 -0
- package/dist/sdk/adapty/apps/create.d.ts +26 -0
- package/dist/sdk/adapty/apps/create.js +36 -0
- package/dist/sdk/adapty/apps/index.d.ts +13 -0
- package/dist/sdk/adapty/apps/index.js +9 -0
- package/dist/sdk/adapty/apps/model.d.ts +24 -0
- package/dist/sdk/adapty/apps/model.js +10 -0
- package/dist/sdk/adapty/apps/resource.d.ts +19 -0
- package/dist/sdk/adapty/apps/resource.js +23 -0
- package/dist/sdk/adapty/apps/update.d.ts +16 -0
- package/dist/sdk/adapty/apps/update.js +25 -0
- package/dist/sdk/adapty/auth/device-code.d.ts +8 -0
- package/dist/sdk/adapty/auth/device-code.js +19 -0
- package/dist/sdk/adapty/auth/index.d.ts +7 -0
- package/dist/sdk/adapty/auth/index.js +5 -0
- package/dist/sdk/adapty/auth/model.d.ts +15 -0
- package/dist/sdk/adapty/auth/model.js +6 -0
- package/dist/sdk/adapty/auth/poll-token.d.ts +8 -0
- package/dist/sdk/adapty/auth/poll-token.js +58 -0
- package/dist/sdk/adapty/auth/resource.d.ts +17 -0
- package/dist/sdk/adapty/auth/resource.js +21 -0
- package/dist/sdk/adapty/errors.d.ts +10 -0
- package/dist/sdk/adapty/errors.js +38 -0
- package/dist/sdk/adapty/index.d.ts +36 -0
- package/dist/sdk/adapty/index.js +27 -0
- package/dist/sdk/adapty/pagination.d.ts +23 -0
- package/dist/sdk/adapty/pagination.js +1 -0
- package/dist/sdk/core/auth/device-flow.d.ts +46 -0
- package/dist/sdk/core/auth/device-flow.js +62 -0
- package/dist/sdk/core/clock.d.ts +7 -0
- package/dist/sdk/core/clock.js +21 -0
- package/dist/sdk/core/errors.d.ts +81 -0
- package/dist/sdk/core/errors.js +84 -0
- package/dist/sdk/core/http/client.d.ts +46 -0
- package/dist/sdk/core/http/client.js +127 -0
- package/dist/sdk/core/http/index.d.ts +11 -0
- package/dist/sdk/core/http/index.js +7 -0
- package/dist/sdk/core/http/policies.d.ts +14 -0
- package/dist/sdk/core/http/policies.js +29 -0
- package/dist/sdk/core/http/retry.d.ts +27 -0
- package/dist/sdk/core/http/retry.js +22 -0
- package/dist/sdk/core/http/url.d.ts +3 -0
- package/dist/sdk/core/http/url.js +19 -0
- package/dist/sdk/core/session.d.ts +20 -0
- package/dist/sdk/core/session.js +69 -0
- package/dist/sdk/core/testing.d.ts +25 -0
- package/dist/sdk/core/testing.js +46 -0
- package/dist/sdk/core/validation.d.ts +10 -0
- package/dist/sdk/core/validation.js +14 -0
- package/oclif.manifest.json +766 -766
- package/package.json +19 -9
|
@@ -24,12 +24,12 @@ export default class AsaCampaignsCreate extends Command {
|
|
|
24
24
|
options: ['MANUAL_CPT', 'MAX_CONVERSIONS'],
|
|
25
25
|
}),
|
|
26
26
|
'billing-event': Flags.string({ default: 'TAPS', description: 'Billing event', options: ['IMPRESSIONS', 'TAPS'] }),
|
|
27
|
-
budget: moneyFlag('Lifetime budget'),
|
|
28
|
-
country: Flags.string({ description: 'Country or region code, repeatable', multiple: true, required: true }),
|
|
27
|
+
'budget': moneyFlag('Lifetime budget'),
|
|
28
|
+
'country': Flags.string({ description: 'Country or region code, repeatable', multiple: true, required: true }),
|
|
29
29
|
'daily-budget': moneyFlag('Daily budget', { required: true }),
|
|
30
|
-
name: Flags.string({ description: 'Campaign name', required: true }),
|
|
31
|
-
org: Flags.string({ description: 'Campaign group ID (UUID) — see `adapty asa orgs list`', required: true }),
|
|
32
|
-
status: Flags.string({ description: 'Initial status', options: ['ENABLED', 'PAUSED'] }),
|
|
30
|
+
'name': Flags.string({ description: 'Campaign name', required: true }),
|
|
31
|
+
'org': Flags.string({ description: 'Campaign group ID (UUID) — see `adapty asa orgs list`', required: true }),
|
|
32
|
+
'status': Flags.string({ description: 'Initial status', options: ['ENABLED', 'PAUSED'] }),
|
|
33
33
|
'supply-source': Flags.string({
|
|
34
34
|
default: ['APPSTORE_SEARCH_RESULTS'],
|
|
35
35
|
description: 'Supply source, repeatable',
|
|
@@ -39,8 +39,9 @@ export default class AsaCampaignsCreate extends Command {
|
|
|
39
39
|
};
|
|
40
40
|
async run() {
|
|
41
41
|
const { flags } = await this.parse(AsaCampaignsCreate);
|
|
42
|
-
if (!isValidUuid(flags.org))
|
|
42
|
+
if (!isValidUuid(flags.org)) {
|
|
43
43
|
this.error('Invalid org ID format.', { exit: 2 });
|
|
44
|
+
}
|
|
44
45
|
let invoice;
|
|
45
46
|
try {
|
|
46
47
|
invoice = locInvoiceDetails(flags);
|
|
@@ -64,14 +65,15 @@ export default class AsaCampaignsCreate extends Command {
|
|
|
64
65
|
target_cpa: money(flags['target-cpa'], flags.currency),
|
|
65
66
|
};
|
|
66
67
|
await confirmMutation(this, { body, method: 'POST', path: '/campaigns/', summary: `Create campaign ${flags.name}` }, flags.yes);
|
|
67
|
-
const client = await createAsaClient(this
|
|
68
|
+
const client = await createAsaClient(this);
|
|
68
69
|
const { replayed, result } = await asaWrite(client, 'post', '/campaigns', {
|
|
69
70
|
body,
|
|
70
71
|
idempotencyKey: flags['idempotency-key'],
|
|
71
72
|
});
|
|
72
73
|
noteReplay(replayed, this.log.bind(this));
|
|
73
|
-
if (result.campaign && !replayed)
|
|
74
|
+
if (result.campaign && !replayed) {
|
|
74
75
|
this.log('Campaign created!');
|
|
76
|
+
}
|
|
75
77
|
printResponse(result, this.log.bind(this));
|
|
76
78
|
reportServingState(result.campaign, this.warn.bind(this));
|
|
77
79
|
return result;
|
|
@@ -11,9 +11,10 @@ export default class AsaCampaignsGet extends Command {
|
|
|
11
11
|
static examples = ['<%= config.bin %> asa campaigns get 550e8400-e29b-41d4-a716-446655440000'];
|
|
12
12
|
async run() {
|
|
13
13
|
const { args } = await this.parse(AsaCampaignsGet);
|
|
14
|
-
if (!isValidUuid(args.campaign_id))
|
|
14
|
+
if (!isValidUuid(args.campaign_id)) {
|
|
15
15
|
this.error('Invalid campaign ID format.', { exit: 2 });
|
|
16
|
-
|
|
16
|
+
}
|
|
17
|
+
const client = await createAsaClient(this);
|
|
17
18
|
const result = await client.get(`/campaigns/${args.campaign_id}`);
|
|
18
19
|
printResponse(result, this.log.bind(this));
|
|
19
20
|
return result;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import type { AsaCampaignDTO } from '../../../lib/asa-schemas.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { PaginatedResponse } from '../../../lib/flags.js';
|
|
4
4
|
export default class AsaCampaignsList extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static enableJsonFlag: boolean;
|
|
@@ -13,7 +13,7 @@ export default class AsaCampaignsList extends Command {
|
|
|
13
13
|
static flags = { ...asaPaginationFlags, ...orgScopeFlags, ...statusFilter(['ENABLED', 'PAUSED']) };
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags } = await this.parse(AsaCampaignsList);
|
|
16
|
-
const client = await createAsaClient(this
|
|
16
|
+
const client = await createAsaClient(this);
|
|
17
17
|
const result = await client.get('/campaigns', {
|
|
18
18
|
...paginationParams(flags),
|
|
19
19
|
...scopeParams(flags),
|
|
@@ -24,36 +24,45 @@ export default class AsaCampaignsUpdate extends Command {
|
|
|
24
24
|
description: 'Bidding strategy',
|
|
25
25
|
options: ['MANUAL_CPT', 'MAX_CONVERSIONS'],
|
|
26
26
|
}),
|
|
27
|
-
budget: moneyFlag('Lifetime budget'),
|
|
28
|
-
country: Flags.string({ description: 'Replace the country list, repeatable', multiple: true }),
|
|
27
|
+
'budget': moneyFlag('Lifetime budget'),
|
|
28
|
+
'country': Flags.string({ description: 'Replace the country list, repeatable', multiple: true }),
|
|
29
29
|
'daily-budget': moneyFlag('Daily budget'),
|
|
30
|
-
name: Flags.string({ description: 'Campaign name' }),
|
|
31
|
-
status: Flags.string({ description: 'Campaign status', options: ['ENABLED', 'PAUSED'] }),
|
|
30
|
+
'name': Flags.string({ description: 'Campaign name' }),
|
|
31
|
+
'status': Flags.string({ description: 'Campaign status', options: ['ENABLED', 'PAUSED'] }),
|
|
32
32
|
'target-cpa': moneyFlag('Target CPA'),
|
|
33
33
|
};
|
|
34
34
|
async run() {
|
|
35
35
|
const { args, flags } = await this.parse(AsaCampaignsUpdate);
|
|
36
|
-
if (!isValidUuid(args.campaign_id))
|
|
36
|
+
if (!isValidUuid(args.campaign_id)) {
|
|
37
37
|
this.error('Invalid campaign ID format.', { exit: 2 });
|
|
38
|
+
}
|
|
38
39
|
const body = {};
|
|
39
|
-
if (flags.name !== undefined)
|
|
40
|
+
if (flags.name !== undefined) {
|
|
40
41
|
body.name = flags.name;
|
|
41
|
-
|
|
42
|
+
}
|
|
43
|
+
if (flags.status !== undefined) {
|
|
42
44
|
body.status = flags.status;
|
|
43
|
-
|
|
45
|
+
}
|
|
46
|
+
if (flags.country !== undefined) {
|
|
44
47
|
body.countries_or_regions = flags.country;
|
|
45
|
-
|
|
48
|
+
}
|
|
49
|
+
if (flags['daily-budget'] !== undefined) {
|
|
46
50
|
body.daily_budget_amount = money(flags['daily-budget'], flags.currency);
|
|
47
|
-
|
|
51
|
+
}
|
|
52
|
+
if (flags.budget !== undefined) {
|
|
48
53
|
body.budget_amount = money(flags.budget, flags.currency);
|
|
49
|
-
|
|
54
|
+
}
|
|
55
|
+
if (flags['target-cpa'] !== undefined) {
|
|
50
56
|
body.target_cpa = money(flags['target-cpa'], flags.currency);
|
|
51
|
-
|
|
57
|
+
}
|
|
58
|
+
if (flags['bidding-strategy'] !== undefined) {
|
|
52
59
|
body.bidding_strategy = flags['bidding-strategy'];
|
|
60
|
+
}
|
|
53
61
|
try {
|
|
54
62
|
const details = locInvoiceDetails(flags);
|
|
55
|
-
if (details)
|
|
63
|
+
if (details) {
|
|
56
64
|
body.loc_invoice_details = details;
|
|
65
|
+
}
|
|
57
66
|
}
|
|
58
67
|
catch (error) {
|
|
59
68
|
this.error(error.message, { exit: 2 });
|
|
@@ -62,14 +71,15 @@ export default class AsaCampaignsUpdate extends Command {
|
|
|
62
71
|
this.error('Nothing to change. Pass at least one field, e.g. --status PAUSED, or the five --invoice-* flags for a line-of-credit organization.', { exit: 2 });
|
|
63
72
|
}
|
|
64
73
|
await confirmMutation(this, { body, method: 'PUT', path: `/campaigns/${args.campaign_id}/`, summary: 'Update campaign' }, flags.yes);
|
|
65
|
-
const client = await createAsaClient(this
|
|
74
|
+
const client = await createAsaClient(this);
|
|
66
75
|
const { replayed, result } = await asaWrite(client, 'put', `/campaigns/${args.campaign_id}`, {
|
|
67
76
|
body,
|
|
68
77
|
idempotencyKey: flags['idempotency-key'],
|
|
69
78
|
});
|
|
70
79
|
noteReplay(replayed, this.log.bind(this));
|
|
71
|
-
if (result.campaign && !replayed)
|
|
80
|
+
if (result.campaign && !replayed) {
|
|
72
81
|
this.log('Campaign updated!');
|
|
82
|
+
}
|
|
73
83
|
printResponse(result, this.log.bind(this));
|
|
74
84
|
reportServingState(result.campaign, this.warn.bind(this));
|
|
75
85
|
return result;
|
|
@@ -16,15 +16,15 @@ export default class AsaCompetitorsSummary extends Command {
|
|
|
16
16
|
const { flags } = await this.parse(AsaCompetitorsSummary);
|
|
17
17
|
const appIds = flags['app-ids']
|
|
18
18
|
.split(',')
|
|
19
|
-
.map(
|
|
19
|
+
.map(part => part.trim())
|
|
20
20
|
.filter(Boolean);
|
|
21
21
|
if (appIds.length === 0 || appIds.length > MAX_APP_IDS) {
|
|
22
22
|
this.error(`Pass 1 to ${MAX_APP_IDS} App Store IDs, got ${appIds.length}.`, { exit: 2 });
|
|
23
23
|
}
|
|
24
|
-
if (appIds.some(
|
|
24
|
+
if (appIds.some(id => !/^\d+$/.test(id))) {
|
|
25
25
|
this.error('App Store IDs are numbers, e.g. --app-ids 1668337467,6503873027.', { exit: 2 });
|
|
26
26
|
}
|
|
27
|
-
const client = await createAsaClient(this
|
|
27
|
+
const client = await createAsaClient(this);
|
|
28
28
|
const { result } = await asaWrite(client, 'post', '/competitors/summary', {
|
|
29
29
|
body: { app_ids: appIds.map(Number) },
|
|
30
30
|
});
|
|
@@ -37,7 +37,7 @@ export default class AsaCompetitorsSummary extends Command {
|
|
|
37
37
|
}, this.log.bind(this));
|
|
38
38
|
this.log('');
|
|
39
39
|
this.log('Top apps by performance:');
|
|
40
|
-
printList(total.topAppsByPerformance.map(
|
|
40
|
+
printList(total.topAppsByPerformance.map(app => ({
|
|
41
41
|
adam_id: app.adamId,
|
|
42
42
|
avg_sov: app.avgSov,
|
|
43
43
|
countries: app.countries,
|
|
@@ -46,7 +46,7 @@ export default class AsaCompetitorsSummary extends Command {
|
|
|
46
46
|
})), this.log.bind(this));
|
|
47
47
|
this.log('');
|
|
48
48
|
this.log('Most contested terms:');
|
|
49
|
-
printList(total.mostContestedTerms.map(
|
|
49
|
+
printList(total.mostContestedTerms.map(term => ({
|
|
50
50
|
competitor_count: term.competitorCount,
|
|
51
51
|
max_sov: term.maxSov,
|
|
52
52
|
term: term.term,
|
|
@@ -12,15 +12,17 @@ export default class AsaConnect extends Command {
|
|
|
12
12
|
};
|
|
13
13
|
async run() {
|
|
14
14
|
const { flags } = await this.parse(AsaConnect);
|
|
15
|
-
const client = await createAsaClient(this
|
|
15
|
+
const client = await createAsaClient(this);
|
|
16
16
|
const { auth_url: authUrl } = await client.get('/apple/oauth');
|
|
17
17
|
this.log(`If the browser doesn't open, visit: ${authUrl}\n`);
|
|
18
18
|
this.log('The link is valid for one hour. Sign in to the Adapty dashboard in that browser first — the last');
|
|
19
19
|
this.log('step is authorized by the dashboard session, not by this CLI.');
|
|
20
|
-
if (process.stdin.isTTY
|
|
20
|
+
if (process.stdin.isTTY) {
|
|
21
21
|
await open(authUrl).catch(() => false);
|
|
22
|
-
|
|
22
|
+
}
|
|
23
|
+
if (!flags.wait) {
|
|
23
24
|
return { auth_url: authUrl };
|
|
25
|
+
}
|
|
24
26
|
const deadline = Date.now() + flags.timeout * 1000;
|
|
25
27
|
let status;
|
|
26
28
|
while (Date.now() < deadline) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import type { AsaCreativeDTO } from '../../../lib/asa-schemas.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { PaginatedResponse } from '../../../lib/flags.js';
|
|
4
4
|
export default class AsaCreativesList extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static enableJsonFlag: boolean;
|
|
@@ -13,7 +13,7 @@ export default class AsaCreativesList extends Command {
|
|
|
13
13
|
static flags = { ...asaPaginationFlags, ...assetScopeFlags };
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags } = await this.parse(AsaCreativesList);
|
|
16
|
-
const client = await createAsaClient(this
|
|
16
|
+
const client = await createAsaClient(this);
|
|
17
17
|
const result = await client.get('/creatives', {
|
|
18
18
|
...paginationParams(flags),
|
|
19
19
|
...scopeParams(flags),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Command, Flags } from '@oclif/core';
|
|
2
1
|
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { Command, Flags } from '@oclif/core';
|
|
3
3
|
import { asaWrite, createAsaClient, noteReplay } from '../../../lib/asa-client.js';
|
|
4
4
|
import { currencyFlag, idempotencyFlags, MAX_BULK_ITEMS, money, moneyFlag, reportBulkOutcome } from '../../../lib/asa-flags.js';
|
|
5
5
|
import { confirmFlags, confirmMutation } from '../../../lib/confirm.js';
|
|
@@ -16,24 +16,26 @@ export default class AsaKeywordsAdd extends Command {
|
|
|
16
16
|
...confirmFlags,
|
|
17
17
|
...idempotencyFlags,
|
|
18
18
|
'ad-group': Flags.string({ description: 'Ad group ID (UUID) — the campaign is resolved from it', required: true }),
|
|
19
|
-
bid: moneyFlag('Bid per keyword'),
|
|
19
|
+
'bid': moneyFlag('Bid per keyword'),
|
|
20
20
|
'from-file': Flags.string({ description: 'File with one keyword per line, combined with any --text values' }),
|
|
21
21
|
'match-type': Flags.string({ default: 'BROAD', description: 'Match type', options: ['BROAD', 'EXACT'] }),
|
|
22
|
-
status: Flags.string({ default: 'ACTIVE', description: 'Keyword status', options: ['ACTIVE', 'PAUSED'] }),
|
|
23
|
-
text: Flags.string({ description: 'Keyword text, repeatable', multiple: true }),
|
|
22
|
+
'status': Flags.string({ default: 'ACTIVE', description: 'Keyword status', options: ['ACTIVE', 'PAUSED'] }),
|
|
23
|
+
'text': Flags.string({ description: 'Keyword text, repeatable', multiple: true }),
|
|
24
24
|
};
|
|
25
25
|
async run() {
|
|
26
26
|
const { flags } = await this.parse(AsaKeywordsAdd);
|
|
27
|
-
if (!isValidUuid(flags['ad-group']))
|
|
27
|
+
if (!isValidUuid(flags['ad-group'])) {
|
|
28
28
|
this.error('Invalid ad group ID format.', { exit: 2 });
|
|
29
|
+
}
|
|
29
30
|
const texts = [...(flags.text ?? []), ...(await this.readTexts(flags['from-file']))];
|
|
30
|
-
if (texts.length === 0)
|
|
31
|
+
if (texts.length === 0) {
|
|
31
32
|
this.error('Pass at least one --text or a --from-file with keywords.', { exit: 2 });
|
|
33
|
+
}
|
|
32
34
|
if (texts.length > MAX_BULK_ITEMS) {
|
|
33
35
|
this.error(`A single call takes at most ${MAX_BULK_ITEMS} keywords, got ${texts.length}.`, { exit: 2 });
|
|
34
36
|
}
|
|
35
37
|
const body = {
|
|
36
|
-
keywords: texts.map(
|
|
38
|
+
keywords: texts.map(text => ({
|
|
37
39
|
ad_group_id: flags['ad-group'],
|
|
38
40
|
bid_amount: money(flags.bid, flags.currency),
|
|
39
41
|
match_type: flags['match-type'],
|
|
@@ -42,7 +44,7 @@ export default class AsaKeywordsAdd extends Command {
|
|
|
42
44
|
})),
|
|
43
45
|
};
|
|
44
46
|
await confirmMutation(this, { body, method: 'POST', path: '/keywords/', summary: `Add ${texts.length} keyword(s)` }, flags.yes);
|
|
45
|
-
const client = await createAsaClient(this
|
|
47
|
+
const client = await createAsaClient(this);
|
|
46
48
|
const { replayed, result } = await asaWrite(client, 'post', '/keywords', {
|
|
47
49
|
body,
|
|
48
50
|
idempotencyKey: flags['idempotency-key'],
|
|
@@ -57,13 +59,14 @@ export default class AsaKeywordsAdd extends Command {
|
|
|
57
59
|
return result;
|
|
58
60
|
}
|
|
59
61
|
async readTexts(path) {
|
|
60
|
-
if (!path)
|
|
62
|
+
if (!path) {
|
|
61
63
|
return [];
|
|
64
|
+
}
|
|
62
65
|
try {
|
|
63
66
|
const raw = await readFile(path, 'utf8');
|
|
64
67
|
return raw
|
|
65
68
|
.split('\n')
|
|
66
|
-
.map(
|
|
69
|
+
.map(line => line.trim())
|
|
67
70
|
.filter(Boolean);
|
|
68
71
|
}
|
|
69
72
|
catch {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import type { AsaKeywordDTO } from '../../../lib/asa-schemas.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { PaginatedResponse } from '../../../lib/flags.js';
|
|
4
4
|
export default class AsaKeywordsList extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static enableJsonFlag: boolean;
|
|
@@ -13,7 +13,7 @@ export default class AsaKeywordsList extends Command {
|
|
|
13
13
|
static flags = { ...asaPaginationFlags, ...adGroupScopeFlags, ...statusFilter(['ACTIVE', 'PAUSED']) };
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags } = await this.parse(AsaKeywordsList);
|
|
16
|
-
const client = await createAsaClient(this
|
|
16
|
+
const client = await createAsaClient(this);
|
|
17
17
|
const result = await client.get('/keywords', {
|
|
18
18
|
...paginationParams(flags),
|
|
19
19
|
...scopeParams(flags),
|
|
@@ -17,37 +17,42 @@ export default class AsaKeywordsUpdate extends Command {
|
|
|
17
17
|
...currencyFlag,
|
|
18
18
|
...confirmFlags,
|
|
19
19
|
...idempotencyFlags,
|
|
20
|
-
bid: moneyFlag('Bid'),
|
|
20
|
+
'bid': moneyFlag('Bid'),
|
|
21
21
|
'match-type': Flags.string({ description: 'Match type', options: ['BROAD', 'EXACT'] }),
|
|
22
|
-
status: Flags.string({ description: 'Keyword status', options: ['ACTIVE', 'PAUSED'] }),
|
|
23
|
-
text: Flags.string({ description: 'Keyword text (only meaningful for a single keyword)' }),
|
|
22
|
+
'status': Flags.string({ description: 'Keyword status', options: ['ACTIVE', 'PAUSED'] }),
|
|
23
|
+
'text': Flags.string({ description: 'Keyword text (only meaningful for a single keyword)' }),
|
|
24
24
|
};
|
|
25
25
|
static strict = false;
|
|
26
26
|
async run() {
|
|
27
27
|
const { argv, flags } = await this.parse(AsaKeywordsUpdate);
|
|
28
28
|
const keywordIds = argv;
|
|
29
29
|
for (const id of keywordIds) {
|
|
30
|
-
if (!isValidUuid(id))
|
|
30
|
+
if (!isValidUuid(id)) {
|
|
31
31
|
this.error(`Invalid keyword ID format: ${id}`, { exit: 2 });
|
|
32
|
+
}
|
|
32
33
|
}
|
|
33
34
|
const change = {};
|
|
34
|
-
if (flags.bid !== undefined)
|
|
35
|
+
if (flags.bid !== undefined) {
|
|
35
36
|
change.bid_amount = money(flags.bid, flags.currency);
|
|
36
|
-
|
|
37
|
+
}
|
|
38
|
+
if (flags.status !== undefined) {
|
|
37
39
|
change.status = flags.status;
|
|
38
|
-
|
|
40
|
+
}
|
|
41
|
+
if (flags['match-type'] !== undefined) {
|
|
39
42
|
change.match_type = flags['match-type'];
|
|
40
|
-
|
|
43
|
+
}
|
|
44
|
+
if (flags.text !== undefined) {
|
|
41
45
|
change.text = flags.text;
|
|
46
|
+
}
|
|
42
47
|
if (Object.keys(change).length === 0) {
|
|
43
48
|
this.error('Nothing to change. Pass at least one field, e.g. --bid 2.00.', { exit: 2 });
|
|
44
49
|
}
|
|
45
50
|
if (flags.text !== undefined && keywordIds.length > 1) {
|
|
46
51
|
this.error('--text would give every keyword the same text. Update them one at a time.', { exit: 2 });
|
|
47
52
|
}
|
|
48
|
-
const body = { keywords: keywordIds.map(
|
|
53
|
+
const body = { keywords: keywordIds.map(id => ({ internal_id: id, ...change })) };
|
|
49
54
|
await confirmMutation(this, { body, method: 'PUT', path: '/keywords/', summary: `Update ${keywordIds.length} keyword(s)` }, flags.yes);
|
|
50
|
-
const client = await createAsaClient(this
|
|
55
|
+
const client = await createAsaClient(this);
|
|
51
56
|
const { replayed, result } = await asaWrite(client, 'put', '/keywords', {
|
|
52
57
|
body,
|
|
53
58
|
idempotencyKey: flags['idempotency-key'],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
import {
|
|
2
|
+
import type { AsaMetricsResponse } from '../../../lib/asa-schemas.js';
|
|
3
3
|
export default class AsaMetrics extends Command {
|
|
4
4
|
static description: string;
|
|
5
5
|
static enableJsonFlag: boolean;
|
|
@@ -20,5 +20,5 @@ export default class AsaMetrics extends Command {
|
|
|
20
20
|
page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
21
|
'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
22
|
};
|
|
23
|
-
run(): Promise<
|
|
23
|
+
run(): Promise<AsaMetricsResponse>;
|
|
24
24
|
}
|
|
@@ -10,10 +10,17 @@ One row per entity, already aggregated server-side and sorted by --order-by, so
|
|
|
10
10
|
call with --order-by and --page-size N — never sum pages yourself. Account-level totals are one call to
|
|
11
11
|
asa metrics overview instead. The date window is capped by the finest --group-by period: 28 days when
|
|
12
12
|
day is grouped, 90 with no period grouping, 180 by week, 365 by month and coarser — widen the window by
|
|
13
|
-
coarsening the grouping, not by splitting into more calls. Each page is also capped at
|
|
14
|
-
|
|
15
|
-
the grouping, narrow the window, or reduce page[size].
|
|
16
|
-
|
|
13
|
+
coarsening the grouping, not by splitting into more calls. Each page is also capped at a breakdown-row
|
|
14
|
+
count (entities × countries × periods); over it the call fails with 422 cli_response_too_large naming the
|
|
15
|
+
page[size] that fits — coarsen the grouping, narrow the window, or reduce page[size].
|
|
16
|
+
|
|
17
|
+
Money columns are in the campaign group currency, not USD, and spend and local_spend carry the same
|
|
18
|
+
figure; the currency itself comes from asa orgs list. Rate budgets and the breakdown-row cap are set per
|
|
19
|
+
company: read the current ones with asa whoami rather than assuming a default. meta.pagination.count is
|
|
20
|
+
the full entity count behind the filters, so take inventory from there instead of counting the rows on a
|
|
21
|
+
page. meta.max_valid_day says how many days the youngest cohort in the window has lived — any --by-days
|
|
22
|
+
window above it repeats the last real figure because that time has not passed yet, so treat those as
|
|
23
|
+
unreached rather than as a plateau.
|
|
17
24
|
|
|
18
25
|
--metric is required and every metric named is computed over the whole entity set, so ask for the
|
|
19
26
|
columns you actually read. subscribers and paid_subscribers (and arppu / arpas, which derive from them)
|
|
@@ -35,18 +42,18 @@ to make any call fast, since cost follows the number of entities aggregated, not
|
|
|
35
42
|
...metricsScopeFlags,
|
|
36
43
|
'date-from': Flags.string({ description: 'Start of the period (YYYY-MM-DD)', required: true }),
|
|
37
44
|
'date-to': Flags.string({ description: 'End of the period (YYYY-MM-DD)', required: true }),
|
|
38
|
-
entity: Flags.string({ description: 'What to report on', options: ASA_METRIC_ENTITIES, required: true }),
|
|
45
|
+
'entity': Flags.string({ description: 'What to report on', options: ASA_METRIC_ENTITIES, required: true }),
|
|
39
46
|
'group-by': Flags.string({
|
|
40
47
|
description: 'Break the rows down by a dimension, repeatable',
|
|
41
48
|
multiple: true,
|
|
42
49
|
options: ASA_GROUP_BY_DIMENSIONS,
|
|
43
50
|
}),
|
|
44
|
-
metric: Flags.string({
|
|
51
|
+
'metric': Flags.string({
|
|
45
52
|
description: 'Metric name (dashboard nomenclature, e.g. spend, taps, gross_roas), repeatable and required; every metric asked for is computed over the whole entity set, so list only what you read; a wrong name fails listing all valid ones',
|
|
46
53
|
multiple: true,
|
|
47
54
|
required: true,
|
|
48
55
|
}),
|
|
49
|
-
order: Flags.string({ default: 'desc', description: 'Sort direction', options: ['asc', 'desc'] }),
|
|
56
|
+
'order': Flags.string({ default: 'desc', description: 'Sort direction', options: ['asc', 'desc'] }),
|
|
50
57
|
'order-by': Flags.string({
|
|
51
58
|
description: 'Metric or field to sort by; cohort metrics rank via their gross_/proceeds_/net_ names',
|
|
52
59
|
}),
|
|
@@ -59,7 +66,7 @@ to make any call fast, since cost follows the number of entities aggregated, not
|
|
|
59
66
|
if (flags['by-days'] && flags['by-days'].length > MAX_BY_DAYS) {
|
|
60
67
|
this.error(`At most ${MAX_BY_DAYS} renewal windows per call, got ${flags['by-days'].length}.`, { exit: 2 });
|
|
61
68
|
}
|
|
62
|
-
const client = await createAsaClient(this
|
|
69
|
+
const client = await createAsaClient(this);
|
|
63
70
|
const { result } = await asaWrite(client, 'post', '/metrics', {
|
|
64
71
|
body: {
|
|
65
72
|
date_from: flags['date-from'],
|
|
@@ -75,7 +82,14 @@ to make any call fast, since cost follows the number of entities aggregated, not
|
|
|
75
82
|
},
|
|
76
83
|
params: paginationParams(flags),
|
|
77
84
|
});
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- FIXME if you see this
|
|
78
86
|
printList(result.data, this.log.bind(this), result.meta?.pagination);
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- FIXME if you see this
|
|
88
|
+
const horizon = result.meta?.max_valid_day;
|
|
89
|
+
if (horizon !== undefined && flags['by-days']?.some(day => day > horizon)) {
|
|
90
|
+
this.log(`\nCohort windows past day ${horizon} have not been reached by this date range yet; they repeat the last `
|
|
91
|
+
+ 'figure actually observed rather than projecting it.');
|
|
92
|
+
}
|
|
79
93
|
return result;
|
|
80
94
|
}
|
|
81
95
|
}
|
|
@@ -18,8 +18,8 @@ the 5-per-minute metrics budget with asa metrics.`;
|
|
|
18
18
|
...byDaysFlag,
|
|
19
19
|
'date-from': Flags.string({ description: 'Start of the period (YYYY-MM-DD)', required: true }),
|
|
20
20
|
'date-to': Flags.string({ description: 'End of the period (YYYY-MM-DD)', required: true }),
|
|
21
|
-
entity: Flags.string({ description: 'What to report on', options: ASA_METRIC_ENTITIES, required: true }),
|
|
22
|
-
metric: Flags.string({
|
|
21
|
+
'entity': Flags.string({ description: 'What to report on', options: ASA_METRIC_ENTITIES, required: true }),
|
|
22
|
+
'metric': Flags.string({
|
|
23
23
|
description: 'Metric name, repeatable; cohort roots only here (revenue, roas, arpu), not their gross_/proceeds_/net_ variants; omit for every metric',
|
|
24
24
|
multiple: true,
|
|
25
25
|
}),
|
|
@@ -34,7 +34,7 @@ the 5-per-minute metrics budget with asa metrics.`;
|
|
|
34
34
|
if (flags['by-days'] && flags['by-days'].length > MAX_BY_DAYS) {
|
|
35
35
|
this.error(`At most ${MAX_BY_DAYS} renewal windows per call, got ${flags['by-days'].length}.`, { exit: 2 });
|
|
36
36
|
}
|
|
37
|
-
const client = await createAsaClient(this
|
|
37
|
+
const client = await createAsaClient(this);
|
|
38
38
|
const { result } = await asaWrite(client, 'post', '/metrics/overview', {
|
|
39
39
|
body: {
|
|
40
40
|
date_from: flags['date-from'],
|
|
@@ -19,25 +19,28 @@ export default class AsaNegativeKeywordsAdd extends Command {
|
|
|
19
19
|
dependsOn: ['campaign'],
|
|
20
20
|
description: 'Apply to every ad group of the campaign instead of the campaign itself',
|
|
21
21
|
}),
|
|
22
|
-
campaign: Flags.string({ description: 'Campaign ID (UUID)', exclusive: ['ad-group'] }),
|
|
22
|
+
'campaign': Flags.string({ description: 'Campaign ID (UUID)', exclusive: ['ad-group'] }),
|
|
23
23
|
'match-type': Flags.string({ default: 'EXACT', description: 'Match type', options: ['BROAD', 'EXACT'] }),
|
|
24
|
-
status: Flags.string({ default: 'ACTIVE', description: 'Keyword status', options: ['ACTIVE', 'PAUSED'] }),
|
|
25
|
-
text: Flags.string({ description: 'Keyword text, repeatable', multiple: true, required: true }),
|
|
24
|
+
'status': Flags.string({ default: 'ACTIVE', description: 'Keyword status', options: ['ACTIVE', 'PAUSED'] }),
|
|
25
|
+
'text': Flags.string({ description: 'Keyword text, repeatable', multiple: true, required: true }),
|
|
26
26
|
};
|
|
27
27
|
async run() {
|
|
28
28
|
const { flags } = await this.parse(AsaNegativeKeywordsAdd);
|
|
29
29
|
const target = flags['ad-group'] ?? flags.campaign;
|
|
30
|
-
if (!target)
|
|
30
|
+
if (!target) {
|
|
31
31
|
this.error('Pass either --ad-group or --campaign.', { exit: 2 });
|
|
32
|
-
|
|
32
|
+
}
|
|
33
|
+
if (!isValidUuid(target)) {
|
|
33
34
|
this.error('Invalid ID format.', { exit: 2 });
|
|
35
|
+
}
|
|
34
36
|
if (flags.text.length > MAX_BULK_ITEMS) {
|
|
35
37
|
this.error(`A single call takes at most ${MAX_BULK_ITEMS} keywords, got ${flags.text.length}.`, { exit: 2 });
|
|
36
38
|
}
|
|
39
|
+
// eslint-disable-next-line no-nested-ternary -- FIXME if you see this
|
|
37
40
|
const scope = flags['ad-group'] ? 'AD_GROUP' : flags['all-ad-groups'] ? 'ALL_CAMPAIGN_AD_GROUPS' : 'CAMPAIGN';
|
|
38
41
|
const parent = flags['ad-group'] ? { ad_group_id: flags['ad-group'] } : { campaign_id: flags.campaign };
|
|
39
42
|
const body = {
|
|
40
|
-
negative_keywords: flags.text.map(
|
|
43
|
+
negative_keywords: flags.text.map(text => ({
|
|
41
44
|
...parent,
|
|
42
45
|
match_type: flags['match-type'],
|
|
43
46
|
status: flags.status,
|
|
@@ -53,7 +56,7 @@ export default class AsaNegativeKeywordsAdd extends Command {
|
|
|
53
56
|
? `Add ${flags.text.length} negative keyword(s) to every ad group of the campaign`
|
|
54
57
|
: `Add ${flags.text.length} negative keyword(s) in ${scope} scope`,
|
|
55
58
|
}, flags.yes);
|
|
56
|
-
const client = await createAsaClient(this
|
|
59
|
+
const client = await createAsaClient(this);
|
|
57
60
|
const { replayed, result } = await asaWrite(client, 'post', '/negative-keywords', {
|
|
58
61
|
body,
|
|
59
62
|
idempotencyKey: flags['idempotency-key'],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import type { AsaNegativeKeywordDTO } from '../../../lib/asa-schemas.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { PaginatedResponse } from '../../../lib/flags.js';
|
|
4
4
|
export default class AsaNegativeKeywordsList extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static enableJsonFlag: boolean;
|
|
@@ -17,7 +17,7 @@ export default class AsaNegativeKeywordsList extends Command {
|
|
|
17
17
|
};
|
|
18
18
|
async run() {
|
|
19
19
|
const { flags } = await this.parse(AsaNegativeKeywordsList);
|
|
20
|
-
const client = await createAsaClient(this
|
|
20
|
+
const client = await createAsaClient(this);
|
|
21
21
|
const result = await client.get('/negative-keywords', {
|
|
22
22
|
...paginationParams(flags),
|
|
23
23
|
...scopeParams(flags),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import type { AsaCampaignGroupDTO } from '../../../lib/asa-schemas.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { PaginatedResponse } from '../../../lib/flags.js';
|
|
4
4
|
export default class AsaOrgsList extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static enableJsonFlag: boolean;
|
|
@@ -10,7 +10,7 @@ export default class AsaOrgsList extends Command {
|
|
|
10
10
|
static flags = { ...asaPaginationFlags };
|
|
11
11
|
async run() {
|
|
12
12
|
const { flags } = await this.parse(AsaOrgsList);
|
|
13
|
-
const client = await createAsaClient(this
|
|
13
|
+
const client = await createAsaClient(this);
|
|
14
14
|
const result = await client.get('/campaign-groups', paginationParams(flags));
|
|
15
15
|
printList(result.data, this.log.bind(this), result.meta.pagination);
|
|
16
16
|
return result;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import type { AsaProductPageDTO } from '../../../lib/asa-schemas.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { PaginatedResponse } from '../../../lib/flags.js';
|
|
4
4
|
export default class AsaProductPagesList extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static enableJsonFlag: boolean;
|
|
@@ -13,7 +13,7 @@ export default class AsaProductPagesList extends Command {
|
|
|
13
13
|
static flags = { ...asaPaginationFlags, ...assetScopeFlags };
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags } = await this.parse(AsaProductPagesList);
|
|
16
|
-
const client = await createAsaClient(this
|
|
16
|
+
const client = await createAsaClient(this);
|
|
17
17
|
const result = await client.get('/product-pages', {
|
|
18
18
|
...paginationParams(flags),
|
|
19
19
|
...scopeParams(flags),
|
|
@@ -16,7 +16,7 @@ export default class AsaProductPagesSync extends Command {
|
|
|
16
16
|
const { flags } = await this.parse(AsaProductPagesSync);
|
|
17
17
|
const body = { ...(flags['adam-id'] === undefined ? {} : { adam_id: flags['adam-id'] }) };
|
|
18
18
|
await confirmMutation(this, { body, method: 'POST', path: '/product-pages/sync/', summary: 'Queue a product page refresh from Apple' }, flags.yes);
|
|
19
|
-
const client = await createAsaClient(this
|
|
19
|
+
const client = await createAsaClient(this);
|
|
20
20
|
const { result } = await asaWrite(client, 'post', '/product-pages/sync', {
|
|
21
21
|
body,
|
|
22
22
|
idempotencyKey: flags['idempotency-key'],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import type { AsaSearchTermDTO } from '../../../lib/asa-schemas.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { PaginatedResponse } from '../../../lib/flags.js';
|
|
4
4
|
export default class AsaSearchTermsList extends Command {
|
|
5
5
|
static description: string;
|
|
6
6
|
static enableJsonFlag: boolean;
|
|
@@ -13,7 +13,7 @@ export default class AsaSearchTermsList extends Command {
|
|
|
13
13
|
static flags = { ...asaPaginationFlags, ...periodFlags, ...adGroupScopeFlags };
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags } = await this.parse(AsaSearchTermsList);
|
|
16
|
-
const client = await createAsaClient(this
|
|
16
|
+
const client = await createAsaClient(this);
|
|
17
17
|
const result = await client.get('/search-terms', {
|
|
18
18
|
...paginationParams(flags),
|
|
19
19
|
...periodParams(flags),
|