@hyperscale0/hsx 1.0.350 → 1.0.352
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/src/std-bundle.d.ts +1 -1
- package/dist/src/std-bundle.js +1 -1
- package/package.json +5 -5
- package/src/std-bundle.ts +1 -1
package/dist/src/std-bundle.d.ts
CHANGED
package/dist/src/std-bundle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by open/hsx/scripts/bundle-std.ts. Do not edit by hand.
|
|
2
|
-
export const HSX_VERSION = "1.0.
|
|
2
|
+
export const HSX_VERSION = "1.0.352";
|
|
3
3
|
export const BUNDLED_STD_HEADERS = new Map([
|
|
4
4
|
["booking", "header booking\n\n// Economics: Deposit and balance payments and every refund are principal. Completion\n// and any forfeit are earnings for the company, or pass the customer's cash through\n// to a bound outside operator.\n\n// Expose create, pay_deposit and pay_balance for the booking path, and\n// cancel_early, cancel_middle and cancel_late for the customer. Create captures\n// subject departure, price, deposit and balance, and refuses a deposit and balance\n// that do not add up to the price. Both installments must be positive. Creation\n// and deposit payment close at the balance cutoff. The balance is payable only after the deposit\n// and before balance_due ahead of departure, so a cancelled booking never offers\n// it. cancel_early runs until early_until before departure and returns everything\n// held. cancel_middle runs from then until late_from; cancel_late runs from then\n// until departure, even when the clock's complete runs late. They keep\n// middle_forfeit or late_forfeit of the held money and return the rest. Both\n// forfeits default to 0%, so nothing is kept unless the author sets them. At\n// departure the clock completes a paid booking and pays operator, and lapses an\n// unpaid one on cancel_late's terms, so nothing stays held after departure.\n\n// Cost: create declares one owned account. Each payment declares one transfer;\n// cancellation and completion move the held balance. Run hsx cost for the\n// composed counts.\n\ninstrument reservation(customer: party = party(person), operator: party = programOperator, early_until: duration = 30d, late_from: duration = 15d, balance_due: duration = 15d, middle_forfeit: percent = 0%, late_forfeit: percent = 0%) {\n checks {\n late_from < early_until {\n message: \"Attachment `{attachment}` sets `late_from` at or above `early_until`, so the late cancellation window opens before the early one closes.\"\n fix: \"Choose a `late_from` shorter than `early_until`, such as `early_until: 30d, late_from: 15d`.\"\n }\n middle_forfeit is percent {\n message: \"`middle_forfeit` is the share of the held money a middle cancellation keeps, from 0% to 100%.\"\n fix: \"Write `middle_forfeit` as a percentage from 0% to 100%, such as `middle_forfeit: 25%`.\"\n }\n late_forfeit is percent {\n message: \"`late_forfeit` is the share of the held money a late cancellation keeps, from 0% to 100%.\"\n fix: \"Write `late_forfeit` as a percentage from 0% to 100%, such as `late_forfeit: 50%`.\"\n }\n }\n revisioned: true\n summary: \"Take a deposit and a balance for a dated booking, with cancellation windows before departure.\"\n fields {\n customer: account of customer, operator: account of operator, held: account of self\n departure: date, price: money = subject.price\n deposit: money = subject.deposit, balance: money = subject.balance\n split: money = sum(self.deposit, self.balance)\n balanceAt: date = before(self.departure, balance_due)\n earlyAt: date = before(self.departure, early_until)\n lateAt: date = before(self.departure, late_from)\n refund: money?, forfeit: money?\n }\n lifecycle { states: [reserved, deposit_paid, paid, completed, cancelled], initial: reserved }\n action create {\n subject { departure: date, price: money, deposit: money, balance: money }\n actor: { party: customer }\n requires self.balanceAt > self.now\n requires self.departure > self.balanceAt\n requires self.deposit > \"0\"\n requires self.balance > \"0\"\n requires self.split == self.price\n }\n action pay_deposit {\n from: reserved, to: deposit_paid, actor: { party: customer }, deadline: { at: self.balanceAt }\n moves self.deposit from customer to self.held economics { purpose: principal, sourceParty: customer }\n }\n action pay_balance {\n from: deposit_paid, to: paid, actor: { party: customer }, deadline: { at: self.balanceAt }\n moves self.balance from customer to self.held economics { purpose: principal, sourceParty: customer }\n }\n action complete {\n from: paid, to: completed, actor: clock, due: { at: self.departure }\n moves self.held.balance from self.held to operator economics { recipient: operator, company: { purpose: earning, sourceParty: customer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action cancel_early { allowZero: true,\n from: [reserved, deposit_paid, paid], to: cancelled, actor: { party: customer }, deadline: { at: self.earlyAt }\n moves self.held.balance from self.held to customer economics { purpose: principal, sourceParty: programOperator }\n }\n action cancel_middle { allowZero: true,\n from: [reserved, deposit_paid, paid], to: cancelled, actor: { party: customer }, due: { at: self.earlyAt }, deadline: { at: self.lateAt }\n calculate: [{ target: forfeit, op: rate, base: { field: self.held.balance }, bps: { literal: middle_forfeit }, rounding: floor }, { target: refund, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.forfeit }] }]\n moves self.refund from self.held to customer economics { purpose: principal, sourceParty: programOperator }; moves self.forfeit from self.held to operator economics { recipient: operator, company: { purpose: earning, sourceParty: customer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action cancel_late { allowZero: true,\n from: [reserved, deposit_paid, paid], to: cancelled, actor: { party: customer }, due: { at: self.lateAt }, deadline: { at: self.departure }\n calculate: [{ target: forfeit, op: rate, base: { field: self.held.balance }, bps: { literal: late_forfeit }, rounding: floor }, { target: refund, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.forfeit }] }]\n moves self.refund from self.held to customer economics { purpose: principal, sourceParty: programOperator }; moves self.forfeit from self.held to operator economics { recipient: operator, company: { purpose: earning, sourceParty: customer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action lapse { allowZero: true,\n from: [reserved, deposit_paid], to: cancelled, actor: clock, due: { at: self.departure }\n calculate: [{ target: forfeit, op: rate, base: { field: self.held.balance }, bps: { literal: late_forfeit }, rounding: floor }, { target: refund, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.forfeit }] }]\n moves self.refund from self.held to customer economics { purpose: principal, sourceParty: programOperator }; moves self.forfeit from self.held to operator economics { recipient: operator, company: { purpose: earning, sourceParty: customer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n}\n"],
|
|
5
5
|
["cards", "header cards\n\n// Activate holder and card before creating and approving an authorization.\n// Only the Product operator activates, suspends or resumes a cardholder; the\n// cardholder or the Product operator closes it. The card's person, bound to the\n// cardholder's holder, freezes, unfreezes and cancels their own card. The issuer\n// freezes it with issuer_freeze into blocked, which only issuer_unfreeze lifts,\n// and cancels it with issuer_cancel.\n// Expose authorization.create, approve and capture; expose decline and reverse\n// separately if callers need those paths. Issuer declines only from pending;\n// merchant captures or reverses an approved reservation. Expiry voids approved\n// reservations or abandons pending ones; it does not delay a captured refund.\n// Create one transaction for the captured authorization and expose its refund.\n// Refund is available immediately from posted, even before authorization.expiresAt,\n// and moves the whole captured amount from merchant to holder under programOperator.\n// No partial capture, repeated capture or partial transaction refund is provided.\n// Disputes need a posted transaction, issuer review and win before their deadline;\n// win invokes the same refund. The alias never changes the declared action actor.\n\n// Cost: authorization approve, capture and reverse each declare one transfer\n// instruction. Transaction refund declares one transfer; a successful dispute\n// invokes that refund. Card state changes alone declare no transfers.\n\ninstrument cardholder(holder: party) {\n summary: \"An account holder whose card access can be activated, suspended or closed.\"\n fields { holder: account of holder }\n lifecycle { states: [pending, active, suspended, closed], initial: pending }\n action create {}\n action activate { from: pending, to: active, actor: { party: programOperator } }\n action suspend { from: active, to: suspended, actor: { party: programOperator } }\n action resume { from: suspended, to: active, actor: { party: programOperator } }\n action close { from: [active, suspended], to: closed, actor: { party: holder } }\n action operator_close { from: [active, suspended], to: closed, actor: { party: programOperator } }\n}\n\ninstrument card(holder: ref<cards.cardholder>, spend_limit: money, issuer: party = programOperator, person: party = party(person)) {\n summary: \"A card with a per-spend ceiling that can be activated, frozen or cancelled.\"\n fields { holder: ref<holder>, person: account of person, spendLimit: money = spend_limit }\n lifecycle { states: [issued, active, frozen, blocked, cancelled], initial: issued }\n action create { requires self.holder in [active]; requires self.holder.holder == self.person }\n action activate { from: issued, to: active, requires self.holder in [active] }\n action freeze { from: active, to: frozen, actor: { party: person } }\n action unfreeze { from: frozen, to: active, actor: { party: person }, requires self.holder in [active] }\n action issuer_freeze { from: [active, frozen], to: blocked, actor: { party: issuer } }\n action issuer_unfreeze { from: [frozen, blocked], to: active, actor: { party: issuer }, requires self.holder in [active] }\n action cancel { from: [issued, active, frozen, blocked], to: cancelled, actor: { party: person } }\n action issuer_cancel { from: [issued, active, frozen, blocked], to: cancelled, actor: { party: issuer } }\n}\n\ninstrument authorization(card: ref<cards.card>, merchant: party, issuer: party = programOperator) {\n summary: \"Reserve a card payment for the merchant, then capture it or release the reservation.\"\n fields { card: ref<card>, merchant: account of merchant, amount: money, expiresAt: date, reservation: text? }\n lifecycle { states: [pending, approved, captured, declined, reversed, expired], initial: pending }\n action create {\n requires self.card in [active]\n requires self.card.holder in [active]\n requires self.amount <= self.card.spendLimit\n }\n action approve {\n from: pending, to: approved, actor: { party: issuer }, deadline: { at: self.expiresAt }\n requires self.card in [active]\n requires self.card.holder in [active]\n moves reserve self.amount from self.card.holder.holder to merchant capture \"reservation\"\n }\n action capture { from: approved, to: captured, actor: { party: merchant }, deadline: { at: self.expiresAt }, moves post self.reservation }\n action reverse { from: approved, to: reversed, actor: { party: merchant }, moves void self.reservation }\n action decline { from: pending, to: declined, actor: { party: issuer } }\n action expire { from: approved, to: expired, actor: clock, due: { at: self.expiresAt }, moves void self.reservation }\n action abandon { from: pending, to: expired, actor: clock, due: { at: self.expiresAt } }\n}\n\ninstrument transaction(authorization: ref<cards.authorization>) {\n summary: \"Record a captured card payment and return its amount when refunded.\"\n fields { authorization: ref<authorization>, amount: money = self.authorization.amount }\n lifecycle { states: [posted, refunded], initial: posted }\n action create { requires self.authorization in [captured]; requires unique \"captured_authorization\" on [self.authorization] }\n action refund {\n from: posted, to: refunded, actor: { party: programOperator }, input { reason: text }\n moves self.amount from self.authorization.merchant to self.authorization.card.holder.holder\n }\n}\n\ninstrument dispute(transaction: ref<cards.transaction>, issuer: party = programOperator, within: duration = 90d) {\n summary: \"Review a disputed card payment before its deadline and refund it when the dispute is won.\"\n fields { transaction: ref<transaction>, evidence: text, expiresAt: date = after(self.createdAt, within) }\n lifecycle { states: [filed, reviewing, won, lost], initial: filed }\n action create { requires self.transaction in [posted]; requires unique \"disputed_transaction\" on [self.transaction] }\n action review { from: filed, to: reviewing, actor: { party: issuer } }\n action win {\n from: reviewing, to: won, actor: { party: issuer }, deadline: { at: self.expiresAt }\n invoke: [{ reference: self.transaction, action: refund, input: { reason: { field: self.evidence } } }]\n }\n action lose { from: [filed, reviewing], to: lost, actor: clock, due: { at: self.expiresAt } }\n}\n"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperscale0/hsx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.352",
|
|
4
4
|
"description": "The strictly typed HSX language: compile total financial programs into canonical UDL.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hsx",
|
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
"bases:bundle": "bun scripts/bundle-bases.ts"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@hyperscale0/adl": "1.0.
|
|
94
|
-
"@hyperscale0/udl": "1.0.
|
|
93
|
+
"@hyperscale0/adl": "1.0.352",
|
|
94
|
+
"@hyperscale0/udl": "1.0.352",
|
|
95
95
|
"fast-sha256": "1.3.0"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"bun-types": "1.4.
|
|
98
|
+
"bun-types": "1.4.3",
|
|
99
99
|
"tsc-rs": "0.7.0"
|
|
100
100
|
},
|
|
101
101
|
"contributors": [
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"Amir Ayub",
|
|
104
104
|
"Sara AlBakaawi"
|
|
105
105
|
],
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "0ee1198b5fee140e7b0a45ed042aca58cf595e3a"
|
|
107
107
|
}
|
package/src/std-bundle.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by open/hsx/scripts/bundle-std.ts. Do not edit by hand.
|
|
2
2
|
|
|
3
|
-
export const HSX_VERSION = "1.0.
|
|
3
|
+
export const HSX_VERSION = "1.0.352";
|
|
4
4
|
|
|
5
5
|
export const BUNDLED_STD_HEADERS: ReadonlyMap<string, string> = new Map<string, string>([
|
|
6
6
|
["booking", "header booking\n\n// Economics: Deposit and balance payments and every refund are principal. Completion\n// and any forfeit are earnings for the company, or pass the customer's cash through\n// to a bound outside operator.\n\n// Expose create, pay_deposit and pay_balance for the booking path, and\n// cancel_early, cancel_middle and cancel_late for the customer. Create captures\n// subject departure, price, deposit and balance, and refuses a deposit and balance\n// that do not add up to the price. Both installments must be positive. Creation\n// and deposit payment close at the balance cutoff. The balance is payable only after the deposit\n// and before balance_due ahead of departure, so a cancelled booking never offers\n// it. cancel_early runs until early_until before departure and returns everything\n// held. cancel_middle runs from then until late_from; cancel_late runs from then\n// until departure, even when the clock's complete runs late. They keep\n// middle_forfeit or late_forfeit of the held money and return the rest. Both\n// forfeits default to 0%, so nothing is kept unless the author sets them. At\n// departure the clock completes a paid booking and pays operator, and lapses an\n// unpaid one on cancel_late's terms, so nothing stays held after departure.\n\n// Cost: create declares one owned account. Each payment declares one transfer;\n// cancellation and completion move the held balance. Run hsx cost for the\n// composed counts.\n\ninstrument reservation(customer: party = party(person), operator: party = programOperator, early_until: duration = 30d, late_from: duration = 15d, balance_due: duration = 15d, middle_forfeit: percent = 0%, late_forfeit: percent = 0%) {\n checks {\n late_from < early_until {\n message: \"Attachment `{attachment}` sets `late_from` at or above `early_until`, so the late cancellation window opens before the early one closes.\"\n fix: \"Choose a `late_from` shorter than `early_until`, such as `early_until: 30d, late_from: 15d`.\"\n }\n middle_forfeit is percent {\n message: \"`middle_forfeit` is the share of the held money a middle cancellation keeps, from 0% to 100%.\"\n fix: \"Write `middle_forfeit` as a percentage from 0% to 100%, such as `middle_forfeit: 25%`.\"\n }\n late_forfeit is percent {\n message: \"`late_forfeit` is the share of the held money a late cancellation keeps, from 0% to 100%.\"\n fix: \"Write `late_forfeit` as a percentage from 0% to 100%, such as `late_forfeit: 50%`.\"\n }\n }\n revisioned: true\n summary: \"Take a deposit and a balance for a dated booking, with cancellation windows before departure.\"\n fields {\n customer: account of customer, operator: account of operator, held: account of self\n departure: date, price: money = subject.price\n deposit: money = subject.deposit, balance: money = subject.balance\n split: money = sum(self.deposit, self.balance)\n balanceAt: date = before(self.departure, balance_due)\n earlyAt: date = before(self.departure, early_until)\n lateAt: date = before(self.departure, late_from)\n refund: money?, forfeit: money?\n }\n lifecycle { states: [reserved, deposit_paid, paid, completed, cancelled], initial: reserved }\n action create {\n subject { departure: date, price: money, deposit: money, balance: money }\n actor: { party: customer }\n requires self.balanceAt > self.now\n requires self.departure > self.balanceAt\n requires self.deposit > \"0\"\n requires self.balance > \"0\"\n requires self.split == self.price\n }\n action pay_deposit {\n from: reserved, to: deposit_paid, actor: { party: customer }, deadline: { at: self.balanceAt }\n moves self.deposit from customer to self.held economics { purpose: principal, sourceParty: customer }\n }\n action pay_balance {\n from: deposit_paid, to: paid, actor: { party: customer }, deadline: { at: self.balanceAt }\n moves self.balance from customer to self.held economics { purpose: principal, sourceParty: customer }\n }\n action complete {\n from: paid, to: completed, actor: clock, due: { at: self.departure }\n moves self.held.balance from self.held to operator economics { recipient: operator, company: { purpose: earning, sourceParty: customer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action cancel_early { allowZero: true,\n from: [reserved, deposit_paid, paid], to: cancelled, actor: { party: customer }, deadline: { at: self.earlyAt }\n moves self.held.balance from self.held to customer economics { purpose: principal, sourceParty: programOperator }\n }\n action cancel_middle { allowZero: true,\n from: [reserved, deposit_paid, paid], to: cancelled, actor: { party: customer }, due: { at: self.earlyAt }, deadline: { at: self.lateAt }\n calculate: [{ target: forfeit, op: rate, base: { field: self.held.balance }, bps: { literal: middle_forfeit }, rounding: floor }, { target: refund, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.forfeit }] }]\n moves self.refund from self.held to customer economics { purpose: principal, sourceParty: programOperator }; moves self.forfeit from self.held to operator economics { recipient: operator, company: { purpose: earning, sourceParty: customer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action cancel_late { allowZero: true,\n from: [reserved, deposit_paid, paid], to: cancelled, actor: { party: customer }, due: { at: self.lateAt }, deadline: { at: self.departure }\n calculate: [{ target: forfeit, op: rate, base: { field: self.held.balance }, bps: { literal: late_forfeit }, rounding: floor }, { target: refund, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.forfeit }] }]\n moves self.refund from self.held to customer economics { purpose: principal, sourceParty: programOperator }; moves self.forfeit from self.held to operator economics { recipient: operator, company: { purpose: earning, sourceParty: customer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n action lapse { allowZero: true,\n from: [reserved, deposit_paid], to: cancelled, actor: clock, due: { at: self.departure }\n calculate: [{ target: forfeit, op: rate, base: { field: self.held.balance }, bps: { literal: late_forfeit }, rounding: floor }, { target: refund, op: subtract, base: { field: self.held.balance }, subtract: [{ field: self.forfeit }] }]\n moves self.refund from self.held to customer economics { purpose: principal, sourceParty: programOperator }; moves self.forfeit from self.held to operator economics { recipient: operator, company: { purpose: earning, sourceParty: customer }, participant: { purpose: pass_through, sourceParty: programOperator } }\n }\n}\n"],
|