adapty 0.1.4 → 0.2.0

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 (39) hide show
  1. package/README.md +24 -12
  2. package/dist/commands/access-levels/create.d.ts +2 -1
  3. package/dist/commands/access-levels/create.js +3 -2
  4. package/dist/commands/access-levels/get.d.ts +2 -7
  5. package/dist/commands/access-levels/list.d.ts +2 -7
  6. package/dist/commands/access-levels/update.d.ts +2 -1
  7. package/dist/commands/access-levels/update.js +3 -2
  8. package/dist/commands/apps/create.d.ts +2 -1
  9. package/dist/commands/apps/create.js +1 -2
  10. package/dist/commands/apps/get.d.ts +2 -11
  11. package/dist/commands/apps/list.d.ts +2 -7
  12. package/dist/commands/apps/update.d.ts +2 -8
  13. package/dist/commands/paywalls/create.d.ts +2 -1
  14. package/dist/commands/paywalls/create.js +3 -2
  15. package/dist/commands/paywalls/get.d.ts +2 -7
  16. package/dist/commands/paywalls/list.d.ts +2 -6
  17. package/dist/commands/paywalls/placements.d.ts +18 -0
  18. package/dist/commands/paywalls/placements.js +25 -0
  19. package/dist/commands/paywalls/update.d.ts +2 -1
  20. package/dist/commands/paywalls/update.js +3 -2
  21. package/dist/commands/placements/create.d.ts +4 -2
  22. package/dist/commands/placements/create.js +29 -6
  23. package/dist/commands/placements/get.d.ts +2 -8
  24. package/dist/commands/placements/list.d.ts +2 -7
  25. package/dist/commands/placements/update.d.ts +4 -2
  26. package/dist/commands/placements/update.js +32 -6
  27. package/dist/commands/products/create.d.ts +2 -1
  28. package/dist/commands/products/create.js +9 -1
  29. package/dist/commands/products/get.d.ts +2 -9
  30. package/dist/commands/products/list.d.ts +2 -7
  31. package/dist/commands/products/update.d.ts +2 -1
  32. package/dist/commands/segments/get.d.ts +14 -0
  33. package/dist/commands/segments/get.js +25 -0
  34. package/dist/commands/segments/list.d.ts +14 -0
  35. package/dist/commands/segments/list.js +20 -0
  36. package/dist/lib/api-schemas.d.ts +99 -0
  37. package/dist/lib/api-schemas.js +7 -0
  38. package/oclif.manifest.json +169 -7
  39. package/package.json +5 -2
package/README.md CHANGED
@@ -1,11 +1,15 @@
1
- # adapty-cli
1
+ <a href="https://adapty.io/?utm_source=github&utm_medium=referral&utm_campaign=adapty-cli">
2
+ <img src="https://adapty-portal-media-production.s3.amazonaws.com/github/logo-adapty-new.svg">
3
+ </a>
2
4
 
