@fougere/core 0.18.0-alpha.0 → 0.19.1-alpha.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.
Files changed (103) hide show
  1. package/README.md +1 -1
  2. package/dist/BootRefusal.d.ts +9 -0
  3. package/dist/BootRefusal.d.ts.map +1 -0
  4. package/dist/BootRefusal.js +12 -0
  5. package/dist/BootRefusal.js.map +1 -0
  6. package/dist/CallIdentity.d.ts.map +1 -1
  7. package/dist/CallIdentity.js +2 -1
  8. package/dist/CallIdentity.js.map +1 -1
  9. package/dist/boot/AppLifecycle.d.ts.map +1 -1
  10. package/dist/boot/AppLifecycle.js +2 -1
  11. package/dist/boot/AppLifecycle.js.map +1 -1
  12. package/dist/boot/Emissions.d.ts +8 -1
  13. package/dist/boot/Emissions.d.ts.map +1 -1
  14. package/dist/boot/Emissions.js +16 -11
  15. package/dist/boot/Emissions.js.map +1 -1
  16. package/dist/boot/bootstrap.d.ts.map +1 -1
  17. package/dist/boot/bootstrap.js +22 -9
  18. package/dist/boot/bootstrap.js.map +1 -1
  19. package/dist/boot/card.d.ts.map +1 -1
  20. package/dist/boot/card.js.map +1 -1
  21. package/dist/boot/install.d.ts.map +1 -1
  22. package/dist/boot/install.js +1 -0
  23. package/dist/boot/install.js.map +1 -1
  24. package/dist/boot/ownership.d.ts.map +1 -1
  25. package/dist/boot/ownership.js +26 -14
  26. package/dist/boot/ownership.js.map +1 -1
  27. package/dist/diagnostic.d.ts +2 -1
  28. package/dist/diagnostic.d.ts.map +1 -1
  29. package/dist/diagnostic.js +2 -1
  30. package/dist/diagnostic.js.map +1 -1
  31. package/dist/dispatch/ArgumentResolver.d.ts +13 -1
  32. package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
  33. package/dist/dispatch/ArgumentResolver.js +48 -2
  34. package/dist/dispatch/ArgumentResolver.js.map +1 -1
  35. package/dist/dispatch/EntityLookup.d.ts +4 -0
  36. package/dist/dispatch/EntityLookup.d.ts.map +1 -0
  37. package/dist/dispatch/EntityLookup.js +2 -0
  38. package/dist/dispatch/EntityLookup.js.map +1 -0
  39. package/dist/dispatch/Facade.d.ts +3 -0
  40. package/dist/dispatch/Facade.d.ts.map +1 -1
  41. package/dist/dispatch/HandlerFacade.d.ts +2 -0
  42. package/dist/dispatch/HandlerFacade.d.ts.map +1 -1
  43. package/dist/dispatch/HandlerFacade.js +14 -4
  44. package/dist/dispatch/HandlerFacade.js.map +1 -1
  45. package/dist/entry/facade.d.ts +10 -1
  46. package/dist/entry/facade.d.ts.map +1 -1
  47. package/dist/entry/facade.js +26 -2
  48. package/dist/entry/facade.js.map +1 -1
  49. package/dist/index.d.ts +2 -0
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +2 -0
  52. package/dist/index.js.map +1 -1
  53. package/dist/prefab/CrudConstructor.d.ts.map +1 -1
  54. package/dist/prefab/CrudConstructor.js +5 -4
  55. package/dist/prefab/CrudConstructor.js.map +1 -1
  56. package/dist/prefab/Middleware.d.ts +13 -0
  57. package/dist/prefab/Middleware.d.ts.map +1 -0
  58. package/dist/prefab/Middleware.js +10 -0
  59. package/dist/prefab/Middleware.js.map +1 -0
  60. package/dist/wire/Facade.d.ts +5 -7
  61. package/dist/wire/Facade.d.ts.map +1 -1
  62. package/dist/wire/Facade.js.map +1 -1
  63. package/dist/wire/Invocation.d.ts +2 -1
  64. package/dist/wire/Invocation.d.ts.map +1 -1
  65. package/dist/wire/Invocation.js +4 -1
  66. package/dist/wire/Invocation.js.map +1 -1
  67. package/dist/wire/InvocationContext.d.ts +6 -0
  68. package/dist/wire/InvocationContext.d.ts.map +1 -1
  69. package/dist/wire/OperationContract.js +2 -2
  70. package/dist/wire/OperationContract.js.map +1 -1
  71. package/dist/wire/SignedCall.d.ts +2 -0
  72. package/dist/wire/SignedCall.d.ts.map +1 -1
  73. package/dist/wire/TypeRef.d.ts +5 -3
  74. package/dist/wire/TypeRef.d.ts.map +1 -1
  75. package/dist/wire/binding.d.ts +8 -1
  76. package/dist/wire/binding.d.ts.map +1 -1
  77. package/dist/wire/binding.js +2 -2
  78. package/dist/wire/binding.js.map +1 -1
  79. package/package.json +3 -3
  80. package/src/BootRefusal.ts +11 -0
  81. package/src/CallIdentity.ts +2 -1
  82. package/src/boot/AppLifecycle.ts +2 -1
  83. package/src/boot/Emissions.ts +18 -11
  84. package/src/boot/bootstrap.ts +25 -10
  85. package/src/boot/card.ts +1 -2
  86. package/src/boot/install.ts +1 -0
  87. package/src/boot/ownership.ts +35 -16
  88. package/src/diagnostic.ts +4 -2
  89. package/src/dispatch/ArgumentResolver.ts +54 -2
  90. package/src/dispatch/EntityLookup.ts +4 -0
  91. package/src/dispatch/Facade.ts +3 -0
  92. package/src/dispatch/HandlerFacade.ts +14 -6
  93. package/src/entry/facade.ts +38 -2
  94. package/src/index.ts +2 -0
  95. package/src/prefab/CrudConstructor.ts +6 -5
  96. package/src/prefab/Middleware.ts +13 -0
  97. package/src/wire/Facade.ts +6 -9
  98. package/src/wire/Invocation.ts +3 -1
  99. package/src/wire/InvocationContext.ts +6 -0
  100. package/src/wire/OperationContract.ts +2 -2
  101. package/src/wire/SignedCall.ts +2 -0
  102. package/src/wire/TypeRef.ts +4 -2
  103. package/src/wire/binding.ts +7 -4
