@casual-simulation/aux-records 3.8.1 → 3.10.2

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 (239) hide show
  1. package/AIChatInterface.d.ts +7 -43
  2. package/AIChatInterface.js +8 -6
  3. package/AIChatInterface.js.map +1 -1
  4. package/AIController.js +44 -49
  5. package/AIController.js.map +1 -1
  6. package/AIOpenAIRealtimeInterface.d.ts +1 -1
  7. package/AnthropicAIChatInterface.js +4 -4
  8. package/AnthropicAIChatInterface.js.map +1 -1
  9. package/AuthController.d.ts +78 -10
  10. package/AuthController.js +230 -166
  11. package/AuthController.js.map +1 -1
  12. package/AuthStore.d.ts +317 -4
  13. package/BigIntPatch.d.ts +1 -0
  14. package/BigIntPatch.js +24 -0
  15. package/BigIntPatch.js.map +1 -0
  16. package/BlockadeLabsGenerateSkyboxInterface.js +4 -4
  17. package/BlockadeLabsGenerateSkyboxInterface.js.map +1 -1
  18. package/CachingConfigStore.d.ts +8 -1
  19. package/CachingConfigStore.js +50 -0
  20. package/CachingConfigStore.js.map +1 -1
  21. package/ComIdConfig.d.ts +132 -86
  22. package/ComIdConfig.js +5 -5
  23. package/ComIdConfig.js.map +1 -1
  24. package/ConfigurationStore.d.ts +1393 -3
  25. package/ConfigurationStore.js +49 -0
  26. package/ConfigurationStore.js.map +1 -1
  27. package/DataRecordsController.js +28 -28
  28. package/DataRecordsController.js.map +1 -1
  29. package/EventRecordsController.js +9 -9
  30. package/EventRecordsController.js.map +1 -1
  31. package/FileRecordsController.js +18 -17
  32. package/FileRecordsController.js.map +1 -1
  33. package/GoogleAIChatInterface.js +4 -4
  34. package/GoogleAIChatInterface.js.map +1 -1
  35. package/HttpTestUtils.d.ts +48 -0
  36. package/HttpTestUtils.js +256 -0
  37. package/HttpTestUtils.js.map +1 -0
  38. package/LivekitController.js +2 -2
  39. package/LivekitController.js.map +1 -1
  40. package/LoomController.js +3 -4
  41. package/LoomController.js.map +1 -1
  42. package/MemoryStore.d.ts +60 -7
  43. package/MemoryStore.js +427 -59
  44. package/MemoryStore.js.map +1 -1
  45. package/MetricsStore.d.ts +11 -0
  46. package/ModerationConfiguration.d.ts +11 -85
  47. package/ModerationConfiguration.js +17 -17
  48. package/ModerationConfiguration.js.map +1 -1
  49. package/ModerationController.js +9 -11
  50. package/ModerationController.js.map +1 -1
  51. package/OpenAIChatInterface.js +8 -13
  52. package/OpenAIChatInterface.js.map +1 -1
  53. package/OpenAIImageInterface.js +4 -5
  54. package/OpenAIImageInterface.js.map +1 -1
  55. package/PolicyController.js +66 -73
  56. package/PolicyController.js.map +1 -1
  57. package/PolicyStore.d.ts +59 -33
  58. package/PolicyStore.js +35 -1
  59. package/PolicyStore.js.map +1 -1
  60. package/PrivoClient.d.ts +3 -1
  61. package/PrivoClient.js +2 -4
  62. package/PrivoClient.js.map +1 -1
  63. package/PrivoConfiguration.d.ts +6 -72
  64. package/PrivoConfiguration.js +30 -31
  65. package/PrivoConfiguration.js.map +1 -1
  66. package/README.md +276 -2
  67. package/RateLimitController.js +2 -2
  68. package/RateLimitController.js.map +1 -1
  69. package/RecordsClient.d.ts +3 -1
  70. package/RecordsClient.js +6 -6
  71. package/RecordsClient.js.map +1 -1
  72. package/RecordsController.d.ts +145 -3
  73. package/RecordsController.js +399 -61
  74. package/RecordsController.js.map +1 -1
  75. package/RecordsServer.d.ts +1932 -1109
  76. package/RecordsStore.d.ts +99 -14
  77. package/RecordsStore.js +8 -10
  78. package/RecordsStore.js.map +1 -1
  79. package/ServerConfig.d.ts +698 -9867
  80. package/ServerConfig.js +457 -377
  81. package/ServerConfig.js.map +1 -1
  82. package/SloydInterface.js +1 -1
  83. package/SloydInterface.js.map +1 -1
  84. package/StabilityAIImageInterface.js +6 -9
  85. package/StabilityAIImageInterface.js.map +1 -1
  86. package/StripeInterface.d.ts +431 -287
  87. package/StripeInterface.js +21 -1
  88. package/StripeInterface.js.map +1 -1
  89. package/SubscriptionConfigBuilder.d.ts +10 -1
  90. package/SubscriptionConfigBuilder.js +72 -41
  91. package/SubscriptionConfigBuilder.js.map +1 -1
  92. package/SubscriptionConfiguration.d.ts +606 -6334
  93. package/SubscriptionConfiguration.js +460 -277
  94. package/SubscriptionConfiguration.js.map +1 -1
  95. package/SubscriptionController.d.ts +677 -4
  96. package/SubscriptionController.js +2986 -186
  97. package/SubscriptionController.js.map +1 -1
  98. package/SystemNotificationMessenger.d.ts +14 -70
  99. package/SystemNotificationMessenger.js +17 -20
  100. package/SystemNotificationMessenger.js.map +1 -1
  101. package/TestUtils.d.ts +18 -3
  102. package/TestUtils.js +84 -8
  103. package/TestUtils.js.map +1 -1
  104. package/TypeUtils.d.ts +991 -0
  105. package/TypeUtils.js +2 -0
  106. package/TypeUtils.js.map +1 -0
  107. package/Utils.d.ts +59 -0
  108. package/Utils.js +507 -3
  109. package/Utils.js.map +1 -1
  110. package/Validations.d.ts +24 -108
  111. package/Validations.js +62 -45
  112. package/Validations.js.map +1 -1
  113. package/ViewTemplateRenderer.d.ts +39 -0
  114. package/ViewTemplateRenderer.js +19 -0
  115. package/ViewTemplateRenderer.js.map +1 -0
  116. package/contracts/ContractRecordsController.d.ts +58 -0
  117. package/contracts/ContractRecordsController.js +144 -0
  118. package/contracts/ContractRecordsController.js.map +1 -0
  119. package/contracts/ContractRecordsStore.d.ts +285 -0
  120. package/contracts/ContractRecordsStore.js +19 -0
  121. package/contracts/ContractRecordsStore.js.map +1 -0
  122. package/contracts/MemoryContractRecordsStore.d.ts +27 -0
  123. package/contracts/MemoryContractRecordsStore.js +124 -0
  124. package/contracts/MemoryContractRecordsStore.js.map +1 -0
  125. package/contracts/index.d.ts +4 -0
  126. package/contracts/index.js +21 -0
  127. package/contracts/index.js.map +1 -0
  128. package/crud/CrudHelpers.d.ts +25 -26
  129. package/crud/CrudHelpers.js +1 -1
  130. package/crud/CrudHelpers.js.map +1 -1
  131. package/crud/CrudRecordsController.js +13 -16
  132. package/crud/CrudRecordsController.js.map +1 -1
  133. package/crud/CrudRecordsControllerTests.d.ts +2 -2
  134. package/crud/CrudRecordsControllerTests.js +605 -580
  135. package/crud/CrudRecordsControllerTests.js.map +1 -1
  136. package/crud/MemoryCrudRecordsStore.js +1 -2
  137. package/crud/MemoryCrudRecordsStore.js.map +1 -1
  138. package/crud/sub/MemorySubCrudRecordsStore.js +4 -6
  139. package/crud/sub/MemorySubCrudRecordsStore.js.map +1 -1
  140. package/crud/sub/SubCrudRecordsController.js +8 -8
  141. package/crud/sub/SubCrudRecordsController.js.map +1 -1
  142. package/database/DatabaseRecordsController.js +1 -2
  143. package/database/DatabaseRecordsController.js.map +1 -1
  144. package/database/SqliteDatabaseInterface.js +1 -2
  145. package/database/SqliteDatabaseInterface.js.map +1 -1
  146. package/dns/DNSDomainNameValidator.d.ts +11 -0
  147. package/dns/DNSDomainNameValidator.js +59 -0
  148. package/dns/DNSDomainNameValidator.js.map +1 -0
  149. package/dns/DomainNameValidator.d.ts +36 -0
  150. package/dns/DomainNameValidator.js +19 -0
  151. package/dns/DomainNameValidator.js.map +1 -0
  152. package/dns/index.d.ts +3 -0
  153. package/dns/index.js +20 -0
  154. package/dns/index.js.map +1 -0
  155. package/financial/FinancialController.d.ts +272 -0
  156. package/financial/FinancialController.js +762 -0
  157. package/financial/FinancialController.js.map +1 -0
  158. package/financial/FinancialInterface.d.ts +352 -0
  159. package/financial/FinancialInterface.js +642 -0
  160. package/financial/FinancialInterface.js.map +1 -0
  161. package/financial/FinancialStore.d.ts +186 -0
  162. package/financial/FinancialStore.js +19 -0
  163. package/financial/FinancialStore.js.map +1 -0
  164. package/financial/MemoryFinancialInterface.d.ts +23 -0
  165. package/financial/MemoryFinancialInterface.js +592 -0
  166. package/financial/MemoryFinancialInterface.js.map +1 -0
  167. package/financial/TigerBeetleFinancialInterface.d.ts +46 -0
  168. package/financial/TigerBeetleFinancialInterface.js +109 -0
  169. package/financial/TigerBeetleFinancialInterface.js.map +1 -0
  170. package/financial/TigerBeetleTestUtils.d.ts +40 -0
  171. package/financial/TigerBeetleTestUtils.js +185 -0
  172. package/financial/TigerBeetleTestUtils.js.map +1 -0
  173. package/financial/Types.d.ts +1 -0
  174. package/financial/Types.js +801 -0
  175. package/financial/Types.js.map +1 -0
  176. package/financial/index.d.ts +6 -0
  177. package/financial/index.js +24 -0
  178. package/financial/index.js.map +1 -0
  179. package/index.d.ts +4 -0
  180. package/index.js +3 -0
  181. package/index.js.map +1 -1
  182. package/notifications/NotificationRecordsController.js +14 -14
  183. package/notifications/NotificationRecordsController.js.map +1 -1
  184. package/notifications/WebPushInterface.d.ts +24 -155
  185. package/notifications/WebPushInterface.js +2 -2
  186. package/notifications/WebPushInterface.js.map +1 -1
  187. package/package.json +72 -70
  188. package/packages/version/MemoryPackageVersionRecordsStore.js +12 -15
  189. package/packages/version/MemoryPackageVersionRecordsStore.js.map +1 -1
  190. package/packages/version/PackageVersionRecordsController.d.ts +19 -0
  191. package/packages/version/PackageVersionRecordsController.js +102 -22
  192. package/packages/version/PackageVersionRecordsController.js.map +1 -1
  193. package/packages/version/PackageVersionRecordsStore.js +6 -8
  194. package/packages/version/PackageVersionRecordsStore.js.map +1 -1
  195. package/purchasable-items/MemoryPurchasableItemRecordsStore.d.ts +7 -0
  196. package/purchasable-items/MemoryPurchasableItemRecordsStore.js +33 -0
  197. package/purchasable-items/MemoryPurchasableItemRecordsStore.js.map +1 -0
  198. package/purchasable-items/PurchasableItemRecordsController.d.ts +16 -0
  199. package/purchasable-items/PurchasableItemRecordsController.js +72 -0
  200. package/purchasable-items/PurchasableItemRecordsController.js.map +1 -0
  201. package/purchasable-items/PurchasableItemRecordsStore.d.ts +66 -0
  202. package/purchasable-items/PurchasableItemRecordsStore.js +2 -0
  203. package/purchasable-items/PurchasableItemRecordsStore.js.map +1 -0
  204. package/purchasable-items/index.d.ts +4 -0
  205. package/purchasable-items/index.js +21 -0
  206. package/purchasable-items/index.js.map +1 -0
  207. package/queue/MemoryQueue.js +1 -1
  208. package/queue/MemoryQueue.js.map +1 -1
  209. package/search/MemorySearchInterface.js +1 -2
  210. package/search/MemorySearchInterface.js.map +1 -1
  211. package/search/SearchRecordsController.d.ts +66 -244
  212. package/search/SearchRecordsController.js +35 -36
  213. package/search/SearchRecordsController.js.map +1 -1
  214. package/search/SearchSyncProcessor.d.ts +7 -83
  215. package/search/TypesenseSearchInterface.js +8 -11
  216. package/search/TypesenseSearchInterface.js.map +1 -1
  217. package/tracing/TracingDecorators.js +5 -8
  218. package/tracing/TracingDecorators.js.map +1 -1
  219. package/webhooks/WebhookEnvironment.d.ts +36 -560
  220. package/webhooks/WebhookEnvironment.js +1 -1
  221. package/webhooks/WebhookEnvironment.js.map +1 -1
  222. package/webhooks/WebhookRecordsController.js +14 -16
  223. package/webhooks/WebhookRecordsController.js.map +1 -1
  224. package/websockets/MemoryLockStore.d.ts +18 -0
  225. package/websockets/MemoryLockStore.js +2 -0
  226. package/websockets/MemoryLockStore.js.map +1 -0
  227. package/websockets/MemoryTempInstRecordsStore.js +15 -27
  228. package/websockets/MemoryTempInstRecordsStore.js.map +1 -1
  229. package/websockets/MemoryWebsocketConnectionStore.js +6 -8
  230. package/websockets/MemoryWebsocketConnectionStore.js.map +1 -1
  231. package/websockets/MemoryWebsocketMessenger.js +1 -2
  232. package/websockets/MemoryWebsocketMessenger.js.map +1 -1
  233. package/websockets/SplitInstRecordsStore.js +2 -2
  234. package/websockets/SplitInstRecordsStore.js.map +1 -1
  235. package/websockets/WebsocketController.d.ts +5 -0
  236. package/websockets/WebsocketController.js +122 -83
  237. package/websockets/WebsocketController.js.map +1 -1
  238. package/RecordsServer.js +0 -6435
  239. package/RecordsServer.js.map +0 -1
