adapty 0.8.3-beta.0 → 0.8.3-beta.1
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.
- package/dist/commands/flows/publish.js +14 -1
- package/oclif.manifest.json +876 -876
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Args, Command } from '@oclif/core';
|
|
2
2
|
import { createAuthenticatedClient } from '../../lib/client-from-config.js';
|
|
3
3
|
import { confirmFlags, confirmMutation } from '../../lib/confirm.js';
|
|
4
|
+
import { ApiError } from '../../lib/errors.js';
|
|
4
5
|
import { appFlag, isValidUuid } from '../../lib/flags.js';
|
|
5
6
|
import { printResponse } from '../../lib/output.js';
|
|
6
7
|
export default class FlowsPublish extends Command {
|
|
@@ -26,7 +27,19 @@ export default class FlowsPublish extends Command {
|
|
|
26
27
|
path: `/apps/${flags.app}/flows/${args.flow_id}/publish/`,
|
|
27
28
|
summary: `Publish flow "${flow.name}" live to end users`,
|
|
28
29
|
}, flags.yes);
|
|
29
|
-
|
|
30
|
+
let result;
|
|
31
|
+
try {
|
|
32
|
+
result = await client.post(`/apps/${flags.app}/flows/${args.flow_id}/publish/`);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof ApiError && (error.statusCode === 400 || error.errorCode === 'validation_error')) {
|
|
36
|
+
this.error(`Flow publish failed: ${error.message}\n` +
|
|
37
|
+
'Publishing needs a flow with a valid config. Fix it, then run `adapty flows publish` again:\n' +
|
|
38
|
+
` • Builder UI: https://app.adapty.io/flows/${args.flow_id}/builder\n` +
|
|
39
|
+
' • Adapty flows agent skill: https://adapty.io/docs/flow-generator-skill', { exit: 1 });
|
|
40
|
+
}
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
30
43
|
this.log('Publishing started — status: publishing. Publication completes asynchronously.');
|
|
31
44
|
printResponse(result, this.log.bind(this));
|
|
32
45
|
return result;
|