3
- CLI for the [Adapty Developer API](https://docs.adapty.io/docs/developer-api). Manage apps, products, paywalls, placements, and access levels from your terminal.
5
+ # Adapty CLI
6
+
7
+ [Adapty Developer CLI](https://adapty.io/docs/developer-cli). Manage apps, products, paywalls, placements, and access levels from your terminal.
4
8
 
5
9
  ## Installation
6
10
 
7
11
  ```sh
8
- npm install -g adapty-cli
12
+ npm install -g adapty
9
13
  ```
10
14
 
11
15
  Requires Node.js >= 18.
@@ -84,19 +88,27 @@ adapty access-levels update --app UUID ACCESS_LEVEL_ID [flags]
84
88
 
85
89
  ### Global Flags
86
90
 
87
- | Flag | Description |
88
- |------|-------------|
89
- | `--json` | Output as JSON |
90
- | `--help` | Show help |
91
- | `--page` | Page number (default: 1) |
91
+ | Flag | Description |
92
+ | ------------- | -------------------------------------- |
93
+ | `--json` | Output as JSON |
94
+ | `--help` | Show help |
95
+ | `--page` | Page number (default: 1) |
92
96
  | `--page-size` | Items per page (default: 20, max: 100) |
93
97
 
94
98
  ## Environment Variables
95
99
 
96
- | Variable | Description |
97
- |----------|-------------|
98
- | `ADAPTY_TOKEN` | Override stored auth token |
99
- | `ADAPTY_API_URL` | Override API base URL (default: `https://api.adapty.io/api/v1/developer`) |
100
+ | Variable | Description |
101
+ | ---------------- | ------------------------------------------------------------------------------- |
102
+ | `ADAPTY_TOKEN` | Override stored auth token |
103
+ | `ADAPTY_API_URL` | Override API base URL (default: `https://api-admin.adapty.io/api/v1/developer`) |
104
+
105
+ ## Claude Code Skill
106
+
107
+ Install the Adapty CLI skill for Claude Code:
108
+
109
+ ```sh
110
+ npx skills add adaptyteam/adapty-cli --skill adapty-cli
111
+ ```
100
112
 
101
113
  ## Development
102
114
 
@@ -1,4 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { AccessLevelDTO } from '../../lib/api-schemas.js';
2
3
  export default class AccessLevelsCreate extends Command {
3
4
  static description: string;
4
5
  static enableJsonFlag: boolean;
@@ -8,5 +9,5 @@ export default class AccessLevelsCreate extends Command {
8
9
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
10
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
11
  };
11
- run(): Promise<Record<string, unknown>>;
12
+ run(): Promise<AccessLevelDTO>;
12
13
  }
@@ -16,10 +16,11 @@ export default class AccessLevelsCreate extends Command {
16
16
  async run() {
17
17
  const { flags } = await this.parse(AccessLevelsCreate);
18
18
  const client = await createAuthenticatedClient(this.config);
19
- const result = await client.post(`/apps/${flags.app}/access-levels`, {
19
+ const body = {
20
20
  sdk_id: flags['sdk-id'],
21
21
  title: flags.title,
22
- });
22
+ };
23
+ const result = await client.post(`/apps/${flags.app}/access-levels`, body);
23
24
  this.log('Access level created!');
24
25
  printResponse(result, this.log.bind(this));
25
26
  return result;
@@ -1,9 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- interface AccessLevelDetailResponse {
3
- id: string;
4
- sdk_id: string;
5
- title: string;
6
- }
2
+ import type { AccessLevelDTO } from '../../lib/api-schemas.js';
7
3
  export default class AccessLevelsGet extends Command {
8
4
  static args: {
9
5
  access_level_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -14,6 +10,5 @@ export default class AccessLevelsGet extends Command {
14
10
  static flags: {
15
11
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
12
  };
17
- run(): Promise<AccessLevelDetailResponse>;
13
+ run(): Promise<AccessLevelDTO>;
18
14
  }
19
- export {};
@@ -1,10 +1,6 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { AccessLevelDTO } from '../../lib/api-schemas.js';
2
3
  import { type PaginatedResponse } from '../../lib/flags.js';
3
- interface AccessLevelItem {
4
- id: string;
5
- sdk_id: string;
6
- title: string;
7
- }
8
4
  export default class AccessLevelsList extends Command {
9
5
  static description: string;
10
6
  static enableJsonFlag: boolean;
@@ -14,6 +10,5 @@ export default class AccessLevelsList extends Command {
14
10
  'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
15
11
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
12
  };
17
- run(): Promise<PaginatedResponse<AccessLevelItem>>;
13
+ run(): Promise<PaginatedResponse<AccessLevelDTO>>;
18
14
  }
19
- export {};
@@ -1,4 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { AccessLevelDTO } from '../../lib/api-schemas.js';
2
3
  export default class AccessLevelsUpdate extends Command {
3
4
  static args: {
4
5
  access_level_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -10,5 +11,5 @@ export default class AccessLevelsUpdate extends Command {
10
11
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
12
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
13
  };
13
- run(): Promise<Record<string, unknown>>;
14
+ run(): Promise<AccessLevelDTO>;
14
15
  }
@@ -21,9 +21,10 @@ export default class AccessLevelsUpdate extends Command {
21
21
  this.error('Invalid access level ID format.', { exit: 2 });
22
22
  }
23
23
  const client = await createAuthenticatedClient(this.config);
24
- const result = await client.put(`/apps/${flags.app}/access-levels/${args.access_level_id}`, {
24
+ const body = {
25
25
  title: flags.title,
26
- });
26
+ };
27
+ const result = await client.put(`/apps/${flags.app}/access-levels/${args.access_level_id}`, body);
27
28
  this.log('Access level updated!');
28
29
  printResponse(result, this.log.bind(this));
29
30
  return result;
@@ -1,4 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { AppSummaryDTO } from '../../lib/api-schemas.js';
2
3
  export default class AppsCreate extends Command {
3
4
  static description: string;
4
5
  static enableJsonFlag: boolean;
@@ -9,5 +10,5 @@ export default class AppsCreate extends Command {
9
10
  platform: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
10
11
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
12
  };
12
- run(): Promise<Record<string, unknown>>;
13
+ run(): Promise<AppSummaryDTO>;
13
14
  }
@@ -39,10 +39,9 @@ export default class AppsCreate extends Command {
39
39
  const result = await client.post('/apps', body);
40
40
  this.log('App created!');
41
41
  printResponse(result, this.log.bind(this));
42
- // Fetch default access level for the new app
43
42
  try {
44
43
  const accessLevels = await client.get(`/apps/${result.id}/access-levels`);
45
- if (accessLevels.items?.length > 0) {
44
+ if (accessLevels.items?.length) {
46
45
  this.log('\nDefault access level:');
47
46
  printResponse(accessLevels.items[0], this.log.bind(this));
48
47
  }
@@ -1,13 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- interface AppDetailResponse {
3
- apple_bundle_id?: string;
4
- google_bundle_id?: string;
5
- id: string;
6
- platforms: string[];
7
- sdk_key: string;
8
- secret_key: string;
9
- title: string;
10
- }
2
+ import type { AppDetailDTO } from '../../lib/api-schemas.js';
11
3
  export default class AppsGet extends Command {
12
4
  static args: {
13
5
  app_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -15,6 +7,5 @@ export default class AppsGet extends Command {
15
7
  static description: string;
16
8
  static enableJsonFlag: boolean;
17
9
  static examples: string[];
18
- run(): Promise<AppDetailResponse>;
10
+ run(): Promise<AppDetailDTO>;
19
11
  }
20
- export {};
@@ -1,10 +1,6 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { AppSummaryDTO } from '../../lib/api-schemas.js';
2
3
  import { type PaginatedResponse } from '../../lib/flags.js';
3
- interface AppItem {
4
- id: string;
5
- sdk_key: string;
6
- title: string;
7
- }
8
4
  export default class AppsList extends Command {
9
5
  static description: string;
10
6
  static enableJsonFlag: boolean;
@@ -13,6 +9,5 @@ export default class AppsList extends Command {
13
9
  page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
14
10
  'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
15
11
  };
16
- run(): Promise<PaginatedResponse<AppItem>>;
12
+ run(): Promise<PaginatedResponse<AppSummaryDTO>>;
17
13
  }
18
- export {};
@@ -1,10 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- interface AppResponse {
3
- apple_bundle_id?: string;
4
- google_bundle_id?: string;
5
- id: string;
6
- title: string;
7
- }
2
+ import type { AppDetailDTO } from '../../lib/api-schemas.js';
8
3
  export default class AppsUpdate extends Command {
9
4
  static args: {
10
5
  app_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -17,6 +12,5 @@ export default class AppsUpdate extends Command {
17
12
  'google-bundle-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
13
  title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
14
  };
20
- run(): Promise<AppResponse>;
15
+ run(): Promise<AppDetailDTO>;
21
16
  }
22
- export {};
@@ -1,4 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { PaywallDTO } from '../../lib/api-schemas.js';
2
3
  export default class PaywallsCreate extends Command {
3
4
  static description: string;
4
5
  static enableJsonFlag: boolean;
@@ -8,5 +9,5 @@ export default class PaywallsCreate extends Command {
8
9
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
10
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
11
  };
11
- run(): Promise<Record<string, unknown>>;
12
+ run(): Promise<PaywallDTO>;
12
13
  }
@@ -20,10 +20,11 @@ export default class PaywallsCreate extends Command {
20
20
  async run() {
21
21
  const { flags } = await this.parse(PaywallsCreate);
22
22
  const client = await createAuthenticatedClient(this.config);
23
- const result = await client.post(`/apps/${flags.app}/paywalls`, {
23
+ const body = {
24
24
  product_ids: flags['product-id'],
25
25
  title: flags.title,
26
- });
26
+ };
27
+ const result = await client.post(`/apps/${flags.app}/paywalls`, body);
27
28
  this.log('Paywall created!');
28
29
  printResponse(result, this.log.bind(this));
29
30
  return result;
@@ -1,9 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- interface PaywallDetailResponse {
3
- id: string;
4
- product_ids: string[];
5
- title: string;
6
- }
2
+ import type { PaywallDTO } from '../../lib/api-schemas.js';
7
3
  export default class PaywallsGet extends Command {
8
4
  static args: {
9
5
  paywall_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -14,6 +10,5 @@ export default class PaywallsGet extends Command {
14
10
  static flags: {
15
11
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
12
  };
17
- run(): Promise<PaywallDetailResponse>;
13
+ run(): Promise<PaywallDTO>;
18
14
  }
19
- export {};
@@ -1,9 +1,6 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { PaywallDTO } from '../../lib/api-schemas.js';
2
3
  import { type PaginatedResponse } from '../../lib/flags.js';
3
- interface PaywallItem {
4
- id: string;
5
- title: string;
6
- }
7
4
  export default class PaywallsList extends Command {
8
5
  static description: string;
9
6
  static enableJsonFlag: boolean;
@@ -13,6 +10,5 @@ export default class PaywallsList extends Command {
13
10
  'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
14
11
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
12
  };
16
- run(): Promise<PaginatedResponse<PaywallItem>>;
13
+ run(): Promise<PaginatedResponse<PaywallDTO>>;
17
14
  }
18
- export {};
@@ -0,0 +1,18 @@
1
+ import { Command } from '@oclif/core';
2
+ import type { PlacementSummaryDTO } from '../../lib/api-schemas.js';
3
+ interface PlacementsByPaywallResponse {
4
+ data: PlacementSummaryDTO[];
5
+ }
6
+ export default class PaywallsPlacements extends Command {
7
+ static args: {
8
+ paywall_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ static description: string;
11
+ static enableJsonFlag: boolean;
12
+ static examples: string[];
13
+ static flags: {
14
+ app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
+ };
16
+ run(): Promise<PlacementsByPaywallResponse>;
17
+ }
18
+ export {};
@@ -0,0 +1,25 @@
1
+ import { Args, Command } from '@oclif/core';
2
+ import { createAuthenticatedClient } from '../../lib/client-from-config.js';
3
+ import { appFlag, isValidUuid } from '../../lib/flags.js';
4
+ import { printList } from '../../lib/output.js';
5
+ export default class PaywallsPlacements extends Command {
6
+ static args = {
7
+ paywall_id: Args.string({ description: 'Paywall ID (UUID)', required: true }),
8
+ };
9
+ static description = 'List placements that currently use this paywall';
10
+ static enableJsonFlag = true;
11
+ static examples = ['<%= config.bin %> paywalls placements --app UUID 770e8400-e29b-41d4-a716-446655440002'];
12
+ static flags = {
13
+ ...appFlag,
14
+ };
15
+ async run() {
16
+ const { args, flags } = await this.parse(PaywallsPlacements);
17
+ if (!isValidUuid(args.paywall_id)) {
18
+ this.error('Invalid paywall ID format.', { exit: 2 });
19
+ }
20
+ const client = await createAuthenticatedClient(this.config);
21
+ const result = await client.get(`/apps/${flags.app}/paywalls/${args.paywall_id}/placements`);
22
+ printList(result.data, this.log.bind(this));
23
+ return result;
24
+ }
25
+ }
@@ -1,4 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { PaywallDTO } from '../../lib/api-schemas.js';
2
3
  export default class PaywallsUpdate extends Command {
3
4
  static args: {
4
5
  paywall_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -11,5 +12,5 @@ export default class PaywallsUpdate extends Command {
11
12
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
13
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
14
  };
14
- run(): Promise<Record<string, unknown>>;
15
+ run(): Promise<PaywallDTO>;
15
16
  }
@@ -26,10 +26,11 @@ export default class PaywallsUpdate extends Command {
26
26
  this.error('Invalid paywall ID format.', { exit: 2 });
27
27
  }
28
28
  const client = await createAuthenticatedClient(this.config);
29
- const result = await client.put(`/apps/${flags.app}/paywalls/${args.paywall_id}`, {
29
+ const body = {
30
30
  product_ids: flags['product-id'],
31
31
  title: flags.title,
32
- });
32
+ };
33
+ const result = await client.put(`/apps/${flags.app}/paywalls/${args.paywall_id}`, body);
33
34
  this.log('Paywall updated!');
34
35
  printResponse(result, this.log.bind(this));
35
36
  return result;
@@ -1,13 +1,15 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { PlacementDetailDTO } from '../../lib/api-schemas.js';
2
3
  export default class PlacementsCreate extends Command {
3
4
  static description: string;
4
5
  static enableJsonFlag: boolean;
5
6
  static examples: string[];
6
7
  static flags: {
8
+ audiences: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
9
  'developer-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
- 'paywall-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'paywall-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
11
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
12
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
13
  };
12
- run(): Promise<Record<string, unknown>>;
14
+ run(): Promise<PlacementDetailDTO>;
13
15
  }
@@ -6,22 +6,45 @@ export default class PlacementsCreate extends Command {
6
6
  static description = 'Create a placement with a paywall';
7
7
  static enableJsonFlag = true;
8
8
  static examples = [
9
- '<%= config.bin %> placements create --app UUID --title "Default" --developer-id default --paywall-id UUID',
9
+ '<%= config.bin %> placements create --app UUID --title "Default" --developer-id default --audiences \'[{"segment_ids":[],"paywall_id":"PAYWALL_UUID","priority":0}]\'',
10
+ '<%= config.bin %> placements create --app UUID --title "Default" --developer-id default --paywall-id PAYWALL_UUID',
10
11
  ];
11
12
  static flags = {
12
13
  ...appFlag,
14
+ audiences: Flags.string({
15
+ description: 'JSON array of audience entries: [{segment_ids, paywall_id, priority}]',
16
+ exactlyOne: ['paywall-id', 'audiences'],
17
+ }),
13
18
  'developer-id': Flags.string({ description: 'Developer ID for the placement', required: true }),
14
- 'paywall-id': Flags.string({ description: 'Paywall ID (UUID)', required: true }),
19
+ 'paywall-id': Flags.string({
20
+ description: 'Paywall ID (UUID). DEPRECATED: use --audiences.',
21
+ exactlyOne: ['paywall-id', 'audiences'],
22
+ }),
15
23
  title: Flags.string({ description: 'Placement title', required: true }),
16
24
  };
17
25
  async run() {
18
26
  const { flags } = await this.parse(PlacementsCreate);
19
- const client = await createAuthenticatedClient(this.config);
20
- const result = await client.post(`/apps/${flags.app}/placements`, {
27
+ const body = {
28
+ audiences: null,
21
29
  developer_id: flags['developer-id'],
22
- paywall_id: flags['paywall-id'],
30
+ paywall_id: null,
23
31
  title: flags.title,
24
- });
32
+ };
33
+ if (flags['paywall-id']) {
34
+ process.stderr.write('⚠️ --paywall-id is deprecated. Use --audiences instead.\n' +
35
+ ' `paywall_id` will be removed from the API in a future release.\n');
36
+ body.paywall_id = flags['paywall-id'];
37
+ }
38
+ else {
39
+ try {
40
+ body.audiences = JSON.parse(flags.audiences);
41
+ }
42
+ catch (error) {
43
+ this.error(`Invalid --audiences JSON: ${error instanceof Error ? error.message : String(error)}`, { exit: 2 });
44
+ }
45
+ }
46
+ const client = await createAuthenticatedClient(this.config);
47
+ const result = await client.post(`/apps/${flags.app}/placements`, body);
25
48
  this.log('Placement created!');
26
49
  printResponse(result, this.log.bind(this));
27
50
  return result;
@@ -1,10 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- interface PlacementDetailResponse {
3
- developer_id: string;
4
- id: string;
5
- paywall_id: string;
6
- title: string;
7
- }
2
+ import type { PlacementDetailDTO } from '../../lib/api-schemas.js';
8
3
  export default class PlacementsGet extends Command {
9
4
  static args: {
10
5
  placement_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -15,6 +10,5 @@ export default class PlacementsGet extends Command {
15
10
  static flags: {
16
11
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
12
  };
18
- run(): Promise<PlacementDetailResponse>;
13
+ run(): Promise<PlacementDetailDTO>;
19
14
  }
20
- export {};
@@ -1,10 +1,6 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { PlacementSummaryDTO } from '../../lib/api-schemas.js';
2
3
  import { type PaginatedResponse } from '../../lib/flags.js';
3
- interface PlacementItem {
4
- developer_id: string;
5
- id: string;
6
- title: string;
7
- }
8
4
  export default class PlacementsList extends Command {
9
5
  static description: string;
10
6
  static enableJsonFlag: boolean;
@@ -14,6 +10,5 @@ export default class PlacementsList extends Command {
14
10
  'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
15
11
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
12
  };
17
- run(): Promise<PaginatedResponse<PlacementItem>>;
13
+ run(): Promise<PaginatedResponse<PlacementSummaryDTO>>;
18
14
  }
19
- export {};
@@ -1,4 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { PlacementDetailDTO } from '../../lib/api-schemas.js';
2
3
  export default class PlacementsUpdate extends Command {
3
4
  static args: {
4
5
  placement_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -7,10 +8,11 @@ export default class PlacementsUpdate extends Command {
7
8
  static enableJsonFlag: boolean;
8
9
  static examples: string[];
9
10
  static flags: {
11
+ audiences: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
12
  'developer-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
- 'paywall-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'paywall-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
14
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
15
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
16
  };
15
- run(): Promise<Record<string, unknown>>;
17
+ run(): Promise<PlacementDetailDTO>;
16
18
  }
@@ -9,12 +9,20 @@ export default class PlacementsUpdate extends Command {
9
9
  static description = 'Update a placement';
10
10
  static enableJsonFlag = true;
11
11
  static examples = [
12
- '<%= config.bin %> placements update --app UUID 550e8400-... --title "Default" --developer-id default --paywall-id UUID',
12
+ '<%= config.bin %> placements update --app UUID 550e8400-... --title "Default" --developer-id default --audiences \'[{"segment_ids":[],"paywall_id":"PAYWALL_UUID","priority":0}]\'',
13
+ '<%= config.bin %> placements update --app UUID 550e8400-... --title "Default" --developer-id default --paywall-id PAYWALL_UUID',
13
14
  ];
14
15
  static flags = {
15
16
  ...appFlag,
17
+ audiences: Flags.string({
18
+ description: 'JSON array of audience entries: [{segment_ids, paywall_id, priority}]',
19
+ exactlyOne: ['paywall-id', 'audiences'],
20
+ }),
16
21
  'developer-id': Flags.string({ description: 'Developer ID for the placement', required: true }),
17
- 'paywall-id': Flags.string({ description: 'Paywall ID (UUID)', required: true }),
22
+ 'paywall-id': Flags.string({
23
+ description: 'Paywall ID (UUID). DEPRECATED: use --audiences.',
24
+ exactlyOne: ['paywall-id', 'audiences'],
25
+ }),
18
26
  title: Flags.string({ description: 'Placement title', required: true }),
19
27
  };
20
28
  async run() {
@@ -22,12 +30,30 @@ export default class PlacementsUpdate extends Command {
22
30
  if (!isValidUuid(args.placement_id)) {
23
31
  this.error('Invalid placement ID format.', { exit: 2 });
24
32
  }
25
- const client = await createAuthenticatedClient(this.config);
26
- const result = await client.put(`/apps/${flags.app}/placements/${args.placement_id}`, {
33
+ const body = {
34
+ audiences: null,
27
35
  developer_id: flags['developer-id'],
28
- paywall_id: flags['paywall-id'],
36
+ paywall_id: null,
29
37
  title: flags.title,
30
- });
38
+ };
39
+ if (flags['paywall-id']) {
40
+ process.stderr.write('⚠️ --paywall-id is deprecated. Use --audiences instead.\n' +
41
+ ' `paywall_id` will be removed from the API in a future release.\n');
42
+ process.stderr.write('⚠️ --paywall-id will rewrite all audiences on this placement.\n' +
43
+ ' If the placement has segment-specific paywalls, they will be replaced\n' +
44
+ ' by a single default audience. Use --audiences to preserve them.\n');
45
+ body.paywall_id = flags['paywall-id'];
46
+ }
47
+ else {
48
+ try {
49
+ body.audiences = JSON.parse(flags.audiences);
50
+ }
51
+ catch (error) {
52
+ this.error(`Invalid --audiences JSON: ${error instanceof Error ? error.message : String(error)}`, { exit: 2 });
53
+ }
54
+ }
55
+ const client = await createAuthenticatedClient(this.config);
56
+ const result = await client.put(`/apps/${flags.app}/placements/${args.placement_id}`, body);
31
57
  this.log('Placement updated!');
32
58
  printResponse(result, this.log.bind(this));
33
59
  return result;
@@ -1,4 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { ProductDTO } from '../../lib/api-schemas.js';
2
3
  export default class ProductsCreate extends Command {
3
4
  static description: string;
4
5
  static enableJsonFlag: boolean;
@@ -12,5 +13,5 @@ export default class ProductsCreate extends Command {
12
13
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
14
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
15
  };
15
- run(): Promise<Record<string, unknown>>;
16
+ run(): Promise<ProductDTO>;
16
17
  }
@@ -2,7 +2,15 @@ import { Command, Flags } from '@oclif/core';
2
2
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
3
3
  import { appFlag } from '../../lib/flags.js';
4
4
  import { printResponse } from '../../lib/output.js';
5
- const VALID_PERIODS = ['weekly', 'monthly', 'two_months', 'trimonthly', 'semiannual', 'annual', 'lifetime'];
5
+ const VALID_PERIODS = [
6
+ 'weekly',
7
+ 'monthly',
8
+ 'two_months',
9
+ 'trimonthly',
10
+ 'semiannual',
11
+ 'annual',
12
+ 'lifetime',
13
+ ];
6
14
  export default class ProductsCreate extends Command {
7
15
  static description = 'Create a product with vendor products per platform';
8
16
  static enableJsonFlag = true;
@@ -1,11 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- interface ProductDetailResponse {
3
- access_level_id: string;
4
- id: string;
5
- period: string;
6
- title: string;
7
- vendor_products: Record<string, unknown>;
8
- }
2
+ import type { ProductDTO } from '../../lib/api-schemas.js';
9
3
  export default class ProductsGet extends Command {
10
4
  static args: {
11
5
  product_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -16,6 +10,5 @@ export default class ProductsGet extends Command {
16
10
  static flags: {
17
11
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
18
12
  };
19
- run(): Promise<ProductDetailResponse>;
13
+ run(): Promise<ProductDTO>;
20
14
  }
21
- export {};
@@ -1,10 +1,6 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { ProductDTO } from '../../lib/api-schemas.js';
2
3
  import { type PaginatedResponse } from '../../lib/flags.js';
3
- interface ProductItem {
4
- id: string;
5
- title: string;
6
- vendor_products: Record<string, unknown>;
7
- }
8
4
  export default class ProductsList extends Command {
9
5
  static description: string;
10
6
  static enableJsonFlag: boolean;
@@ -14,6 +10,5 @@ export default class ProductsList extends Command {
14
10
  'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
15
11
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
12
  };
17
- run(): Promise<PaginatedResponse<ProductItem>>;
13
+ run(): Promise<PaginatedResponse<ProductDTO>>;
18
14
  }
19
- export {};
@@ -1,4 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
+ import type { ProductDTO } from '../../lib/api-schemas.js';
2
3
  export default class ProductsUpdate extends Command {
3
4
  static args: {
4
5
  product_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -11,5 +12,5 @@ export default class ProductsUpdate extends Command {
11
12
  title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
13
  app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
14
  };
14
- run(): Promise<Record<string, unknown>>;
15
+ run(): Promise<ProductDTO>;
15
16
  }
@@ -0,0 +1,14 @@
1
+ import { Command } from '@oclif/core';
2
+ import type { SegmentDTO } from '../../lib/api-schemas.js';
3
+ export default class SegmentsGet extends Command {
4
+ static args: {
5
+ segment_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static enableJsonFlag: boolean;
9
+ static examples: string[];
10
+ static flags: {
11
+ app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<SegmentDTO>;
14
+ }
@@ -0,0 +1,25 @@
1
+ import { Args, Command } from '@oclif/core';
2
+ import { createAuthenticatedClient } from '../../lib/client-from-config.js';
3
+ import { appFlag, isValidUuid } from '../../lib/flags.js';
4
+ import { printResponse } from '../../lib/output.js';
5
+ export default class SegmentsGet extends Command {
6
+ static args = {
7
+ segment_id: Args.string({ description: 'Segment ID (UUID)', required: true }),
8
+ };
9
+ static description = 'Get segment details';
10
+ static enableJsonFlag = true;
11
+ static examples = ['<%= config.bin %> segments get --app UUID 550e8400-e29b-41d4-a716-446655440000'];
12
+ static flags = {
13
+ ...appFlag,
14
+ };
15
+ async run() {
16
+ const { args, flags } = await this.parse(SegmentsGet);
17
+ if (!isValidUuid(args.segment_id)) {
18
+ this.error('Invalid segment ID format.', { exit: 2 });
19
+ }
20
+ const client = await createAuthenticatedClient(this.config);
21
+ const result = await client.get(`/apps/${flags.app}/segments/${args.segment_id}`);
22
+ printResponse(result, this.log.bind(this));
23
+ return result;
24
+ }
25
+ }
@@ -0,0 +1,14 @@
1
+ import { Command } from '@oclif/core';
2
+ import type { SegmentDTO } from '../../lib/api-schemas.js';
3
+ import { type PaginatedResponse } from '../../lib/flags.js';
4
+ export default class SegmentsList extends Command {
5
+ static description: string;
6
+ static enableJsonFlag: boolean;
7
+ static examples: string[];
8
+ static flags: {
9
+ page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
11
+ app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<PaginatedResponse<SegmentDTO>>;
14
+ }
@@ -0,0 +1,20 @@
1
+ import { Command } from '@oclif/core';
2
+ import { createAuthenticatedClient } from '../../lib/client-from-config.js';
3
+ import { appFlag, paginationFlags, paginationParams } from '../../lib/flags.js';
4
+ import { printList } from '../../lib/output.js';
5
+ export default class SegmentsList extends Command {
6
+ static description = 'List segments for an app';
7
+ static enableJsonFlag = true;
8
+ static examples = ['<%= config.bin %> segments list --app 550e8400-...'];
9
+ static flags = {
10
+ ...appFlag,
11
+ ...paginationFlags,
12
+ };
13
+ async run() {
14
+ const { flags } = await this.parse(SegmentsList);
15
+ const client = await createAuthenticatedClient(this.config);
16
+ const result = await client.get(`/apps/${flags.app}/segments`, paginationParams(flags));
17
+ printList(result.data, this.log.bind(this), result.meta.pagination);
18
+ return result;
19
+ }
20
+ }
@@ -0,0 +1,99 @@
1
+ export type ProductPeriod = 'annual' | 'consumable' | 'lifetime' | 'monthly' | 'nonsubscriptions' | 'semiannual' | 'trimonthly' | 'two_months' | 'uncategorised' | 'weekly';
2
+ export interface VendorProductDTO {
3
+ base_plan_id: null | string;
4
+ id: null | string;
5
+ product_id: null | string;
6
+ }
7
+ export interface AppSummaryDTO {
8
+ id: string;
9
+ sdk_key: null | string;
10
+ title: string;
11
+ }
12
+ export interface AppDetailDTO {
13
+ apple_bundle_id: null | string;
14
+ google_bundle_id: null | string;
15
+ id: string;
16
+ platforms: string[];
17
+ sdk_key: null | string;
18
+ secret_key: null | string;
19
+ title: string;
20
+ }
21
+ export interface AppCreateRequestDTO {
22
+ apple_bundle_id?: null | string;
23
+ google_bundle_id?: null | string;
24
+ title: string;
25
+ }
26
+ export interface AppUpdateRequestDTO {
27
+ apple_bundle_id?: null | string;
28
+ google_bundle_id?: null | string;
29
+ title?: null | string;
30
+ }
31
+ export interface AccessLevelDTO {
32
+ id: string;
33
+ sdk_id: string;
34
+ title: null | string;
35
+ }
36
+ export interface AccessLevelCreateRequestDTO {
37
+ sdk_id: string;
38
+ title?: null | string;
39
+ }
40
+ export interface AccessLevelUpdateRequestDTO {
41
+ title?: null | string;
42
+ }
43
+ export interface ProductDTO {
44
+ access_level_id: string;
45
+ id: string;
46
+ period: ProductPeriod;
47
+ title: string;
48
+ vendor_products: Record<string, VendorProductDTO>;
49
+ }
50
+ export interface ProductCreateRequestDTO {
51
+ access_level_id: string;
52
+ android_base_plan_id?: null | string;
53
+ android_product_id?: null | string;
54
+ ios_product_id?: null | string;
55
+ period: ProductPeriod;
56
+ price_usd?: null | number;
57
+ title: string;
58
+ }
59
+ export interface ProductUpdateRequestDTO {
60
+ access_level_id: string;
61
+ title: string;
62
+ }
63
+ export interface PaywallDTO {
64
+ id: string;
65
+ product_ids: string[];
66
+ title: string;
67
+ }
68
+ export interface PaywallWriteRequestDTO {
69
+ product_ids?: string[];
70
+ title: string;
71
+ }
72
+ export interface SegmentDTO {
73
+ description: null | string;
74
+ id: string;
75
+ title: string;
76
+ }
77
+ export interface PlacementAudienceEntryDTO {
78
+ paywall_id: string;
79
+ priority: number;
80
+ segment_ids?: string[];
81
+ }
82
+ export interface PlacementSummaryDTO {
83
+ developer_id: string;
84
+ id: string;
85
+ title: string;
86
+ }
87
+ export interface PlacementDetailDTO {
88
+ audiences?: PlacementAudienceEntryDTO[];
89
+ developer_id: string;
90
+ id: string;
91
+ title: string;
92
+ }
93
+ export interface PlacementWriteRequestDTO {
94
+ audiences: null | PlacementAudienceEntryDTO[];
95
+ developer_id: string;
96
+ /** @deprecated use `audiences` */
97
+ paywall_id: null | string;
98
+ title: string;
99
+ }
@@ -0,0 +1,7 @@
1
+ // Hand-picked DTOs from the Adapty Developer API OpenAPI schema. Kept in
2
+ // lockstep with the server-side `portal.developer_api_context.domains.data_transfer_objects.resource_data.*` types.
3
+ //
4
+ // To refresh after a backend change, fetch the spec with:
5
+ // curl -H 'Referer: /api/v1/developer/' http://localhost:8000/api/v1/swagger/schema/
6
+ // and update the affected definitions here.
7
+ export {};
@@ -735,6 +735,52 @@
735
735
  "list.js"
736
736
  ]
737
737
  },
738
+ "paywalls:placements": {
739
+ "aliases": [],
740
+ "args": {
741
+ "paywall_id": {
742
+ "description": "Paywall ID (UUID)",
743
+ "name": "paywall_id",
744
+ "required": true
745
+ }
746
+ },
747
+ "description": "List placements that currently use this paywall",
748
+ "examples": [
749
+ "<%= config.bin %> paywalls placements --app UUID 770e8400-e29b-41d4-a716-446655440002"
750
+ ],
751
+ "flags": {
752
+ "json": {
753
+ "description": "Format output as json.",
754
+ "helpGroup": "GLOBAL",
755
+ "name": "json",
756
+ "allowNo": false,
757
+ "type": "boolean"
758
+ },
759
+ "app": {
760
+ "description": "App ID (UUID)",
761
+ "name": "app",
762
+ "required": true,
763
+ "hasDynamicHelp": false,
764
+ "multiple": false,
765
+ "type": "option"
766
+ }
767
+ },
768
+ "hasDynamicHelp": false,
769
+ "hiddenAliases": [],
770
+ "id": "paywalls:placements",
771
+ "pluginAlias": "adapty",
772
+ "pluginName": "adapty",
773
+ "pluginType": "core",
774
+ "strict": true,
775
+ "enableJsonFlag": true,
776
+ "isESM": true,
777
+ "relativePath": [
778
+ "dist",
779
+ "commands",
780
+ "paywalls",
781
+ "placements.js"
782
+ ]
783
+ },
738
784
  "paywalls:update": {
739
785
  "aliases": [],
740
786
  "args": {
@@ -802,7 +848,8 @@
802
848
  "args": {},
803
849
  "description": "Create a placement with a paywall",
804
850
  "examples": [
805
- "<%= config.bin %> placements create --app UUID --title \"Default\" --developer-id default --paywall-id UUID"
851
+ "<%= config.bin %> placements create --app UUID --title \"Default\" --developer-id default --audiences '[{\"segment_ids\":[],\"paywall_id\":\"PAYWALL_UUID\",\"priority\":0}]'",
852
+ "<%= config.bin %> placements create --app UUID --title \"Default\" --developer-id default --paywall-id PAYWALL_UUID"
806
853
  ],
807
854
  "flags": {
808
855
  "json": {
@@ -820,6 +867,13 @@
820
867
  "multiple": false,
821
868
  "type": "option"
822
869
  },
870
+ "audiences": {
871
+ "description": "JSON array of audience entries: [{segment_ids, paywall_id, priority}]",
872
+ "name": "audiences",
873
+ "hasDynamicHelp": false,
874
+ "multiple": false,
875
+ "type": "option"
876
+ },
823
877
  "developer-id": {
824
878
  "description": "Developer ID for the placement",
825
879
  "name": "developer-id",
@@ -829,9 +883,8 @@
829
883
  "type": "option"
830
884
  },
831
885
  "paywall-id": {
832
- "description": "Paywall ID (UUID)",
886
+ "description": "Paywall ID (UUID). DEPRECATED: use --audiences.",
833
887
  "name": "paywall-id",
834
- "required": true,
835
888
  "hasDynamicHelp": false,
836
889
  "multiple": false,
837
890
  "type": "option"
@@ -974,7 +1027,8 @@
974
1027
  },
975
1028
  "description": "Update a placement",
976
1029
  "examples": [
977
- "<%= config.bin %> placements update --app UUID 550e8400-... --title \"Default\" --developer-id default --paywall-id UUID"
1030
+ "<%= config.bin %> placements update --app UUID 550e8400-... --title \"Default\" --developer-id default --audiences '[{\"segment_ids\":[],\"paywall_id\":\"PAYWALL_UUID\",\"priority\":0}]'",
1031
+ "<%= config.bin %> placements update --app UUID 550e8400-... --title \"Default\" --developer-id default --paywall-id PAYWALL_UUID"
978
1032
  ],
979
1033
  "flags": {
980
1034
  "json": {
@@ -992,6 +1046,13 @@
992
1046
  "multiple": false,
993
1047
  "type": "option"
994
1048
  },
1049
+ "audiences": {
1050
+ "description": "JSON array of audience entries: [{segment_ids, paywall_id, priority}]",
1051
+ "name": "audiences",
1052
+ "hasDynamicHelp": false,
1053
+ "multiple": false,
1054
+ "type": "option"
1055
+ },
995
1056
  "developer-id": {
996
1057
  "description": "Developer ID for the placement",
997
1058
  "name": "developer-id",
@@ -1001,9 +1062,8 @@
1001
1062
  "type": "option"
1002
1063
  },
1003
1064
  "paywall-id": {
1004
- "description": "Paywall ID (UUID)",
1065
+ "description": "Paywall ID (UUID). DEPRECATED: use --audiences.",
1005
1066
  "name": "paywall-id",
1006
- "required": true,
1007
1067
  "hasDynamicHelp": false,
1008
1068
  "multiple": false,
1009
1069
  "type": "option"
@@ -1281,7 +1341,109 @@
1281
1341
  "products",
1282
1342
  "update.js"
1283
1343
  ]
1344
+ },
1345
+ "segments:get": {
1346
+ "aliases": [],
1347
+ "args": {
1348
+ "segment_id": {
1349
+ "description": "Segment ID (UUID)",
1350
+ "name": "segment_id",
1351
+ "required": true
1352
+ }
1353
+ },
1354
+ "description": "Get segment details",
1355
+ "examples": [
1356
+ "<%= config.bin %> segments get --app UUID 550e8400-e29b-41d4-a716-446655440000"
1357
+ ],
1358
+ "flags": {
1359
+ "json": {
1360
+ "description": "Format output as json.",
1361
+ "helpGroup": "GLOBAL",
1362
+ "name": "json",
1363
+ "allowNo": false,
1364
+ "type": "boolean"
1365
+ },
1366
+ "app": {
1367
+ "description": "App ID (UUID)",
1368
+ "name": "app",
1369
+ "required": true,
1370
+ "hasDynamicHelp": false,
1371
+ "multiple": false,
1372
+ "type": "option"
1373
+ }
1374
+ },
1375
+ "hasDynamicHelp": false,
1376
+ "hiddenAliases": [],
1377
+ "id": "segments:get",
1378
+ "pluginAlias": "adapty",
1379
+ "pluginName": "adapty",
1380
+ "pluginType": "core",
1381
+ "strict": true,
1382
+ "enableJsonFlag": true,
1383
+ "isESM": true,
1384
+ "relativePath": [
1385
+ "dist",
1386
+ "commands",
1387
+ "segments",
1388
+ "get.js"
1389
+ ]
1390
+ },
1391
+ "segments:list": {
1392
+ "aliases": [],
1393
+ "args": {},
1394
+ "description": "List segments for an app",
1395
+ "examples": [
1396
+ "<%= config.bin %> segments list --app 550e8400-..."
1397
+ ],
1398
+ "flags": {
1399
+ "json": {
1400
+ "description": "Format output as json.",
1401
+ "helpGroup": "GLOBAL",
1402
+ "name": "json",
1403
+ "allowNo": false,
1404
+ "type": "boolean"
1405
+ },
1406
+ "app": {
1407
+ "description": "App ID (UUID)",
1408
+ "name": "app",
1409
+ "required": true,
1410
+ "hasDynamicHelp": false,
1411
+ "multiple": false,
1412
+ "type": "option"
1413
+ },
1414
+ "page": {
1415
+ "description": "Page number",
1416
+ "name": "page",
1417
+ "default": 1,
1418
+ "hasDynamicHelp": false,
1419
+ "multiple": false,
1420
+ "type": "option"
1421
+ },
1422
+ "page-size": {
1423
+ "description": "Items per page (max 100)",
1424
+ "name": "page-size",
1425
+ "default": 20,
1426
+ "hasDynamicHelp": false,
1427
+ "multiple": false,
1428
+ "type": "option"
1429
+ }
1430
+ },
1431
+ "hasDynamicHelp": false,
1432
+ "hiddenAliases": [],
1433
+ "id": "segments:list",
1434
+ "pluginAlias": "adapty",
1435
+ "pluginName": "adapty",
1436
+ "pluginType": "core",
1437
+ "strict": true,
1438
+ "enableJsonFlag": true,
1439
+ "isESM": true,
1440
+ "relativePath": [
1441
+ "dist",
1442
+ "commands",
1443
+ "segments",
1444
+ "list.js"
1445
+ ]
1284
1446
  }
1285
1447
  },
1286
- "version": "0.1.4"
1448
+ "version": "0.2.0"
1287
1449
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adapty",
3
3
  "description": "Adapty command line interface",
4
- "version": "0.1.4",
4
+ "version": "0.2.0",
5
5
  "author": "Adapty team <support@adapty.io>",
6
6
  "bin": {
7
7
  "adapty": "./bin/run.js"
@@ -42,7 +42,7 @@
42
42
  "./dist",
43
43
  "./oclif.manifest.json"
44
44
  ],
45
- "homepage": "https://github.com/adaptyteam/adapty-cli",
45
+ "homepage": "https://adapty.io/docs/developer-cli",
46
46
  "keywords": [
47
47
  "adapty",
48
48
  "cli",
@@ -79,6 +79,9 @@
79
79
  },
80
80
  "placements": {
81
81
  "description": "Manage placements"
82
+ },
83
+ "segments": {
84
+ "description": "List segments"
82
85
  }
83
86
  }
84
87
  },