@percayso-community/cayso-contracts 0.29.0 → 0.30.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/README.md +38 -14
- package/dist/assertion.d.ts +12 -2
- package/dist/assurance.js +37 -0
- package/dist/client.d.ts +24 -3
- package/dist/client.js +18 -0
- package/dist/cloud-settlement.d.ts +336 -20
- package/dist/contract-schema.generated.js +490 -2
- package/dist/errors.d.ts +55 -2
- package/dist/index.d.ts +72 -2
- package/dist/index.js +71 -1
- package/dist/operator.d.ts +6 -1
- package/dist/operator.js +2 -0
- package/dist/routes.d.ts +68 -3
- package/dist/routes.js +65 -3
- package/dist/schema-types.d.ts +12 -2
- package/dist/schema.d.ts +20 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,64 @@
|
|
|
76
76
|
* this money surface gains that Piper's own contracts lack, since theirs share
|
|
77
77
|
* one global version bumped across all twenty-two together (CAY-0026).
|
|
78
78
|
*
|
|
79
|
+
* `0.29.0` → `0.30.0` publishes and SERVES Cayso's authorisation acknowledgement keys
|
|
80
|
+
* (CAY-0093): {@link ACKNOWLEDGEMENT_KEYS_ROUTE}, `GET /api/acknowledgement-keys`, an
|
|
81
|
+
* unauthenticated read outside `ROUTES`, described in the schema under `keyRoutes`;
|
|
82
|
+
* the key set it answers, {@link AcknowledgementKeySet} of
|
|
83
|
+
* {@link AcknowledgementPublicKey}, Ed25519 public JSON Web Keys and nothing private;
|
|
84
|
+
* and `CaysoApiErrorCode` gains `acknowledgement_signing_not_configured`, the route's
|
|
85
|
+
* closed door.
|
|
86
|
+
*
|
|
87
|
+
* The same version SERVES the standing authorisation (CAY-0094), published at `0.25.0`
|
|
88
|
+
* and answered until now by the router's `404`: `ROUTES.standingAuthorisation` answers
|
|
89
|
+
* {@link StandingAuthorisationResponse} with an acknowledgement signed under that key.
|
|
90
|
+
* It adds the owner's way to withdraw one: `ROUTES.revokeStandingAuthorisation`,
|
|
91
|
+
* `POST /api/cloud/standing-authorisation-revocations`, mapped to the new operation
|
|
92
|
+
* `'revoke-standing-authorisation'`, money-grade in `ASSURANCE_POLICY`; the client
|
|
93
|
+
* method `revokeStandingAuthorisation`; {@link StandingAuthorisationRevocationRequest},
|
|
94
|
+
* {@link StandingAuthorisationRevocationResponse} and the closed
|
|
95
|
+
* {@link StandingAuthorisationRevocationRefusal}, which `CaysoApiErrorCode` gains by
|
|
96
|
+
* reference; and the seam codes `standing_authorisation_store_not_configured`,
|
|
97
|
+
* `standing_authorisation_cap_ceiling_not_configured` and
|
|
98
|
+
* `standing_authorisation_life_ceiling_not_configured`.
|
|
99
|
+
*
|
|
100
|
+
* The same version publishes and SERVES binding a Node to a wallet (CMTY-0018 §4,
|
|
101
|
+
* CAY-0095): `ROUTES.bindNode`, `POST /api/cloud/node-bindings`, mapped to the new
|
|
102
|
+
* operation `'bind-node'`, money-grade in `ASSURANCE_POLICY`; the client method
|
|
103
|
+
* `bindNode`; {@link NodePresentationClaims}, {@link NodeBindingRequest},
|
|
104
|
+
* {@link NodeBindingResponse} and the closed {@link NodeBindingRefusal}. Beside it, the
|
|
105
|
+
* Contribution Store's read of whether a Node is bound: {@link NODE_BINDING_QUERY_ROUTE},
|
|
106
|
+
* `POST /api/cloud/node-binding-queries`, outside `ROUTES` and in the schema under
|
|
107
|
+
* `issuerRoutes`, authenticated by the registered Store issuer; {@link
|
|
108
|
+
* NodeBindingQueryClaims}, {@link NodeBindingQueryRequest}, the answer
|
|
109
|
+
* {@link NodeBindingStatus} — `nodeId` and `bound` and nothing else — and the closed
|
|
110
|
+
* {@link NodeBindingQueryRefusal}. `CaysoApiErrorCode` gains both unions by reference
|
|
111
|
+
* and the seam codes `node_binding_store_not_configured`, `core_node_ids_not_configured`
|
|
112
|
+
* and `contribution_store_issuer_not_configured`.
|
|
113
|
+
*
|
|
114
|
+
* The same version SERVES the Contribution Store's settlement assertion (CMTY-0018 §2,
|
|
115
|
+
* CAY-0096) at {@link CLOUD_SETTLEMENT_ROUTE}, published at `0.25.0` and answered until
|
|
116
|
+
* now by the router's `404`. A settled period writes one `contribution_settlement`
|
|
117
|
+
* movement per paid contribution row and one `consumption_settlement` per consumption
|
|
118
|
+
* row, so `MovementKind` and `MOVEMENT_KINDS` gain both. The closed refusal unions gain
|
|
119
|
+
* the members the write needs: {@link SettlementAssertionLevelRefusal} gains
|
|
120
|
+
* `settlement_period_not_recognised`, `settlement_period_not_ended` and
|
|
121
|
+
* `settlement_carve_contended`; {@link ContributionRowRefusal} gains
|
|
122
|
+
* `contribution_node_is_a_core_node` and `contribution_treasury_short`;
|
|
123
|
+
* {@link ConsumptionRowRefusal} gains `consumption_authorisation_not_in_force` and
|
|
124
|
+
* `consumption_wallet_short`. `CaysoApiErrorCode` gains them by reference and the seam
|
|
125
|
+
* code `cloud_settlement_store_not_configured`.
|
|
126
|
+
*
|
|
127
|
+
* BREAKING in the package's sense because closed tables grew: `ROUTES`,
|
|
128
|
+
* `ContractOperation`, `CaysoApiErrorCode`, `MovementKind` and the settlement's refusal
|
|
129
|
+
* unions. Additive on the wire (CAY-0086): no route a `0.29.0` consumer could reach
|
|
130
|
+
* changed, because the only ones that answer differently are the standing
|
|
131
|
+
* authorisation and the settlement assertion, which no deployment served before, and
|
|
132
|
+
* they answer the shapes `0.25.0` published, a member those shapes' unions gained, or a
|
|
133
|
+
* new seam code no served route emits. The operator movement list can now carry the two
|
|
134
|
+
* new kinds, and it is read only by the admin app in this tree, released with it. The
|
|
135
|
+
* two Node routes are ones a `0.29.0` consumer cannot name.
|
|
136
|
+
*
|
|
79
137
|
* `0.28.0` → `0.29.0` publishes and SERVES the Handle change (CAY-0091):
|
|
80
138
|
* `ROUTES.handleChange`, `POST /api/handle-changes`, mapped to the new operation
|
|
81
139
|
* `'change-handle'`, money-grade in `ASSURANCE_POLICY`; `ROUTES.handleChangeReceipt`,
|
|
@@ -552,7 +610,7 @@
|
|
|
552
610
|
* have needed a breaking bump on their own. Under semver below `1.0.0` the minor
|
|
553
611
|
* is where a breaking change goes, so the minor moves and the patch does not.
|
|
554
612
|
*/
|
|
555
|
-
export declare const CONTRACT_VERSION: "0.
|
|
613
|
+
export declare const CONTRACT_VERSION: "0.30.0";
|
|
556
614
|
/** The package's own name, so a consumer can name what it depends on. */
|
|
557
615
|
export declare const packageName = "@percayso-community/cayso-contracts";
|
|
558
616
|
/**
|
|
@@ -576,6 +634,18 @@ export { ROUTES } from './routes.js';
|
|
|
576
634
|
* no operation, no assurance bar and no client method.
|
|
577
635
|
*/
|
|
578
636
|
export { CLOUD_SETTLEMENT_ROUTE } from './routes.js';
|
|
637
|
+
/**
|
|
638
|
+
* Where the Contribution Store asks whether a Node is bound (CAY-0095). A value beside
|
|
639
|
+
* `ROUTES` and never in it, for the settlement path's reason: it is authenticated by
|
|
640
|
+
* the registered Store issuer, not by a person.
|
|
641
|
+
*/
|
|
642
|
+
export { NODE_BINDING_QUERY_ROUTE } from './routes.js';
|
|
643
|
+
/**
|
|
644
|
+
* Where Cayso publishes its authorisation acknowledgement keys (CAY-0093). A value
|
|
645
|
+
* beside `ROUTES` and never in it: an unauthenticated read of a public key carries no
|
|
646
|
+
* identity, so it has no operation, no assurance bar and no client method.
|
|
647
|
+
*/
|
|
648
|
+
export { ACKNOWLEDGEMENT_KEYS_ROUTE } from './routes.js';
|
|
579
649
|
/**
|
|
580
650
|
* The purchase lifecycle's runtime half (CAY-0032): which statuses a purchase
|
|
581
651
|
* never leaves, the predicate over them, and the window an authorisation holds its
|
|
@@ -702,7 +772,7 @@ export type { HandleChangeReceiptStatement, HandleChangeReceipt, HandleChangeCha
|
|
|
702
772
|
export type { QuoteSide, QuoteRequest, Quote, QuotePlaced, QuoteRefused, QuoteResponse, QuoteEntryRefusal, QuotePlacementRefusal, QuoteWithdrawalRequest, QuoteWithdrawal, QuoteWithdrawn, QuoteWithdrawalRefused, QuoteWithdrawalResponse, QuoteWithdrawalRefusal, BuyBackRequest, BuyBack, BuyBackMade, BuyBackRefused, BuyBackResponse, BuyBackRefusal, BookLevel, QuoteStatus, QuoteWithdrawalReason, OwnQuote, OwnQuoteNotWithdrawn, OwnQuoteWithdrawn, CitizenMarketView, CitizenMarketViewed, CitizenMarketViewRefusal, CitizenMarketViewRefused, CitizenMarketResponse, } from './citizen-market.js';
|
|
703
773
|
export type { MarketplaceReceiptSignatureAlgorithm, MarketplaceReceiptKeyId, MarketplaceSaleKind, MarketplaceReceiptLeg, MarketplaceSettlementReceiptStatement, HousePublisherChargeReceiptStatement, ThirdPartyRefundReceiptStatement, HousePublisherRefundReceiptStatement, MarketplaceReceiptStatement, MarketplaceReceipt, MarketplaceReceiptReadRequest, MarketplaceReceiptFound, MarketplaceNoMovement, MarketplaceReceiptReadRefusal, MarketplaceReceiptReadRefused, MarketplaceReceiptReadResponse, } from './marketplace-receipt.js';
|
|
704
774
|
export type { StoreSignedStatement, MarketplaceOrderRequest, MarketplaceRefundRequest, MarketplaceOrderReceipt, MarketplaceRefundReceipt, MarketplaceOrderSettled, MarketplaceOrderRefused, MarketplaceOrderResponse, MarketplaceOrderRefusal, MarketplaceRefundSettled, MarketplaceRefundRefused, MarketplaceRefundResponse, MarketplaceRefundRefusal, } from './marketplace-settlement.js';
|
|
705
|
-
export type { InstanceKeyId, SettlementPeriodRule, SettlementPeriodId, NodeId, ContributionStoreIssuer, PercaysoCloudAudience, StandingAuthorisationClaims, StandingAuthorisationRequest, AuthorisationAcknowledgementClaims, StandingAuthorisationAcknowledged, StandingAuthorisationRefused, StandingAuthorisationResponse, StandingAuthorisationRefusal, ContributionType, SettlementPeriod, ContributionWithheldReason, ContributionQualified, ContributionWithheld, ContributionQualification, ContributionRow, ConsumptionRow, SettlementTotals, SettlementAssertionClaims, SettlementAssertionRequest, SettlementAssertionSettled, SettlementAssertionRefused, ContributionRowRefused, ConsumptionRowRefused, SettlementAssertionResponse, SettlementAssertionLevelRefusal, ContributionRowRefusal, ConsumptionRowRefusal, SettlementAssertionRefusal, } from './cloud-settlement.js';
|
|
775
|
+
export type { InstanceKeyId, SettlementPeriodRule, SettlementPeriodId, NodeId, ContributionStoreIssuer, PercaysoCloudAudience, StandingAuthorisationClaims, StandingAuthorisationRequest, AuthorisationAcknowledgementClaims, AcknowledgementKeyId, AcknowledgementPublicKey, AcknowledgementKeySet, StandingAuthorisationAcknowledged, StandingAuthorisationRefused, StandingAuthorisationResponse, StandingAuthorisationRefusal, StandingAuthorisationRevocationRequest, StandingAuthorisationRevoked, StandingAuthorisationRevocationRefused, StandingAuthorisationRevocationResponse, StandingAuthorisationRevocationRefusal, NodePresentationClaims, NodeBindingRequest, NodeBound, NodeBindingRefused, NodeBindingResponse, NodeBindingRefusal, NodeBindingQueryClaims, NodeBindingQueryRequest, NodeBindingStatus, NodeBindingQueryRefused, NodeBindingQueryRefusal, ContributionType, SettlementPeriod, ContributionWithheldReason, ContributionQualified, ContributionWithheld, ContributionQualification, ContributionRow, ConsumptionRow, SettlementTotals, SettlementAssertionClaims, SettlementAssertionRequest, SettlementAssertionSettled, SettlementAssertionRefused, ContributionRowRefused, ConsumptionRowRefused, SettlementAssertionResponse, SettlementAssertionLevelRefusal, ContributionRowRefusal, ConsumptionRowRefusal, SettlementAssertionRefusal, } from './cloud-settlement.js';
|
|
706
776
|
export type { PurchaseRequest, PurchaseAuthorised, PurchaseTerminal, PurchaseUnresolved, PurchaseRefused, PurchaseAuthorisationResponse, PurchaseFailureReason, PurchaseStatus, LivePurchaseStatus, TerminalPurchaseStatus, PurchaseCancelRefusalReason, PurchaseCancelled, PurchaseCancelRefused, PurchaseCancelResponse, PurchaseResult, } from './purchase.js';
|
|
707
777
|
export type { VerificationMethod, VerificationStatus, SubjectPersonhood, AssertionClaims, AssertionHeader, AssertionEnvelope, ContractOperation, InternalOperation, ScopeKey, } from './assertion.js';
|
|
708
778
|
export type { VerificationEvidence, EvidenceStatement, MethodDecision, MethodDecisions, AssuranceRequired, AssuranceNotRequired, OperationAssurance, AssuranceRefusalReason, AssuranceAssessment, } from './assurance.js';
|
package/dist/index.js
CHANGED
|
@@ -92,6 +92,64 @@
|
|
|
92
92
|
* this money surface gains that Piper's own contracts lack, since theirs share
|
|
93
93
|
* one global version bumped across all twenty-two together (CAY-0026).
|
|
94
94
|
*
|
|
95
|
+
* `0.29.0` → `0.30.0` publishes and SERVES Cayso's authorisation acknowledgement keys
|
|
96
|
+
* (CAY-0093): {@link ACKNOWLEDGEMENT_KEYS_ROUTE}, `GET /api/acknowledgement-keys`, an
|
|
97
|
+
* unauthenticated read outside `ROUTES`, described in the schema under `keyRoutes`;
|
|
98
|
+
* the key set it answers, {@link AcknowledgementKeySet} of
|
|
99
|
+
* {@link AcknowledgementPublicKey}, Ed25519 public JSON Web Keys and nothing private;
|
|
100
|
+
* and `CaysoApiErrorCode` gains `acknowledgement_signing_not_configured`, the route's
|
|
101
|
+
* closed door.
|
|
102
|
+
*
|
|
103
|
+
* The same version SERVES the standing authorisation (CAY-0094), published at `0.25.0`
|
|
104
|
+
* and answered until now by the router's `404`: `ROUTES.standingAuthorisation` answers
|
|
105
|
+
* {@link StandingAuthorisationResponse} with an acknowledgement signed under that key.
|
|
106
|
+
* It adds the owner's way to withdraw one: `ROUTES.revokeStandingAuthorisation`,
|
|
107
|
+
* `POST /api/cloud/standing-authorisation-revocations`, mapped to the new operation
|
|
108
|
+
* `'revoke-standing-authorisation'`, money-grade in `ASSURANCE_POLICY`; the client
|
|
109
|
+
* method `revokeStandingAuthorisation`; {@link StandingAuthorisationRevocationRequest},
|
|
110
|
+
* {@link StandingAuthorisationRevocationResponse} and the closed
|
|
111
|
+
* {@link StandingAuthorisationRevocationRefusal}, which `CaysoApiErrorCode` gains by
|
|
112
|
+
* reference; and the seam codes `standing_authorisation_store_not_configured`,
|
|
113
|
+
* `standing_authorisation_cap_ceiling_not_configured` and
|
|
114
|
+
* `standing_authorisation_life_ceiling_not_configured`.
|
|
115
|
+
*
|
|
116
|
+
* The same version publishes and SERVES binding a Node to a wallet (CMTY-0018 §4,
|
|
117
|
+
* CAY-0095): `ROUTES.bindNode`, `POST /api/cloud/node-bindings`, mapped to the new
|
|
118
|
+
* operation `'bind-node'`, money-grade in `ASSURANCE_POLICY`; the client method
|
|
119
|
+
* `bindNode`; {@link NodePresentationClaims}, {@link NodeBindingRequest},
|
|
120
|
+
* {@link NodeBindingResponse} and the closed {@link NodeBindingRefusal}. Beside it, the
|
|
121
|
+
* Contribution Store's read of whether a Node is bound: {@link NODE_BINDING_QUERY_ROUTE},
|
|
122
|
+
* `POST /api/cloud/node-binding-queries`, outside `ROUTES` and in the schema under
|
|
123
|
+
* `issuerRoutes`, authenticated by the registered Store issuer; {@link
|
|
124
|
+
* NodeBindingQueryClaims}, {@link NodeBindingQueryRequest}, the answer
|
|
125
|
+
* {@link NodeBindingStatus} — `nodeId` and `bound` and nothing else — and the closed
|
|
126
|
+
* {@link NodeBindingQueryRefusal}. `CaysoApiErrorCode` gains both unions by reference
|
|
127
|
+
* and the seam codes `node_binding_store_not_configured`, `core_node_ids_not_configured`
|
|
128
|
+
* and `contribution_store_issuer_not_configured`.
|
|
129
|
+
*
|
|
130
|
+
* The same version SERVES the Contribution Store's settlement assertion (CMTY-0018 §2,
|
|
131
|
+
* CAY-0096) at {@link CLOUD_SETTLEMENT_ROUTE}, published at `0.25.0` and answered until
|
|
132
|
+
* now by the router's `404`. A settled period writes one `contribution_settlement`
|
|
133
|
+
* movement per paid contribution row and one `consumption_settlement` per consumption
|
|
134
|
+
* row, so `MovementKind` and `MOVEMENT_KINDS` gain both. The closed refusal unions gain
|
|
135
|
+
* the members the write needs: {@link SettlementAssertionLevelRefusal} gains
|
|
136
|
+
* `settlement_period_not_recognised`, `settlement_period_not_ended` and
|
|
137
|
+
* `settlement_carve_contended`; {@link ContributionRowRefusal} gains
|
|
138
|
+
* `contribution_node_is_a_core_node` and `contribution_treasury_short`;
|
|
139
|
+
* {@link ConsumptionRowRefusal} gains `consumption_authorisation_not_in_force` and
|
|
140
|
+
* `consumption_wallet_short`. `CaysoApiErrorCode` gains them by reference and the seam
|
|
141
|
+
* code `cloud_settlement_store_not_configured`.
|
|
142
|
+
*
|
|
143
|
+
* BREAKING in the package's sense because closed tables grew: `ROUTES`,
|
|
144
|
+
* `ContractOperation`, `CaysoApiErrorCode`, `MovementKind` and the settlement's refusal
|
|
145
|
+
* unions. Additive on the wire (CAY-0086): no route a `0.29.0` consumer could reach
|
|
146
|
+
* changed, because the only ones that answer differently are the standing
|
|
147
|
+
* authorisation and the settlement assertion, which no deployment served before, and
|
|
148
|
+
* they answer the shapes `0.25.0` published, a member those shapes' unions gained, or a
|
|
149
|
+
* new seam code no served route emits. The operator movement list can now carry the two
|
|
150
|
+
* new kinds, and it is read only by the admin app in this tree, released with it. The
|
|
151
|
+
* two Node routes are ones a `0.29.0` consumer cannot name.
|
|
152
|
+
*
|
|
95
153
|
* `0.28.0` → `0.29.0` publishes and SERVES the Handle change (CAY-0091):
|
|
96
154
|
* `ROUTES.handleChange`, `POST /api/handle-changes`, mapped to the new operation
|
|
97
155
|
* `'change-handle'`, money-grade in `ASSURANCE_POLICY`; `ROUTES.handleChangeReceipt`,
|
|
@@ -568,7 +626,7 @@
|
|
|
568
626
|
* have needed a breaking bump on their own. Under semver below `1.0.0` the minor
|
|
569
627
|
* is where a breaking change goes, so the minor moves and the patch does not.
|
|
570
628
|
*/
|
|
571
|
-
export const CONTRACT_VERSION = '0.
|
|
629
|
+
export const CONTRACT_VERSION = '0.30.0';
|
|
572
630
|
/** The package's own name, so a consumer can name what it depends on. */
|
|
573
631
|
export const packageName = '@percayso-community/cayso-contracts';
|
|
574
632
|
/**
|
|
@@ -592,6 +650,18 @@ export { ROUTES } from './routes.js';
|
|
|
592
650
|
* no operation, no assurance bar and no client method.
|
|
593
651
|
*/
|
|
594
652
|
export { CLOUD_SETTLEMENT_ROUTE } from './routes.js';
|
|
653
|
+
/**
|
|
654
|
+
* Where the Contribution Store asks whether a Node is bound (CAY-0095). A value beside
|
|
655
|
+
* `ROUTES` and never in it, for the settlement path's reason: it is authenticated by
|
|
656
|
+
* the registered Store issuer, not by a person.
|
|
657
|
+
*/
|
|
658
|
+
export { NODE_BINDING_QUERY_ROUTE } from './routes.js';
|
|
659
|
+
/**
|
|
660
|
+
* Where Cayso publishes its authorisation acknowledgement keys (CAY-0093). A value
|
|
661
|
+
* beside `ROUTES` and never in it: an unauthenticated read of a public key carries no
|
|
662
|
+
* identity, so it has no operation, no assurance bar and no client method.
|
|
663
|
+
*/
|
|
664
|
+
export { ACKNOWLEDGEMENT_KEYS_ROUTE } from './routes.js';
|
|
595
665
|
/**
|
|
596
666
|
* The purchase lifecycle's runtime half (CAY-0032): which statuses a purchase
|
|
597
667
|
* never leaves, the predicate over them, and the window an authorisation holds its
|
package/dist/operator.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export declare const OPERATOR_READ_ROUTES: {
|
|
|
85
85
|
* movement list's `kind` filter refuses anything outside it (`400 invalid_kind`), and
|
|
86
86
|
* every row's `kind` is one of these.
|
|
87
87
|
*/
|
|
88
|
-
export type MovementKind = 'issuance' | 'purchase' | 'grant' | 'charge' | 'payout' | 'transfer' | 'burn' | 'forfeit' | 'commercial_payment' | 'quoted_sale' | 'buy_back' | 'quoted_sale_compensation' | 'marketplace_settlement';
|
|
88
|
+
export type MovementKind = 'issuance' | 'purchase' | 'grant' | 'charge' | 'payout' | 'transfer' | 'burn' | 'forfeit' | 'commercial_payment' | 'quoted_sale' | 'buy_back' | 'quoted_sale_compensation' | 'marketplace_settlement' | 'contribution_settlement' | 'consumption_settlement';
|
|
89
89
|
/** Every {@link MovementKind}, in the service's order — for a filter a person picks from. */
|
|
90
90
|
export declare const MOVEMENT_KINDS: readonly MovementKind[];
|
|
91
91
|
/**
|
|
@@ -101,6 +101,11 @@ export declare const MOVEMENT_KINDS: readonly MovementKind[];
|
|
|
101
101
|
* publisher's Citizen Wallet and `cents` the whole price the buyer paid. The Community
|
|
102
102
|
* leg's share of it went to the Treasury inside the same movement, and the row does not
|
|
103
103
|
* itemise it; the signed receipt names both legs (CAY-0090).
|
|
104
|
+
*
|
|
105
|
+
* A `contribution_settlement` runs from the Treasury to a Node's wallet, and a
|
|
106
|
+
* `consumption_settlement` from an Instance's wallet to the Treasury: one per row of a
|
|
107
|
+
* settled Cloud period (CAY-0096). Neither row names the Node, the authorisation or
|
|
108
|
+
* the period; the wallet ids are the handle here as everywhere.
|
|
104
109
|
*/
|
|
105
110
|
export interface OperatorMovementRow {
|
|
106
111
|
/** The row's own opaque handle: a stable list key, not an identity. */
|
package/dist/operator.js
CHANGED
package/dist/routes.d.ts
CHANGED
|
@@ -119,13 +119,34 @@
|
|
|
119
119
|
* authorisation under the owner's assertion (`present-standing-authorisation`,
|
|
120
120
|
* CMTY-0018 §1). A person is behind it, so it is classified by a person's
|
|
121
121
|
* assurance like every other entry. It names no wallet: the wallet is the verified
|
|
122
|
-
* holder's own.
|
|
122
|
+
* holder's own. Published at `0.25.0` and served from `0.30.0` (CAY-0094).
|
|
123
|
+
*
|
|
124
|
+
* `revokeStandingAuthorisation` withdraws one (`revoke-standing-authorisation`). It
|
|
125
|
+
* is its own path for citizenship's reason, and a `POST` for cancelling's: nothing is
|
|
126
|
+
* deleted. The authorisation's row stays, and so does its Instance key's binding to
|
|
127
|
+
* the wallet; the revocation is a row of its own beside them. The body names the
|
|
128
|
+
* authorisation's `jti` and no wallet.
|
|
129
|
+
*
|
|
130
|
+
* `bindNode` binds a Node to the wallet its presenting Instance key is already bound
|
|
131
|
+
* to (`bind-node`, CAY-0095), under the owner's assertion. A person is behind it, so
|
|
132
|
+
* it is classified by a person's assurance. The body carries the Node ID signed by the
|
|
133
|
+
* Instance key and that key's public half, and no wallet: the wallet is the one the
|
|
134
|
+
* key is bound to, which must be the verified holder's own. A `POST` to a collection
|
|
135
|
+
* of bindings, because a Node is bound once and a repeat answers the same.
|
|
123
136
|
*
|
|
124
137
|
* The Contribution Store's settlement assertion is presented by no person. Its path
|
|
125
138
|
* is {@link CLOUD_SETTLEMENT_ROUTE}, outside this table, because every entry here is
|
|
126
139
|
* mapped in `OPERATION_FOR_ROUTE` to the assurance a person needs, and `null` there
|
|
127
140
|
* means "carries no identity", which is false of an assertion a registered issuer
|
|
128
|
-
* signed.
|
|
141
|
+
* signed. The Store's read of whether a Node is bound,
|
|
142
|
+
* {@link NODE_BINDING_QUERY_ROUTE}, is outside it for the same reason.
|
|
143
|
+
*
|
|
144
|
+
* ## Why Cayso's acknowledgement keys are outside this table too
|
|
145
|
+
*
|
|
146
|
+
* {@link ACKNOWLEDGEMENT_KEYS_ROUTE} publishes the public half of the key Cayso signs
|
|
147
|
+
* an authorisation acknowledgement with. It carries no identity at all, so it is not
|
|
148
|
+
* a person's operation either, and it is read by the Percayso Cloud's software rather
|
|
149
|
+
* than by a person's, so the client has no method for it.
|
|
129
150
|
*/
|
|
130
151
|
export declare const ROUTES: {
|
|
131
152
|
readonly wallet: {
|
|
@@ -200,6 +221,14 @@ export declare const ROUTES: {
|
|
|
200
221
|
readonly method: "POST";
|
|
201
222
|
readonly path: "/api/cloud/standing-authorisations";
|
|
202
223
|
};
|
|
224
|
+
readonly revokeStandingAuthorisation: {
|
|
225
|
+
readonly method: "POST";
|
|
226
|
+
readonly path: "/api/cloud/standing-authorisation-revocations";
|
|
227
|
+
};
|
|
228
|
+
readonly bindNode: {
|
|
229
|
+
readonly method: "POST";
|
|
230
|
+
readonly path: "/api/cloud/node-bindings";
|
|
231
|
+
};
|
|
203
232
|
readonly version: {
|
|
204
233
|
readonly method: "GET";
|
|
205
234
|
readonly path: "/api/version";
|
|
@@ -217,9 +246,45 @@ export declare const ROUTES: {
|
|
|
217
246
|
* in {@link ROUTES}, whose every entry is classified by a person's assurance. The
|
|
218
247
|
* client has no method for it, because no person's software calls it.
|
|
219
248
|
*
|
|
220
|
-
* Published
|
|
249
|
+
* Published at `0.25.0` and served from `0.30.0` (CAY-0096): a settled period is one
|
|
250
|
+
* `contribution_settlement` movement per paid contribution row and one
|
|
251
|
+
* `consumption_settlement` movement per consumption row, written whole or not at all.
|
|
221
252
|
*/
|
|
222
253
|
export declare const CLOUD_SETTLEMENT_ROUTE: {
|
|
223
254
|
readonly method: "POST";
|
|
224
255
|
readonly path: "/api/cloud/settlement-assertions";
|
|
225
256
|
};
|
|
257
|
+
/**
|
|
258
|
+
* Where the Percayso Cloud's Contribution Store asks whether one Node is bound to a
|
|
259
|
+
* wallet (CMTY-0018 §4, CAY-0095), so it can carry an unbound Node's rows withheld
|
|
260
|
+
* (`node_not_bound`) rather than pay them to nobody.
|
|
261
|
+
*
|
|
262
|
+
* **Authenticated by the registered Store issuer, exactly as
|
|
263
|
+
* {@link CLOUD_SETTLEMENT_ROUTE} is, and never by a person.** The body is the Store's
|
|
264
|
+
* own signed query, naming the one Node it asks about, so a captured query answers
|
|
265
|
+
* for that Node and no other. A person issuer's key is never the Store's, so a query
|
|
266
|
+
* a person signed is refused. It answers `{ nodeId, bound }` and nothing else: no
|
|
267
|
+
* wallet, holder, Citizen or date crosses to the Cloud. A `POST` because the question
|
|
268
|
+
* travels signed in the body; nothing is written. Not in {@link ROUTES}, and no
|
|
269
|
+
* client method, because no person's software calls it.
|
|
270
|
+
*/
|
|
271
|
+
export declare const NODE_BINDING_QUERY_ROUTE: {
|
|
272
|
+
readonly method: "POST";
|
|
273
|
+
readonly path: "/api/cloud/node-binding-queries";
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Where Cayso publishes the public half of every key it signs an authorisation
|
|
277
|
+
* acknowledgement with (CMTY-0018 §1, CMTY-0022 row 9): a JSON Web Key Set the
|
|
278
|
+
* Percayso Cloud reads to verify an acknowledgement an Instance hands it.
|
|
279
|
+
*
|
|
280
|
+
* **An unauthenticated read**, because a public key is public: it carries no
|
|
281
|
+
* identity, names no wallet and moves nothing. Not in {@link ROUTES}, whose every
|
|
282
|
+
* entry is classified by a person's assurance, and no client method, because no
|
|
283
|
+
* person's software calls it. A deployment holding no acknowledgement key answers
|
|
284
|
+
* `503 acknowledgement_signing_not_configured`, never an empty set a verifier would
|
|
285
|
+
* read as "Cayso signs nothing".
|
|
286
|
+
*/
|
|
287
|
+
export declare const ACKNOWLEDGEMENT_KEYS_ROUTE: {
|
|
288
|
+
readonly method: "GET";
|
|
289
|
+
readonly path: "/api/acknowledgement-keys";
|
|
290
|
+
};
|
package/dist/routes.js
CHANGED
|
@@ -134,13 +134,34 @@
|
|
|
134
134
|
* authorisation under the owner's assertion (`present-standing-authorisation`,
|
|
135
135
|
* CMTY-0018 §1). A person is behind it, so it is classified by a person's
|
|
136
136
|
* assurance like every other entry. It names no wallet: the wallet is the verified
|
|
137
|
-
* holder's own.
|
|
137
|
+
* holder's own. Published at `0.25.0` and served from `0.30.0` (CAY-0094).
|
|
138
|
+
*
|
|
139
|
+
* `revokeStandingAuthorisation` withdraws one (`revoke-standing-authorisation`). It
|
|
140
|
+
* is its own path for citizenship's reason, and a `POST` for cancelling's: nothing is
|
|
141
|
+
* deleted. The authorisation's row stays, and so does its Instance key's binding to
|
|
142
|
+
* the wallet; the revocation is a row of its own beside them. The body names the
|
|
143
|
+
* authorisation's `jti` and no wallet.
|
|
144
|
+
*
|
|
145
|
+
* `bindNode` binds a Node to the wallet its presenting Instance key is already bound
|
|
146
|
+
* to (`bind-node`, CAY-0095), under the owner's assertion. A person is behind it, so
|
|
147
|
+
* it is classified by a person's assurance. The body carries the Node ID signed by the
|
|
148
|
+
* Instance key and that key's public half, and no wallet: the wallet is the one the
|
|
149
|
+
* key is bound to, which must be the verified holder's own. A `POST` to a collection
|
|
150
|
+
* of bindings, because a Node is bound once and a repeat answers the same.
|
|
138
151
|
*
|
|
139
152
|
* The Contribution Store's settlement assertion is presented by no person. Its path
|
|
140
153
|
* is {@link CLOUD_SETTLEMENT_ROUTE}, outside this table, because every entry here is
|
|
141
154
|
* mapped in `OPERATION_FOR_ROUTE` to the assurance a person needs, and `null` there
|
|
142
155
|
* means "carries no identity", which is false of an assertion a registered issuer
|
|
143
|
-
* signed.
|
|
156
|
+
* signed. The Store's read of whether a Node is bound,
|
|
157
|
+
* {@link NODE_BINDING_QUERY_ROUTE}, is outside it for the same reason.
|
|
158
|
+
*
|
|
159
|
+
* ## Why Cayso's acknowledgement keys are outside this table too
|
|
160
|
+
*
|
|
161
|
+
* {@link ACKNOWLEDGEMENT_KEYS_ROUTE} publishes the public half of the key Cayso signs
|
|
162
|
+
* an authorisation acknowledgement with. It carries no identity at all, so it is not
|
|
163
|
+
* a person's operation either, and it is read by the Percayso Cloud's software rather
|
|
164
|
+
* than by a person's, so the client has no method for it.
|
|
144
165
|
*/
|
|
145
166
|
export const ROUTES = {
|
|
146
167
|
wallet: { method: 'GET', path: '/api/wallet' },
|
|
@@ -161,6 +182,11 @@ export const ROUTES = {
|
|
|
161
182
|
requestBuyBack: { method: 'POST', path: '/api/buy-backs' },
|
|
162
183
|
marketplaceOrder: { method: 'POST', path: '/api/marketplace/orders' },
|
|
163
184
|
standingAuthorisation: { method: 'POST', path: '/api/cloud/standing-authorisations' },
|
|
185
|
+
revokeStandingAuthorisation: {
|
|
186
|
+
method: 'POST',
|
|
187
|
+
path: '/api/cloud/standing-authorisation-revocations',
|
|
188
|
+
},
|
|
189
|
+
bindNode: { method: 'POST', path: '/api/cloud/node-bindings' },
|
|
164
190
|
version: { method: 'GET', path: '/api/version' },
|
|
165
191
|
};
|
|
166
192
|
/**
|
|
@@ -175,9 +201,45 @@ export const ROUTES = {
|
|
|
175
201
|
* in {@link ROUTES}, whose every entry is classified by a person's assurance. The
|
|
176
202
|
* client has no method for it, because no person's software calls it.
|
|
177
203
|
*
|
|
178
|
-
* Published
|
|
204
|
+
* Published at `0.25.0` and served from `0.30.0` (CAY-0096): a settled period is one
|
|
205
|
+
* `contribution_settlement` movement per paid contribution row and one
|
|
206
|
+
* `consumption_settlement` movement per consumption row, written whole or not at all.
|
|
179
207
|
*/
|
|
180
208
|
export const CLOUD_SETTLEMENT_ROUTE = {
|
|
181
209
|
method: 'POST',
|
|
182
210
|
path: '/api/cloud/settlement-assertions',
|
|
183
211
|
};
|
|
212
|
+
/**
|
|
213
|
+
* Where the Percayso Cloud's Contribution Store asks whether one Node is bound to a
|
|
214
|
+
* wallet (CMTY-0018 §4, CAY-0095), so it can carry an unbound Node's rows withheld
|
|
215
|
+
* (`node_not_bound`) rather than pay them to nobody.
|
|
216
|
+
*
|
|
217
|
+
* **Authenticated by the registered Store issuer, exactly as
|
|
218
|
+
* {@link CLOUD_SETTLEMENT_ROUTE} is, and never by a person.** The body is the Store's
|
|
219
|
+
* own signed query, naming the one Node it asks about, so a captured query answers
|
|
220
|
+
* for that Node and no other. A person issuer's key is never the Store's, so a query
|
|
221
|
+
* a person signed is refused. It answers `{ nodeId, bound }` and nothing else: no
|
|
222
|
+
* wallet, holder, Citizen or date crosses to the Cloud. A `POST` because the question
|
|
223
|
+
* travels signed in the body; nothing is written. Not in {@link ROUTES}, and no
|
|
224
|
+
* client method, because no person's software calls it.
|
|
225
|
+
*/
|
|
226
|
+
export const NODE_BINDING_QUERY_ROUTE = {
|
|
227
|
+
method: 'POST',
|
|
228
|
+
path: '/api/cloud/node-binding-queries',
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Where Cayso publishes the public half of every key it signs an authorisation
|
|
232
|
+
* acknowledgement with (CMTY-0018 §1, CMTY-0022 row 9): a JSON Web Key Set the
|
|
233
|
+
* Percayso Cloud reads to verify an acknowledgement an Instance hands it.
|
|
234
|
+
*
|
|
235
|
+
* **An unauthenticated read**, because a public key is public: it carries no
|
|
236
|
+
* identity, names no wallet and moves nothing. Not in {@link ROUTES}, whose every
|
|
237
|
+
* entry is classified by a person's assurance, and no client method, because no
|
|
238
|
+
* person's software calls it. A deployment holding no acknowledgement key answers
|
|
239
|
+
* `503 acknowledgement_signing_not_configured`, never an empty set a verifier would
|
|
240
|
+
* read as "Cayso signs nothing".
|
|
241
|
+
*/
|
|
242
|
+
export const ACKNOWLEDGEMENT_KEYS_ROUTE = {
|
|
243
|
+
method: 'GET',
|
|
244
|
+
path: '/api/acknowledgement-keys',
|
|
245
|
+
};
|
package/dist/schema-types.d.ts
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
* consumer's business, Piper's or the Percayso Cloud's, and a schema that
|
|
24
24
|
* enumerated the operator surface would have published it (CAY-0026, Amendment 3;
|
|
25
25
|
* CLAUDE.md). The Contribution Store's settlement path is published, but under
|
|
26
|
-
* `issuerRoutes`, apart from the routes a person calls
|
|
26
|
+
* `issuerRoutes`, apart from the routes a person calls, and Cayso's acknowledgement keys
|
|
27
|
+
* under `keyRoutes`. The generator only ever sees this package, so the
|
|
27
28
|
* internal surface is absent by construction.
|
|
28
29
|
*
|
|
29
30
|
* The one part of the operator surface that IS published — the three reads on the
|
|
@@ -129,10 +130,19 @@ export interface ContractSchema {
|
|
|
129
130
|
/**
|
|
130
131
|
* The routes authenticated by a registered issuer (CAY-0030) rather than by a
|
|
131
132
|
* person, and therefore not in `ROUTES`: today the Contribution Store's
|
|
132
|
-
* settlement path (`CLOUD_SETTLEMENT_ROUTE`, CMTY-0018 §2)
|
|
133
|
+
* settlement path (`CLOUD_SETTLEMENT_ROUTE`, CMTY-0018 §2) and its read of whether a
|
|
134
|
+
* Node is bound (`NODE_BINDING_QUERY_ROUTE`, CAY-0095). Kept apart from
|
|
133
135
|
* {@link routes} so that no consumer reads one as the other.
|
|
134
136
|
*/
|
|
135
137
|
readonly issuerRoutes: Readonly<Record<string, SchemaRoute>>;
|
|
138
|
+
/**
|
|
139
|
+
* The unauthenticated reads that publish the public half of a key Cayso signs
|
|
140
|
+
* with, and therefore not in `ROUTES` either: today the authorisation
|
|
141
|
+
* acknowledgement keys (`ACKNOWLEDGEMENT_KEYS_ROUTE`, CAY-0093). No credential
|
|
142
|
+
* travels with them, so they are apart from both {@link routes} and
|
|
143
|
+
* {@link issuerRoutes}.
|
|
144
|
+
*/
|
|
145
|
+
readonly keyRoutes: Readonly<Record<string, SchemaRoute>>;
|
|
136
146
|
readonly types: Readonly<Record<string, SchemaType>>;
|
|
137
147
|
/**
|
|
138
148
|
* The operator reads an operator app's server calls, and their types — under
|
package/dist/schema.d.ts
CHANGED
|
@@ -10,15 +10,27 @@
|
|
|
10
10
|
* none of this, and importing it does nothing but hand back a frozen data value
|
|
11
11
|
* and its types (CLAUDE.md: packages have no side effects on import).
|
|
12
12
|
*
|
|
13
|
-
* ##
|
|
13
|
+
* ## A published, versioned surface — and the one a Go consumer depends on
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
15
|
+
* Two consumers read this descriptor, in two ways, and both are depending on the
|
|
16
|
+
* package (CAY-0026 Amendment 3; CMTY-0018 §3 as amended):
|
|
17
|
+
*
|
|
18
|
+
* - **A TypeScript consumer imports the types** and the compiler holds the
|
|
19
|
+
* surface; for it this descriptor is a tool *about* the contract — the version
|
|
20
|
+
* endpoint, the CI contract test, an operator eyeballing a mismatch — and never
|
|
21
|
+
* a runtime type system standing in for the import.
|
|
22
|
+
* - **A consumer in another language generates from this entry point of the
|
|
23
|
+
* published tarball at a pinned version**, and fails its own build when its
|
|
24
|
+
* generated types drift from the schema. The Percayso Cloud is that consumer: it
|
|
25
|
+
* is written in Go, cannot import a TypeScript type, and generates its types for
|
|
26
|
+
* the two seams in `cloud-settlement` from the tarball it pins. The pin is its
|
|
27
|
+
* lockfile entry and the regeneration is its compile. The schema ships as a JS
|
|
28
|
+
* module only, which is why the generator reads the tarball.
|
|
29
|
+
*
|
|
30
|
+
* What is refused is reading the schema OFF THE WIRE (`GET /api/version/schema`)
|
|
31
|
+
* as a substitute for pinning the package: that couples a consumer's build to a
|
|
32
|
+
* deployment's uptime and replaces a pinned version with whatever is deployed. The
|
|
33
|
+
* endpoint reports a running deployment; the package is the contract (the README).
|
|
22
34
|
*/
|
|
23
35
|
export type { ContractSchema, ScalarKind, SchemaProperty, SchemaOperatorRoute, SchemaOperatorSurface, SchemaRoute, SchemaType, SchemaTypeNode, } from './schema-types.js';
|
|
24
36
|
export { CONTRACT_SCHEMA } from './contract-schema.generated.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percayso-community/cayso-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "The versioned capability contract surface through which anything outside this repository reads a wallet. Published; keep it the surface of every consumer outside this tree, Piper and the Percayso Cloud, and nothing internal.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|