@composable-os/cli 0.1.0-beta.8 → 0.1.0-beta.9

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.
Files changed (63) hide show
  1. package/dist/accounts-D6N77JGP.js +44 -0
  2. package/dist/{blocks-DEELKGDC.js → blocks-4CA4PP3P.js} +4 -4
  3. package/dist/{chunk-X6I2LWB3.js → chunk-2MLAPQU7.js} +1471 -359
  4. package/dist/{chunk-2S7375SC.js → chunk-3MIEYXRY.js} +3 -301
  5. package/dist/chunk-56A6RJIU.js +1040 -0
  6. package/dist/chunk-7CQGMVDO.js +63 -0
  7. package/dist/{chunk-STJZJIRA.js → chunk-7O4F3NU4.js} +1039 -1380
  8. package/dist/chunk-7U3OZLTK.js +1370 -0
  9. package/dist/{chunk-ZRWF6QZS.js → chunk-DU6OIFOU.js} +1 -0
  10. package/dist/chunk-E4WCYTCT.js +347 -0
  11. package/dist/{chunk-E5JLTLRM.js → chunk-GYTEW66E.js} +1 -1
  12. package/dist/chunk-LPD2VR5M.js +284 -0
  13. package/dist/chunk-NDKVIG23.js +2641 -0
  14. package/dist/chunk-NSSUOI3Z.js +333 -0
  15. package/dist/chunk-OV3OFYPI.js +746 -0
  16. package/dist/{chunk-KTXGEXTY.js → chunk-P6YZMS3F.js} +11 -5
  17. package/dist/{chunk-G3ORKXVP.js → chunk-RFJOPI42.js} +138 -14
  18. package/dist/{chunk-KOKYDJ7Z.js → chunk-RXRD34QW.js} +10 -8
  19. package/dist/{chunk-XDDBLYKW.js → chunk-STBMGUTM.js} +4613 -2307
  20. package/dist/chunk-VTQNOQGA.js +150 -0
  21. package/dist/chunk-XSE37HK5.js +426 -0
  22. package/dist/{chunk-LTQDLCP7.js → chunk-Z52IX5WL.js} +257 -845
  23. package/dist/chunk-ZSR5H4O7.js +552 -0
  24. package/dist/{cli-DTMGNDXN.js → cli-7A5XHYML.js} +16 -9
  25. package/dist/{cli-BRSACHSG.js → cli-T6MJM7TU.js} +20 -8
  26. package/dist/cli.js +4 -4
  27. package/dist/{client-repo-ZVZ6KW5S.js → client-repo-PC4ISVEZ.js} +4 -4
  28. package/dist/create.js +4 -4
  29. package/dist/{fields-64BQJA62.js → fields-L24XAIOA.js} +13 -11
  30. package/dist/invoke-TLYT6CFI.js +33 -0
  31. package/dist/order-IKQBUFCV.js +19 -0
  32. package/dist/{person-WMWRF2HV.js → person-DXEOOH2A.js} +9 -5
  33. package/dist/plan-on-sale-LRCK5MJG.js +24 -0
  34. package/dist/platform/migrations/0510_video_and_file_media.sql +109 -0
  35. package/dist/platform/migrations/0516_order_tax.sql +63 -0
  36. package/dist/platform/migrations/0530_subscriptions.sql +173 -0
  37. package/dist/platform/migrations/0531_subscription_trials.sql +56 -0
  38. package/dist/platform/migrations/0532_subscription_offers.sql +80 -0
  39. package/dist/platform/migrations/0533_allowances.sql +262 -0
  40. package/dist/platform/migrations/0560_recurring.sql +75 -0
  41. package/dist/platform/sdk/allowance.ts +508 -0
  42. package/dist/platform/sdk/capacity.ts +89 -0
  43. package/dist/platform/sdk/contract.ts +97 -1
  44. package/dist/platform/sdk/document.ts +161 -14
  45. package/dist/platform/sdk/field-types.ts +5 -0
  46. package/dist/platform/sdk/index.ts +3 -0
  47. package/dist/platform/sdk/manifest.ts +206 -5
  48. package/dist/platform/sdk/media.ts +62 -0
  49. package/dist/platform/sdk/recurring.ts +314 -0
  50. package/dist/platform/sdk/rich-text.ts +52 -4
  51. package/dist/platform/sdk/sellable.ts +120 -0
  52. package/dist/platform/sdk/states.ts +162 -1
  53. package/dist/platform/sdk/unique.ts +81 -0
  54. package/dist/run-BMSZKTN3.js +648 -0
  55. package/dist/run-GMQBAV6H.js +309 -0
  56. package/dist/{run-4JNFLYXV.js → run-TNHMG5RI.js} +51 -390
  57. package/dist/src-7DXXGZG2.js +38 -0
  58. package/dist/{src-J27WXNLY.js → src-BDG7PERB.js} +73 -1
  59. package/dist/visibility-XSBZTO66.js +33 -0
  60. package/package.json +2 -2
  61. package/dist/chunk-MAXLUQKB.js +0 -1287
  62. package/dist/invoke-NHHOLLF6.js +0 -26
  63. package/dist/src-G6OF5SKW.js +0 -31
