adapty 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +1 -1
  2. package/bin/dev.js +2 -2
  3. package/bin/run.js +2 -2
  4. package/dist/commands/access-levels/create.js +1 -1
  5. package/dist/commands/access-levels/list.d.ts +1 -1
  6. package/dist/commands/apps/create.js +9 -6
  7. package/dist/commands/apps/list.d.ts +1 -1
  8. package/dist/commands/apps/update.js +7 -4
  9. package/dist/commands/asa/ad-groups/create.js +9 -7
  10. package/dist/commands/asa/ad-groups/get.js +3 -2
  11. package/dist/commands/asa/ad-groups/list.d.ts +1 -1
  12. package/dist/commands/asa/ad-groups/list.js +1 -1
  13. package/dist/commands/asa/ad-groups/update.js +22 -12
  14. package/dist/commands/asa/ads/create.js +7 -5
  15. package/dist/commands/asa/ads/get.js +3 -2
  16. package/dist/commands/asa/ads/list.d.ts +1 -1
  17. package/dist/commands/asa/ads/list.js +1 -1
  18. package/dist/commands/asa/ads/update.js +9 -5
  19. package/dist/commands/asa/apps/list.d.ts +1 -1
  20. package/dist/commands/asa/apps/list.js +1 -1
  21. package/dist/commands/asa/automations/create.js +9 -6
  22. package/dist/commands/asa/automations/get.js +3 -2
  23. package/dist/commands/asa/automations/list.d.ts +1 -1
  24. package/dist/commands/asa/automations/list.js +1 -1
  25. package/dist/commands/asa/automations/run.js +5 -3
  26. package/dist/commands/asa/automations/runs.d.ts +1 -1
  27. package/dist/commands/asa/automations/runs.js +4 -4
  28. package/dist/commands/asa/automations/update.js +17 -9
  29. package/dist/commands/asa/campaigns/bulk-create.js +31 -18
  30. package/dist/commands/asa/campaigns/bulk-list.js +7 -5
  31. package/dist/commands/asa/campaigns/bulk-status.js +3 -2
  32. package/dist/commands/asa/campaigns/create.js +10 -8
  33. package/dist/commands/asa/campaigns/get.js +3 -2
  34. package/dist/commands/asa/campaigns/list.d.ts +1 -1
  35. package/dist/commands/asa/campaigns/list.js +1 -1
  36. package/dist/commands/asa/campaigns/update.js +25 -15
  37. package/dist/commands/asa/competitors/summary.js +5 -5
  38. package/dist/commands/asa/connect.js +5 -3
  39. package/dist/commands/asa/creatives/list.d.ts +1 -1
  40. package/dist/commands/asa/creatives/list.js +1 -1
  41. package/dist/commands/asa/keywords/add.js +13 -10
  42. package/dist/commands/asa/keywords/list.d.ts +1 -1
  43. package/dist/commands/asa/keywords/list.js +1 -1
  44. package/dist/commands/asa/keywords/update.js +15 -10
  45. package/dist/commands/asa/metrics/index.d.ts +2 -2
  46. package/dist/commands/asa/metrics/index.js +22 -8
  47. package/dist/commands/asa/metrics/overview.js +3 -3
  48. package/dist/commands/asa/negative-keywords/add.js +10 -7
  49. package/dist/commands/asa/negative-keywords/list.d.ts +1 -1
  50. package/dist/commands/asa/negative-keywords/list.js +1 -1
  51. package/dist/commands/asa/orgs/list.d.ts +1 -1
  52. package/dist/commands/asa/orgs/list.js +1 -1
  53. package/dist/commands/asa/product-pages/list.d.ts +1 -1
  54. package/dist/commands/asa/product-pages/list.js +1 -1
  55. package/dist/commands/asa/product-pages/sync.js +1 -1
  56. package/dist/commands/asa/search-terms/list.d.ts +1 -1
  57. package/dist/commands/asa/search-terms/list.js +1 -1
  58. package/dist/commands/asa/whoami.js +7 -2
  59. package/dist/commands/auth/login.js +3 -1
  60. package/dist/commands/flows/config/get.js +2 -2
  61. package/dist/commands/flows/config/preview.d.ts +2 -2
  62. package/dist/commands/flows/config/preview.js +6 -4
  63. package/dist/commands/flows/config/update.js +5 -3
  64. package/dist/commands/flows/config/validate.js +5 -3
  65. package/dist/commands/flows/list.d.ts +1 -1
  66. package/dist/commands/flows/media/upload.js +1 -1
  67. package/dist/commands/flows/publish.js +5 -5
  68. package/dist/commands/paywalls/create.js +1 -1
  69. package/dist/commands/paywalls/list.d.ts +1 -1
  70. package/dist/commands/paywalls/placements.d.ts +2 -2
  71. package/dist/commands/paywalls/update.js +1 -1
  72. package/dist/commands/placements/create.js +17 -12
  73. package/dist/commands/placements/list.d.ts +1 -1
  74. package/dist/commands/placements/update.js +20 -15
  75. package/dist/commands/products/create.js +20 -13
  76. package/dist/commands/products/list.d.ts +1 -1
  77. package/dist/commands/products/update.js +1 -1
  78. package/dist/commands/segments/list.d.ts +1 -1
  79. package/dist/lib/api-client.d.ts +10 -6
  80. package/dist/lib/api-client.js +56 -35
  81. package/dist/lib/api-schemas.d.ts +56 -56
  82. package/dist/lib/app-url.js +2 -1
  83. package/dist/lib/asa-client.d.ts +13 -8
  84. package/dist/lib/asa-client.js +9 -4
  85. package/dist/lib/asa-flags.d.ts +19 -19
  86. package/dist/lib/asa-flags.js +38 -25
  87. package/dist/lib/asa-keyword-action.d.ts +10 -10
  88. package/dist/lib/asa-keyword-action.js +40 -25
  89. package/dist/lib/asa-schemas.d.ts +100 -80
  90. package/dist/lib/auth.js +2 -1
  91. package/dist/lib/client-from-config.d.ts +1 -1
  92. package/dist/lib/client-from-config.js +2 -1
  93. package/dist/lib/config.d.ts +2 -2
  94. package/dist/lib/confirm.d.ts +4 -4
  95. package/dist/lib/confirm.js +12 -7
  96. package/dist/lib/errors.d.ts +18 -18
  97. package/dist/lib/errors.js +12 -9
  98. package/dist/lib/flags.d.ts +3 -3
  99. package/dist/lib/flags.js +2 -1
  100. package/dist/lib/flow-help.js +11 -6
  101. package/dist/lib/output.js +23 -12
  102. package/dist/lib/preview.d.ts +5 -5
  103. package/dist/lib/preview.js +2 -1
  104. package/oclif.manifest.json +131 -131
  105. package/package.json +10 -8
