@percayso-community/cayso-contracts 0.29.0 → 1.0.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/errors.d.ts CHANGED
@@ -39,11 +39,13 @@
39
39
  * to the unions that own them, so neither can grow a member this union does not
40
40
  * carry. The founder claim's refusals are included the same way, and so are the
41
41
  * commercial payment's, the citizen market's, the marketplace status read's and the
42
- * two marketplace settlements', and the Percayso Cloud's two seams'.
42
+ * two marketplace settlements', the Percayso Cloud's two seams', and the binding of
43
+ * BizID's authority assertion to Percayso ID's.
43
44
  */
45
+ import type { AuthorityBindingRefusal } from './authority.js';
44
46
  import type { FounderClaimRefusal } from './citizenship.js';
45
47
  import type { BuyBackRefusal, QuotePlacementRefusal, QuoteWithdrawalRefusal } from './citizen-market.js';
46
- import type { SettlementAssertionRefusal, StandingAuthorisationRefusal } from './cloud-settlement.js';
48
+ import type { SettlementAssertionRefusal, StandingAuthorisationRefusal, StandingAuthorisationRevocationRefusal, NodeBindingQueryRefusal, NodeBindingRefusal } from './cloud-settlement.js';
47
49
  import type { CitizenTransferRefusal } from './citizen-transfer.js';
48
50
  import type { HandleChangeReceiptReadRefusal, HandleChangeRefusal } from './handle-change.js';
49
51
  import type { CommercialPaymentRefusal } from './commercial-payment.js';
@@ -175,6 +177,68 @@ export type CaysoApiErrorCode =
175
177
  * start.
176
178
  */
177
179
  | 'receipt_signing_not_configured'
180
+ /**
181
+ * This deployment holds no key it may sign an authorisation acknowledgement with,
182
+ * so it publishes no acknowledgement key and signs no acknowledgement (CAY-0093).
183
+ * A closed door, never an empty key set: a verifier reading an empty set would
184
+ * learn nothing true.
185
+ */
186
+ | 'acknowledgement_signing_not_configured'
187
+ /**
188
+ * No standing-authorisation store is wired, so no Instance key can be bound and no
189
+ * authorisation presented or revoked (CAY-0094).
190
+ */
191
+ | 'standing_authorisation_store_not_configured'
192
+ /**
193
+ * The ceiling on what a holder may delegate to an Instance per period is not
194
+ * configured on this deployment, so no standing authorisation is acknowledged
195
+ * (CAY-0094, CAY-0024). The figure is the canon's; unset is a closed door and never
196
+ * "no limit", and it is not `cap_not_delegable`, which says the cap is too high.
197
+ */
198
+ | 'standing_authorisation_cap_ceiling_not_configured'
199
+ /**
200
+ * The ceiling on how long a standing authorisation may live is not configured on
201
+ * this deployment, so none is acknowledged (CAY-0094). The figure is the canon's;
202
+ * unset is a closed door and never "no limit", and it is not
203
+ * `authorisation_outlives_its_ceiling`, which says the authorisation is too long.
204
+ */
205
+ | 'standing_authorisation_life_ceiling_not_configured'
206
+ /**
207
+ * No Node-binding store is wired, so no Node can be bound and the Contribution
208
+ * Store's read of a Node's binding is not answered (CAY-0095). Never "unbound": a
209
+ * read that cannot look must not tell the Store a bound Node's rows are withheld.
210
+ */
211
+ | 'node_binding_store_not_configured'
212
+ /**
213
+ * This deployment has not been told which Node IDs are Core Nodes, so no Node is
214
+ * bound and the Store's read is not answered (CAY-0095): binding one, or answering for
215
+ * one, without knowing would let a Core Node, whose owner is the Operator, earn for a
216
+ * Citizen Wallet. Told "none" is a configuration; untold is a closed door.
217
+ */
218
+ | 'core_node_ids_not_configured'
219
+ /**
220
+ * No Contribution Store issuer is registered on this deployment, so no statement
221
+ * from the Store is verified and the Store's read of a Node's binding is not
222
+ * answered (CAY-0095). Not Store Platform's order keys, which
223
+ * are `marketplace_order_keys_not_configured`'s.
224
+ */
225
+ | 'contribution_store_issuer_not_configured'
226
+ /**
227
+ * No authority issuer is registered on this deployment, so no authority assertion
228
+ * from Percayso BizID is verified and no act that needs one is performed (CAY-0100).
229
+ * A closed door, never a refusal of the assertion and never "act as the Citizen
230
+ * alone". Declared before any route answers it: the binding to the identity
231
+ * assertion is the first to serve it. Not `authority_assertion_invalid`, which says
232
+ * the assertion was presented and refused.
233
+ */
234
+ | 'authority_issuer_not_configured'
235
+ /**
236
+ * No settlement store is wired — this deployment has no Treasury configured, so a
237
+ * contribution has nowhere to be paid from and a consumption nowhere to be paid to
238
+ * — and no settlement assertion is settled (CAY-0096). Never a refusal: the Store's
239
+ * period is not wrong, Cayso is not ready to read it.
240
+ */
241
+ | 'cloud_settlement_store_not_configured'
178
242
  /**
179
243
  * This deployment holds no registry of Store Platform order keys, so no signed
180
244
  * order can be verified and no marketplace operation is served (CAY-0083 §4).
@@ -201,7 +265,7 @@ export type CaysoApiErrorCode =
201
265
  /** There is no such purchase under this caller's wallet. */
