readlint.com 0.6.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.
- package/dist/cli.js +6 -5
- package/dist/gen/types.gen.d.ts +20 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
package/dist/cli.js
CHANGED
|
@@ -16,7 +16,8 @@ Commands:
|
|
|
16
16
|
get UUID, delete UUID Read or delete an evaluation
|
|
17
17
|
agent-permissions get Read the owner’s agent billing policy
|
|
18
18
|
billing status|quote|portal Read billing, get a nonbinding quote or payment link
|
|
19
|
-
billing order --quote-id UUID --terms-version VERSION --agree-to-pay --idempotency-key UUID
|
|
19
|
+
billing order --quote-id UUID --terms-version VERSION --agree-to-pay --idempotency-key UUID [--start-now]
|
|
20
|
+
Consumers must pass --start-now: the paid start and withdrawal charges follow the quote disclosure and accepted Terms
|
|
20
21
|
billing cancel --idempotency-key UUID (retain for recovery)
|
|
21
22
|
login, logout Approve device login or remove local credentials
|
|
22
23
|
mcp Serve four MCP tools over stdio
|
|
@@ -42,7 +43,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
42
43
|
const { values, positionals } = parseArgs({ args: argv, allowPositionals: true, strict: true, options: {
|
|
43
44
|
json: { type: "boolean" }, "api-key": { type: "string" }, "base-url": { type: "string" }, timeout: { type: "string" },
|
|
44
45
|
help: { type: "boolean", short: "h" }, version: { type: "boolean" }, title: { type: "string" },
|
|
45
|
-
"quote-id": { type: "string" }, "terms-version": { type: "string" }, "agree-to-pay": { type: "boolean" },
|
|
46
|
+
"quote-id": { type: "string" }, "terms-version": { type: "string" }, "agree-to-pay": { type: "boolean" }, "start-now": { type: "boolean" },
|
|
46
47
|
description: { type: "string" }, "idempotency-key": { type: "string" }, limit: { type: "string" }, offset: { type: "string" },
|
|
47
48
|
} });
|
|
48
49
|
if (values.help) {
|
|
@@ -62,8 +63,8 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
62
63
|
throw new TypeError();
|
|
63
64
|
if (command === "billing" && !["status", "quote", "portal", "order", "cancel"].includes(argument))
|
|
64
65
|
throw new TypeError();
|
|
65
|
-
for (const flag of ["title", "description", "idempotency-key", "limit", "offset", "quote-id", "terms-version", "agree-to-pay"]) {
|
|
66
|
-
if (values[flag] !== undefined && !(["check", "evaluate"].includes(command) ? ["title", "description", "idempotency-key"] : command === "list" ? ["limit", "offset"] : command === "billing" && argument === "order" ? ["idempotency-key", "quote-id", "terms-version", "agree-to-pay"] : command === "billing" && argument === "cancel" ? ["idempotency-key"] : []).includes(flag))
|
|
66
|
+
for (const flag of ["title", "description", "idempotency-key", "limit", "offset", "quote-id", "terms-version", "agree-to-pay", "start-now"]) {
|
|
67
|
+
if (values[flag] !== undefined && !(["check", "evaluate"].includes(command) ? ["title", "description", "idempotency-key"] : command === "list" ? ["limit", "offset"] : command === "billing" && argument === "order" ? ["idempotency-key", "quote-id", "terms-version", "agree-to-pay", "start-now"] : command === "billing" && argument === "cancel" ? ["idempotency-key"] : []).includes(flag))
|
|
67
68
|
throw new TypeError();
|
|
68
69
|
}
|
|
69
70
|
const timeoutMs = values.timeout === undefined ? 120_000 : Math.ceil(Number(values.timeout) * 1000);
|
|
@@ -122,7 +123,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
122
123
|
if (argument === "cancel")
|
|
123
124
|
result = await client.cancelBillingPlan({ idempotencyKey: submissionKey });
|
|
124
125
|
else
|
|
125
|
-
result = await client.confirmBillingOrder(values["quote-id"], { termsVersion: values["terms-version"], paidOrderConfirmed: true, idempotencyKey: submissionKey });
|
|
126
|
+
result = await client.confirmBillingOrder(values["quote-id"], { termsVersion: values["terms-version"], paidOrderConfirmed: true, idempotencyKey: submissionKey, startNow: values["start-now"] === true });
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
else if (command === "get")
|
package/dist/gen/types.gen.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export type AgentBillingStatus = {
|
|
|
9
9
|
* Access Active
|
|
10
10
|
*/
|
|
11
11
|
access_active: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Business
|
|
14
|
+
*/
|
|
15
|
+
business: boolean;
|
|
12
16
|
/**
|
|
13
17
|
* Cancelled At
|
|
14
18
|
*/
|
|
@@ -129,6 +133,10 @@ export type AgentQuote = {
|
|
|
129
133
|
* Monthly Credits Cents
|
|
130
134
|
*/
|
|
131
135
|
monthly_credits_cents: number;
|
|
136
|
+
/**
|
|
137
|
+
* Plan Line
|
|
138
|
+
*/
|
|
139
|
+
plan_line: string;
|
|
132
140
|
/**
|
|
133
141
|
* Privacy Url
|
|
134
142
|
*/
|
|
@@ -145,6 +153,14 @@ export type AgentQuote = {
|
|
|
145
153
|
* Renewal Terms
|
|
146
154
|
*/
|
|
147
155
|
renewal_terms: string;
|
|
156
|
+
/**
|
|
157
|
+
* Start Now Action
|
|
158
|
+
*/
|
|
159
|
+
start_now_action: string | null;
|
|
160
|
+
/**
|
|
161
|
+
* Start Now Required
|
|
162
|
+
*/
|
|
163
|
+
start_now_required: boolean;
|
|
148
164
|
/**
|
|
149
165
|
* Subtotal Cents
|
|
150
166
|
*/
|
|
@@ -559,6 +575,10 @@ export type PaidInstruction = {
|
|
|
559
575
|
* Quote Id
|
|
560
576
|
*/
|
|
561
577
|
quote_id: string;
|
|
578
|
+
/**
|
|
579
|
+
* Start Now
|
|
580
|
+
*/
|
|
581
|
+
start_now?: boolean;
|
|
562
582
|
/**
|
|
563
583
|
* Terms Version
|
|
564
584
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -44,11 +44,12 @@ export declare class Readlint {
|
|
|
44
44
|
getAgentPermissions(): Promise<AgentPermissions>;
|
|
45
45
|
getBillingStatus(): Promise<AgentBillingStatus>;
|
|
46
46
|
createBillingQuote(): Promise<AgentQuote>;
|
|
47
|
-
/** Explicit paid instruction; never automatically retried. */
|
|
47
|
+
/** Explicit paid instruction; never automatically retried. Consumers must pass startNow: true: start the paid plan as disclosed in the quote; withdrawal charges follow its disclosure and accepted Terms. */
|
|
48
48
|
confirmBillingOrder(quoteId: string, options: {
|
|
49
49
|
termsVersion: string;
|
|
50
50
|
paidOrderConfirmed: true;
|
|
51
51
|
idempotencyKey: string;
|
|
52
|
+
startNow?: boolean;
|
|
52
53
|
}): Promise<OrderAccepted>;
|
|
53
54
|
cancelBillingPlan(options: {
|
|
54
55
|
idempotencyKey: string;
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ const RECOVERY = {
|
|
|
14
14
|
terms_version_mismatch: "Use the Terms version in a fresh quote.",
|
|
15
15
|
paid_order_consent_required: "Explicit paid-order confirmation is required.",
|
|
16
16
|
paid_order_already_confirmed: "Read the current order in billing status.",
|
|
17
|
+
start_now_required: "Upgrade to readlint/readlint.com 0.7.0 or later if needed. Consumers must ask to start the paid plan now: pass --start-now / startNow: true after reading the quote's disclosure.",
|
|
17
18
|
save_card_first: "Save a payment method using the returned payment link.",
|
|
18
19
|
billing_address_required: "Complete the billing address using the returned payment link.",
|
|
19
20
|
validation_error: "Check the input before retrying.",
|
|
@@ -134,11 +135,11 @@ export class Readlint {
|
|
|
134
135
|
createBillingQuote() {
|
|
135
136
|
return this.#request("POST", "/v1/billing/quote", false);
|
|
136
137
|
}
|
|
137
|
-
/** Explicit paid instruction; never automatically retried. */
|
|
138
|
+
/** Explicit paid instruction; never automatically retried. Consumers must pass startNow: true: start the paid plan as disclosed in the quote; withdrawal charges follow its disclosure and accepted Terms. */
|
|
138
139
|
confirmBillingOrder(quoteId, options) {
|
|
139
140
|
if (options?.paidOrderConfirmed !== true)
|
|
140
141
|
throw new TypeError("paidOrderConfirmed must be explicitly true.");
|
|
141
|
-
return this.#request("POST", "/v1/billing/order", false, JSON.stringify({ quote_id: uuid(quoteId), terms_version: options.termsVersion, paid_order_confirmed: true }), { "Content-Type": "application/json", "Idempotency-Key": uuid(options.idempotencyKey) });
|
|
142
|
+
return this.#request("POST", "/v1/billing/order", false, JSON.stringify({ quote_id: uuid(quoteId), terms_version: options.termsVersion, paid_order_confirmed: true, start_now: options.startNow ?? false }), { "Content-Type": "application/json", "Idempotency-Key": uuid(options.idempotencyKey) });
|
|
142
143
|
}
|
|
143
144
|
cancelBillingPlan(options) {
|
|
144
145
|
return this.#request("POST", "/v1/billing/cancel", false, "{}", { "Content-Type": "application/json", "Idempotency-Key": uuid(options.idempotencyKey) });
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.7.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.7.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "readlint.com",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "TypeScript SDK, CLI and MCP server for readlint.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsc -p tsconfig.build.json",
|
|
31
31
|
"typecheck": "tsc --noEmit",
|
|
32
|
-
"test": "npm run build && node --test test/*.test.mjs",
|
|
32
|
+
"test": "npm run build && npm run build:examples && node --test test/*.test.mjs",
|
|
33
|
+
"build:examples": "tsc -p tsconfig.examples.json",
|
|
33
34
|
"generate": "node scripts/openapi.mjs",
|
|
34
35
|
"check:openapi": "node scripts/openapi.mjs --check",
|
|
35
36
|
"prepack": "npm run build"
|