@@ -0,0 +1,552 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ MEDIA_FILE_TYPES,
4
+ MEDIA_KINDS,
5
+ MEDIA_TYPES,
6
+ MEDIA_VIDEO_TYPE
7
+ } from "./chunk-2MLAPQU7.js";
8
+
9
+ // ../core/src/fields/types.ts
10
+ function defineObject(object) {
11
+ const names = /* @__PURE__ */ new Set();
12
+ for (const field of object.fields) {
13
+ if (names.has(field.name)) throw new Error(`${object.name}: duplicate field ${field.name}`);
14
+ names.add(field.name);
15
+ if ((field.filterable || field.sortable) && !field.column && !field.related) {
16
+ throw new Error(`${object.name}.${field.name}: filterable fields need a column or related`);
17
+ }
18
+ if (field.sortable && !field.column) {
19
+ throw new Error(`${object.name}.${field.name}: only single-valued fields can be sortable`);
20
+ }
21
+ if (field.type === "enum" && !field.enumValues?.length) {
22
+ throw new Error(`${object.name}.${field.name}: enum fields need enumValues`);
23
+ }
24
+ }
25
+ if (!names.has(object.defaultSort.field)) {
26
+ throw new Error(`${object.name}: default sort field ${object.defaultSort.field} is unknown`);
27
+ }
28
+ return object;
29
+ }
30
+ function getField(object, name) {
31
+ return object.fields.find((field) => field.name === name);
32
+ }
33
+ function timelineFields(object) {
34
+ return object.fields.filter((field) => field.track === "timeline").map((field) => field.name);
35
+ }
36
+
37
+ // ../core/src/fields/media.ts
38
+ var ITEM_TYPES = [...MEDIA_TYPES, ...MEDIA_FILE_TYPES, MEDIA_VIDEO_TYPE];
39
+ var mediaObject = defineObject({
40
+ name: "media",
41
+ label: "Media",
42
+ plural: "Media",
43
+ source: "rec_media",
44
+ titleField: "name",
45
+ defaultSort: { field: "createdAt", direction: "desc" },
46
+ fields: [
47
+ { name: "id", label: "ID", type: "id", column: "id", filterable: true, sortable: true },
48
+ { name: "name", label: "Name", type: "text", column: "name", filterable: true, sortable: true },
49
+ {
50
+ name: "kind",
51
+ label: "Kind",
52
+ type: "enum",
53
+ enumValues: MEDIA_KINDS,
54
+ column: "kind",
55
+ filterable: true,
56
+ sortable: true
57
+ },
58
+ {
59
+ name: "type",
60
+ label: "Type",
61
+ type: "enum",
62
+ enumValues: ITEM_TYPES,
63
+ column: "type",
64
+ filterable: true,
65
+ sortable: true
66
+ },
67
+ {
68
+ name: "bytes",
69
+ label: "Size",
70
+ type: "number",
71
+ column: "bytes",
72
+ filterable: true,
73
+ sortable: true
74
+ },
75
+ {
76
+ name: "width",
77
+ label: "Width",
78
+ type: "number",
79
+ column: "width",
80
+ filterable: true,
81
+ sortable: true
82
+ },
83
+ {
84
+ name: "height",
85
+ label: "Height",
86
+ type: "number",
87
+ column: "height",
88
+ filterable: true,
89
+ sortable: true
90
+ },
91
+ {
92
+ name: "state",
93
+ label: "State",
94
+ type: "enum",
95
+ enumValues: ["uploading", "processing", "ready", "failed"],
96
+ column: "state",
97
+ filterable: true,
98
+ sortable: true
99
+ },
100
+ {
101
+ name: "duration",
102
+ label: "Duration (seconds)",
103
+ type: "number",
104
+ column: "duration",
105
+ filterable: true,
106
+ sortable: true
107
+ },
108
+ {
109
+ name: "alt",
110
+ label: "Alt text",
111
+ type: "text",
112
+ column: "alt",
113
+ filterable: true,
114
+ sortable: false
115
+ },
116
+ {
117
+ name: "createdAt",
118
+ label: "Uploaded",
119
+ type: "datetime",
120
+ column: "created_at",
121
+ filterable: true,
122
+ sortable: true
123
+ },
124
+ {
125
+ name: "createdBy",
126
+ label: "Uploaded by",
127
+ type: "id",
128
+ column: "created_by",
129
+ filterable: true,
130
+ sortable: false
131
+ }
132
+ ]
133
+ });
134
+
135
+ // ../core/src/fields/subscription.ts
136
+ var SUBSCRIPTION_STATES = [
137
+ "incomplete",
138
+ "expired",
139
+ "trialing",
140
+ "active",
141
+ "past_due",
142
+ "unpaid",
143
+ "paused",
144
+ "ended"
145
+ ];
146
+ var STATE_LABELS = {
147
+ incomplete: "Incomplete",
148
+ expired: "Expired",
149
+ trialing: "Trial",
150
+ active: "Active",
151
+ past_due: "Past due",
152
+ unpaid: "Unpaid",
153
+ paused: "Paused",
154
+ ended: "Ended"
155
+ };
156
+ var LIVE = ["incomplete", "trialing", "active", "past_due", "unpaid", "paused"];
157
+ var others = (state) => LIVE.filter((s) => s !== state);
158
+ var SUBSCRIPTION_MACHINE = {
159
+ field: "state",
160
+ initial: "incomplete",
161
+ moves: [
162
+ { from: others("trialing"), to: "trialing", by: ["host"] },
163
+ { from: others("active"), to: "active", by: ["host"] },
164
+ { from: others("past_due"), to: "past_due", by: ["host"] },
165
+ { from: others("unpaid"), to: "unpaid", by: ["host"] },
166
+ { from: others("paused"), to: "paused", by: ["host"] },
167
+ // The first payment never succeeded within the provider's 23 hours.
168
+ { from: "incomplete", to: "expired", by: ["host"], final: true },
169
+ { from: [...LIVE], to: "ended", by: ["host"], final: true }
170
+ ]
171
+ };
172
+ var id = { type: "id", filterable: true, sortable: false };
173
+ var amount = { type: "number", filterable: true, sortable: true };
174
+ var when = { type: "datetime", filterable: true, sortable: true };
175
+ var text = (name, label, column) => ({ name, label, type: "text", column, filterable: true, sortable: false });
176
+ var subscriptionObject = defineObject({
177
+ name: "subscription",
178
+ label: "Subscription",
179
+ plural: "Subscriptions",
180
+ source: "rec_subscription",
181
+ titleField: "planTitle",
182
+ defaultSort: { field: "createdAt", direction: "desc" },
183
+ states: SUBSCRIPTION_MACHINE,
184
+ customer: {
185
+ field: "payerPersonId",
186
+ read: [
187
+ "holderPersonId",
188
+ "planObject",
189
+ "planId",
190
+ "planTitle",
191
+ "amount",
192
+ "currency",
193
+ "interval",
194
+ "taxed",
195
+ "state",
196
+ "trialEnd",
197
+ "currentPeriodStart",
198
+ "currentPeriodEnd",
199
+ "cancelAtPeriodEnd",
200
+ "cancelAt",
201
+ "canceledAt",
202
+ "endedAt",
203
+ "actionUrl",
204
+ "createdAt"
205
+ ],
206
+ write: []
207
+ },
208
+ fields: [
209
+ { name: "id", label: "ID", type: "id", column: "id", filterable: true, sortable: true },
210
+ {
211
+ ...id,
212
+ name: "payerPersonId",
213
+ label: "Payer",
214
+ column: "payer_person_id",
215
+ fieldType: "relation",
216
+ options: { to: "person" }
217
+ },
218
+ {
219
+ ...id,
220
+ name: "holderPersonId",
221
+ label: "Holder",
222
+ column: "holder_person_id",
223
+ fieldType: "relation",
224
+ options: { to: "person" }
225
+ },
226
+ text("email", "Email", "email"),
227
+ {
228
+ name: "placedAs",
229
+ label: "Started by",
230
+ type: "enum",
231
+ enumValues: ["customer", "public", "staff"],
232
+ column: "placed_as",
233
+ filterable: true,
234
+ sortable: false
235
+ },
236
+ text("planObject", "Plan's object", "plan_object"),
237
+ { ...id, name: "planId", label: "Plan", column: "plan_id" },
238
+ text("planTitle", "Plan", "plan_title"),
239
+ { ...amount, name: "amount", label: "Price per period", column: "amount" },
240
+ text("currency", "Currency", "currency"),
241
+ {
242
+ name: "interval",
243
+ label: "Every",
244
+ type: "enum",
245
+ enumValues: ["week", "month", "year"],
246
+ column: "interval",
247
+ filterable: true,
248
+ sortable: false
249
+ },
250
+ {
251
+ name: "taxed",
252
+ label: "Taxed",
253
+ type: "boolean",
254
+ column: "taxed",
255
+ filterable: true,
256
+ sortable: false
257
+ },
258
+ {
259
+ name: "state",
260
+ label: "State",
261
+ type: "enum",
262
+ enumValues: SUBSCRIPTION_STATES,
263
+ column: "state",
264
+ filterable: true,
265
+ sortable: true,
266
+ options: {
267
+ choices: SUBSCRIPTION_STATES.map((value) => ({ value, label: STATE_LABELS[value] }))
268
+ }
269
+ },
270
+ text("provider", "Provider", "provider"),
271
+ text("providerRef", "Provider's reference", "provider_ref"),
272
+ { ...when, name: "trialEnd", label: "Trial ends", column: "trial_end" },
273
+ { ...when, name: "currentPeriodStart", label: "Period from", column: "current_period_start" },
274
+ { ...when, name: "currentPeriodEnd", label: "Period to", column: "current_period_end" },
275
+ {
276
+ name: "cancelAtPeriodEnd",
277
+ label: "Ends at period end",
278
+ type: "boolean",
279
+ column: "cancel_at_period_end",
280
+ filterable: true,
281
+ sortable: false
282
+ },
283
+ // A date set at the provider another way (its dashboard): the host's resume cannot undo it.
284
+ { ...when, name: "cancelAt", label: "Ends on", column: "cancel_at" },
285
+ { ...when, name: "canceledAt", label: "Cancelled on", column: "canceled_at" },
286
+ { ...when, name: "endedAt", label: "Ended on", column: "ended_at" },
287
+ text("endReason", "Why it ended", "end_reason"),
288
+ text("actionUrl", "Confirm payment at", "action_url"),
289
+ { ...when, name: "failingSince", label: "Failing since", column: "failing_since" },
290
+ { ...when, name: "createdAt", label: "Started", column: "created_at" },
291
+ { ...when, name: "updatedAt", label: "Updated", column: "updated_at" }
292
+ ]
293
+ });
294
+
295
+ // ../core/src/fields/order.ts
296
+ var ORDER_STATES = [
297
+ "pending",
298
+ "part_paid",
299
+ "paid",
300
+ "cancelled",
301
+ "expired",
302
+ "refunded"
303
+ ];
304
+ var STATE_LABELS2 = {
305
+ pending: "Pending",
306
+ part_paid: "Part paid",
307
+ paid: "Paid",
308
+ cancelled: "Cancelled",
309
+ expired: "Expired",
310
+ refunded: "Refunded"
311
+ };
312
+ var ORDER_MACHINE = {
313
+ field: "state",
314
+ initial: "pending",
315
+ moves: [
316
+ // Only a verified payment marks an order paid, in part or in full.
317
+ { from: ["pending", "part_paid", "expired"], to: "paid", by: ["host"] },
318
+ // A late deposit staff honour (ADR 0429) makes an expired order part paid.
319
+ { from: ["pending", "expired"], to: "part_paid", by: ["host"] },
320
+ // A buyer may give up an order they have paid nothing on. Once money is on it, staff cancel.
321
+ { from: "pending", to: "cancelled", by: ["staff", "customer"], final: true },
322
+ { from: "part_paid", to: "cancelled", by: ["staff"], final: true },
323
+ // Not final: a late payment staff choose to honour makes it paid.
324
+ { from: "pending", to: "expired", by: ["host"] },
325
+ { from: "paid", to: "refunded", by: ["host"], final: true }
326
+ ]
327
+ };
328
+ var id2 = { type: "id", filterable: true, sortable: false };
329
+ var amount2 = { type: "number", filterable: true, sortable: true };
330
+ var when2 = { type: "datetime", filterable: true, sortable: true };
331
+ var orderObject = defineObject({
332
+ name: "order",
333
+ label: "Order",
334
+ plural: "Orders",
335
+ source: "rec_order",
336
+ defaultSort: { field: "createdAt", direction: "desc" },
337
+ states: ORDER_MACHINE,
338
+ customer: {
339
+ field: "personId",
340
+ read: [
341
+ "state",
342
+ "currency",
343
+ "total",
344
+ "paid",
345
+ "balance",
346
+ "refunded",
347
+ "pay",
348
+ "deposit",
349
+ "balanceDueAt",
350
+ "expiresAt",
351
+ "paidAt",
352
+ "createdAt",
353
+ "taxAmount",
354
+ "taxRefunded",
355
+ "taxCountry",
356
+ "subscriptionId",
357
+ "periodStart",
358
+ "periodEnd"
359
+ ],
360
+ write: []
361
+ },
362
+ fields: [
363
+ { name: "id", label: "ID", type: "id", column: "id", filterable: true, sortable: true },
364
+ {
365
+ ...id2,
366
+ name: "personId",
367
+ label: "Person",
368
+ column: "person_id",
369
+ // What the customer declaration needs to know: this is whose order it is.
370
+ fieldType: "relation",
371
+ options: { to: "person" }
372
+ },
373
+ {
374
+ name: "email",
375
+ label: "Email",
376
+ type: "text",
377
+ column: "email",
378
+ filterable: true,
379
+ sortable: false
380
+ },
381
+ {
382
+ name: "state",
383
+ label: "State",
384
+ type: "enum",
385
+ enumValues: ORDER_STATES,
386
+ column: "state",
387
+ filterable: true,
388
+ sortable: true,
389
+ options: {
390
+ choices: ORDER_STATES.map((value) => ({ value, label: STATE_LABELS2[value] }))
391
+ }
392
+ },
393
+ {
394
+ name: "currency",
395
+ label: "Currency",
396
+ type: "text",
397
+ column: "currency",
398
+ filterable: true,
399
+ sortable: false
400
+ },
401
+ { ...amount2, name: "total", label: "Total", column: "total" },
402
+ { ...amount2, name: "paid", label: "Paid", column: "paid" },
403
+ { ...amount2, name: "balance", label: "Balance", column: "balance" },
404
+ { ...amount2, name: "refunded", label: "Refunded", column: "refunded" },
405
+ {
406
+ name: "pay",
407
+ label: "Paying",
408
+ type: "enum",
409
+ enumValues: ["full", "deposit"],
410
+ column: "pay",
411
+ filterable: true,
412
+ sortable: false
413
+ },
414
+ { ...amount2, name: "deposit", label: "Deposit", column: "deposit" },
415
+ { ...when2, name: "balanceDueAt", label: "Balance due", column: "balance_due_at" },
416
+ { ...when2, name: "expiresAt", label: "Expires", column: "expires_at" },
417
+ {
418
+ name: "placedAs",
419
+ label: "Placed by",
420
+ type: "enum",
421
+ enumValues: ["customer", "public", "staff"],
422
+ column: "placed_as",
423
+ filterable: true,
424
+ sortable: false
425
+ },
426
+ { ...when2, name: "paidAt", label: "Paid on", column: "paid_at" },
427
+ { ...when2, name: "cancelledAt", label: "Cancelled on", column: "cancelled_at" },
428
+ { ...when2, name: "refundedAt", label: "Refunded on", column: "refunded_at" },
429
+ { ...when2, name: "createdAt", label: "Created", column: "created_at" },
430
+ { ...when2, name: "updatedAt", label: "Updated", column: "updated_at" },
431
+ // Tax at checkout (ADR 0479): the provider's figures, inside the amounts above.
432
+ { ...amount2, name: "taxAmount", label: "Tax", column: "tax_amount" },
433
+ { ...amount2, name: "taxRefunded", label: "Tax refunded", column: "tax_refunded" },
434
+ {
435
+ name: "taxCountry",
436
+ label: "Tax country",
437
+ type: "text",
438
+ column: "tax_country",
439
+ filterable: true,
440
+ sortable: false
441
+ },
442
+ { ...amount2, name: "net", label: "Net of tax", column: "net" },
443
+ // A subscription period's order (ADR 0486).
444
+ { ...id2, name: "subscriptionId", label: "Subscription", column: "subscription_id" },
445
+ { ...when2, name: "periodStart", label: "Period from", column: "period_start" },
446
+ { ...when2, name: "periodEnd", label: "Period to", column: "period_end" },
447
+ // Staff only: a period paid other than as agreed, recorded for what was paid.
448
+ {
449
+ name: "periodFlag",
450
+ label: "Paid other than agreed",
451
+ type: "enum",
452
+ enumValues: ["paid_less", "paid_more", "not_as_agreed"],
453
+ column: "period_flag",
454
+ filterable: true,
455
+ sortable: false
456
+ }
457
+ ]
458
+ });
459
+ var orderLineObject = defineObject({
460
+ name: "orderLine",
461
+ label: "Order line",
462
+ plural: "Order lines",
463
+ source: "rec_order_line",
464
+ defaultSort: { field: "position", direction: "asc" },
465
+ customer: {
466
+ field: "personId",
467
+ read: [
468
+ "orderId",
469
+ "position",
470
+ "object",
471
+ "recordId",
472
+ "title",
473
+ "quantity",
474
+ "unitPrice",
475
+ "total",
476
+ "taxAmount"
477
+ ],
478
+ write: []
479
+ },
480
+ fields: [
481
+ { name: "id", label: "ID", type: "id", column: "id", filterable: true, sortable: true },
482
+ { ...id2, name: "orderId", label: "Order", column: "order_id" },
483
+ {
484
+ ...id2,
485
+ name: "personId",
486
+ label: "Person",
487
+ column: "person_id",
488
+ fieldType: "relation",
489
+ options: { to: "person" }
490
+ },
491
+ { ...amount2, name: "position", label: "Position", column: "position" },
492
+ {
493
+ name: "object",
494
+ label: "What is bought",
495
+ type: "text",
496
+ column: "object_type",
497
+ filterable: true,
498
+ sortable: false
499
+ },
500
+ { ...id2, name: "recordId", label: "Record", column: "record_id" },
501
+ {
502
+ name: "title",
503
+ label: "Title",
504
+ type: "text",
505
+ column: "title",
506
+ filterable: true,
507
+ sortable: false
508
+ },
509
+ { ...amount2, name: "quantity", label: "Quantity", column: "quantity" },
510
+ { ...amount2, name: "unitPrice", label: "Unit price", column: "unit_price" },
511
+ { ...amount2, name: "total", label: "Line total", column: "line_total" },
512
+ { ...when2, name: "createdAt", label: "Created", column: "created_at" },
513
+ { ...amount2, name: "taxAmount", label: "Tax", column: "tax_amount" },
514
+ {
515
+ name: "taxCode",
516
+ label: "Tax code",
517
+ type: "text",
518
+ column: "tax_code",
519
+ filterable: true,
520
+ sortable: false
521
+ }
522
+ ]
523
+ });
524
+ var BASE_OBJECTS = {
525
+ order: orderObject,
526
+ orderLine: orderLineObject,
527
+ // Stage 28 (ADR 0444): the media library.
528
+ media: mediaObject,
529
+ // Stage 32a (ADR 0485): a subscription the payment provider runs.
530
+ subscription: subscriptionObject
531
+ };
532
+ var BASE_TABLES = {
533
+ order: "core_order",
534
+ orderLine: "core_order_line",
535
+ media: "core_media",
536
+ subscription: "core_subscription"
537
+ };
538
+
539
+ export {
540
+ defineObject,
541
+ getField,
542
+ timelineFields,
543
+ mediaObject,
544
+ SUBSCRIPTION_STATES,
545
+ subscriptionObject,
546
+ ORDER_STATES,
547
+ ORDER_MACHINE,
548
+ orderObject,
549
+ orderLineObject,
550
+ BASE_OBJECTS,
551
+ BASE_TABLES
552
+ };
@@ -2,16 +2,23 @@
2
2
  import {
3
3
  productContract,
4
4
  renderClient
5
- } from "./chunk-KTXGEXTY.js";
6
- import "./chunk-XDDBLYKW.js";
7
- import "./chunk-LTQDLCP7.js";
8
- import "./chunk-ZRWF6QZS.js";
9
- import "./chunk-6UWRT4VM.js";
10
- import "./chunk-MAXLUQKB.js";
11
- import "./chunk-STJZJIRA.js";
5
+ } from "./chunk-P6YZMS3F.js";
6
+ import "./chunk-STBMGUTM.js";
7
+ import "./chunk-7U3OZLTK.js";
8
+ import "./chunk-LPD2VR5M.js";
9
+ import "./chunk-Z52IX5WL.js";
10
+ import "./chunk-VTQNOQGA.js";
11
+ import "./chunk-NDKVIG23.js";
12
+ import "./chunk-NSSUOI3Z.js";
13
+ import "./chunk-56A6RJIU.js";
14
+ import "./chunk-OV3OFYPI.js";
15
+ import "./chunk-DU6OIFOU.js";
12
16
  import "./chunk-KGHA67HG.js";