202
266
  | 'not_found'
203
267
  /** Something failed on the way and the refusal discloses nothing further. */
204
- | 'internal_error' | PurchaseFailureReason | PurchaseCancelRefusalReason | FounderClaimRefusal | CommercialPaymentRefusal | CitizenTransferRefusal | HandleChangeRefusal | HandleChangeReceiptReadRefusal | QuotePlacementRefusal | QuoteWithdrawalRefusal | BuyBackRefusal | MarketplaceReceiptReadRefusal | MarketplaceOrderRefusal | MarketplaceRefundRefusal | StandingAuthorisationRefusal | SettlementAssertionRefusal;
268
+ | 'internal_error' | PurchaseFailureReason | PurchaseCancelRefusalReason | FounderClaimRefusal | CommercialPaymentRefusal | CitizenTransferRefusal | HandleChangeRefusal | HandleChangeReceiptReadRefusal | QuotePlacementRefusal | QuoteWithdrawalRefusal | BuyBackRefusal | MarketplaceReceiptReadRefusal | MarketplaceOrderRefusal | MarketplaceRefundRefusal | StandingAuthorisationRefusal | StandingAuthorisationRevocationRefusal | NodeBindingRefusal | NodeBindingQueryRefusal | SettlementAssertionRefusal | AuthorityBindingRefusal;
205
269
  /**
206
270
  * The body of every refusal on this surface: one code, and nothing beside it.
207
271
  *
package/dist/index.d.ts CHANGED
@@ -60,10 +60,10 @@
60
60
  * This is the surface of every consumer outside this tree (CAY-0026, Amendment 3):
61
61
  * Piper first, and the Percayso Cloud second, whose two seams with Cayso arrive from
62
62
  * `cloud-settlement`. Peer types, admin types, holdings and carves are deliberately
63
- * not exported here; they are not a consumer's business. The three operator reads an
63
+ * not exported here; they are not a consumer's business. The four operator reads an
64
64
  * operator app's server calls are published, but on their own entry point,
65
- * `@percayso-community/cayso-contracts/operator` (CAY-0026, Amendment 4), and nothing
66
- * here re-exports them: none of this barrel's consumers is an operator.
65
+ * `@percayso-community/cayso-contracts/operator` (CAY-0026, Amendments 4 and 5), and
66
+ * nothing here re-exports them: none of this barrel's consumers is an operator.
67
67
  * And it carries **no numbers** — amounts, rates, tiers, schedules and thresholds
68
68
  * live in the canon PRD and are read from one place, never restated here.
69
69
  */
