@hyperscale0/hsx 5.6.0 → 5.8.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.
@@ -1 +1 @@
1
- {"version":3,"file":"std-bundle.js","sourceRoot":"","sources":["../../src/std-bundle.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,MAAM,CAAC,MAAM,iBAAiB,GAAgC,IAAI,GAAG,CAAiB;IACpF,CAAC,WAAW,EAAE,2oKAA2oK,CAAC;IAC1pK,CAAC,iBAAiB,EAAE,2sNAA2sN,CAAC;IAChuN,CAAC,YAAY,EAAE,+qHAA+qH,CAAC;IAC/rH,CAAC,eAAe,EAAE,gq9DAAgq9D,CAAC;IACnr9D,CAAC,eAAe,EAAE,01KAA01K,CAAC;IAC72K,CAAC,aAAa,EAAE,qwTAAqwT,CAAC;IACtxT,CAAC,iBAAiB,EAAE,s+TAAs+T,CAAC;IAC3/T,CAAC,WAAW,EAAE,u1VAAu1V,CAAC;IACt2V,CAAC,eAAe,EAAE,649CAA649C,CAAC;IACh69C,CAAC,aAAa,EAAE,85JAA85J,CAAC;IAC/6J,CAAC,YAAY,EAAE,o7SAAo7S,CAAC;IACp8S,CAAC,YAAY,EAAE,2jGAA2jG,CAAC;CAC5kG,CAAC,CAAC"}
1
+ {"version":3,"file":"std-bundle.js","sourceRoot":"","sources":["../../src/std-bundle.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,MAAM,CAAC,MAAM,iBAAiB,GAAgC,IAAI,GAAG,CAAiB;IACpF,CAAC,WAAW,EAAE,2oKAA2oK,CAAC;IAC1pK,CAAC,iBAAiB,EAAE,2sNAA2sN,CAAC;IAChuN,CAAC,YAAY,EAAE,+qHAA+qH,CAAC;IAC/rH,CAAC,eAAe,EAAE,6m+DAA6m+D,CAAC;IACho+D,CAAC,eAAe,EAAE,01KAA01K,CAAC;IAC72K,CAAC,aAAa,EAAE,qwTAAqwT,CAAC;IACtxT,CAAC,iBAAiB,EAAE,woTAAwoT,CAAC;IAC7pT,CAAC,WAAW,EAAE,u1VAAu1V,CAAC;IACt2V,CAAC,eAAe,EAAE,649CAA649C,CAAC;IACh69C,CAAC,aAAa,EAAE,85JAA85J,CAAC;IAC/6J,CAAC,YAAY,EAAE,o7SAAo7S,CAAC;IACp8S,CAAC,YAAY,EAAE,2jGAA2jG,CAAC;CAC5kG,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const HSX_VERSION = "5.6.0";
1
+ export declare const HSX_VERSION = "5.8.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export const HSX_VERSION = "5.6.0";
1
+ export const HSX_VERSION = "5.8.0";
2
2
  //# sourceMappingURL=version.js.map
package/docs/README.md CHANGED
@@ -388,17 +388,51 @@ adapters are bound, participants have funds, or the flow can finish.
388
388
  | `financing.late_charge` | `fine` is a fixed money amount, not a percentage of overdue principal. |
389
389
  | `cards.card` | `spend_limit` is a per-authorization ceiling, not a monthly aggregate. |
390
390
 
391
- The financing, collections and reporting samples compose loan agreements; they
392
- do not supply a complete public repayment path. Insurance and travel also need
393
- premium-slice records and actions. Savings needs dated contribution records.
394
- Create aliases in these samples cover the root attachments, not every child
395
- record. Read each header's creation and lifecycle requirements before execution.
396
-
397
- The [lending sample](../examples/lending.hsx) exposes limit approvals, funding and
398
- commitment creation, and cash prepare/distribute actions. Its repayment and share
399
- child actions still lack a public execution path. It is a composition example,
400
- not a complete public repayment flow. Callers still need dates, agreement inputs,
401
- funded wallets, eligible settlements and the distribution's share records.
391
+ A seller-owned marketplace object can declare `entryActions: [create_order]`
392
+ when `create_order` exposes an attachment's create action with its buyer bound
393
+ to `actor`. This admits active enrolled customers to that action. The default
394
+ is closed. A retained buyer can read the record and run its buyer actions;
395
+ the seller remains owner. Entry never grants access to an existing escrow.
396
+
397
+ `financing.limits` and `financing.portfolio_limit` declare `scope: product`.
398
+ Create and approve the portfolio limit once per Product and the borrower limit
399
+ once per borrower. Plans on later records resolve those shared references.
400
+ Ordinary references remain on the current record; shared references must match
401
+ the bound party accounts. The aggregate caps still apply across all plans.
402
+
403
+ `programTax` transfers use an operator-owned cash account keyed `programTax`.
404
+ The account primitive creates it automatically and shares it across the Product.
405
+ Zero-tax escrow releases need no additional party setup.
406
+
407
+ The financing, collections and lending samples expose payment creation, payment,
408
+ refund and payoff quotes through the object's existing action routes. A child
409
+ alias names the full attachment path, for example:
410
+
411
+ ```hsx
412
+ expose enrolment.tuition.payment.create as create_payment
413
+ expose enrolment.tuition.payment.pay as pay_instalment
414
+ expose enrolment.tuition.payoff_quote.create as request_payoff_quote
415
+ ```
416
+
417
+ Read the parent object's actions and follow pagination to discover child actions.
418
+ Use the returned target, Build, digest and object revision when executing. Creation
419
+ targets the child attachment; later actions target the child's instance ID on the
420
+ same object. The caller must satisfy the header's actor rule. Parties bind from
421
+ the session and object ownership. Retry the same request with the same
422
+ Idempotency-Key to retrieve its result without moving money again.
423
+
424
+ Supply payment amount and identity at creation. Pass the quote instance as the
425
+ parent payoff's `quote` input. For a late charge on a multi-instalment plan, select
426
+ the overdue child with the creation input `slice`. Repayment uses the declared
427
+ allocation order and payoff rebate; aliases do not change those terms.
428
+
429
+ The [lending sample](../examples/lending.hsx) also exposes share creation. Callers
430
+ still need dates, agreement inputs, funded wallets and eligible settlements.
431
+ References without an explicit creation input require one matching agreement on
432
+ the object. In particular, lending distributions with multiple settlements or
433
+ commitments need authored selectors before callers can choose among them.
434
+ Insurance and travel need premium-slice records and actions. Savings needs dated
435
+ contribution records. Read each header's creation and lifecycle requirements.
402
436
 
403
437
  ## Checkout and reversals
404
438
 
package/docs/examples.md CHANGED
@@ -9,7 +9,7 @@ Each file is an authored program. Object creation enters no agreement; an attach
9
9
  | [Used device sales](../examples/escrow.hsx) | escrow | Buyers fund a used device purchase, then accept delivery or raise a dispute before release. |
10
10
  | [Tuition instalments](../examples/financing.hsx) | financing | A tuition lender funds a student's fees over three interest-free instalments with borrowing limits. |
11
11
  | [Device insurance](../examples/insurance.hsx) | insurance, money | A device retailer collects the purchase price and attaches cover with a claim review process. |
12
- | [Community business lending](../examples/lending.hsx) | lending, financing, wallet | A lending composition with limit approvals, wallet commitments and cash distribution transitions. Repayment and distribution-share child actions still need an execution path; this is not a complete public repayment flow. |
12
+ | [Community business lending](../examples/lending.hsx) | lending, financing, wallet | A lending composition with limit approvals, wallet commitments and cash distribution transitions. |
13
13
  | [Financed car sales](../examples/library.hsx) | escrow, financing | A minimal financed car sale connects escrow to a three-instalment plan and lending limits. |
14
14
  | [Freelance marketplace](../examples/marketplace.hsx) | marketplace, escrow | Freelancers publish offers and clients place orders with funds held until work is accepted. |
15
15
  | [Tutoring studio](../examples/money.hsx) | money | A tutoring studio collects a fixed fee for each lesson and can cancel unpaid bookings. |
package/docs/headers.md CHANGED
@@ -16,7 +16,7 @@ Bind party parameters to owner, actor, operator or declared parties. Configure d
16
16
  | money.metered | `payer: party`, `payee: party`, `unit_price: money`, `units: integer = 1`, `fee: fee = { seller: 0% }` |
17
17
  | marketplace.listing | `seller: party` |
18
18
  | marketplace.order | `listing: ref<marketplace.listing>`, `buyer: party` |
19
- | marketplace.reservation | `listing: ref<marketplace.listing>`, `funds: ref<escrow.hold>`, `plans: ref<financing.installments>[]`, `converters: ref[]`, `buyer: party`, `seller: party`, `expires_after: duration = 48h`, `deposit: money = 1000 SAR`, `cancellation_refund: percent = 100%`, `expiry_refund: percent = 100%`, `retained_to: party = programOperator`, `operator: party = programOperator`, `competing_quotes: enum(allowed, blocked) = allowed` |
19
+ | marketplace.reservation | `listing: ref<marketplace.listing>`, `funds: ref<escrow.hold>`, `converters: ref[]`, `buyer: party`, `seller: party`, `expires_after: duration = 48h`, `deposit: money = 1000 SAR`, `cancellation_refund: percent = 100%`, `expiry_refund: percent = 100%`, `retained_to: party = programOperator`, `operator: party = programOperator`, `competing_quotes: enum(allowed, blocked) = allowed` |
20
20
  | escrow.hold | `payer: party = party(person)`, `payee: party = programOperator`, `accept_within: duration = 48h`, `fee: fee = { seller: 0%, tax: 0% }`, `dispute: policy = { refund_after: return_verified }` |
21
21
  | wallet.balance | `holder: party`, `spend_limit: money = 100000 SAR` |
22
22
  | wallet.spend | `wallet: ref<wallet.balance>`, `payee: party` |
@@ -7,8 +7,8 @@ party agency: business
7
7
  object facility "Business loan" {
8
8
  fields { businessName: text, purpose: text, price: money }
9
9
  columns: [businessName, purpose, price]
10
- attach allowance = financing.limits { expose create as create_allowance, borrower: owner, per_borrower: 100000 SAR }
11
- attach budget = financing.portfolio_limit { expose create as create_budget, limit: 2000000 SAR }
10
+ attach allowance = financing.limits { expose create as create_allowance, expose approve as approve_borrower, borrower: owner, per_borrower: 100000 SAR }
11
+ attach budget = financing.portfolio_limit { expose create as create_budget, expose approve as approve_budget, limit: 2000000 SAR }
12
12
  attach loan = financing.installments {
13
13
  expose create as create_loan
14
14
  borrower: owner, capital: operator
@@ -16,6 +16,7 @@ object facility "Business loan" {
16
16
  limits: allowance, portfolio: budget
17
17
  expose sign as sign_loan
18
18
  expose disburse as release_loan
19
+ expose payoff as repay_early
19
20
  }
20
21
  attach recovery = collections.case {
21
22
  expose create as create_recovery
@@ -29,3 +30,8 @@ object facility "Business loan" {
29
30
  case: recovery, agency: agency
30
31
  }
31
32
  }
33
+
34
+ expose facility.loan.payment.create as create_payment
35
+ expose facility.loan.payment.pay as pay_instalment
36
+ expose facility.loan.payment.refund as refund_payment
37
+ expose facility.loan.payoff_quote.create as request_payoff_quote
@@ -25,3 +25,8 @@ object enrolment "Enrolment" {
25
25
  expose payoff as repay_early
26
26
  }
27
27
  }
28
+
29
+ expose enrolment.tuition.payment.create as create_payment
30
+ expose enrolment.tuition.payment.pay as pay_instalment
31
+ expose enrolment.tuition.payment.refund as refund_payment
32
+ expose enrolment.tuition.payoff_quote.create as request_payoff_quote
@@ -1,5 +1,4 @@
1
1
  // A lending composition with limit approvals, wallet commitments and cash distribution transitions.
2
- // Repayment and distribution-share child actions still need an execution path; this is not a complete public repayment flow.
3
2
  program community_business_lending "Community business lending"
4
3
  use lending
5
4
  use financing
@@ -25,6 +24,7 @@ object business "Business funding" {
25
24
  limits: allowance, portfolio: budget
26
25
  expose sign as sign_loan
27
26
  expose disburse as release_loan
27
+ expose payoff as repay_early
28
28
  }
29
29
  attach investor_balance = wallet.balance {
30
30
  expose create as create_investor_balance
@@ -49,3 +49,9 @@ object business "Business funding" {
49
49
  expose distribute_cash as distribute_returns
50
50
  }
51
51
  }
52
+
53
+ expose business.loan.payment.create as create_payment
54
+ expose business.loan.payment.pay as pay_instalment
55
+ expose business.loan.payment.refund as refund_payment
56
+ expose business.loan.payoff_quote.create as request_payoff_quote
57
+ expose business.returns.share.create as create_return_share
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperscale0/hsx",
3
- "version": "5.6.0",
3
+ "version": "5.8.0",
4
4
  "description": "The strictly typed HSX language: compile total financial programs into canonical UDL.",
5
5
  "keywords": [
6
6
  "hsx",
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "dependencies": {
88
88
  "@hyperscale0/adl": "1.0.0-beta.10",
89
- "@hyperscale0/udl": "4.8.0",
89
+ "@hyperscale0/udl": "4.9.0",
90
90
  "fast-sha256": "1.3.0"
91
91
  },
92
92
  "devDependencies": {
@@ -98,5 +98,5 @@
98
98
  "Amir Ayub",
99
99
  "Sara AlBakaawi"
100
100
  ],
101
- "gitHead": "be567dd18eb45ea3e02adc1f33b8491aa05df135"
101
+ "gitHead": "d368f9b62ba1bd8d75e48e77acca613c750ad0b0"
102
102
  }