adapty 0.8.8 → 0.9.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 (204) hide show
  1. package/README.md +147 -2
  2. package/dist/cli/base/adapty/adapty-command.d.ts +3 -2
  3. package/dist/cli/base/adapty/adapty-command.js +8 -5
  4. package/dist/cli/base/adapty/build.d.ts +6 -1
  5. package/dist/cli/base/adapty/build.js +1 -0
  6. package/dist/cli/base/adapty/index.d.ts +1 -0
  7. package/dist/cli/base/adapty/index.js +1 -0
  8. package/dist/cli/base/adapty/migration-command.d.ts +11 -0
  9. package/dist/cli/base/adapty/migration-command.js +17 -0
  10. package/dist/cli/base/base-command.d.ts +6 -0
  11. package/dist/cli/base/base-command.js +14 -0
  12. package/dist/cli/commands/apps/create.d.ts +1 -1
  13. package/dist/cli/commands/apps/get.js +1 -1
  14. package/dist/cli/commands/apps/list.js +1 -1
  15. package/dist/cli/commands/apps/update.js +1 -1
  16. package/dist/cli/commands/attribution/report/command.d.ts +18 -0
  17. package/dist/cli/commands/attribution/report/command.js +93 -0
  18. package/dist/cli/commands/attribution/report/index.d.ts +1 -18
  19. package/dist/cli/commands/attribution/report/index.js +1 -93
  20. package/dist/cli/commands/attribution/values.js +1 -1
  21. package/dist/cli/commands/auth/login.js +1 -0
  22. package/dist/cli/commands/auth/{logout.d.ts → logout/command.d.ts} +1 -1
  23. package/dist/cli/commands/auth/logout/command.js +33 -0
  24. package/dist/cli/commands/auth/logout/index.d.ts +1 -0
  25. package/dist/cli/commands/auth/logout/index.js +1 -0
  26. package/dist/cli/commands/auth/logout/lib/cleanup.d.ts +3 -0
  27. package/dist/cli/commands/auth/logout/lib/cleanup.js +21 -0
  28. package/dist/cli/commands/auth/{revoke.d.ts → revoke/command.d.ts} +1 -1
  29. package/dist/cli/commands/auth/{revoke.js → revoke/command.js} +7 -7
  30. package/dist/cli/commands/auth/revoke/index.d.ts +1 -0
  31. package/dist/cli/commands/auth/revoke/index.js +1 -0
  32. package/dist/cli/commands/auth/revoke/lib/cleanup.d.ts +4 -0
  33. package/dist/cli/commands/auth/revoke/lib/cleanup.js +29 -0
  34. package/dist/cli/commands/auth/status/command.d.ts +7 -0
  35. package/dist/cli/commands/auth/status/command.js +22 -0
  36. package/dist/cli/commands/auth/status/index.d.ts +1 -7
  37. package/dist/cli/commands/auth/status/index.js +1 -22
  38. package/dist/cli/commands/migrations/close/command.d.ts +16 -0
  39. package/dist/cli/commands/migrations/close/command.js +58 -0
  40. package/dist/cli/commands/migrations/close/index.d.ts +1 -0
  41. package/dist/cli/commands/migrations/close/index.js +1 -0
  42. package/dist/cli/commands/migrations/create/command.d.ts +20 -0
  43. package/dist/cli/commands/migrations/create/command.js +86 -0
  44. package/dist/cli/commands/migrations/create/index.d.ts +1 -0
  45. package/dist/cli/commands/migrations/create/index.js +1 -0
  46. package/dist/cli/commands/migrations/current/command.d.ts +12 -0
  47. package/dist/cli/commands/migrations/current/command.js +25 -0
  48. package/dist/cli/commands/migrations/current/index.d.ts +1 -0
  49. package/dist/cli/commands/migrations/current/index.js +1 -0
  50. package/dist/cli/commands/migrations/list/command.d.ts +11 -0
  51. package/dist/cli/commands/migrations/list/command.js +27 -0
  52. package/dist/cli/commands/migrations/list/index.d.ts +1 -0
  53. package/dist/cli/commands/migrations/list/index.js +1 -0
  54. package/dist/cli/commands/migrations/list/lib/render.d.ts +3 -0
  55. package/dist/cli/commands/migrations/list/lib/render.js +77 -0
  56. package/dist/cli/commands/migrations/run/command.d.ts +25 -0
  57. package/dist/cli/commands/migrations/run/command.js +141 -0
  58. package/dist/cli/commands/migrations/run/index.d.ts +1 -0
  59. package/dist/cli/commands/migrations/run/index.js +1 -0
  60. package/dist/cli/commands/migrations/run/lib/action-view.d.ts +7 -0
  61. package/dist/cli/commands/migrations/run/lib/action-view.js +2 -0
  62. package/dist/cli/commands/migrations/run/lib/actions.d.ts +4 -0
  63. package/dist/cli/commands/migrations/run/lib/actions.js +20 -0
  64. package/dist/cli/commands/migrations/run/lib/https.d.ts +1 -0
  65. package/dist/cli/commands/migrations/run/lib/https.js +8 -0
  66. package/dist/cli/commands/migrations/run/lib/input.d.ts +10 -0
  67. package/dist/cli/commands/migrations/run/lib/input.js +51 -0
  68. package/dist/cli/commands/migrations/run/lib/open-link.d.ts +7 -0
  69. package/dist/cli/commands/migrations/run/lib/open-link.js +11 -0
  70. package/dist/cli/commands/migrations/show/command.d.ts +17 -0
  71. package/dist/cli/commands/migrations/show/command.js +47 -0
  72. package/dist/cli/commands/migrations/show/index.d.ts +1 -0
  73. package/dist/cli/commands/migrations/show/index.js +1 -0
  74. package/dist/cli/commands/migrations/show/lib/render.d.ts +4 -0
  75. package/dist/cli/commands/migrations/show/lib/render.js +27 -0
  76. package/dist/cli/commands/migrations/status/command.d.ts +18 -0
  77. package/dist/cli/commands/migrations/status/command.js +54 -0
  78. package/dist/cli/commands/migrations/status/index.d.ts +1 -0
  79. package/dist/cli/commands/migrations/status/index.js +1 -0
  80. package/dist/cli/commands/migrations/status/lib/flags.d.ts +8 -0
  81. package/dist/cli/commands/migrations/status/lib/flags.js +29 -0
  82. package/dist/cli/commands/migrations/status/lib/notice.d.ts +3 -0
  83. package/dist/cli/commands/migrations/status/lib/notice.js +10 -0
  84. package/dist/cli/commands/migrations/steps/command.d.ts +14 -0
  85. package/dist/cli/commands/migrations/steps/command.js +34 -0
  86. package/dist/cli/commands/migrations/steps/index.d.ts +1 -0
  87. package/dist/cli/commands/migrations/steps/index.js +1 -0
  88. package/dist/cli/commands/migrations/steps/lib/render.d.ts +3 -0
  89. package/dist/cli/commands/migrations/steps/lib/render.js +28 -0
  90. package/dist/cli/commands/migrations/unuse/command.d.ts +11 -0
  91. package/dist/cli/commands/migrations/unuse/command.js +23 -0
  92. package/dist/cli/commands/migrations/unuse/index.d.ts +1 -0
  93. package/dist/cli/commands/migrations/unuse/index.js +1 -0
  94. package/dist/cli/commands/migrations/use/command.d.ts +14 -0
  95. package/dist/cli/commands/migrations/use/command.js +24 -0
  96. package/dist/cli/commands/migrations/use/index.d.ts +1 -0
  97. package/dist/cli/commands/migrations/use/index.js +1 -0
  98. package/dist/cli/context/migration/current.d.ts +32 -0
  99. package/dist/cli/context/migration/current.js +30 -0
  100. package/dist/cli/context/migration/index.d.ts +4 -0
  101. package/dist/cli/context/migration/index.js +2 -0
  102. package/dist/cli/context/migration/model.d.ts +14 -0
  103. package/dist/cli/context/migration/model.js +30 -0
  104. package/dist/cli/context/migration/resolve.d.ts +16 -0
  105. package/dist/cli/context/migration/resolve.js +26 -0
  106. package/dist/cli/context/migration/store.d.ts +9 -0
  107. package/dist/cli/context/migration/store.js +99 -0
  108. package/dist/cli/errors/wizard.d.ts +5 -0
  109. package/dist/cli/errors/wizard.js +54 -0
  110. package/dist/cli/errors.d.ts +37 -4
  111. package/dist/cli/errors.js +58 -4
  112. package/dist/cli/input/app.d.ts +8 -0
  113. package/dist/cli/{flags.js → input/app.js} +2 -9
  114. package/dist/cli/input/migration.d.ts +7 -0
  115. package/dist/cli/input/migration.js +17 -0
  116. package/dist/cli/input/pagination.d.ts +11 -0
  117. package/dist/cli/input/pagination.js +8 -0
  118. package/dist/cli/views/migrations/envelope/action-block.d.ts +2 -0
  119. package/dist/cli/views/migrations/envelope/action-block.js +32 -0
  120. package/dist/cli/views/migrations/envelope/envelope.d.ts +3 -0
  121. package/dist/cli/views/migrations/envelope/envelope.js +40 -0
  122. package/dist/cli/views/migrations/envelope/issue-block.d.ts +2 -0
  123. package/dist/cli/views/migrations/envelope/issue-block.js +13 -0
  124. package/dist/cli/views/migrations/notices.d.ts +7 -0
  125. package/dist/cli/views/migrations/notices.js +7 -0
  126. package/dist/commands/access-levels/create.js +1 -1
  127. package/dist/commands/access-levels/get.js +1 -1
  128. package/dist/commands/access-levels/list.js +1 -1
  129. package/dist/commands/access-levels/update.js +1 -1
  130. package/dist/commands/asa/campaigns/create.d.ts +0 -1
  131. package/dist/commands/asa/campaigns/create.js +0 -2
  132. package/dist/commands/asa/campaigns/update.d.ts +0 -1
  133. package/dist/commands/asa/campaigns/update.js +1 -5
  134. package/dist/commands/auth/logout.d.ts +1 -1
  135. package/dist/commands/auth/logout.js +1 -1
  136. package/dist/commands/auth/revoke.d.ts +1 -1
  137. package/dist/commands/auth/revoke.js +1 -1
  138. package/dist/commands/flows/config/get.js +1 -1
  139. package/dist/commands/flows/config/update.js +1 -1
  140. package/dist/commands/flows/config/validate.js +1 -1
  141. package/dist/commands/flows/create.js +1 -1
  142. package/dist/commands/flows/get.js +1 -1
  143. package/dist/commands/flows/list.js +1 -1
  144. package/dist/commands/flows/media/upload.js +1 -1
  145. package/dist/commands/flows/publish.js +1 -1
  146. package/dist/commands/flows/update.js +1 -1
  147. package/dist/commands/migrations/close.d.ts +1 -0
  148. package/dist/commands/migrations/close.js +2 -0
  149. package/dist/commands/migrations/create.d.ts +1 -0
  150. package/dist/commands/migrations/create.js +2 -0
  151. package/dist/commands/migrations/current.d.ts +1 -0
  152. package/dist/commands/migrations/current.js +1 -0
  153. package/dist/commands/migrations/list.d.ts +1 -0
  154. package/dist/commands/migrations/list.js +2 -0
  155. package/dist/commands/migrations/run.d.ts +1 -0
  156. package/dist/commands/migrations/run.js +2 -0
  157. package/dist/commands/migrations/show.d.ts +1 -0
  158. package/dist/commands/migrations/show.js +2 -0
  159. package/dist/commands/migrations/status.d.ts +1 -0
  160. package/dist/commands/migrations/status.js +2 -0
  161. package/dist/commands/migrations/steps.d.ts +1 -0
  162. package/dist/commands/migrations/steps.js +2 -0
  163. package/dist/commands/migrations/unuse.d.ts +1 -0
  164. package/dist/commands/migrations/unuse.js +1 -0
  165. package/dist/commands/migrations/use.d.ts +1 -0
  166. package/dist/commands/migrations/use.js +1 -0
  167. package/dist/commands/paywalls/create.js +1 -1
  168. package/dist/commands/paywalls/get.js +1 -1
  169. package/dist/commands/paywalls/list.js +1 -1
  170. package/dist/commands/paywalls/placements.js +1 -1
  171. package/dist/commands/paywalls/update.js +1 -1
  172. package/dist/commands/placements/create.js +1 -1
  173. package/dist/commands/placements/get.js +1 -1
  174. package/dist/commands/placements/list.js +1 -1
  175. package/dist/commands/placements/update.js +1 -1
  176. package/dist/commands/products/create.js +1 -1
  177. package/dist/commands/products/get.js +1 -1
  178. package/dist/commands/products/list.js +1 -1
  179. package/dist/commands/products/update.js +1 -1
  180. package/dist/commands/segments/get.js +1 -1
  181. package/dist/commands/segments/list.js +1 -1
  182. package/dist/lib/asa-flags.js +1 -3
  183. package/dist/sdk/adapty/errors.d.ts +4 -0
  184. package/dist/sdk/adapty/errors.js +25 -0
  185. package/dist/sdk/adapty/index.d.ts +5 -0
  186. package/dist/sdk/adapty/index.js +29 -3
  187. package/dist/sdk/adapty/migrations/action.d.ts +15 -0
  188. package/dist/sdk/adapty/migrations/action.js +17 -0
  189. package/dist/sdk/adapty/migrations/close.d.ts +16 -0
  190. package/dist/sdk/adapty/migrations/close.js +7 -0
  191. package/dist/sdk/adapty/migrations/create.d.ts +16 -0
  192. package/dist/sdk/adapty/migrations/create.js +43 -0
  193. package/dist/sdk/adapty/migrations/index.d.ts +9 -0
  194. package/dist/sdk/adapty/migrations/index.js +4 -0
  195. package/dist/sdk/adapty/migrations/model.d.ts +100 -0
  196. package/dist/sdk/adapty/migrations/model.js +1 -0
  197. package/dist/sdk/adapty/migrations/resource.d.ts +27 -0
  198. package/dist/sdk/adapty/migrations/resource.js +52 -0
  199. package/dist/sdk/adapty/migrations/wait.d.ts +6 -0
  200. package/dist/sdk/adapty/migrations/wait.js +9 -0
  201. package/oclif.manifest.json +2119 -1528
  202. package/package.json +4 -1
  203. package/dist/cli/commands/auth/logout.js +0 -28
  204. package/dist/cli/flags.d.ts +0 -20