@@ -76,6 +76,106 @@
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
+ * From `1.0.0` the version follows ordinary semantic versioning (CAY-0101, amending
80
+ * CAY-0086). A minor is additive on the wire and drops nothing: Cayso keeps serving
81
+ * every earlier minor of the same major, so a removal waits for a major. A major is
82
+ * the only breaking kind, and the only time a consumer has to move. A consumer's
83
+ * handshake accepts a Cayso if `contractVersion` or any entry of
84
+ * `supportedContractVersions` is on its own line: from `1.0.0` the same major, below
85
+ * it the same minor.
86
+ *
87
+ * `0.32.0` → `1.0.0` changes nothing but the version. Its content is exactly
88
+ * `0.32.0`'s, and a deployment of it keeps serving `0.32.0`, `0.31.0`, `0.30.0` and
89
+ * `0.29.0` as a declared transition from the `0.x` line, which the next major ends. The
90
+ * entries below are the `0.x` history; "breaking" in them is the package's sense,
91
+ * under which a minor below `1.0.0` was a breaking line.
92
+ *
93
+ * `0.31.0` → `0.32.0` publishes and serves a fourth operator read on the `./operator`
94
+ * entry point, the economy summary, under
95
+ * `read-economy-summary-as-operator` (CAY-0026 Amendment 5): whole-number counts of
96
+ * wallets, movements and purchases, and cent totals of what is minted, cancelled and
97
+ * held, with its closed not-configured body. Nothing in this barrel changed, so no
98
+ * closed table grew: `ROUTES`, `ContractOperation` and `CaysoApiErrorCode` are as
99
+ * `0.31.0` published them. It is additive in the package's sense and on the wire
100
+ * (CAY-0086).
101
+ *
102
+ * `0.30.0` → `0.31.0` publishes BizID's authority assertion (CAY-0100), and serves
103
+ * nothing new: {@link AuthorityClaims}, its {@link AuthorityEnvelope} under the identity
104
+ * assertion's own `AssertionHeader`, and the binding's closed
105
+ * {@link AuthorityBindingRefusal}, which `CaysoApiErrorCode` gains by reference;
106
+ * {@link AUTHORITY_ASSERTION_HEADER}, the header it travels in; {@link isMandateVersion},
107
+ * the one check that `mandateVersion` is a JSON integer of at least 1; the seam code
108
+ * `authority_issuer_not_configured`, which `CaysoApiErrorCode` gains as the authority
109
+ * issuer's closed door and no route emits yet (#417); an optional
110
+ * `auth_time` on {@link AssertionClaims}, which the verifier now admits as a
111
+ * non-negative integer and nothing reads; and an optional per-request authority
112
+ * assertion provider on the thin client's three Organisation operations,
113
+ * `provisionOrganisation`, `makeCommercialPayment` and `authorisePurchase`, sent only
114
+ * when the caller passes one. `organisationAuthority` and `mandateFor` stay, retired
115
+ * and removed by a later breaking step (#419). BREAKING in the package's sense
116
+ * because a closed union grew. Additive on the wire (CAY-0086): no route a `0.30.0`
117
+ * consumer calls changed or answers anything new, because no route reads the header
118
+ * or produces the new codes yet, and a credential a `0.30.0` issuer mints, which
119
+ * carries no `auth_time`, verifies exactly as before.
120
+ *
121
+ * `0.29.0` → `0.30.0` publishes and SERVES Cayso's authorisation acknowledgement keys
122
+ * (CAY-0093): {@link ACKNOWLEDGEMENT_KEYS_ROUTE}, `GET /api/acknowledgement-keys`, an
123
+ * unauthenticated read outside `ROUTES`, described in the schema under `keyRoutes`;
124
+ * the key set it answers, {@link AcknowledgementKeySet} of
125
+ * {@link AcknowledgementPublicKey}, Ed25519 public JSON Web Keys and nothing private;
126
+ * and `CaysoApiErrorCode` gains `acknowledgement_signing_not_configured`, the route's
127
+ * closed door.
128
+ *
129
+ * The same version SERVES the standing authorisation (CAY-0094), published at `0.25.0`
130
+ * and answered until now by the router's `404`: `ROUTES.standingAuthorisation` answers
131
+ * {@link StandingAuthorisationResponse} with an acknowledgement signed under that key.
132
+ * It adds the owner's way to withdraw one: `ROUTES.revokeStandingAuthorisation`,
133
+ * `POST /api/cloud/standing-authorisation-revocations`, mapped to the new operation
134
+ * `'revoke-standing-authorisation'`, money-grade in `ASSURANCE_POLICY`; the client
135
+ * method `revokeStandingAuthorisation`; {@link StandingAuthorisationRevocationRequest},
136
+ * {@link StandingAuthorisationRevocationResponse} and the closed
137
+ * {@link StandingAuthorisationRevocationRefusal}, which `CaysoApiErrorCode` gains by
138
+ * reference; and the seam codes `standing_authorisation_store_not_configured`,
139
+ * `standing_authorisation_cap_ceiling_not_configured` and
140
+ * `standing_authorisation_life_ceiling_not_configured`.
141
+ *
142
+ * The same version publishes and SERVES binding a Node to a wallet (CMTY-0018 §4,
143
+ * CAY-0095): `ROUTES.bindNode`, `POST /api/cloud/node-bindings`, mapped to the new
144
+ * operation `'bind-node'`, money-grade in `ASSURANCE_POLICY`; the client method
145
+ * `bindNode`; {@link NodePresentationClaims}, {@link NodeBindingRequest},
146
+ * {@link NodeBindingResponse} and the closed {@link NodeBindingRefusal}. Beside it, the
147
+ * Contribution Store's read of whether a Node is bound: {@link NODE_BINDING_QUERY_ROUTE},
148
+ * `POST /api/cloud/node-binding-queries`, outside `ROUTES` and in the schema under
149
+ * `issuerRoutes`, authenticated by the registered Store issuer; {@link
150
+ * NodeBindingQueryClaims}, {@link NodeBindingQueryRequest}, the answer
151
+ * {@link NodeBindingStatus} — `nodeId` and `bound` and nothing else — and the closed
152
+ * {@link NodeBindingQueryRefusal}. `CaysoApiErrorCode` gains both unions by reference
153
+ * and the seam codes `node_binding_store_not_configured`, `core_node_ids_not_configured`
154
+ * and `contribution_store_issuer_not_configured`.
155
+ *
156
+ * The same version SERVES the Contribution Store's settlement assertion (CMTY-0018 §2,
157
+ * CAY-0096) at {@link CLOUD_SETTLEMENT_ROUTE}, published at `0.25.0` and answered until
158
+ * now by the router's `404`. A settled period writes one `contribution_settlement`
159
+ * movement per paid contribution row and one `consumption_settlement` per consumption
160
+ * row, so `MovementKind` and `MOVEMENT_KINDS` gain both. The closed refusal unions gain
161
+ * the members the write needs: {@link SettlementAssertionLevelRefusal} gains
162
+ * `settlement_period_not_recognised`, `settlement_period_not_ended` and
163
+ * `settlement_carve_contended`; {@link ContributionRowRefusal} gains
164
+ * `contribution_node_is_a_core_node` and `contribution_treasury_short`;
165
+ * {@link ConsumptionRowRefusal} gains `consumption_authorisation_not_in_force` and
166
+ * `consumption_wallet_short`. `CaysoApiErrorCode` gains them by reference and the seam
167
+ * code `cloud_settlement_store_not_configured`.
168
+ *
169
+ * BREAKING in the package's sense because closed tables grew: `ROUTES`,
170
+ * `ContractOperation`, `CaysoApiErrorCode`, `MovementKind` and the settlement's refusal
171
+ * unions. Additive on the wire (CAY-0086): no route a `0.29.0` consumer could reach
172
+ * changed, because the only ones that answer differently are the standing
173
+ * authorisation and the settlement assertion, which no deployment served before, and
174
+ * they answer the shapes `0.25.0` published, a member those shapes' unions gained, or a
175
+ * new seam code no served route emits. The operator movement list can now carry the two
176
+ * new kinds, and it is read only by the admin app in this tree, released with it. The
177
+ * two Node routes are ones a `0.29.0` consumer cannot name.
178
+ *
79
179
  * `0.28.0` → `0.29.0` publishes and SERVES the Handle change (CAY-0091):
