@hyperscale0/udl 2.6.1 → 3.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/CHANGELOG.md +2 -330
- package/LICENSING.md +1 -2
- package/README.md +3 -114
- package/TRADEMARKS.md +2 -2
- package/dist/diagnostics.d.ts +21 -201
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +29 -193
- package/dist/diagnostics.js.map +1 -1
- package/dist/evolution.d.ts +3 -132
- package/dist/evolution.d.ts.map +1 -1
- package/dist/evolution.js +29 -633
- package/dist/evolution.js.map +1 -1
- package/dist/finance.d.ts +5 -72
- package/dist/finance.d.ts.map +1 -1
- package/dist/finance.js +233 -737
- package/dist/finance.js.map +1 -1
- package/dist/index.d.ts +7 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -12
- package/dist/index.js.map +1 -1
- package/dist/instrument-references.d.ts.map +1 -1
- package/dist/instrument-references.js +3 -2
- package/dist/instrument-references.js.map +1 -1
- package/dist/schema.d.ts +2079 -4564
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +270 -1609
- package/dist/schema.js.map +1 -1
- package/dist/validation.d.ts +8 -104
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +653 -3271
- package/dist/validation.js.map +1 -1
- package/docs/README.md +147 -14
- package/package.json +7 -11
- package/spec/README.md +151 -164
- package/spec/darb.udl.json +249 -0
- package/spec/udl.schema.json +4104 -3202
- package/src/diagnostics.ts +51 -246
- package/src/evolution.ts +39 -1045
- package/src/finance.ts +287 -1127
- package/src/index.ts +18 -142
- package/src/instrument-references.ts +3 -2
- package/src/schema.ts +285 -1843
- package/src/validation.ts +870 -5611
- package/conformance/README.md +0 -82
- package/conformance/evolution/action-contract.expected.json +0 -10
- package/conformance/evolution/action-contract.live.udl +0 -44
- package/conformance/evolution/action-contract.next.udl +0 -45
- package/conformance/evolution/product-identity.expected.json +0 -10
- package/conformance/evolution/product-identity.live.udl +0 -55
- package/conformance/evolution/product-identity.next.udl +0 -55
- package/conformance/evolution/version-required.expected.json +0 -10
- package/conformance/evolution/version-required.live.udl +0 -55
- package/conformance/evolution/version-required.next.udl +0 -58
- package/conformance/invalid/action-without-transition.expected.json +0 -10
- package/conformance/invalid/action-without-transition.udl +0 -60
- package/conformance/invalid/agent-description-too-long.expected.json +0 -10
- package/conformance/invalid/agent-description-too-long.udl +0 -57
- package/conformance/invalid/blank-title.expected.json +0 -10
- package/conformance/invalid/blank-title.udl +0 -54
- package/conformance/invalid/call-binds-results.expected.json +0 -10
- package/conformance/invalid/call-binds-results.udl +0 -314
- package/conformance/invalid/call-unknown-action.expected.json +0 -10
- package/conformance/invalid/call-unknown-action.udl +0 -314
- package/conformance/invalid/composition-dial-duplicate-key.expected.json +0 -10
- package/conformance/invalid/composition-dial-duplicate-key.udl +0 -73
- package/conformance/invalid/depth-budget.expected.json +0 -10
- package/conformance/invalid/depth-budget.udl +0 -49
- package/conformance/invalid/duplicate-subject.expected.json +0 -10
- package/conformance/invalid/duplicate-subject.udl +0 -230
- package/conformance/invalid/forged-effects.expected.json +0 -10
- package/conformance/invalid/forged-effects.udl +0 -76
- package/conformance/invalid/format-version.expected.json +0 -10
- package/conformance/invalid/format-version.udl +0 -54
- package/conformance/invalid/instrument-id-not-snake-case.expected.json +0 -10
- package/conformance/invalid/instrument-id-not-snake-case.udl +0 -54
- package/conformance/invalid/invalid-aggregate-gate-shape.expected.json +0 -10
- package/conformance/invalid/invalid-aggregate-gate-shape.udl +0 -1819
- package/conformance/invalid/invalid-check-duration.expected.json +0 -10
- package/conformance/invalid/invalid-check-duration.udl +0 -219
- package/conformance/invalid/invalid-dial-anchor.expected.json +0 -10
- package/conformance/invalid/invalid-dial-anchor.udl +0 -219
- package/conformance/invalid/invalid-exception-parent-ref.expected.json +0 -10
- package/conformance/invalid/invalid-exception-parent-ref.udl +0 -2487
- package/conformance/invalid/invalid-exposure-shape.expected.json +0 -10
- package/conformance/invalid/invalid-exposure-shape.udl +0 -1819
- package/conformance/invalid/invalid-journeys.expected.json +0 -10
- package/conformance/invalid/invalid-journeys.udl +0 -77
- package/conformance/invalid/invalid-remainder.expected.json +0 -10
- package/conformance/invalid/invalid-remainder.udl +0 -220
- package/conformance/invalid/invalid-schema-keyword.expected.json +0 -10
- package/conformance/invalid/invalid-schema-keyword.udl +0 -220
- package/conformance/invalid/invalid-utf8.expected.json +0 -10
- package/conformance/invalid/invalid-utf8.udl +0 -1
- package/conformance/invalid/leaf-effect-mismatch.expected.json +0 -10
- package/conformance/invalid/leaf-effect-mismatch.udl +0 -314
- package/conformance/invalid/malformed-json.expected.json +0 -10
- package/conformance/invalid/malformed-json.udl +0 -1
- package/conformance/invalid/missing-create-action.expected.json +0 -10
- package/conformance/invalid/missing-create-action.udl +0 -48
- package/conformance/invalid/missing-exception-amount-field.expected.json +0 -10
- package/conformance/invalid/missing-exception-amount-field.udl +0 -2487
- package/conformance/invalid/missing-exception-contract.expected.json +0 -14
- package/conformance/invalid/missing-exception-contract.udl +0 -2523
- package/conformance/invalid/missing-exception-reason-field.expected.json +0 -10
- package/conformance/invalid/missing-exception-reason-field.udl +0 -2487
- package/conformance/invalid/not-an-object.expected.json +0 -10
- package/conformance/invalid/not-an-object.udl +0 -1
- package/conformance/invalid/payout-reconcile-not-a-bank-debit.expected.json +0 -10
- package/conformance/invalid/payout-reconcile-not-a-bank-debit.udl +0 -259
- package/conformance/invalid/piece-plan-without-partition.expected.json +0 -10
- package/conformance/invalid/piece-plan-without-partition.udl +0 -305
- package/conformance/invalid/private-action-independent-approval.expected.json +0 -10
- package/conformance/invalid/private-action-independent-approval.udl +0 -314
- package/conformance/invalid/quote-freeze-set-incomplete.expected.json +0 -10
- package/conformance/invalid/quote-freeze-set-incomplete.udl +0 -261
- package/conformance/invalid/quote-named-reference-gate.expected.json +0 -10
- package/conformance/invalid/quote-named-reference-gate.udl +0 -50
- package/conformance/invalid/reconcile-named-reference-gate.expected.json +0 -10
- package/conformance/invalid/reconcile-named-reference-gate.udl +0 -50
- package/conformance/invalid/unfund-order-not-reversed.expected.json +0 -10
- package/conformance/invalid/unfund-order-not-reversed.udl +0 -314
- package/conformance/invalid/unknown-key.expected.json +0 -10
- package/conformance/invalid/unknown-key.udl +0 -55
- package/conformance/invalid/unknown-reference-gate-field.expected.json +0 -10
- package/conformance/invalid/unknown-reference-gate-field.udl +0 -1819
- package/conformance/invalid/unknown-required-field.expected.json +0 -10
- package/conformance/invalid/unknown-required-field.udl +0 -220
- package/conformance/invalid/unreachable-state.expected.json +0 -10
- package/conformance/invalid/unreachable-state.udl +0 -55
- package/conformance/invalid/wrong-exception-amount-field.expected.json +0 -10
- package/conformance/invalid/wrong-exception-amount-field.udl +0 -2487
- package/conformance/invalid/wrong-exception-reason-field.expected.json +0 -10
- package/conformance/invalid/wrong-exception-reason-field.udl +0 -2487
- package/conformance/valid/agent-description.expected.json +0 -6
- package/conformance/valid/agent-description.udl +0 -66
- package/conformance/valid/attested.expected.json +0 -6
- package/conformance/valid/attested.udl +0 -251
- package/conformance/valid/cards.expected.json +0 -6
- package/conformance/valid/cards.udl +0 -1579
- package/conformance/valid/commerce-escrow.expected.json +0 -6
- package/conformance/valid/commerce-escrow.udl +0 -1512
- package/conformance/valid/compiled-crowdfunding.expected.json +0 -6
- package/conformance/valid/compiled-crowdfunding.udl +0 -1843
- package/conformance/valid/compiled-watch-club.expected.json +0 -6
- package/conformance/valid/compiled-watch-club.udl +0 -2486
- package/conformance/valid/complete-contract.expected.json +0 -6
- package/conformance/valid/complete-contract.udl +0 -218
- package/conformance/valid/effect-signatures.expected.json +0 -6
- package/conformance/valid/effect-signatures.udl +0 -75
- package/conformance/valid/hand-edited.expected.json +0 -6
- package/conformance/valid/hand-edited.udl +0 -1
- package/conformance/valid/insured-car-marketplace.expected.json +0 -6
- package/conformance/valid/insured-car-marketplace.udl +0 -1050
- package/conformance/valid/insured-travel.expected.json +0 -6
- package/conformance/valid/insured-travel.udl +0 -3469
- package/conformance/valid/minimal.expected.json +0 -6
- package/conformance/valid/minimal.udl +0 -62
- package/conformance/valid/piece-plan-calls.expected.json +0 -6
- package/conformance/valid/piece-plan-calls.udl +0 -314
- package/conformance/valid/protection.expected.json +0 -6
- package/conformance/valid/protection.udl +0 -1551
- package/conformance/valid/string-escaping.expected.json +0 -6
- package/conformance/valid/string-escaping.udl +0 -54
- package/conformance/valid/vocabulary.expected.json +0 -6
- package/conformance/valid/vocabulary.udl +0 -2012
- package/dist/allocation.d.ts +0 -60
- package/dist/allocation.d.ts.map +0 -1
- package/dist/allocation.js +0 -177
- package/dist/allocation.js.map +0 -1
- package/dist/check-profiles.d.ts +0 -57
- package/dist/check-profiles.d.ts.map +0 -1
- package/dist/check-profiles.js +0 -62
- package/dist/check-profiles.js.map +0 -1
- package/dist/distribution.d.ts +0 -15
- package/dist/distribution.d.ts.map +0 -1
- package/dist/distribution.js +0 -49
- package/dist/distribution.js.map +0 -1
- package/dist/effects.d.ts +0 -58
- package/dist/effects.d.ts.map +0 -1
- package/dist/effects.js +0 -1126
- package/dist/effects.js.map +0 -1
- package/dist/reference.d.ts +0 -3
- package/dist/reference.d.ts.map +0 -1
- package/dist/reference.js +0 -28
- package/dist/reference.js.map +0 -1
- package/dist/vocabulary.d.ts +0 -23
- package/dist/vocabulary.d.ts.map +0 -1
- package/dist/vocabulary.js +0 -1052
- package/dist/vocabulary.js.map +0 -1
- package/docs/funding-custody.md +0 -165
- package/docs/guide/01-a-document.md +0 -37
- package/docs/guide/02-money-steps.md +0 -23
- package/docs/guide/03-laws.md +0 -18
- package/docs/guide/04-fees-and-remainder.md +0 -36
- package/docs/guide/05-checks-updates-dials.md +0 -7
- package/docs/guide/06-effects.md +0 -11
- package/docs/guide/07-evolution.md +0 -11
- package/docs/guide/08-implementing.md +0 -13
- package/docs/guide/09-schedules-and-allocation.md +0 -132
- package/docs/llms-full.txt +0 -2008
- package/docs/llms.txt +0 -14
- package/docs/piece-plans.md +0 -148
- package/docs/reference/canonical.md +0 -16
- package/docs/reference/clauses.md +0 -1585
- package/docs/reference/cli.md +0 -24
- package/docs/reference/diagnostics.md +0 -38
- package/skills/udl/SKILL.md +0 -28
- package/src/allocation.ts +0 -259
- package/src/check-profiles.ts +0 -80
- package/src/distribution.ts +0 -61
- package/src/effects.ts +0 -1920
- package/src/reference.ts +0 -31
- package/src/vocabulary.ts +0 -1635
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
{
|
|
2
|
+
"udl": 3,
|
|
3
|
+
"version": 1,
|
|
4
|
+
"product": "darb_cars",
|
|
5
|
+
"title": "Darb Cars",
|
|
6
|
+
"currency": "SAR",
|
|
7
|
+
"parties": {
|
|
8
|
+
"buyer": {
|
|
9
|
+
"kind": "person"
|
|
10
|
+
},
|
|
11
|
+
"seller": {
|
|
12
|
+
"kind": "business"
|
|
13
|
+
},
|
|
14
|
+
"operator": {
|
|
15
|
+
"kind": "business"
|
|
16
|
+
},
|
|
17
|
+
"tax": {
|
|
18
|
+
"kind": "business"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"instruments": [
|
|
22
|
+
{
|
|
23
|
+
"id": "sale",
|
|
24
|
+
"title": "Sale",
|
|
25
|
+
"summary": "Capped seller fee and VAT on held purchase money",
|
|
26
|
+
"fields": [
|
|
27
|
+
{
|
|
28
|
+
"name": "price",
|
|
29
|
+
"type": "money",
|
|
30
|
+
"minimum": "1"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "held",
|
|
34
|
+
"type": "account",
|
|
35
|
+
"owner": "self",
|
|
36
|
+
"book": "cash"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "deliveredAt",
|
|
40
|
+
"type": "date"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "returnVerified",
|
|
44
|
+
"type": "boolean"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "uncappedFee",
|
|
48
|
+
"type": "money"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "sellerFee",
|
|
52
|
+
"type": "money"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "serviceTax",
|
|
56
|
+
"type": "money"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "sellerNet",
|
|
60
|
+
"type": "money"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"calculate": [
|
|
64
|
+
{
|
|
65
|
+
"target": "uncappedFee",
|
|
66
|
+
"op": "rate",
|
|
67
|
+
"base": {
|
|
68
|
+
"field": "self.price"
|
|
69
|
+
},
|
|
70
|
+
"bps": {
|
|
71
|
+
"literal": 100
|
|
72
|
+
},
|
|
73
|
+
"rounding": "floor"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"target": "sellerFee",
|
|
77
|
+
"op": "minimum",
|
|
78
|
+
"values": [
|
|
79
|
+
{
|
|
80
|
+
"field": "self.uncappedFee"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"literal": "75000"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"target": "serviceTax",
|
|
89
|
+
"op": "rate",
|
|
90
|
+
"base": {
|
|
91
|
+
"field": "self.sellerFee"
|
|
92
|
+
},
|
|
93
|
+
"bps": {
|
|
94
|
+
"literal": 1500
|
|
95
|
+
},
|
|
96
|
+
"rounding": "floor"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"target": "sellerNet",
|
|
100
|
+
"op": "subtract",
|
|
101
|
+
"base": {
|
|
102
|
+
"field": "self.price"
|
|
103
|
+
},
|
|
104
|
+
"subtract": [
|
|
105
|
+
{
|
|
106
|
+
"field": "self.sellerFee"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"field": "self.serviceTax"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"lifecycle": {
|
|
115
|
+
"states": ["created", "funded", "accepted", "released", "refunded"],
|
|
116
|
+
"initial": "created",
|
|
117
|
+
"transitions": {
|
|
118
|
+
"fund": {
|
|
119
|
+
"from": ["created"],
|
|
120
|
+
"to": "funded"
|
|
121
|
+
},
|
|
122
|
+
"accept": {
|
|
123
|
+
"from": ["funded"],
|
|
124
|
+
"to": "accepted"
|
|
125
|
+
},
|
|
126
|
+
"release": {
|
|
127
|
+
"from": ["accepted"],
|
|
128
|
+
"to": "released"
|
|
129
|
+
},
|
|
130
|
+
"refund": {
|
|
131
|
+
"from": ["funded", "accepted"],
|
|
132
|
+
"to": "refunded"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"actions": {
|
|
137
|
+
"create": {
|
|
138
|
+
"summary": "Open a sale hold",
|
|
139
|
+
"event": "sale.create",
|
|
140
|
+
"actor": "caller",
|
|
141
|
+
"input": [],
|
|
142
|
+
"requires": [],
|
|
143
|
+
"moves": [],
|
|
144
|
+
"publicAction": "createSale"
|
|
145
|
+
},
|
|
146
|
+
"fund": {
|
|
147
|
+
"summary": "Fund the purchase",
|
|
148
|
+
"event": "sale.fund",
|
|
149
|
+
"actor": "caller",
|
|
150
|
+
"input": [],
|
|
151
|
+
"requires": [],
|
|
152
|
+
"moves": [
|
|
153
|
+
{
|
|
154
|
+
"key": "fund",
|
|
155
|
+
"operation": "internal_transfer.create",
|
|
156
|
+
"amount": {
|
|
157
|
+
"field": "self.price"
|
|
158
|
+
},
|
|
159
|
+
"from": "party.buyer",
|
|
160
|
+
"to": "self.held"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"publicAction": "fundSale"
|
|
164
|
+
},
|
|
165
|
+
"accept": {
|
|
166
|
+
"summary": "Accept delivery",
|
|
167
|
+
"event": "sale.accept",
|
|
168
|
+
"actor": "caller",
|
|
169
|
+
"input": [],
|
|
170
|
+
"requires": [],
|
|
171
|
+
"moves": [],
|
|
172
|
+
"deadline": {
|
|
173
|
+
"at": "self.deliveredAt",
|
|
174
|
+
"offset": 172800000
|
|
175
|
+
},
|
|
176
|
+
"publicAction": "acceptSale"
|
|
177
|
+
},
|
|
178
|
+
"release": {
|
|
179
|
+
"summary": "Pay seller net, fee and VAT",
|
|
180
|
+
"event": "sale.release",
|
|
181
|
+
"actor": "caller",
|
|
182
|
+
"input": [],
|
|
183
|
+
"requires": [],
|
|
184
|
+
"moves": [
|
|
185
|
+
{
|
|
186
|
+
"key": "seller",
|
|
187
|
+
"operation": "internal_transfer.create",
|
|
188
|
+
"amount": {
|
|
189
|
+
"field": "self.sellerNet"
|
|
190
|
+
},
|
|
191
|
+
"from": "self.held",
|
|
192
|
+
"to": "party.seller"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"key": "fee",
|
|
196
|
+
"operation": "internal_transfer.create",
|
|
197
|
+
"amount": {
|
|
198
|
+
"field": "self.sellerFee"
|
|
199
|
+
},
|
|
200
|
+
"from": "self.held",
|
|
201
|
+
"to": "party.operator"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"key": "tax",
|
|
205
|
+
"operation": "internal_transfer.create",
|
|
206
|
+
"amount": {
|
|
207
|
+
"field": "self.serviceTax"
|
|
208
|
+
},
|
|
209
|
+
"from": "self.held",
|
|
210
|
+
"to": "party.tax"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"publicAction": "releaseSale"
|
|
214
|
+
},
|
|
215
|
+
"refund": {
|
|
216
|
+
"summary": "Refund after verified return",
|
|
217
|
+
"event": "sale.refund",
|
|
218
|
+
"actor": "caller",
|
|
219
|
+
"input": [],
|
|
220
|
+
"requires": [
|
|
221
|
+
{
|
|
222
|
+
"kind": "compare",
|
|
223
|
+
"left": {
|
|
224
|
+
"field": "self.returnVerified"
|
|
225
|
+
},
|
|
226
|
+
"operator": "==",
|
|
227
|
+
"right": {
|
|
228
|
+
"literal": true
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"moves": [
|
|
233
|
+
{
|
|
234
|
+
"key": "refund",
|
|
235
|
+
"operation": "internal_transfer.create",
|
|
236
|
+
"amount": {
|
|
237
|
+
"field": "self.price"
|
|
238
|
+
},
|
|
239
|
+
"from": "self.held",
|
|
240
|
+
"to": "party.buyer"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"publicAction": "refundSale"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"actionOrder": ["create", "fund", "accept", "release", "refund"]
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
}
|