@@ -3,10 +3,12 @@ function formatLabel(snakeKey) {
3
3
  return snakeKey
4
4
  .split('_')
5
5
  .map((w) => {
6
- if (w === 'ids')
6
+ if (w === 'ids') {
7
7
  return 'IDs';
8
- if (UPPER_WORDS.has(w))
8
+ }
9
+ if (UPPER_WORDS.has(w)) {
9
10
  return w.toUpperCase();
11
+ }
10
12
  return w.charAt(0).toUpperCase() + w.slice(1);
11
13
  })
12
14
  .join(' ');
@@ -18,19 +20,22 @@ function renderArrayItems(items, indent) {
18
20
  const childIndent = indent + ' ';
19
21
  const lines = [];
20
22
  for (const item of items) {
21
- if (item === undefined || item === null)
23
+ if (item === undefined || item === null) {
22
24
  continue;
25
+ }
23
26
  if (Array.isArray(item)) {
24
27
  lines.push(...renderArrayItems(item, childIndent));
25
28
  }
26
29
  else if (isScalar(item)) {
30
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- FIXME if you see this
27
31
  lines.push(`${indent}- ${String(item)}`);
28
32
  }
29
33
  else {
30
- const rendered = renderObject(item, childIndent);
31
- if (rendered.length === 0)
34
+ const [head, ...rest] = renderObject(item, childIndent);
35
+ if (head === undefined) {
32
36
  continue;
33
- lines.push(`${indent}- ${rendered[0].slice(childIndent.length)}`, ...rendered.slice(1));
37
+ }
38
+ lines.push(`${indent}- ${head.slice(childIndent.length)}`, ...rest);
34
39
  }
35
40
  }
36
41
  return lines;
@@ -38,13 +43,15 @@ function renderArrayItems(items, indent) {
38
43
  function renderObject(data, indent) {
39
44
  const lines = [];
40
45
  for (const [key, value] of Object.entries(data)) {
41
- if (value === undefined || value === null)
46
+ if (value === undefined || value === null) {
42
47
  continue;
48
+ }
43
49
  const label = `${indent}${formatLabel(key)}:`;
44
50
  if (Array.isArray(value)) {
45
- if (value.length === 0)
51
+ if (value.length === 0) {
46
52
  continue;
47
- if (value.every((v) => isScalar(v))) {
53
+ }
54
+ if (value.every(v => isScalar(v))) {
48
55
  lines.push(`${label} ${value.map(String).join(', ')}`);
49
56
  }
50
57
  else {
@@ -52,25 +59,29 @@ function renderObject(data, indent) {
52
59
  }
53
60
  }
54
61
  else if (isScalar(value)) {
62
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- FIXME if you see this
55
63
  lines.push(`${label} ${String(value)}`);
56
64
  }
57
65
  else {
58
66
  const nested = renderObject(value, indent + ' ');
59
- if (nested.length > 0)
67
+ if (nested.length > 0) {
60
68
  lines.push(label, ...nested);
69
+ }
61
70
  }
62
71
  }
63
72
  return lines;
64
73
  }
65
74
  export function printResponse(data, log) {
66
- for (const line of renderObject(data, ''))
75
+ for (const line of renderObject(data, '')) {
67
76
  log(line);
77
+ }
68
78
  }
69
79
  export function printList(items, log, pagination) {
70
80
  for (const [i, item] of items.entries()) {
71
81
  printResponse(item, log);
72
- if (i < items.length - 1)
82
+ if (i < items.length - 1) {
73
83
  log('---');
84
+ }
74
85
  }
75
86
  if (pagination) {
76
87
  log('');
@@ -5,10 +5,10 @@ export declare const DEFAULT_DEVICE_ID = "iphone-14";
5
5
  export declare const ORIENTATIONS: readonly ["landscape", "portrait"];
6
6
  export declare const DEFAULT_ORIENTATION = "portrait";
7
7
  /** Payload the render page expects. Wire format shared with the UI, hence camelCase. */
8
- export interface PreviewPayload {
8
+ export type PreviewPayload = {
9
9
  flow: Record<string, unknown>;
10
10
  remoteConfigs: unknown[];
11
- }
11
+ };
12
12
  /**
13
13
  * Accepts either a dashboard-api envelope (`{config, remote_configs, ...}`) or a bare
14
14
  * builder config, and returns the shape the render page injects.
@@ -18,10 +18,10 @@ export interface PreviewPayload {
18
18
  * rejected there instead — better to say so here, against the file the user named.
19
19
  */
20
20
  export declare function normalizePreviewConfig(raw: unknown): PreviewPayload;
21
- export interface RenderTarget {
21
+ export type RenderTarget = {
22
22
  device: string;
23
23
  orientation: string;
24
24
  /** Omitted lets the render page fall back to the flow's first screen. */
25
- screen?: string;
26
- }
25
+ screen?: string | undefined;
26
+ };
27
27
  export declare function buildRenderUrl(target: RenderTarget, payload: PreviewPayload): string;
@@ -39,8 +39,9 @@ function encodeConfigFragment(payload) {
39
39
  }
40
40
  export function buildRenderUrl(target, payload) {
41
41
  const url = appUrl(PREVIEW_PATH);
42
- if (target.screen)
42
+ if (target.screen) {
43
43
  url.searchParams.set('screen', target.screen);
44
+ }
44
45
  url.searchParams.set('device', target.device);
45
46
  url.searchParams.set('orientation', target.orientation);
46
47
  url.hash = `config=${encodeConfigFragment(payload)}`;
@@ -425,36 +425,59 @@
425
425
  "update.js"
426
426
  ]
427
427
  },
428
- "auth:login": {
428
+ "asa:connect": {
429
429
  "aliases": [],
430
430
  "args": {},
431
- "description": "Authenticate with Adapty via browser",
431
+ "description": "Connect an Apple Search Ads account to this company",
432
432
  "examples": [
433
- "<%= config.bin %> auth login"
433
+ "<%= config.bin %> asa connect",
434
+ "<%= config.bin %> asa connect --no-wait"
434
435
  ],
435
- "flags": {},
436
+ "flags": {
437
+ "json": {
438
+ "description": "Format output as json.",
439
+ "helpGroup": "GLOBAL",
440
+ "name": "json",
441
+ "allowNo": false,
442
+ "type": "boolean"
443
+ },
444
+ "timeout": {
445
+ "description": "Seconds to wait for the browser step",
446
+ "name": "timeout",
447
+ "default": 300,
448
+ "hasDynamicHelp": false,
449
+ "multiple": false,
450
+ "type": "option"
451
+ },
452
+ "wait": {
453
+ "description": "Wait until Apple Ads reports as connected",
454
+ "name": "wait",
455
+ "allowNo": true,
456
+ "type": "boolean"
457
+ }
458
+ },
436
459
  "hasDynamicHelp": false,
437
460
  "hiddenAliases": [],
438
- "id": "auth:login",
461
+ "id": "asa:connect",
439
462
  "pluginAlias": "adapty",
440
463
  "pluginName": "adapty",
441
464
  "pluginType": "core",
442
465
  "strict": true,
443
- "enableJsonFlag": false,
466
+ "enableJsonFlag": true,
444
467
  "isESM": true,
445
468
  "relativePath": [
446
469
  "dist",
447
470
  "commands",
448
- "auth",
449
- "login.js"
471
+ "asa",
472
+ "connect.js"
450
473
  ]
451
474
  },
452
- "auth:logout": {
475
+ "asa:whoami": {
453
476
  "aliases": [],
454
477
  "args": {},
455
- "description": "Remove stored authentication token",
478
+ "description": "Show which company the token unlocks, whether Apple Ads is connected, and the request budgets it gets\n\nLimits are raised per company, so read them here rather than assuming the defaults: metrics_limit_per_minute\nand metrics_burst_limit govern asa metrics, keywords_read_limit_per_minute the keyword lists,\nmetrics_inflight_limit how many analytics calls may overlap, and max_breakdown_rows_per_page the size a\ngrouped page may project to before it is refused.",
456
479
  "examples": [
457
- "<%= config.bin %> auth logout"
480
+ "<%= config.bin %> asa whoami"
458
481
  ],
459
482
  "flags": {
460
483
  "json": {
@@ -467,7 +490,7 @@
467
490
  },
468
491
  "hasDynamicHelp": false,
469
492
  "hiddenAliases": [],
470
- "id": "auth:logout",
493
+ "id": "asa:whoami",
471
494
  "pluginAlias": "adapty",
472
495
  "pluginName": "adapty",
473
496
  "pluginType": "core",
@@ -477,48 +500,40 @@
477
500
  "relativePath": [
478
501
  "dist",
479
502
  "commands",
480
- "auth",
481
- "logout.js"
503
+ "asa",
504
+ "whoami.js"
482
505
  ]
483
506
  },
484
- "auth:revoke": {
507
+ "auth:login": {
485
508
  "aliases": [],
486
509
  "args": {},
487
- "description": "Revoke the current authentication token",
510
+ "description": "Authenticate with Adapty via browser",
488
511
  "examples": [
489
- "<%= config.bin %> auth revoke"
512
+ "<%= config.bin %> auth login"
490
513
  ],
491
- "flags": {
492
- "json": {
493
- "description": "Format output as json.",
494
- "helpGroup": "GLOBAL",
495
- "name": "json",
496
- "allowNo": false,
497
- "type": "boolean"
498
- }
499
- },
514
+ "flags": {},
500
515
  "hasDynamicHelp": false,
501
516
  "hiddenAliases": [],
502
- "id": "auth:revoke",
517
+ "id": "auth:login",
503
518
  "pluginAlias": "adapty",
504
519
  "pluginName": "adapty",
505
520
  "pluginType": "core",
506
521
  "strict": true,
507
- "enableJsonFlag": true,
522
+ "enableJsonFlag": false,
508
523
  "isESM": true,
509
524
  "relativePath": [
510
525
  "dist",
511
526
  "commands",
512
527
  "auth",
513
- "revoke.js"
528
+ "login.js"
514
529
  ]
515
530
  },
516
- "auth:status": {
531
+ "auth:logout": {
517
532
  "aliases": [],
518
533
  "args": {},
519
- "description": "Show current authentication state (local only)",
534
+ "description": "Remove stored authentication token",
520
535
  "examples": [
521
- "<%= config.bin %> auth status"
536
+ "<%= config.bin %> auth logout"
522
537
  ],
523
538
  "flags": {
524
539
  "json": {
@@ -531,7 +546,7 @@
531
546
  },
532
547
  "hasDynamicHelp": false,
533
548
  "hiddenAliases": [],
534
- "id": "auth:status",
549
+ "id": "auth:logout",
535
550
  "pluginAlias": "adapty",
536
551
  "pluginName": "adapty",
537
552
  "pluginType": "core",
@@ -542,15 +557,15 @@
542
557
  "dist",
543
558
  "commands",
544
559
  "auth",
545
- "status.js"
560
+ "logout.js"
546
561
  ]
547
562
  },
548
- "auth:whoami": {
563
+ "auth:revoke": {
549
564
  "aliases": [],
550
565
  "args": {},
551
- "description": "Show current user info from server (verifies token)",
566
+ "description": "Revoke the current authentication token",
552
567
  "examples": [
553
- "<%= config.bin %> auth whoami"
568
+ "<%= config.bin %> auth revoke"
554
569
  ],
555
570
  "flags": {
556
571
  "json": {
@@ -563,7 +578,7 @@
563
578
  },
564
579
  "hasDynamicHelp": false,
565
580
  "hiddenAliases": [],
566
- "id": "auth:whoami",
581
+ "id": "auth:revoke",
567
582
  "pluginAlias": "adapty",
568
583
  "pluginName": "adapty",
569
584
  "pluginType": "core",
@@ -574,16 +589,15 @@
574
589
  "dist",
575
590
  "commands",
576
591
  "auth",
577
- "whoami.js"
592
+ "revoke.js"
578
593
  ]
579
594
  },
580
- "asa:connect": {
595
+ "auth:status": {
581
596
  "aliases": [],
582
597
  "args": {},
583
- "description": "Connect an Apple Search Ads account to this company",
598
+ "description": "Show current authentication state (local only)",
584
599
  "examples": [
585
- "<%= config.bin %> asa connect",
586
- "<%= config.bin %> asa connect --no-wait"
600
+ "<%= config.bin %> auth status"
587
601
  ],
588
602
  "flags": {
589
603
  "json": {
@@ -592,25 +606,11 @@
592
606
  "name": "json",
593
607
  "allowNo": false,
594
608
  "type": "boolean"
595
- },
596
- "timeout": {
597
- "description": "Seconds to wait for the browser step",
598
- "name": "timeout",
599
- "default": 300,
600
- "hasDynamicHelp": false,
601
- "multiple": false,
602
- "type": "option"
603
- },
604
- "wait": {
605
- "description": "Wait until Apple Ads reports as connected",
606
- "name": "wait",
607
- "allowNo": true,
608
- "type": "boolean"
609
609
  }
610
610
  },
611
611
  "hasDynamicHelp": false,
612
612
  "hiddenAliases": [],
613
- "id": "asa:connect",
613
+ "id": "auth:status",
614
614
  "pluginAlias": "adapty",
615
615
  "pluginName": "adapty",
616
616
  "pluginType": "core",
@@ -620,16 +620,16 @@
620
620
  "relativePath": [
621
621
  "dist",
622
622
  "commands",
623
- "asa",
624
- "connect.js"
623
+ "auth",
624
+ "status.js"
625
625
  ]
626
626
  },
627
- "asa:whoami": {
627
+ "auth:whoami": {
628
628
  "aliases": [],
629
629
  "args": {},
630
- "description": "Show which company the token unlocks and whether Apple Ads is connected",
630
+ "description": "Show current user info from server (verifies token)",
631
631
  "examples": [
632
- "<%= config.bin %> asa whoami"
632
+ "<%= config.bin %> auth whoami"
633
633
  ],
634
634
  "flags": {
635
635
  "json": {
@@ -642,7 +642,7 @@
642
642
  },
643
643
  "hasDynamicHelp": false,
644
644
  "hiddenAliases": [],
645
- "id": "asa:whoami",
645
+ "id": "auth:whoami",
646
646
  "pluginAlias": "adapty",
647
647
  "pluginName": "adapty",
648
648
  "pluginType": "core",
@@ -652,7 +652,7 @@
652
652
  "relativePath": [
653
653
  "dist",
654
654
  "commands",
655
- "asa",
655
+ "auth",
656
656
  "whoami.js"
657
657
  ]
658
658
  },
@@ -3788,70 +3788,6 @@
3788
3788
  "summary.js"
3789
3789
  ]
3790
3790
  },
3791
- "asa:creatives:list": {
3792
- "aliases": [],
3793
- "args": {},
3794
- "description": "List creatives; creative_id is what `asa ads create` needs",
3795
- "examples": [
3796
- "<%= config.bin %> asa creatives list",
3797
- "<%= config.bin %> asa creatives list --app APP_UUID"
3798
- ],
3799
- "flags": {
3800
- "json": {
3801
- "description": "Format output as json.",
3802
- "helpGroup": "GLOBAL",
3803
- "name": "json",
3804
- "allowNo": false,
3805
- "type": "boolean"
3806
- },
3807
- "page": {
3808
- "description": "Page number",
3809
- "name": "page",
3810
- "default": 1,
3811
- "hasDynamicHelp": false,
3812
- "multiple": false,
3813
- "type": "option"
3814
- },
3815
- "page-size": {
3816
- "description": "Items per page (max 1000); prefer one big page over a pagination loop",
3817
- "name": "page-size",
3818
- "default": 100,
3819
- "hasDynamicHelp": false,
3820
- "multiple": false,
3821
- "type": "option"
3822
- },
3823
- "app": {
3824
- "description": "Keep only rows in this app; repeatable",
3825
- "name": "app",
3826
- "hasDynamicHelp": false,
3827
- "multiple": true,
3828
- "type": "option"
3829
- },
3830
- "campaign-group": {
3831
- "description": "Keep only rows in this campaign group; repeatable",
3832
- "name": "campaign-group",
3833
- "hasDynamicHelp": false,
3834
- "multiple": true,
3835
- "type": "option"
3836
- }
3837
- },
3838
- "hasDynamicHelp": false,
3839
- "hiddenAliases": [],
3840
- "id": "asa:creatives:list",
3841
- "pluginAlias": "adapty",
3842
- "pluginName": "adapty",
3843
- "pluginType": "core",
3844
- "strict": true,
3845
- "enableJsonFlag": true,
3846
- "isESM": true,
3847
- "relativePath": [
3848
- "dist",
3849
- "commands",
3850
- "asa",
3851
- "creatives",
3852
- "list.js"
3853
- ]
3854
- },
3855
3791
  "asa:keywords:add": {
3856
3792
  "aliases": [],
3857
3793
  "args": {},
@@ -4158,7 +4094,7 @@
4158
4094
  "asa:metrics": {
4159
4095
  "aliases": [],
4160
4096
  "args": {},
4161
- "description": "Query metrics for any level of the account over a date range\n\nOne row per entity, already aggregated server-side and sorted by --order-by, so a top-N question is one\ncall with --order-by and --page-size N — never sum pages yourself. Account-level totals are one call to\nasa metrics overview instead. The date window is capped by the finest --group-by period: 28 days when\nday is grouped, 90 with no period grouping, 180 by week, 365 by month and coarser — widen the window by\ncoarsening the grouping, not by splitting into more calls. Each page is also capped at 5000 breakdown\nrows (entities × countries × periods); over it the call fails with 422 cli_response_too_large — coarsen\nthe grouping, narrow the window, or reduce page[size]. Budget: 5 metrics calls per minute, at most\n2 per 10 seconds, one at a time.\n\n--metric is required and every metric named is computed over the whole entity set, so ask for the\ncolumns you actually read. subscribers and paid_subscribers (and arppu / arpas, which derive from them)\ncount unique profiles per entity and cost roughly seventeen times the rest; whatever the --entity, they\nare refused unless --campaign or --ad-group scopes the call. Those scope flags are also the cheapest way\nto make any call fast, since cost follows the number of entities aggregated, not the page size.",
4097
+ "description": "Query metrics for any level of the account over a date range\n\nOne row per entity, already aggregated server-side and sorted by --order-by, so a top-N question is one\ncall with --order-by and --page-size N — never sum pages yourself. Account-level totals are one call to\nasa metrics overview instead. The date window is capped by the finest --group-by period: 28 days when\nday is grouped, 90 with no period grouping, 180 by week, 365 by month and coarser — widen the window by\ncoarsening the grouping, not by splitting into more calls. Each page is also capped at a breakdown-row\ncount (entities × countries × periods); over it the call fails with 422 cli_response_too_large naming the\npage[size] that fits — coarsen the grouping, narrow the window, or reduce page[size].\n\nMoney columns are in the campaign group currency, not USD, and spend and local_spend carry the same\nfigure; the currency itself comes from asa orgs list. Rate budgets and the breakdown-row cap are set per\ncompany: read the current ones with asa whoami rather than assuming a default. meta.pagination.count is\nthe full entity count behind the filters, so take inventory from there instead of counting the rows on a\npage. meta.max_valid_day says how many days the youngest cohort in the window has lived — any --by-days\nwindow above it repeats the last real figure because that time has not passed yet, so treat those as\nunreached rather than as a plateau.\n\n--metric is required and every metric named is computed over the whole entity set, so ask for the\ncolumns you actually read. subscribers and paid_subscribers (and arppu / arpas, which derive from them)\ncount unique profiles per entity and cost roughly seventeen times the rest; whatever the --entity, they\nare refused unless --campaign or --ad-group scopes the call. Those scope flags are also the cheapest way\nto make any call fast, since cost follows the number of entities aggregated, not the page size.",
4162
4098
  "examples": [
4163
4099
  "<%= config.bin %> asa metrics --entity campaign --date-from 2026-07-01 --date-to 2026-07-31 --metric spend --metric adapty_installs",
4164
4100
  "<%= config.bin %> asa metrics --entity campaign --date-from 2026-07-01 --date-to 2026-07-31 --metric spend --order-by spend --page-size 5",
@@ -4877,6 +4813,70 @@
4877
4813
  "list.js"
4878
4814
  ]
4879
4815
  },
4816
+ "asa:creatives:list": {
4817
+ "aliases": [],
4818
+ "args": {},
4819
+ "description": "List creatives; creative_id is what `asa ads create` needs",
4820
+ "examples": [
4821
+ "<%= config.bin %> asa creatives list",
4822
+ "<%= config.bin %> asa creatives list --app APP_UUID"
4823
+ ],
4824
+ "flags": {
4825
+ "json": {
4826
+ "description": "Format output as json.",
4827
+ "helpGroup": "GLOBAL",
4828
+ "name": "json",
4829
+ "allowNo": false,
4830
+ "type": "boolean"
4831
+ },
4832
+ "page": {
4833
+ "description": "Page number",
4834
+ "name": "page",
4835
+ "default": 1,
4836
+ "hasDynamicHelp": false,
4837
+ "multiple": false,
4838
+ "type": "option"
4839
+ },
4840
+ "page-size": {
4841
+ "description": "Items per page (max 1000); prefer one big page over a pagination loop",
4842
+ "name": "page-size",
4843
+ "default": 100,
4844
+ "hasDynamicHelp": false,
4845
+ "multiple": false,
4846
+ "type": "option"
4847
+ },
4848
+ "app": {
4849
+ "description": "Keep only rows in this app; repeatable",
4850
+ "name": "app",
4851
+ "hasDynamicHelp": false,
4852
+ "multiple": true,
4853
+ "type": "option"
4854
+ },
4855
+ "campaign-group": {
4856
+ "description": "Keep only rows in this campaign group; repeatable",
4857
+ "name": "campaign-group",
4858
+ "hasDynamicHelp": false,
4859
+ "multiple": true,
4860
+ "type": "option"
4861
+ }
4862
+ },
4863
+ "hasDynamicHelp": false,
4864
+ "hiddenAliases": [],
4865
+ "id": "asa:creatives:list",
4866
+ "pluginAlias": "adapty",
4867
+ "pluginName": "adapty",
4868
+ "pluginType": "core",
4869
+ "strict": true,
4870
+ "enableJsonFlag": true,
4871
+ "isESM": true,
4872
+ "relativePath": [
4873
+ "dist",
4874
+ "commands",
4875
+ "asa",
4876
+ "creatives",
4877
+ "list.js"
4878
+ ]
4879
+ },
4880
4880
  "flows:config:get": {
4881
4881
  "aliases": [],
4882
4882
  "args": {
@@ -5181,5 +5181,5 @@
5181
5181
  ]
5182
5182
  }
5183
5183
  },
5184
- "version": "0.8.4"
5184
+ "version": "0.8.5"
5185
5185
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adapty",
3
3
  "description": "Adapty command line interface",
4
- "version": "0.8.4",
4
+ "version": "0.8.5",
5
5
  "author": "Adapty team <support@adapty.io>",
6
6
  "bin": {
7
7
  "adapty": "./bin/run.js"
@@ -16,25 +16,27 @@
16
16
  },
17
17
  "devDependencies": {
18
18
  "@eslint/compat": "^1",
19
- "@oclif/prettier-config": "^0.2.1",
19
+ "@eslint/js": "^9.39.2",
20
20
  "@oclif/test": "^4",
21
+ "@stylistic/eslint-plugin": "^5.10.0",
21
22
  "@types/chai": "^4",
22
23
  "@types/mocha": "^10",
23
- "@types/node": "^18",
24
+ "@types/node": "^22",
24
25
  "@types/sinon": "^21.0.0",
25
26
  "chai": "^4",
26
27
  "eslint": "^9",
27
- "eslint-config-oclif": "^6",
28
- "eslint-config-prettier": "^10",
28
+ "eslint-plugin-import-x": "^4.17.1",
29
+ "eslint-plugin-n": "^18.3.0",
29
30
  "mocha": "^10",
30
31
  "oclif": "^4",
31
32
  "shx": "^0.3.3",
32
33
  "sinon": "^21.0.2",
33
34
  "ts-node": "^10",
34
- "typescript": "^5"
35
+ "typescript": "^5",
36
+ "typescript-eslint": "^8.70.0"
35
37
  },
36
38
  "engines": {
37
- "node": ">=18.0.0"
39
+ "node": "^22 || >=24"
38
40
  },
39
41
  "packageManager": "pnpm@10.28.1",
40
42
  "files": [
@@ -137,7 +139,7 @@
137
139
  "scripts": {
138
140
  "build": "shx rm -rf dist && tsc -b",
139
141
  "check:agent-docs": "oclif manifest && node scripts/check-agent-docs.mjs",
140
- "lint": "eslint",
142
+ "lint": "eslint --max-warnings 0",
141
143
  "postpack": "shx rm -f oclif.manifest.json",
142
144
  "posttest": "pnpm run lint",
143
145
  "prepack": "oclif manifest && oclif readme",