@oatscenter/trellis 0.100.0-rc.1

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 (264) hide show
  1. package/README.md +59 -0
  2. package/auth/authorization/client_context.d.ts +61 -0
  3. package/auth/authorization/client_context.js +266 -0
  4. package/auth/authorization/nats_registry.d.ts +41 -0
  5. package/auth/authorization/nats_registry.js +283 -0
  6. package/auth/authorization/provider_cache.d.ts +90 -0
  7. package/auth/authorization/provider_cache.js +783 -0
  8. package/auth/authorization/refresh.d.ts +46 -0
  9. package/auth/authorization/refresh.js +246 -0
  10. package/auth/authorization/types.d.ts +207 -0
  11. package/auth/authorization/types.js +60 -0
  12. package/auth/authorization_context.d.ts +11 -0
  13. package/auth/authorization_context.js +10 -0
  14. package/auth/browser/flow_types.d.ts +84 -0
  15. package/auth/browser/flow_types.js +70 -0
  16. package/auth/browser/portal.d.ts +21 -0
  17. package/auth/browser/portal.js +307 -0
  18. package/auth/browser/storage.d.ts +26 -0
  19. package/auth/browser/storage.js +224 -0
  20. package/auth/browser.d.ts +11 -0
  21. package/auth/browser.js +10 -0
  22. package/auth/browser_recovery.d.ts +13 -0
  23. package/auth/browser_recovery.js +38 -0
  24. package/auth/device_activation.d.ts +134 -0
  25. package/auth/device_activation.js +376 -0
  26. package/auth/http_error.d.ts +12 -0
  27. package/auth/http_error.js +32 -0
  28. package/auth/keys.d.ts +5 -0
  29. package/auth/keys.js +63 -0
  30. package/auth/mod.d.ts +16 -0
  31. package/auth/mod.js +16 -0
  32. package/auth/proof.d.ts +31 -0
  33. package/auth/proof.js +95 -0
  34. package/auth/protocol_wasm/trellis_protocol_wasm.d.ts +138 -0
  35. package/auth/protocol_wasm/trellis_protocol_wasm.js +605 -0
  36. package/auth/protocol_wasm/trellis_protocol_wasm_bg.wasm +0 -0
  37. package/auth/protocol_wasm/trellis_protocol_wasm_bytes.d.ts +1 -0
  38. package/auth/protocol_wasm/trellis_protocol_wasm_bytes.js +2 -0
  39. package/auth/protocol_wasm.d.ts +179 -0
  40. package/auth/protocol_wasm.js +133 -0
  41. package/auth/session_auth.d.ts +30 -0
  42. package/auth/session_auth.js +77 -0
  43. package/auth/session_proof.d.ts +53 -0
  44. package/auth/session_proof.js +43 -0
  45. package/auth/time.d.ts +6 -0
  46. package/auth/time.js +7 -0
  47. package/auth/trellis_id.d.ts +1 -0
  48. package/auth/trellis_id.js +5 -0
  49. package/auth/utils.d.ts +10 -0
  50. package/auth/utils.js +69 -0
  51. package/auth.d.ts +1 -0
  52. package/auth.js +1 -0
  53. package/caller.d.ts +111 -0
  54. package/caller.js +85 -0
  55. package/client.d.ts +14 -0
  56. package/client.js +1 -0
  57. package/client_connect.d.ts +143 -0
  58. package/client_connect.js +1097 -0
  59. package/codec.d.ts +13 -0
  60. package/codec.js +192 -0
  61. package/connection.d.ts +107 -0
  62. package/connection.js +396 -0
  63. package/device/activation.d.ts +42 -0
  64. package/device/activation.js +319 -0
  65. package/device.d.ts +80 -0
  66. package/device.js +687 -0
  67. package/env.d.ts +2 -0
  68. package/env.js +10 -0
  69. package/errors/AuthError.d.ts +30 -0
  70. package/errors/AuthError.js +34 -0
  71. package/errors/KVError.d.ts +30 -0
  72. package/errors/KVError.js +36 -0
  73. package/errors/OperationLifecycleError.d.ts +110 -0
  74. package/errors/OperationLifecycleError.js +142 -0
  75. package/errors/RemoteError.d.ts +61 -0
  76. package/errors/RemoteError.js +72 -0
  77. package/errors/SchemaValidationError.d.ts +48 -0
  78. package/errors/SchemaValidationError.js +49 -0
  79. package/errors/StoreError.d.ts +21 -0
  80. package/errors/StoreError.js +31 -0
  81. package/errors/TransferError.d.ts +21 -0
  82. package/errors/TransferError.js +31 -0
  83. package/errors/TransportError.d.ts +29 -0
  84. package/errors/TransportError.js +33 -0
  85. package/errors/TrellisError.d.ts +15 -0
  86. package/errors/TrellisError.js +15 -0
  87. package/errors/ValidationError.d.ts +50 -0
  88. package/errors/ValidationError.js +59 -0
  89. package/errors/index.d.ts +254 -0
  90. package/errors/index.js +238 -0
  91. package/generated.d.ts +4 -0
  92. package/generated.js +3 -0
  93. package/generated_support.d.ts +120 -0
  94. package/generated_support.js +359 -0
  95. package/globals.d.ts +9 -0
  96. package/globals.js +16 -0
  97. package/health_transport.d.ts +18 -0
  98. package/health_transport.js +32 -0
  99. package/helpers.d.ts +11 -0
  100. package/helpers.js +53 -0
  101. package/index.d.ts +2 -0
  102. package/index.js +2 -0
  103. package/internal_sdk/generated/apis/auth/mod.d.ts +805 -0
  104. package/internal_sdk/generated/apis/auth/mod.js +958 -0
  105. package/internal_sdk/generated/apis/core/mod.d.ts +79 -0
  106. package/internal_sdk/generated/apis/core/mod.js +93 -0
  107. package/internal_sdk/generated/apis/events/mod.d.ts +224 -0
  108. package/internal_sdk/generated/apis/events/mod.js +313 -0
  109. package/internal_sdk/generated/apis/health/mod.d.ts +106 -0
  110. package/internal_sdk/generated/apis/health/mod.js +132 -0
  111. package/internal_sdk/generated/apis/index.d.ts +7 -0
  112. package/internal_sdk/generated/apis/index.js +8 -0
  113. package/internal_sdk/generated/apis/jobs/mod.d.ts +176 -0
  114. package/internal_sdk/generated/apis/jobs/mod.js +209 -0
  115. package/internal_sdk/generated/apis/state/mod.d.ts +104 -0
  116. package/internal_sdk/generated/apis/state/mod.js +139 -0
  117. package/internal_sdk/generated/index.d.ts +4 -0
  118. package/internal_sdk/generated/index.js +5 -0
  119. package/internal_sdk/generated/package.json +18 -0
  120. package/internal_sdk/generated/participants/cli/mod.d.ts +402 -0
  121. package/internal_sdk/generated/participants/cli/mod.js +460 -0
  122. package/internal_sdk/generated/participants/cli/types.d.ts +2 -0
  123. package/internal_sdk/generated/participants/cli/types.js +3 -0
  124. package/internal_sdk/generated/participants/console/mod.d.ts +489 -0
  125. package/internal_sdk/generated/participants/console/mod.js +579 -0
  126. package/internal_sdk/generated/participants/console/types.d.ts +2 -0
  127. package/internal_sdk/generated/participants/console/types.js +3 -0
  128. package/internal_sdk/generated/participants/eventsRuntime/mod.d.ts +64 -0
  129. package/internal_sdk/generated/participants/eventsRuntime/mod.js +42 -0
  130. package/internal_sdk/generated/participants/eventsRuntime/types.d.ts +2 -0
  131. package/internal_sdk/generated/participants/eventsRuntime/types.js +3 -0
  132. package/internal_sdk/generated/participants/healthRuntime/mod.d.ts +58 -0
  133. package/internal_sdk/generated/participants/healthRuntime/mod.js +36 -0
  134. package/internal_sdk/generated/participants/healthRuntime/types.d.ts +2 -0
  135. package/internal_sdk/generated/participants/healthRuntime/types.js +3 -0
  136. package/internal_sdk/generated/participants/index.d.ts +8 -0
  137. package/internal_sdk/generated/participants/index.js +9 -0
  138. package/internal_sdk/generated/participants/jobsRuntime/mod.d.ts +64 -0
  139. package/internal_sdk/generated/participants/jobsRuntime/mod.js +42 -0
  140. package/internal_sdk/generated/participants/jobsRuntime/types.d.ts +2 -0
  141. package/internal_sdk/generated/participants/jobsRuntime/types.js +3 -0
  142. package/internal_sdk/generated/participants/platform/mod.d.ts +164 -0
  143. package/internal_sdk/generated/participants/platform/mod.js +149 -0
  144. package/internal_sdk/generated/participants/platform/types.d.ts +7 -0
  145. package/internal_sdk/generated/participants/platform/types.js +5 -0
  146. package/internal_sdk/generated/participants/portal/mod.d.ts +131 -0
  147. package/internal_sdk/generated/participants/portal/mod.js +109 -0
  148. package/internal_sdk/generated/participants/portal/types.d.ts +2 -0
  149. package/internal_sdk/generated/participants/portal/types.js +3 -0
  150. package/internal_sdk/generated/types/_internal/p0.d.ts +13511 -0
  151. package/internal_sdk/generated/types/_internal/p0.js +6105 -0
  152. package/internal_sdk/generated/types/index.d.ts +2951 -0
  153. package/internal_sdk/generated/types/index.js +1477 -0
  154. package/jobs.d.ts +309 -0
  155. package/jobs.js +389 -0
  156. package/kv.d.ts +85 -0
  157. package/kv.js +330 -0
  158. package/operations.d.ts +189 -0
  159. package/operations.js +847 -0
  160. package/package.json +73 -0
  161. package/pagination.d.ts +25 -0
  162. package/pagination.js +117 -0
  163. package/participant.d.ts +6 -0
  164. package/participant.js +6 -0
  165. package/participant_runtime/api.d.ts +131 -0
  166. package/participant_runtime/api.js +42 -0
  167. package/participant_runtime/json.d.ts +16 -0
  168. package/participant_runtime/json.js +193 -0
  169. package/participant_runtime/metadata.d.ts +34 -0
  170. package/participant_runtime/metadata.js +4 -0
  171. package/participant_runtime/participant.d.ts +200 -0
  172. package/participant_runtime/participant.js +330 -0
  173. package/participant_runtime/schemas.d.ts +347 -0
  174. package/participant_runtime/schemas.js +211 -0
  175. package/participant_runtime/surface_names.d.ts +16 -0
  176. package/participant_runtime/surface_names.js +34 -0
  177. package/portable.d.ts +30 -0
  178. package/portable.js +14 -0
  179. package/provider.d.ts +69 -0
  180. package/provider.js +68 -0
  181. package/runtime_transport.d.ts +25 -0
  182. package/runtime_transport.js +48 -0
  183. package/service/mod.d.ts +14 -0
  184. package/service/mod.js +13 -0
  185. package/service/outbox_inbox.d.ts +259 -0
  186. package/service/outbox_inbox.js +908 -0
  187. package/service/runtime/bootstrap.d.ts +56 -0
  188. package/service/runtime/bootstrap.js +226 -0
  189. package/service/runtime/core.d.ts +46 -0
  190. package/service/runtime/core.js +1747 -0
  191. package/service/runtime/health.d.ts +97 -0
  192. package/service/runtime/health.js +153 -0
  193. package/service/runtime/health_schemas.d.ts +23 -0
  194. package/service/runtime/health_schemas.js +20 -0
  195. package/service/runtime/internal_jobs/active-job.d.ts +40 -0
  196. package/service/runtime/internal_jobs/active-job.js +91 -0
  197. package/service/runtime/internal_jobs/bindings.d.ts +40 -0
  198. package/service/runtime/internal_jobs/bindings.js +1 -0
  199. package/service/runtime/internal_jobs/cancellation-registry.d.ts +13 -0
  200. package/service/runtime/internal_jobs/cancellation-registry.js +55 -0
  201. package/service/runtime/internal_jobs/heartbeat.d.ts +33 -0
  202. package/service/runtime/internal_jobs/heartbeat.js +65 -0
  203. package/service/runtime/internal_jobs/job-manager.d.ts +126 -0
  204. package/service/runtime/internal_jobs/job-manager.js +821 -0
  205. package/service/runtime/internal_jobs/key-coordinator.d.ts +280 -0
  206. package/service/runtime/internal_jobs/key-coordinator.js +747 -0
  207. package/service/runtime/internal_jobs/projection.d.ts +3 -0
  208. package/service/runtime/internal_jobs/projection.js +42 -0
  209. package/service/runtime/internal_jobs/runtime-worker.d.ts +126 -0
  210. package/service/runtime/internal_jobs/runtime-worker.js +454 -0
  211. package/service/runtime/internal_jobs/types.d.ts +246 -0
  212. package/service/runtime/internal_jobs/types.js +163 -0
  213. package/service/runtime/logger.d.ts +2 -0
  214. package/service/runtime/logger.js +7 -0
  215. package/service/runtime/runtime.d.ts +16 -0
  216. package/service/runtime/runtime.js +1 -0
  217. package/service/runtime/service.d.ts +372 -0
  218. package/service/runtime/service.js +1896 -0
  219. package/service/runtime/transfer/download.d.ts +27 -0
  220. package/service/runtime/transfer/download.js +1 -0
  221. package/service/runtime/transfer/protocol.d.ts +15 -0
  222. package/service/runtime/transfer/protocol.js +46 -0
  223. package/service/runtime/transfer/queue.d.ts +18 -0
  224. package/service/runtime/transfer/queue.js +136 -0
  225. package/service/runtime/transfer/upload.d.ts +40 -0
  226. package/service/runtime/transfer/upload.js +27 -0
  227. package/service/runtime/transfer.d.ts +62 -0
  228. package/service/runtime/transfer.js +763 -0
  229. package/session.d.ts +862 -0
  230. package/session.js +3407 -0
  231. package/store.d.ts +71 -0
  232. package/store.js +412 -0
  233. package/store_entry.d.ts +20 -0
  234. package/store_entry.js +75 -0
  235. package/tasks.d.ts +10 -0
  236. package/tasks.js +28 -0
  237. package/telemetry/carrier.d.ts +8 -0
  238. package/telemetry/carrier.js +20 -0
  239. package/telemetry/core.d.ts +7 -0
  240. package/telemetry/core.js +14 -0
  241. package/telemetry/env.d.ts +2 -0
  242. package/telemetry/env.js +10 -0
  243. package/telemetry/init.d.ts +2 -0
  244. package/telemetry/init.js +7 -0
  245. package/telemetry/metrics.d.ts +81 -0
  246. package/telemetry/metrics.js +267 -0
  247. package/telemetry/mod.d.ts +13 -0
  248. package/telemetry/mod.js +8 -0
  249. package/telemetry/nats.d.ts +6 -0
  250. package/telemetry/nats.js +6 -0
  251. package/telemetry/result.d.ts +1 -0
  252. package/telemetry/result.js +18 -0
  253. package/telemetry/runtime.d.ts +1 -0
  254. package/telemetry/runtime.js +141 -0
  255. package/telemetry/trace.d.ts +4 -0
  256. package/telemetry/trace.js +26 -0
  257. package/telemetry/trellis.d.ts +1 -0
  258. package/telemetry/trellis.js +1 -0
  259. package/telemetry.d.ts +1 -0
  260. package/telemetry.js +1 -0
  261. package/transfer.d.ts +112 -0
  262. package/transfer.js +525 -0
  263. package/transfer_protocol.d.ts +1 -0
  264. package/transfer_protocol.js +13 -0