@@ -0,0 +1,186 @@
1
+ import type { PartialExcept } from '../crud';
2
+ export interface FinancialStore {
3
+ /**
4
+ * Gets the financial account with the given ID.
5
+ * @param id The ID of the account to get.
6
+ */
7
+ getAccountById(id: string): Promise<FinancialAccount | null>;
8
+ /**
9
+ * Gets the financial account with the given filter.
10
+ * @param filter The filter to use. Must specify one of userId, studioId, or contractId and also specify the ledger.
11
+ */
12
+ getAccountByFilter(filter: UniqueFinancialAccountFilter): Promise<FinancialAccount | null>;
13
+ /**
14
+ * Gets a list of financial accounts by the given filter.
15
+ * @param filter The filter to use.
16
+ */
17
+ listAccounts(filter: FinancialAccountFilter): Promise<FinancialAccount[]>;
18
+ /**
19
+ * Saves the given financial account in the store.
20
+ * @param account The account to save.
21
+ */
22
+ createAccount(account: FinancialAccount): Promise<void>;
23
+ /**
24
+ * Creates a new external payout.
25
+ * @param payout The payout to create.
26
+ */
27
+ createExternalPayout(payout: ExternalPayout): Promise<void>;
28
+ /**
29
+ * Marks a payout as posted.
30
+ * @param payoutId The ID of the payout to mark as posted.
31
+ * @param postedTransferId The ID of the transfer that posted the payout.
32
+ * @param postedAtMs The time that the payout was posted at in milliseconds since epoch.
33
+ */
34
+ markPayoutAsPosted(payoutId: string, postedTransferId: string, postedAtMs: number): Promise<void>;
35
+ /**
36
+ * Marks a payout as voided.
37
+ * @param payoutId The ID of the payout to mark as voided.
38
+ * @param voidedTransferId The ID of the transfer that voided the payout.
39
+ * @param voidedAtMs The time that the payout was voided at in milliseconds since epoch.
40
+ */
41
+ markPayoutAsVoided(payoutId: string, voidedTransferId: string, voidedAtMs: number): Promise<void>;
42
+ /**
43
+ * Updates the given external payout.
44
+ * @param payout The payout to update.
45
+ */
46
+ updateExternalPayout(payout: PartialExcept<ExternalPayout, 'id'>): Promise<void>;
47
+ }
48
+ export interface UniqueFinancialAccountFilter {
49
+ /**
50
+ * The user ID to filter by.
51
+ */
52
+ userId?: string;
53
+ /**
54
+ * The studio ID to filter by.
55
+ */
56
+ studioId?: string;
57
+ /**
58
+ * The contract ID to filter by.
59
+ */
60
+ contractId?: string;
61
+ /**
62
+ * The ledger to filter by.
63
+ */
64
+ ledger: number;
65
+ }
66
+ export interface FinancialAccountFilter {
67
+ /**
68
+ * The user ID to filter by.
69
+ */
70
+ userId?: string;
71
+ /**
72
+ * The studio ID to filter by.
73
+ */
74
+ studioId?: string;
75
+ /**
76
+ * The contract ID to filter by.
77
+ */
78
+ contractId?: string;
79
+ /**
80
+ * The ledger to filter by.
81
+ */
82
+ ledger?: number;
83
+ }
84
+ /**
85
+ * Represents a financial account in the system.
86
+ */
87
+ export interface FinancialAccount {
88
+ /**
89
+ * The ID of the account.
90
+ */
91
+ id: string;
92
+ /**
93
+ * The ID of the user that this account is held by.
94
+ * If null, then this account is not held by a user.
95
+ */
96
+ userId?: string | null;
97
+ /**
98
+ * The ID of the studio that this account is held by.
99
+ * If null, then this account is not held by a studio.
100
+ */
101
+ studioId?: string | null;
102
+ /**
103
+ * The ID of the contract that this account is held by.
104
+ * If null, then this account is not held by a contract.
105
+ */
106
+ contractId?: string | null;
107
+ /**
108
+ * The ledger that this account is for.
109
+ */
110
+ ledger: number;
111
+ /**
112
+ * The currency that this account is tracked in.
113
+ * Always matches the currency of the ledger.
114
+ */
115
+ currency: string;
116
+ }
117
+ export interface ExternalPayout {
118
+ /**
119
+ * The ID of the payout.
120
+ */
121
+ id: string;
122
+ /**
123
+ * The ID of the invoice that the payout is for.
124
+ */
125
+ invoiceId?: string;
126
+ /**
127
+ * The ID of the user that the payout is for.
128
+ */
129
+ userId?: string;
130
+ /**
131
+ * The ID of the studio that the payout is for.
132
+ */
133
+ studioId?: string;
134
+ /**
135
+ * The ID of the transfer that makes the payout.
136
+ */
137
+ transferId: string;
138
+ /**
139
+ * The ID of the transaction that this payout is part of.
140
+ */
141
+ transactionId: string;
142
+ /**
143
+ * The ID of the stripe transfer that is associated with this payout.
144
+ */
145
+ stripeTransferId?: string;
146
+ /**
147
+ * The ID of the Stripe account that the payout is sent to.
148
+ */
149
+ destinationStripeAccountId?: string;
150
+ /**
151
+ * The destination that the payout is sent to.
152
+ */
153
+ externalDestination: PayoutDestination;
154
+ /**
155
+ * The amount of the payout.
156
+ */
157
+ amount: number;
158
+ /**
159
+ * The ID of the transfer that posts the payout.
160
+ */
161
+ postedTransferId?: string;
162
+ /**
163
+ * The ID of the transfer that voids the payout.
164
+ */
165
+ voidedTransferId?: string;
166
+ /**
167
+ * The time that the payout was initiated at in milliseconds since epoch.
168
+ */
169
+ initatedAtMs: number;
170
+ /**
171
+ * The time that the payout was posted at in milliseconds since epoch.
172
+ */
173
+ postedAtMs?: number;
174
+ /**
175
+ * The time that the payout was voided at in milliseconds since epoch.
176
+ */
177
+ voidedAtMs?: number;
178
+ }
179
+ /**
180
+ * The list of possible payout destinations.
181
+ *
182
+ * - `stripe` indicates that the payout should be sent to the user's Stripe account.
183
+ * - `cash` indicates that the payout was sent as cash (e.g. check, manual bank transfer, cash, etc.)
184
+ */
185
+ export type PayoutDestination = 'stripe' | 'cash';
186
+ //# sourceMappingURL=FinancialStore.d.ts.map
@@ -0,0 +1,19 @@
1
+ /* CasualOS is a set of web-based tools designed to facilitate the creation of real-time, multi-user, context-aware interactive experiences.
2
+ *
3
+ * Copyright (c) 2019-2025 Casual Simulation, Inc.
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Affero General Public License as
7
+ * published by the Free Software Foundation, either version 3 of the
8
+ * License, or (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ export {};
19
+ //# sourceMappingURL=FinancialStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FinancialStore.js","sourceRoot":"","sources":["FinancialStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
@@ -0,0 +1,23 @@
1
+ import type { FinancialInterface } from './FinancialInterface';
2
+ import type { Account, AccountBalance, AccountFilter, CreateAccountsError, CreateTransfersError, QueryFilter, Transfer } from 'tigerbeetle-node';
3
+ export declare class MemoryFinancialInterface implements FinancialInterface {
4
+ private _accounts;
5
+ private _balances;
6
+ private _transfers;
7
+ private _currentId;
8
+ get accounts(): Map<bigint, Account>;
9
+ get transfers(): Transfer[];
10
+ now(): bigint;
11
+ generateId(): bigint;
12
+ createAccount(account: Account): Promise<CreateAccountsError[]>;
13
+ createAccounts(batch: Account[]): Promise<CreateAccountsError[]>;
14
+ createTransfers(batch: Transfer[]): Promise<CreateTransfersError[]>;
15
+ private _recordBalance;
16
+ lookupAccounts(batch: Account['id'][]): Promise<Account[]>;
17
+ lookupTransfers(batch: Transfer['id'][]): Promise<Transfer[]>;
18
+ getAccountTransfers(filter: AccountFilter): Promise<Transfer[]>;
19
+ getAccountBalances(filter: AccountFilter): Promise<AccountBalance[]>;
20
+ queryAccounts(filter: QueryFilter): Promise<Account[]>;
21
+ queryTransfers(filter: QueryFilter): Promise<Transfer[]>;
22
+ }
23
+ //# sourceMappingURL=MemoryFinancialInterface.d.ts.map