80
180
  * `ROUTES.handleChange`, `POST /api/handle-changes`, mapped to the new operation
81
181
  * `'change-handle'`, money-grade in `ASSURANCE_POLICY`; `ROUTES.handleChangeReceipt`,
@@ -552,7 +652,7 @@
552
652
  * have needed a breaking bump on their own. Under semver below `1.0.0` the minor
553
653
  * is where a breaking change goes, so the minor moves and the patch does not.
554
654
  */
555
- export declare const CONTRACT_VERSION: "0.29.0";
655
+ export declare const CONTRACT_VERSION: "1.0.0";
556
656
  /** The package's own name, so a consumer can name what it depends on. */
557
657
  export declare const packageName = "@percayso-community/cayso-contracts";
558
658
  /**
@@ -576,6 +676,18 @@ export { ROUTES } from './routes.js';
576
676
  * no operation, no assurance bar and no client method.
577
677
  */
578
678
  export { CLOUD_SETTLEMENT_ROUTE } from './routes.js';
679
+ /**
680
+ * Where the Contribution Store asks whether a Node is bound (CAY-0095). A value beside
681
+ * `ROUTES` and never in it, for the settlement path's reason: it is authenticated by
682
+ * the registered Store issuer, not by a person.
683
+ */
684
+ export { NODE_BINDING_QUERY_ROUTE } from './routes.js';
685
+ /**
686
+ * Where Cayso publishes its authorisation acknowledgement keys (CAY-0093). A value
687
+ * beside `ROUTES` and never in it: an unauthenticated read of a public key carries no
688
+ * identity, so it has no operation, no assurance bar and no client method.
689
+ */
690
+ export { ACKNOWLEDGEMENT_KEYS_ROUTE } from './routes.js';
579
691
  /**
580
692
  * The purchase lifecycle's runtime half (CAY-0032): which statuses a purchase
581
693
  * never leaves, the predicate over them, and the window an authorisation holds its
@@ -617,6 +729,17 @@ export { NOT_PROVISIONED } from './citizenship.js';
617
729
  * exception to keeping numbers in the canon PRD; no economic figure is here.
618
730
  */
