adapty 0.6.1-beta.0 → 0.7.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.
@@ -0,0 +1,16 @@
1
+ import { Command } from '@oclif/core';
2
+ import type { AsaBulkOperationListDTO } from '../../../lib/asa-schemas.js';
3
+ export default class AsaCampaignsBulkList extends Command {
4
+ static description: string;
5
+ static enableJsonFlag: boolean;
6
+ static examples: string[];
7
+ static flags: {
8
+ app: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ 'created-from': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'created-to': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ status: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<AsaBulkOperationListDTO>;
16
+ }
@@ -0,0 +1,54 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { createAsaClient } from '../../../lib/asa-client.js';
3
+ import { asaPaginationFlags, parseDate } from '../../../lib/asa-flags.js';
4
+ import { isValidUuid, paginationParams } from '../../../lib/flags.js';
5
+ import { printList } from '../../../lib/output.js';
6
+ async function parseAppId(input) {
7
+ if (!isValidUuid(input))
8
+ throw new Error('Invalid app ID format. Run `adapty asa apps list` to find your app ID.');
9
+ return input;
10
+ }
11
+ export default class AsaCampaignsBulkList extends Command {
12
+ static description = "This company's bulk operations, newest first; inspect one with bulk-status";
13
+ static enableJsonFlag = true;
14
+ static examples = [
15
+ '<%= config.bin %> asa campaigns bulk-list',
16
+ '<%= config.bin %> asa campaigns bulk-list --status partial --status failed',
17
+ '<%= config.bin %> asa campaigns bulk-list --created-from 2026-08-01 --created-to 2026-08-20',
18
+ ];
19
+ static flags = {
20
+ ...asaPaginationFlags,
21
+ app: Flags.string({ description: 'Keep only operations of this app (UUID)', parse: parseAppId }),
22
+ 'created-from': Flags.string({
23
+ description: 'Keep only operations created on or after this date (YYYY-MM-DD)',
24
+ parse: parseDate,
25
+ }),
26
+ 'created-to': Flags.string({
27
+ description: 'Keep only operations created on or before this date (YYYY-MM-DD)',
28
+ parse: parseDate,
29
+ }),
30
+ status: Flags.string({
31
+ description: 'Keep only operations in this state; repeatable',
32
+ multiple: true,
33
+ options: ['failed', 'partial', 'pending', 'running', 'success'],
34
+ }),
35
+ };
36
+ async run() {
37
+ const { flags } = await this.parse(AsaCampaignsBulkList);
38
+ const client = await createAsaClient(this.config);
39
+ const result = await client.get('/bulk-operations', {
40
+ ...paginationParams(flags),
41
+ app_id: flags.app,
42
+ created_from: flags['created-from'],
43
+ created_to: flags['created-to'],
44
+ status: flags.status,
45
+ });
46
+ const pages = Math.max(1, Math.ceil(result.total / result.limit));
47
+ printList(result.items, this.log.bind(this), {
48
+ count: result.total,
49
+ page: flags.page,
50
+ pages,
51
+ });
52
+ return result;
53
+ }
54
+ }
@@ -101,21 +101,6 @@ export interface FlowConfigWriteRequestDTO {
101
101
  expected_updated_at?: null | number;
102
102
  remote_configs?: FlowRemoteConfigDTO[];
103
103
  }
104
- export interface FlowConfigValidateRequestDTO {
105
- config: Record<string, unknown>;
106
- }
107
- export interface FlowConfigIssueDTO {
108
- /** Machine code, relayed from the transformer; absent until it reports path-level diagnostics. */
109
- code?: null | string;
110
- message: string;
111
- /** Location of the issue; absent until the transformer reports path-level diagnostics. */
112
- path?: null | string;
113
- severity: string;
114
- }
115
- export interface FlowConfigValidationDTO {
116
- issues: FlowConfigIssueDTO[];
117
- valid: boolean;
118
- }
119
104
  export interface SegmentDTO {
120
105
  description: null | string;
121
106
  id: string;
@@ -11,6 +11,7 @@ export declare const asaPaginationFlags: {
11
11
  export declare const byDaysFlag: {
12
12
  'by-days': import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
13
  };
14
+ export declare function parseDate(input: string): Promise<string>;
14
15
  export declare const periodFlags: {
15
16
  'date-from': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
17
  'date-to': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -26,7 +26,7 @@ export const byDaysFlag = {
26
26
  multiple: true,
27
27
  }),
28
28
  };
29
- async function parseDate(input) {
29
+ export async function parseDate(input) {
30
30
  if (!DATE_REGEX.test(input))
31
31
  throw new Error('Dates must be written as YYYY-MM-DD.');
32
32
  return input;
@@ -314,6 +314,21 @@ export interface AsaBulkOperationStateDTO {
314
314
  started_at: null | string;
315
315
  status: AsaBulkOperationStatus;
316
316
  }
317
+ export interface AsaBulkOperationListItemDTO {
318
+ app_id: string;
319
+ created_at: string;
320
+ error: null | string;
321
+ finished_at: null | string;
322
+ operation_id: string;
323
+ started_at: null | string;
324
+ status: AsaBulkOperationStatus;
325
+ }
326
+ export interface AsaBulkOperationListDTO {
327
+ items: AsaBulkOperationListItemDTO[];
328
+ limit: number;
329
+ offset: number;
330
+ total: number;
331
+ }
317
332
  export interface AsaTemplateIssueDTO {
318
333
  column: null | string;
319
334
  message: string;