@@ -0,0 +1,17 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { validateMigrationId } from '../context/migration/index.js';
3
+ export const migrationArgs = {
4
+ id: Args.string({
5
+ description: 'Migration ID from `adapty migrations list`',
6
+ required: true,
7
+ parse: value => Promise.resolve(validateMigrationId(value)),
8
+ }),
9
+ };
10
+ /** Explicit ID wins over the environment and the saved selection, resolved after parsing. */
11
+ export const migrationFlags = {
12
+ migration: Flags.string({
13
+ char: 'm',
14
+ description: 'Migration ID; overrides ADAPTY_MIGRATION and the saved selection from migrations use/create',
15
+ helpValue: 'ID',
16
+ }),
17
+ };
@@ -0,0 +1,11 @@
1
+ import type { PageParams } from '../../sdk/adapty/index.js';
2
+ /** The published defaults, so a migrated `list` asks for the same page as an untouched one. */
3
+ export declare const paginationFlags: {
4
+ page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
5
+ 'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
6
+ };
7
+ /** The one place where flag names meet sdk field names. */
8
+ export declare const pageParams: (flags: {
9
+ "page": number;
10
+ "page-size": number;
11
+ }) => PageParams;
@@ -0,0 +1,8 @@
1
+ import { Flags } from '@oclif/core';
2
+ /** The published defaults, so a migrated `list` asks for the same page as an untouched one. */
3
+ export const paginationFlags = {
4
+ 'page': Flags.integer({ default: 1, description: 'Page number', min: 1 }),
5
+ 'page-size': Flags.integer({ default: 20, description: 'Items per page (max 100)', max: 100, min: 1 }),
6
+ };
7
+ /** The one place where flag names meet sdk field names. */
8
+ export const pageParams = (flags) => ({ page: flags.page, pageSize: flags['page-size'] });
@@ -0,0 +1,2 @@
1
+ import type { Action } from '../../../../sdk/adapty/index.js';
2
+ export declare const actionBlock: (action: Action, migrationId: string) => string[];
@@ -0,0 +1,32 @@
1
+ const knownKinds = new Set(['external', 'input', 'upload']);
2
+ const indent = (text, pad) => {
3
+ return text.split('\n').map(line => `${pad}${line}`).join('\n');
4
+ };
5
+ export const actionBlock = (action, migrationId) => {
6
+ const lines = [` ${action.action_id} (${action.kind}) ${action.title}`];
7
+ const href = 'href' in action ? action.href : undefined;
8
+ if (action.detail !== null) {
9
+ lines.push(indent(action.detail, ' '));
10
+ }
11
+ if (href !== undefined) {
12
+ lines.push(` ${href}`);
13
+ }
14
+ if (action.reads.length > 0) {
15
+ const commands = action.reads.map(name => `adapty migrations show ${name} -m ${migrationId}`);
16
+ lines.push(` Read first: ${commands.join(', ')}`);
17
+ }
18
+ if (action.confirm !== null) {
19
+ lines.push(' Confirmation:', indent(action.confirm, ' '));
20
+ if (action.kind === 'input') {
21
+ lines.push(' Review this text before passing --yes.');
22
+ }
23
+ }
24
+ if (action.kind === 'upload') {
25
+ lines.push(' File uploads are not supported by this CLI.');
26
+ lines.push(' Use the dashboard or an offered Cloud Export action.');
27
+ }
28
+ if (!knownKinds.has(action.kind)) {
29
+ lines.push(' This action needs a newer adapty-cli');
30
+ }
31
+ return lines;
32
+ };
@@ -0,0 +1,3 @@
1
+ import type { Envelope } from '../../../../sdk/adapty/index.js';
2
+ /** Preserve server wording so new steps and actions need no CLI update. */
3
+ export declare const renderEnvelope: (envelope: Envelope) => string;
@@ -0,0 +1,40 @@
1
+ import { actionBlock } from './action-block.js';
2
+ import { issueBlock } from './issue-block.js';
3
+ const knownStates = new Set([
4
+ 'running', 'action_required', 'completed', 'failed', 'canceled',
5
+ ]);
6
+ const appLine = (app) => {
7
+ return app === null ? 'App: not created yet' : `App: ${app.name} (${app.id})`;
8
+ };
9
+ const progressLine = (progress) => {
10
+ const done = progress.total === null ? String(progress.done) : `${progress.done} of ${progress.total}`;
11
+ return `Progress: ${done} ${progress.unit}`;
12
+ };
13
+ /** Preserve server wording so new steps and actions need no CLI update. */
14
+ export const renderEnvelope = (envelope) => {
15
+ const { migration } = envelope;
16
+ const lines = [
17
+ `${migration.id} ${migration.flow} ${migration.state}`,
18
+ appLine(migration.app),
19
+ migration.summary,
20
+ ];
21
+ if (!knownStates.has(migration.state)) {
22
+ lines.push('This migration state needs a newer adapty-cli');
23
+ }
24
+ if (migration.progress !== null) {
25
+ lines.push(progressLine(migration.progress));
26
+ }
27
+ if (envelope.issues.length > 0) {
28
+ lines.push('', 'Issues:', ...envelope.issues.flatMap(issue => issueBlock(issue, migration.id)));
29
+ }
30
+ if (envelope.next_actions.length > 0) {
31
+ lines.push('', 'Do next:', ...envelope.next_actions.flatMap(action => actionBlock(action, migration.id)));
32
+ }
33
+ if (envelope.available_actions.length > 0) {
34
+ lines.push('', 'Also available:', ...envelope.available_actions.flatMap(action => actionBlock(action, migration.id)));
35
+ }
36
+ if (envelope.resources.length > 0) {
37
+ lines.push('', `Readable now: ${envelope.resources.map(resource => resource.name).join(', ')}`);
38
+ }
39
+ return lines.join('\n');
40
+ };
@@ -0,0 +1,2 @@
1
+ import type { Issue } from '../../../../sdk/adapty/index.js';
2
+ export declare const issueBlock: (issue: Issue, migrationId: string) => string[];
@@ -0,0 +1,13 @@
1
+ const indent = (text, pad) => {
2
+ return text.split('\n').map(line => `${pad}${line}`).join('\n');
3
+ };
4
+ export const issueBlock = (issue, migrationId) => {
5
+ const lines = [` ${issue.title} (${issue.code})`];
6
+ if (issue.detail !== null) {
7
+ lines.push(indent(issue.detail, ' '));
8
+ }
9
+ if (issue.action_id !== null) {
10
+ lines.push(` Fix with: adapty migrations run ${issue.action_id} -m ${migrationId}`);
11
+ }
12
+ return lines;
13
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * ADAPTY_MIGRATION outlives both a save and a clear, so "saved" or "cleared" alone would be a lie.
3
+ * Commands write these to stderr rather than through `warn()`, which oclif silences under --json:
4
+ * a selection that is not in effect is exactly what a script has to be told about.
5
+ */
6
+ export declare const envOverridesSelection = "Warning: ADAPTY_MIGRATION still overrides the saved selection. Unset it in your shell to use this ID.\n";
7
+ export declare const envSuppliesMigration = "Warning: ADAPTY_MIGRATION still supplies a migration ID. Unset it in your shell.\n";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * ADAPTY_MIGRATION outlives both a save and a clear, so "saved" or "cleared" alone would be a lie.
3
+ * Commands write these to stderr rather than through `warn()`, which oclif silences under --json:
4
+ * a selection that is not in effect is exactly what a script has to be told about.
5
+ */
6
+ export const envOverridesSelection = 'Warning: ADAPTY_MIGRATION still overrides the saved selection. Unset it in your shell to use this ID.\n';
7
+ export const envSuppliesMigration = 'Warning: ADAPTY_MIGRATION still supplies a migration ID. Unset it in your shell.\n';
@@ -1,5 +1,5 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { printResponse } from '../../lib/output.js';
5
5
  export default class AccessLevelsCreate extends Command {
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { paginationFlags, paginationParams } from '../../lib/flags.js';
5
5
  import { printList } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -9,7 +9,6 @@ export default class AsaCampaignsCreate extends Command {
9
9
  'adam-id': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
10
10
  'bidding-strategy': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  'billing-event': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
- budget: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
12
  country: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
14
13
  'daily-budget': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
14
  name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
@@ -24,7 +24,6 @@ export default class AsaCampaignsCreate extends Command {
24
24
  options: ['MANUAL_CPT', 'MAX_CONVERSIONS'],
25
25
  }),
26
26
  'billing-event': Flags.string({ default: 'TAPS', description: 'Billing event', options: ['IMPRESSIONS', 'TAPS'] }),
27
- 'budget': moneyFlag('Lifetime budget'),
28
27
  'country': Flags.string({ description: 'Country or region code, repeatable', multiple: true, required: true }),
29
28
  'daily-budget': moneyFlag('Daily budget', { required: true }),
30
29
  'name': Flags.string({ description: 'Campaign name', required: true }),
@@ -54,7 +53,6 @@ export default class AsaCampaignsCreate extends Command {
54
53
  adam_id: flags['adam-id'],
55
54
  bidding_strategy: flags['bidding-strategy'],
56
55
  billing_event: flags['billing-event'],
57
- budget_amount: money(flags.budget, flags.currency),
58
56
  campaign_group_id: flags.org,
59
57
  countries_or_regions: flags.country,
60
58
  daily_budget_amount: money(flags['daily-budget'], flags.currency),
@@ -9,7 +9,6 @@ export default class AsaCampaignsUpdate extends Command {
9
9
  static examples: string[];
10
10
  static flags: {
11
11
  'bidding-strategy': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
- budget: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
12
  country: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
13
  'daily-budget': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
14
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -8,7 +8,7 @@ export default class AsaCampaignsUpdate extends Command {
8
8
  static args = {
9
9
  campaign_id: Args.string({ description: 'Campaign ID (UUID)', required: true }),
10
10
  };
11
- static description = 'Change a campaign: budgets, countries, status, schedule or Invoicing Options (all five --invoice-* flags together; they replace the stored set)';
11
+ static description = 'Change a campaign: daily budget, countries, status or Invoicing Options (all five --invoice-* flags together; they replace the stored set)';
12
12
  static enableJsonFlag = true;
13
13
  static examples = [
14
14
  '<%= config.bin %> asa campaigns update UUID --status PAUSED',
@@ -24,7 +24,6 @@ export default class AsaCampaignsUpdate extends Command {
24
24
  description: 'Bidding strategy',
25
25
  options: ['MANUAL_CPT', 'MAX_CONVERSIONS'],
26
26
  }),
27
- 'budget': moneyFlag('Lifetime budget'),
28
27
  'country': Flags.string({ description: 'Replace the country list, repeatable', multiple: true }),
29
28
  'daily-budget': moneyFlag('Daily budget'),
30
29
  'name': Flags.string({ description: 'Campaign name' }),
@@ -49,9 +48,6 @@ export default class AsaCampaignsUpdate extends Command {
49
48
  if (flags['daily-budget'] !== undefined) {
50
49
  body.daily_budget_amount = money(flags['daily-budget'], flags.currency);
51
50
  }
52
- if (flags.budget !== undefined) {
53
- body.budget_amount = money(flags.budget, flags.currency);
54
- }
55
51
  if (flags['target-cpa'] !== undefined) {
56
52
  body.target_cpa = money(flags['target-cpa'], flags.currency);
57
53
  }
@@ -1 +1 @@
1
- export { default } from '../../cli/commands/auth/logout.js';
1
+ export { default } from '../../cli/commands/auth/logout/index.js';
@@ -1,2 +1,2 @@
1
1
  // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
- export { default } from '../../cli/commands/auth/logout.js';
2
+ export { default } from '../../cli/commands/auth/logout/index.js';
@@ -1 +1 @@
1
- export { default } from '../../cli/commands/auth/revoke.js';
1
+ export { default } from '../../cli/commands/auth/revoke/index.js';
@@ -1,2 +1,2 @@
1
1
  // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
- export { default } from '../../cli/commands/auth/revoke.js';
2
+ export { default } from '../../cli/commands/auth/revoke/index.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../../cli/flags.js';
2
+ import { appIdFlag } from '../../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../../lib/flags.js';
5
5
  import { printResponse } from '../../../lib/output.js';
@@ -1,6 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { Args, Command, Flags } from '@oclif/core';
3
- import { appIdFlag } from '../../../cli/flags.js';
3
+ import { appIdFlag } from '../../../cli/input/app.js';
4
4
  import { createAuthenticatedClient } from '../../../lib/client-from-config.js';
5
5
  import { isValidUuid } from '../../../lib/flags.js';
6
6
  import { printResponse } from '../../../lib/output.js';
@@ -1,6 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { Args, Command, Flags } from '@oclif/core';
3
- import { appIdFlag } from '../../../cli/flags.js';
3
+ import { appIdFlag } from '../../../cli/input/app.js';
4
4
  import { createAuthenticatedClient } from '../../../lib/client-from-config.js';
5
5
  import { isValidUuid } from '../../../lib/flags.js';
6
6
  import { printResponse } from '../../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { printResponse } from '../../lib/output.js';
5
5
  export default class FlowsCreate extends Command {
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { paginationFlags, paginationParams } from '../../lib/flags.js';
5
5
  import { printList } from '../../lib/output.js';
@@ -1,7 +1,7 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { basename, extname } from 'node:path';
3
3
  import { Args, Command } from '@oclif/core';
4
- import { appIdFlag } from '../../../cli/flags.js';
4
+ import { appIdFlag } from '../../../cli/input/app.js';
5
5
  import { createAuthenticatedClient } from '../../../lib/client-from-config.js';
6
6
  import { printResponse } from '../../../lib/output.js';
7
7
  const IMAGE_MIME_TYPES = {
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { confirmFlags, confirmMutation } from '../../lib/confirm.js';
5
5
  import { ApiError } from '../../lib/errors.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/close/index.js';
@@ -0,0 +1,2 @@
1
+ // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
+ export { default } from '../../cli/commands/migrations/close/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/create/index.js';
@@ -0,0 +1,2 @@
1
+ // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
+ export { default } from '../../cli/commands/migrations/create/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/current/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/current/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/list/index.js';
@@ -0,0 +1,2 @@
1
+ // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
+ export { default } from '../../cli/commands/migrations/list/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/run/index.js';
@@ -0,0 +1,2 @@
1
+ // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
+ export { default } from '../../cli/commands/migrations/run/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/show/index.js';
@@ -0,0 +1,2 @@
1
+ // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
+ export { default } from '../../cli/commands/migrations/show/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/status/index.js';
@@ -0,0 +1,2 @@
1
+ // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
+ export { default } from '../../cli/commands/migrations/status/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/steps/index.js';
@@ -0,0 +1,2 @@
1
+ // Implementation lives in the new cli layer; oclif discovers commands only under src/commands.
2
+ export { default } from '../../cli/commands/migrations/steps/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/unuse/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/unuse/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/use/index.js';
@@ -0,0 +1 @@
1
+ export { default } from '../../cli/commands/migrations/use/index.js';
@@ -1,5 +1,5 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { printResponse } from '../../lib/output.js';
5
5
  export default class PaywallsCreate extends Command {
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { paginationFlags, paginationParams } from '../../lib/flags.js';
5
5
  import { printList } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printList } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { draftFlowError } from '../../lib/flow-help.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { paginationFlags, paginationParams } from '../../lib/flags.js';
5
5
  import { printList } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { draftFlowError } from '../../lib/flow-help.js';
@@ -1,5 +1,5 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { printResponse } from '../../lib/output.js';
5
5
  const VALID_PERIODS = [
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { paginationFlags, paginationParams } from '../../lib/flags.js';
5
5
  import { printList } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Args, Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { isValidUuid } from '../../lib/flags.js';
5
5
  import { printResponse } from '../../lib/output.js';
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@oclif/core';
2
- import { appIdFlag } from '../../cli/flags.js';
2
+ import { appIdFlag } from '../../cli/input/app.js';
3
3
  import { createAuthenticatedClient } from '../../lib/client-from-config.js';
4
4
  import { paginationFlags, paginationParams } from '../../lib/flags.js';
5
5
  import { printList } from '../../lib/output.js';
@@ -218,15 +218,13 @@ export function locInvoiceDetails(flags) {
218
218
  const SERVING_HINTS = {
219
219
  AUTOMATED_KEYWORDS_REQUIRED_AD_GROUP_MISSING: campaignId => `Max Conversions campaign needs an automated ad group: adapty asa ad-groups create --campaign ${campaignId} --name "Automated Max Conv" --automated`,
220
220
  MISSING_BO_OR_INVOICING_FIELDS: campaignId => `This organization bills by line of credit — add Invoicing Options: adapty asa campaigns update ${campaignId} --invoice-advertiser ... --invoice-order-number ... --invoice-contact-name ... --invoice-contact-email ... --invoice-billing-email ...`,
221
+ PAUSED_BY_USER: campaignId => `Campaign is paused — to serve, enable it: adapty asa campaigns update ${campaignId} --status ENABLED; its ad groups and keywords must be enabled too: adapty asa ad-groups update ... --status ENABLED, adapty asa keywords update ... --status ACTIVE`,
221
222
  };
222
223
  export function reportServingState(campaign, warn) {
223
224
  if (campaign?.serving_status !== 'NOT_RUNNING' || !campaign.serving_state_reasons?.length) {
224
225
  return;
225
226
  }
226
227
  const reasons = campaign.serving_state_reasons;
227
- if (reasons.length === 1 && reasons[0] === 'PAUSED_BY_USER') {
228
- return;
229
- }
230
228
  for (const reason of reasons) {
231
229
  const hint = SERVING_HINTS[reason];
232
230
  if (hint) {
@@ -6,5 +6,9 @@ import type { ErrorParser } from '../core/http/index.js';
6
6
  *
7
7
  * Wired once in createAdapty: which shapes a service speaks is product knowledge, and ASA speaks
8
8
  * another — which is why the transport takes the parser as a parameter.
9
+ *
10
+ * The Wizard Service sits behind the same transport (section 4.5 of the CLI–WS contract) and
11
+ * words its rejection as `{ error: { code, message } }` (`WizardError`) — one shape this parser
12
+ * now reads too, alongside the ones the developer API sends.
9
13
  */
10
14
  export declare const developerErrorParser: ErrorParser;