@@ -0,0 +1,347 @@
1
+ import Type, { type Static, type TArray, type TObject, type TSchema } from "typebox";
2
+ export declare const ContractEventConsumersSchema: Type.TRecord<"^.*$", Type.TObject<{
3
+ uses: Type.TOptional<Type.TRecord<"^.*$", Type.TArray<Type.TString>>>;
4
+ self: Type.TOptional<Type.TArray<Type.TString>>;
5
+ replay: Type.TOptional<Type.TUnion<[Type.TLiteral<"new">, Type.TLiteral<"all">]>>;
6
+ concurrency: Type.TOptional<Type.TInteger>;
7
+ }>>;
8
+ export type ContractEventConsumers = Static<typeof ContractEventConsumersSchema>;
9
+ export declare const KvResourceBindingSchema: Type.TObject<{
10
+ bucket: Type.TString;
11
+ history: Type.TInteger;
12
+ ttlMs: Type.TInteger;
13
+ maxValueBytes: Type.TOptional<Type.TInteger>;
14
+ }>;
15
+ export type KvResourceBinding = Static<typeof KvResourceBindingSchema>;
16
+ export declare const StoreResourceBindingSchema: Type.TObject<{
17
+ name: Type.TString;
18
+ ttlMs: Type.TInteger;
19
+ maxObjectBytes: Type.TOptional<Type.TInteger>;
20
+ maxTotalBytes: Type.TOptional<Type.TInteger>;
21
+ }>;
22
+ export type StoreResourceBinding = Static<typeof StoreResourceBindingSchema>;
23
+ export declare const JobsQueueKeyConcurrencyBindingSchema: Type.TObject<{
24
+ key: Type.TArray<Type.TString>;
25
+ maxActive: Type.TInteger;
26
+ heartbeatIntervalMs: Type.TInteger;
27
+ heartbeatTtlMs: Type.TInteger;
28
+ stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
29
+ }>;
30
+ export type JobsQueueKeyConcurrencyBinding = Static<typeof JobsQueueKeyConcurrencyBindingSchema>;
31
+ export declare const JobsQueueDepthBindingSchema: Type.TObject<{
32
+ maxQueuedPerKey: Type.TInteger;
33
+ whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
34
+ }>;
35
+ export type JobsQueueDepthBinding = Static<typeof JobsQueueDepthBindingSchema>;
36
+ export declare const JobsQueueBindingSchema: Type.TObject<{
37
+ queueType: Type.TString;
38
+ publishPrefix: Type.TString;
39
+ workSubject: Type.TString;
40
+ consumerName: Type.TString;
41
+ payload: Type.TObject<{
42
+ schema: Type.TString;
43
+ }>;
44
+ update: Type.TOptional<Type.TObject<{
45
+ schema: Type.TString;
46
+ }>>;
47
+ updatesPrefix: Type.TOptional<Type.TString>;
48
+ result: Type.TOptional<Type.TObject<{
49
+ schema: Type.TString;
50
+ }>>;
51
+ maxDeliver: Type.TInteger;
52
+ backoffMs: Type.TArray<Type.TInteger>;
53
+ ackWaitMs: Type.TInteger;
54
+ defaultDeadlineMs: Type.TOptional<Type.TInteger>;
55
+ keyConcurrency: Type.TOptional<Type.TObject<{
56
+ key: Type.TArray<Type.TString>;
57
+ maxActive: Type.TInteger;
58
+ heartbeatIntervalMs: Type.TInteger;
59
+ heartbeatTtlMs: Type.TInteger;
60
+ stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
61
+ }>>;
62
+ queue: Type.TOptional<Type.TObject<{
63
+ maxQueuedPerKey: Type.TInteger;
64
+ whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
65
+ }>>;
66
+ }>;
67
+ export type JobsQueueBinding = Static<typeof JobsQueueBindingSchema>;
68
+ export declare const JobsResourceBindingSchema: Type.TObject<{
69
+ serviceName: Type.TString;
70
+ namespace: Type.TString;
71
+ workStream: Type.TOptional<Type.TString>;
72
+ queues: Type.TRecord<"^.*$", Type.TObject<{
73
+ queueType: Type.TString;
74
+ publishPrefix: Type.TString;
75
+ workSubject: Type.TString;
76
+ consumerName: Type.TString;
77
+ payload: Type.TObject<{
78
+ schema: Type.TString;
79
+ }>;
80
+ update: Type.TOptional<Type.TObject<{
81
+ schema: Type.TString;
82
+ }>>;
83
+ updatesPrefix: Type.TOptional<Type.TString>;
84
+ result: Type.TOptional<Type.TObject<{
85
+ schema: Type.TString;
86
+ }>>;
87
+ maxDeliver: Type.TInteger;
88
+ backoffMs: Type.TArray<Type.TInteger>;
89
+ ackWaitMs: Type.TInteger;
90
+ defaultDeadlineMs: Type.TOptional<Type.TInteger>;
91
+ keyConcurrency: Type.TOptional<Type.TObject<{
92
+ key: Type.TArray<Type.TString>;
93
+ maxActive: Type.TInteger;
94
+ heartbeatIntervalMs: Type.TInteger;
95
+ heartbeatTtlMs: Type.TInteger;
96
+ stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
97
+ }>>;
98
+ queue: Type.TOptional<Type.TObject<{
99
+ maxQueuedPerKey: Type.TInteger;
100
+ whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
101
+ }>>;
102
+ }>>;
103
+ }>;
104
+ export type JobsResourceBinding = Static<typeof JobsResourceBindingSchema>;
105
+ export declare const EventConsumerResourceBindingSchema: Type.TObject<{
106
+ resourceId: Type.TString;
107
+ stream: Type.TString;
108
+ consumerName: Type.TString;
109
+ filterSubjects: Type.TArray<Type.TString>;
110
+ replay: Type.TUnion<[Type.TLiteral<"new">, Type.TLiteral<"all">]>;
111
+ concurrency: Type.TInteger;
112
+ ackWaitMs: Type.TInteger;
113
+ maxDeliver: Type.TInteger;
114
+ backoffMs: Type.TArray<Type.TInteger>;
115
+ replayBinding: Type.TObject<{
116
+ stream: Type.TString;
117
+ consumerName: Type.TString;
118
+ }>;
119
+ }>;
120
+ export type EventConsumerResourceBinding = Static<typeof EventConsumerResourceBindingSchema>;
121
+ export declare const ContractResourceBindingsSchema: Type.TObject<{
122
+ kv: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
123
+ bucket: Type.TString;
124
+ history: Type.TInteger;
125
+ ttlMs: Type.TInteger;
126
+ maxValueBytes: Type.TOptional<Type.TInteger>;
127
+ }>>>;
128
+ store: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
129
+ name: Type.TString;
130
+ ttlMs: Type.TInteger;
131
+ maxObjectBytes: Type.TOptional<Type.TInteger>;
132
+ maxTotalBytes: Type.TOptional<Type.TInteger>;
133
+ }>>>;
134
+ jobs: Type.TOptional<Type.TObject<{
135
+ serviceName: Type.TString;
136
+ namespace: Type.TString;
137
+ workStream: Type.TOptional<Type.TString>;
138
+ queues: Type.TRecord<"^.*$", Type.TObject<{
139
+ queueType: Type.TString;
140
+ publishPrefix: Type.TString;
141
+ workSubject: Type.TString;
142
+ consumerName: Type.TString;
143
+ payload: Type.TObject<{
144
+ schema: Type.TString;
145
+ }>;
146
+ update: Type.TOptional<Type.TObject<{
147
+ schema: Type.TString;
148
+ }>>;
149
+ updatesPrefix: Type.TOptional<Type.TString>;
150
+ result: Type.TOptional<Type.TObject<{
151
+ schema: Type.TString;
152
+ }>>;
153
+ maxDeliver: Type.TInteger;
154
+ backoffMs: Type.TArray<Type.TInteger>;
155
+ ackWaitMs: Type.TInteger;
156
+ defaultDeadlineMs: Type.TOptional<Type.TInteger>;
157
+ keyConcurrency: Type.TOptional<Type.TObject<{
158
+ key: Type.TArray<Type.TString>;
159
+ maxActive: Type.TInteger;
160
+ heartbeatIntervalMs: Type.TInteger;
161
+ heartbeatTtlMs: Type.TInteger;
162
+ stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
163
+ }>>;
164
+ queue: Type.TOptional<Type.TObject<{
165
+ maxQueuedPerKey: Type.TInteger;
166
+ whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
167
+ }>>;
168
+ }>>;
169
+ }>>;
170
+ eventConsumers: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
171
+ resourceId: Type.TString;
172
+ stream: Type.TString;
173
+ consumerName: Type.TString;
174
+ filterSubjects: Type.TArray<Type.TString>;
175
+ replay: Type.TUnion<[Type.TLiteral<"new">, Type.TLiteral<"all">]>;
176
+ concurrency: Type.TInteger;
177
+ ackWaitMs: Type.TInteger;
178
+ maxDeliver: Type.TInteger;
179
+ backoffMs: Type.TArray<Type.TInteger>;
180
+ replayBinding: Type.TObject<{
181
+ stream: Type.TString;
182
+ consumerName: Type.TString;
183
+ }>;
184
+ }>>>;
185
+ }>;
186
+ export type ContractResourceBindings = Static<typeof ContractResourceBindingsSchema>;
187
+ export declare const InstalledGeneratedServiceParticipantSchema: Type.TObject<{
188
+ contractId: Type.TString;
189
+ digest: Type.TString;
190
+ resources: Type.TObject<{
191
+ kv: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
192
+ bucket: Type.TString;
193
+ history: Type.TInteger;
194
+ ttlMs: Type.TInteger;
195
+ maxValueBytes: Type.TOptional<Type.TInteger>;
196
+ }>>>;
197
+ store: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
198
+ name: Type.TString;
199
+ ttlMs: Type.TInteger;
200
+ maxObjectBytes: Type.TOptional<Type.TInteger>;
201
+ maxTotalBytes: Type.TOptional<Type.TInteger>;
202
+ }>>>;
203
+ jobs: Type.TOptional<Type.TObject<{
204
+ serviceName: Type.TString;
205
+ namespace: Type.TString;
206
+ workStream: Type.TOptional<Type.TString>;
207
+ queues: Type.TRecord<"^.*$", Type.TObject<{
208
+ queueType: Type.TString;
209
+ publishPrefix: Type.TString;
210
+ workSubject: Type.TString;
211
+ consumerName: Type.TString;
212
+ payload: Type.TObject<{
213
+ schema: Type.TString;
214
+ }>;
215
+ update: Type.TOptional<Type.TObject<{
216
+ schema: Type.TString;
217
+ }>>;
218
+ updatesPrefix: Type.TOptional<Type.TString>;
219
+ result: Type.TOptional<Type.TObject<{
220
+ schema: Type.TString;
221
+ }>>;
222
+ maxDeliver: Type.TInteger;
223
+ backoffMs: Type.TArray<Type.TInteger>;
224
+ ackWaitMs: Type.TInteger;
225
+ defaultDeadlineMs: Type.TOptional<Type.TInteger>;
226
+ keyConcurrency: Type.TOptional<Type.TObject<{
227
+ key: Type.TArray<Type.TString>;
228
+ maxActive: Type.TInteger;
229
+ heartbeatIntervalMs: Type.TInteger;
230
+ heartbeatTtlMs: Type.TInteger;
231
+ stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
232
+ }>>;
233
+ queue: Type.TOptional<Type.TObject<{
234
+ maxQueuedPerKey: Type.TInteger;
235
+ whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
236
+ }>>;
237
+ }>>;
238
+ }>>;
239
+ eventConsumers: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
240
+ resourceId: Type.TString;
241
+ stream: Type.TString;
242
+ consumerName: Type.TString;
243
+ filterSubjects: Type.TArray<Type.TString>;
244
+ replay: Type.TUnion<[Type.TLiteral<"new">, Type.TLiteral<"all">]>;
245
+ concurrency: Type.TInteger;
246
+ ackWaitMs: Type.TInteger;
247
+ maxDeliver: Type.TInteger;
248
+ backoffMs: Type.TArray<Type.TInteger>;
249
+ replayBinding: Type.TObject<{
250
+ stream: Type.TString;
251
+ consumerName: Type.TString;
252
+ }>;
253
+ }>>>;
254
+ }>;
255
+ }>;
256
+ export type InstalledGeneratedServiceParticipant = Static<typeof InstalledGeneratedServiceParticipantSchema>;
257
+ export declare const IsoDateSchema: Type.TCodec<Type.TString, Date>;
258
+ /** Schema for a bounded pagination request. */
259
+ export declare const PageRequestSchema: Type.TObject<{
260
+ offset: Type.TOptional<Type.TInteger>;
261
+ limit: Type.TInteger;
262
+ }>;
263
+ /** Bounded pagination request. */
264
+ export type PageRequest = Static<typeof PageRequestSchema>;
265
+ /** Create a schema for a bounded page response with typed entries. */
266
+ export declare function PageResponseSchema<TEntry extends TSchema>(entry: TEntry): Type.TObject<{
267
+ entries: Type.TArray<TEntry>;
268
+ count: Type.TInteger;
269
+ offset: Type.TInteger;
270
+ limit: Type.TInteger;
271
+ nextOffset: Type.TOptional<Type.TInteger>;
272
+ }>;
273
+ /** Bounded pagination response with typed entries. */
274
+ export type PageResponse<TEntry> = {
275
+ entries: TEntry[];
276
+ count: number;
277
+ offset: number;
278
+ limit: number;
279
+ nextOffset?: number;
280
+ };
281
+ /**
282
+ * Validates and normalizes an offset pagination query.
283
+ *
284
+ * Ensures `offset` and `limit` are non-negative integers within bounds. Throws
285
+ * `RangeError` on invalid input.
286
+ */
287
+ export declare function normalizePageQuery(query: PageRequest, maxLimit?: number): Required<PageRequest>;
288
+ /**
289
+ * Builds a {@link PageResponse} from a pre-sliced offset page.
290
+ *
291
+ * @param entries - The entries for the current page, already sliced by the caller.
292
+ * @param totalCount - Total number of matching entries before slicing.
293
+ * @param query - The original pagination query used to produce the page.
294
+ * @param maxLimit - Optional maximum limit accepted by the endpoint.
295
+ */
296
+ export declare function buildPageResponse<T>(entries: T[], totalCount: number, query: PageRequest, maxLimit?: number): PageResponse<T>;
297
+ /** Schema for a cursor pagination query. */
298
+ export declare const CursorQuerySchema: Type.TObject<{
299
+ cursor: Type.TOptional<Type.TString>;
300
+ limit: Type.TOptional<Type.TInteger>;
301
+ }>;
302
+ /** Cursor pagination query. */
303
+ export type CursorQuery = Static<typeof CursorQuerySchema>;
304
+ /** Schema for cursor pagination response metadata. */
305
+ export declare const CursorPageInfoSchema: Type.TObject<{
306
+ nextCursor: Type.TOptional<Type.TString>;
307
+ }>;
308
+ /** Cursor pagination response metadata. */
309
+ export type CursorPageInfo = Static<typeof CursorPageInfoSchema>;
310
+ /** TypeBox schema for a cursor page response with typed items. */
311
+ export type CursorPageResponseSchema<TItem extends TSchema> = TObject<{
312
+ items: TArray<TItem>;
313
+ page: typeof CursorPageInfoSchema;
314
+ }>;
315
+ /** Create a schema for a cursor page response with typed items. */
316
+ export declare function CursorPageSchema<TItem extends TSchema>(item: TItem): CursorPageResponseSchema<TItem>;
317
+ /** Cursor pagination response with typed items. */
318
+ export type CursorPage<TItem> = {
319
+ items: TItem[];
320
+ page: CursorPageInfo;
321
+ };
322
+ /** Options for normalizing a cursor pagination query. */
323
+ export type CursorQueryOptions = {
324
+ /** Limit used when the query does not specify one. Defaults to `100`. */
325
+ defaultLimit?: number;
326
+ /** Service-owned maximum accepted limit, when one applies. */
327
+ maxLimit?: number;
328
+ };
329
+ /** Cursor query after defaults and validation have been applied. */
330
+ export type NormalizedCursorQuery = {
331
+ cursor?: string;
332
+ limit: number;
333
+ };
334
+ /**
335
+ * Validates and normalizes a cursor pagination query.
336
+ *
337
+ * Defaults `limit` to `100`, applies an optional service-owned maximum, and
338
+ * preserves a non-empty optional cursor.
339
+ */
340
+ export declare function normalizeCursorQuery(query: CursorQuery, options?: CursorQueryOptions): NormalizedCursorQuery;
341
+ /**
342
+ * Builds a {@link CursorPage} from items and an optional next cursor.
343
+ *
344
+ * @param items - The items for the current page.
345
+ * @param nextCursor - Cursor clients can use to request the next page.
346
+ */
347
+ export declare function buildCursorPage<T>(items: T[], nextCursor?: string): CursorPage<T>;
@@ -0,0 +1,211 @@
1
+ import Type, {} from "typebox";
2
+ function parseIsoDate(value) {
3
+ const parsed = new Date(value);
4
+ if (Number.isNaN(parsed.getTime()) || parsed.toISOString() !== value) {
5
+ throw new TypeError(`Expected canonical ISO 8601 UTC date-time string, received '${value}'`);
6
+ }
7
+ return parsed;
8
+ }
9
+ function formatIsoDate(value) {
10
+ if (!(value instanceof Date) || Number.isNaN(value.getTime())) {
11
+ throw new TypeError("Expected a valid Date instance");
12
+ }
13
+ return value.toISOString();
14
+ }
15
+ const ContractSchemaRefSchema = Type.Object({
16
+ schema: Type.String({ minLength: 1 }),
17
+ });
18
+ export const ContractEventConsumersSchema = Type.Record(Type.String({ minLength: 1 }), Type.Object({
19
+ uses: Type.Optional(Type.Record(Type.String({ minLength: 1 }), Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }))),
20
+ self: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
21
+ replay: Type.Optional(Type.Union([
22
+ Type.Literal("new"),
23
+ Type.Literal("all"),
24
+ ])),
25
+ concurrency: Type.Optional(Type.Integer({ minimum: 1 })),
26
+ }));
27
+ export const KvResourceBindingSchema = Type.Object({
28
+ bucket: Type.String({ minLength: 1 }),
29
+ history: Type.Integer({ minimum: 1 }),
30
+ ttlMs: Type.Integer({ minimum: 0 }),
31
+ maxValueBytes: Type.Optional(Type.Integer({ minimum: 1 })),
32
+ });
33
+ export const StoreResourceBindingSchema = Type.Object({
34
+ name: Type.String({ minLength: 1 }),
35
+ ttlMs: Type.Integer({ minimum: 0 }),
36
+ maxObjectBytes: Type.Optional(Type.Integer({ minimum: 1 })),
37
+ maxTotalBytes: Type.Optional(Type.Integer({ minimum: 1 })),
38
+ });
39
+ export const JobsQueueKeyConcurrencyBindingSchema = Type.Object({
40
+ key: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
41
+ maxActive: Type.Integer({ minimum: 1 }),
42
+ heartbeatIntervalMs: Type.Integer({ minimum: 1 }),
43
+ heartbeatTtlMs: Type.Integer({ minimum: 1 }),
44
+ stalePolicy: Type.Union([
45
+ Type.Literal("fail-stale"),
46
+ Type.Literal("block"),
47
+ ]),
48
+ });
49
+ export const JobsQueueDepthBindingSchema = Type.Object({
50
+ maxQueuedPerKey: Type.Integer({ minimum: 0 }),
51
+ whenFull: Type.Union([
52
+ Type.Literal("reject"),
53
+ Type.Literal("coalesce"),
54
+ Type.Literal("replace-oldest"),
55
+ ]),
56
+ });
57
+ export const JobsQueueBindingSchema = Type.Object({
58
+ queueType: Type.String({ minLength: 1 }),
59
+ publishPrefix: Type.String({ minLength: 1 }),
60
+ workSubject: Type.String({ minLength: 1 }),
61
+ consumerName: Type.String({ minLength: 1 }),
62
+ payload: ContractSchemaRefSchema,
63
+ update: Type.Optional(ContractSchemaRefSchema),
64
+ updatesPrefix: Type.Optional(Type.String({ minLength: 1 })),
65
+ result: Type.Optional(ContractSchemaRefSchema),
66
+ maxDeliver: Type.Integer({ minimum: 1 }),
67
+ backoffMs: Type.Array(Type.Integer({ minimum: 0 })),
68
+ ackWaitMs: Type.Integer({ minimum: 1 }),
69
+ defaultDeadlineMs: Type.Optional(Type.Integer({ minimum: 1 })),
70
+ keyConcurrency: Type.Optional(JobsQueueKeyConcurrencyBindingSchema),
71
+ queue: Type.Optional(JobsQueueDepthBindingSchema),
72
+ });
73
+ export const JobsResourceBindingSchema = Type.Object({
74
+ serviceName: Type.String({ minLength: 1 }),
75
+ namespace: Type.String({ minLength: 1 }),
76
+ workStream: Type.Optional(Type.String({ minLength: 1 })),
77
+ queues: Type.Record(Type.String({ minLength: 1 }), JobsQueueBindingSchema),
78
+ });
79
+ export const EventConsumerResourceBindingSchema = Type.Object({
80
+ resourceId: Type.String({ minLength: 1 }),
81
+ stream: Type.String({ minLength: 1 }),
82
+ consumerName: Type.String({ minLength: 1 }),
83
+ filterSubjects: Type.Array(Type.String({ minLength: 1 })),
84
+ replay: Type.Union([Type.Literal("new"), Type.Literal("all")]),
85
+ concurrency: Type.Integer({ minimum: 1 }),
86
+ ackWaitMs: Type.Integer({ minimum: 1 }),
87
+ maxDeliver: Type.Integer({ minimum: 1 }),
88
+ backoffMs: Type.Array(Type.Integer({ minimum: 0 })),
89
+ replayBinding: Type.Object({
90
+ stream: Type.String({ minLength: 1 }),
91
+ consumerName: Type.String({ minLength: 1 }),
92
+ }),
93
+ });
94
+ export const ContractResourceBindingsSchema = Type.Object({
95
+ kv: Type.Optional(Type.Record(Type.String({ minLength: 1 }), KvResourceBindingSchema)),
96
+ store: Type.Optional(Type.Record(Type.String({ minLength: 1 }), StoreResourceBindingSchema)),
97
+ jobs: Type.Optional(JobsResourceBindingSchema),
98
+ eventConsumers: Type.Optional(Type.Record(Type.String({ minLength: 1 }), EventConsumerResourceBindingSchema)),
99
+ });
100
+ export const InstalledGeneratedServiceParticipantSchema = Type.Object({
101
+ contractId: Type.String({ minLength: 1 }),
102
+ digest: Type.String({ pattern: "^[A-Za-z0-9_-]+$" }),
103
+ resources: ContractResourceBindingsSchema,
104
+ });
105
+ export const IsoDateSchema = Type.Codec(Type.String({ format: "date-time" }))
106
+ .Decode((value) => parseIsoDate(value))
107
+ .Encode((value) => formatIsoDate(value));
108
+ /** Schema for a bounded pagination request. */
109
+ export const PageRequestSchema = Type.Object({
110
+ offset: Type.Optional(Type.Integer({ minimum: 0 })),
111
+ limit: Type.Integer({ minimum: 0 }),
112
+ });
113
+ /** Create a schema for a bounded page response with typed entries. */
114
+ export function PageResponseSchema(entry) {
115
+ return Type.Object({
116
+ entries: Type.Array(entry, { default: [] }),
117
+ count: Type.Integer({ minimum: 0 }),
118
+ offset: Type.Integer({ minimum: 0 }),
119
+ limit: Type.Integer({ minimum: 0 }),
120
+ nextOffset: Type.Optional(Type.Integer({ minimum: 0 })),
121
+ });
122
+ }
123
+ /**
124
+ * Validates and normalizes an offset pagination query.
125
+ *
126
+ * Ensures `offset` and `limit` are non-negative integers within bounds. Throws
127
+ * `RangeError` on invalid input.
128
+ */
129
+ export function normalizePageQuery(query, maxLimit = Number.MAX_SAFE_INTEGER) {
130
+ if (!Number.isInteger(query.limit) || query.limit < 0) {
131
+ throw new RangeError("list limit must be a non-negative integer");
132
+ }
133
+ if (query.limit > maxLimit) {
134
+ throw new RangeError(`list limit must be <= ${maxLimit}`);
135
+ }
136
+ const offset = query.offset ?? 0;
137
+ if (!Number.isInteger(offset) || offset < 0) {
138
+ throw new RangeError("list offset must be a non-negative integer");
139
+ }
140
+ return { offset, limit: query.limit };
141
+ }
142
+ /**
143
+ * Builds a {@link PageResponse} from a pre-sliced offset page.
144
+ *
145
+ * @param entries - The entries for the current page, already sliced by the caller.
146
+ * @param totalCount - Total number of matching entries before slicing.
147
+ * @param query - The original pagination query used to produce the page.
148
+ * @param maxLimit - Optional maximum limit accepted by the endpoint.
149
+ */
150
+ export function buildPageResponse(entries, totalCount, query, maxLimit) {
151
+ const { offset, limit } = normalizePageQuery(query, maxLimit);
152
+ return {
153
+ entries,
154
+ count: totalCount,
155
+ offset,
156
+ limit,
157
+ nextOffset: limit <= 0 || offset + limit >= totalCount
158
+ ? undefined
159
+ : offset + limit,
160
+ };
161
+ }
162
+ /** Schema for a cursor pagination query. */
163
+ export const CursorQuerySchema = Type.Object({
164
+ cursor: Type.Optional(Type.String({ minLength: 1 })),
165
+ limit: Type.Optional(Type.Integer({ minimum: 1 })),
166
+ });
167
+ /** Schema for cursor pagination response metadata. */
168
+ export const CursorPageInfoSchema = Type.Object({
169
+ nextCursor: Type.Optional(Type.String({ minLength: 1 })),
170
+ });
171
+ /** Create a schema for a cursor page response with typed items. */
172
+ export function CursorPageSchema(item) {
173
+ return Type.Object({
174
+ items: Type.Array(item, { default: [] }),
175
+ page: CursorPageInfoSchema,
176
+ });
177
+ }
178
+ /**
179
+ * Validates and normalizes a cursor pagination query.
180
+ *
181
+ * Defaults `limit` to `100`, applies an optional service-owned maximum, and
182
+ * preserves a non-empty optional cursor.
183
+ */
184
+ export function normalizeCursorQuery(query, options = {}) {
185
+ const limit = query.limit ?? options.defaultLimit ?? 100;
186
+ if (!Number.isFinite(limit) || !Number.isInteger(limit) || limit <= 0) {
187
+ throw new RangeError("list limit must be a positive finite integer");
188
+ }
189
+ if (options.maxLimit !== undefined && limit > options.maxLimit) {
190
+ throw new RangeError(`list limit must be <= ${options.maxLimit}`);
191
+ }
192
+ if (query.cursor === undefined) {
193
+ return { limit };
194
+ }
195
+ if (query.cursor.length === 0) {
196
+ throw new RangeError("list cursor must be a non-empty string");
197
+ }
198
+ return { cursor: query.cursor, limit };
199
+ }
200
+ /**
201
+ * Builds a {@link CursorPage} from items and an optional next cursor.
202
+ *
203
+ * @param items - The items for the current page.
204
+ * @param nextCursor - Cursor clients can use to request the next page.
205
+ */
206
+ export function buildCursorPage(items, nextCursor) {
207
+ return {
208
+ items,
209
+ page: nextCursor === undefined ? {} : { nextCursor },
210
+ };
211
+ }
@@ -0,0 +1,16 @@
1
+ type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
2
+ type CharacterKind = "upper" | "lower" | "digit" | "separator";
3
+ type KindOf<TChar extends string> = TChar extends Digit ? "digit" : TChar extends Lowercase<TChar> ? TChar extends Uppercase<TChar> ? "separator" : "lower" : "upper";
4
+ type FirstKind<TValue extends string> = TValue extends `${infer TChar}${infer _Rest}` ? KindOf<TChar> : "separator";
5
+ type AppendSeparator<TValue extends string> = TValue extends "" ? "" : TValue extends `${string}_` ? TValue : `${TValue}_`;
6
+ type SnakeSurfaceName<TValue extends string, TPrevious extends CharacterKind = "separator", TOutput extends string = ""> = TValue extends `${infer TChar}${infer TRest}` ? KindOf<TChar> extends infer TKind extends CharacterKind ? TKind extends "separator" ? SnakeSurfaceName<TRest, "separator", AppendSeparator<TOutput>> : TKind extends "upper" ? SnakeSurfaceName<TRest, "upper", `${TOutput}${TOutput extends "" ? "" : TPrevious extends "separator" ? "" : TPrevious extends "lower" | "digit" ? "_" : FirstKind<TRest> extends "lower" ? "_" : ""}${Lowercase<TChar>}`> : SnakeSurfaceName<TRest, TKind, `${TOutput}${TChar}`> : never : TOutput extends `${infer TTrimmed}_` ? TTrimmed : TOutput;
7
+ type PascalFromSnake<TValue extends string> = TValue extends `${infer THead}_${infer TTail}` ? `${Capitalize<THead>}${PascalFromSnake<TTail>}` : Capitalize<TValue>;
8
+ /** The deterministic PascalCase identifier for a canonical surface name. */
9
+ export type PascalActionName<TName extends string> = PascalFromSnake<SnakeSurfaceName<TName>>;
10
+ /** The deterministic lowerCamelCase identifier for a canonical surface name. */
11
+ export type ConnectedActionName<TName extends string> = Uncapitalize<PascalActionName<TName>>;
12
+ /** Converts a canonical surface name to its acronym-aware PascalCase identifier. */
13
+ export declare function pascalSurfaceName(value: string): string;
14
+ /** Converts a canonical surface name to its acronym-aware lowerCamelCase identifier. */
15
+ export declare function lowerCamelSurfaceName(value: string): string;
16
+ export {};
@@ -0,0 +1,34 @@
1
+ function snakeSurfaceName(value) {
2
+ const chars = [...value];
3
+ let output = "";
4
+ let previousWasSeparator = false;
5
+ for (let index = 0; index < chars.length; index++) {
6
+ const char = chars[index];
7
+ if (/^[A-Za-z0-9]$/.test(char)) {
8
+ const previous = chars[index - 1];
9
+ const next = chars[index + 1];
10
+ const startsNewWord = /^[A-Z]$/.test(char) && output !== "" &&
11
+ !previousWasSeparator &&
12
+ (previous !== undefined && /^[a-z0-9]$/.test(previous) ||
13
+ next !== undefined && /^[a-z]$/.test(next));
14
+ if (startsNewWord)
15
+ output += "_";
16
+ output += char.toLowerCase();
17
+ previousWasSeparator = false;
18
+ }
19
+ else if (output !== "" && !previousWasSeparator) {
20
+ output += "_";
21
+ previousWasSeparator = true;
22
+ }
23
+ }
24
+ return output.replace(/_$/, "");
25
+ }
26
+ /** Converts a canonical surface name to its acronym-aware PascalCase identifier. */
27
+ export function pascalSurfaceName(value) {
28
+ return snakeSurfaceName(value).split("_").filter(Boolean).map((word) => word[0].toUpperCase() + word.slice(1)).join("");
29
+ }
30
+ /** Converts a canonical surface name to its acronym-aware lowerCamelCase identifier. */
31
+ export function lowerCamelSurfaceName(value) {
32
+ const pascal = pascalSurfaceName(value);
33
+ return pascal[0] ? pascal[0].toLowerCase() + pascal.slice(1) : "";
34
+ }
package/portable.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ /** Shared portable application API for native and browser entrypoints. */
2
+ export { classifyBrowserAuthError, createAuth, isRecoverableBrowserAuthError, } from "./auth.ts";
3
+ export type { BrowserAuthRecoveryClassification, BrowserAuthRecoveryKind, NatsConnectOptions, } from "./auth.ts";
4
+ export { isJsonValue } from "./participant.ts";
5
+ export type { InferSchemaType, JsonValue } from "./participant.ts";
6
+ export { TrellisConnection } from "./connection.ts";
7
+ export type { TrellisConnectionStatus } from "./connection.ts";
8
+ export { buildCursorPage, buildPageResponse, CursorPageInfoSchema, CursorPageSchema, CursorQuerySchema, normalizeCursorQuery, normalizePageQuery, PageRequestSchema, PageResponseSchema, } from "./participant.ts";
9
+ export type { CursorPage, CursorPageInfo, CursorPageResponseSchema, CursorQuery, CursorQueryOptions, InferRuntimeRpcError, NormalizedCursorQuery, PageRequest, PageResponse, RpcErrorClass, RuntimeRpcErrorDesc, SerializableErrorData, TrellisValidationExtension, TrellisValidationIssueHint, } from "./participant.ts";
10
+ export { AsyncResult, BaseError, err, isErr, isOk, ok, Result, } from "@oatscenter/result";
11
+ export type { MaybeAsync } from "@oatscenter/result";
12
+ export type { ClientOpts } from "./client.ts";
13
+ export type { CallerParticipant, CallerRuntime } from "./caller.ts";
14
+ export { PaginationError } from "./pagination.ts";
15
+ export { decodePaginationCursor, encodePaginationCursor, paginationQueryDigest, } from "./auth/protocol_wasm.ts";
16
+ export type { PaginationErrorData } from "./pagination.ts";
17
+ export type { ClientAuthContinuation, ClientAuthOptions, ClientAuthRequiredContext, ClientResourceMigrations, ConnectedTrellisClient, TrellisClientConnectArgs, } from "./client_connect.ts";
18
+ export { ClientAuthHandledError, TrellisClient } from "./client_connect.ts";
19
+ export type { KvWatchItem, ResourceRevision, TypedKvEntry } from "./kv.ts";
20
+ export type { TrellisErrorInstance } from "./errors/index.ts";
21
+ export { AuthError, KVError, OperationAlreadyTerminalError, OperationMismatchError, OperationNotFoundError, RemoteError, StoreError, TransferError, TransportError, TrellisError, UnexpectedError, ValidationError, } from "./errors/index.ts";
22
+ export { TypedStoreEntry } from "./store_entry.ts";
23
+ export type { StoreBody, StoreInfo, StoreListOptions, StoreListPage, StoreOpenOptions, StorePutOptions, StoreStatus, StoreWaitOptions, } from "./store.ts";
24
+ export { FileInfoSchema, TransferGrantSchema } from "./transfer.ts";
25
+ export type { FileInfo, ReceiveTransferGrant, ReceiveTransferHandle, SendTransferGrant, SendTransferHandle, TransferBody, TransferGrant, } from "./transfer.ts";
26
+ export type { AcceptedOperationEvent, CancelledOperationEvent, CompletedOperationEvent, CompletedTransfer, FailedOperationEvent, OperationControlError, OperationEvent, OperationInputBuilder, OperationLifecycleError, OperationObserverCallbacks, OperationRef, OperationRefData, OperationSignalAck, OperationSnapshot, OperationStartOptions, OperationState, OperationTransferProgress, OperationWatchOptions, ProgressOperationEvent, ProgressOperationSnapshot, StartedOperationEvent, StartedTransfer, TerminalOperation, TransferCapableOperationInputBuilder, TransferOperationBuilder, TransferOperationEvent, TransferOperationSnapshot, UpdateOperationEvent, } from "./operations.ts";
27
+ export { controlSubject, OperationInvoker } from "./operations.ts";
28
+ export type { AcceptedOperation, EventListenerContext, EventName, EventOpts, EventPayload, EventType, FeedInputBuilder, FeedSubscribeOpts, FeedSubscription, HandlerJobQueue, HandlerJobsFacade, HandlerKvFacade, HandlerStoreHandle, HandlerTrellis, HandlerTrellisForContract, InternalCaller, OperationHandlerContext, OperationHandlerErrorOf, OperationRegistration, OperationRuntimeHandle, OperationTransferContextOf, OperationTransferHandle, OperationUpdateOf, PreparedTrellisEvent, RequestOpts, RpcHandlerContext, RpcInputOf, RpcMethodNameOf, RpcOutputOf, RpcRequestErrorOf, RuntimeStateStoresForContract, RuntimeStateStoreShape, SessionCaller, StateFacade, TrellisEventHeader, TrellisEventMessage, ValueStateStoreClient, VerifiedCaller, } from "./session.ts";
29
+ export { ResourceUnavailableError, StateConflictError } from "./session.ts";
30
+ export type { TrellisAuth } from "./session.ts";
package/portable.js ADDED
@@ -0,0 +1,14 @@
1
+ /** Shared portable application API for native and browser entrypoints. */
2
+ export { classifyBrowserAuthError, createAuth, isRecoverableBrowserAuthError, } from "./auth.js";
3
+ export { isJsonValue } from "./participant.js";
4
+ export { TrellisConnection } from "./connection.js";
5
+ export { buildCursorPage, buildPageResponse, CursorPageInfoSchema, CursorPageSchema, CursorQuerySchema, normalizeCursorQuery, normalizePageQuery, PageRequestSchema, PageResponseSchema, } from "./participant.js";
6
+ export { AsyncResult, BaseError, err, isErr, isOk, ok, Result, } from "@oatscenter/result";
7
+ export { PaginationError } from "./pagination.js";
8
+ export { decodePaginationCursor, encodePaginationCursor, paginationQueryDigest, } from "./auth/protocol_wasm.js";
9
+ export { ClientAuthHandledError, TrellisClient } from "./client_connect.js";
10
+ export { AuthError, KVError, OperationAlreadyTerminalError, OperationMismatchError, OperationNotFoundError, RemoteError, StoreError, TransferError, TransportError, TrellisError, UnexpectedError, ValidationError, } from "./errors/index.js";
11
+ export { TypedStoreEntry } from "./store_entry.js";
12
+ export { FileInfoSchema, TransferGrantSchema } from "./transfer.js";
13
+ export { controlSubject, OperationInvoker } from "./operations.js";
14
+ export { ResourceUnavailableError, StateConflictError } from "./session.js";