619
731
  export { MAX_ASSERTION_LIFETIME_SECONDS, CLOCK_SKEW_TOLERANCE_SECONDS, MINIMUM_ASSERTION_USE_RETENTION_SECONDS, } from './assertion.js';
732
+ /**
733
+ * The request header BizID's authority assertion travels in, beside the identity
734
+ * assertion's `Authorization` (CAY-0100 §4). A value so a consumer and the service
735
+ * spell it from one place; the reasoning behind the name is on the constant.
736
+ */
737
+ export { AUTHORITY_ASSERTION_HEADER } from './authority.js';
738
+ /**
739
+ * Whether a value is a well-formed `AuthorityClaims.mandateVersion`: a JSON integer of at
740
+ * least 1, BizID's mandate version counter (CAY-0100 §5). The one check of the shape.
741
+ */
742
+ export { isMandateVersion } from './authority.js';
620
743
  /**
621
744
  * The assurance profile (CAY-0029): what each `VerificationMethod` asserts, which
622
745
  * methods each operation accepts, and the version a claim is minted under.
@@ -702,8 +825,9 @@ export type { HandleChangeReceiptStatement, HandleChangeReceipt, HandleChangeCha
702
825
  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
826
  export type { MarketplaceReceiptSignatureAlgorithm, MarketplaceReceiptKeyId, MarketplaceSaleKind, MarketplaceReceiptLeg, MarketplaceSettlementReceiptStatement, HousePublisherChargeReceiptStatement, ThirdPartyRefundReceiptStatement, HousePublisherRefundReceiptStatement, MarketplaceReceiptStatement, MarketplaceReceipt, MarketplaceReceiptReadRequest, MarketplaceReceiptFound, MarketplaceNoMovement, MarketplaceReceiptReadRefusal, MarketplaceReceiptReadRefused, MarketplaceReceiptReadResponse, } from './marketplace-receipt.js';
704
827
  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';
828
+ 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
829
  export type { PurchaseRequest, PurchaseAuthorised, PurchaseTerminal, PurchaseUnresolved, PurchaseRefused, PurchaseAuthorisationResponse, PurchaseFailureReason, PurchaseStatus, LivePurchaseStatus, TerminalPurchaseStatus, PurchaseCancelRefusalReason, PurchaseCancelled, PurchaseCancelRefused, PurchaseCancelResponse, PurchaseResult, } from './purchase.js';
707
830
  export type { VerificationMethod, VerificationStatus, SubjectPersonhood, AssertionClaims, AssertionHeader, AssertionEnvelope, ContractOperation, InternalOperation, ScopeKey, } from './assertion.js';
831
+ export type { AuthorityClaims, AuthorityEnvelope, AuthorityBindingRefusal } from './authority.js';
708
832
  export type { VerificationEvidence, EvidenceStatement, MethodDecision, MethodDecisions, AssuranceRequired, AssuranceNotRequired, OperationAssurance, AssuranceRefusalReason, AssuranceAssessment, } from './assurance.js';
709
833
  export type { Restriction, HoldingKind, HoldingCapability, PermittedStanding, RefusedStanding, OpenStanding, CapabilityStanding, CapabilityCell, CapabilityCoordinate, CapabilityPolicy, ArrivalAndExpiry, } from './restriction.js';
package/dist/index.js CHANGED
@@ -75,10 +75,10 @@
75
75
  * This is the surface of every consumer outside this tree (CAY-0026, Amendment 3):
76
76
  * Piper first, and the Percayso Cloud second, whose two seams with Cayso arrive from
77
77
  * `cloud-settlement`. Peer types, admin types, holdings and carves are deliberately
78
- * not exported here; they are not a consumer's business. The three operator reads an
78
+ * not exported here; they are not a consumer's business. The four operator reads an
79
79
  * operator app's server calls are published, but on their own entry point,
80
- * `@percayso-community/cayso-contracts/operator` (CAY-0026, Amendment 4), and nothing
81
- * here re-exports them: none of this barrel's consumers is an operator.
80
+ * `@percayso-community/cayso-contracts/operator` (CAY-0026, Amendments 4 and 5), and
81
+ * nothing here re-exports them: none of this barrel's consumers is an operator.
82
82
  * And it carries **no numbers** — amounts, rates, tiers, schedules and thresholds
83
83
  * live in the canon PRD and are read from one place, never restated here.
84
84
  */