@@ -5,6 +5,8 @@ export interface SignedCall {
5
5
  params?: Record<string, unknown>;
6
6
  query?: Record<string, unknown>;
7
7
  input?: unknown;
8
+ /** What code wrote for the handler — pinned like the input, or a signed call replays with others. */
9
+ args?: readonly unknown[];
8
10
  state?: Record<string, unknown>;
9
11
  /** The hour, pinned like the input: moving it is moving the call. */
10
12
  runAt?: number;
@@ -16,6 +16,8 @@ export interface TypeRef {
16
16
  undefined?: boolean;
17
17
  /** Whether this is a Promise wrapper (unwrapped in output). */
18
18
  promise?: boolean;
19
- /** `Post['id']` — the entity whose primary key this value is, and the field holding it. */
20
- identifies?: { entity: string; field: string };
19
+ /** `Post['title']` — the field this type is read from, whose rules the value obeys. */
20
+ field?: { entity: string; name: string };
21
+ /** The entity whose row this value designates — set by the scan when `field` is its primary. */
22
+ identifies?: string;
21
23
  }
@@ -17,8 +17,11 @@ type ParamSource =
17
17
  * (`Emissions.stamped`, which realizes `created()`); this is the declared form of it.
18
18
  */
19
19
  | { kind: 'pipe'; factName: string }
20
- /** `identifies` names the entity whose row the value designates — `id: Post['id']`. */
21
- | { kind: 'param'; name: string; coerce?: 'number' | 'boolean'; identifies?: string }
20
+ /**
21
+ * `field` is where the value's rules are declared — `title: Post['title']`. `identifies` names
22
+ * the entity whose row the value designates, when that field is its primary.
23
+ */
24
+ | { kind: 'param'; name: string; coerce?: 'number' | 'boolean'; field?: { entity: string; name: string }; identifies?: string }
22
25
  | { kind: 'input' }
23
26
  | { kind: 'context' }
24
27
  /** The whole query bag, for an op whose argument IS the options (list). */
@@ -78,9 +81,9 @@ function sourceOf(param: Param, collectorTypeNames: Set<string>): ParamSource {
78
81
  if (collectorTypeNames.has(typeKey)) return { kind: 'collector', typeName: typeKey };
79
82
  if (typeName === 'InvocationContext') return { kind: 'context' };
80
83
  if (PRIMITIVES.has(typeName)) {
81
- const identifies = param.type.identifies?.entity;
84
+ const { field, identifies } = param.type;
82
85
 
83
- return { kind: 'param', name: param.name, coerce: coercionFor(typeName), ...(identifies && { identifies }) };
86
+ return { kind: 'param', name: param.name, coerce: coercionFor(typeName), ...(field && { field }), ...(identifies && { identifies }) };
84
87
  }
85
88
 
86
89
  return { kind: 'input' };