@tityra/cli 1.1.2 → 1.1.3
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/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/dist/schema/writeSchema.js +5 -29
- package/dist/services/apiClient.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
- Reject monitoring enablement before transport and direct customers to recurring credit approval in Tityra.
|
|
6
|
+
- Describe funding errors without implying that monitoring needs a paid subscription.
|
|
7
|
+
|
|
3
8
|
## 1.1.2
|
|
4
9
|
|
|
5
10
|
- Explain organisation prepaid credits and the Starter, Pro and Enterprise plans.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Tityra's website content audits review content delivery, structure and available
|
|
|
6
6
|
|
|
7
7
|
## Project status
|
|
8
8
|
|
|
9
|
-
Version `1.1.
|
|
9
|
+
Version `1.1.3` rejects unsupported monitoring enablement before sending a request and directs customers to recurring credit approval in Tityra. Funding errors no longer imply that monitoring needs a paid subscription. Credit purchases and spending approval take place in Tityra. Stable releases use npm's `latest` tag; check the [npm package page](https://www.npmjs.com/package/@tityra/cli) for the currently published version. CI targets Node.js 22 and 24 on Linux, macOS and Windows; local regression tests use isolated fixtures rather than live customer accounts.
|
|
10
10
|
|
|
11
11
|
## Basic functionality
|
|
12
12
|
|
|
@@ -25,6 +25,8 @@ export function validateWrite(kind, input) {
|
|
|
25
25
|
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
26
26
|
usage('--input must contain a JSON object.');
|
|
27
27
|
const body = input;
|
|
28
|
+
if (kind === 'monitoring' && body.action === 'enable')
|
|
29
|
+
usage('Enable or resume monitoring in Tityra, where an authorised spender approves the recurring organisation credit budget. The CLI can only pause monitoring.');
|
|
28
30
|
const fields = {
|
|
29
31
|
audit: ['projectId', 'plan', 'idempotencyKey', 'authorisation', 'notes', 'auditScope'],
|
|
30
32
|
challenge: ['reason', 'body', 'expectedReportRevision', 'idempotencyKey'],
|
|
@@ -38,14 +40,7 @@ export function validateWrite(kind, input) {
|
|
|
38
40
|
'idempotencyKey',
|
|
39
41
|
],
|
|
40
42
|
checkout: ['idempotencyKey'],
|
|
41
|
-
monitoring: [
|
|
42
|
-
'action',
|
|
43
|
-
'expectedRevision',
|
|
44
|
-
'idempotencyKey',
|
|
45
|
-
'authorisation',
|
|
46
|
-
'expectedWebsite',
|
|
47
|
-
'auditScope',
|
|
48
|
-
],
|
|
43
|
+
monitoring: ['action', 'expectedRevision', 'idempotencyKey'],
|
|
49
44
|
};
|
|
50
45
|
if (Object.keys(body).some((key) => !fields[kind].includes(key)))
|
|
51
46
|
usage('Input contains an unsupported field. Use the documented request body.');
|
|
@@ -60,29 +55,10 @@ export function validateWrite(kind, input) {
|
|
|
60
55
|
usage(`${key} must be a positive integer from the current server response.`);
|
|
61
56
|
};
|
|
62
57
|
if (kind === 'monitoring') {
|
|
63
|
-
if (
|
|
64
|
-
usage('Monitoring action must be
|
|
58
|
+
if (body.action !== 'disable')
|
|
59
|
+
usage('Monitoring action must be disable.');
|
|
65
60
|
if (!Number.isSafeInteger(body.expectedRevision) || Number(body.expectedRevision) < 0)
|
|
66
61
|
usage('expectedRevision must be a non-negative integer from the current monitoring response.');
|
|
67
|
-
if (body.action === 'enable') {
|
|
68
|
-
if (body.authorisation !== true)
|
|
69
|
-
usage('Enabling monitoring requires explicit authorisation: true.');
|
|
70
|
-
text('expectedWebsite', 1, 2000);
|
|
71
|
-
let website;
|
|
72
|
-
try {
|
|
73
|
-
website = new URL(body.expectedWebsite);
|
|
74
|
-
}
|
|
75
|
-
catch {
|
|
76
|
-
usage('expectedWebsite must be the website returned by the monitoring response.');
|
|
77
|
-
}
|
|
78
|
-
if (!['http:', 'https:'].includes(website.protocol) || website.username || website.password)
|
|
79
|
-
usage('expectedWebsite must be an HTTP(S) website without credentials.');
|
|
80
|
-
validateAuditScope(body.auditScope);
|
|
81
|
-
}
|
|
82
|
-
else if (body.authorisation !== undefined ||
|
|
83
|
-
body.expectedWebsite !== undefined ||
|
|
84
|
-
body.auditScope !== undefined)
|
|
85
|
-
usage('Pausing monitoring accepts only action, expectedRevision and idempotencyKey.');
|
|
86
62
|
}
|
|
87
63
|
else if (kind === 'audit') {
|
|
88
64
|
if (typeof body.projectId !== 'string')
|
|
@@ -92,8 +92,8 @@ export class ApiClient {
|
|
|
92
92
|
? 'Your connection does not have permission for this project or action. Review its scopes and project access.'
|
|
93
93
|
: response.status === 402
|
|
94
94
|
? pathname.endsWith('/monitoring')
|
|
95
|
-
? '
|
|
96
|
-
: '
|
|
95
|
+
? 'Monitoring is unavailable for this project. Review its organisation credit budget and current access in Tityra.'
|
|
96
|
+
: 'Funding or payment is required before this report is available. Review its status in Tityra.'
|
|
97
97
|
: response.status === 409
|
|
98
98
|
? 'The resource or its authorisation changed. Read the latest revision and review your input before retrying.'
|
|
99
99
|
: response.status === 429
|
package/package.json
CHANGED