@@ -92,6 +92,106 @@
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
+ * From `1.0.0` the version follows ordinary semantic versioning (CAY-0101, amending
96
+ * CAY-0086). A minor is additive on the wire and drops nothing: Cayso keeps serving
97
+ * every earlier minor of the same major, so a removal waits for a major. A major is
98
+ * the only breaking kind, and the only time a consumer has to move. A consumer's
99
+ * handshake accepts a Cayso if `contractVersion` or any entry of
100
+ * `supportedContractVersions` is on its own line: from `1.0.0` the same major, below
101
+ * it the same minor.
102
+ *
103
+ * `0.32.0` → `1.0.0` changes nothing but the version. Its content is exactly
104
+ * `0.32.0`'s, and a deployment of it keeps serving `0.32.0`, `0.31.0`, `0.30.0` and
105
+ * `0.29.0` as a declared transition from the `0.x` line, which the next major ends. The
106
+ * entries below are the `0.x` history; "breaking" in them is the package's sense,
107
+ * under which a minor below `1.0.0` was a breaking line.
108
+ *
109
+ * `0.31.0` → `0.32.0` publishes and serves a fourth operator read on the `./operator`
110
+ * entry point, the economy summary, under
111
+ * `read-economy-summary-as-operator` (CAY-0026 Amendment 5): whole-number counts of
112
+ * wallets, movements and purchases, and cent totals of what is minted, cancelled and
113
+ * held, with its closed not-configured body. Nothing in this barrel changed, so no
114
+ * closed table grew: `ROUTES`, `ContractOperation` and `CaysoApiErrorCode` are as
115
+ * `0.31.0` published them. It is additive in the package's sense and on the wire
116
+ * (CAY-0086).
117
+ *
118
+ * `0.30.0` → `0.31.0` publishes BizID's authority assertion (CAY-0100), and serves
119
+ * nothing new: {@link AuthorityClaims}, its {@link AuthorityEnvelope} under the identity
120
+ * assertion's own `AssertionHeader`, and the binding's closed
121
+ * {@link AuthorityBindingRefusal}, which `CaysoApiErrorCode` gains by reference;
122
+ * {@link AUTHORITY_ASSERTION_HEADER}, the header it travels in; {@link isMandateVersion},
123
+ * the one check that `mandateVersion` is a JSON integer of at least 1; the seam code
124
+ * `authority_issuer_not_configured`, which `CaysoApiErrorCode` gains as the authority
125
+ * issuer's closed door and no route emits yet (#417); an optional
126
+ * `auth_time` on {@link AssertionClaims}, which the verifier now admits as a
127
+ * non-negative integer and nothing reads; and an optional per-request authority
128
+ * assertion provider on the thin client's three Organisation operations,
129
+ * `provisionOrganisation`, `makeCommercialPayment` and `authorisePurchase`, sent only
130
+ * when the caller passes one. `organisationAuthority` and `mandateFor` stay, retired
131
+ * and removed by a later breaking step (#419). BREAKING in the package's sense
132
+ * because a closed union grew. Additive on the wire (CAY-0086): no route a `0.30.0`
133
+ * consumer calls changed or answers anything new, because no route reads the header
134
+ * or produces the new codes yet, and a credential a `0.30.0` issuer mints, which
135
+ * carries no `auth_time`, verifies exactly as before.
136
+ *
137
+ * `0.29.0` → `0.30.0` publishes and SERVES Cayso's authorisation acknowledgement keys
138
+ * (CAY-0093): {@link ACKNOWLEDGEMENT_KEYS_ROUTE}, `GET /api/acknowledgement-keys`, an
139
+ * unauthenticated read outside `ROUTES`, described in the schema under `keyRoutes`;
140
+ * the key set it answers, {@link AcknowledgementKeySet} of
141
+ * {@link AcknowledgementPublicKey}, Ed25519 public JSON Web Keys and nothing private;
142
+ * and `CaysoApiErrorCode` gains `acknowledgement_signing_not_configured`, the route's
143
+ * closed door.
144
+ *
145
+ * The same version SERVES the standing authorisation (CAY-0094), published at `0.25.0`
146
+ * and answered until now by the router's `404`: `ROUTES.standingAuthorisation` answers
147
+ * {@link StandingAuthorisationResponse} with an acknowledgement signed under that key.
148
+ * It adds the owner's way to withdraw one: `ROUTES.revokeStandingAuthorisation`,
149
+ * `POST /api/cloud/standing-authorisation-revocations`, mapped to the new operation
150
+ * `'revoke-standing-authorisation'`, money-grade in `ASSURANCE_POLICY`; the client
151
+ * method `revokeStandingAuthorisation`; {@link StandingAuthorisationRevocationRequest},
152
+ * {@link StandingAuthorisationRevocationResponse} and the closed
153
+ * {@link StandingAuthorisationRevocationRefusal}, which `CaysoApiErrorCode` gains by
154
+ * reference; and the seam codes `standing_authorisation_store_not_configured`,
155
+ * `standing_authorisation_cap_ceiling_not_configured` and
156
+ * `standing_authorisation_life_ceiling_not_configured`.
157
+ *
158
+ * The same version publishes and SERVES binding a Node to a wallet (CMTY-0018 §4,
159
+ * CAY-0095): `ROUTES.bindNode`, `POST /api/cloud/node-bindings`, mapped to the new
160
+ * operation `'bind-node'`, money-grade in `ASSURANCE_POLICY`; the client method
161
+ * `bindNode`; {@link NodePresentationClaims}, {@link NodeBindingRequest},
162
+ * {@link NodeBindingResponse} and the closed {@link NodeBindingRefusal}. Beside it, the
163
+ * Contribution Store's read of whether a Node is bound: {@link NODE_BINDING_QUERY_ROUTE},
164
+ * `POST /api/cloud/node-binding-queries`, outside `ROUTES` and in the schema under
165
+ * `issuerRoutes`, authenticated by the registered Store issuer; {@link
166
+ * NodeBindingQueryClaims}, {@link NodeBindingQueryRequest}, the answer
167
+ * {@link NodeBindingStatus} — `nodeId` and `bound` and nothing else — and the closed
168
+ * {@link NodeBindingQueryRefusal}. `CaysoApiErrorCode` gains both unions by reference
169
+ * and the seam codes `node_binding_store_not_configured`, `core_node_ids_not_configured`
170
+ * and `contribution_store_issuer_not_configured`.
171
+ *
172
+ * The same version SERVES the Contribution Store's settlement assertion (CMTY-0018 §2,
173
+ * CAY-0096) at {@link CLOUD_SETTLEMENT_ROUTE}, published at `0.25.0` and answered until
174
+ * now by the router's `404`. A settled period writes one `contribution_settlement`
175
+ * movement per paid contribution row and one `consumption_settlement` per consumption
176
+ * row, so `MovementKind` and `MOVEMENT_KINDS` gain both. The closed refusal unions gain
177
+ * the members the write needs: {@link SettlementAssertionLevelRefusal} gains
178
+ * `settlement_period_not_recognised`, `settlement_period_not_ended` and
179
+ * `settlement_carve_contended`; {@link ContributionRowRefusal} gains
180
+ * `contribution_node_is_a_core_node` and `contribution_treasury_short`;
181
+ * {@link ConsumptionRowRefusal} gains `consumption_authorisation_not_in_force` and
182
+ * `consumption_wallet_short`. `CaysoApiErrorCode` gains them by reference and the seam
183
+ * code `cloud_settlement_store_not_configured`.
184
+ *
185
+ * BREAKING in the package's sense because closed tables grew: `ROUTES`,
186
+ * `ContractOperation`, `CaysoApiErrorCode`, `MovementKind` and the settlement's refusal
187
+ * unions. Additive on the wire (CAY-0086): no route a `0.29.0` consumer could reach
188
+ * changed, because the only ones that answer differently are the standing
189
+ * authorisation and the settlement assertion, which no deployment served before, and
190
+ * they answer the shapes `0.25.0` published, a member those shapes' unions gained, or a
191
+ * new seam code no served route emits. The operator movement list can now carry the two
192
+ * new kinds, and it is read only by the admin app in this tree, released with it. The
193
+ * two Node routes are ones a `0.29.0` consumer cannot name.
194
+ *
95
195
  * `0.28.0` → `0.29.0` publishes and SERVES the Handle change (CAY-0091):
