@capxul/cli 4.20.0-beta.20 → 4.20.0-beta.21
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/README.md +80 -4
- package/dist/browser/signer.js +54 -2
- package/dist/browser/signer.js.map +1 -1
- package/dist/main.mjs +252 -91
- package/dist/main.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -204,8 +204,11 @@ require `--confirm` before session restoration. A lost write reply gives an
|
|
|
204
204
|
exact readback command in the same scope and session. It never repeats the
|
|
205
205
|
write. These commands start no signer and move no funds.
|
|
206
206
|
|
|
207
|
-
Issue accepts an Invoice request JSON object from
|
|
208
|
-
|
|
207
|
+
Issue accepts a basic payment request or an Invoice request JSON object from
|
|
208
|
+
`--input FILE` or `--input -`. Both require `payer` and an exact positive
|
|
209
|
+
`amount`. A basic request requires an explicit `reference` and accepts an
|
|
210
|
+
optional private `memo`. An Invoice request also supplies `invoice`.
|
|
211
|
+
Issue saves available document PDFs in the common directory by default.
|
|
209
212
|
Human and JSON output include `checkoutUrl` for an Invoice instruction with a link token.
|
|
210
213
|
Memo requests do not receive an Invoice checkout URL.
|
|
211
214
|
The PDF includes the checkout link from the authorized backend render context.
|
|
@@ -234,6 +237,17 @@ output; use the printed document render command.
|
|
|
234
237
|
}
|
|
235
238
|
```
|
|
236
239
|
|
|
240
|
+
For a basic request, omit `invoice`:
|
|
241
|
+
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"payer": { "kind": "email", "email": "bob@example.com" },
|
|
245
|
+
"amount": { "asset": "<admitted asset ID>", "value": "9" },
|
|
246
|
+
"reference": "SESSION-001",
|
|
247
|
+
"memo": "Counselling session"
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
237
251
|
Supply your Invoice number. The request reference defaults to that number;
|
|
238
252
|
optional `reference` changes the request reference only. `dueAt` uses epoch
|
|
239
253
|
milliseconds, as the shared Invoice document and frontend do. Set it to zero
|
|
@@ -1037,5 +1051,67 @@ positive whole numbers.
|
|
|
1037
1051
|
Creation requires an explicit replay key. Keep the key and identical terms when
|
|
1038
1052
|
recovering an uncertain result. Read the offer list before another write. Revision
|
|
1039
1053
|
and deactivation require the revision you observed. A conflict requires a fresh
|
|
1040
|
-
read. The CLI does not retry a write automatically.
|
|
1041
|
-
|
|
1054
|
+
read. The CLI does not retry a write automatically. Successful offer results
|
|
1055
|
+
include `checkoutUrl`. Share that URL for another purchase of the same offer.
|
|
1056
|
+
An offer link is not a saved purchase or proof of payment.
|
|
1057
|
+
|
|
1058
|
+
The checkout page reads the current offer before the payer continues. A quantity
|
|
1059
|
+
in the URL is a hint. The backend checks its bounds and freezes the selected
|
|
1060
|
+
revision, quantity, price, asset, network, and recipient for that purchase.
|
|
1061
|
+
Changing the URL cannot change a saved purchase. Refresh retains its checkout
|
|
1062
|
+
reference. Separate purchasers receive separate checkout and settlement IDs.
|
|
1063
|
+
|
|
1064
|
+
## Invoice and document flow
|
|
1065
|
+
|
|
1066
|
+
Alice issues an Invoice to Bob with `request issue`. For an Organization issuer,
|
|
1067
|
+
Alice uses `org request issue --org ORGANIZATION_ID`. Issuance saves Alice's PDF
|
|
1068
|
+
by default and returns the request ID, document references, and checkout URL.
|
|
1069
|
+
Bob runs `inbox list`, then `inbox get --request-id REQUEST_ID`. An Organization
|
|
1070
|
+
payer uses the equivalent `org inbox` commands with its explicit Organization.
|
|
1071
|
+
|
|
1072
|
+
Bob's Inbox contains the request and document references. It does not receive a
|
|
1073
|
+
local PDF automatically. Bob uses the printed `document render` command to save
|
|
1074
|
+
his copy. Both participants read the same verified document. Their files can
|
|
1075
|
+
have different local paths. `status` shows available request and document counts;
|
|
1076
|
+
it does not download documents.
|
|
1077
|
+
|
|
1078
|
+
A direct Payment uses the existing Payment and Activity commands. Alice inspects
|
|
1079
|
+
her outgoing records. Bob inspects his incoming records after the backend observes
|
|
1080
|
+
them. Available document references can then be rendered by an authorized
|
|
1081
|
+
participant. Issuance, signing, submission, and settlement are separate states.
|
|
1082
|
+
A PDF file or checkout link does not prove that funds moved.
|
|
1083
|
+
|
|
1084
|
+
Cancellation removes the request from the received Inbox list. Because `inbox get`
|
|
1085
|
+
reads that list, it cannot find the cancelled ID. Existing participant document
|
|
1086
|
+
access remains available through the saved document and content hashes. Keep
|
|
1087
|
+
those references when retaining a cancelled Invoice.
|
|
1088
|
+
|
|
1089
|
+
The shared document directory is `documents` next to the CLI settings directory.
|
|
1090
|
+
`CAPXUL_CLI_HOME` selects a separate CLI settings directory. `--output-dir` changes
|
|
1091
|
+
the document output location for supported document and payment commands. Each
|
|
1092
|
+
render preserves previous files. A failed PDF render does not repeat issuance or
|
|
1093
|
+
payment. Retry `document render` with the existing document references.
|
|
1094
|
+
|
|
1095
|
+
## Checkout links
|
|
1096
|
+
|
|
1097
|
+
An Invoice URL has the form `/checkout/invoices/LINK_TOKEN`. An offer URL has the
|
|
1098
|
+
form `/checkout/offers/OFFER_ID`. Use the complete `checkoutUrl` returned by the
|
|
1099
|
+
CLI. Do not build a payment by sending funds directly to the printed Safe.
|
|
1100
|
+
|
|
1101
|
+
A valid Invoice link holder can fund its fixed obligation. The named debtor and
|
|
1102
|
+
actual sender remain separate. Public checkout shows the approved payment
|
|
1103
|
+
summary. It does not expose private billing details or original document bytes.
|
|
1104
|
+
Only authorized participants can open the private Invoice document.
|
|
1105
|
+
|
|
1106
|
+
The checkout page offers registered Account or Organization funding and supported
|
|
1107
|
+
external wallet funding. Registered funding uses the selected actor's authority.
|
|
1108
|
+
External funding requires the correct network, balance, gas, and any exact token
|
|
1109
|
+
approval. Payment goes through the Payments contract with the validated snapshot.
|
|
1110
|
+
Inspect the resulting state and receipt before reporting payment complete.
|
|
1111
|
+
|
|
1112
|
+
CLI `inbox pay` retains its existing CLI signing flow. It does not depend on the
|
|
1113
|
+
hosted checkout page. A rejected signature or uncertain reply is not permission
|
|
1114
|
+
to send another Payment. Use the printed readback and recovery instructions.
|
|
1115
|
+
|
|
1116
|
+
Checkout links do not create recurring billing, automatic debits, booking,
|
|
1117
|
+
refunds, or QR codes.
|
package/dist/browser/signer.js
CHANGED
|
@@ -21347,6 +21347,7 @@
|
|
|
21347
21347
|
});
|
|
21348
21348
|
/** Link holders receive payment terms, not the private Invoice document. */
|
|
21349
21349
|
const InvoiceCheckoutSummarySchema = Struct({
|
|
21350
|
+
documentKind: optional(Literals(["memo", "invoice"])),
|
|
21350
21351
|
linkToken: text$1(128),
|
|
21351
21352
|
issuerLabel: text$1(256),
|
|
21352
21353
|
dueAt: InvoiceDraftSchema.fields.dueAt,
|
|
@@ -21368,7 +21369,7 @@
|
|
|
21368
21369
|
"unavailable"
|
|
21369
21370
|
])
|
|
21370
21371
|
});
|
|
21371
|
-
Struct({
|
|
21372
|
+
const InvoiceCheckoutPreparationSchema = Struct({
|
|
21372
21373
|
invoice: InvoiceCheckoutSummarySchema,
|
|
21373
21374
|
sourceWallet: AddressSchema$1,
|
|
21374
21375
|
allowance: OfferCheckoutPreparationSchema.fields.allowance,
|
|
@@ -21408,6 +21409,44 @@
|
|
|
21408
21409
|
...registeredCheckoutExecutionFields,
|
|
21409
21410
|
invoice: InvoiceCheckoutSummarySchema
|
|
21410
21411
|
});
|
|
21412
|
+
/** Generic request checkout uses the same fixed obligation and receipt contract. */
|
|
21413
|
+
const RequestCheckoutSummarySchema = Struct({
|
|
21414
|
+
...InvoiceCheckoutSummarySchema.fields,
|
|
21415
|
+
documentKind: Literals(["memo", "invoice"])
|
|
21416
|
+
});
|
|
21417
|
+
Struct({
|
|
21418
|
+
request: RequestCheckoutSummarySchema,
|
|
21419
|
+
sourceWallet: InvoiceCheckoutPreparationSchema.fields.sourceWallet,
|
|
21420
|
+
allowance: InvoiceCheckoutPreparationSchema.fields.allowance,
|
|
21421
|
+
approval: InvoiceCheckoutPreparationSchema.fields.approval,
|
|
21422
|
+
payment: InvoiceCheckoutPreparationSchema.fields.payment
|
|
21423
|
+
});
|
|
21424
|
+
const RequestCheckoutStateSchema = Struct({
|
|
21425
|
+
request: RequestCheckoutSummarySchema,
|
|
21426
|
+
verification: InvoiceCheckoutStateSchema.fields.verification,
|
|
21427
|
+
receipt: InvoiceCheckoutStateSchema.fields.receipt,
|
|
21428
|
+
latePayment: InvoiceCheckoutStateSchema.fields.latePayment
|
|
21429
|
+
});
|
|
21430
|
+
Union([
|
|
21431
|
+
Struct({
|
|
21432
|
+
status: Literal("verified"),
|
|
21433
|
+
receipt: CheckoutReceiptSchema,
|
|
21434
|
+
state: RequestCheckoutStateSchema
|
|
21435
|
+
}),
|
|
21436
|
+
Struct({
|
|
21437
|
+
status: Literals(["pending", "provider_failure"]),
|
|
21438
|
+
state: RequestCheckoutStateSchema
|
|
21439
|
+
}),
|
|
21440
|
+
Struct({
|
|
21441
|
+
status: Literal("mismatch"),
|
|
21442
|
+
code: String$1,
|
|
21443
|
+
state: RequestCheckoutStateSchema
|
|
21444
|
+
})
|
|
21445
|
+
]);
|
|
21446
|
+
Struct({
|
|
21447
|
+
...registeredCheckoutExecutionFields,
|
|
21448
|
+
request: RequestCheckoutSummarySchema
|
|
21449
|
+
});
|
|
21411
21450
|
//#endregion
|
|
21412
21451
|
//#region ../../packages/wire/src/bootstrap.ts
|
|
21413
21452
|
const PUBLIC_POSTHOG_PROJECT_TOKEN = /^phc_[A-Za-z0-9_-]{1,191}$/u;
|
|
@@ -21513,6 +21552,13 @@
|
|
|
21513
21552
|
state: "financialOps/offerCheckoutSettlement:state",
|
|
21514
21553
|
reconcile: "financialOps/offerCheckoutSettlement:reconcile"
|
|
21515
21554
|
},
|
|
21555
|
+
"financialOps/requestCheckouts": {
|
|
21556
|
+
summary: "financialOps/requestCheckouts:summary",
|
|
21557
|
+
prepare: "financialOps/requestCheckouts:prepare",
|
|
21558
|
+
state: "financialOps/requestCheckouts:state",
|
|
21559
|
+
reconcile: "financialOps/requestCheckouts:reconcile",
|
|
21560
|
+
prepareRegistered: "financialOps/requestCheckouts:prepareRegistered"
|
|
21561
|
+
},
|
|
21516
21562
|
"financialOps/invoiceCheckouts": {
|
|
21517
21563
|
summary: "financialOps/invoiceCheckouts:summary",
|
|
21518
21564
|
prepare: "financialOps/invoiceCheckouts:prepare",
|
|
@@ -22798,6 +22844,11 @@ body:has(> .capxul-doc){margin:0}
|
|
|
22798
22844
|
deactivate: "offers.deactivate"
|
|
22799
22845
|
},
|
|
22800
22846
|
checkouts: {
|
|
22847
|
+
request: "checkouts.request",
|
|
22848
|
+
prepareRequest: "checkouts.prepareRequest",
|
|
22849
|
+
requestState: "checkouts.requestState",
|
|
22850
|
+
reconcileRequest: "checkouts.reconcileRequest",
|
|
22851
|
+
prepareRequestRegistered: "checkouts.prepareRequestRegistered",
|
|
22801
22852
|
invoice: "checkouts.invoice",
|
|
22802
22853
|
prepareInvoice: "checkouts.prepareInvoice",
|
|
22803
22854
|
invoiceState: "checkouts.invoiceState",
|
|
@@ -85343,8 +85394,9 @@ ${SUCCESS}
|
|
|
85343
85394
|
//#region ../../packages/sdk/src/contract/checkouts.ts
|
|
85344
85395
|
const fns = CAPXUL_FUNCTIONS["financialOps/offerCheckouts"];
|
|
85345
85396
|
const settlement = CAPXUL_FUNCTIONS["financialOps/offerCheckoutSettlement"];
|
|
85397
|
+
const requests = CAPXUL_FUNCTIONS["financialOps/requestCheckouts"];
|
|
85346
85398
|
const invoices = CAPXUL_FUNCTIONS["financialOps/invoiceCheckouts"];
|
|
85347
|
-
invoices.summary, invoices.prepare, invoices.state, invoices.reconcile, CAPXUL_FUNCTIONS["moneyExecution/paymentCommandActions"].prepareInvoiceCheckoutExecution, CAPXUL_FUNCTIONS["moneyExecution/paymentCommandActions"].prepareOfferCheckoutExecution, settlement.state, settlement.reconcile, fns.prepare, fns.offer, fns.create, fns.get;
|
|
85399
|
+
requests.summary, requests.prepare, requests.state, requests.reconcile, requests.prepareRegistered, invoices.summary, invoices.prepare, invoices.state, invoices.reconcile, CAPXUL_FUNCTIONS["moneyExecution/paymentCommandActions"].prepareInvoiceCheckoutExecution, CAPXUL_FUNCTIONS["moneyExecution/paymentCommandActions"].prepareOfferCheckoutExecution, settlement.state, settlement.reconcile, fns.prepare, fns.offer, fns.create, fns.get;
|
|
85348
85400
|
//#endregion
|
|
85349
85401
|
//#region ../../packages/sdk/src/surface/accounts-deps.ts
|
|
85350
85402
|
var AccountsDepsTag = class extends Service()("@capxul/sdk/AccountsDeps") {};
|