13
- import "./chunk-2S7375SC.js";
14
- import "./chunk-X6I2LWB3.js";
17
+ import "./chunk-6UWRT4VM.js";
18
+ import "./chunk-7O4F3NU4.js";
19
+ import "./chunk-3MIEYXRY.js";
20
+ import "./chunk-ZSR5H4O7.js";
21
+ import "./chunk-2MLAPQU7.js";
15
22
  import "./chunk-5KSXSK7Y.js";
16
23
 
17
24
  // ../client-gen/src/node/cli.ts
@@ -2,7 +2,11 @@
2
2
  import {
3
3
  checkEvaluated,
4
4
  checkManifest
5
- } from "./chunk-MAXLUQKB.js";
5
+ } from "./chunk-NDKVIG23.js";
6
+ import "./chunk-NSSUOI3Z.js";
7
+ import "./chunk-56A6RJIU.js";
8
+ import "./chunk-OV3OFYPI.js";
9
+ import "./chunk-KGHA67HG.js";
6
10
  import {
7
11
  CaseBuilder,
8
12
  CaseNode,
@@ -52,14 +56,14 @@ import {
52
56
  refreshSchemaRegistry,
53
57
  sql,
54
58
  waitOrAbort
55
- } from "./chunk-STJZJIRA.js";
56
- import "./chunk-KGHA67HG.js";
57
- import "./chunk-2S7375SC.js";
59
+ } from "./chunk-7O4F3NU4.js";
60
+ import "./chunk-3MIEYXRY.js";
61
+ import "./chunk-ZSR5H4O7.js";
58
62
  import {
59
63
  OLD_OPS_SPECIFIER,
60
64
  OPS_MODULE,
61
65
  OPS_SPECIFIER
62
- } from "./chunk-X6I2LWB3.js";
66
+ } from "./chunk-2MLAPQU7.js";
63
67
  import {
64
68
  __commonJS,
65
69
  __toESM
@@ -31092,6 +31096,12 @@ function siblingsNamed(dir, id, manifest) {
31092
31096
  const name = match[1];
31093
31097
  if (name !== id && existsSync2(join4(dirname3(resolve2(dir)), name, "index.ts"))) names.add(name);
31094
31098
  }
31099
+ const required = manifest?.requires;
31100
+ for (const name of Array.isArray(required) ? required : []) {
31101
+ if (typeof name === "string" && name !== id && existsSync2(join4(dirname3(resolve2(dir)), name, "index.ts"))) {
31102
+ names.add(name);
31103
+ }
31104
+ }
31095
31105
  return [...names].sort();
31096
31106
  }