96
196
  * `ROUTES.handleChange`, `POST /api/handle-changes`, mapped to the new operation
97
197
  * `'change-handle'`, money-grade in `ASSURANCE_POLICY`; `ROUTES.handleChangeReceipt`,
@@ -568,7 +668,7 @@
568
668
  * have needed a breaking bump on their own. Under semver below `1.0.0` the minor
569
669
  * is where a breaking change goes, so the minor moves and the patch does not.
570
670
  */
571
- export const CONTRACT_VERSION = '0.29.0';
671
+ export const CONTRACT_VERSION = '1.0.0';
572
672
  /** The package's own name, so a consumer can name what it depends on. */
573
673
  export const packageName = '@percayso-community/cayso-contracts';
574
674
  /**
@@ -592,6 +692,18 @@ export { ROUTES } from './routes.js';
592
692
  * no operation, no assurance bar and no client method.
593
693
  */
594
694
  export { CLOUD_SETTLEMENT_ROUTE } from './routes.js';
695
+ /**
696
+ * Where the Contribution Store asks whether a Node is bound (CAY-0095). A value beside
697
+ * `ROUTES` and never in it, for the settlement path's reason: it is authenticated by
698
+ * the registered Store issuer, not by a person.
699
+ */
700
+ export { NODE_BINDING_QUERY_ROUTE } from './routes.js';
701
+ /**
702
+ * Where Cayso publishes its authorisation acknowledgement keys (CAY-0093). A value
703
+ * beside `ROUTES` and never in it: an unauthenticated read of a public key carries no
704
+ * identity, so it has no operation, no assurance bar and no client method.
705
+ */
706
+ export { ACKNOWLEDGEMENT_KEYS_ROUTE } from './routes.js';
595
707
  /**
596
708
  * The purchase lifecycle's runtime half (CAY-0032): which statuses a purchase
597
709
  * never leaves, the predicate over them, and the window an authorisation holds its
@@ -633,6 +745,17 @@ export { NOT_PROVISIONED } from './citizenship.js';
633
745
  * exception to keeping numbers in the canon PRD; no economic figure is here.
634
746
  */
635
747
  export { MAX_ASSERTION_LIFETIME_SECONDS, CLOCK_SKEW_TOLERANCE_SECONDS, MINIMUM_ASSERTION_USE_RETENTION_SECONDS, } from './assertion.js';
748
+ /**
749
+ * The request header BizID's authority assertion travels in, beside the identity
750
+ * assertion's `Authorization` (CAY-0100 §4). A value so a consumer and the service
751
+ * spell it from one place; the reasoning behind the name is on the constant.
752
+ */
753
+ export { AUTHORITY_ASSERTION_HEADER } from './authority.js';
754
+ /**
755
+ * Whether a value is a well-formed `AuthorityClaims.mandateVersion`: a JSON integer of at
756
+ * least 1, BizID's mandate version counter (CAY-0100 §5). The one check of the shape.
757
+ */
758
+ export { isMandateVersion } from './authority.js';
636
759
  /**
637
760
  * The assurance profile (CAY-0029): what each `VerificationMethod` asserts, which
638
761
  * methods each operation accepts, and the version a claim is minted under.