| import { Command } from '@oclif/core'; | ||
| import type { PlacementSummaryDTO } from '../../lib/api-schemas.js'; | ||
| interface PlacementsByPaywallResponse { | ||
| data: PlacementSummaryDTO[]; | ||
| } | ||
| export default class PaywallsPlacements extends Command { | ||
| static args: { | ||
| paywall_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>; | ||
| }; | ||
| static description: string; | ||
| static enableJsonFlag: boolean; | ||
| static examples: string[]; | ||
| static flags: { | ||
| app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| }; | ||
| run(): Promise<PlacementsByPaywallResponse>; | ||
| } | ||
| export {}; |
| import { Args, Command } from '@oclif/core'; | ||
| import { createAuthenticatedClient } from '../../lib/client-from-config.js'; | ||
| import { appFlag, isValidUuid } from '../../lib/flags.js'; | ||
| import { printList } from '../../lib/output.js'; | ||
| export default class PaywallsPlacements extends Command { | ||
| static args = { | ||
| paywall_id: Args.string({ description: 'Paywall ID (UUID)', required: true }), | ||
| }; | ||
| static description = 'List placements that currently use this paywall'; | ||
| static enableJsonFlag = true; | ||
| static examples = ['<%= config.bin %> paywalls placements --app UUID 770e8400-e29b-41d4-a716-446655440002']; | ||
| static flags = { | ||
| ...appFlag, | ||
| }; | ||
| async run() { | ||
| const { args, flags } = await this.parse(PaywallsPlacements); | ||
| if (!isValidUuid(args.paywall_id)) { | ||
| this.error('Invalid paywall ID format.', { exit: 2 }); | ||
| } | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.get(`/apps/${flags.app}/paywalls/${args.paywall_id}/placements`); | ||
| printList(result.data, this.log.bind(this)); | ||
| return result; | ||
| } | ||
| } |
| import { Command } from '@oclif/core'; | ||
| import type { SegmentDTO } from '../../lib/api-schemas.js'; | ||
| export default class SegmentsGet extends Command { | ||
| static args: { | ||
| segment_id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>; | ||
| }; | ||
| static description: string; | ||
| static enableJsonFlag: boolean; | ||
| static examples: string[]; | ||
| static flags: { | ||
| app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| }; | ||
| run(): Promise<SegmentDTO>; | ||
| } |
| import { Args, Command } from '@oclif/core'; | ||
| import { createAuthenticatedClient } from '../../lib/client-from-config.js'; | ||
| import { appFlag, isValidUuid } from '../../lib/flags.js'; | ||
| import { printResponse } from '../../lib/output.js'; | ||
| export default class SegmentsGet extends Command { | ||
| static args = { | ||
| segment_id: Args.string({ description: 'Segment ID (UUID)', required: true }), | ||
| }; | ||
| static description = 'Get segment details'; | ||
| static enableJsonFlag = true; | ||
| static examples = ['<%= config.bin %> segments get --app UUID 550e8400-e29b-41d4-a716-446655440000']; | ||
| static flags = { | ||
| ...appFlag, | ||
| }; | ||
| async run() { | ||
| const { args, flags } = await this.parse(SegmentsGet); | ||
| if (!isValidUuid(args.segment_id)) { | ||
| this.error('Invalid segment ID format.', { exit: 2 }); | ||
| } | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.get(`/apps/${flags.app}/segments/${args.segment_id}`); | ||
| printResponse(result, this.log.bind(this)); | ||
| return result; | ||
| } | ||
| } |
| import { Command } from '@oclif/core'; | ||
| import type { SegmentDTO } from '../../lib/api-schemas.js'; | ||
| import { type PaginatedResponse } from '../../lib/flags.js'; | ||
| export default class SegmentsList extends Command { | ||
| static description: string; | ||
| static enableJsonFlag: boolean; | ||
| static examples: string[]; | ||
| static flags: { | ||
| page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>; | ||
| 'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>; | ||
| app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| }; | ||
| run(): Promise<PaginatedResponse<SegmentDTO>>; | ||
| } |
| import { Command } from '@oclif/core'; | ||
| import { createAuthenticatedClient } from '../../lib/client-from-config.js'; | ||
| import { appFlag, paginationFlags, paginationParams } from '../../lib/flags.js'; | ||
| import { printList } from '../../lib/output.js'; | ||
| export default class SegmentsList extends Command { | ||
| static description = 'List segments for an app'; | ||
| static enableJsonFlag = true; | ||
| static examples = ['<%= config.bin %> segments list --app 550e8400-...']; | ||
| static flags = { | ||
| ...appFlag, | ||
| ...paginationFlags, | ||
| }; | ||
| async run() { | ||
| const { flags } = await this.parse(SegmentsList); | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.get(`/apps/${flags.app}/segments`, paginationParams(flags)); | ||
| printList(result.data, this.log.bind(this), result.meta.pagination); | ||
| return result; | ||
| } | ||
| } |
| export type ProductPeriod = 'annual' | 'consumable' | 'lifetime' | 'monthly' | 'nonsubscriptions' | 'semiannual' | 'trimonthly' | 'two_months' | 'uncategorised' | 'weekly'; | ||
| export interface VendorProductDTO { | ||
| base_plan_id: null | string; | ||
| id: null | string; | ||
| product_id: null | string; | ||
| } | ||
| export interface AppSummaryDTO { | ||
| id: string; | ||
| sdk_key: null | string; | ||
| title: string; | ||
| } | ||
| export interface AppDetailDTO { | ||
| apple_bundle_id: null | string; | ||
| google_bundle_id: null | string; | ||
| id: string; | ||
| platforms: string[]; | ||
| sdk_key: null | string; | ||
| secret_key: null | string; | ||
| title: string; | ||
| } | ||
| export interface AppCreateRequestDTO { | ||
| apple_bundle_id?: null | string; | ||
| google_bundle_id?: null | string; | ||
| title: string; | ||
| } | ||
| export interface AppUpdateRequestDTO { | ||
| apple_bundle_id?: null | string; | ||
| google_bundle_id?: null | string; | ||
| title?: null | string; | ||
| } | ||
| export interface AccessLevelDTO { | ||
| id: string; | ||
| sdk_id: string; | ||
| title: null | string; | ||
| } | ||
| export interface AccessLevelCreateRequestDTO { | ||
| sdk_id: string; | ||
| title?: null | string; | ||
| } | ||
| export interface AccessLevelUpdateRequestDTO { | ||
| title?: null | string; | ||
| } | ||
| export interface ProductDTO { | ||
| access_level_id: string; | ||
| id: string; | ||
| period: ProductPeriod; | ||
| title: string; | ||
| vendor_products: Record<string, VendorProductDTO>; | ||
| } | ||
| export interface ProductCreateRequestDTO { | ||
| access_level_id: string; | ||
| android_base_plan_id?: null | string; | ||
| android_product_id?: null | string; | ||
| ios_product_id?: null | string; | ||
| period: ProductPeriod; | ||
| price_usd?: null | number; | ||
| title: string; | ||
| } | ||
| export interface ProductUpdateRequestDTO { | ||
| access_level_id: string; | ||
| title: string; | ||
| } | ||
| export interface PaywallDTO { | ||
| id: string; | ||
| product_ids: string[]; | ||
| title: string; | ||
| } | ||
| export interface PaywallWriteRequestDTO { | ||
| product_ids?: string[]; | ||
| title: string; | ||
| } | ||
| export interface SegmentDTO { | ||
| description: null | string; | ||
| id: string; | ||
| title: string; | ||
| } | ||
| export interface PlacementAudienceEntryDTO { | ||
| paywall_id: string; | ||
| priority: number; | ||
| segment_ids?: string[]; | ||
| } | ||
| export interface PlacementSummaryDTO { | ||
| developer_id: string; | ||
| id: string; | ||
| title: string; | ||
| } | ||
| export interface PlacementDetailDTO { | ||
| audiences?: PlacementAudienceEntryDTO[]; | ||
| developer_id: string; | ||
| id: string; | ||
| title: string; | ||
| } | ||
| export interface PlacementWriteRequestDTO { | ||
| audiences: null | PlacementAudienceEntryDTO[]; | ||
| developer_id: string; | ||
| /** @deprecated use `audiences` */ | ||
| paywall_id: null | string; | ||
| title: string; | ||
| } |
| // Hand-picked DTOs from the Adapty Developer API OpenAPI schema. Kept in | ||
| // lockstep with the server-side `portal.developer_api_context.domains.data_transfer_objects.resource_data.*` types. | ||
| // | ||
| // To refresh after a backend change, fetch the spec with: | ||
| // curl -H 'Referer: /api/v1/developer/' http://localhost:8000/api/v1/swagger/schema/ | ||
| // and update the affected definitions here. | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { AccessLevelDTO } from '../../lib/api-schemas.js'; | ||
| export default class AccessLevelsCreate extends Command { | ||
@@ -11,3 +12,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<AccessLevelDTO>; | ||
| } |
@@ -19,6 +19,7 @@ import { Command, Flags } from '@oclif/core'; | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.post(`/apps/${flags.app}/access-levels`, { | ||
| const body = { | ||
| sdk_id: flags['sdk-id'], | ||
| title: flags.title, | ||
| }); | ||
| }; | ||
| const result = await client.post(`/apps/${flags.app}/access-levels`, body); | ||
| this.log('Access level created!'); | ||
@@ -25,0 +26,0 @@ printResponse(result, this.log.bind(this)); |
| import { Command } from '@oclif/core'; | ||
| interface AccessLevelDetailResponse { | ||
| id: string; | ||
| sdk_id: string; | ||
| title: string; | ||
| } | ||
| import type { AccessLevelDTO } from '../../lib/api-schemas.js'; | ||
| export default class AccessLevelsGet extends Command { | ||
@@ -17,4 +13,3 @@ static args: { | ||
| }; | ||
| run(): Promise<AccessLevelDetailResponse>; | ||
| run(): Promise<AccessLevelDTO>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { AccessLevelDTO } from '../../lib/api-schemas.js'; | ||
| import { type PaginatedResponse } from '../../lib/flags.js'; | ||
| interface AccessLevelItem { | ||
| id: string; | ||
| sdk_id: string; | ||
| title: string; | ||
| } | ||
| export default class AccessLevelsList extends Command { | ||
@@ -17,4 +13,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<PaginatedResponse<AccessLevelItem>>; | ||
| run(): Promise<PaginatedResponse<AccessLevelDTO>>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { AccessLevelDTO } from '../../lib/api-schemas.js'; | ||
| export default class AccessLevelsUpdate extends Command { | ||
@@ -13,3 +14,3 @@ static args: { | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<AccessLevelDTO>; | ||
| } |
@@ -24,5 +24,6 @@ import { Args, Command, Flags } from '@oclif/core'; | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.put(`/apps/${flags.app}/access-levels/${args.access_level_id}`, { | ||
| const body = { | ||
| title: flags.title, | ||
| }); | ||
| }; | ||
| const result = await client.put(`/apps/${flags.app}/access-levels/${args.access_level_id}`, body); | ||
| this.log('Access level updated!'); | ||
@@ -29,0 +30,0 @@ printResponse(result, this.log.bind(this)); |
| import { Command } from '@oclif/core'; | ||
| import type { AppSummaryDTO } from '../../lib/api-schemas.js'; | ||
| export default class AppsCreate extends Command { | ||
@@ -12,3 +13,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<AppSummaryDTO>; | ||
| } |
@@ -42,6 +42,5 @@ import { Command, Flags } from '@oclif/core'; | ||
| printResponse(result, this.log.bind(this)); | ||
| // Fetch default access level for the new app | ||
| try { | ||
| const accessLevels = await client.get(`/apps/${result.id}/access-levels`); | ||
| if (accessLevels.items?.length > 0) { | ||
| if (accessLevels.items?.length) { | ||
| this.log('\nDefault access level:'); | ||
@@ -48,0 +47,0 @@ printResponse(accessLevels.items[0], this.log.bind(this)); |
| import { Command } from '@oclif/core'; | ||
| interface AppDetailResponse { | ||
| apple_bundle_id?: string; | ||
| google_bundle_id?: string; | ||
| id: string; | ||
| platforms: string[]; | ||
| sdk_key: string; | ||
| secret_key: string; | ||
| title: string; | ||
| } | ||
| import type { AppDetailDTO } from '../../lib/api-schemas.js'; | ||
| export default class AppsGet extends Command { | ||
@@ -18,4 +10,3 @@ static args: { | ||
| static examples: string[]; | ||
| run(): Promise<AppDetailResponse>; | ||
| run(): Promise<AppDetailDTO>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { AppSummaryDTO } from '../../lib/api-schemas.js'; | ||
| import { type PaginatedResponse } from '../../lib/flags.js'; | ||
| interface AppItem { | ||
| id: string; | ||
| sdk_key: string; | ||
| title: string; | ||
| } | ||
| export default class AppsList extends Command { | ||
@@ -16,4 +12,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<PaginatedResponse<AppItem>>; | ||
| run(): Promise<PaginatedResponse<AppSummaryDTO>>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| interface AppResponse { | ||
| apple_bundle_id?: string; | ||
| google_bundle_id?: string; | ||
| id: string; | ||
| title: string; | ||
| } | ||
| import type { AppDetailDTO } from '../../lib/api-schemas.js'; | ||
| export default class AppsUpdate extends Command { | ||
@@ -20,4 +15,3 @@ static args: { | ||
| }; | ||
| run(): Promise<AppResponse>; | ||
| run(): Promise<AppDetailDTO>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { PaywallDTO } from '../../lib/api-schemas.js'; | ||
| export default class PaywallsCreate extends Command { | ||
@@ -11,3 +12,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<PaywallDTO>; | ||
| } |
@@ -23,6 +23,7 @@ import { Command, Flags } from '@oclif/core'; | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.post(`/apps/${flags.app}/paywalls`, { | ||
| const body = { | ||
| product_ids: flags['product-id'], | ||
| title: flags.title, | ||
| }); | ||
| }; | ||
| const result = await client.post(`/apps/${flags.app}/paywalls`, body); | ||
| this.log('Paywall created!'); | ||
@@ -29,0 +30,0 @@ printResponse(result, this.log.bind(this)); |
| import { Command } from '@oclif/core'; | ||
| interface PaywallDetailResponse { | ||
| id: string; | ||
| product_ids: string[]; | ||
| title: string; | ||
| } | ||
| import type { PaywallDTO } from '../../lib/api-schemas.js'; | ||
| export default class PaywallsGet extends Command { | ||
@@ -17,4 +13,3 @@ static args: { | ||
| }; | ||
| run(): Promise<PaywallDetailResponse>; | ||
| run(): Promise<PaywallDTO>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { PaywallDTO } from '../../lib/api-schemas.js'; | ||
| import { type PaginatedResponse } from '../../lib/flags.js'; | ||
| interface PaywallItem { | ||
| id: string; | ||
| title: string; | ||
| } | ||
| export default class PaywallsList extends Command { | ||
@@ -16,4 +13,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<PaginatedResponse<PaywallItem>>; | ||
| run(): Promise<PaginatedResponse<PaywallDTO>>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { PaywallDTO } from '../../lib/api-schemas.js'; | ||
| export default class PaywallsUpdate extends Command { | ||
@@ -14,3 +15,3 @@ static args: { | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<PaywallDTO>; | ||
| } |
@@ -29,6 +29,7 @@ import { Args, Command, Flags } from '@oclif/core'; | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.put(`/apps/${flags.app}/paywalls/${args.paywall_id}`, { | ||
| const body = { | ||
| product_ids: flags['product-id'], | ||
| title: flags.title, | ||
| }); | ||
| }; | ||
| const result = await client.put(`/apps/${flags.app}/paywalls/${args.paywall_id}`, body); | ||
| this.log('Paywall updated!'); | ||
@@ -35,0 +36,0 @@ printResponse(result, this.log.bind(this)); |
| import { Command } from '@oclif/core'; | ||
| import type { PlacementDetailDTO } from '../../lib/api-schemas.js'; | ||
| export default class PlacementsCreate extends Command { | ||
@@ -7,8 +8,9 @@ static description: string; | ||
| static flags: { | ||
| audiences: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>; | ||
| 'developer-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| 'paywall-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| 'paywall-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>; | ||
| title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<PlacementDetailDTO>; | ||
| } |
@@ -9,8 +9,16 @@ import { Command, Flags } from '@oclif/core'; | ||
| static examples = [ | ||
| '<%= config.bin %> placements create --app UUID --title "Default" --developer-id default --paywall-id UUID', | ||
| '<%= config.bin %> placements create --app UUID --title "Default" --developer-id default --audiences \'[{"segment_ids":[],"paywall_id":"PAYWALL_UUID","priority":0}]\'', | ||
| '<%= config.bin %> placements create --app UUID --title "Default" --developer-id default --paywall-id PAYWALL_UUID', | ||
| ]; | ||
| static flags = { | ||
| ...appFlag, | ||
| audiences: Flags.string({ | ||
| description: 'JSON array of audience entries: [{segment_ids, paywall_id, priority}]', | ||
| exactlyOne: ['paywall-id', 'audiences'], | ||
| }), | ||
| 'developer-id': Flags.string({ description: 'Developer ID for the placement', required: true }), | ||
| 'paywall-id': Flags.string({ description: 'Paywall ID (UUID)', required: true }), | ||
| 'paywall-id': Flags.string({ | ||
| description: 'Paywall ID (UUID). DEPRECATED: use --audiences.', | ||
| exactlyOne: ['paywall-id', 'audiences'], | ||
| }), | ||
| title: Flags.string({ description: 'Placement title', required: true }), | ||
@@ -20,8 +28,23 @@ }; | ||
| const { flags } = await this.parse(PlacementsCreate); | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.post(`/apps/${flags.app}/placements`, { | ||
| const body = { | ||
| audiences: null, | ||
| developer_id: flags['developer-id'], | ||
| paywall_id: flags['paywall-id'], | ||
| paywall_id: null, | ||
| title: flags.title, | ||
| }); | ||
| }; | ||
| if (flags['paywall-id']) { | ||
| process.stderr.write('⚠️ --paywall-id is deprecated. Use --audiences instead.\n' + | ||
| ' `paywall_id` will be removed from the API in a future release.\n'); | ||
| body.paywall_id = flags['paywall-id']; | ||
| } | ||
| else { | ||
| try { | ||
| body.audiences = JSON.parse(flags.audiences); | ||
| } | ||
| catch (error) { | ||
| this.error(`Invalid --audiences JSON: ${error instanceof Error ? error.message : String(error)}`, { exit: 2 }); | ||
| } | ||
| } | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.post(`/apps/${flags.app}/placements`, body); | ||
| this.log('Placement created!'); | ||
@@ -28,0 +51,0 @@ printResponse(result, this.log.bind(this)); |
| import { Command } from '@oclif/core'; | ||
| interface PlacementDetailResponse { | ||
| developer_id: string; | ||
| id: string; | ||
| paywall_id: string; | ||
| title: string; | ||
| } | ||
| import type { PlacementDetailDTO } from '../../lib/api-schemas.js'; | ||
| export default class PlacementsGet extends Command { | ||
@@ -18,4 +13,3 @@ static args: { | ||
| }; | ||
| run(): Promise<PlacementDetailResponse>; | ||
| run(): Promise<PlacementDetailDTO>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { PlacementSummaryDTO } from '../../lib/api-schemas.js'; | ||
| import { type PaginatedResponse } from '../../lib/flags.js'; | ||
| interface PlacementItem { | ||
| developer_id: string; | ||
| id: string; | ||
| title: string; | ||
| } | ||
| export default class PlacementsList extends Command { | ||
@@ -17,4 +13,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<PaginatedResponse<PlacementItem>>; | ||
| run(): Promise<PaginatedResponse<PlacementSummaryDTO>>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { PlacementDetailDTO } from '../../lib/api-schemas.js'; | ||
| export default class PlacementsUpdate extends Command { | ||
@@ -10,8 +11,9 @@ static args: { | ||
| static flags: { | ||
| audiences: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>; | ||
| 'developer-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| 'paywall-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| 'paywall-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>; | ||
| title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>; | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<PlacementDetailDTO>; | ||
| } |
@@ -12,8 +12,16 @@ import { Args, Command, Flags } from '@oclif/core'; | ||
| static examples = [ | ||
| '<%= config.bin %> placements update --app UUID 550e8400-... --title "Default" --developer-id default --paywall-id UUID', | ||
| '<%= config.bin %> placements update --app UUID 550e8400-... --title "Default" --developer-id default --audiences \'[{"segment_ids":[],"paywall_id":"PAYWALL_UUID","priority":0}]\'', | ||
| '<%= config.bin %> placements update --app UUID 550e8400-... --title "Default" --developer-id default --paywall-id PAYWALL_UUID', | ||
| ]; | ||
| static flags = { | ||
| ...appFlag, | ||
| audiences: Flags.string({ | ||
| description: 'JSON array of audience entries: [{segment_ids, paywall_id, priority}]', | ||
| exactlyOne: ['paywall-id', 'audiences'], | ||
| }), | ||
| 'developer-id': Flags.string({ description: 'Developer ID for the placement', required: true }), | ||
| 'paywall-id': Flags.string({ description: 'Paywall ID (UUID)', required: true }), | ||
| 'paywall-id': Flags.string({ | ||
| description: 'Paywall ID (UUID). DEPRECATED: use --audiences.', | ||
| exactlyOne: ['paywall-id', 'audiences'], | ||
| }), | ||
| title: Flags.string({ description: 'Placement title', required: true }), | ||
@@ -26,8 +34,26 @@ }; | ||
| } | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.put(`/apps/${flags.app}/placements/${args.placement_id}`, { | ||
| const body = { | ||
| audiences: null, | ||
| developer_id: flags['developer-id'], | ||
| paywall_id: flags['paywall-id'], | ||
| paywall_id: null, | ||
| title: flags.title, | ||
| }); | ||
| }; | ||
| if (flags['paywall-id']) { | ||
| process.stderr.write('⚠️ --paywall-id is deprecated. Use --audiences instead.\n' + | ||
| ' `paywall_id` will be removed from the API in a future release.\n'); | ||
| process.stderr.write('⚠️ --paywall-id will rewrite all audiences on this placement.\n' + | ||
| ' If the placement has segment-specific paywalls, they will be replaced\n' + | ||
| ' by a single default audience. Use --audiences to preserve them.\n'); | ||
| body.paywall_id = flags['paywall-id']; | ||
| } | ||
| else { | ||
| try { | ||
| body.audiences = JSON.parse(flags.audiences); | ||
| } | ||
| catch (error) { | ||
| this.error(`Invalid --audiences JSON: ${error instanceof Error ? error.message : String(error)}`, { exit: 2 }); | ||
| } | ||
| } | ||
| const client = await createAuthenticatedClient(this.config); | ||
| const result = await client.put(`/apps/${flags.app}/placements/${args.placement_id}`, body); | ||
| this.log('Placement updated!'); | ||
@@ -34,0 +60,0 @@ printResponse(result, this.log.bind(this)); |
| import { Command } from '@oclif/core'; | ||
| import type { ProductDTO } from '../../lib/api-schemas.js'; | ||
| export default class ProductsCreate extends Command { | ||
@@ -15,3 +16,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<ProductDTO>; | ||
| } |
@@ -5,3 +5,11 @@ import { Command, Flags } from '@oclif/core'; | ||
| import { printResponse } from '../../lib/output.js'; | ||
| const VALID_PERIODS = ['weekly', 'monthly', 'two_months', 'trimonthly', 'semiannual', 'annual', 'lifetime']; | ||
| const VALID_PERIODS = [ | ||
| 'weekly', | ||
| 'monthly', | ||
| 'two_months', | ||
| 'trimonthly', | ||
| 'semiannual', | ||
| 'annual', | ||
| 'lifetime', | ||
| ]; | ||
| export default class ProductsCreate extends Command { | ||
@@ -8,0 +16,0 @@ static description = 'Create a product with vendor products per platform'; |
| import { Command } from '@oclif/core'; | ||
| interface ProductDetailResponse { | ||
| access_level_id: string; | ||
| id: string; | ||
| period: string; | ||
| title: string; | ||
| vendor_products: Record<string, unknown>; | ||
| } | ||
| import type { ProductDTO } from '../../lib/api-schemas.js'; | ||
| export default class ProductsGet extends Command { | ||
@@ -19,4 +13,3 @@ static args: { | ||
| }; | ||
| run(): Promise<ProductDetailResponse>; | ||
| run(): Promise<ProductDTO>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { ProductDTO } from '../../lib/api-schemas.js'; | ||
| import { type PaginatedResponse } from '../../lib/flags.js'; | ||
| interface ProductItem { | ||
| id: string; | ||
| title: string; | ||
| vendor_products: Record<string, unknown>; | ||
| } | ||
| export default class ProductsList extends Command { | ||
@@ -17,4 +13,3 @@ static description: string; | ||
| }; | ||
| run(): Promise<PaginatedResponse<ProductItem>>; | ||
| run(): Promise<PaginatedResponse<ProductDTO>>; | ||
| } | ||
| export {}; |
| import { Command } from '@oclif/core'; | ||
| import type { ProductDTO } from '../../lib/api-schemas.js'; | ||
| export default class ProductsUpdate extends Command { | ||
@@ -14,3 +15,3 @@ static args: { | ||
| }; | ||
| run(): Promise<Record<string, unknown>>; | ||
| run(): Promise<ProductDTO>; | ||
| } |
+284
-122
| { | ||
| "commands": { | ||
| "apps:create": { | ||
| "access-levels:create": { | ||
| "aliases": [], | ||
| "args": {}, | ||
| "description": "Create a new Adapty app", | ||
| "description": "Create a custom access level", | ||
| "examples": [ | ||
| "<%= config.bin %> apps create --title \"My App\" --platform ios --apple-bundle-id com.example.app", | ||
| "<%= config.bin %> apps create --title \"My App\" --platform ios --platform android --apple-bundle-id com.example.app --google-bundle-id com.example.app" | ||
| "<%= config.bin %> access-levels create --app 550e8400-... --sdk-id vip --title \"VIP Access\"" | ||
| ], | ||
@@ -19,5 +18,6 @@ "flags": { | ||
| }, | ||
| "apple-bundle-id": { | ||
| "description": "Apple bundle ID (required with --platform ios)", | ||
| "name": "apple-bundle-id", | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
@@ -27,5 +27,6 @@ "multiple": false, | ||
| }, | ||
| "google-bundle-id": { | ||
| "description": "Google bundle ID (required with --platform android)", | ||
| "name": "google-bundle-id", | ||
| "sdk-id": { | ||
| "description": "Access level SDK identifier", | ||
| "name": "sdk-id", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
@@ -35,16 +36,4 @@ "multiple": false, | ||
| }, | ||
| "platform": { | ||
| "description": "Platform (ios, android). Repeat for multiple.", | ||
| "name": "platform", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": true, | ||
| "options": [ | ||
| "ios", | ||
| "android" | ||
| ], | ||
| "type": "option" | ||
| }, | ||
| "title": { | ||
| "description": "App title", | ||
| "description": "Access level title", | ||
| "name": "title", | ||
@@ -59,3 +48,3 @@ "required": true, | ||
| "hiddenAliases": [], | ||
| "id": "apps:create", | ||
| "id": "access-levels:create", | ||
| "pluginAlias": "adapty", | ||
@@ -70,18 +59,18 @@ "pluginName": "adapty", | ||
| "commands", | ||
| "apps", | ||
| "access-levels", | ||
| "create.js" | ||
| ] | ||
| }, | ||
| "apps:get": { | ||
| "access-levels:get": { | ||
| "aliases": [], | ||
| "args": { | ||
| "app_id": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app_id", | ||
| "access_level_id": { | ||
| "description": "Access Level ID (UUID)", | ||
| "name": "access_level_id", | ||
| "required": true | ||
| } | ||
| }, | ||
| "description": "Get app details", | ||
| "description": "Get access level details", | ||
| "examples": [ | ||
| "<%= config.bin %> apps get 550e8400-e29b-41d4-a716-446655440000" | ||
| "<%= config.bin %> access-levels get --app UUID 550e8400-e29b-41d4-a716-446655440000" | ||
| ], | ||
@@ -95,2 +84,10 @@ "flags": { | ||
| "type": "boolean" | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| } | ||
@@ -100,3 +97,3 @@ }, | ||
| "hiddenAliases": [], | ||
| "id": "apps:get", | ||
| "id": "access-levels:get", | ||
| "pluginAlias": "adapty", | ||
@@ -111,13 +108,12 @@ "pluginName": "adapty", | ||
| "commands", | ||
| "apps", | ||
| "access-levels", | ||
| "get.js" | ||
| ] | ||
| }, | ||
| "apps:list": { | ||
| "access-levels:list": { | ||
| "aliases": [], | ||
| "args": {}, | ||
| "description": "List Adapty apps", | ||
| "description": "List access levels for an app", | ||
| "examples": [ | ||
| "<%= config.bin %> apps list", | ||
| "<%= config.bin %> apps list --page 2 --page-size 10" | ||
| "<%= config.bin %> access-levels list --app 550e8400-e29b-41d4-a716-446655440000" | ||
| ], | ||
@@ -132,2 +128,10 @@ "flags": { | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| }, | ||
| "page": { | ||
@@ -152,3 +156,3 @@ "description": "Page number", | ||
| "hiddenAliases": [], | ||
| "id": "apps:list", | ||
| "id": "access-levels:list", | ||
| "pluginAlias": "adapty", | ||
@@ -163,18 +167,18 @@ "pluginName": "adapty", | ||
| "commands", | ||
| "apps", | ||
| "access-levels", | ||
| "list.js" | ||
| ] | ||
| }, | ||
| "apps:update": { | ||
| "access-levels:update": { | ||
| "aliases": [], | ||
| "args": { | ||
| "app_id": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app_id", | ||
| "access_level_id": { | ||
| "description": "Access Level ID (UUID)", | ||
| "name": "access_level_id", | ||
| "required": true | ||
| } | ||
| }, | ||
| "description": "Update an app", | ||
| "description": "Update an access level", | ||
| "examples": [ | ||
| "<%= config.bin %> apps update 550e8400-... --title \"My App\"" | ||
| "<%= config.bin %> access-levels update --app UUID 550e8400-... --title \"VIP Access\"" | ||
| ], | ||
@@ -189,5 +193,6 @@ "flags": { | ||
| }, | ||
| "apple-bundle-id": { | ||
| "description": "Apple bundle ID", | ||
| "name": "apple-bundle-id", | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
@@ -197,12 +202,6 @@ "multiple": false, | ||
| }, | ||
| "google-bundle-id": { | ||
| "description": "Google bundle ID", | ||
| "name": "google-bundle-id", | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| }, | ||
| "title": { | ||
| "description": "App title", | ||
| "description": "Access level title", | ||
| "name": "title", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
@@ -215,3 +214,3 @@ "multiple": false, | ||
| "hiddenAliases": [], | ||
| "id": "apps:update", | ||
| "id": "access-levels:update", | ||
| "pluginAlias": "adapty", | ||
@@ -226,12 +225,13 @@ "pluginName": "adapty", | ||
| "commands", | ||
| "apps", | ||
| "access-levels", | ||
| "update.js" | ||
| ] | ||
| }, | ||
| "access-levels:create": { | ||
| "apps:create": { | ||
| "aliases": [], | ||
| "args": {}, | ||
| "description": "Create a custom access level", | ||
| "description": "Create a new Adapty app", | ||
| "examples": [ | ||
| "<%= config.bin %> access-levels create --app 550e8400-... --sdk-id vip --title \"VIP Access\"" | ||
| "<%= config.bin %> apps create --title \"My App\" --platform ios --apple-bundle-id com.example.app", | ||
| "<%= config.bin %> apps create --title \"My App\" --platform ios --platform android --apple-bundle-id com.example.app --google-bundle-id com.example.app" | ||
| ], | ||
@@ -246,6 +246,5 @@ "flags": { | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "apple-bundle-id": { | ||
| "description": "Apple bundle ID (required with --platform ios)", | ||
| "name": "apple-bundle-id", | ||
| "hasDynamicHelp": false, | ||
@@ -255,6 +254,5 @@ "multiple": false, | ||
| }, | ||
| "sdk-id": { | ||
| "description": "Access level SDK identifier", | ||
| "name": "sdk-id", | ||
| "required": true, | ||
| "google-bundle-id": { | ||
| "description": "Google bundle ID (required with --platform android)", | ||
| "name": "google-bundle-id", | ||
| "hasDynamicHelp": false, | ||
@@ -264,4 +262,16 @@ "multiple": false, | ||
| }, | ||
| "platform": { | ||
| "description": "Platform (ios, android). Repeat for multiple.", | ||
| "name": "platform", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": true, | ||
| "options": [ | ||
| "ios", | ||
| "android" | ||
| ], | ||
| "type": "option" | ||
| }, | ||
| "title": { | ||
| "description": "Access level title", | ||
| "description": "App title", | ||
| "name": "title", | ||
@@ -276,3 +286,3 @@ "required": true, | ||
| "hiddenAliases": [], | ||
| "id": "access-levels:create", | ||
| "id": "apps:create", | ||
| "pluginAlias": "adapty", | ||
@@ -287,18 +297,18 @@ "pluginName": "adapty", | ||
| "commands", | ||
| "access-levels", | ||
| "apps", | ||
| "create.js" | ||
| ] | ||
| }, | ||
| "access-levels:get": { | ||
| "apps:get": { | ||
| "aliases": [], | ||
| "args": { | ||
| "access_level_id": { | ||
| "description": "Access Level ID (UUID)", | ||
| "name": "access_level_id", | ||
| "app_id": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app_id", | ||
| "required": true | ||
| } | ||
| }, | ||
| "description": "Get access level details", | ||
| "description": "Get app details", | ||
| "examples": [ | ||
| "<%= config.bin %> access-levels get --app UUID 550e8400-e29b-41d4-a716-446655440000" | ||
| "<%= config.bin %> apps get 550e8400-e29b-41d4-a716-446655440000" | ||
| ], | ||
@@ -312,10 +322,2 @@ "flags": { | ||
| "type": "boolean" | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| } | ||
@@ -325,3 +327,3 @@ }, | ||
| "hiddenAliases": [], | ||
| "id": "access-levels:get", | ||
| "id": "apps:get", | ||
| "pluginAlias": "adapty", | ||
@@ -336,12 +338,13 @@ "pluginName": "adapty", | ||
| "commands", | ||
| "access-levels", | ||
| "apps", | ||
| "get.js" | ||
| ] | ||
| }, | ||
| "access-levels:list": { | ||
| "apps:list": { | ||
| "aliases": [], | ||
| "args": {}, | ||
| "description": "List access levels for an app", | ||
| "description": "List Adapty apps", | ||
| "examples": [ | ||
| "<%= config.bin %> access-levels list --app 550e8400-e29b-41d4-a716-446655440000" | ||
| "<%= config.bin %> apps list", | ||
| "<%= config.bin %> apps list --page 2 --page-size 10" | ||
| ], | ||
@@ -356,10 +359,2 @@ "flags": { | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| }, | ||
| "page": { | ||
@@ -384,3 +379,3 @@ "description": "Page number", | ||
| "hiddenAliases": [], | ||
| "id": "access-levels:list", | ||
| "id": "apps:list", | ||
| "pluginAlias": "adapty", | ||
@@ -395,18 +390,18 @@ "pluginName": "adapty", | ||
| "commands", | ||
| "access-levels", | ||
| "apps", | ||
| "list.js" | ||
| ] | ||
| }, | ||
| "access-levels:update": { | ||
| "apps:update": { | ||
| "aliases": [], | ||
| "args": { | ||
| "access_level_id": { | ||
| "description": "Access Level ID (UUID)", | ||
| "name": "access_level_id", | ||
| "app_id": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app_id", | ||
| "required": true | ||
| } | ||
| }, | ||
| "description": "Update an access level", | ||
| "description": "Update an app", | ||
| "examples": [ | ||
| "<%= config.bin %> access-levels update --app UUID 550e8400-... --title \"VIP Access\"" | ||
| "<%= config.bin %> apps update 550e8400-... --title \"My App\"" | ||
| ], | ||
@@ -421,6 +416,5 @@ "flags": { | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "apple-bundle-id": { | ||
| "description": "Apple bundle ID", | ||
| "name": "apple-bundle-id", | ||
| "hasDynamicHelp": false, | ||
@@ -430,6 +424,12 @@ "multiple": false, | ||
| }, | ||
| "google-bundle-id": { | ||
| "description": "Google bundle ID", | ||
| "name": "google-bundle-id", | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| }, | ||
| "title": { | ||
| "description": "Access level title", | ||
| "description": "App title", | ||
| "name": "title", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
@@ -442,3 +442,3 @@ "multiple": false, | ||
| "hiddenAliases": [], | ||
| "id": "access-levels:update", | ||
| "id": "apps:update", | ||
| "pluginAlias": "adapty", | ||
@@ -453,3 +453,3 @@ "pluginName": "adapty", | ||
| "commands", | ||
| "access-levels", | ||
| "apps", | ||
| "update.js" | ||
@@ -768,2 +768,48 @@ ] | ||
| }, | ||
| "paywalls:placements": { | ||
| "aliases": [], | ||
| "args": { | ||
| "paywall_id": { | ||
| "description": "Paywall ID (UUID)", | ||
| "name": "paywall_id", | ||
| "required": true | ||
| } | ||
| }, | ||
| "description": "List placements that currently use this paywall", | ||
| "examples": [ | ||
| "<%= config.bin %> paywalls placements --app UUID 770e8400-e29b-41d4-a716-446655440002" | ||
| ], | ||
| "flags": { | ||
| "json": { | ||
| "description": "Format output as json.", | ||
| "helpGroup": "GLOBAL", | ||
| "name": "json", | ||
| "allowNo": false, | ||
| "type": "boolean" | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| } | ||
| }, | ||
| "hasDynamicHelp": false, | ||
| "hiddenAliases": [], | ||
| "id": "paywalls:placements", | ||
| "pluginAlias": "adapty", | ||
| "pluginName": "adapty", | ||
| "pluginType": "core", | ||
| "strict": true, | ||
| "enableJsonFlag": true, | ||
| "isESM": true, | ||
| "relativePath": [ | ||
| "dist", | ||
| "commands", | ||
| "paywalls", | ||
| "placements.js" | ||
| ] | ||
| }, | ||
| "paywalls:update": { | ||
@@ -836,3 +882,4 @@ "aliases": [], | ||
| "examples": [ | ||
| "<%= config.bin %> placements create --app UUID --title \"Default\" --developer-id default --paywall-id UUID" | ||
| "<%= config.bin %> placements create --app UUID --title \"Default\" --developer-id default --audiences '[{\"segment_ids\":[],\"paywall_id\":\"PAYWALL_UUID\",\"priority\":0}]'", | ||
| "<%= config.bin %> placements create --app UUID --title \"Default\" --developer-id default --paywall-id PAYWALL_UUID" | ||
| ], | ||
@@ -855,2 +902,9 @@ "flags": { | ||
| }, | ||
| "audiences": { | ||
| "description": "JSON array of audience entries: [{segment_ids, paywall_id, priority}]", | ||
| "name": "audiences", | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| }, | ||
| "developer-id": { | ||
@@ -865,5 +919,4 @@ "description": "Developer ID for the placement", | ||
| "paywall-id": { | ||
| "description": "Paywall ID (UUID)", | ||
| "description": "Paywall ID (UUID). DEPRECATED: use --audiences.", | ||
| "name": "paywall-id", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
@@ -1011,3 +1064,4 @@ "multiple": false, | ||
| "examples": [ | ||
| "<%= config.bin %> placements update --app UUID 550e8400-... --title \"Default\" --developer-id default --paywall-id UUID" | ||
| "<%= config.bin %> placements update --app UUID 550e8400-... --title \"Default\" --developer-id default --audiences '[{\"segment_ids\":[],\"paywall_id\":\"PAYWALL_UUID\",\"priority\":0}]'", | ||
| "<%= config.bin %> placements update --app UUID 550e8400-... --title \"Default\" --developer-id default --paywall-id PAYWALL_UUID" | ||
| ], | ||
@@ -1030,2 +1084,9 @@ "flags": { | ||
| }, | ||
| "audiences": { | ||
| "description": "JSON array of audience entries: [{segment_ids, paywall_id, priority}]", | ||
| "name": "audiences", | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| }, | ||
| "developer-id": { | ||
@@ -1040,5 +1101,4 @@ "description": "Developer ID for the placement", | ||
| "paywall-id": { | ||
| "description": "Paywall ID (UUID)", | ||
| "description": "Paywall ID (UUID). DEPRECATED: use --audiences.", | ||
| "name": "paywall-id", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
@@ -1321,5 +1381,107 @@ "multiple": false, | ||
| ] | ||
| }, | ||
| "segments:get": { | ||
| "aliases": [], | ||
| "args": { | ||
| "segment_id": { | ||
| "description": "Segment ID (UUID)", | ||
| "name": "segment_id", | ||
| "required": true | ||
| } | ||
| }, | ||
| "description": "Get segment details", | ||
| "examples": [ | ||
| "<%= config.bin %> segments get --app UUID 550e8400-e29b-41d4-a716-446655440000" | ||
| ], | ||
| "flags": { | ||
| "json": { | ||
| "description": "Format output as json.", | ||
| "helpGroup": "GLOBAL", | ||
| "name": "json", | ||
| "allowNo": false, | ||
| "type": "boolean" | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| } | ||
| }, | ||
| "hasDynamicHelp": false, | ||
| "hiddenAliases": [], | ||
| "id": "segments:get", | ||
| "pluginAlias": "adapty", | ||
| "pluginName": "adapty", | ||
| "pluginType": "core", | ||
| "strict": true, | ||
| "enableJsonFlag": true, | ||
| "isESM": true, | ||
| "relativePath": [ | ||
| "dist", | ||
| "commands", | ||
| "segments", | ||
| "get.js" | ||
| ] | ||
| }, | ||
| "segments:list": { | ||
| "aliases": [], | ||
| "args": {}, | ||
| "description": "List segments for an app", | ||
| "examples": [ | ||
| "<%= config.bin %> segments list --app 550e8400-..." | ||
| ], | ||
| "flags": { | ||
| "json": { | ||
| "description": "Format output as json.", | ||
| "helpGroup": "GLOBAL", | ||
| "name": "json", | ||
| "allowNo": false, | ||
| "type": "boolean" | ||
| }, | ||
| "app": { | ||
| "description": "App ID (UUID)", | ||
| "name": "app", | ||
| "required": true, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| }, | ||
| "page": { | ||
| "description": "Page number", | ||
| "name": "page", | ||
| "default": 1, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| }, | ||
| "page-size": { | ||
| "description": "Items per page (max 100)", | ||
| "name": "page-size", | ||
| "default": 20, | ||
| "hasDynamicHelp": false, | ||
| "multiple": false, | ||
| "type": "option" | ||
| } | ||
| }, | ||
| "hasDynamicHelp": false, | ||
| "hiddenAliases": [], | ||
| "id": "segments:list", | ||
| "pluginAlias": "adapty", | ||
| "pluginName": "adapty", | ||
| "pluginType": "core", | ||
| "strict": true, | ||
| "enableJsonFlag": true, | ||
| "isESM": true, | ||
| "relativePath": [ | ||
| "dist", | ||
| "commands", | ||
| "segments", | ||
| "list.js" | ||
| ] | ||
| } | ||
| }, | ||
| "version": "0.1.5" | ||
| "version": "0.2.0" | ||
| } |
+4
-1
| { | ||
| "name": "adapty", | ||
| "description": "Adapty command line interface", | ||
| "version": "0.1.5", | ||
| "version": "0.2.0", | ||
| "author": "Adapty team <support@adapty.io>", | ||
@@ -82,2 +82,5 @@ "bin": { | ||
| "description": "Manage placements" | ||
| }, | ||
| "segments": { | ||
| "description": "List segments" | ||
| } | ||
@@ -84,0 +87,0 @@ } |
+12
-4
@@ -100,7 +100,15 @@ <a href="https://adapty.io/?utm_source=github&utm_medium=referral&utm_campaign=adapty-cli"> | ||
| | Variable | Description | | ||
| | ---------------- | ------------------------------------------------------------------------- | | ||
| | `ADAPTY_TOKEN` | Override stored auth token | | ||
| | `ADAPTY_API_URL` | Override API base URL (default: `https://api.adapty.io/api/v1/developer`) | | ||
| | Variable | Description | | ||
| | ---------------- | ------------------------------------------------------------------------------- | | ||
| | `ADAPTY_TOKEN` | Override stored auth token | | ||
| | `ADAPTY_API_URL` | Override API base URL (default: `https://api-admin.adapty.io/api/v1/developer`) | | ||
| ## Claude Code Skill | ||
| Install the Adapty CLI skill for Claude Code: | ||
| ```sh | ||
| npx skills add adaptyteam/adapty-cli --skill adapty-cli | ||
| ``` | ||
| ## Development | ||
@@ -107,0 +115,0 @@ |
117832
15.28%81
10.96%3193
14.04%124
6.9%