31097
31107
  async function installSibling(platform, local, dir, now, done) {
@@ -31105,7 +31115,9 @@ async function installSibling(platform, local, dir, now, done) {
31105
31115
  if (why) return `${sibling}: ${why}`;
31106
31116
  }
31107
31117
  await refreshSchemaRegistry(local.db);
31108
- const { issues, plan } = await checkManifest(local.db, id, evaluated.manifest, now);
31118
+ const { issues, plan } = await checkManifest(local.db, id, evaluated.manifest, now, {
31119
+ installed: [...done]
31120
+ });
31109
31121
  if (issues.length || !plan) return issues[0]?.message ?? "it has no reconcile plan";
31110
31122
  local.batch(plan.statements);
31111
31123
  return null;
@@ -31160,8 +31172,8 @@ async function checkExtensionDir(dir, options = {}) {
31160
31172
  const local = await createLocalDb(platform.migrations);
31161
31173
  try {
31162
31174
  const before = [];
31175
+ const done = /* @__PURE__ */ new Set([id]);
31163
31176
  if (evaluated.ok) {
31164
- const done = /* @__PURE__ */ new Set([id]);
31165
31177
  for (const sibling of siblingsNamed(root, id, evaluated.manifest)) {
31166
31178
  const why = await installSibling(platform, local, join4(dirname3(root), sibling), now, done);
31167
31179
  if (why) {
@@ -31176,7 +31188,7 @@ async function checkExtensionDir(dir, options = {}) {
31176
31188
  }
31177
31189
  }
31178
31190
  await refreshSchemaRegistry(local.db);
31179
- const result = await checkEvaluated(local.db, id, evaluated, now);
31191
+ const result = await checkEvaluated(local.db, id, evaluated, now, { installed: [...done] });
31180
31192
  const issues = [...before, ...result.issues];
31181
31193
  return {
31182
31194
  ...result,
package/dist/cli.js CHANGED
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  ghAvailable,
4
4
  ghVerifier
5
- } from "./chunk-E5JLTLRM.js";
5
+ } from "./chunk-GYTEW66E.js";
6
6
  import {
7
7
  Redactor,
8
8
  runCli,
9
9
  terminalIo
10
- } from "./chunk-G3ORKXVP.js";
11
- import "./chunk-ZRWF6QZS.js";
10
+ } from "./chunk-RFJOPI42.js";
11
+ import "./chunk-DU6OIFOU.js";
12
+ import "./chunk-KGHA67HG.js";
12
13
  import "./chunk-2ABSVMGB.js";
13
14
  import "./chunk-6UWRT4VM.js";
14
- import "./chunk-KGHA67HG.js";
15
15
  import "./chunk-5KSXSK7Y.js";
16
16
 
17
17
  // src/cli.ts
@@ -22,12 +22,12 @@ import {
22
22
  upgradeRepo,
23
23
  withEnvBinding,
24
24
  withTsExtensions
25
- } from "./chunk-KOKYDJ7Z.js";
26
- import "./chunk-G3ORKXVP.js";
27
- import "./chunk-ZRWF6QZS.js";
25
+ } from "./chunk-RXRD34QW.js";
26
+ import "./chunk-RFJOPI42.js";
27
+ import "./chunk-DU6OIFOU.js";
28
+ import "./chunk-KGHA67HG.js";
28
29
  import "./chunk-2ABSVMGB.js";
29
30
  import "./chunk-6UWRT4VM.js";
30
- import "./chunk-KGHA67HG.js";
31
31
  import "./chunk-5KSXSK7Y.js";
32
32
  export {
33
33
  IMPORT_LOOPBACK_REDIRECT,